main_2020_show.js 2.8 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262662636626466265662666626766268662696627066271662726627366274662756627666277662786627966280662816628266283662846628566286662876628866289662906629166292662936629466295662966629766298662996630066301663026630366304663056630666307663086630966310663116631266313663146631566316663176631866319663206632166322663236632466325663266632766328663296633066331663326633366334663356633666337663386633966340663416634266343663446634566346663476634866349663506635166352663536635466355663566635766358663596636066361663626636366364663656636666367663686636966370663716637266373663746637566376663776637866379663806638166382663836638466385663866638766388663896639066391663926639366394663956639666397663986639966400664016640266403664046640566406664076640866409664106641166412664136641466415664166641766418664196642066421664226642366424664256642666427664286642966430664316643266433664346643566436664376643866439664406644166442664436644466445664466644766448664496645066451664526645366454664556645666457664586645966460664616646266463664646646566466664676646866469664706647166472664736647466475664766647766478664796648066481664826648366484664856648666487664886648966490664916649266493664946649566496664976649866499665006650166502665036650466505665066650766508665096651066511665126651366514665156651666517665186651966520665216652266523665246652566526665276652866529665306653166532665336653466535665366653766538665396654066541665426654366544665456654666547665486654966550665516655266553665546655566556665576655866559665606656166562665636656466565665666656766568665696657066571665726657366574665756657666577665786657966580665816658266583665846658566586665876658866589665906659166592665936659466595665966659766598665996660066601666026660366604666056660666607666086660966610666116661266613666146661566616666176661866619666206662166622666236662466625666266662766628666296663066631666326663366634666356663666637666386663966640666416664266643666446664566646666476664866649666506665166652666536665466655666566665766658666596666066661666626666366664666656666666667666686666966670666716667266673666746667566676666776667866679666806668166682666836668466685666866668766688666896669066691666926669366694666956669666697666986669966700667016670266703667046670566706667076670866709667106671166712667136671466715667166671766718667196672066721667226672366724667256672666727667286672966730667316673266733667346673566736667376673866739667406674166742667436674466745667466674766748667496675066751667526675366754667556675666757667586675966760667616676266763667646676566766667676676866769667706677166772667736677466775667766677766778667796678066781667826678366784667856678666787667886678966790667916679266793667946679566796667976679866799668006680166802668036680466805668066680766808668096681066811668126681366814668156681666817668186681966820668216682266823668246682566826668276682866829668306683166832668336683466835668366683766838668396684066841668426684366844668456684666847668486684966850668516685266853668546685566856668576685866859668606686166862668636686466865668666686766868668696687066871668726687366874668756687666877668786687966880668816688266883668846688566886668876688866889668906689166892668936689466895668966689766898668996690066901669026690366904669056690666907669086690966910669116691266913669146691566916669176691866919669206692166922669236692466925669266692766928669296693066931669326693366934669356693666937669386693966940669416694266943669446694566946669476694866949669506695166952669536695466955669566695766958669596696066961669626696366964669656696666967669686696966970669716697266973669746697566976669776697866979669806698166982669836698466985669866698766988669896699066991669926699366994669956699666997669986699967000670016700267003670046700567006670076700867009670106701167012670136701467015670166701767018670196702067021670226702367024670256702667027670286702967030670316703267033670346703567036670376703867039670406704167042670436704467045670466704767048670496705067051670526705367054670556705667057670586705967060670616706267063670646706567066670676706867069670706707167072670736707467075670766707767078670796708067081670826708367084670856708667087670886708967090670916709267093670946709567096670976709867099671006710167102671036710467105671066710767108671096711067111671126711367114671156711667117671186711967120671216712267123671246712567126671276712867129671306713167132671336713467135671366713767138671396714067141671426714367144671456714667147671486714967150671516715267153671546715567156671576715867159671606716167162671636716467165671666716767168671696717067171671726717367174671756717667177671786717967180671816718267183671846718567186671876718867189671906719167192671936719467195671966719767198671996720067201672026720367204672056720667207672086720967210672116721267213672146721567216672176721867219672206722167222672236722467225672266722767228672296723067231672326723367234672356723667237672386723967240672416724267243672446724567246672476724867249672506725167252672536725467255672566725767258672596726067261672626726367264672656726667267672686726967270672716727267273672746727567276672776727867279672806728167282672836728467285672866728767288672896729067291672926729367294672956729667297672986729967300673016730267303673046730567306673076730867309673106731167312673136731467315673166731767318673196732067321673226732367324673256732667327673286732967330673316733267333673346733567336673376733867339673406734167342673436734467345673466734767348673496735067351673526735367354673556735667357673586735967360673616736267363673646736567366673676736867369673706737167372673736737467375673766737767378673796738067381673826738367384673856738667387673886738967390673916739267393673946739567396673976739867399674006740167402674036740467405674066740767408674096741067411674126741367414674156741667417674186741967420674216742267423674246742567426674276742867429674306743167432674336743467435674366743767438674396744067441674426744367444674456744667447674486744967450674516745267453674546745567456674576745867459674606746167462674636746467465674666746767468674696747067471674726747367474674756747667477674786747967480674816748267483674846748567486674876748867489674906749167492674936749467495674966749767498674996750067501675026750367504675056750667507675086750967510675116751267513675146751567516675176751867519675206752167522675236752467525675266752767528675296753067531675326753367534675356753667537675386753967540675416754267543675446754567546675476754867549675506755167552675536755467555675566755767558675596756067561675626756367564675656756667567675686756967570675716757267573675746757567576675776757867579675806758167582675836758467585675866758767588675896759067591675926759367594675956759667597675986759967600676016760267603676046760567606676076760867609676106761167612676136761467615676166761767618676196762067621676226762367624676256762667627676286762967630676316763267633676346763567636676376763867639676406764167642676436764467645676466764767648676496765067651676526765367654676556765667657676586765967660676616766267663676646766567666676676766867669676706767167672676736767467675676766767767678676796768067681676826768367684676856768667687676886768967690676916769267693676946769567696676976769867699677006770167702677036770467705677066770767708677096771067711677126771367714677156771667717677186771967720677216772267723677246772567726677276772867729677306773167732677336773467735677366773767738677396774067741677426774367744677456774667747677486774967750677516775267753677546775567756677576775867759677606776167762677636776467765677666776767768677696777067771677726777367774677756777667777677786777967780677816778267783677846778567786677876778867789677906779167792677936779467795677966779767798677996780067801678026780367804678056780667807678086780967810678116781267813678146781567816678176781867819678206782167822678236782467825678266782767828678296783067831678326783367834678356783667837678386783967840678416784267843678446784567846678476784867849678506785167852678536785467855678566785767858678596786067861678626786367864678656786667867678686786967870678716787267873678746787567876678776787867879678806788167882678836788467885678866788767888678896789067891678926789367894678956789667897678986789967900679016790267903679046790567906679076790867909679106791167912679136791467915679166791767918679196792067921679226792367924679256792667927679286792967930679316793267933679346793567936679376793867939679406794167942679436794467945679466794767948679496795067951679526795367954679556795667957679586795967960679616796267963679646796567966679676796867969679706797167972679736797467975679766797767978679796798067981679826798367984679856798667987679886798967990679916799267993679946799567996679976799867999680006800168002680036800468005680066800768008680096801068011680126801368014680156801668017680186801968020680216802268023680246802568026680276802868029680306803168032680336803468035680366803768038680396804068041680426804368044680456804668047680486804968050680516805268053680546805568056680576805868059680606806168062680636806468065680666806768068680696807068071680726807368074680756807668077680786807968080680816808268083680846808568086680876808868089680906809168092680936809468095680966809768098680996810068101681026810368104681056810668107681086810968110681116811268113681146811568116681176811868119681206812168122681236812468125681266812768128681296813068131681326813368134681356813668137681386813968140681416814268143681446814568146681476814868149681506815168152681536815468155681566815768158681596816068161681626816368164681656816668167681686816968170681716817268173681746817568176681776817868179681806818168182681836818468185681866818768188681896819068191681926819368194681956819668197681986819968200682016820268203682046820568206682076820868209682106821168212682136821468215682166821768218682196822068221682226822368224682256822668227682286822968230682316823268233682346823568236682376823868239682406824168242682436824468245682466824768248682496825068251682526825368254682556825668257682586825968260682616826268263682646826568266682676826868269682706827168272682736827468275682766827768278682796828068281682826828368284682856828668287682886828968290682916829268293682946829568296682976829868299683006830168302683036830468305683066830768308683096831068311683126831368314683156831668317683186831968320683216832268323683246832568326683276832868329683306833168332683336833468335683366833768338683396834068341683426834368344683456834668347683486834968350683516835268353683546835568356683576835868359683606836168362683636836468365683666836768368683696837068371683726837368374683756837668377683786837968380683816838268383683846838568386683876838868389683906839168392683936839468395683966839768398683996840068401684026840368404684056840668407684086840968410684116841268413684146841568416684176841868419684206842168422684236842468425684266842768428684296843068431684326843368434684356843668437684386843968440684416844268443684446844568446684476844868449684506845168452684536845468455684566845768458684596846068461684626846368464684656846668467684686846968470684716847268473684746847568476684776847868479684806848168482684836848468485684866848768488684896849068491684926849368494684956849668497684986849968500685016850268503685046850568506685076850868509685106851168512685136851468515685166851768518685196852068521685226852368524685256852668527685286852968530685316853268533685346853568536685376853868539685406854168542685436854468545685466854768548685496855068551685526855368554685556855668557685586855968560685616856268563685646856568566685676856868569685706857168572685736857468575685766857768578685796858068581685826858368584685856858668587685886858968590685916859268593685946859568596685976859868599686006860168602686036860468605686066860768608686096861068611686126861368614686156861668617686186861968620686216862268623686246862568626686276862868629686306863168632686336863468635686366863768638686396864068641686426864368644686456864668647686486864968650686516865268653686546865568656686576865868659686606866168662686636866468665686666866768668686696867068671686726867368674686756867668677686786867968680686816868268683686846868568686686876868868689686906869168692686936869468695686966869768698686996870068701687026870368704687056870668707687086870968710687116871268713687146871568716687176871868719687206872168722687236872468725687266872768728687296873068731687326873368734687356873668737687386873968740687416874268743687446874568746687476874868749687506875168752687536875468755687566875768758687596876068761687626876368764687656876668767687686876968770687716877268773687746877568776687776877868779687806878168782687836878468785687866878768788687896879068791687926879368794687956879668797687986879968800688016880268803688046880568806688076880868809688106881168812688136881468815688166881768818688196882068821688226882368824688256882668827688286882968830688316883268833688346883568836688376883868839688406884168842688436884468845688466884768848688496885068851688526885368854688556885668857688586885968860688616886268863688646886568866688676886868869688706887168872688736887468875688766887768878688796888068881688826888368884688856888668887688886888968890688916889268893688946889568896688976889868899689006890168902689036890468905689066890768908689096891068911689126891368914689156891668917689186891968920689216892268923689246892568926689276892868929689306893168932689336893468935689366893768938689396894068941689426894368944689456894668947689486894968950689516895268953689546895568956689576895868959689606896168962689636896468965689666896768968689696897068971689726897368974689756897668977689786897968980689816898268983689846898568986689876898868989689906899168992689936899468995689966899768998689996900069001690026900369004690056900669007690086900969010690116901269013690146901569016690176901869019690206902169022690236902469025690266902769028690296903069031690326903369034690356903669037690386903969040690416904269043690446904569046690476904869049690506905169052690536905469055690566905769058690596906069061690626906369064690656906669067690686906969070690716907269073690746907569076690776907869079690806908169082690836908469085690866908769088690896909069091690926909369094690956909669097690986909969100691016910269103691046910569106691076910869109691106911169112691136911469115691166911769118691196912069121691226912369124691256912669127691286912969130691316913269133691346913569136691376913869139691406914169142691436914469145691466914769148691496915069151691526915369154691556915669157691586915969160691616916269163691646916569166691676916869169691706917169172691736917469175691766917769178691796918069181691826918369184691856918669187691886918969190691916919269193691946919569196691976919869199692006920169202692036920469205692066920769208692096921069211692126921369214692156921669217692186921969220692216922269223692246922569226692276922869229692306923169232692336923469235692366923769238692396924069241692426924369244692456924669247692486924969250692516925269253692546925569256692576925869259692606926169262692636926469265692666926769268692696927069271692726927369274692756927669277692786927969280692816928269283692846928569286692876928869289692906929169292692936929469295692966929769298692996930069301693026930369304693056930669307693086930969310693116931269313693146931569316693176931869319693206932169322693236932469325693266932769328693296933069331693326933369334693356933669337693386933969340693416934269343693446934569346693476934869349693506935169352693536935469355693566935769358693596936069361693626936369364693656936669367693686936969370693716937269373693746937569376693776937869379693806938169382693836938469385693866938769388693896939069391693926939369394693956939669397693986939969400694016940269403694046940569406694076940869409694106941169412694136941469415694166941769418694196942069421694226942369424694256942669427694286942969430694316943269433694346943569436694376943869439694406944169442694436944469445694466944769448694496945069451694526945369454694556945669457694586945969460694616946269463694646946569466694676946869469694706947169472694736947469475694766947769478694796948069481694826948369484694856948669487694886948969490694916949269493694946949569496694976949869499695006950169502695036950469505695066950769508695096951069511695126951369514695156951669517695186951969520695216952269523695246952569526695276952869529695306953169532695336953469535695366953769538695396954069541695426954369544695456954669547695486954969550695516955269553695546955569556695576955869559695606956169562695636956469565695666956769568695696957069571695726957369574695756957669577695786957969580695816958269583695846958569586695876958869589695906959169592695936959469595695966959769598695996960069601696026960369604696056960669607696086960969610696116961269613696146961569616696176961869619696206962169622696236962469625696266962769628696296963069631696326963369634696356963669637696386963969640696416964269643696446964569646696476964869649696506965169652696536965469655696566965769658696596966069661696626966369664696656966669667696686966969670696716967269673696746967569676696776967869679696806968169682696836968469685696866968769688696896969069691696926969369694696956969669697696986969969700697016970269703697046970569706697076970869709697106971169712697136971469715697166971769718697196972069721697226972369724697256972669727697286972969730697316973269733697346973569736697376973869739697406974169742697436974469745697466974769748697496975069751697526975369754697556975669757697586975969760697616976269763697646976569766697676976869769697706977169772697736977469775697766977769778697796978069781697826978369784697856978669787697886978969790697916979269793697946979569796697976979869799698006980169802698036980469805698066980769808698096981069811698126981369814698156981669817698186981969820698216982269823698246982569826698276982869829698306983169832698336983469835698366983769838698396984069841698426984369844698456984669847698486984969850698516985269853698546985569856698576985869859698606986169862698636986469865698666986769868698696987069871698726987369874698756987669877698786987969880698816988269883698846988569886698876988869889698906989169892698936989469895698966989769898698996990069901699026990369904699056990669907699086990969910699116991269913699146991569916699176991869919699206992169922699236992469925699266992769928699296993069931699326993369934699356993669937699386993969940699416994269943699446994569946699476994869949699506995169952699536995469955699566995769958699596996069961699626996369964699656996669967699686996969970699716997269973699746997569976699776997869979699806998169982699836998469985699866998769988699896999069991699926999369994699956999669997699986999970000700017000270003700047000570006700077000870009700107001170012700137001470015700167001770018700197002070021700227002370024700257002670027700287002970030700317003270033700347003570036700377003870039700407004170042700437004470045700467004770048700497005070051700527005370054700557005670057700587005970060700617006270063700647006570066700677006870069700707007170072700737007470075700767007770078700797008070081700827008370084700857008670087700887008970090700917009270093700947009570096700977009870099701007010170102701037010470105701067010770108701097011070111701127011370114701157011670117701187011970120701217012270123701247012570126701277012870129701307013170132701337013470135701367013770138701397014070141701427014370144701457014670147701487014970150701517015270153701547015570156701577015870159701607016170162701637016470165701667016770168701697017070171701727017370174701757017670177701787017970180701817018270183701847018570186701877018870189701907019170192701937019470195701967019770198701997020070201702027020370204702057020670207702087020970210702117021270213702147021570216702177021870219702207022170222702237022470225702267022770228702297023070231702327023370234702357023670237702387023970240702417024270243702447024570246702477024870249702507025170252702537025470255702567025770258702597026070261702627026370264702657026670267702687026970270702717027270273702747027570276702777027870279702807028170282702837028470285702867028770288702897029070291702927029370294702957029670297702987029970300703017030270303703047030570306703077030870309703107031170312703137031470315703167031770318703197032070321703227032370324703257032670327703287032970330703317033270333703347033570336703377033870339703407034170342703437034470345703467034770348703497035070351703527035370354703557035670357703587035970360703617036270363703647036570366703677036870369703707037170372703737037470375703767037770378703797038070381703827038370384703857038670387703887038970390703917039270393703947039570396703977039870399704007040170402704037040470405704067040770408704097041070411704127041370414704157041670417704187041970420704217042270423704247042570426704277042870429704307043170432704337043470435704367043770438704397044070441704427044370444704457044670447704487044970450704517045270453704547045570456704577045870459704607046170462704637046470465704667046770468704697047070471704727047370474704757047670477704787047970480704817048270483704847048570486704877048870489704907049170492704937049470495704967049770498704997050070501705027050370504705057050670507705087050970510705117051270513705147051570516705177051870519705207052170522705237052470525705267052770528705297053070531705327053370534705357053670537705387053970540705417054270543705447054570546705477054870549705507055170552705537055470555705567055770558705597056070561705627056370564705657056670567705687056970570705717057270573705747057570576705777057870579705807058170582705837058470585705867058770588705897059070591705927059370594705957059670597705987059970600706017060270603706047060570606706077060870609706107061170612706137061470615706167061770618706197062070621706227062370624706257062670627706287062970630706317063270633706347063570636706377063870639706407064170642706437064470645706467064770648706497065070651706527065370654706557065670657706587065970660706617066270663706647066570666706677066870669706707067170672706737067470675706767067770678706797068070681706827068370684706857068670687706887068970690706917069270693706947069570696706977069870699707007070170702707037070470705707067070770708707097071070711707127071370714707157071670717707187071970720707217072270723707247072570726707277072870729707307073170732707337073470735707367073770738707397074070741707427074370744707457074670747707487074970750707517075270753707547075570756707577075870759707607076170762707637076470765707667076770768707697077070771707727077370774707757077670777707787077970780707817078270783707847078570786707877078870789707907079170792707937079470795707967079770798707997080070801708027080370804708057080670807708087080970810708117081270813708147081570816708177081870819708207082170822708237082470825708267082770828708297083070831708327083370834708357083670837708387083970840708417084270843708447084570846708477084870849708507085170852708537085470855708567085770858708597086070861708627086370864708657086670867708687086970870708717087270873708747087570876708777087870879708807088170882708837088470885708867088770888708897089070891708927089370894708957089670897708987089970900709017090270903709047090570906709077090870909709107091170912709137091470915709167091770918709197092070921709227092370924709257092670927709287092970930709317093270933709347093570936709377093870939709407094170942709437094470945709467094770948709497095070951709527095370954709557095670957709587095970960709617096270963709647096570966709677096870969709707097170972709737097470975709767097770978709797098070981709827098370984709857098670987709887098970990709917099270993709947099570996709977099870999710007100171002710037100471005710067100771008710097101071011710127101371014710157101671017710187101971020710217102271023710247102571026710277102871029710307103171032710337103471035710367103771038710397104071041710427104371044710457104671047710487104971050710517105271053710547105571056710577105871059710607106171062710637106471065710667106771068710697107071071710727107371074710757107671077710787107971080710817108271083710847108571086710877108871089710907109171092710937109471095710967109771098710997110071101711027110371104711057110671107711087110971110711117111271113711147111571116711177111871119711207112171122711237112471125711267112771128711297113071131711327113371134711357113671137711387113971140711417114271143711447114571146711477114871149711507115171152711537115471155711567115771158711597116071161711627116371164711657116671167711687116971170711717117271173711747117571176711777117871179711807118171182711837118471185711867118771188711897119071191711927119371194711957119671197711987119971200712017120271203712047120571206712077120871209712107121171212712137121471215712167121771218712197122071221712227122371224712257122671227712287122971230712317123271233712347123571236712377123871239712407124171242712437124471245712467124771248712497125071251712527125371254712557125671257712587125971260712617126271263712647126571266712677126871269712707127171272712737127471275712767127771278712797128071281712827128371284712857128671287712887128971290712917129271293712947129571296712977129871299713007130171302713037130471305713067130771308713097131071311713127131371314713157131671317713187131971320713217132271323713247132571326713277132871329713307133171332713337133471335713367133771338713397134071341713427134371344713457134671347713487134971350713517135271353713547135571356713577135871359713607136171362713637136471365713667136771368713697137071371713727137371374713757137671377713787137971380713817138271383713847138571386713877138871389713907139171392713937139471395713967139771398713997140071401714027140371404714057140671407714087140971410714117141271413714147141571416714177141871419714207142171422714237142471425714267142771428714297143071431714327143371434714357143671437714387143971440714417144271443714447144571446714477144871449714507145171452714537145471455714567145771458714597146071461714627146371464714657146671467714687146971470714717147271473714747147571476714777147871479714807148171482714837148471485714867148771488714897149071491714927149371494714957149671497714987149971500715017150271503715047150571506715077150871509715107151171512715137151471515715167151771518715197152071521715227152371524715257152671527715287152971530715317153271533715347153571536715377153871539715407154171542715437154471545715467154771548715497155071551715527155371554715557155671557715587155971560715617156271563715647156571566715677156871569715707157171572715737157471575715767157771578715797158071581715827158371584715857158671587715887158971590715917159271593715947159571596715977159871599716007160171602716037160471605716067160771608716097161071611716127161371614716157161671617716187161971620716217162271623716247162571626716277162871629716307163171632716337163471635716367163771638716397164071641716427164371644716457164671647716487164971650716517165271653716547165571656716577165871659716607166171662716637166471665716667166771668716697167071671716727167371674716757167671677716787167971680716817168271683716847168571686716877168871689716907169171692716937169471695716967169771698716997170071701717027170371704717057170671707717087170971710717117171271713717147171571716717177171871719717207172171722717237172471725717267172771728717297173071731717327173371734717357173671737717387173971740717417174271743717447174571746717477174871749717507175171752717537175471755717567175771758717597176071761717627176371764717657176671767717687176971770717717177271773717747177571776717777177871779717807178171782717837178471785717867178771788717897179071791717927179371794717957179671797717987179971800718017180271803718047180571806718077180871809718107181171812718137181471815718167181771818718197182071821718227182371824718257182671827718287182971830718317183271833718347183571836718377183871839718407184171842718437184471845718467184771848718497185071851718527185371854718557185671857718587185971860718617186271863718647186571866718677186871869718707187171872718737187471875718767187771878718797188071881718827188371884718857188671887718887188971890718917189271893718947189571896718977189871899719007190171902719037190471905719067190771908719097191071911719127191371914719157191671917719187191971920719217192271923719247192571926719277192871929719307193171932719337193471935719367193771938719397194071941719427194371944719457194671947719487194971950719517195271953719547195571956719577195871959719607196171962719637196471965719667196771968719697197071971719727197371974719757197671977719787197971980719817198271983719847198571986719877198871989719907199171992719937199471995719967199771998719997200072001720027200372004720057200672007720087200972010720117201272013720147201572016720177201872019720207202172022720237202472025720267202772028720297203072031720327203372034720357203672037720387203972040720417204272043720447204572046720477204872049720507205172052720537205472055720567205772058720597206072061720627206372064720657206672067720687206972070720717207272073720747207572076720777207872079720807208172082720837208472085720867208772088720897209072091720927209372094720957209672097720987209972100721017210272103721047210572106721077210872109721107211172112721137211472115721167211772118721197212072121721227212372124721257212672127721287212972130721317213272133721347213572136721377213872139721407214172142721437214472145721467214772148721497215072151721527215372154721557215672157721587215972160721617216272163721647216572166721677216872169721707217172172721737217472175721767217772178721797218072181721827218372184721857218672187721887218972190721917219272193721947219572196721977219872199722007220172202722037220472205722067220772208722097221072211722127221372214722157221672217722187221972220722217222272223722247222572226722277222872229722307223172232722337223472235722367223772238722397224072241722427224372244722457224672247722487224972250722517225272253722547225572256722577225872259722607226172262722637226472265722667226772268722697227072271722727227372274722757227672277722787227972280722817228272283722847228572286722877228872289722907229172292722937229472295722967229772298722997230072301723027230372304723057230672307723087230972310723117231272313723147231572316723177231872319723207232172322723237232472325723267232772328723297233072331723327233372334723357233672337723387233972340723417234272343723447234572346723477234872349723507235172352723537235472355723567235772358723597236072361723627236372364723657236672367723687236972370723717237272373723747237572376723777237872379723807238172382723837238472385723867238772388723897239072391723927239372394723957239672397723987239972400724017240272403724047240572406724077240872409724107241172412724137241472415724167241772418724197242072421724227242372424724257242672427724287242972430724317243272433724347243572436724377243872439724407244172442724437244472445724467244772448724497245072451724527245372454724557245672457724587245972460724617246272463724647246572466724677246872469724707247172472724737247472475724767247772478724797248072481724827248372484724857248672487724887248972490724917249272493724947249572496724977249872499725007250172502725037250472505725067250772508725097251072511725127251372514725157251672517725187251972520725217252272523725247252572526725277252872529725307253172532725337253472535725367253772538725397254072541725427254372544725457254672547725487254972550725517255272553725547255572556725577255872559725607256172562725637256472565725667256772568725697257072571725727257372574725757257672577725787257972580725817258272583725847258572586725877258872589725907259172592725937259472595725967259772598725997260072601726027260372604726057260672607726087260972610726117261272613726147261572616726177261872619726207262172622726237262472625726267262772628726297263072631726327263372634726357263672637726387263972640726417264272643726447264572646726477264872649726507265172652726537265472655726567265772658726597266072661726627266372664726657266672667726687266972670726717267272673726747267572676726777267872679726807268172682726837268472685726867268772688726897269072691726927269372694726957269672697726987269972700727017270272703727047270572706727077270872709727107271172712727137271472715727167271772718727197272072721727227272372724727257272672727727287272972730727317273272733727347273572736727377273872739727407274172742727437274472745727467274772748727497275072751727527275372754727557275672757727587275972760727617276272763727647276572766727677276872769727707277172772727737277472775727767277772778727797278072781727827278372784727857278672787727887278972790727917279272793727947279572796727977279872799728007280172802728037280472805728067280772808728097281072811728127281372814728157281672817728187281972820728217282272823728247282572826728277282872829728307283172832728337283472835728367283772838728397284072841728427284372844728457284672847728487284972850728517285272853728547285572856728577285872859728607286172862728637286472865728667286772868728697287072871728727287372874728757287672877728787287972880728817288272883728847288572886728877288872889728907289172892728937289472895728967289772898728997290072901729027290372904729057290672907729087290972910729117291272913729147291572916729177291872919729207292172922729237292472925729267292772928729297293072931729327293372934729357293672937729387293972940729417294272943729447294572946729477294872949729507295172952729537295472955729567295772958729597296072961729627296372964729657296672967729687296972970729717297272973729747297572976729777297872979729807298172982729837298472985729867298772988729897299072991729927299372994729957299672997729987299973000730017300273003730047300573006730077300873009730107301173012730137301473015730167301773018730197302073021730227302373024730257302673027730287302973030730317303273033730347303573036730377303873039730407304173042730437304473045730467304773048730497305073051730527305373054730557305673057730587305973060730617306273063730647306573066730677306873069730707307173072730737307473075730767307773078730797308073081730827308373084730857308673087730887308973090730917309273093730947309573096730977309873099731007310173102731037310473105731067310773108731097311073111731127311373114731157311673117731187311973120731217312273123731247312573126731277312873129731307313173132731337313473135731367313773138731397314073141731427314373144731457314673147731487314973150731517315273153731547315573156731577315873159731607316173162731637316473165731667316773168731697317073171731727317373174731757317673177731787317973180731817318273183731847318573186731877318873189731907319173192731937319473195731967319773198731997320073201732027320373204732057320673207732087320973210732117321273213732147321573216732177321873219732207322173222732237322473225732267322773228732297323073231732327323373234732357323673237732387323973240732417324273243732447324573246732477324873249732507325173252732537325473255732567325773258732597326073261732627326373264732657326673267732687326973270732717327273273732747327573276732777327873279732807328173282732837328473285732867328773288732897329073291732927329373294732957329673297732987329973300733017330273303733047330573306733077330873309733107331173312733137331473315733167331773318733197332073321733227332373324733257332673327733287332973330733317333273333733347333573336733377333873339733407334173342733437334473345733467334773348733497335073351733527335373354733557335673357733587335973360733617336273363733647336573366733677336873369733707337173372733737337473375733767337773378733797338073381733827338373384733857338673387733887338973390733917339273393733947339573396733977339873399734007340173402734037340473405734067340773408734097341073411734127341373414734157341673417734187341973420734217342273423734247342573426734277342873429734307343173432734337343473435734367343773438734397344073441734427344373444734457344673447734487344973450734517345273453734547345573456734577345873459734607346173462734637346473465734667346773468734697347073471734727347373474734757347673477734787347973480734817348273483734847348573486734877348873489734907349173492734937349473495734967349773498734997350073501735027350373504735057350673507735087350973510735117351273513735147351573516735177351873519735207352173522735237352473525735267352773528735297353073531735327353373534735357353673537735387353973540735417354273543735447354573546735477354873549735507355173552735537355473555735567355773558735597356073561735627356373564735657356673567735687356973570735717357273573735747357573576735777357873579735807358173582735837358473585735867358773588735897359073591735927359373594735957359673597735987359973600736017360273603736047360573606736077360873609736107361173612736137361473615736167361773618736197362073621736227362373624736257362673627736287362973630736317363273633736347363573636736377363873639736407364173642736437364473645736467364773648736497365073651736527365373654736557365673657736587365973660736617366273663736647366573666736677366873669
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0; //true
  5. !(function () {
  6. "use strict";
  7. function t(t, i) {
  8. return typeof t === i;
  9. }
  10. function i(t, i) {
  11. return t instanceof i;
  12. }
  13. function n(t) {
  14. return t && t.nodeType;
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0;
  18. }
  19. function o(t, i, n) {
  20. return (
  21. g.each(t, function (t, e) {
  22. n = i.call(e, n, t, e);
  23. }),
  24. n
  25. );
  26. }
  27. function r(t, i, n) {
  28. var e, o, r;
  29. if (t === i) return !0;
  30. if (!t || !i || t.constructor !== i.constructor) return !1;
  31. for (e = 0, o = n.length; o > e; e += 1) {
  32. if (((r = n[e]), t[r] && y(t[r].equals) && !t[r].equals(i[r]))) return !1;
  33. if (t[r] !== i[r]) return !1;
  34. }
  35. return !0;
  36. }
  37. function s(t, i, n, e) {
  38. (this.left = E(t)),
  39. (this.top = E(i)),
  40. (this.width = E(n)),
  41. (this.height = E(e)),
  42. (this.right = this.left + this.width),
  43. (this.bottom = this.top + this.height);
  44. }
  45. function h(t, i, n, e) {
  46. (this.visible = t || 0),
  47. (this.viewport = i || 0),
  48. (this.possible = n || 0),
  49. (this.rects = (e && T({}, e)) || null);
  50. }
  51. function l(t, i) {
  52. (this.els = t), (this.viewport = i);
  53. }
  54. function c(t, i, n) {
  55. var e;
  56. return (
  57. g.inArray(n, q) >= 0
  58. ? (e = s.ofElement(t))
  59. : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  60. e ? e[n] : 0
  61. );
  62. }
  63. function u(t, i) {
  64. return t.val - i.val;
  65. }
  66. function a(t, i) {
  67. return i.val - t.val;
  68. }
  69. function f(t) {
  70. var i = s.ofContent(t, !0),
  71. n = s.ofViewport(t, !0),
  72. e = i.width - n.width,
  73. o = i.height - n.height;
  74. (this.content = i),
  75. (this.viewport = n),
  76. (this.width = 0 >= e ? null : n.left / e),
  77. (this.height = 0 >= o ? null : n.top / o),
  78. (this.left = n.left),
  79. (this.top = n.top),
  80. (this.right = i.right - n.right),
  81. (this.bottom = i.bottom - n.bottom);
  82. }
  83. function p(t) {
  84. this.el = t || window;
  85. }
  86. function d(t, i) {
  87. (this.context = t), (this.viewport = i), this.init();
  88. }
  89. function v(t, i, n, e) {
  90. (this.context = new l(t, i)),
  91. (this.property = n),
  92. (this.descending = e),
  93. this.init();
  94. }
  95. function w(t) {
  96. t && t !== window && t !== document
  97. ? ((this.context = t), (this.$autoTarget = g(t)))
  98. : (this.context = window),
  99. this.init();
  100. }
  101. var g = jQuery,
  102. m = g(window),
  103. b = g(document),
  104. T = g.extend,
  105. y = g.isFunction,
  106. k = Math.max,
  107. V = Math.min,
  108. E = Math.round,
  109. x = (function () {
  110. var t = {},
  111. i = 1;
  112. return function (n) {
  113. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0;
  114. };
  115. })();
  116. T(s.prototype, {
  117. equals: function (t) {
  118. return r(this, t, ["left", "top", "width", "height"]);
  119. },
  120. area: function () {
  121. return this.width * this.height;
  122. },
  123. relativeTo: function (t) {
  124. return new s(
  125. this.left - t.left,
  126. this.top - t.top,
  127. this.width,
  128. this.height
  129. );
  130. },
  131. intersection: function (t) {
  132. if (!i(t, s)) return null;
  133. var n = k(this.left, t.left),
  134. e = V(this.right, t.right),
  135. o = k(this.top, t.top),
  136. r = V(this.bottom, t.bottom),
  137. h = e - n,
  138. l = r - o;
  139. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null;
  140. },
  141. envelope: function (t) {
  142. if (!i(t, s)) return this;
  143. var n = V(this.left, t.left),
  144. e = k(this.right, t.right),
  145. o = V(this.top, t.top),
  146. r = k(this.bottom, t.bottom),
  147. h = e - n,
  148. l = r - o;
  149. return new s(n, o, h, l);
  150. },
  151. }),
  152. T(s, {
  153. ofContent: function (t, i) {
  154. return t && t !== document && t !== window
  155. ? i
  156. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  157. : new s(
  158. t.offsetLeft - t.scrollLeft,
  159. t.offsetTop - t.scrollTop,
  160. t.scrollWidth,
  161. t.scrollHeight
  162. )
  163. : new s(0, 0, b.width(), b.height());
  164. },
  165. ofViewport: function (t, i) {
  166. return t && t !== document && t !== window
  167. ? i
  168. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  169. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  170. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height());
  171. },
  172. ofElement: function (t) {
  173. var i = g(t);
  174. if (!i.is(":visible")) return null;
  175. var n = i.offset();
  176. return new s(n.left, n.top, i.outerWidth(), i.outerHeight());
  177. },
  178. }),
  179. T(h.prototype, {
  180. equals: function (t) {
  181. return this.fracsEqual(t) && this.rectsEqual(t);
  182. },
  183. fracsEqual: function (t) {
  184. return r(this, t, ["visible", "viewport", "possible"]);
  185. },
  186. rectsEqual: function (t) {
  187. return r(this.rects, t.rects, ["document", "element", "viewport"]);
  188. },
  189. }),
  190. T(h, {
  191. of: function (t, i) {
  192. var e, o, r;
  193. return (
  194. (t = (n(t) && s.ofElement(t)) || t),
  195. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  196. t instanceof s && (e = t.intersection(i))
  197. ? ((o = e.area()),
  198. (r = V(t.width, i.width) * V(t.height, i.height)),
  199. new h(o / t.area(), o / i.area(), o / r, {
  200. document: e,
  201. element: e.relativeTo(t),
  202. viewport: e.relativeTo(i),
  203. }))
  204. : new h()
  205. );
  206. },
  207. });
  208. var q = ["width", "height", "left", "right", "top", "bottom"],
  209. S = ["possible", "visible", "viewport"];
  210. T(l.prototype, {
  211. sorted: function (t, i) {
  212. var n = this.viewport;
  213. return g
  214. .map(this.els, function (i) {
  215. return {
  216. el: i,
  217. val: c(i, n, t),
  218. };
  219. })
  220. .sort(i ? a : u);
  221. },
  222. best: function (t, i) {
  223. return this.els.length ? this.sorted(t, i)[0] : null;
  224. },
  225. }),
  226. T(f.prototype, {
  227. equals: function (t) {
  228. return r(this, t, [
  229. "width",
  230. "height",
  231. "left",
  232. "top",
  233. "right",
  234. "bottom",
  235. "content",
  236. "viewport",
  237. ]);
  238. },
  239. }),
  240. T(p.prototype, {
  241. equals: function (t) {
  242. return r(this, t, ["el"]);
  243. },
  244. scrollState: function () {
  245. return new f(this.el);
  246. },
  247. scrollTo: function (t, i, n) {
  248. var e = g(this.el === window ? "html,body" : this.el);
  249. (t = t || 0),
  250. (i = i || 0),
  251. (n = isNaN(n) ? 1e3 : n),
  252. e.stop(!0).animate(
  253. {
  254. scrollLeft: t,
  255. scrollTop: i,
  256. },
  257. n
  258. );
  259. },
  260. scroll: function (t, i, n) {
  261. var e = this.el === window ? m : g(this.el);
  262. (t = t || 0),
  263. (i = i || 0),
  264. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n);
  265. },
  266. scrollToRect: function (t, i, n, e) {
  267. (i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e);
  268. },
  269. scrollToElement: function (t, i, n, e) {
  270. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  271. this.scrollToRect(o, i, n, e);
  272. },
  273. });
  274. var C = {
  275. init: function () {
  276. (this.callbacks = g.Callbacks("memory unique")),
  277. (this.currVal = null),
  278. (this.prevVal = null),
  279. (this.checkProxy = g.proxy(this.check, this)),
  280. this.autoCheck();
  281. },
  282. bind: function (t) {
  283. this.callbacks.add(t);
  284. },
  285. unbind: function (t) {
  286. t ? this.callbacks.remove(t) : this.callbacks.empty();
  287. },
  288. trigger: function () {
  289. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal]);
  290. },
  291. check: function (t) {
  292. var i = this.updatedValue(t);
  293. return (
  294. void 0 !== i &&
  295. ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  296. );
  297. },
  298. $autoTarget: m,
  299. autoEvents: "load resize scroll",
  300. autoCheck: function (t) {
  301. this.$autoTarget[t === !1 ? "off" : "on"](
  302. this.autoEvents,
  303. this.checkProxy
  304. );
  305. },
  306. };
  307. T(d.prototype, C, {
  308. updatedValue: function () {
  309. var t = h.of(this.context, this.viewport);
  310. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  311. },
  312. }),
  313. T(v.prototype, C, {
  314. updatedValue: function () {
  315. var t = this.context.best(this.property, this.descending);
  316. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t)
  317. ? t
  318. : void 0;
  319. },
  320. }),
  321. T(w.prototype, C, {
  322. updatedValue: function () {
  323. var t = new f(this.context);
  324. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  325. },
  326. });
  327. var L = function (t, i) {
  328. var n = [].slice,
  329. e = jQuery,
  330. o = e.extend,
  331. r = e.isFunction,
  332. s = o({}, i),
  333. h = function (i, n, o, s) {
  334. return (
  335. (o = r(o) ? o.apply(i, n) : o),
  336. r(s[o])
  337. ? s[o].apply(i, n)
  338. : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  339. );
  340. },
  341. l = function () {
  342. return h(this, n.call(arguments), s.defaultStatic, l);
  343. },
  344. c = function (t) {
  345. return r(c[t])
  346. ? c[t].apply(this, n.call(arguments, 1))
  347. : h(this, n.call(arguments), s.defaultMethod, c);
  348. },
  349. u = function (t) {
  350. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u);
  351. };
  352. (u.prev = {
  353. statics: e[t],
  354. methods: e.fn[t],
  355. }),
  356. u(i),
  357. (e[t] = l),
  358. (e.fn[t] = c);
  359. },
  360. M = "fracs";
  361. L(M, {
  362. statics: {
  363. version: "0.15.0",
  364. Rect: s,
  365. Fractions: h,
  366. Group: l,
  367. ScrollState: f,
  368. Viewport: p,
  369. FracsCallbacks: d,
  370. GroupCallbacks: v,
  371. ScrollStateCallbacks: w,
  372. fracs: function (t, i) {
  373. return h.of(t, i);
  374. },
  375. },
  376. methods: {
  377. content: function (t) {
  378. return this.length ? s.ofContent(this[0], t) : null;
  379. },
  380. envelope: function () {
  381. return o(this, function (t) {
  382. var i = s.ofElement(this);
  383. return t ? t.envelope(i) : i;
  384. });
  385. },
  386. fracs: function (i, n, o) {
  387. t(i, "string") || ((o = n), (n = i), (i = null)),
  388. y(n) || ((o = n), (n = null)),
  389. (o = e(o));
  390. var r = M + ".fracs." + x(o);
  391. return "unbind" === i
  392. ? this.each(function () {
  393. var t = g(this).data(r);
  394. t && t.unbind(n);
  395. })
  396. : "check" === i
  397. ? this.each(function () {
  398. var t = g(this).data(r);
  399. t && t.check();
  400. })
  401. : y(n)
  402. ? this.each(function () {
  403. var t = g(this),
  404. i = t.data(r);
  405. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n);
  406. })
  407. : this.length
  408. ? h.of(this[0], o)
  409. : null;
  410. },
  411. intersection: function () {
  412. return o(this, function (t) {
  413. var i = s.ofElement(this);
  414. return t ? t.intersection(i) : i;
  415. });
  416. },
  417. max: function (t, i, n) {
  418. return (
  419. y(i) || ((n = i), (i = null)),
  420. (n = e(n)),
  421. i
  422. ? (new v(this, n, t, !0).bind(i), this)
  423. : this.pushStack(new l(this, n).best(t, !0).el)
  424. );
  425. },
  426. min: function (t, i, n) {
  427. return (
  428. y(i) || ((n = i), (i = null)),
  429. (n = e(n)),
  430. i
  431. ? (new v(this, n, t).bind(i), this)
  432. : this.pushStack(new l(this, n).best(t).el)
  433. );
  434. },
  435. rect: function () {
  436. return this.length ? s.ofElement(this[0]) : null;
  437. },
  438. scrollState: function (i, n) {
  439. var e = M + ".scrollState";
  440. return (
  441. t(i, "string") || ((n = i), (i = null)),
  442. "unbind" === i
  443. ? this.each(function () {
  444. var t = g(this).data(e);
  445. t && t.unbind(n);
  446. })
  447. : "check" === i
  448. ? this.each(function () {
  449. var t = g(this).data(e);
  450. t && t.check();
  451. })
  452. : y(n)
  453. ? this.each(function () {
  454. var t = g(this),
  455. i = t.data(e);
  456. i || ((i = new w(this)), t.data(e, i)), i.bind(n);
  457. })
  458. : this.length
  459. ? new f(this[0])
  460. : null
  461. );
  462. },
  463. scroll: function (t, i, n) {
  464. return this.each(function () {
  465. new p(this).scroll(t, i, n);
  466. });
  467. },
  468. scrollTo: function (t, i, n, o) {
  469. return (
  470. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  471. (t = e(t)),
  472. this.each(function () {
  473. t
  474. ? new p(this).scrollToElement(t, i, n, o)
  475. : new p(this).scrollTo(i, n, o);
  476. })
  477. );
  478. },
  479. scrollToThis: function (t, i, n, o) {
  480. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this;
  481. },
  482. softLink: function (t, i, n, o) {
  483. return (
  484. (o = new p(e(o))),
  485. this.filter("a[href^=#]").each(function () {
  486. var e = g(this);
  487. e.on("click", function () {
  488. o.scrollToElement(g(e.attr("href"))[0], t, i, n);
  489. });
  490. })
  491. );
  492. },
  493. sort: function (i, n, o) {
  494. return (
  495. t(n, "boolean") || ((o = n), (n = null)),
  496. (o = e(o)),
  497. this.pushStack(
  498. g.map(new l(this, o).sorted(i, !n), function (t) {
  499. return t.el;
  500. })
  501. )
  502. );
  503. },
  504. viewport: function (t) {
  505. return this.length ? s.ofViewport(this[0], t) : null;
  506. },
  507. },
  508. defaultStatic: "fracs",
  509. defaultMethod: "fracs",
  510. });
  511. })();
  512. if ("undefined" == typeof jQuery)
  513. throw new Error("Bootstrap's JavaScript requires jQuery");
  514. +(function (t) {
  515. "use strict";
  516. function e(e) {
  517. return this.each(function () {
  518. var o = t(this),
  519. s = o.data("bs.tooltip"),
  520. n = "object" == typeof e && e;
  521. (s || "destroy" != e) &&
  522. (s || o.data("bs.tooltip", (s = new i(this, n))),
  523. "string" == typeof e && s[e]());
  524. });
  525. }
  526. var i = function (t, e) {
  527. (this.type =
  528. this.options =
  529. this.enabled =
  530. this.timeout =
  531. this.hoverState =
  532. this.$element =
  533. null),
  534. this.init("tooltip", t, e);
  535. };
  536. (i.VERSION = "3.2.0"),
  537. (i.DEFAULTS = {
  538. animation: !0,
  539. placement: "top",
  540. selector: !1,
  541. template:
  542. '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  543. trigger: "hover focus",
  544. title: "",
  545. delay: 0,
  546. html: !1,
  547. container: !1,
  548. viewport: {
  549. selector: "body",
  550. padding: 0,
  551. },
  552. }),
  553. (i.prototype.init = function (e, i, o) {
  554. (this.enabled = !0),
  555. (this.type = e),
  556. (this.$element = t(i)),
  557. (this.options = this.getOptions(o)),
  558. (this.$viewport =
  559. this.options.viewport &&
  560. t(this.options.viewport.selector || this.options.viewport));
  561. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  562. var r = s[n];
  563. if ("click" == r)
  564. this.$element.on(
  565. "click." + this.type,
  566. this.options.selector,
  567. t.proxy(this.toggle, this)
  568. );
  569. else if ("manual" != r) {
  570. var a = "hover" == r ? "mouseenter" : "focusin",
  571. l = "hover" == r ? "mouseleave" : "focusout";
  572. this.$element.on(
  573. a + "." + this.type,
  574. this.options.selector,
  575. t.proxy(this.enter, this)
  576. ),
  577. this.$element.on(
  578. l + "." + this.type,
  579. this.options.selector,
  580. t.proxy(this.leave, this)
  581. );
  582. }
  583. }
  584. this.options.selector
  585. ? (this._options = t.extend({}, this.options, {
  586. trigger: "manual",
  587. selector: "",
  588. }))
  589. : this.fixTitle();
  590. }),
  591. (i.prototype.getDefaults = function () {
  592. return i.DEFAULTS;
  593. }),
  594. (i.prototype.getOptions = function (e) {
  595. return (
  596. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  597. e.delay &&
  598. "number" == typeof e.delay &&
  599. (e.delay = {
  600. show: e.delay,
  601. hide: e.delay,
  602. }),
  603. e
  604. );
  605. }),
  606. (i.prototype.getDelegateOptions = function () {
  607. var e = {},
  608. i = this.getDefaults();
  609. return (
  610. this._options &&
  611. t.each(this._options, function (t, o) {
  612. i[t] != o && (e[t] = o);
  613. }),
  614. e
  615. );
  616. }),
  617. (i.prototype.enter = function (e) {
  618. var i =
  619. e instanceof this.constructor
  620. ? e
  621. : t(e.currentTarget).data("bs." + this.type);
  622. return (
  623. i ||
  624. ((i = new this.constructor(
  625. e.currentTarget,
  626. this.getDelegateOptions()
  627. )),
  628. t(e.currentTarget).data("bs." + this.type, i)),
  629. clearTimeout(i.timeout),
  630. (i.hoverState = "in"),
  631. i.options.delay && i.options.delay.show
  632. ? void (i.timeout = setTimeout(function () {
  633. // "in" == i.hoverState && i.show()
  634. }, i.options.delay.show))
  635. : i.show()
  636. );
  637. }),
  638. (i.prototype.leave = function (e) {
  639. var i =
  640. e instanceof this.constructor
  641. ? e
  642. : t(e.currentTarget).data("bs." + this.type);
  643. return (
  644. i ||
  645. ((i = new this.constructor(
  646. e.currentTarget,
  647. this.getDelegateOptions()
  648. )),
  649. t(e.currentTarget).data("bs." + this.type, i)),
  650. clearTimeout(i.timeout),
  651. (i.hoverState = "out"),
  652. i.options.delay && i.options.delay.hide
  653. ? void (i.timeout = setTimeout(function () {
  654. "out" == i.hoverState && i.hide();
  655. }, i.options.delay.hide))
  656. : i.hide()
  657. );
  658. }),
  659. (i.prototype.show = function () {
  660. var e = t.Event("show.bs." + this.type);
  661. if (this.hasContent() && this.enabled) {
  662. this.$element.trigger(e);
  663. var i = t.contains(document.documentElement, this.$element[0]);
  664. if (e.isDefaultPrevented() || !i) return;
  665. var o = this,
  666. s = this.tip(),
  667. n = this.getUID(this.type);
  668. this.setContent(),
  669. s.attr("id", n),
  670. this.$element.attr("aria-describedby", n),
  671. this.options.animation && s.addClass("fade");
  672. var r =
  673. "function" == typeof this.options.placement
  674. ? this.options.placement.call(this, s[0], this.$element[0])
  675. : this.options.placement,
  676. a = /\s?auto?\s?/i,
  677. l = a.test(r);
  678. l && (r = r.replace(a, "") || "top"),
  679. s
  680. .detach()
  681. .css({
  682. top: 0,
  683. left: 0,
  684. display: "block",
  685. })
  686. .addClass(r)
  687. .data("bs." + this.type, this),
  688. this.options.container
  689. ? s.appendTo(this.options.container)
  690. : s.insertAfter(this.$element);
  691. var p = this.getPosition(),
  692. h = s[0].offsetWidth,
  693. f = s[0].offsetHeight;
  694. if (l) {
  695. var u = r,
  696. c = this.$element.parent(),
  697. d = this.getPosition(c);
  698. (r =
  699. "bottom" == r && p.top + p.height + f - d.scroll > d.height
  700. ? "top"
  701. : "top" == r && p.top - d.scroll - f < 0
  702. ? "bottom"
  703. : "right" == r && p.right + h > d.width
  704. ? "left"
  705. : "left" == r && p.left - h < d.left
  706. ? "right"
  707. : r),
  708. s.removeClass(u).addClass(r);
  709. }
  710. var g = this.getCalculatedOffset(r, p, h, f);
  711. this.applyPlacement(g, r);
  712. var y = function () {
  713. o.$element.trigger("shown.bs." + o.type), (o.hoverState = null);
  714. };
  715. t.support.transition && this.$tip.hasClass("fade")
  716. ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150)
  717. : y();
  718. }
  719. }),
  720. (i.prototype.applyPlacement = function (e, i) {
  721. var o = this.tip(),
  722. s = o[0].offsetWidth,
  723. n = o[0].offsetHeight,
  724. r = parseInt(o.css("margin-top"), 10),
  725. a = parseInt(o.css("margin-left"), 10);
  726. isNaN(r) && (r = 0),
  727. isNaN(a) && (a = 0),
  728. (e.top = e.top + r),
  729. (e.left = e.left + a),
  730. t.offset.setOffset(
  731. o[0],
  732. t.extend(
  733. {
  734. using: function (t) {
  735. o.css({
  736. top: Math.round(t.top),
  737. left: Math.round(t.left),
  738. });
  739. },
  740. },
  741. e
  742. ),
  743. 0
  744. ),
  745. o.addClass("in");
  746. var l = o[0].offsetWidth,
  747. p = o[0].offsetHeight;
  748. "top" == i && p != n && (e.top = e.top + n - p);
  749. var h = this.getViewportAdjustedDelta(i, e, l, p);
  750. h.left ? (e.left += h.left) : (e.top += h.top);
  751. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  752. u = h.left ? "left" : "top",
  753. c = h.left ? "offsetWidth" : "offsetHeight";
  754. o.offset(e), this.replaceArrow(f, o[0][c], u);
  755. }),
  756. (i.prototype.replaceArrow = function (t, e, i) {
  757. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "");
  758. }),
  759. (i.prototype.setContent = function () {
  760. var t = this.tip(),
  761. e = this.getTitle();
  762. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  763. t.removeClass("fade in top bottom left right");
  764. }),
  765. (i.prototype.hide = function () {
  766. function e() {
  767. "in" != i.hoverState && o.detach(),
  768. i.$element.trigger("hidden.bs." + i.type);
  769. }
  770. var i = this,
  771. o = this.tip(),
  772. s = t.Event("hide.bs." + this.type);
  773. if (
  774. (this.$element.removeAttr("aria-describedby"),
  775. this.$element.trigger(s),
  776. !s.isDefaultPrevented())
  777. )
  778. return (
  779. o.removeClass("in"),
  780. t.support.transition && this.$tip.hasClass("fade")
  781. ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150)
  782. : e(),
  783. (this.hoverState = null),
  784. this
  785. );
  786. }),
  787. (i.prototype.fixTitle = function () {
  788. var t = this.$element;
  789. (t.attr("title") || "string" != typeof t.attr("data-original-title")) &&
  790. t.attr("data-original-title", t.attr("title") || "").attr("title", "");
  791. }),
  792. (i.prototype.hasContent = function () {
  793. return this.getTitle();
  794. }),
  795. (i.prototype.getPosition = function (e) {
  796. e = e || this.$element;
  797. var i = e[0],
  798. o = "BODY" == i.tagName;
  799. return t.extend(
  800. {},
  801. "function" == typeof i.getBoundingClientRect
  802. ? i.getBoundingClientRect()
  803. : null,
  804. {
  805. scroll: o
  806. ? document.documentElement.scrollTop || document.body.scrollTop
  807. : e.scrollTop(),
  808. width: o ? t(window).width() : e.outerWidth(),
  809. height: o ? t(window).height() : e.outerHeight(),
  810. },
  811. o
  812. ? {
  813. top: 0,
  814. left: 0,
  815. }
  816. : e.offset()
  817. );
  818. }),
  819. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  820. return "bottom" == t
  821. ? {
  822. top: e.top + e.height,
  823. left: e.left + e.width / 2 - i / 2,
  824. }
  825. : "top" == t
  826. ? {
  827. top: e.top - o,
  828. left: e.left + e.width / 2 - i / 2,
  829. }
  830. : "left" == t
  831. ? {
  832. top: e.top + e.height / 2 - o / 2,
  833. left: e.left - i,
  834. }
  835. : {
  836. top: e.top + e.height / 2 - o / 2,
  837. left: e.left + e.width,
  838. };
  839. }),
  840. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  841. var s = {
  842. top: 0,
  843. left: 0,
  844. };
  845. if (!this.$viewport) return s;
  846. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  847. r = this.getPosition(this.$viewport);
  848. if (/right|left/.test(t)) {
  849. var a = e.top - n - r.scroll,
  850. l = e.top + n - r.scroll + o;
  851. a < r.top
  852. ? (s.top = r.top - a)
  853. : l > r.top + r.height && (s.top = r.top + r.height - l);
  854. } else {
  855. var p = e.left - n,
  856. h = e.left + n + i;
  857. p < r.left
  858. ? (s.left = r.left - p)
  859. : h > r.width && (s.left = r.left + r.width - h);
  860. }
  861. return s;
  862. }),
  863. (i.prototype.getTitle = function () {
  864. var t,
  865. e = this.$element,
  866. i = this.options;
  867. return (t =
  868. e.attr("data-original-title") ||
  869. ("function" == typeof i.title ? i.title.call(e[0]) : i.title));
  870. }),
  871. (i.prototype.getUID = function (t) {
  872. do t += ~~(1e6 * Math.random());
  873. while (document.getElementById(t));
  874. return t;
  875. }),
  876. (i.prototype.tip = function () {
  877. return (this.$tip = this.$tip || t(this.options.template));
  878. }),
  879. (i.prototype.arrow = function () {
  880. return (this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow"));
  881. }),
  882. (i.prototype.validate = function () {
  883. this.$element[0].parentNode ||
  884. (this.hide(), (this.$element = null), (this.options = null));
  885. }),
  886. (i.prototype.enable = function () {
  887. this.enabled = !0;
  888. }),
  889. (i.prototype.disable = function () {
  890. this.enabled = !1;
  891. }),
  892. (i.prototype.toggleEnabled = function () {
  893. this.enabled = !this.enabled;
  894. }),
  895. (i.prototype.toggle = function (e) {
  896. var i = this;
  897. e &&
  898. ((i = t(e.currentTarget).data("bs." + this.type)),
  899. i ||
  900. ((i = new this.constructor(
  901. e.currentTarget,
  902. this.getDelegateOptions()
  903. )),
  904. t(e.currentTarget).data("bs." + this.type, i))),
  905. i.tip().hasClass("in") ? i.leave(i) : i.enter(i);
  906. }),
  907. (i.prototype.destroy = function () {
  908. clearTimeout(this.timeout),
  909. this.hide()
  910. .$element.off("." + this.type)
  911. .removeData("bs." + this.type);
  912. });
  913. var o = t.fn.tooltip;
  914. (t.fn.tooltip = e),
  915. (t.fn.tooltip.Constructor = i),
  916. (t.fn.tooltip.noConflict = function () {
  917. return (t.fn.tooltip = o), this;
  918. });
  919. })(jQuery);
  920. !(function (e, t, n) {
  921. "undefined" != typeof module && module.exports
  922. ? (module.exports = n())
  923. : "function" == typeof define && define.amd
  924. ? define(n)
  925. : (t[e] = n());
  926. })("Keen", this, function () {
  927. "use strict";
  928. function Keen() {
  929. return _init.apply(this, arguments);
  930. }
  931. function _init(e) {
  932. if (_isUndefined(e))
  933. throw new Error(
  934. "Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/"
  935. );
  936. if (
  937. _isUndefined(e.projectId) ||
  938. "String" !== _type(e.projectId) ||
  939. e.projectId.length < 1
  940. )
  941. throw new Error("Please provide a projectId");
  942. this.configure(e);
  943. }
  944. function _extend(e) {
  945. for (var t = 1; t < arguments.length; t++)
  946. for (var n in arguments[t]) e[n] = arguments[t][n];
  947. return e;
  948. }
  949. function _isUndefined(e) {
  950. return void 0 === e;
  951. }
  952. function _type(e) {
  953. var t = e && e.constructor ? e.constructor.toString() : void 0;
  954. return t ? t.match(/function (.*)\(/)[1] : "Null";
  955. }
  956. function _each(e, t, n) {
  957. var r;
  958. if (!e) return 0;
  959. if (((n = n ? n : e), "array" === _type(e))) {
  960. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0;
  961. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0;
  962. return 1;
  963. }
  964. function _parse_params(e) {
  965. for (
  966. var t,
  967. n = {},
  968. r = /\+/g,
  969. i = /([^&=]+)=?([^&]*)/g,
  970. o = function (e) {
  971. return decodeURIComponent(e.replace(r, " "));
  972. },
  973. a = e.split("?")[1];
  974. (t = i.exec(a));
  975. )
  976. n[o(t[1])] = o(t[2]);
  977. return n;
  978. }
  979. function _set_protocol(e) {
  980. switch (e) {
  981. case "http":
  982. return "http";
  983. case "auto":
  984. return location.protocol.replace(/:/g, "");
  985. case "https":
  986. case void 0:
  987. default:
  988. return "https";
  989. }
  990. }
  991. function _set_request_type(e) {
  992. var t = e || "jsonp",
  993. n = !1;
  994. return (
  995. ("Object" === _type(XMLHttpRequest) ||
  996. "Function" === _type(XMLHttpRequest)) &&
  997. "withCredentials" in new XMLHttpRequest() &&
  998. (n = !0),
  999. null == t || "xhr" == t ? (n ? "xhr" : "jsonp") : t
  1000. );
  1001. }
  1002. function _build_url(e) {
  1003. return this.client.endpoint + "/projects/" + this.client.projectId + e;
  1004. }
  1005. function _uploadEvent(e, t, n, r, i) {
  1006. var o = _build_url.apply(this, ["/events/" + e]),
  1007. a = {};
  1008. (n = n !== !1),
  1009. this.client.globalProperties && (a = this.client.globalProperties(e));
  1010. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c]);
  1011. switch (this.client.requestType) {
  1012. case "xhr":
  1013. _request.xhr.apply(this, [
  1014. "POST",
  1015. o,
  1016. null,
  1017. a,
  1018. this.client.writeKey,
  1019. n,
  1020. r,
  1021. i,
  1022. ]);
  1023. break;
  1024. case "jsonp":
  1025. var s = JSON.stringify(a),
  1026. l = Keen.Base64.encode(s);
  1027. (o = o + "?api_key=" + this.client.writeKey),
  1028. (o = o + "&data=" + l),
  1029. (o = o + "&modified=" + new Date().getTime()),
  1030. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  1031. break;
  1032. case "beacon":
  1033. var s = JSON.stringify(a),
  1034. l = Keen.Base64.encode(s);
  1035. (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)),
  1036. (o = o + "&data=" + encodeURIComponent(l)),
  1037. (o = o + "&modified=" + encodeURIComponent(new Date().getTime())),
  1038. (o += "&c=clv1"),
  1039. _request.beacon.apply(this, [o, null, r, i]);
  1040. }
  1041. }
  1042. Keen.prototype.configure = function (e) {
  1043. return (
  1044. (e.host = _isUndefined(e.host)
  1045. ? "api.keen.io/3.0"
  1046. : e.host.replace(/.*?:\/\//g, "")),
  1047. (e.protocol = _set_protocol(e.protocol)),
  1048. (e.requestType = _set_request_type(e.requestType)),
  1049. (this.client = {
  1050. projectId: e.projectId,
  1051. writeKey: e.writeKey,
  1052. readKey: e.readKey,
  1053. globalProperties: null,
  1054. endpoint: e.protocol + "://" + e.host,
  1055. requestType: e.requestType,
  1056. }),
  1057. Keen.trigger("client", this, e),
  1058. this.trigger("ready"),
  1059. this
  1060. );
  1061. };
  1062. var _request = {
  1063. xhr: function (e, t, n, r, i, o, a, c) {
  1064. if (!i)
  1065. return Keen.log(
  1066. "Please provide a writeKey for https://keen.io/project/" +
  1067. this.client.projectId
  1068. );
  1069. var s = new XMLHttpRequest();
  1070. if (
  1071. ((s.onreadystatechange = function () {
  1072. if (4 == s.readyState)
  1073. if (s.status >= 200 && s.status < 300) {
  1074. var e;
  1075. try {
  1076. e = JSON.parse(s.responseText);
  1077. } catch (e) {
  1078. Keen.log(
  1079. "Could not JSON parse HTTP response: " + s.responseText
  1080. ),
  1081. c && c(s, e);
  1082. }
  1083. a && e && a(e);
  1084. } else Keen.log("HTTP request failed."), c && c(s, null);
  1085. }),
  1086. s.open(e, t, o),
  1087. i && s.setRequestHeader("Authorization", i),
  1088. r && s.setRequestHeader("Content-Type", "application/json"),
  1089. n)
  1090. )
  1091. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1092. var u = r ? JSON.stringify(r) : null;
  1093. s.send(u);
  1094. },
  1095. jsonp: function (e, t, n, r) {
  1096. if (!t)
  1097. return Keen.log(
  1098. "Please provide a writeKey for https://keen.io/project/" +
  1099. this.client.projectId
  1100. );
  1101. if (t && e.indexOf("api_key") < 0) {
  1102. var i = e.indexOf("?") > 0 ? "&" : "?";
  1103. e = e + i + "api_key=" + t;
  1104. }
  1105. for (var o = "keenJSONPCallback" + new Date().getTime(); o in window; )
  1106. o += "a";
  1107. var a = !1;
  1108. (window[o] = function (e) {
  1109. (a = !0), n && e && n(e), (window[o] = void 0);
  1110. }),
  1111. (e = e + "&jsonp=" + o);
  1112. var c = document.createElement("script");
  1113. (c.id = "keen-jsonp"),
  1114. (c.src = e),
  1115. document.getElementsByTagName("head")[0].appendChild(c),
  1116. (c.onreadystatechange = function () {
  1117. a === !1 && "loaded" === this.readyState && ((a = !0), r && r());
  1118. }),
  1119. (c.onerror = function () {
  1120. a === !1 && ((a = !0), r && r());
  1121. });
  1122. },
  1123. beacon: function (e, t, n, r) {
  1124. if (t && e.indexOf("api_key") < 0) {
  1125. var i = e.indexOf("?") > 0 ? "&" : "?";
  1126. e = e + i + "api_key=" + t;
  1127. }
  1128. var o = !1,
  1129. a = document.createElement("img");
  1130. (a.onload = function () {
  1131. if (((o = !0), "naturalHeight" in this)) {
  1132. if (this.naturalHeight + this.naturalWidth === 0)
  1133. return void this.onerror();
  1134. } else if (this.width + this.height === 0) return void this.onerror();
  1135. n &&
  1136. n({
  1137. created: !0,
  1138. });
  1139. }),
  1140. (a.onerror = function () {
  1141. (o = !0), r && r();
  1142. }),
  1143. (a.src = e);
  1144. },
  1145. },
  1146. Events = (Keen.Events = {
  1147. on: function (e, t) {
  1148. this.listeners || (this.listeners = {});
  1149. var n = this.listeners[e] || (this.listeners[e] = []);
  1150. return (
  1151. n.push({
  1152. callback: t,
  1153. }),
  1154. this
  1155. );
  1156. },
  1157. off: function (e, t) {
  1158. if (!e && !t)
  1159. return (this.listeners = void 0), delete this.listeners, this;
  1160. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1161. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1162. (t && 0 != n.length) ||
  1163. ((this.listeners[e] = void 0), delete this.listeners[e]);
  1164. return this;
  1165. },
  1166. trigger: function (e) {
  1167. if (!this.listeners) return this;
  1168. for (
  1169. var t = Array.prototype.slice.call(arguments, 1),
  1170. n = this.listeners[e] || [],
  1171. r = 0;
  1172. r < n.length;
  1173. r++
  1174. )
  1175. n[r].callback.apply(this, t);
  1176. return this;
  1177. },
  1178. });
  1179. _extend(Keen.prototype, Events),
  1180. _extend(Keen, Events),
  1181. (Keen.loaded = !0),
  1182. (Keen.utils = {
  1183. each: _each,
  1184. extend: _extend,
  1185. parseParams: _parse_params,
  1186. }),
  1187. (Keen.ready = function (e) {
  1188. Keen.loaded ? e() : Keen.on("ready", e);
  1189. }),
  1190. (Keen.log = function (e) {
  1191. "object" == typeof console && console.log("[Keen IO]", e);
  1192. });
  1193. var Plugins = (Keen.Plugins = {});
  1194. (Keen.prototype.addEvent = function () {
  1195. _uploadEvent.apply(this, arguments);
  1196. }),
  1197. (Keen.prototype.addEventSync = function (e, t, n, r) {
  1198. _uploadEvent.apply(this, [e, t, !1, n, r]);
  1199. }),
  1200. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  1201. var o = e,
  1202. a = o.metaKey,
  1203. c = o.target,
  1204. s = !1,
  1205. l = function () {};
  1206. return (
  1207. void 0 === r && (r = 500),
  1208. "A" === c.nodeName
  1209. ? (l = function () {
  1210. a || s || ((s = !0), (window.location = c.href));
  1211. })
  1212. : "FORM" === c.nodeName &&
  1213. (l = function () {
  1214. s || ((s = !0), c.submit());
  1215. }),
  1216. i &&
  1217. (l = function () {
  1218. s || ((s = !0), i());
  1219. }),
  1220. _uploadEvent.call(this, t, n, l, l),
  1221. setTimeout(function () {
  1222. l();
  1223. }, r),
  1224. !!a && void 0
  1225. );
  1226. }),
  1227. (Keen.prototype.setGlobalProperties = function (e) {
  1228. if (!this.client)
  1229. return Keen.log(
  1230. "Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/"
  1231. );
  1232. if (!e || "function" != typeof e)
  1233. throw new Error("Invalid value for global properties: " + e);
  1234. this.client.globalProperties = e;
  1235. }),
  1236. (Keen.Base64 = {
  1237. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1238. encode: function (e) {
  1239. var t,
  1240. n,
  1241. r,
  1242. i,
  1243. o,
  1244. a,
  1245. c,
  1246. s = "",
  1247. l = 0,
  1248. u = this.map;
  1249. for (e = this.utf8.encode(e); l < e.length; )
  1250. (t = e.charCodeAt(l++)),
  1251. (n = e.charCodeAt(l++)),
  1252. (r = e.charCodeAt(l++)),
  1253. (i = t >> 2),
  1254. (o = ((3 & t) << 4) | (n >> 4)),
  1255. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1256. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1257. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c));
  1258. return s;
  1259. },
  1260. decode: function (e) {
  1261. var t,
  1262. n,
  1263. r,
  1264. i,
  1265. o,
  1266. a,
  1267. c,
  1268. s = "",
  1269. l = 0,
  1270. u = this.map,
  1271. f = String.fromCharCode;
  1272. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1273. (t = u.indexOf(e.charAt(l++))),
  1274. (n = u.indexOf(e.charAt(l++))),
  1275. (r = u.indexOf(e.charAt(l++))),
  1276. (i = u.indexOf(e.charAt(l++))),
  1277. (o = (t << 2) | (n >> 4)),
  1278. (a = ((15 & n) << 4) | (r >> 2)),
  1279. (c = ((3 & r) << 6) | i),
  1280. (s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : ""));
  1281. return this.utf8.decode(s);
  1282. },
  1283. utf8: {
  1284. encode: function (e) {
  1285. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1286. (t = e.charCodeAt(r++)),
  1287. (n +=
  1288. 128 > t
  1289. ? i(t)
  1290. : t > 127 && 2048 > t
  1291. ? i((t >> 6) | 192) + i((63 & t) | 128)
  1292. : i((t >> 12) | 224) +
  1293. i(((t >> 6) & 63) | 128) +
  1294. i((63 & t) | 128));
  1295. return n;
  1296. },
  1297. decode: function (e) {
  1298. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1299. (n = e.charCodeAt(i)),
  1300. (r +=
  1301. 128 > n
  1302. ? [o(n), i++][0]
  1303. : n > 191 && 224 > n
  1304. ? [
  1305. o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))),
  1306. (i += 2),
  1307. ][0]
  1308. : [
  1309. o(
  1310. ((15 & n) << 12) |
  1311. ((63 & (t = e.charCodeAt(i + 1))) << 6) |
  1312. (63 & (c3 = e.charCodeAt(i + 2)))
  1313. ),
  1314. (i += 3),
  1315. ][0]);
  1316. return r;
  1317. },
  1318. },
  1319. }),
  1320. "object" != typeof JSON && (JSON = {}),
  1321. (function () {
  1322. function f(e) {
  1323. return 10 > e ? "0" + e : e;
  1324. }
  1325. function quote(e) {
  1326. return (
  1327. (escapable.lastIndex = 0),
  1328. escapable.test(e)
  1329. ? '"' +
  1330. e.replace(escapable, function (e) {
  1331. var t = meta[e];
  1332. return "string" == typeof t
  1333. ? t
  1334. : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4);
  1335. }) +
  1336. '"'
  1337. : '"' + e + '"'
  1338. );
  1339. }
  1340. function str(e, t) {
  1341. var n,
  1342. r,
  1343. i,
  1344. o,
  1345. a,
  1346. c = gap,
  1347. s = t[e];
  1348. switch (
  1349. (s &&
  1350. "object" == typeof s &&
  1351. "function" == typeof s.toJSON &&
  1352. (s = s.toJSON(e)),
  1353. "function" == typeof rep && (s = rep.call(t, e, s)),
  1354. typeof s)
  1355. ) {
  1356. case "string":
  1357. return quote(s);
  1358. case "number":
  1359. return isFinite(s) ? String(s) : "null";
  1360. case "boolean":
  1361. case "null":
  1362. return String(s);
  1363. case "object":
  1364. if (!s) return "null";
  1365. if (
  1366. ((gap += indent),
  1367. (a = []),
  1368. "[object Array]" === Object.prototype.toString.apply(s))
  1369. ) {
  1370. for (o = s.length, n = 0; o > n; n += 1)
  1371. a[n] = str(n, s) || "null";
  1372. return (
  1373. (i =
  1374. 0 === a.length
  1375. ? "[]"
  1376. : gap
  1377. ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]"
  1378. : "[" + a.join(",") + "]"),
  1379. (gap = c),
  1380. i
  1381. );
  1382. }
  1383. if (rep && "object" == typeof rep)
  1384. for (o = rep.length, n = 0; o > n; n += 1)
  1385. "string" == typeof rep[n] &&
  1386. ((r = rep[n]),
  1387. (i = str(r, s)),
  1388. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1389. else
  1390. for (r in s)
  1391. Object.prototype.hasOwnProperty.call(s, r) &&
  1392. ((i = str(r, s)),
  1393. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1394. return (
  1395. (i =
  1396. 0 === a.length
  1397. ? "{}"
  1398. : gap
  1399. ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}"
  1400. : "{" + a.join(",") + "}"),
  1401. (gap = c),
  1402. i
  1403. );
  1404. }
  1405. }
  1406. "function" != typeof Date.prototype.toJSON &&
  1407. ((Date.prototype.toJSON = function () {
  1408. return isFinite(this.valueOf())
  1409. ? this.getUTCFullYear() +
  1410. "-" +
  1411. f(this.getUTCMonth() + 1) +
  1412. "-" +
  1413. f(this.getUTCDate()) +
  1414. "T" +
  1415. f(this.getUTCHours()) +
  1416. ":" +
  1417. f(this.getUTCMinutes()) +
  1418. ":" +
  1419. f(this.getUTCSeconds()) +
  1420. "Z"
  1421. : null;
  1422. }),
  1423. (String.prototype.toJSON =
  1424. Number.prototype.toJSON =
  1425. Boolean.prototype.toJSON =
  1426. function () {
  1427. return this.valueOf();
  1428. }));
  1429. var cx =
  1430. /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1431. escapable =
  1432. /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1433. gap,
  1434. indent,
  1435. meta = {
  1436. "\b": "\\b",
  1437. "\t": "\\t",
  1438. "\n": "\\n",
  1439. "\f": "\\f",
  1440. "\r": "\\r",
  1441. '"': '\\"',
  1442. "\\": "\\\\",
  1443. },
  1444. rep;
  1445. "function" != typeof JSON.stringify &&
  1446. (JSON.stringify = function (e, t, n) {
  1447. var r;
  1448. if (((gap = ""), (indent = ""), "number" == typeof n))
  1449. for (r = 0; n > r; r += 1) indent += " ";
  1450. else "string" == typeof n && (indent = n);
  1451. if (
  1452. ((rep = t),
  1453. t &&
  1454. "function" != typeof t &&
  1455. ("object" != typeof t || "number" != typeof t.length))
  1456. )
  1457. throw new Error("JSON.stringify");
  1458. return str("", {
  1459. "": e,
  1460. });
  1461. }),
  1462. "function" != typeof JSON.parse &&
  1463. (JSON.parse = function (text, reviver) {
  1464. function walk(e, t) {
  1465. var n,
  1466. r,
  1467. i = e[t];
  1468. if (i && "object" == typeof i)
  1469. for (n in i)
  1470. Object.prototype.hasOwnProperty.call(i, n) &&
  1471. ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n]);
  1472. return reviver.call(e, t, i);
  1473. }
  1474. var j;
  1475. if (
  1476. ((text = String(text)),
  1477. (cx.lastIndex = 0),
  1478. cx.test(text) &&
  1479. (text = text.replace(cx, function (e) {
  1480. return (
  1481. "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1482. );
  1483. })),
  1484. /^[\],:{}\s]*$/.test(
  1485. text
  1486. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
  1487. .replace(
  1488. /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  1489. "]"
  1490. )
  1491. .replace(/(?:^|:|,)(?:\s*\[)+/g, "")
  1492. ))
  1493. )
  1494. return (
  1495. (j = eval("(" + text + ")")),
  1496. "function" == typeof reviver
  1497. ? walk(
  1498. {
  1499. "": j,
  1500. },
  1501. ""
  1502. )
  1503. : j
  1504. );
  1505. throw new SyntaxError("JSON.parse");
  1506. });
  1507. })(),
  1508. !(function (e, t, n) {
  1509. "undefined" != typeof module && module.exports
  1510. ? (module.exports = n())
  1511. : "function" == typeof define && define.amd
  1512. ? define(n)
  1513. : (t[e] = n());
  1514. })("domready", Keen.utils, function (e) {
  1515. function t(e) {
  1516. for (d = 1; (e = r.shift()); ) e();
  1517. }
  1518. var n,
  1519. r = [],
  1520. i = !1,
  1521. o = document,
  1522. a = o.documentElement,
  1523. c = a.doScroll,
  1524. s = "DOMContentLoaded",
  1525. l = "addEventListener",
  1526. u = "onreadystatechange",
  1527. f = "readyState",
  1528. p = c ? /^loaded|^c/ : /^loaded|c/,
  1529. d = p.test(o[f]);
  1530. return (
  1531. o[l] &&
  1532. o[l](
  1533. s,
  1534. (n = function () {
  1535. o.removeEventListener(s, n, i), t();
  1536. }),
  1537. i
  1538. ),
  1539. c &&
  1540. o.attachEvent(
  1541. u,
  1542. (n = function () {
  1543. /^c/.test(o[f]) && (o.detachEvent(u, n), t());
  1544. })
  1545. ),
  1546. (e = c
  1547. ? function (t) {
  1548. self != top
  1549. ? d
  1550. ? t()
  1551. : r.push(t)
  1552. : (function () {
  1553. try {
  1554. a.doScroll("left");
  1555. } catch (n) {
  1556. return setTimeout(function () {
  1557. e(t);
  1558. }, 50);
  1559. }
  1560. t();
  1561. })();
  1562. }
  1563. : function (e) {
  1564. d ? e() : r.push(e);
  1565. })
  1566. );
  1567. });
  1568. var loaded = window.Keen,
  1569. cached = window._Keen || {},
  1570. clients,
  1571. ready;
  1572. if (loaded && cached) {
  1573. (clients = cached.clients || {}), (ready = cached.ready || []);
  1574. for (var instance in clients)
  1575. if (clients.hasOwnProperty(instance)) {
  1576. var client = clients[instance];
  1577. for (var method in Keen.prototype)
  1578. Keen.prototype.hasOwnProperty(method) &&
  1579. (loaded.prototype[method] = Keen.prototype[method]);
  1580. if (
  1581. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1582. (loaded.Visualization = Keen.Visualization
  1583. ? Keen.Visualization
  1584. : function () {}),
  1585. client._config &&
  1586. (client.configure.call(client, client._config),
  1587. delete client._config),
  1588. client._setGlobalProperties)
  1589. ) {
  1590. for (
  1591. var globals = client._setGlobalProperties, i = 0;
  1592. i < globals.length;
  1593. i++
  1594. )
  1595. client.setGlobalProperties.apply(client, globals[i]);
  1596. delete client._setGlobalProperties;
  1597. }
  1598. if (client._addEvent) {
  1599. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1600. client.addEvent.apply(client, queue[i]);
  1601. delete client._addEvent;
  1602. }
  1603. var callback = client._on || [];
  1604. if (client._on) {
  1605. for (var i = 0; i < callback.length; i++)
  1606. client.on.apply(client, callback[i]);
  1607. client.trigger("ready"), delete client._on;
  1608. }
  1609. }
  1610. for (var i = 0; i < ready.length; i++) {
  1611. var callback = ready[i];
  1612. Keen.on("ready", function () {
  1613. callback();
  1614. });
  1615. }
  1616. }
  1617. return (
  1618. Keen.loaded &&
  1619. setTimeout(function () {
  1620. Keen.utils.domready(function () {
  1621. Keen.trigger("ready");
  1622. });
  1623. }, 0),
  1624. Keen
  1625. );
  1626. });
  1627. !(function () {
  1628. var t = (window.analytics = window.analytics || []);
  1629. if (!t.initialize) {
  1630. if (t.invoked)
  1631. return void (
  1632. window.console &&
  1633. console.error &&
  1634. console.error("Segment snippet included twice.")
  1635. );
  1636. (t.invoked = !0),
  1637. (t.methods = [
  1638. "trackSubmit",
  1639. "trackClick",
  1640. "trackLink",
  1641. "trackForm",
  1642. "pageview",
  1643. "identify",
  1644. "reset",
  1645. "group",
  1646. "track",
  1647. "ready",
  1648. "alias",
  1649. "debug",
  1650. "page",
  1651. "once",
  1652. "off",
  1653. "on",
  1654. ]),
  1655. (t.factory = function (e) {
  1656. return function () {
  1657. var n = Array.prototype.slice.call(arguments);
  1658. return n.unshift(e), t.push(n), t;
  1659. };
  1660. });
  1661. for (var e = 0; e < t.methods.length; e++) {
  1662. var n = t.methods[e];
  1663. t[n] = t.factory(n);
  1664. }
  1665. (t.load = function (t) {
  1666. var e = document.createElement("script");
  1667. (e.type = "text/javascript"),
  1668. (e.async = !0),
  1669. (e.src =
  1670. ("https:" === document.location.protocol ? "https://" : "http://") +
  1671. "cdn.segment.com/analytics.js/v1/" +
  1672. t +
  1673. "/analytics.min.js");
  1674. var n = document.getElementsByTagName("script")[0];
  1675. n.parentNode.insertBefore(e, n);
  1676. }),
  1677. (t.SNIPPET_VERSION = "4.0.0");
  1678. }
  1679. })();
  1680. !(function (i, e) {
  1681. "use strict";
  1682. var s = "",
  1683. r = "?",
  1684. o = "function",
  1685. a = "undefined",
  1686. n = "object",
  1687. t = "major",
  1688. d = "model",
  1689. w = "name",
  1690. l = "type",
  1691. p = "vendor",
  1692. m = "version",
  1693. c = "architecture",
  1694. u = "console",
  1695. g = "mobile",
  1696. f = "tablet",
  1697. h = "smarttv",
  1698. b = {
  1699. has: function (i, e) {
  1700. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1;
  1701. },
  1702. lowerize: function (i) {
  1703. return i.toLowerCase();
  1704. },
  1705. },
  1706. y = {
  1707. rgx: function () {
  1708. for (
  1709. var i, s, r, t, d, w, l, p = 0, m = arguments;
  1710. p < m.length;
  1711. p += 2
  1712. ) {
  1713. var c = m[p],
  1714. u = m[p + 1];
  1715. if (typeof i === a) {
  1716. i = {};
  1717. for (t in u)
  1718. (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e);
  1719. }
  1720. for (s = r = 0; s < c.length; s++)
  1721. if ((w = c[s].exec(this.getUA()))) {
  1722. for (t = 0; t < u.length; t++)
  1723. (l = w[++r]),
  1724. (d = u[t]),
  1725. typeof d === n && d.length > 0
  1726. ? 2 == d.length
  1727. ? typeof d[1] == o
  1728. ? (i[d[0]] = d[1].call(this, l))
  1729. : (i[d[0]] = d[1])
  1730. : 3 == d.length
  1731. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1732. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1733. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1734. : 4 == d.length &&
  1735. (i[d[0]] = l
  1736. ? d[3].call(this, l.replace(d[1], d[2]))
  1737. : e)
  1738. : (i[d] = l ? l : e);
  1739. break;
  1740. }
  1741. if (w) break;
  1742. }
  1743. return i;
  1744. },
  1745. str: function (i, s) {
  1746. for (var o in s)
  1747. if (typeof s[o] === n && s[o].length > 0) {
  1748. for (var a = 0; a < s[o].length; a++)
  1749. if (b.has(s[o][a], i)) return o === r ? e : o;
  1750. } else if (b.has(s[o], i)) return o === r ? e : o;
  1751. return i;
  1752. },
  1753. },
  1754. v = {
  1755. browser: {
  1756. oldsafari: {
  1757. major: {
  1758. 1: ["/8", "/1", "/3"],
  1759. 2: "/4",
  1760. "?": "/",
  1761. },
  1762. version: {
  1763. "1.0": "/8",
  1764. 1.2: "/1",
  1765. 1.3: "/3",
  1766. "2.0": "/412",
  1767. "2.0.2": "/416",
  1768. "2.0.3": "/417",
  1769. "2.0.4": "/419",
  1770. "?": "/",
  1771. },
  1772. },
  1773. },
  1774. device: {
  1775. sprint: {
  1776. model: {
  1777. "Evo Shift 4G": "7373KT",
  1778. },
  1779. vendor: {
  1780. HTC: "APA",
  1781. Sprint: "Sprint",
  1782. },
  1783. },
  1784. },
  1785. os: {
  1786. windows: {
  1787. version: {
  1788. ME: "4.90",
  1789. "NT 3.11": "NT3.51",
  1790. "NT 4.0": "NT4.0",
  1791. 2e3: "NT 5.0",
  1792. XP: ["NT 5.1", "NT 5.2"],
  1793. Vista: "NT 6.0",
  1794. 7: "NT 6.1",
  1795. 8: "NT 6.2",
  1796. 8.1: "NT 6.3",
  1797. RT: "ARM",
  1798. },
  1799. },
  1800. },
  1801. },
  1802. k = {
  1803. browser: [
  1804. [
  1805. /(opera\smini)\/((\d+)?[\w\.-]+)/i,
  1806. /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,
  1807. /(opera).+version\/((\d+)?[\w\.]+)/i,
  1808. /(opera)[\/\s]+((\d+)?[\w\.]+)/i,
  1809. ],
  1810. [w, m, t],
  1811. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1812. [[w, "Opera"], m, t],
  1813. [
  1814. /(kindle)\/((\d+)?[\w\.]+)/i,
  1815. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1816. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1817. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1818. /(rekonq)((?:\/)[\w\.]+)*/i,
  1819. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i,
  1820. ],
  1821. [w, m, t],
  1822. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1823. [[w, "IE"], m, t],
  1824. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1825. [[w, "Yandex"], m, t],
  1826. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1827. [[w, /_/g, " "], m, t],
  1828. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1829. [w, m, t],
  1830. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1831. [[w, "Dolphin"], m, t],
  1832. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1833. [[w, "Chrome"], m, t],
  1834. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1835. [m, t, [w, "Mobile Safari"]],
  1836. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1837. [m, t, w],
  1838. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1839. [
  1840. w,
  1841. [t, y.str, v.browser.oldsafari.major],
  1842. [m, y.str, v.browser.oldsafari.version],
  1843. ],
  1844. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1845. [w, m, t],
  1846. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1847. [[w, "Netscape"], m, t],
  1848. [
  1849. /(swiftfox)/i,
  1850. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1851. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1852. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1853. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1854. /(links)\s\(((\d+)?[\w\.]+)/i,
  1855. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1856. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1857. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i,
  1858. ],
  1859. [w, m, t],
  1860. [
  1861. /(apple(?:coremedia|))\/((\d+)[\w\._]+)/i,
  1862. /(coremedia) v((\d+)[\w\._]+)/i,
  1863. ],
  1864. [w, m, t],
  1865. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1866. [w, m],
  1867. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1868. [w, m, t],
  1869. [
  1870. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1871. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1872. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1873. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i,
  1874. ],
  1875. [w, m, t],
  1876. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1877. [w, m, t],
  1878. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1879. [[w, "Flip Player"], m, t],
  1880. [
  1881. /(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i,
  1882. ],
  1883. [w],
  1884. [
  1885. /(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i,
  1886. ],
  1887. [w, m, t],
  1888. [
  1889. /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i,
  1890. /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
  1891. /(lavf)((\d+)[\d\.]+)/i,
  1892. ],
  1893. [w, m, t],
  1894. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1895. [[w, /_/g, " "], m, t],
  1896. [
  1897. /(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i,
  1898. ],
  1899. [w, m],
  1900. [
  1901. /(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i,
  1902. /(mplayer) unknown-((\d+)[\w\.\-]+)/i,
  1903. ],
  1904. [w, m, t],
  1905. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1906. [w],
  1907. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1908. [w, m, t],
  1909. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1910. [w, m, t],
  1911. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1912. [w, m, t],
  1913. [
  1914. /(winamp)3 version ((\d+)[\w\.-]+)/i,
  1915. /(winamp)\s((\d+)[\w\.-]+)/i,
  1916. /(winamp)mpeg\/((\d+)[\w\.-]+)/i,
  1917. ],
  1918. [w, m, t],
  1919. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1920. [w],
  1921. [
  1922. /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i,
  1923. ],
  1924. [w, m, t],
  1925. [/(smp)((\d+)[\d\.]+)/i],
  1926. [w, m, t],
  1927. [
  1928. /(vlc) media player - version ((\d+)[\w\.]+)/i,
  1929. /(vlc)\/((\d+)[\w\.-]+)/i,
  1930. /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i,
  1931. /(foobar2000)\/((\d+)[\d\.]+)/i,
  1932. /(itunes)\/((\d+)[\d\.]+)/i,
  1933. ],
  1934. [w, m, t],
  1935. [
  1936. /(wmplayer)\/((\d+)[\w\.-]+)/i,
  1937. /(windows-media-player)\/((\d+)[\w\.-]+)/i,
  1938. ],
  1939. [[w, /-/g, " "], m, t],
  1940. [
  1941. /windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i,
  1942. ],
  1943. [m, t, [w, "Windows"]],
  1944. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1945. [w, m, t],
  1946. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1947. [[w, "rad.io"], m, t],
  1948. ],
  1949. cpu: [
  1950. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1951. [[c, "amd64"]],
  1952. [/(ia32(?=;))/i],
  1953. [[c, b.lowerize]],
  1954. [/((?:i[346]|x)86)[;\)]/i],
  1955. [[c, "ia32"]],
  1956. [/windows\s(ce|mobile);\sppc;/i],
  1957. [[c, "arm"]],
  1958. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1959. [[c, /ower/, "", b.lowerize]],
  1960. [/(sun4\w)[;\)]/i],
  1961. [[c, "sparc"]],
  1962. [
  1963. /(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i,
  1964. ],
  1965. [c, b.lowerize],
  1966. ],
  1967. device: [
  1968. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1969. [d, p, [l, f]],
  1970. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1971. [d, [p, "Apple"], [l, f]],
  1972. [/(apple\s{0,1}tv)/i],
  1973. [
  1974. [d, "Apple TV"],
  1975. [p, "Apple"],
  1976. ],
  1977. [
  1978. /(hp).+(touchpad)/i,
  1979. /(kindle)\/([\w\.]+)/i,
  1980. /\s(nook)[\w\s]+build\/(\w+)/i,
  1981. /(dell)\s(strea[kpr\s\d]*[\dko])/i,
  1982. ],
  1983. [p, d, [l, f]],
  1984. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1985. [d, p, [l, g]],
  1986. [/\((ip[honed|\s\w*]+);/i],
  1987. [d, [p, "Apple"], [l, g]],
  1988. [
  1989. /(blackberry)[\s-]?(\w+)/i,
  1990. /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,
  1991. /(hp)\s([\w\s]+\w)/i,
  1992. /(asus)-?(\w+)/i,
  1993. ],
  1994. [p, d, [l, g]],
  1995. [/\((bb10);\s(\w+)/i],
  1996. [[p, "BlackBerry"], d, [l, g]],
  1997. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1998. [[p, "Asus"], d, [l, f]],
  1999. [/(sony)\s(tablet\s[ps])/i],
  2000. [p, d, [l, f]],
  2001. [/(nintendo)\s([wids3u]+)/i],
  2002. [p, d, [l, u]],
  2003. [/((playstation)\s[3portablevi]+)/i],
  2004. [[p, "Sony"], d, [l, u]],
  2005. [/(sprint\s(\w+))/i],
  2006. [
  2007. [p, y.str, v.device.sprint.vendor],
  2008. [d, y.str, v.device.sprint.model],
  2009. [l, g],
  2010. ],
  2011. [
  2012. /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,
  2013. /(zte)-(\w+)*/i,
  2014. /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i,
  2015. ],
  2016. [p, [d, /_/g, " "], [l, g]],
  2017. [
  2018. /\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
  2019. /(mot)[\s-]?(\w+)*/i,
  2020. ],
  2021. [[p, "Motorola"], d, [l, g]],
  2022. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  2023. [[p, "Motorola"], d, [l, f]],
  2024. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  2025. [[p, "Samsung"], d, [l, f]],
  2026. [
  2027. /((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,
  2028. /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
  2029. /sec-((sgh\w+))/i,
  2030. ],
  2031. [[p, "Samsung"], d, [l, g]],
  2032. [/(sie)-(\w+)*/i],
  2033. [[p, "Siemens"], d, [l, g]],
  2034. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  2035. [[p, "Nokia"], d, [l, g]],
  2036. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  2037. [[p, "Acer"], d, [l, f]],
  2038. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  2039. [[p, "LG"], d, [l, f]],
  2040. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  2041. [[p, "LG"], d, [l, g]],
  2042. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  2043. [[p, "Lenovo"], d, [l, f]],
  2044. [/(lg) netcast\.tv/i],
  2045. [p, [l, h]],
  2046. [/(mobile|tablet);.+rv\:.+gecko\//i],
  2047. [l, p, d],
  2048. ],
  2049. engine: [
  2050. [
  2051. /(presto)\/([\w\.]+)/i,
  2052. /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,
  2053. /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,
  2054. /(icab)[\/\s]([23]\.[\d\.]+)/i,
  2055. ],
  2056. [w, m],
  2057. [/rv\:([\w\.]+).*(gecko)/i],
  2058. [m, w],
  2059. ],
  2060. os: [
  2061. [/microsoft\s(windows)\s(vista|xp)/i],
  2062. [w, m],
  2063. [
  2064. /(windows)\snt\s6\.2;\s(arm)/i,
  2065. /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i,
  2066. ],
  2067. [w, [m, y.str, v.os.windows.version]],
  2068. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  2069. [
  2070. [w, "Windows"],
  2071. [m, y.str, v.os.windows.version],
  2072. ],
  2073. [/\((bb)(10);/i],
  2074. [[w, "BlackBerry"], m],
  2075. [
  2076. /(blackberry)\w*\/?([\w\.]+)*/i,
  2077. /(tizen)\/([\w\.]+)/i,
  2078. /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i,
  2079. ],
  2080. [w, m],
  2081. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  2082. [[w, "Symbian"], m],
  2083. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  2084. [[w, "Firefox OS"], m],
  2085. [
  2086. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  2087. /(mint)[\/\s\(]?(\w+)*/i,
  2088. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  2089. /(hurd|linux)\s?([\w\.]+)*/i,
  2090. /(gnu)\s?([\w\.]+)*/i,
  2091. ],
  2092. [w, m],
  2093. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  2094. [[w, "Chromium OS"], m],
  2095. [/(sunos)\s?([\w\.]+\d)*/i],
  2096. [[w, "Solaris"], m],
  2097. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  2098. [w, m],
  2099. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  2100. [
  2101. [w, "iOS"],
  2102. [m, /_/g, "."],
  2103. ],
  2104. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  2105. [w, [m, /_/g, "."]],
  2106. [
  2107. /(haiku)\s(\w+)/i,
  2108. /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,
  2109. /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
  2110. /(unix)\s?([\w\.]+)*/i,
  2111. ],
  2112. [w, m],
  2113. ],
  2114. },
  2115. x = function (e) {
  2116. var r =
  2117. e ||
  2118. (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  2119. return this instanceof x
  2120. ? ((this.getBrowser = function () {
  2121. return y.rgx.apply(this, k.browser);
  2122. }),
  2123. (this.getCPU = function () {
  2124. return y.rgx.apply(this, k.cpu);
  2125. }),
  2126. (this.getDevice = function () {
  2127. return y.rgx.apply(this, k.device);
  2128. }),
  2129. (this.getEngine = function () {
  2130. return y.rgx.apply(this, k.engine);
  2131. }),
  2132. (this.getOS = function () {
  2133. return y.rgx.apply(this, k.os);
  2134. }),
  2135. (this.getResult = function () {
  2136. return {
  2137. ua: this.getUA(),
  2138. browser: this.getBrowser(),
  2139. engine: this.getEngine(),
  2140. os: this.getOS(),
  2141. device: this.getDevice(),
  2142. cpu: this.getCPU(),
  2143. };
  2144. }),
  2145. (this.getUA = function () {
  2146. return r;
  2147. }),
  2148. (this.setUA = function (i) {
  2149. return (r = i), this;
  2150. }),
  2151. void this.setUA(r))
  2152. : new x(e).getResult();
  2153. };
  2154. if (typeof exports !== a)
  2155. typeof module !== a && module.exports && (exports = module.exports = x),
  2156. (exports.UAParser = x);
  2157. else if (
  2158. ((i.UAParser = x),
  2159. typeof define === o &&
  2160. define.amd &&
  2161. define(function () {
  2162. return x;
  2163. }),
  2164. typeof i.jQuery !== a)
  2165. ) {
  2166. var A = i.jQuery,
  2167. _ = new x();
  2168. (A.ua = _.getResult()),
  2169. (A.ua.get = function () {
  2170. return _.getUA();
  2171. }),
  2172. (A.ua.set = function (i) {
  2173. _.setUA(i);
  2174. var e = _.getResult();
  2175. for (var s in e) A.ua[s] = e[s];
  2176. });
  2177. }
  2178. })(this);
  2179. window.Modernizr = (function (n, e, t) {
  2180. function o(n) {
  2181. d.cssText = n;
  2182. }
  2183. function r(n, e) {
  2184. return typeof n === e;
  2185. }
  2186. var i,
  2187. c,
  2188. u,
  2189. a = "2.8.2",
  2190. f = {},
  2191. s = e.documentElement,
  2192. l = "modernizr",
  2193. p = e.createElement(l),
  2194. d = p.style,
  2195. y = ({}.toString, {}),
  2196. w = [],
  2197. b = w.slice,
  2198. v = {}.hasOwnProperty;
  2199. (u =
  2200. r(v, "undefined") || r(v.call, "undefined")
  2201. ? function (n, e) {
  2202. return e in n && r(n.constructor.prototype[e], "undefined");
  2203. }
  2204. : function (n, e) {
  2205. return v.call(n, e);
  2206. }),
  2207. Function.prototype.bind ||
  2208. (Function.prototype.bind = function (n) {
  2209. var e = this;
  2210. if ("function" != typeof e) throw new TypeError();
  2211. var t = b.call(arguments, 1),
  2212. o = function () {
  2213. if (this instanceof o) {
  2214. var r = function () {};
  2215. r.prototype = e.prototype;
  2216. var i = new r(),
  2217. c = e.apply(i, t.concat(b.call(arguments)));
  2218. return Object(c) === c ? c : i;
  2219. }
  2220. return e.apply(n, t.concat(b.call(arguments)));
  2221. };
  2222. return o;
  2223. }),
  2224. (y.webgl = function () {
  2225. return !!n.WebGLRenderingContext;
  2226. });
  2227. for (var h in y)
  2228. u(y, h) &&
  2229. ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? "" : "no-") + c));
  2230. return (
  2231. (f.addTest = function (n, e) {
  2232. if ("object" == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o]);
  2233. else {
  2234. if (((n = n.toLowerCase()), f[n] !== t)) return f;
  2235. (e = "function" == typeof e ? e() : e),
  2236. "undefined" != typeof enableClasses &&
  2237. enableClasses &&
  2238. (s.className += " " + (e ? "" : "no-") + n),
  2239. (f[n] = e);
  2240. }
  2241. return f;
  2242. }),
  2243. o(""),
  2244. (p = i = null),
  2245. (f._version = a),
  2246. f
  2247. );
  2248. })(this, this.document);
  2249. !(function (e, t, a) {
  2250. "use strict";
  2251. function n(t, h, m) {
  2252. function H(a) {
  2253. var n = 0,
  2254. i = Ee.length;
  2255. if (
  2256. ((Ce.old = e.extend({}, Ce)),
  2257. (Ie = we ? 0 : be[ge.horizontal ? "width" : "height"]()),
  2258. (ke = Be[ge.horizontal ? "width" : "height"]()),
  2259. (ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"]()),
  2260. (Ee.length = 0),
  2261. (Ce.start = 0),
  2262. (Ce.end = q(ze - Ie, 0)),
  2263. Re)
  2264. ) {
  2265. (n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0);
  2266. var r,
  2267. s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"),
  2268. o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"),
  2269. l = "border-box" === e(qe).css("boxSizing"),
  2270. u = "none" !== qe.css("float"),
  2271. f = 0,
  2272. v = qe.length - 1;
  2273. (ze = 0),
  2274. qe.each(function (t, a) {
  2275. var n = e(a),
  2276. i = a.getBoundingClientRect(),
  2277. l = E(
  2278. ge.horizontal
  2279. ? i.width || i.right - i.left
  2280. : i.height || i.bottom - i.top
  2281. ),
  2282. d = c(n, ge.horizontal ? "marginLeft" : "marginTop"),
  2283. p = c(n, ge.horizontal ? "marginRight" : "marginBottom"),
  2284. h = l + d + p,
  2285. m = !d || !p,
  2286. g = {};
  2287. (g.el = a),
  2288. (g.size = m ? l : h),
  2289. (g.half = g.size / 2),
  2290. (g.start = ze + (m ? d : 0)),
  2291. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  2292. (g.end = g.start - Ie + g.size),
  2293. t || (ze += s),
  2294. (ze += h),
  2295. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  2296. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  2297. Ne.push(g),
  2298. (r = g);
  2299. }),
  2300. (Pe[0].style[ge.horizontal ? "width" : "height"] =
  2301. (l ? ze : ze - s - o) + "px"),
  2302. (ze -= f),
  2303. Ne.length
  2304. ? ((Ce.start = Ne[0][Me ? "center" : "start"]),
  2305. (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start))
  2306. : (Ce.start = Ce.end = 0);
  2307. }
  2308. if (
  2309. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  2310. Q(),
  2311. Se.length &&
  2312. ke > 0 &&
  2313. (ge.dynamicHandle
  2314. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)),
  2315. (Te = d(Te, ge.minHandleSize, ke)),
  2316. (Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px"))
  2317. : (Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"]()),
  2318. (xe.end = ke - Te),
  2319. it || j()),
  2320. !we && Ie > 0)
  2321. ) {
  2322. var p = Ce.start,
  2323. h = "";
  2324. if (Re)
  2325. e.each(Ne, function (e, t) {
  2326. Me
  2327. ? Ee.push(t.center)
  2328. : t.start + t.size > p &&
  2329. p <= Ce.end &&
  2330. ((p = t.start),
  2331. Ee.push(p),
  2332. (p += Ie),
  2333. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end));
  2334. });
  2335. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie);
  2336. if (De[0] && i !== Ee.length) {
  2337. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m);
  2338. (Ae = De.html(h).children()),
  2339. Ae.eq(Oe.activePage).addClass(ge.activeClass);
  2340. }
  2341. }
  2342. if (
  2343. ((Oe.slideeSize = ze),
  2344. (Oe.frameSize = Ie),
  2345. (Oe.sbSize = ke),
  2346. (Oe.handleSize = Te),
  2347. Re)
  2348. ) {
  2349. a &&
  2350. null != ge.startAt &&
  2351. (W(ge.startAt), ye[Le ? "toCenter" : "toStart"](ge.startAt));
  2352. var g = Ne[Oe.activeItem];
  2353. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end));
  2354. } else
  2355. a
  2356. ? null != ge.startAt && X(ge.startAt, 1)
  2357. : X(d(Ce.dest, Ce.start, Ce.end));
  2358. pe("load");
  2359. }
  2360. function X(e, t, a) {
  2361. if (Re && at.released && !a) {
  2362. var n = $(e),
  2363. i = e > Ce.start && e < Ce.end;
  2364. Le
  2365. ? (i && (e = Ne[n.centerItem].center),
  2366. Me && ge.activateMiddle && W(n.centerItem))
  2367. : i && (e = Ne[n.firstItem].start);
  2368. }
  2369. at.init && at.slidee && ge.elasticBounds
  2370. ? e > Ce.end
  2371. ? (e = Ce.end + (e - Ce.end) / 6)
  2372. : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)
  2373. : (e = d(e, Ce.start, Ce.end)),
  2374. (et.start = +new Date()),
  2375. (et.time = 0),
  2376. (et.from = Ce.cur),
  2377. (et.to = e),
  2378. (et.delta = e - Ce.cur),
  2379. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  2380. (et.immediate =
  2381. !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  2382. (at.tweese = 0),
  2383. e !== Ce.dest && ((Ce.dest = e), pe("change"), it || Y()),
  2384. K(),
  2385. Q(),
  2386. Z(),
  2387. F();
  2388. }
  2389. function Y() {
  2390. if (ye.initialized) {
  2391. if (!it) return (it = w(Y)), void (at.released && pe("moveStart"));
  2392. et.immediate
  2393. ? (Ce.cur = et.to)
  2394. : et.tweesing
  2395. ? ((et.tweeseDelta = et.to - Ce.cur),
  2396. x(et.tweeseDelta) < 0.1
  2397. ? (Ce.cur = et.to)
  2398. : (Ce.cur +=
  2399. et.tweeseDelta *
  2400. (at.released ? ge.swingSpeed : ge.syncSpeed)))
  2401. : ((et.time = N(+new Date() - et.start, ge.speed)),
  2402. (Ce.cur =
  2403. et.from +
  2404. et.delta *
  2405. e.easing[ge.easing](
  2406. et.time / ge.speed,
  2407. et.time,
  2408. 0,
  2409. 1,
  2410. ge.speed
  2411. ))),
  2412. et.to === Ce.cur
  2413. ? ((Ce.cur = et.to), (at.tweese = it = 0))
  2414. : (it = w(Y)),
  2415. pe("move"),
  2416. we ||
  2417. (f
  2418. ? (Pe[0].style[f] =
  2419. v +
  2420. (ge.horizontal ? "translateX" : "translateY") +
  2421. "(" +
  2422. -Ce.cur +
  2423. "px)")
  2424. : (Pe[0].style[ge.horizontal ? "left" : "top"] =
  2425. -E(Ce.cur) + "px")),
  2426. !it && at.released && pe("moveEnd"),
  2427. j();
  2428. }
  2429. }
  2430. function j() {
  2431. Se.length &&
  2432. ((xe.cur =
  2433. Ce.start === Ce.end
  2434. ? 0
  2435. : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) /
  2436. (Ce.end - Ce.start)) *
  2437. xe.end),
  2438. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  2439. _e.hPos !== xe.cur &&
  2440. ((_e.hPos = xe.cur),
  2441. f
  2442. ? (Se[0].style[f] =
  2443. v +
  2444. (ge.horizontal ? "translateX" : "translateY") +
  2445. "(" +
  2446. xe.cur +
  2447. "px)")
  2448. : (Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px")));
  2449. }
  2450. function F() {
  2451. Ae[0] &&
  2452. _e.page !== Oe.activePage &&
  2453. ((_e.page = Oe.activePage),
  2454. Ae.removeClass(ge.activeClass)
  2455. .eq(Oe.activePage)
  2456. .addClass(ge.activeClass),
  2457. pe("activePage", _e.page));
  2458. }
  2459. function M() {
  2460. (tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  2461. (ot = at.init ? w(M) : 0),
  2462. (tt.now = +new Date()),
  2463. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  2464. X(at.init ? tt.pos : E(tt.pos)),
  2465. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  2466. (tt.lastTime = tt.now);
  2467. }
  2468. function L(e, t, n) {
  2469. if (("boolean" === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n);
  2470. else {
  2471. if (Le && "center" !== e) return;
  2472. var r = ye.getPos(t);
  2473. r && X(r[e], n, !Le);
  2474. }
  2475. }
  2476. function R(e) {
  2477. return null != e
  2478. ? l(e)
  2479. ? e >= 0 && e < Ne.length
  2480. ? e
  2481. : -1
  2482. : qe.index(e)
  2483. : -1;
  2484. }
  2485. function U(e) {
  2486. return R(l(e) && 0 > e ? e + Ne.length : e);
  2487. }
  2488. function W(e, t) {
  2489. var a = R(e);
  2490. return (
  2491. !(!Re || 0 > a) &&
  2492. ((_e.active !== a || t) &&
  2493. (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2494. qe.eq(a).addClass(ge.activeClass),
  2495. (_e.active = Oe.activeItem = a),
  2496. Z(),
  2497. pe("active", a)),
  2498. a)
  2499. );
  2500. }
  2501. function $(e) {
  2502. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  2503. var t = {},
  2504. a = Me ? 0 : Ie / 2;
  2505. if (!we)
  2506. for (var n = 0, i = Ee.length; i > n; n++) {
  2507. if (e >= Ce.end || n === Ee.length - 1) {
  2508. t.activePage = Ee.length - 1;
  2509. break;
  2510. }
  2511. if (e <= Ee[n] + a) {
  2512. t.activePage = n;
  2513. break;
  2514. }
  2515. }
  2516. if (Re) {
  2517. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2518. if (
  2519. (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2520. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2521. c === u - 1 || e <= Ne[c].end + Ne[c].half)
  2522. ) {
  2523. s = c;
  2524. break;
  2525. }
  2526. (t.firstItem = l(r) ? r : 0),
  2527. (t.centerItem = l(o) ? o : t.firstItem),
  2528. (t.lastItem = l(s) ? s : t.centerItem);
  2529. }
  2530. return t;
  2531. }
  2532. function Q(t) {
  2533. e.extend(Oe, $(t));
  2534. }
  2535. function Z() {
  2536. var e = Ce.dest <= Ce.start,
  2537. t = Ce.dest >= Ce.end,
  2538. a = (e ? 1 : 0) | (t ? 2 : 0);
  2539. if (
  2540. (_e.slideePosState !== a &&
  2541. ((_e.slideePosState = a),
  2542. Je.is("button,input") && Je.prop("disabled", e),
  2543. Ke.is("button,input") && Ke.prop("disabled", t),
  2544. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  2545. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  2546. _e.fwdbwdState !== a &&
  2547. at.released &&
  2548. ((_e.fwdbwdState = a),
  2549. Qe.is("button,input") && Qe.prop("disabled", e),
  2550. $e.is("button,input") && $e.prop("disabled", t)),
  2551. Re && null != Oe.activeItem)
  2552. ) {
  2553. var n = 0 === Oe.activeItem,
  2554. i = Oe.activeItem >= Ne.length - 1,
  2555. r = (n ? 1 : 0) | (i ? 2 : 0);
  2556. _e.itemsButtonState !== r &&
  2557. ((_e.itemsButtonState = r),
  2558. Ze.is("button,input") && Ze.prop("disabled", n),
  2559. Ge.is("button,input") && Ge.prop("disabled", i),
  2560. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  2561. Ge[i ? "addClass" : "removeClass"](ge.disabledClass));
  2562. }
  2563. }
  2564. function G(e, t, a) {
  2565. if (
  2566. ((e = U(e)),
  2567. (t = U(t)),
  2568. e > -1 &&
  2569. t > -1 &&
  2570. e !== t &&
  2571. (!a || t !== e - 1) &&
  2572. (a || t !== e + 1))
  2573. ) {
  2574. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  2575. var n = t > e ? e : a ? t : t - 1,
  2576. i = e > t ? e : a ? t + 1 : t,
  2577. r = e > t;
  2578. null != Oe.activeItem &&
  2579. (e === Oe.activeItem
  2580. ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1)
  2581. : Oe.activeItem > n &&
  2582. Oe.activeItem < i &&
  2583. (_e.active = Oe.activeItem += r ? 1 : -1)),
  2584. H();
  2585. }
  2586. }
  2587. function J(e, t) {
  2588. for (var a = 0, n = Ve[e].length; n > a; a++)
  2589. if (Ve[e][a] === t) return a;
  2590. return -1;
  2591. }
  2592. function K() {
  2593. at.released && !ye.isPaused && ye.resume();
  2594. }
  2595. function V(e) {
  2596. return (
  2597. E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start
  2598. );
  2599. }
  2600. function _() {
  2601. (at.history[0] = at.history[1]),
  2602. (at.history[1] = at.history[2]),
  2603. (at.history[2] = at.history[3]),
  2604. (at.history[3] = at.delta);
  2605. }
  2606. function ee(e) {
  2607. (at.released = 0), (at.source = e), (at.slidee = "slidee" === e);
  2608. }
  2609. function te(t) {
  2610. var a = "touchstart" === t.type,
  2611. n = t.data.source,
  2612. i = "slidee" === n;
  2613. at.init ||
  2614. (!a && ie(t.target)) ||
  2615. (("handle" !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2616. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2617. (a || r(t),
  2618. ee(n),
  2619. (at.init = 0),
  2620. (at.$source = e(t.target)),
  2621. (at.touch = a),
  2622. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2623. (at.initX = at.pointer.pageX),
  2624. (at.initY = at.pointer.pageY),
  2625. (at.initPos = i ? Ce.cur : xe.cur),
  2626. (at.start = +new Date()),
  2627. (at.time = 0),
  2628. (at.path = 0),
  2629. (at.delta = 0),
  2630. (at.locked = 0),
  2631. (at.history = [0, 0, 0, 0]),
  2632. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2633. b.on(a ? z : I, ae),
  2634. ye.pause(1),
  2635. (i ? Pe : Se).addClass(ge.draggedClass),
  2636. pe("moveStart"),
  2637. i && (rt = setInterval(_, 10))));
  2638. }
  2639. function ae(e) {
  2640. if (
  2641. ((at.released = "mouseup" === e.type || "touchend" === e.type),
  2642. (at.pointer = at.touch
  2643. ? e.originalEvent[at.released ? "changedTouches" : "touches"][0]
  2644. : e),
  2645. (at.pathX = at.pointer.pageX - at.initX),
  2646. (at.pathY = at.pointer.pageY - at.initY),
  2647. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2648. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2649. at.released || !(at.path < 1))
  2650. ) {
  2651. if (!at.init) {
  2652. if (
  2653. !(ge.horizontal
  2654. ? x(at.pathX) > x(at.pathY)
  2655. : x(at.pathX) < x(at.pathY))
  2656. )
  2657. return ne();
  2658. at.init = 1;
  2659. }
  2660. r(e),
  2661. !at.locked &&
  2662. at.path > at.pathToLock &&
  2663. at.slidee &&
  2664. ((at.locked = 1), at.$source.on(B, s)),
  2665. at.released &&
  2666. (ne(),
  2667. ge.releaseSwing &&
  2668. at.slidee &&
  2669. ((at.swing = ((at.delta - at.history[0]) / 40) * 300),
  2670. (at.delta += at.swing),
  2671. (at.tweese = x(at.swing) > 10))),
  2672. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta));
  2673. }
  2674. }
  2675. function ne() {
  2676. clearInterval(rt),
  2677. (at.released = !0),
  2678. b.off(at.touch ? z : I, ae),
  2679. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2680. setTimeout(function () {
  2681. at.$source.off(B, s);
  2682. }),
  2683. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  2684. ye.resume(1),
  2685. (at.init = 0);
  2686. }
  2687. function ie(t) {
  2688. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive);
  2689. }
  2690. function re() {
  2691. ye.stop(), b.off("mouseup", re);
  2692. }
  2693. function se(e) {
  2694. switch ((r(e), this)) {
  2695. case $e[0]:
  2696. case Qe[0]:
  2697. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on("mouseup", re);
  2698. break;
  2699. case Ze[0]:
  2700. ye.prev();
  2701. break;
  2702. case Ge[0]:
  2703. ye.next();
  2704. break;
  2705. case Je[0]:
  2706. ye.prevPage();
  2707. break;
  2708. case Ke[0]:
  2709. ye.nextPage();
  2710. }
  2711. }
  2712. function oe(e) {
  2713. return (
  2714. (nt.curDelta =
  2715. (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2716. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2717. Re
  2718. ? ((p = +new Date()),
  2719. nt.last < p - nt.resetTime && (nt.delta = 0),
  2720. (nt.last = p),
  2721. (nt.delta += nt.curDelta),
  2722. x(nt.delta) < 1
  2723. ? (nt.finalDelta = 0)
  2724. : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2725. nt.finalDelta)
  2726. : nt.curDelta
  2727. );
  2728. }
  2729. function le(e) {
  2730. e.originalEvent[g] = ye;
  2731. var t = +new Date();
  2732. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  2733. return void (O = t);
  2734. if (ge.scrollBy && Ce.start !== Ce.end) {
  2735. var a = oe(e.originalEvent);
  2736. (ge.scrollTrap ||
  2737. (a > 0 && Ce.dest < Ce.end) ||
  2738. (0 > a && Ce.dest > Ce.start)) &&
  2739. r(e, 1),
  2740. ye.slideBy(ge.scrollBy * a);
  2741. }
  2742. }
  2743. function ce(e) {
  2744. ge.clickBar &&
  2745. e.target === Be[0] &&
  2746. (r(e),
  2747. X(
  2748. V(
  2749. (ge.horizontal
  2750. ? e.pageX - Be.offset().left
  2751. : e.pageY - Be.offset().top) -
  2752. Te / 2
  2753. )
  2754. ));
  2755. }
  2756. function de(e) {
  2757. if (ge.keyboardNavBy)
  2758. switch (e.which) {
  2759. case ge.horizontal ? 37 : 38:
  2760. r(e), ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  2761. break;
  2762. case ge.horizontal ? 39 : 40:
  2763. r(e), ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]();
  2764. }
  2765. }
  2766. function ue(e) {
  2767. return ie(this)
  2768. ? void (e.originalEvent[g + "ignore"] = !0)
  2769. : void (
  2770. this.parentNode !== Pe[0] ||
  2771. e.originalEvent[g + "ignore"] ||
  2772. ye.activate(this)
  2773. );
  2774. }
  2775. function fe() {
  2776. this.parentNode === De[0] && ye.activatePage(Ae.index(this));
  2777. }
  2778. function ve(e) {
  2779. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2);
  2780. }
  2781. function pe(e, t) {
  2782. if (Ve[e]) {
  2783. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++)
  2784. T.push(Ve[e][he]);
  2785. for (he = 0; me > he; he++) T[he].call(ye, e, t);
  2786. }
  2787. }
  2788. var he,
  2789. me,
  2790. ge = e.extend({}, n.defaults, h),
  2791. ye = this,
  2792. we = l(t),
  2793. be = e(t),
  2794. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2795. Ie = 0,
  2796. ze = 0,
  2797. Ce = {
  2798. start: 0,
  2799. center: 0,
  2800. end: 0,
  2801. cur: 0,
  2802. dest: 0,
  2803. },
  2804. Be = e(ge.scrollBar).eq(0),
  2805. Se = Be.children().eq(0),
  2806. ke = 0,
  2807. Te = 0,
  2808. xe = {
  2809. start: 0,
  2810. end: 0,
  2811. cur: 0,
  2812. },
  2813. De = e(ge.pagesBar),
  2814. Ae = 0,
  2815. Ee = [],
  2816. qe = 0,
  2817. Ne = [],
  2818. Oe = {
  2819. firstItem: 0,
  2820. lastItem: 0,
  2821. centerItem: 0,
  2822. activeItem: null,
  2823. activePage: 0,
  2824. },
  2825. He = new u(be[0]),
  2826. Xe = new u(Pe[0]),
  2827. Ye = new u(Be[0]),
  2828. je = new u(Se[0]),
  2829. Fe = "basic" === ge.itemNav,
  2830. Me = "forceCentered" === ge.itemNav,
  2831. Le = "centered" === ge.itemNav || Me,
  2832. Re = !we && (Fe || Le || Me),
  2833. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2834. We = ge.dragSource ? e(ge.dragSource) : be,
  2835. $e = e(ge.forward),
  2836. Qe = e(ge.backward),
  2837. Ze = e(ge.prev),
  2838. Ge = e(ge.next),
  2839. Je = e(ge.prevPage),
  2840. Ke = e(ge.nextPage),
  2841. Ve = {},
  2842. _e = {},
  2843. et = {},
  2844. tt = {},
  2845. at = {
  2846. released: 1,
  2847. },
  2848. nt = {
  2849. last: 0,
  2850. delta: 0,
  2851. resetTime: 200,
  2852. },
  2853. it = 0,
  2854. rt = 0,
  2855. st = 0,
  2856. ot = 0;
  2857. we || (t = be[0]),
  2858. (ye.initialized = 0),
  2859. (ye.frame = t),
  2860. (ye.slidee = Pe[0]),
  2861. (ye.pos = Ce),
  2862. (ye.rel = Oe),
  2863. (ye.items = Ne),
  2864. (ye.pages = Ee),
  2865. (ye.isPaused = 0),
  2866. (ye.options = ge),
  2867. (ye.dragging = at),
  2868. (ye.reload = function () {
  2869. H();
  2870. }),
  2871. (ye.getPos = function (e) {
  2872. if (Re) {
  2873. var t = R(e);
  2874. return -1 !== t && Ne[t];
  2875. }
  2876. var a = Pe.find(e).eq(0);
  2877. if (a[0]) {
  2878. var n = ge.horizontal
  2879. ? a.offset().left - Pe.offset().left
  2880. : a.offset().top - Pe.offset().top,
  2881. i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2882. return {
  2883. start: n,
  2884. center: n - Ie / 2 + i / 2,
  2885. end: n - Ie + i,
  2886. size: i,
  2887. };
  2888. }
  2889. return !1;
  2890. }),
  2891. (ye.moveBy = function (e) {
  2892. (tt.speed = e),
  2893. !at.init &&
  2894. tt.speed &&
  2895. Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) &&
  2896. ((tt.lastTime = +new Date()),
  2897. (tt.startPos = Ce.cur),
  2898. ee("button"),
  2899. (at.init = 1),
  2900. pe("moveStart"),
  2901. y(ot),
  2902. M());
  2903. }),
  2904. (ye.stop = function () {
  2905. "button" === at.source && ((at.init = 0), (at.released = 1));
  2906. }),
  2907. (ye.prev = function () {
  2908. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1);
  2909. }),
  2910. (ye.next = function () {
  2911. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1);
  2912. }),
  2913. (ye.prevPage = function () {
  2914. ye.activatePage(Oe.activePage - 1);
  2915. }),
  2916. (ye.nextPage = function () {
  2917. ye.activatePage(Oe.activePage + 1);
  2918. }),
  2919. (ye.slideBy = function (e, t) {
  2920. e &&
  2921. (Re
  2922. ? ye[Le ? "toCenter" : "toStart"](
  2923. d(
  2924. (Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e,
  2925. 0,
  2926. Ne.length
  2927. )
  2928. )
  2929. : X(Ce.dest + e, t));
  2930. }),
  2931. (ye.slideTo = function (e, t) {
  2932. X(e, t);
  2933. }),
  2934. (ye.toStart = function (e, t) {
  2935. L("start", e, t);
  2936. }),
  2937. (ye.toEnd = function (e, t) {
  2938. L("end", e, t);
  2939. }),
  2940. (ye.toCenter = function (e, t) {
  2941. L("center", e, t);
  2942. }),
  2943. (ye.getIndex = R),
  2944. (ye.activate = function (e, t) {
  2945. var a = W(e);
  2946. ge.smart &&
  2947. a !== !1 &&
  2948. (Le
  2949. ? ye.toCenter(a, t)
  2950. : a >= Oe.lastItem
  2951. ? ye.toStart(a, t)
  2952. : a <= Oe.firstItem
  2953. ? ye.toEnd(a, t)
  2954. : K());
  2955. }),
  2956. (ye.activatePage = function (e, t) {
  2957. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t);
  2958. }),
  2959. (ye.resume = function (e) {
  2960. ge.cycleBy &&
  2961. ge.cycleInterval &&
  2962. ("items" !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2963. !(e < ye.isPaused) &&
  2964. ((ye.isPaused = 0),
  2965. st ? (st = clearTimeout(st)) : pe("resume"),
  2966. (st = setTimeout(function () {
  2967. switch ((pe("cycle"), ge.cycleBy)) {
  2968. case "items":
  2969. ye.activate(
  2970. Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1
  2971. );
  2972. break;
  2973. case "pages":
  2974. ye.activatePage(
  2975. Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1
  2976. );
  2977. }
  2978. }, ge.cycleInterval)));
  2979. }),
  2980. (ye.pause = function (e) {
  2981. e < ye.isPaused ||
  2982. ((ye.isPaused = e || 100),
  2983. st && ((st = clearTimeout(st)), pe("pause")));
  2984. }),
  2985. (ye.toggle = function () {
  2986. ye[st ? "pause" : "resume"]();
  2987. }),
  2988. (ye.set = function (t, a) {
  2989. e.isPlainObject(t)
  2990. ? e.extend(ge, t)
  2991. : ge.hasOwnProperty(t) && (ge[t] = a);
  2992. }),
  2993. (ye.add = function (t, a) {
  2994. var n = e(t);
  2995. Re
  2996. ? (null == a || !Ne[0] || a >= Ne.length
  2997. ? n.appendTo(Pe)
  2998. : Ne.length && n.insertBefore(Ne[a].el),
  2999. null != Oe.activeItem &&
  3000. a <= Oe.activeItem &&
  3001. (_e.active = Oe.activeItem += n.length))
  3002. : Pe.append(n),
  3003. H();
  3004. }),
  3005. (ye.remove = function (t) {
  3006. if (Re) {
  3007. var a = U(t);
  3008. if (a > -1) {
  3009. qe.eq(a).remove();
  3010. var n = a === Oe.activeItem;
  3011. null != Oe.activeItem &&
  3012. a < Oe.activeItem &&
  3013. (_e.active = --Oe.activeItem),
  3014. H(),
  3015. n && ((_e.active = null), ye.activate(Oe.activeItem));
  3016. }
  3017. } else e(t).remove(), H();
  3018. }),
  3019. (ye.moveAfter = function (e, t) {
  3020. G(e, t, 1);
  3021. }),
  3022. (ye.moveBefore = function (e, t) {
  3023. G(e, t);
  3024. }),
  3025. (ye.on = function (e, t) {
  3026. if ("object" === i(e))
  3027. for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a]);
  3028. else if ("function" === i(t))
  3029. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  3030. (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t);
  3031. else if ("array" === i(t))
  3032. for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o]);
  3033. }),
  3034. (ye.one = function (e, t) {
  3035. function a() {
  3036. t.apply(ye, arguments), ye.off(e, a);
  3037. }
  3038. ye.on(e, a);
  3039. }),
  3040. (ye.off = function (e, t) {
  3041. if (t instanceof Array)
  3042. for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a]);
  3043. else
  3044. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  3045. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0;
  3046. else {
  3047. var o = J(i[r], t);
  3048. -1 !== o && Ve[i[r]].splice(o, 1);
  3049. }
  3050. }),
  3051. (ye.destroy = function () {
  3052. return (
  3053. Ue.add(Se)
  3054. .add(Be)
  3055. .add(De)
  3056. .add($e)
  3057. .add(Qe)
  3058. .add(Ze)
  3059. .add(Ge)
  3060. .add(Je)
  3061. .add(Ke)
  3062. .off("." + g),
  3063. b.off("keydown", de),
  3064. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  3065. qe &&
  3066. null != Oe.activeItem &&
  3067. qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  3068. De.empty(),
  3069. we ||
  3070. (be.off("." + g),
  3071. He.restore(),
  3072. Xe.restore(),
  3073. Ye.restore(),
  3074. je.restore(),
  3075. e.removeData(t, g)),
  3076. (Ne.length = Ee.length = 0),
  3077. (_e = {}),
  3078. (ye.initialized = 0),
  3079. ye
  3080. );
  3081. }),
  3082. (ye.init = function () {
  3083. if (!ye.initialized) {
  3084. ye.on(m);
  3085. var e = ["overflow", "position"],
  3086. t = [
  3087. "position",
  3088. "webkitTransform",
  3089. "msTransform",
  3090. "transform",
  3091. "left",
  3092. "top",
  3093. "width",
  3094. "height",
  3095. ];
  3096. He.save.apply(He, e),
  3097. Ye.save.apply(Ye, e),
  3098. Xe.save.apply(Xe, t),
  3099. je.save.apply(je, t);
  3100. var a = Se;
  3101. return (
  3102. we ||
  3103. ((a = a.add(Pe)),
  3104. be.css("overflow", "hidden"),
  3105. f ||
  3106. "static" !== be.css("position") ||
  3107. be.css("position", "relative")),
  3108. f
  3109. ? v && a.css(f, v)
  3110. : ("static" === Be.css("position") &&
  3111. Be.css("position", "relative"),
  3112. a.css({
  3113. position: "absolute",
  3114. })),
  3115. ge.forward && $e.on(S, se),
  3116. ge.backward && Qe.on(S, se),
  3117. ge.prev && Ze.on(B, se),
  3118. ge.next && Ge.on(B, se),
  3119. ge.prevPage && Je.on(B, se),
  3120. ge.nextPage && Ke.on(B, se),
  3121. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  3122. Be[0] && Be.on(B, ce),
  3123. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  3124. De[0] &&
  3125. ge.activatePageOn &&
  3126. De.on(ge.activatePageOn + "." + g, "*", fe),
  3127. We.on(
  3128. P,
  3129. {
  3130. source: "slidee",
  3131. },
  3132. te
  3133. ),
  3134. Se &&
  3135. Se.on(
  3136. P,
  3137. {
  3138. source: "handle",
  3139. },
  3140. te
  3141. ),
  3142. b.on("keydown", de),
  3143. we ||
  3144. (be.on("mouseenter." + g + " mouseleave." + g, ve),
  3145. be.on("scroll." + g, o)),
  3146. (ye.initialized = 1),
  3147. H(!0),
  3148. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  3149. ye
  3150. );
  3151. }
  3152. });
  3153. }
  3154. function i(e) {
  3155. return null == e
  3156. ? String(e)
  3157. : "object" == typeof e || "function" == typeof e
  3158. ? Object.prototype.toString
  3159. .call(e)
  3160. .match(/\s([a-z]+)/i)[1]
  3161. .toLowerCase() || "object"
  3162. : typeof e;
  3163. }
  3164. function r(e, t) {
  3165. e.preventDefault(), t && e.stopPropagation();
  3166. }
  3167. function s(t) {
  3168. r(t, 1), e(this).off(t.type, s);
  3169. }
  3170. function o() {
  3171. (this.scrollLeft = 0), (this.scrollTop = 0);
  3172. }
  3173. function l(e) {
  3174. return !isNaN(parseFloat(e)) && isFinite(e);
  3175. }
  3176. function c(e, t) {
  3177. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""));
  3178. }
  3179. function d(e, t, a) {
  3180. return t > e ? t : e > a ? a : e;
  3181. }
  3182. function u(e) {
  3183. var t = {};
  3184. return (
  3185. (t.style = {}),
  3186. (t.save = function () {
  3187. if (e && e.nodeType) {
  3188. for (var a = 0; a < arguments.length; a++)
  3189. t.style[arguments[a]] = e.style[arguments[a]];
  3190. return t;
  3191. }
  3192. }),
  3193. (t.restore = function () {
  3194. if (e && e.nodeType) {
  3195. for (var a in t.style)
  3196. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  3197. return t;
  3198. }
  3199. }),
  3200. t
  3201. );
  3202. }
  3203. var f,
  3204. v,
  3205. p,
  3206. h = "sly",
  3207. m = "Sly",
  3208. g = h,
  3209. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  3210. w = t.requestAnimationFrame,
  3211. b = e(document),
  3212. P = "touchstart." + g + " mousedown." + g,
  3213. I = "mousemove." + g + " mouseup." + g,
  3214. z = "touchmove." + g + " touchend." + g,
  3215. C =
  3216. (document.implementation.hasFeature("Event.wheel", "3.0")
  3217. ? "wheel."
  3218. : "mousewheel.") + g,
  3219. B = "click." + g,
  3220. S = "mousedown." + g,
  3221. k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"],
  3222. T = [],
  3223. x = Math.abs,
  3224. D = Math.sqrt,
  3225. A = Math.pow,
  3226. E = Math.round,
  3227. q = Math.max,
  3228. N = Math.min,
  3229. O = 0;
  3230. b.on(C, function (e) {
  3231. var t = e.originalEvent[g],
  3232. a = +new Date();
  3233. (!t || t.options.scrollHijack < a - O) && (O = a);
  3234. }),
  3235. (function (e) {
  3236. function t(e) {
  3237. var t = new Date().getTime(),
  3238. n = Math.max(0, 16 - (t - a)),
  3239. i = setTimeout(e, n);
  3240. return (a = t), i;
  3241. }
  3242. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  3243. var a = new Date().getTime(),
  3244. n =
  3245. e.cancelAnimationFrame ||
  3246. e.webkitCancelAnimationFrame ||
  3247. e.clearTimeout;
  3248. y = function (t) {
  3249. n.call(e, t);
  3250. };
  3251. })(window),
  3252. (function () {
  3253. function e(e) {
  3254. for (var n = 0, i = t.length; i > n; n++) {
  3255. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  3256. if (null != a.style[r]) return r;
  3257. }
  3258. }
  3259. var t = ["", "webkit", "moz", "ms", "o"],
  3260. a = document.createElement("div");
  3261. (f = e("transform")), (v = e("perspective") ? "translateZ(0) " : "");
  3262. })(),
  3263. (t[m] = n),
  3264. (e.fn[h] = function (t, a) {
  3265. var r, s;
  3266. return (
  3267. e.isPlainObject(t) ||
  3268. (("string" === i(t) || t === !1) &&
  3269. ((r = t === !1 ? "destroy" : t),
  3270. (s = Array.prototype.slice.call(arguments, 1))),
  3271. (t = {})),
  3272. this.each(function (i, o) {
  3273. var l = e.data(o, g);
  3274. l || r
  3275. ? l && r && l[r] && l[r].apply(l, s)
  3276. : (l = e.data(o, g, new n(o, t, a).init()));
  3277. })
  3278. );
  3279. }),
  3280. (n.defaults = {
  3281. slidee: null,
  3282. horizontal: !1,
  3283. itemNav: null,
  3284. itemSelector: null,
  3285. smart: !1,
  3286. activateOn: null,
  3287. activateMiddle: !1,
  3288. scrollSource: null,
  3289. scrollBy: 0,
  3290. scrollHijack: 300,
  3291. scrollTrap: !1,
  3292. dragSource: null,
  3293. mouseDragging: !1,
  3294. touchDragging: !1,
  3295. releaseSwing: !1,
  3296. swingSpeed: 0.2,
  3297. elasticBounds: !1,
  3298. interactive: null,
  3299. scrollBar: null,
  3300. dragHandle: !1,
  3301. dynamicHandle: !1,
  3302. minHandleSize: 50,
  3303. clickBar: !1,
  3304. syncSpeed: 0.5,
  3305. pagesBar: null,
  3306. activatePageOn: null,
  3307. pageBuilder: function (e) {
  3308. return "<li>" + (e + 1) + "</li>";
  3309. },
  3310. forward: null,
  3311. backward: null,
  3312. prev: null,
  3313. next: null,
  3314. prevPage: null,
  3315. nextPage: null,
  3316. cycleBy: null,
  3317. cycleInterval: 5e3,
  3318. pauseOnHover: !1,
  3319. startPaused: !1,
  3320. moveBy: 300,
  3321. speed: 0,
  3322. easing: "swing",
  3323. startAt: null,
  3324. keyboardNavBy: null,
  3325. draggedClass: "dragged",
  3326. activeClass: "active",
  3327. disabledClass: "disabled",
  3328. });
  3329. })(jQuery, window);
  3330. !(function e(t, i, n) {
  3331. function r(a, s) {
  3332. if (!i[a]) {
  3333. if (!t[a]) {
  3334. var l = "function" == typeof require && require;
  3335. if (!s && l) return l(a, !0);
  3336. if (o) return o(a, !0);
  3337. var c = new Error("Cannot find module '" + a + "'");
  3338. throw ((c.code = "MODULE_NOT_FOUND"), c);
  3339. }
  3340. var h = (i[a] = {
  3341. exports: {},
  3342. });
  3343. t[a][0].call(
  3344. h.exports,
  3345. function (e) {
  3346. var i = t[a][1][e];
  3347. return r(i ? i : e);
  3348. },
  3349. h,
  3350. h.exports,
  3351. e,
  3352. t,
  3353. i,
  3354. n
  3355. );
  3356. }
  3357. return i[a].exports;
  3358. }
  3359. for (
  3360. var o = "function" == typeof require && require, a = 0;
  3361. a < n.length;
  3362. a++
  3363. )
  3364. r(n[a]);
  3365. return r;
  3366. })(
  3367. {
  3368. 1: [
  3369. function (e, t, i) {
  3370. (function (i) {
  3371. "use strict";
  3372. function n(e) {
  3373. (this.player = null),
  3374. (this.director = null),
  3375. (this.modelManager = null),
  3376. (this.container = null),
  3377. (this.tagManager = null),
  3378. (this.fadeInSpeed = e),
  3379. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) ||
  3380. (this.fadeInSpeed = 0);
  3381. }
  3382. var r = e("three"),
  3383. o = e("./util/logger"),
  3384. a = (e("./util/common"), e("./enum/PlayerEvents")),
  3385. s = e("./enum/DirectorEvents"),
  3386. l = e("./settings"),
  3387. c = e("./enum/Viewmode"),
  3388. h =
  3389. (e("./enum/WarpStyle"),
  3390. e("./enum/BlackoutStyle"),
  3391. e("./enum/ModelManagerEvents")),
  3392. u = e("./enum/tagEvents"),
  3393. d = e("./util/transitions"),
  3394. p = e("./util/lerp"),
  3395. f = new o(i);
  3396. //window.THREE = r;
  3397. (n.prototype.init = function (e, t, i, n, r) {
  3398. window.app = this;
  3399. (this.player = t),
  3400. (this.director = e),
  3401. (this.modelManager = i),
  3402. (this.tagManager = n),
  3403. (this.container = r),
  3404. this.updateModel(),
  3405. this.bindEvents();
  3406. }),
  3407. (n.prototype.bindEvents = function () {
  3408. this.modelManager.on(
  3409. h.ActiveModelChanged,
  3410. this.updateModel.bind(this)
  3411. ),
  3412. this.player.on(
  3413. a.ModeChanging,
  3414. this.handlePlayerModeChanging.bind(this)
  3415. ),
  3416. this.player.on(
  3417. a.ModeChanged,
  3418. this.handlePlayerModeChanged.bind(this)
  3419. ),
  3420. this.player.on(
  3421. a.ClosestPanoChanging,
  3422. this.handleClosestPanoChanging.bind(this)
  3423. ),
  3424. this.player.on(
  3425. a.StartInside,
  3426. this.handleStartInside.bind(this)
  3427. ),
  3428. this.player.on(
  3429. a.StartOutside,
  3430. this.handleStartOutside.bind(this)
  3431. ),
  3432. this.player.on(
  3433. a.WarpStarted,
  3434. this.handleWarpStarted.bind(this)
  3435. ),
  3436. this.director.on(
  3437. s.ActionInterrupted,
  3438. this.handleActionInterruption.bind(this)
  3439. ),
  3440. this.tagManager.on(
  3441. u.TagActivated,
  3442. this.ontagActivated.bind(this)
  3443. ),
  3444. this.tagManager.on(
  3445. u.TagNavigation,
  3446. this.onNavigationTotag.bind(this)
  3447. );
  3448. }),
  3449. (n.prototype.updateModel = function () {
  3450. //模型this.model
  3451. this.model = this.modelManager.getActiveModel();
  3452. }),
  3453. (n.prototype.handleWarpStarted = function () {
  3454. this.hidePlayerReticule();
  3455. }),
  3456. (n.prototype.ontagActivated = function () {
  3457. this.hidePlayerReticule();
  3458. }),
  3459. (n.prototype.onNavigationTotag = function () {
  3460. this.hidePlayerReticule();
  3461. }),
  3462. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  3463. var n = this.modelManager.getActiveModel(),
  3464. r =
  3465. this.player.is360View(t, i) || this.director.tourIsPlaying
  3466. ? 0
  3467. : l[t].markerOpacity;
  3468. n.fadePanoMarkers(r), n.setMode(t);
  3469. }),
  3470. (n.prototype.handlePlayerModeChanged = function (e, t) {
  3471. var i = this.modelManager.getActiveModel(),
  3472. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  3473. i.setSide(n), i.setMode(t);
  3474. }),
  3475. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  3476. i !== c.TRANSITIONING &&
  3477. (e && !this.director.tourIsPlaying && e.hoverOff(i),
  3478. t && !this.director.tourIsPlaying && t.hoverOn(i));
  3479. }),
  3480. (n.prototype.handleActionInterruption = function () {}),
  3481. (n.prototype.handleStartInside = function (e) {
  3482. var t = l[this.player.mode],
  3483. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  3484. this.fadeIn(this.fadeInSpeed),
  3485. (this.model.alpha = 0),
  3486. (this.model.skybox.material.uniforms.opacity.value = 1),
  3487. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  3488. var n = this.player.reticule;
  3489. d.start(
  3490. p.property(n.material, "opacity", 0),
  3491. i,
  3492. null,
  3493. 0,
  3494. null,
  3495. "retReOpac"
  3496. );
  3497. }),
  3498. (n.prototype.handleStartOutside = function (e) {
  3499. this.fadeIn(e);
  3500. }),
  3501. (n.prototype.fadeIn = function (e) {
  3502. (null !== e && void 0 !== e) ||
  3503. ((e = 2e3),
  3504. f.warn(
  3505. "DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms."
  3506. )),
  3507. $(this.container).fadeIn(e);
  3508. }),
  3509. (n.prototype.hidePlayerReticule = function () {
  3510. this.player.reticule.hide();
  3511. }),
  3512. (t.exports = n);
  3513. }).call(this, "/js/DisplayController.js");
  3514. },
  3515. {
  3516. "./enum/BlackoutStyle": 18,
  3517. "./enum/DirectorEvents": 23,
  3518. "./enum/tagEvents": 32,
  3519. "./enum/ModelManagerEvents": 33,
  3520. "./enum/PlayerEvents": 40,
  3521. "./enum/Viewmode": 51,
  3522. "./enum/WarpStyle": 52,
  3523. "./settings": 166,
  3524. "./util/common": 185,
  3525. "./util/lerp": 188,
  3526. "./util/logger": 189,
  3527. "./util/transitions": 195,
  3528. three: 217,
  3529. },
  3530. ],
  3531. 2: [
  3532. function (e, t, i) {
  3533. "use strict";
  3534. function n() {
  3535. (this.baseStartTime = performance.timing.navigationStart),
  3536. (this.loadingStartTime = null),
  3537. (this.waitingStartTime = null),
  3538. (this.appReadyTime = null);
  3539. }
  3540. (n.prototype.setBaseStartTime = function (e) {
  3541. this.baseStartTime = e || Date.now();
  3542. }),
  3543. (n.prototype.setWaitingStartTime = function (e) {
  3544. this.waitingStartTime = e || Date.now();
  3545. }),
  3546. (n.prototype.setLoadingStartTime = function (e) {
  3547. this.loadingStartTime = e || Date.now();
  3548. }),
  3549. (n.prototype.setAppReadyTime = function (e) {
  3550. this.appReadyTime = e || Date.now();
  3551. }),
  3552. (n.prototype.calcFullLoadingTime = function () {
  3553. var e = this.appReadyTime - this.baseStartTime;
  3554. return (
  3555. this.waitingStartTime &&
  3556. (e -= this.loadingStartTime - this.waitingStartTime),
  3557. e
  3558. );
  3559. }),
  3560. (t.exports = n);
  3561. },
  3562. {},
  3563. ],
  3564. 3: [
  3565. function (e, t, i) {
  3566. (function (i) {
  3567. "use strict";
  3568. function n() {
  3569. return 100 * Math.random();
  3570. }
  3571. var r = e("./util/logger"),
  3572. o = e("./util/browser"),
  3573. a = new r(i),
  3574. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3575. initialized: !1,
  3576. init: function (e, t) {
  3577. if (((t = t || {}), !this.initialized)) {
  3578. (this.initialized = !0),
  3579. o.valueFromHash("tilegen") &&
  3580. (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  3581. o.valueFromHash("imgopt") &&
  3582. (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  3583. for (var i in e) {
  3584. var r = i.match("^sc_tilegen_([0-9]+)$");
  3585. r && (s.tilegen = n() < parseInt(r[1]));
  3586. var l = i.match("^sc_imgopt_([0-9]+)$");
  3587. l && (s.imgopt = n() < parseInt(l[1]));
  3588. }
  3589. for (var c in t)
  3590. (s[c] = t[c]), a.debug("A/B override:", c, s[c]);
  3591. }
  3592. },
  3593. changeIfTileGenerating: function (e) {
  3594. return (
  3595. s.tilegen &&
  3596. ((e += e.indexOf("?") === -1 ? "?" : "&"), (e += "")),
  3597. e
  3598. );
  3599. },
  3600. changeIfImageOptimzing: function (e) {
  3601. return (
  3602. s.imgopt &&
  3603. e.indexOf("imgopt=1") === -1 &&
  3604. ((e += e.indexOf("?") === -1 ? "?" : "&"), (e += "")),
  3605. e
  3606. );
  3607. },
  3608. tilegen: !1,
  3609. imgopt: !1,
  3610. });
  3611. t.exports = s;
  3612. }).call(this, "/js/ab.js");
  3613. },
  3614. {
  3615. "./util/browser": 182,
  3616. "./util/logger": 189,
  3617. },
  3618. ],
  3619. 4: [
  3620. function (e, t, i) {
  3621. (function (i) {
  3622. "use strict";
  3623. function n() {
  3624. return {
  3625. addons: [
  3626. {
  3627. name: "keen:ua_parser",
  3628. input: {
  3629. ua_string: "user_agent",
  3630. },
  3631. output: "parsed_user_agent",
  3632. },
  3633. ],
  3634. };
  3635. }
  3636. function r(e, t, i, n) {
  3637. function r(t) {
  3638. l[t.sid] = !0;
  3639. var i = t.billboard.media && t.billboard.media.type,
  3640. n = {
  3641. tag_id: t.sid,
  3642. tags_visited: Object.keys(l).length,
  3643. tag_count: Object.keys(e.tags).length,
  3644. tag_view_count: ++E,
  3645. has_media: !!i,
  3646. };
  3647. i && (n.media_type = i), u("tag_opened", n);
  3648. }
  3649. var l = {},
  3650. h = Date.now() - N,
  3651. f = null;
  3652. n && (f = Date.now() - window.navigationStart);
  3653. var g;
  3654. try {
  3655. g =
  3656. /* e.data.player_options.highlight_reel && */ e.heroLocations
  3657. .length > 0;
  3658. } catch (e) {
  3659. g = !1;
  3660. }
  3661. var v,
  3662. A = e.supportsVR;
  3663. A ||
  3664. ((v = "VR disabled at the model/account level"),
  3665. m.valueFromHash("vr") === _.NONE
  3666. ? (v = "VR disabled, using &vr=0")
  3667. : m.detectAndroid()
  3668. ? b.isDeviceSupported(w.Android) ||
  3669. (v = "VR disabled, unsupported Android version")
  3670. : m.detectIOS() &&
  3671. (b.isDeviceSupported(w.IOS) ||
  3672. (v = "VR disabled, unsupported iOS version"))),
  3673. u("model_loaded", {
  3674. duration: h,
  3675. duration_from_navigation_start: f,
  3676. has_hlr: g,
  3677. has_vr: A,
  3678. vr_reason: v,
  3679. });
  3680. var I = 0;
  3681. e.panos.forEach(function (e) {
  3682. e.on("enter", function () {
  3683. c("pano_viewed", {
  3684. pano_id: e.id,
  3685. pano_view_count: ++I,
  3686. alignment_type: e.alignmentType,
  3687. interaction_source: O,
  3688. navigation_source: p,
  3689. });
  3690. });
  3691. });
  3692. var E = 0;
  3693. for (var T in e.tags)
  3694. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  3695. t.on("tour_auto", function (e) {
  3696. p = "tour_" + e;
  3697. }),
  3698. t.on("tour_manual", function (e) {
  3699. (O = "gui-" + e), (p = "tour_manual");
  3700. }),
  3701. i.on(C.InteractionKey, function () {
  3702. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey);
  3703. }),
  3704. i.on(C.InteractionDirect, function () {
  3705. t.mode === y.TRANSITIONING ||
  3706. t.flying ||
  3707. d(C.InteractionDirect);
  3708. }),
  3709. o(t),
  3710. a(),
  3711. s();
  3712. }
  3713. function o(e) {
  3714. I.on(T.OPENED, function () {
  3715. c("showcase_share_intent", {
  3716. pano_id: e.currentPano && e.currentPano.id,
  3717. });
  3718. }),
  3719. I.on(T.LINK_CLICKED, function (t) {
  3720. c("showcase_share_action", {
  3721. channel: t.channel,
  3722. pano_id: e.currentPano && e.currentPano.id,
  3723. });
  3724. }),
  3725. E.on(x.ORIGIN_LINK_CLICKED, function () {
  3726. c("showcase_share_origin_link_clicked");
  3727. });
  3728. }
  3729. function a() {}
  3730. function s() {
  3731. b.on(
  3732. S.OPENED,
  3733. c.bind(this, "showcase_gui", {
  3734. gui_action: "click_vr_button",
  3735. })
  3736. ),
  3737. b.on(S.LAUNCH, function (e) {
  3738. c("showcase_gui", {
  3739. gui_action: "launch_vr",
  3740. vr_platform: e.vr_platform,
  3741. vr_app: e.vr_app,
  3742. });
  3743. }),
  3744. b.on(
  3745. S.PREV,
  3746. c.bind(this, "showcase_gui", {
  3747. gui_action: "vr_modal_prev",
  3748. })
  3749. ),
  3750. b.on(S.NEXT, function (e) {
  3751. c("showcase_gui", {
  3752. gui_action: e.nextAction,
  3753. });
  3754. }),
  3755. b.on(
  3756. S.CLOSED,
  3757. c.bind(this, "showcase_gui", {
  3758. gui_action: "vr_modal_close",
  3759. })
  3760. ),
  3761. b.on(S.falseICECHOSEN, function (e) {
  3762. c("showcase_gui", {
  3763. gui_action: e.name + " ",
  3764. });
  3765. }),
  3766. b.on(S.STORE, function (e) {
  3767. c("showcase_gui", {
  3768. gui_action: "launch_store",
  3769. store: e,
  3770. });
  3771. });
  3772. }
  3773. function l(e, t) {
  3774. if (f)
  3775. try {
  3776. f.addEvent(
  3777. e,
  3778. v.extendObject(
  3779. {
  3780. host: window.location.host,
  3781. keen: n(),
  3782. user_agent: "${keen.user_agent}",
  3783. referrer: {
  3784. url: v.normalizeUrl(document.referrer),
  3785. domain: v.domainFromUrl(document.referrer),
  3786. url_original: document.referrer,
  3787. },
  3788. embedded: m.inIframe(),
  3789. is_mobile: m.isMobile(),
  3790. version: "2.25.6-0-gd87e5b1",
  3791. },
  3792. t
  3793. )
  3794. );
  3795. } catch (e) {
  3796. P.warn(
  3797. "analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " +
  3798. e
  3799. );
  3800. }
  3801. }
  3802. function c(e, t) {
  3803. if (((t = t || {}), L))
  3804. try {
  3805. window.analytics.track(e, v.extendObject(t, B), {
  3806. context: {
  3807. app: {
  3808. name: "showcase",
  3809. version: "2.25.6-0-gd87e5b1",
  3810. },
  3811. screen: {
  3812. width: window.screen.width,
  3813. height: window.screen.height,
  3814. density: window.devicePixelRatio,
  3815. },
  3816. },
  3817. });
  3818. } catch (t) {
  3819. console.warn("Failed to send data to segment for " + e);
  3820. }
  3821. }
  3822. function h(e, t) {
  3823. if (((t = t || {}), navigator.sendBeacon && L))
  3824. try {
  3825. navigator.sendBeacon(
  3826. "https://api.segment.io/v1/t",
  3827. JSON.stringify({
  3828. event: e,
  3829. anonymousId: window.analytics.user().anonymousId(),
  3830. properties: v.extendObject(t, B),
  3831. writeKey: L,
  3832. sentAt: Date.now(),
  3833. type: "track",
  3834. context: {
  3835. userAgent: m.userAgent(),
  3836. library: {
  3837. name: "showcase-beacon",
  3838. version: "2.25.6-0-gd87e5b1",
  3839. },
  3840. app: {
  3841. name: "showcase",
  3842. version: "2.25.6-0-gd87e5b1",
  3843. },
  3844. },
  3845. })
  3846. );
  3847. } catch (e) {
  3848. console.warn("Failed to send async segment request");
  3849. }
  3850. }
  3851. function u(e, t) {
  3852. (t = t || {}), c(e, t);
  3853. }
  3854. function d(e, t) {
  3855. (O = e === C.InteractionGui ? "gui-" + t : e), (p = "self_guided");
  3856. }
  3857. var p,
  3858. f,
  3859. g = (e("three"), e("./util/ajax"), e("./ab")),
  3860. m = e("./util/browser"),
  3861. v = e("./util/common"),
  3862. A = e("./settings"),
  3863. y = (e("./localization/localize"), e("./enum/Viewmode")),
  3864. C = e("./enum/ControlEvents"),
  3865. I = e("./gui/sharing/modal"),
  3866. E = e("./gui/title/titleBar"),
  3867. b = e("./gui/vr/vrModal"),
  3868. w = e("./enum/VRPlatforms"),
  3869. _ = e("./enum/VROption"),
  3870. T = e("./gui/sharing/ShareEvents"),
  3871. x = e("./gui/title/TitleEvents"),
  3872. S = e("./gui/vr/vrEvent"),
  3873. M = e("./tag/Billboard/BillboardEvent"),
  3874. R = e("./util/logger"),
  3875. P = new R(i),
  3876. O = (e("./enum/PlayerEvents"), "direct"),
  3877. L = null,
  3878. D = !1,
  3879. N = null,
  3880. B = null,
  3881. F = v.uuid4();
  3882. t.exports = {
  3883. report: function (e, t, i, n) {
  3884. l("Session starts", {
  3885. model: e,
  3886. status: t,
  3887. loadtime: Date.now() - (N || Date.now()),
  3888. loadtime_from_navigation_start: i
  3889. ? Date.now() - window.navigationStart
  3890. : null,
  3891. autoplay: i,
  3892. quickstart: n,
  3893. ab_tilegen: g.tilegen,
  3894. ab_imgopt: g.imgopt,
  3895. });
  3896. },
  3897. impression: function (e) {
  3898. e = e || {};
  3899. var t = void 0 === e.isVisible || e.isVisible,
  3900. i =
  3901. (void 0 !== e.immediate && e.immediate,
  3902. window.location.search.substr(1).split("&"));
  3903. u("impression", {
  3904. visible: t,
  3905. url_params: i,
  3906. });
  3907. },
  3908. initKeen: function (e) {
  3909. return e.token && e.appId
  3910. ? void (f = new Keen({
  3911. projectId: e.appId,
  3912. writeKey: e.token,
  3913. readKey: "",
  3914. requestType: "xhr",
  3915. }))
  3916. : void P.warn("no keen token/appId");
  3917. },
  3918. initSegment: function (e) {
  3919. return e.token
  3920. ? ((L = e.token),
  3921. window.analytics.load(e.token),
  3922. (B = {
  3923. model_id: e.model,
  3924. start_source: e.startSource,
  3925. autoplay: e.autoplay,
  3926. quickstart: e.quickstart,
  3927. language_tag: A.languageTag,
  3928. is_mobile: m.isMobile(),
  3929. iframe: m.inIframe(),
  3930. aspect_ratio: m.aspectRatio(),
  3931. session_id: F,
  3932. window: {
  3933. width: $("#player").width(),
  3934. height: $("#player").height(),
  3935. },
  3936. platform: {
  3937. browser: {
  3938. name: $.ua.browser.name,
  3939. major: $.ua.browser.major,
  3940. version: $.ua.browser.version,
  3941. },
  3942. os: {
  3943. name: $.ua.os.name,
  3944. version: $.ua.os.version,
  3945. },
  3946. device: {
  3947. vendor: $.ua.device.vendor,
  3948. model: $.ua.device.model,
  3949. type: $.ua.device.type,
  3950. },
  3951. },
  3952. }),
  3953. (D = Math.random() < A.analytics.sessionTrackingRate),
  3954. P.debug(
  3955. "tracking sample rate = " + A.analytics.sessionTrackingRate
  3956. ),
  3957. void P.debug("tracking this session = " + D))
  3958. : void P.warn("no segment token");
  3959. },
  3960. sessionStart: function (e) {
  3961. P.debug("analytics user_session_start"),
  3962. c("session_started"),
  3963. (N = Date.now()),
  3964. window.addEventListener("unload", function () {
  3965. h("session_ended", {
  3966. duration: Date.now() - N,
  3967. });
  3968. });
  3969. },
  3970. modelLoaded: function (e, t, i, n) {
  3971. r(e, t, i, n);
  3972. },
  3973. loadComplete: function (e) {
  3974. var t = {
  3975. time_to_app_start: e,
  3976. };
  3977. c("load_times", t);
  3978. },
  3979. track: function (e, t) {
  3980. D &&
  3981. (P.debug(
  3982. 'analytics.track("' + e + '", ' + JSON.stringify(t) + " )"
  3983. ),
  3984. c(e, t));
  3985. },
  3986. trackAlways: function (e, t) {
  3987. P.debug(
  3988. 'analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"
  3989. ),
  3990. c(e, t);
  3991. },
  3992. getSessionId: function () {
  3993. return F;
  3994. },
  3995. updateInteraction: d,
  3996. };
  3997. }).call(this, "/js/analytics.js");
  3998. },
  3999. {
  4000. "./ab": 3,
  4001. "./enum/ControlEvents": 21,
  4002. "./enum/PlayerEvents": 40,
  4003. "./enum/VROption": 47,
  4004. "./enum/VRPlatforms": 49,
  4005. "./enum/Viewmode": 51,
  4006. "./gui/sharing/ShareEvents": 76,
  4007. "./gui/sharing/modal": 77,
  4008. "./gui/title/TitleEvents": 80,
  4009. "./gui/title/titleBar": 82,
  4010. "./gui/vr/vrEvent": 85,
  4011. "./gui/vr/vrModal": 87,
  4012. "./localization/localize": 108,
  4013. "./tag/Billboard/BillboardEvent": 120,
  4014. "./settings": 166,
  4015. "./util/ajax": 181,
  4016. "./util/browser": 182,
  4017. "./util/common": 185,
  4018. "./util/logger": 189,
  4019. three: 217,
  4020. },
  4021. ],
  4022. 5: [
  4023. function (e, t, i) {
  4024. "use strict";
  4025. function n() {
  4026. r.PerspectiveCamera.call(
  4027. this,
  4028. a.clampVFOV(o.dollhouseFOV),
  4029. $("#player").width() / $("#player").height(),
  4030. o.dollhouseNear,
  4031. o.dollhouseFar
  4032. ),
  4033. (this.controls = null);
  4034. }
  4035. var r = e("three"),
  4036. o = e("../constants"),
  4037. a = e("../util/cameraLight");
  4038. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  4039. (n.prototype.updateAspect = function (e) {
  4040. (this.aspect = e), this.updateProjectionMatrix();
  4041. }),
  4042. (t.exports = n);
  4043. },
  4044. {
  4045. "../constants": 8,
  4046. "../util/cameraLight": 184,
  4047. three: 217,
  4048. },
  4049. ],
  4050. 6: [
  4051. function (e, t, i) {
  4052. "use strict";
  4053. function n() {
  4054. var e = $("#player").width() / $("#player").height();
  4055. r.OrthographicCamera.call(
  4056. this,
  4057. -o.orthoBase,
  4058. o.orthoBase,
  4059. o.orthoBase / e,
  4060. -o.orthoBase / e,
  4061. o.orthoNear,
  4062. o.orthoFar
  4063. ),
  4064. (this.controls = null),
  4065. this.updateAspect(e);
  4066. }
  4067. var r = e("three"),
  4068. o = e("../constants");
  4069. (n.prototype = Object.create(r.OrthographicCamera.prototype)),
  4070. (n.prototype.updateAspect = function (e) {
  4071. (this.aspect = e),
  4072. (this.top = o.orthoBase / e),
  4073. (this.bottom = -o.orthoBase / e),
  4074. this.updateProjectionMatrix();
  4075. }),
  4076. (t.exports = n);
  4077. },
  4078. {
  4079. "../constants": 8,
  4080. three: 217,
  4081. },
  4082. ],
  4083. 7: [
  4084. function (e, t, i) {
  4085. "use strict";
  4086. function n() {
  4087. r.PerspectiveCamera.call(
  4088. this,
  4089. a.clampVFOV(o.insideFOV),
  4090. $("#player").width() / $("#player").height(),
  4091. o.insideNear,
  4092. o.insideFar
  4093. ),
  4094. (this.controls = null);
  4095. }
  4096. var r = e("three"),
  4097. o = e("../settings"),
  4098. a = e("../util/cameraLight");
  4099. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  4100. (n.prototype.updateAspect = function (e) {
  4101. (this.aspect = e), this.updateProjectionMatrix();
  4102. }),
  4103. (t.exports = n);
  4104. },
  4105. {
  4106. "../settings": 166,
  4107. "../util/cameraLight": 184,
  4108. three: 217,
  4109. },
  4110. ],
  4111. 8: [
  4112. function (e, t, i) {
  4113. "use strict";
  4114. t.exports = {
  4115. signedUrlDefaultExpireTime: 24e4,
  4116. signedUrlCheckInterval: 1e4,
  4117. signedUrlRefreshBuffer: 15e3,
  4118. dollhouseFOV: 70,
  4119. dollhouseNear: 1,
  4120. dollhouseFar: 5e3,
  4121. insideFOV: 70,
  4122. insideFOVMax: 120,
  4123. insideNear: 0.1,
  4124. insideFar: 5e3,
  4125. insideLookSpeed: 0.12,
  4126. insideLookLimitUp: 40, //视角
  4127. insideLookLimitDown: -40,
  4128. orthoNear: 1,
  4129. orthoFar: 5e3,
  4130. orthoBase: 10,
  4131. narrowLandscapeHeight: 290,
  4132. reallyNarrowLandscapeHeight: 250,
  4133. visionTilingStartDate: new Date("8/26/2016"),
  4134. visionTilingStartVersion: "1.1.407.13667",
  4135. windowHeightHighQualityThreshold: 900,
  4136. tourStepDelayDefault: 3500,
  4137. tourStepDelaySlideShow: 5e3,
  4138. workshopApsect: 9 / 16,
  4139. highQualityMaxZoom: 2,
  4140. ultraHighQualityMaxZoom: 3,
  4141. };
  4142. },
  4143. {},
  4144. ],
  4145. 9: [
  4146. function (e, t, i) {
  4147. "use strict";
  4148. function n() {
  4149. (this.activeControl = null),
  4150. (this.controls = {}),
  4151. (this.cameras = {});
  4152. }
  4153. var r = e("./PanoramaControls"),
  4154. o = e("./DollhouseControls"),
  4155. a = e("./FloorplanControls"),
  4156. s = e("../cameras/PanoramaCamera"),
  4157. l = e("../cameras/DollhouseCamera"),
  4158. c = e("../cameras/FloorplanCamera"),
  4159. h = e("events").EventEmitter,
  4160. u = e("../enum/ControlEvents"),
  4161. d = e("../enum/ModelManagerEvents"),
  4162. p = e("../enum/Viewmode"),
  4163. f = e("../settings");
  4164. (n.prototype = Object.create(h.prototype)),
  4165. (n.prototype.init = function (e, t) {
  4166. this.setUpControls(), this.bindEvents(e, t);
  4167. }),
  4168. (n.prototype.activateControls = function (e) {
  4169. this.activeControl &&
  4170. (this.activeControl.reset(), (this.activeControl.enabled = !1)),
  4171. this.controls[e] && (this.controls[e].enabled = !0),
  4172. (this.activeControl = this.controls[e]);
  4173. }),
  4174. (n.prototype.setUpControls = function () {
  4175. var e = {},
  4176. t = {},
  4177. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  4178. n = [s, l, c],
  4179. h = [r, o, a];
  4180. i.forEach(
  4181. function (i, r) {
  4182. (e[i] = new n[r]()),
  4183. (t[i] = new h[r](e[i])),
  4184. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  4185. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  4186. t[i].on(
  4187. u.InteractionDirect,
  4188. this.emit.bind(this, u.InteractionDirect)
  4189. ),
  4190. t[i].on(
  4191. u.InteractionKey,
  4192. this.emit.bind(this, u.InteractionKey)
  4193. ),
  4194. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  4195. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll));
  4196. }.bind(this)
  4197. ),
  4198. (this.controls = t),
  4199. (this.cameras = e);
  4200. }),
  4201. (n.prototype.bindEvents = function (e, t) {
  4202. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  4203. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  4204. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  4205. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  4206. f.useWheel &&
  4207. (e.addEventListener(
  4208. "mousewheel",
  4209. this.onMouseWheel.bind(this),
  4210. { passive: false }
  4211. ),
  4212. e.addEventListener(
  4213. "DOMMouseScroll",
  4214. this.onMouseWheel.bind(this)
  4215. )),
  4216. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  4217. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  4218. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  4219. e.addEventListener("contextmenu", function (e) {
  4220. e.preventDefault();
  4221. }),
  4222. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  4223. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  4224. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  4225. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  4226. e.addEventListener(
  4227. "pointercancel",
  4228. this.onPointerCancel.bind(this)
  4229. ),
  4230. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  4231. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  4232. t.on(
  4233. d.ActiveModelChanged,
  4234. function (e) {
  4235. this.setModelForControls(e.model);
  4236. }.bind(this)
  4237. );
  4238. }),
  4239. (n.prototype.setModelForControls = function (e) {
  4240. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  4241. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  4242. [p.DOLLHOUSE, p.FLOORPLAN].forEach(
  4243. function (e) {
  4244. this.controls[e].setBounds(t);
  4245. }.bind(this)
  4246. );
  4247. }),
  4248. (n.prototype.onMouseDown = function (e) {
  4249. e.preventDefault(),
  4250. this.activeControl && this.activeControl.onMouseDown(e);
  4251. }),
  4252. (n.prototype.onMouseMove = function (e) {
  4253. e.preventDefault(),
  4254. this.activeControl && this.activeControl.onMouseMove(e);
  4255. }),
  4256. (n.prototype.onMouseUp = function (e) {
  4257. e.preventDefault(),
  4258. this.activeControl && this.activeControl.onMouseUp(e);
  4259. }),
  4260. (n.prototype.onMouseOver = function (e) {
  4261. e.preventDefault(),
  4262. this.activeControl && this.activeControl.onMouseOver(e);
  4263. }),
  4264. (n.prototype.onMouseWheel = function (e) {
  4265. e.preventDefault(),
  4266. this.activeControl && this.activeControl.onMouseWheel(e);
  4267. }),
  4268. (n.prototype.onTouchStart = function (e) {
  4269. e.preventDefault(),
  4270. this.activeControl && this.activeControl.onTouchStart(e);
  4271. var hotList = $("#hotListWrap")[0];
  4272. hotList.classList.remove("hotListActive");
  4273. $("#hotListContent ul .active").removeClass("active");
  4274. $("#hotList")[0].classList.remove("active");
  4275. }),
  4276. (n.prototype.onTouchMove = function (e) {
  4277. e.preventDefault(),
  4278. this.activeControl && this.activeControl.onTouchMove(e);
  4279. }),
  4280. (n.prototype.onTouchEnd = function (e) {
  4281. e.preventDefault(),
  4282. this.activeControl && this.activeControl.onTouchEnd(e);
  4283. }),
  4284. (n.prototype.onPointerDown = function (e) {
  4285. if ((e.preventDefault(), this.activeControl))
  4286. switch (e.pointerType) {
  4287. case "mouse":
  4288. this.activeControl.onMouseDown(e);
  4289. break;
  4290. default:
  4291. this.activeControl.onPointerDown(e);
  4292. }
  4293. }),
  4294. (n.prototype.onPointerMove = function (e) {
  4295. if ((e.preventDefault(), this.activeControl))
  4296. switch (e.pointerType) {
  4297. case "mouse":
  4298. this.activeControl.onMouseMove(e);
  4299. break;
  4300. default:
  4301. this.activeControl.onPointerMove(e);
  4302. }
  4303. }),
  4304. (n.prototype.onPointerUp = function (e) {
  4305. if ((e.preventDefault(), this.activeControl))
  4306. switch (e.pointerType) {
  4307. case "mouse":
  4308. this.activeControl.onMouseUp(e);
  4309. break;
  4310. default:
  4311. this.activeControl.onPointerUp(e);
  4312. }
  4313. }),
  4314. (n.prototype.onPointerCancel = function (e) {
  4315. e.preventDefault(),
  4316. this.activeControl &&
  4317. "mouse" !== e.pointerType &&
  4318. this.activeControl.onPointerUp(e);
  4319. }),
  4320. (n.prototype.onKeyDown = function (e) {
  4321. e.metaKey ||
  4322. e.ctrlKey ||
  4323. (e.preventDefault(),
  4324. this.activeControl && this.activeControl.onKeyDown(e));
  4325. }),
  4326. (n.prototype.onKeyUp = function (e) {
  4327. e.preventDefault(),
  4328. this.activeControl && this.activeControl.onKeyUp(e);
  4329. }),
  4330. (t.exports = n);
  4331. },
  4332. {
  4333. "../cameras/DollhouseCamera": 5,
  4334. "../cameras/FloorplanCamera": 6,
  4335. "../cameras/PanoramaCamera": 7,
  4336. "../enum/ControlEvents": 21,
  4337. "../enum/ModelManagerEvents": 33,
  4338. "../enum/Viewmode": 51,
  4339. "../settings": 166,
  4340. "./DollhouseControls": 10,
  4341. "./FloorplanControls": 11,
  4342. "./PanoramaControls": 13,
  4343. events: 202,
  4344. },
  4345. ],
  4346. 10: [
  4347. function (e, t, i) {
  4348. "use strict";
  4349. function n(e) {
  4350. a.call(this, e),
  4351. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4352. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  4353. (this.minDistance = o.dollhouseDefault.minDistance),
  4354. (this.maxDistance = o.dollhouseDefault.maxDistance),
  4355. (this.adjustedMinDistance = this.minDistance),
  4356. (this.adjustedMaxDistance = this.maxDistance);
  4357. }
  4358. var r = e("three"),
  4359. o = e("../settings"),
  4360. a = e("./OutsideControls");
  4361. (n.prototype = Object.create(a.prototype)),
  4362. (n.prototype.pan = function (e, t) {
  4363. this.camera.updateMatrix();
  4364. var i = this.camera.position.clone().sub(this.target).length();
  4365. (i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)),
  4366. this.panLeft((2 * e * i) / $("#player").height()),
  4367. this.panUp((-2 * t * i) / $("#player").height());
  4368. }),
  4369. (n.prototype.updateZoom = function () {
  4370. var e = this.offset.length();
  4371. return e * this.scale;
  4372. }),
  4373. (n.prototype.setZoomBounds = function (e) {
  4374. var t = e.min.distanceTo(e.max);
  4375. (this.adjustedMinDistance = Math.max(
  4376. Math.min(t / 2, o.dollhouseDefault.minDistance),
  4377. 0
  4378. )),
  4379. (this.adjustedMaxDistance = Math.min(
  4380. Math.max(t, o.dollhouseDefault.maxDistance),
  4381. o.skyboxRadius
  4382. )),
  4383. (this.minDistance = this.adjustedMinDistance),
  4384. (this.maxDistance = this.adjustedMaxDistance);
  4385. }),
  4386. (n.prototype.resetRanges = function (e, t) {
  4387. e
  4388. ? ((this.minDistance = Math.min(e, this.minDistance)),
  4389. (this.maxDistance = Math.max(e, this.maxDistance)))
  4390. : ((this.minDistance = this.adjustedMinDistance),
  4391. (this.maxDistance = this.adjustedMaxDistance)),
  4392. t
  4393. ? ((this.minPolarAngle = r.Math.degToRad(-15)),
  4394. (this.maxPolarAngle = r.Math.degToRad(89.9)))
  4395. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4396. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle));
  4397. }),
  4398. (n.prototype.toJSON = function () {
  4399. return a.prototype.toJSON.call(this);
  4400. }),
  4401. (t.exports = n);
  4402. },
  4403. {
  4404. "../settings": 166,
  4405. "./OutsideControls": 12,
  4406. three: 217,
  4407. },
  4408. ],
  4409. 11: [
  4410. function (e, t, i) {
  4411. "use strict";
  4412. function n(e) {
  4413. a.call(this, e),
  4414. (this.minDistance = 15),
  4415. (this.maxDistance = 50),
  4416. (this.noRotateUpDown = !0),
  4417. (this.minPolarAngle = 0),
  4418. (this.maxPolarAngle = 0),
  4419. (this.mouseActions[l.LEFT] = s.PAN),
  4420. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  4421. (this.mouseActions[l.RIGHT] = s.ROTATE),
  4422. (this.touchActions[1] = s.PAN),
  4423. (this.touchActions[2] = s.ROTATE_DOLLY),
  4424. (this.absoluteScale = 1),
  4425. (this.currentScale = 1);
  4426. }
  4427. var r = e("three"),
  4428. o = e("../settings"),
  4429. a = e("./OutsideControls"),
  4430. s = e("../enum/ControlActions"),
  4431. l = e("../enum/MouseButton"),
  4432. c = e("../util/math"),
  4433. h = e("../util/browser");
  4434. (n.prototype = Object.create(a.prototype)),
  4435. (n.prototype.zoomToContain = function (e) {
  4436. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  4437. this.currentScale = this.absoluteScale;
  4438. }),
  4439. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  4440. let defaultRatio = 1.2,
  4441. absoluteScale;
  4442. if (_settings.floorPlanAngle) {
  4443. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  4444. var angle = parseFloat(_settings.floorPlanAngle);
  4445. modelSize = modelSize
  4446. .clone()
  4447. .applyEuler(new THREE.Euler(0, angle, 0));
  4448. var n = Math.max(
  4449. Math.abs(modelSize.x),
  4450. Math.abs(modelSize.z) * this.camera.aspect
  4451. ); //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  4452. var screenSize = Math.min(
  4453. $("#player").width(),
  4454. $("#player").height()
  4455. );
  4456. var maxSize = 800; //模型最大占据像素
  4457. ratio =
  4458. ratio != void 0
  4459. ? ratio
  4460. : Math.max(
  4461. (screenSize * defaultRatio) / maxSize,
  4462. defaultRatio
  4463. );
  4464. absoluteScale = (n / 2 / o.orthoBase) * ratio; //根据模型所占最大视口尺寸调整缩放
  4465. } else {
  4466. var t = Math.max(modelSize.x, modelSize.z),
  4467. i = Math.min(modelSize.x, modelSize.z),
  4468. n = Math.max(t, i * this.camera.aspect),
  4469. r = Math.max(i, t * this.camera.aspect);
  4470. absoluteScale =
  4471. ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) *
  4472. defaultRatio;
  4473. }
  4474. return absoluteScale;
  4475. }),
  4476. /* n.prototype.rotateToView = function(e, t) {
  4477. var i = 0
  4478. , n = h.aspectRatio() < 1
  4479. , r = e.x < e.z;
  4480. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  4481. this.rotateLeft(i),
  4482. this.update(0)
  4483. },
  4484. */
  4485. (n.prototype.rotateToView = function (modelSize, direction) {
  4486. let i = 0,
  4487. n = h.aspectRatio() < 1; //是否模型尺寸显“细长”
  4488. if (_settings.floorPlanAngle) {
  4489. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  4490. i = parseFloat(_settings.floorPlanAngle);
  4491. } else {
  4492. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  4493. if (n === r) {
  4494. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  4495. if (direction.z > 0) {
  4496. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  4497. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  4498. }
  4499. //(第二种情况) 不做处理
  4500. } else if (direction.x > 0) {
  4501. i = Math.PI / 2;
  4502. } else {
  4503. i = -Math.PI / 2;
  4504. }
  4505. }
  4506. this.rotateLeft(i);
  4507. this.update(0);
  4508. }),
  4509. (n.prototype.rotateToAngle = function (angle) {
  4510. //add 旋转到特定角度
  4511. this.rotateLeft(angle + this.lon);
  4512. this.update(0);
  4513. }),
  4514. (n.prototype.pan = function (e, t) {
  4515. this.camera.updateMatrix(),
  4516. this.panLeft(
  4517. (e * (this.camera.right - this.camera.left)) /
  4518. $("#player").width()
  4519. ),
  4520. this.panUp(
  4521. (-t * (this.camera.top - this.camera.bottom)) /
  4522. $("#player").height()
  4523. );
  4524. }),
  4525. (n.prototype.updateZoom = function () {
  4526. return (
  4527. (this.absoluteScale *=
  4528. this.scale - 0.03 * this.keyboardZoomSpeed),
  4529. (this.absoluteScale = Math.max(
  4530. o.zoomNearLimit,
  4531. Math.min(this.absoluteScale, o.zoomFarLimit)
  4532. )),
  4533. (this.currentScale =
  4534. 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  4535. (this.camera.left = -o.orthoBase * this.currentScale),
  4536. (this.camera.right = o.orthoBase * this.currentScale),
  4537. (this.camera.top =
  4538. (o.orthoBase * this.currentScale) / this.camera.aspect),
  4539. (this.camera.bottom =
  4540. (-o.orthoBase * this.currentScale) / this.camera.aspect),
  4541. this.camera.updateProjectionMatrix(),
  4542. this.offset.length()
  4543. );
  4544. }),
  4545. (n.prototype.toJSON = (function () {
  4546. var e = new r.Quaternion(),
  4547. t = new r.Quaternion().setFromAxisAngle(
  4548. new r.Vector3(0, 1, 0),
  4549. r.Math.degToRad(90)
  4550. ),
  4551. i = new r.Quaternion();
  4552. return function () {
  4553. var n = a.prototype.toJSON.call(this);
  4554. return (
  4555. e.copy(n.camera_quaternion),
  4556. i.copy(t),
  4557. i.multiply(e),
  4558. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  4559. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  4560. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  4561. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  4562. (n.ortho_zoom = c.toPrecision(
  4563. this.currentScale * this.camera.aspect,
  4564. 4
  4565. )),
  4566. n
  4567. );
  4568. };
  4569. })()),
  4570. (t.exports = n);
  4571. },
  4572. {
  4573. "../enum/ControlActions": 20,
  4574. "../enum/MouseButton": 34,
  4575. "../settings": 166,
  4576. "../util/browser": 182,
  4577. "../util/math": 190,
  4578. "./OutsideControls": 12,
  4579. three: 217,
  4580. },
  4581. ],
  4582. 12: [
  4583. function (e, t, i) {
  4584. "use strict";
  4585. function n(e) {
  4586. (this.camera = e),
  4587. (this.camera.controls = this),
  4588. (this.enabled = !1),
  4589. (this.target = new r.Vector3()),
  4590. (this.targetBounds = new r.Box3()),
  4591. (this.zoomSpeed = 1),
  4592. (this.minDistance = 0),
  4593. (this.maxDistance = 1 / 0),
  4594. (this.noRotateUpDown = !1),
  4595. (this.rotateSpeed = 1),
  4596. (this.keyboardZoomSpeed = 0),
  4597. (this.keyPanSpeed = 7),
  4598. (this.autoRotate = !1),
  4599. (this.autoRotateSpeed = 2),
  4600. (this.autoPan = !1),
  4601. (this.autoPanPosition = new r.Vector3()),
  4602. (this.minPolarAngle = r.Math.degToRad(25)),
  4603. (this.maxPolarAngle = r.Math.degToRad(65)),
  4604. (this.rotationAcceleration = new r.Vector2()),
  4605. (this.rotationSpeed = new r.Vector2()),
  4606. (this.panAcceleration = new r.Vector2()),
  4607. (this.panSpeed = new r.Vector2()),
  4608. (this.rotateStart = new r.Vector2()),
  4609. (this.rotateEnd = new r.Vector2()),
  4610. (this.rotateDelta = new r.Vector2()),
  4611. (this.panStart = new r.Vector2()),
  4612. (this.panEnd = new r.Vector2()),
  4613. (this.panDelta = new r.Vector2()),
  4614. (this.panOffset = new r.Vector3()),
  4615. (this.offset = new r.Vector3()),
  4616. (this.dollyStart = new r.Vector2()),
  4617. (this.dollyEnd = new r.Vector2()),
  4618. (this.dollyDelta = new r.Vector2()),
  4619. (this.phiDelta = 0),
  4620. (this.thetaDelta = 0),
  4621. (this.scale = 1),
  4622. (this.panVector = new r.Vector3()),
  4623. (this.lastPosition = new r.Vector3()),
  4624. (this.state = c.NONE),
  4625. (this.mouseActions = {}),
  4626. (this.mouseActions[h.LEFT] = c.ROTATE),
  4627. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  4628. (this.mouseActions[h.RIGHT] = c.PAN),
  4629. (this.touchActions = {}),
  4630. (this.touchActions[1] = c.ROTATE),
  4631. (this.touchActions[2] = c.PAN_DOLLY),
  4632. (this.lastMoveTime = 0),
  4633. (this.pointersLimit = 2),
  4634. (this.pointers = []);
  4635. }
  4636. var r = e("three"),
  4637. o = e("../settings"),
  4638. a = e("../util/common"),
  4639. s = e("../util/math"),
  4640. l = e("../enum/Vectors"),
  4641. c = e("../enum/ControlActions"),
  4642. h = e("../enum/MouseButton"),
  4643. u = e("../enum/Keys"),
  4644. d = e("../enum/ControlEvents"),
  4645. p = e("events").EventEmitter,
  4646. f = 1e-6;
  4647. (n.prototype = Object.create(p.prototype)),
  4648. (n.prototype.setBounds = function (e) {
  4649. this.targetBounds = e;
  4650. }),
  4651. (n.prototype.isEngaged = function () {
  4652. return this.state !== c.NONE;
  4653. }),
  4654. (n.prototype.rotateLeft = function (e) {
  4655. void 0 === e && (e = this.getAutoRotationAngle()),
  4656. (this.thetaDelta -= e);
  4657. }),
  4658. (n.prototype.rotateUp = function (e) {
  4659. this.noRotateUpDown ||
  4660. (void 0 === e && (e = this.getAutoRotationAngle()),
  4661. (this.phiDelta -= e));
  4662. }),
  4663. (n.prototype.panLeft = function (e) {
  4664. var t = this.camera.matrix.elements;
  4665. this.panOffset.set(t[0], 0, t[2]).normalize(),
  4666. this.panOffset.multiplyScalar(-e),
  4667. this.panVector.add(this.panOffset);
  4668. }),
  4669. (n.prototype.panUp = function (e) {
  4670. var t = this.camera.matrix.elements;
  4671. this.panOffset.set(t[4], 0, t[6]).normalize(),
  4672. this.panOffset.multiplyScalar(-e),
  4673. this.panVector.add(this.panOffset);
  4674. }),
  4675. (n.prototype.startRotating = function (e, t) {
  4676. e && this.navRotationAcc("x", e), t && this.navRotationAcc("y", t);
  4677. }),
  4678. (n.prototype.stopRotating = function (e) {
  4679. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4680. this.navRotationAcc("x", 0),
  4681. this.navRotationAcc("y", 0);
  4682. }),
  4683. (n.prototype.setAutoPanPosition = (function (e, t) {
  4684. var i = new r.Vector3(),
  4685. n = new r.Vector3();
  4686. return function (e, t) {
  4687. i.copy(this.camera.position),
  4688. (void 0 === e && null === e) || i.setX(e),
  4689. (void 0 === t && null === t) || i.setZ(t);
  4690. var r = this.camera.position.distanceTo(this.target),
  4691. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  4692. (this.targetClamped = !1),
  4693. n.copy(i).addScaledVector(o, r),
  4694. this.targetBounds.containsPoint(n) ||
  4695. (this.targetBounds.clampPoint(n, n),
  4696. i.copy(n).addScaledVector(o, -r),
  4697. (this.targetClamped = !0)),
  4698. (this.autoPanPosition.x = i.x),
  4699. (this.autoPanPosition.z = i.z),
  4700. this.autoPan && this.stopAutoPanning();
  4701. };
  4702. })()),
  4703. (n.prototype.stopAutoPanning = function () {
  4704. var e = this.autoPan;
  4705. (this.autoPan = !1),
  4706. this.emit(
  4707. this.targetClamped
  4708. ? d.AutoPanClamped
  4709. : e
  4710. ? d.AutoPanInterrupt
  4711. : d.AutoPanComplete
  4712. );
  4713. }),
  4714. (n.prototype.dollyIn = function (e) {
  4715. void 0 === e && (e = this.getZoomScale()), (this.scale /= e);
  4716. }),
  4717. (n.prototype.dollyOut = function (e) {
  4718. void 0 === e && (e = this.getZoomScale()), (this.scale *= e);
  4719. }),
  4720. (n.prototype.updatePan = function (e) {
  4721. if (
  4722. (this.panSpeed
  4723. .multiplyScalar(1 - o.panFriction)
  4724. .addScaledVector(
  4725. this.panAcceleration,
  4726. o.panAccelerationOutside * e
  4727. ),
  4728. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4729. this.autoPan)
  4730. ) {
  4731. var t = new r.Vector3()
  4732. .copy(this.autoPanPosition)
  4733. .sub(this.camera.position);
  4734. t.setY(0).clampLength(0, 50 * e),
  4735. this.target.add(t),
  4736. this.camera.position.add(t),
  4737. this.autoPanPosition.x === this.camera.position.x &&
  4738. this.autoPanPosition.z === this.camera.position.z &&
  4739. ((this.autoPan = !1), this.stopAutoPanning());
  4740. }
  4741. }),
  4742. (n.prototype.update = function (e) {
  4743. e || (e = 1 / 60);
  4744. var friction = Math.min(1, o.rotationFriction * e * 60); //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4745. this.rotationSpeed
  4746. .multiplyScalar(1 - friction)
  4747. .addScaledVector(
  4748. this.rotationAcceleration,
  4749. o.rotationAccelerationOutside * e
  4750. ),
  4751. this.rotateLeft(-this.rotationSpeed.x),
  4752. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4753. this.updatePan(e);
  4754. var t = this.camera.position;
  4755. this.offset.copy(t).sub(this.target);
  4756. var i = Math.atan2(this.offset.x, this.offset.z),
  4757. n = Math.atan2(
  4758. Math.sqrt(
  4759. this.offset.x * this.offset.x + this.offset.z * this.offset.z
  4760. ),
  4761. this.offset.y
  4762. );
  4763. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4764. (i += this.thetaDelta),
  4765. (n += this.phiDelta),
  4766. (n = Math.max(
  4767. this.minPolarAngle,
  4768. Math.min(this.maxPolarAngle, n)
  4769. )),
  4770. (n = Math.max(f, Math.min(Math.PI - f, n)));
  4771. (this.lon = i), (this.lat = n); //add
  4772. var r = this.updateZoom();
  4773. (r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  4774. this.target.add(this.panVector),
  4775. this.targetBounds.clampPoint(this.target, this.target),
  4776. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  4777. (this.offset.y = r * Math.cos(n)),
  4778. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  4779. t.copy(this.target).add(this.offset),
  4780. this.camera.lookAt(this.target),
  4781. (this.thetaDelta = 0),
  4782. (this.phiDelta = 0),
  4783. (this.scale = 1),
  4784. this.panVector.set(0, 0, 0),
  4785. this.lastPosition.distanceTo(this.camera.position) > 0 &&
  4786. this.lastPosition.copy(this.camera.position);
  4787. }),
  4788. (n.prototype.getAutoRotationAngle = function () {
  4789. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed;
  4790. }),
  4791. (n.prototype.getZoomScale = function () {
  4792. return Math.pow(0.95, this.zoomSpeed);
  4793. }),
  4794. (n.prototype.onMouseDown = function (e) {
  4795. if (this.enabled) {
  4796. switch (
  4797. (e.preventDefault(),
  4798. this.stopAutoPanning(),
  4799. (this.mouseDown = !0),
  4800. (this.state = this.mouseActions[e.button]),
  4801. this.state)
  4802. ) {
  4803. case c.ROTATE:
  4804. this.rotateStart.set(
  4805. e.clientX,
  4806. this.noRotateUpDown ? 0 : e.clientY
  4807. ),
  4808. this.rotationSpeed.set(0, 0);
  4809. break;
  4810. case c.DOLLY:
  4811. this.dollyStart.set(e.clientX, e.clientY);
  4812. break;
  4813. case c.PAN:
  4814. this.panStart.set(e.clientX, e.clientY);
  4815. }
  4816. this.emit(d.InputStart, "mouse");
  4817. }
  4818. }),
  4819. (n.prototype.onMouseMove = function (e) {
  4820. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4821. switch ((e.preventDefault(), this.state)) {
  4822. case c.ROTATE:
  4823. this.rotateEnd.set(
  4824. e.clientX,
  4825. this.noRotateUpDown ? 0 : e.clientY
  4826. ),
  4827. this.rotateDelta.subVectors(
  4828. this.rotateEnd,
  4829. this.rotateStart
  4830. ),
  4831. this.rotateLeft(
  4832. ((2 * Math.PI * this.rotateDelta.x) /
  4833. $("#player").width()) *
  4834. this.rotateSpeed
  4835. ),
  4836. this.rotateUp(
  4837. ((2 * Math.PI * this.rotateDelta.y) /
  4838. $("#player").height()) *
  4839. this.rotateSpeed
  4840. ),
  4841. this.rotateStart.copy(this.rotateEnd);
  4842. break;
  4843. case c.DOLLY:
  4844. this.dollyEnd.set(e.clientX, e.clientY),
  4845. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  4846. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  4847. t.call(this), this.dollyStart.copy(this.dollyEnd);
  4848. break;
  4849. case c.PAN:
  4850. this.panEnd.set(e.clientX, e.clientY),
  4851. this.panDelta.subVectors(this.panEnd, this.panStart),
  4852. this.pan(this.panDelta.x, this.panDelta.y),
  4853. this.panStart.copy(this.panEnd);
  4854. }
  4855. this.emit(d.Move, "mouse"),
  4856. (this.lastMoveTime = e.timeStamp),
  4857. this.update();
  4858. }
  4859. }),
  4860. (n.prototype.onMouseUp = function (e) {
  4861. this.enabled &&
  4862. ((this.mouseDown = !1),
  4863. (this.state = c.NONE),
  4864. "mouseover" !== e.type &&
  4865. (e.timeStamp > this.lastMoveTime + 100
  4866. ? (this.rotationSpeed.set(0, 0),
  4867. this.rotationAcceleration.set(0, 0))
  4868. : this.rotationAcceleration.set(
  4869. -this.rotateDelta.x,
  4870. this.rotateDelta.y
  4871. ),
  4872. this.update(),
  4873. this.rotationAcceleration.set(0, 0),
  4874. this.rotateDelta.set(0, 0)));
  4875. }),
  4876. (n.prototype.onMouseOver = function (e) {
  4877. (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e);
  4878. }),
  4879. (n.prototype.onMouseWheel = function (e) {
  4880. if (this.enabled && o.useWheel) {
  4881. this.emit(d.Move, "wheel");
  4882. var t = e.wheelDelta || -e.detail,
  4883. i = t > 0 ? this.dollyOut : this.dollyIn;
  4884. i.call(this), this.update();
  4885. }
  4886. }),
  4887. (n.prototype.onKeyDown = function (e) {
  4888. this.enabled &&
  4889. (e.metaKey ||
  4890. e.ctrlKey ||
  4891. (e.preventDefault(), this.handleKeyDown(e.which)));
  4892. }),
  4893. (n.prototype.navRotationAcc = function (e, t) {
  4894. "y" === e
  4895. ? this.noRotateUpDown
  4896. ? (this.keyboardZoomSpeed = t)
  4897. : (this.rotationAcceleration.y = t)
  4898. : (this.rotationAcceleration.x = t);
  4899. }),
  4900. (n.prototype.navPanAcc = function (e, t) {
  4901. this.stopAutoPanning(), (this.panAcceleration[e] = t);
  4902. }),
  4903. (n.prototype.handleKeyDown = function (e) {
  4904. var t = !0;
  4905. switch (e) {
  4906. case u.UPARROW:
  4907. case u.I:
  4908. this.navRotationAcc("y", 1);
  4909. break;
  4910. case u.DOWNARROW:
  4911. case u.K:
  4912. this.navRotationAcc("y", -1);
  4913. break;
  4914. case u.LEFTARROW:
  4915. case u.J:
  4916. this.navRotationAcc("x", -1);
  4917. break;
  4918. case u.RIGHTARROW:
  4919. case u.L:
  4920. this.navRotationAcc("x", 1);
  4921. break;
  4922. case u.W:
  4923. this.navPanAcc("y", 1);
  4924. break;
  4925. case u.S:
  4926. this.navPanAcc("y", -1);
  4927. break;
  4928. case u.A:
  4929. this.navPanAcc("x", -1);
  4930. break;
  4931. case u.D:
  4932. this.navPanAcc("x", 1);
  4933. break;
  4934. default:
  4935. t = !1;
  4936. }
  4937. t && this.emit(d.Move, "key");
  4938. }),
  4939. (n.prototype.onKeyUp = function (e) {
  4940. this.enabled &&
  4941. (e.preventDefault(),
  4942. e.stopPropagation(),
  4943. this.handleKeyUp(e.which));
  4944. }),
  4945. (n.prototype.handleKeyUp = function (e) {
  4946. switch (e) {
  4947. case u.I:
  4948. case u.K:
  4949. case u.UPARROW:
  4950. case u.DOWNARROW:
  4951. (this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0);
  4952. break;
  4953. case u.J:
  4954. case u.L:
  4955. case u.LEFTARROW:
  4956. case u.RIGHTARROW:
  4957. this.rotationAcceleration.x = 0;
  4958. break;
  4959. case u.S:
  4960. case u.W:
  4961. this.panAcceleration.y = 0;
  4962. break;
  4963. case u.A:
  4964. case u.D:
  4965. this.panAcceleration.x = 0;
  4966. }
  4967. }),
  4968. (n.prototype.onTouchStart = function (e) {
  4969. if (this.enabled || this.state === c.NONE) {
  4970. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning();
  4971. var t = function () {
  4972. if (2 === e.touches.length) {
  4973. var t = e.touches[0].pageX - e.touches[1].pageX,
  4974. i = e.touches[0].pageY - e.touches[1].pageY;
  4975. this.dollyStart.set(t, i);
  4976. }
  4977. }.bind(this),
  4978. i = function () {
  4979. this.panStart.set(
  4980. a.average(e.touches, "pageX"),
  4981. a.average(e.touches, "pageY")
  4982. );
  4983. }.bind(this),
  4984. n = function () {
  4985. this.rotateStart.set(
  4986. a.average(e.touches, "pageX"),
  4987. a.average(e.touches, "pageY")
  4988. );
  4989. }.bind(this);
  4990. switch (
  4991. ((this.state = this.touchActions[e.touches.length]), this.state)
  4992. ) {
  4993. case c.PAN_DOLLY:
  4994. t();
  4995. case c.PAN:
  4996. i();
  4997. break;
  4998. case c.ROTATE_DOLLY:
  4999. t();
  5000. case c.ROTATE:
  5001. n();
  5002. }
  5003. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, "touch");
  5004. }
  5005. }),
  5006. (n.prototype.onTouchMove = function (e) {
  5007. if (this.enabled && this.state !== c.NONE) {
  5008. e.preventDefault(), e.stopPropagation();
  5009. var t = function () {
  5010. var t = e.touches[0].pageX - e.touches[1].pageX,
  5011. i = e.touches[0].pageY - e.touches[1].pageY;
  5012. this.dollyEnd.set(t, i);
  5013. var n = this.dollyStart.length() - this.dollyEnd.length();
  5014. n > 0
  5015. ? this.dollyOut(1 + n / 500)
  5016. : this.dollyIn(1 - n / 500),
  5017. this.dollyStart.copy(this.dollyEnd);
  5018. }.bind(this),
  5019. i = function () {
  5020. this.panEnd.set(
  5021. a.average(e.touches, "pageX"),
  5022. a.average(e.touches, "pageY")
  5023. ),
  5024. this.panDelta.subVectors(this.panEnd, this.panStart),
  5025. this.pan(this.panDelta.x, this.panDelta.y),
  5026. this.panStart.copy(this.panEnd),
  5027. this.rotateDelta.set(0, 0);
  5028. }.bind(this),
  5029. n = function () {
  5030. this.rotateEnd.set(
  5031. a.average(e.touches, "pageX"),
  5032. a.average(e.touches, "pageY")
  5033. ),
  5034. this.rotateDelta.subVectors(
  5035. this.rotateEnd,
  5036. this.rotateStart
  5037. ),
  5038. this.rotateLeft(
  5039. ((2 * Math.PI * this.rotateDelta.x) /
  5040. $("#player").width()) *
  5041. this.rotateSpeed
  5042. ),
  5043. this.rotateUp(
  5044. ((2 * Math.PI * this.rotateDelta.y) /
  5045. $("#player").height()) *
  5046. this.rotateSpeed
  5047. ),
  5048. this.rotateStart.copy(this.rotateEnd);
  5049. }.bind(this),
  5050. r = function () {
  5051. if (2 === e.touches.length) {
  5052. var i = window.devicePixelRatio || 1,
  5053. r = e.touches[1].pageX - e.touches[0].pageX,
  5054. s = e.touches[1].pageY - e.touches[0].pageY,
  5055. l = Math.sqrt(r * r + s * s),
  5056. h = Math.abs(this.dollyStart.length() - l);
  5057. if (h > o.input.touchMoveThreshold * i)
  5058. (this.state = c.DOLLY), t();
  5059. else {
  5060. var u = a.average(e.touches, "pageX"),
  5061. d = a.average(e.touches, "pageY"),
  5062. p = this.rotateDelta
  5063. .set(u, d)
  5064. .sub(this.rotateStart)
  5065. .length();
  5066. p > o.input.touchMoveThreshold &&
  5067. ((this.state = c.ROTATE),
  5068. this.rotateStart.set(u, d),
  5069. n());
  5070. }
  5071. }
  5072. }.bind(this);
  5073. switch (this.state) {
  5074. case c.PAN_DOLLY:
  5075. t();
  5076. case c.PAN:
  5077. i();
  5078. break;
  5079. case c.ROTATE_DOLLY:
  5080. r();
  5081. break;
  5082. case c.DOLLY:
  5083. t();
  5084. break;
  5085. case c.ROTATE:
  5086. n();
  5087. break;
  5088. default:
  5089. this.state = c.NONE;
  5090. }
  5091. (this.lastMoveTime = e.timeStamp), this.emit(d.Move, "touch");
  5092. }
  5093. }),
  5094. (n.prototype.onTouchEnd = function (e) {
  5095. this.enabled &&
  5096. (this.state === c.ROTATE &&
  5097. (e.timeStamp > this.lastMoveTime + 100
  5098. ? (this.rotationSpeed.set(0, 0),
  5099. this.rotationAcceleration.set(0, 0))
  5100. : this.rotationAcceleration.set(
  5101. -this.rotateDelta.x,
  5102. this.rotateDelta.y
  5103. )),
  5104. (this.state = c.NONE),
  5105. this.update(),
  5106. this.rotationAcceleration.set(0, 0),
  5107. this.rotateDelta.set(0, 0));
  5108. }),
  5109. (n.prototype.onPointerDown = function (e) {
  5110. this.enabled &&
  5111. ("touch" === e.pointerType &&
  5112. (this.pointers.length < this.pointersLimit &&
  5113. this.pointers.push({
  5114. id: e.pointerId,
  5115. pageX: e.pageX,
  5116. pageY: e.pageY,
  5117. }),
  5118. (e.touches = this.pointers),
  5119. this.onTouchStart(e)),
  5120. this.emit(d.InputStart, "pointer"));
  5121. }),
  5122. (n.prototype.onPointerMove = function (e) {
  5123. this.enabled &&
  5124. "touch" === e.pointerType &&
  5125. (this.pointers.forEach(function (t) {
  5126. e.pointerId === t.id &&
  5127. ((t.pageX = e.pageX), (t.pageY = e.pageY));
  5128. }),
  5129. (e.touches = this.pointers),
  5130. this.onTouchMove(e));
  5131. }),
  5132. (n.prototype.onPointerUp = function (e) {
  5133. this.enabled &&
  5134. "touch" === e.pointerType &&
  5135. (this.pointers.forEach(
  5136. function (t, i) {
  5137. e.pointerId === t.id && this.pointers.splice(i, 1);
  5138. }.bind(this)
  5139. ),
  5140. (e.touches = this.pointers),
  5141. this.onTouchEnd(e));
  5142. }),
  5143. (n.prototype.reset = function () {
  5144. (this.state = c.NONE),
  5145. this.stopAutoPanning(),
  5146. this.rotationSpeed.set(0, 0),
  5147. this.rotationAcceleration.set(0, 0),
  5148. this.panSpeed.set(0, 0),
  5149. this.panAcceleration.set(0, 0);
  5150. }),
  5151. (n.prototype.toJSON = function () {
  5152. var e = {
  5153. camera_position: {
  5154. x: s.toPrecision(this.camera.position.x, 4),
  5155. y: s.toPrecision(this.camera.position.y, 4),
  5156. z: s.toPrecision(this.camera.position.z, 4),
  5157. },
  5158. camera_quaternion: {
  5159. x: s.toPrecision(this.camera.quaternion.x, 4),
  5160. y: s.toPrecision(this.camera.quaternion.y, 4),
  5161. z: s.toPrecision(this.camera.quaternion.z, 4),
  5162. w: s.toPrecision(this.camera.quaternion.w, 4),
  5163. },
  5164. };
  5165. return e;
  5166. }),
  5167. (t.exports = n);
  5168. },
  5169. {
  5170. "../enum/ControlActions": 20,
  5171. "../enum/ControlEvents": 21,
  5172. "../enum/Keys": 30,
  5173. "../enum/MouseButton": 34,
  5174. "../enum/Vectors": 50,
  5175. "../settings": 166,
  5176. "../util/common": 185,
  5177. "../util/math": 190,
  5178. events: 202,
  5179. three: 217,
  5180. },
  5181. ],
  5182. 13: [
  5183. function (e, t, i) {
  5184. (function (i) {
  5185. "use strict";
  5186. function n(e) {
  5187. (this.camera = e),
  5188. (this.camera.controls = this),
  5189. (this.target = new r.Vector3(0, 0, 0)),
  5190. (this.lookVector = new r.Vector3()),
  5191. (this.lookSpeed = 0.05),
  5192. (this.rotationAcc = new r.Vector2()),
  5193. (this.rotationSpeed = new r.Vector2()),
  5194. (this.lat = 0),
  5195. (this.lon = 0),
  5196. (this.phi = 0),
  5197. (this.theta = 0),
  5198. (this.enabled = !1),
  5199. (this.locked = !1),
  5200. (this.pointer = new r.Vector2(0, 0)),
  5201. (this.rotationHistory = []),
  5202. (this.rotationDifference = new r.Vector2()),
  5203. (this.pointerDragOn = !1),
  5204. (this.pointerDragStart = new r.Vector2(0, 0)),
  5205. (this.pinchDistance = 0),
  5206. (this.moveStart = new r.Vector2()),
  5207. (this.moveTolerance = 0.01),
  5208. (this.pointersLimit = 2),
  5209. (this.pointers = []);
  5210. }
  5211. var r = e("three"),
  5212. o = e("../util/logger"),
  5213. a = e("../settings"),
  5214. s = e("../util/common"),
  5215. l = e("../util/math"),
  5216. c = (e("../enum/Vectors"), e("../enum/MouseButton")),
  5217. h = e("../enum/Keys"),
  5218. u = e("../enum/ControlEvents"),
  5219. d = e("events").EventEmitter;
  5220. new o(i);
  5221. (n.prototype = Object.create(d.prototype)),
  5222. (n.prototype.usable = function () {
  5223. return this.enabled && !this.locked;
  5224. }),
  5225. /* n.prototype.lookAt = function(e) {
  5226. var t = this.camera.position.clone().sub(e)
  5227. , i = Math.atan(t.z / t.x);
  5228. i += t.x < 0 ? Math.PI : 0,
  5229. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  5230. this.lon = r.Math.radToDeg(i) + 180;
  5231. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  5232. , o = Math.atan(t.y / n);
  5233. this.lat = -r.Math.radToDeg(o)
  5234. }
  5235. */
  5236. (n.prototype.lookAt = function (aim, dir) {
  5237. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  5238. var i = Math.atan(t.z / t.x);
  5239. i += t.x < 0 ? Math.PI : 0;
  5240. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  5241. this.lon = r.Math.radToDeg(i) + 180;
  5242. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  5243. o = Math.atan(t.y / n);
  5244. this.lat = -r.Math.radToDeg(o);
  5245. }),
  5246. (n.prototype.startRotationFrom = function (e, t) {
  5247. l.convertScreenPositionToNDC(e, t, this.pointer),
  5248. (this.pointerDragOn = !0),
  5249. this.pointerDragStart.copy(this.pointer),
  5250. this.moveStart.copy(this.pointer),
  5251. (this.rotationHistory = []),
  5252. this.rotationSpeed.set(0, 0);
  5253. }),
  5254. (n.prototype.onMouseOver = function (e) {
  5255. !this.pointerDragOn ||
  5256. (0 !== e.which && 0 !== e.buttons) ||
  5257. this.onMouseUp(e);
  5258. }),
  5259. (n.prototype.onTouchStart = function (e) {
  5260. if (this.usable()) {
  5261. switch (
  5262. (e.preventDefault(), e.stopPropagation(), e.touches.length)
  5263. ) {
  5264. case 1:
  5265. this.startRotationFrom(
  5266. e.touches[0].clientX,
  5267. e.touches[0].clientY
  5268. );
  5269. break;
  5270. case 2:
  5271. var t =
  5272. (e.touches[0].clientX - e.touches[1].clientX) /
  5273. $("#player").width(),
  5274. i =
  5275. (e.touches[0].clientY - e.touches[1].clientY) /
  5276. $("#player").height();
  5277. this.pinchDistance = Math.sqrt(t * t + i * i);
  5278. }
  5279. this.emit(u.InputStart, "touch");
  5280. }
  5281. }),
  5282. (n.prototype.onPointerDown = function (e) {
  5283. this.usable() &&
  5284. "touch" === e.pointerType &&
  5285. (this.pointers.length < this.pointersLimit &&
  5286. this.pointers.push({
  5287. id: e.pointerId,
  5288. clientX: e.clientX,
  5289. clientY: e.clientY,
  5290. }),
  5291. (e.touches = this.pointers),
  5292. this.onTouchStart(e),
  5293. this.emit(u.InputStart, "pointer"));
  5294. }),
  5295. (n.prototype.onMouseDown = function (e) {
  5296. if (this.usable()) {
  5297. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  5298. case c.LEFT:
  5299. this.startRotationFrom(e.clientX, e.clientY);
  5300. }
  5301. SoundManager.pause("tour"); // zeg 点击场景时停止语音
  5302. this.emit(u.InputStart, "mouse");
  5303. }
  5304. }),
  5305. (n.prototype.updateRotation = function () {
  5306. if (this.usable() && this.pointerDragOn) {
  5307. var e = new r.Vector3(
  5308. this.pointerDragStart.x,
  5309. this.pointerDragStart.y,
  5310. -1
  5311. ).unproject(this.camera),
  5312. t = new r.Vector3(
  5313. this.pointer.x,
  5314. this.pointer.y,
  5315. -1
  5316. ).unproject(this.camera),
  5317. i = Math.sqrt(e.x * e.x + e.z * e.z),
  5318. n = Math.sqrt(t.x * t.x + t.z * t.z),
  5319. o = Math.atan2(e.y, i),
  5320. a = Math.atan2(t.y, n);
  5321. (this.rotationDifference.y = r.Math.radToDeg(o - a)),
  5322. (e.y = 0),
  5323. (t.y = 0);
  5324. var s = Math.acos(e.dot(t) / e.length() / t.length());
  5325. isNaN(s) ||
  5326. ((this.rotationDifference.x = r.Math.radToDeg(s)),
  5327. this.pointerDragStart.x < this.pointer.x &&
  5328. (this.rotationDifference.x *= -1)),
  5329. this.pointerDragStart.copy(this.pointer);
  5330. }
  5331. }),
  5332. (n.prototype.onMouseMove = function (e) {
  5333. this.usable() &&
  5334. (l.convertScreenPositionToNDC(
  5335. e.clientX,
  5336. e.clientY,
  5337. this.pointer
  5338. ),
  5339. this.pointerDragOn &&
  5340. (Math.abs(this.pointer.x - this.moveStart.x) >
  5341. this.moveTolerance ||
  5342. Math.abs(this.pointer.y - this.moveStart.y) >
  5343. this.moveTolerance) &&
  5344. this.emit(u.Move, "mouse"));
  5345. }),
  5346. (n.prototype.onTouchMove = function (e) {
  5347. if (this.usable())
  5348. switch ((this.emit(u.Move, "touch"), e.touches.length)) {
  5349. case 1:
  5350. l.convertScreenPositionToNDC(
  5351. e.touches[0].clientX,
  5352. e.touches[0].clientY,
  5353. this.pointer
  5354. );
  5355. break;
  5356. case 2:
  5357. var t =
  5358. (e.touches[0].clientX - e.touches[1].clientX) /
  5359. $("#player").width(),
  5360. i =
  5361. (e.touches[0].clientY - e.touches[1].clientY) /
  5362. $("#player").height(),
  5363. n = this.pinchDistance - Math.sqrt(t * t + i * i);
  5364. Math.abs(n) > 0.01 &&
  5365. (this.emit(u.InteractionDirect),
  5366. this.emit(u.Pinch, n),
  5367. (this.pinchDistance -= n));
  5368. }
  5369. }),
  5370. (n.prototype.onPointerMove = function (e) {
  5371. this.usable() &&
  5372. "touch" === e.pointerType &&
  5373. (this.pointers.forEach(function (t) {
  5374. e.pointerId === t.id &&
  5375. ((t.clientX = e.clientX), (t.clientY = e.clientY));
  5376. }),
  5377. (e.touches = this.pointers),
  5378. this.onTouchMove(e));
  5379. }),
  5380. (n.prototype.endRotation = function () {
  5381. this.pointerDragOn = !1;
  5382. var e = s.averageVectors(this.rotationHistory);
  5383. this.rotationSpeed.set(
  5384. e.x * a.rotationAfterMoveMultiplier,
  5385. e.y * a.rotationAfterMoveMultiplier
  5386. );
  5387. }),
  5388. (n.prototype.onTouchEnd = function (e) {
  5389. this.usable() &&
  5390. (e.preventDefault(), e.stopPropagation(), this.endRotation());
  5391. }),
  5392. (n.prototype.onMouseUp = function (e) {
  5393. this.usable() &&
  5394. (e.preventDefault(), e.stopPropagation(), this.endRotation());
  5395. }),
  5396. (n.prototype.onPointerUp = function (e) {
  5397. this.usable() &&
  5398. "touch" === e.pointerType &&
  5399. (this.pointers.forEach(
  5400. function (t, i) {
  5401. e.pointerId === t.id && this.pointers.splice(i, 1);
  5402. }.bind(this)
  5403. ),
  5404. (e.touches = this.pointers),
  5405. this.onTouchEnd(e));
  5406. }),
  5407. (n.prototype.update = function (e) {
  5408. this.lon, this.lat;
  5409. for (
  5410. this.updateRotation(),
  5411. this.rotationHistory.push(this.rotationDifference.clone());
  5412. this.rotationHistory.length > a.rotationAfterMoveHistoryCount;
  5413. )
  5414. this.rotationHistory.shift();
  5415. (this.lon += this.rotationDifference.x),
  5416. (this.lat += this.rotationDifference.y),
  5417. this.rotationDifference.set(0, 0);
  5418. //改
  5419. var friction = Math.min(1, a.rotationFriction * e * 60); //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  5420. (this.rotationSpeed.x =
  5421. this.rotationSpeed.x * (1 - friction) +
  5422. this.rotationAcc.x * a.rotationAccelerationInside),
  5423. (this.rotationSpeed.y =
  5424. this.rotationSpeed.y * (1 - friction) +
  5425. this.rotationAcc.y * a.rotationAccelerationInside),
  5426. (this.lon += this.rotationSpeed.x * e),
  5427. (this.lat += this.rotationSpeed.y * e);
  5428. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  5429. var insideLookLimitDown =
  5430. a.insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2;
  5431. var insideLookLimitUp =
  5432. a.insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2;
  5433. this.lat = Math.max(
  5434. insideLookLimitDown,
  5435. Math.min(insideLookLimitUp, this.lat)
  5436. ); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  5437. (this.phi = r.Math.degToRad(90 - this.lat)),
  5438. (this.theta = r.Math.degToRad(this.lon)),
  5439. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  5440. (this.lookVector.y = Math.cos(this.phi)),
  5441. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  5442. this.target.copy(this.lookVector).add(this.camera.position),
  5443. this.camera.lookAt(this.target);
  5444. }),
  5445. (n.prototype.onMouseWheel = function (e) {
  5446. if (this.usable()) {
  5447. var t = e.wheelDelta || -e.detail;
  5448. this.emit(u.InteractionDirect), this.emit(u.Scroll, t);
  5449. }
  5450. }),
  5451. (n.prototype.onKeyDown = function (e) {
  5452. this.usable() &&
  5453. (e.metaKey ||
  5454. e.ctrlKey ||
  5455. (e.preventDefault(), this.handleKeyDown(e.which)));
  5456. }),
  5457. (n.prototype.handleKeyDown = function (e) {
  5458. var t = function (e, t) {
  5459. this.rotationAcc[e] = t;
  5460. }.bind(this);
  5461. this.emit(u.InteractionKey);
  5462. var i = !0;
  5463. switch (e) {
  5464. case h.LEFTARROW:
  5465. case h.J:
  5466. t("x", -1);
  5467. break;
  5468. case h.RIGHTARROW:
  5469. case h.L:
  5470. t("x", 1);
  5471. break;
  5472. case h.I:
  5473. t("y", 1);
  5474. break;
  5475. case h.K:
  5476. t("y", -1);
  5477. break;
  5478. default:
  5479. i = !1;
  5480. }
  5481. i && this.emit(u.Move, "key");
  5482. }),
  5483. (n.prototype.onKeyUp = function (e) {
  5484. this.usable() &&
  5485. (e.preventDefault(),
  5486. e.stopPropagation(),
  5487. this.handleKeyUp(e.which));
  5488. }),
  5489. (n.prototype.handleKeyUp = function (e) {
  5490. switch (e) {
  5491. case h.LEFTARROW:
  5492. case h.J:
  5493. case h.RIGHTARROW:
  5494. case h.L:
  5495. this.rotationAcc.x = 0;
  5496. break;
  5497. case h.I:
  5498. case h.K:
  5499. this.rotationAcc.y = 0;
  5500. }
  5501. }),
  5502. (n.prototype.startRotating = function (e, t) {
  5503. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t);
  5504. }),
  5505. (n.prototype.stopRotating = function (e) {
  5506. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  5507. this.rotationAcc.set(0, 0);
  5508. }),
  5509. (n.prototype.reset = function () {
  5510. (this.pointerDragOn = !1),
  5511. this.rotationAcc.set(0, 0),
  5512. this.rotationSpeed.set(0, 0),
  5513. (this.pointers = []);
  5514. }),
  5515. (n.prototype.toJSON = function () {
  5516. var e = {
  5517. camera_position: {
  5518. x: l.toPrecision(this.camera.position.x, 4),
  5519. y: l.toPrecision(this.camera.position.y, 4),
  5520. z: l.toPrecision(this.camera.position.z, 4),
  5521. },
  5522. camera_quaternion: {
  5523. x: l.toPrecision(this.camera.quaternion.x, 4),
  5524. y: l.toPrecision(this.camera.quaternion.y, 4),
  5525. z: l.toPrecision(this.camera.quaternion.z, 4),
  5526. w: l.toPrecision(this.camera.quaternion.w, 4),
  5527. },
  5528. };
  5529. return e;
  5530. }),
  5531. (n.prototype.setStateFromJSON = function (e) {
  5532. this.camera.position.copy(e.camera_position),
  5533. this.camera.quaternion.copy(e.camera_quaternion);
  5534. }),
  5535. (t.exports = n);
  5536. }).call(this, "/js/controls/PanoramaControls.js");
  5537. },
  5538. {
  5539. "../enum/ControlEvents": 21,
  5540. "../enum/Keys": 30,
  5541. "../enum/MouseButton": 34,
  5542. "../enum/Vectors": 50,
  5543. "../settings": 166,
  5544. "../util/common": 185,
  5545. "../util/logger": 189,
  5546. "../util/math": 190,
  5547. events: 202,
  5548. three: 217,
  5549. },
  5550. ],
  5551. 14: [
  5552. function (e, t, i) {
  5553. (function (i) {
  5554. "use strict";
  5555. var n = e("three"),
  5556. r = e("../enum/Viewmode"),
  5557. o = e("../util/logger"),
  5558. a = new o(i);
  5559. t.exports = {
  5560. serialize: function (e) {
  5561. return encodeURI(JSON.stringify(e));
  5562. },
  5563. deserialize: function (e) {
  5564. function t(e) {
  5565. function t(e, t) {
  5566. return e && "number" == typeof t && !isNaN(t);
  5567. }
  5568. return e.reduce(t, !0);
  5569. }
  5570. try {
  5571. var i = JSON.parse(decodeURI(e)),
  5572. o = {
  5573. mode: r.fromInt(i.camera_mode),
  5574. panoId: i.scan_id,
  5575. position: new n.Vector3().copy(i.camera_position),
  5576. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  5577. zoom: i.ortho_zoom,
  5578. floorVisibility: i.floor_visibility,
  5579. },
  5580. s = o.position;
  5581. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  5582. var l = o.quaternion;
  5583. return (
  5584. t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o
  5585. );
  5586. } catch (i) {
  5587. a.debug(
  5588. "Not able to parse start location as JSON; falling back to old array style parsing"
  5589. );
  5590. try {
  5591. var c = e.split(","),
  5592. h = {
  5593. x: parseFloat(c[2]),
  5594. y: parseFloat(c[3]),
  5595. z: parseFloat(c[4]),
  5596. },
  5597. u = {
  5598. x: parseFloat(c[5]),
  5599. y: parseFloat(c[6]),
  5600. z: parseFloat(c[7]),
  5601. w: parseFloat(c[8]),
  5602. };
  5603. return (
  5604. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  5605. t([u.x, u.y, u.z, u.w]) ||
  5606. ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  5607. {
  5608. mode: r.fromInt(c[0]),
  5609. panoId: c[1],
  5610. position: new n.Vector3().copy(h),
  5611. quaternion: new n.Quaternion().copy(u),
  5612. }
  5613. );
  5614. } catch (t) {
  5615. a.warn(
  5616. 'Invalid start override, ignoring: "' + e + '"',
  5617. t.message
  5618. );
  5619. }
  5620. }
  5621. return null;
  5622. },
  5623. };
  5624. }).call(this, "/js/controls/serializer.js");
  5625. },
  5626. {
  5627. "../enum/Viewmode": 51,
  5628. "../util/logger": 189,
  5629. three: 217,
  5630. },
  5631. ],
  5632. 15: [
  5633. function (e, t, i) {
  5634. (function (i) {
  5635. "use strict";
  5636. function n() {
  5637. (this.endlessLoop = a.warp.loop),
  5638. (this.clock = new r.Clock(!0)),
  5639. (this.model = null),
  5640. (this.player = null),
  5641. (this.currentItem = null),
  5642. (this.destinationItem = null),
  5643. (this.tourIsPlaying = !1),
  5644. (this.transitionStage = y.None),
  5645. (this.nextFunc = null),
  5646. (this.onTheBus = !1),
  5647. (this.tourInProgress = !1),
  5648. (this.reachSource = null),
  5649. (this.interrupted = !1),
  5650. (this.nItems = 0),
  5651. (this.walkingSectionPaused = !1);
  5652. }
  5653. var r = e("three"),
  5654. o = e("./util/logger"),
  5655. a = e("./settings"),
  5656. s = e("./util/transitions"),
  5657. l = e("events").EventEmitter,
  5658. c = e("./enum/Viewmode"),
  5659. h = e("./analytics"),
  5660. u = e("./enum/WarpStyle"),
  5661. s = e("./util/transitions"),
  5662. d = (e("./model/ModelManager"), e("./enum/ModelManagerEvents")),
  5663. p = e("./enum/DirectorEvents"),
  5664. f = e("./enum/PlayerEvents"),
  5665. g = (e("./enum/ControlEvents"), e("./enum/BlackoutStyle")),
  5666. m = e("./enum/PathDiscardMode"),
  5667. v = e("./enum/PathDisplayMode"),
  5668. A = (e("./player"), new o(i)),
  5669. y = Object.freeze({
  5670. None: 0,
  5671. Moving: 1,
  5672. Aiming: 2,
  5673. Interlude: 3,
  5674. }),
  5675. C = Object.freeze({
  5676. Forward: 1,
  5677. NoChange: 0,
  5678. Backwards: -1,
  5679. }),
  5680. I = s.getUniqueId();
  5681. (n.prototype = Object.create(l.prototype)),
  5682. (n.prototype.init = function (e, t) {
  5683. (this.player = e),
  5684. (this.modelManager = t),
  5685. this.updateModel(),
  5686. this.resetAll(),
  5687. this.bindEvents();
  5688. // // zeg 查询pano对应的导览片段
  5689. // if(!this.panoIdMap) {
  5690. // this.panoIdMap = new Map()
  5691. // this.model.heroLocations.forEach( (value, index) => {
  5692. // // value.heroLocations.forEach( hl => {
  5693. // if(!value.heroLocations) return
  5694. // let hl = value.heroLocations[0]
  5695. // let arr = this.panoIdMap.get(hl.panoId)
  5696. // if(arr){
  5697. // this.panoIdMap.set(hl.panoId, [...arr, index])
  5698. // } else {
  5699. // this.panoIdMap.set(hl.panoId, [index])
  5700. // }
  5701. // // })
  5702. // })
  5703. // }
  5704. }),
  5705. (n.prototype.resetAll = function () {
  5706. if (
  5707. ((this.currentItem = null),
  5708. (this.destinationItem = null),
  5709. (this.tourIsPlaying = !1),
  5710. //this.bgmReplay(),//xzw
  5711. (this.transitionStage = y.None),
  5712. (this.nextFunc = null),
  5713. (this.onTheBus = !1),
  5714. (this.reachSource = null),
  5715. (this.interrupted = !1),
  5716. this.model)
  5717. ) {
  5718. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  5719. this.defaultWarpStyle =
  5720. this.model.data.hasOwnProperty("player_options") &&
  5721. this.model.data.player_options &&
  5722. this.model.data.player_options.fast_transitions === !1
  5723. ? e
  5724. : u.BLACK;
  5725. } else
  5726. (this.defaultWarpStyle = u.BLACK),
  5727. A.warn(
  5728. 'No model yet, choosing "' +
  5729. this.defaultWarpStyle +
  5730. '" transitions'
  5731. );
  5732. this.resetSpecialTransition();
  5733. }),
  5734. (n.prototype.updateModel = function () {
  5735. (this.model = this.modelManager.getActiveModel()),
  5736. (this.nItems = this.model.heroLocations.length);
  5737. }),
  5738. (n.prototype.bindEvents = function () {
  5739. this.modelManager.on(
  5740. d.ActiveModelChanged,
  5741. this.updateModel.bind(this)
  5742. ),
  5743. this.player.on(
  5744. f.WarpInterruptedWithFlyTo,
  5745. this.checkAndHandleWalkingtourInterruption.bind(this)
  5746. ),
  5747. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  5748. this.player.on(
  5749. f.PanoChosen,
  5750. this.handlePlayerPanoChosen.bind(this)
  5751. ),
  5752. this.player.on(
  5753. f.ModeChanged,
  5754. this.handlePlayerModeChanged.bind(this)
  5755. ),
  5756. this.player.on(
  5757. f.InputStart,
  5758. this.handlePlayerInputStart.bind(this)
  5759. ),
  5760. this.player.on(
  5761. f.FlyingStarted,
  5762. this.handlePlayerFlyingStarted.bind(this)
  5763. ),
  5764. this.player.once(f.Move, function () {
  5765. s.cancelById(I);
  5766. });
  5767. }),
  5768. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  5769. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  5770. return (
  5771. /* e === u.WALK && ( */ this.interrupt(g.NONE),
  5772. this.pauseWalkingSection(),
  5773. this.player.fastForwardActivePanoFlight(),
  5774. !0
  5775. ); /* ) */
  5776. }),
  5777. (n.prototype.handlePlayerMove = function (e) {
  5778. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  5779. this.emit("update.controls");
  5780. }),
  5781. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  5782. this.intermediateState() ||
  5783. e.id === t.id ||
  5784. ((this.onTheBus = !1), this.emit("update.controls"));
  5785. }),
  5786. (n.prototype.handlePlayerModeChanged = function (e, t) {
  5787. this.intermediateState() ||
  5788. e === t ||
  5789. ((this.onTheBus = !1), this.emit("update.controls"));
  5790. }),
  5791. (n.prototype.handlePlayerInputStart = function (e) {
  5792. this.transitionStage === y.Interlude && this.interrupt(g.NONE);
  5793. }),
  5794. (n.prototype.handlePlayerFlyingStarted = function () {
  5795. this.clearWalkingSectionPaused();
  5796. }),
  5797. (n.prototype.describe = function () {
  5798. return {
  5799. nItems: this.nItems,
  5800. currentItem: this.currentItem,
  5801. destinationItem: this.destinationItem,
  5802. tourIsPlaying: this.tourIsPlaying,
  5803. onTheBus: this.onTheBus,
  5804. endlessLoop: this.endlessLoop,
  5805. viewMode: this.player.mode,
  5806. inTransition: this._inTransition(),
  5807. transitionStage: this.transitionStage,
  5808. tourInProgress: this.tourInProgress,
  5809. };
  5810. }),
  5811. (n.prototype._inTransition = function () {
  5812. return (
  5813. this.player.flying ||
  5814. this.player.isWarping() ||
  5815. this.player.isWaitingToWarp() ||
  5816. this.player.mode === c.TRANSITIONING ||
  5817. this.tourIsPlaying
  5818. );
  5819. }),
  5820. (n.prototype.bounceable = function () {
  5821. var e = this.clock.getDelta();
  5822. return (
  5823. this.isInterrupted() ||
  5824. (e < 0.9 && e > 0.01) ||
  5825. (this.player.flying && !this.player.isWarping())
  5826. );
  5827. }),
  5828. (n.prototype.itemCompare = function (item1, item2, type) {
  5829. //add
  5830. if (type == "equal") {
  5831. //==
  5832. return (
  5833. item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  5834. );
  5835. } else if (type == "less") {
  5836. //<
  5837. return (
  5838. (item1 && item2 && item1[0] < item2[0]) ||
  5839. (item1[0] == item2[0] && item1[1] < item2[1])
  5840. );
  5841. }
  5842. });
  5843. (n.prototype.currentMoveDirection = function () {
  5844. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  5845. return null === this.currentItem || void 0 === this.currentItem
  5846. ? y.Forward
  5847. : this.itemCompare(
  5848. this.destinationItem,
  5849. this.currentItem,
  5850. "equal"
  5851. )
  5852. ? y.NoChange
  5853. : this.itemCompare(this.currentItem, this.destinationItem, "less")
  5854. ? y.Forward
  5855. : y.Backwards;
  5856. }),
  5857. (n.prototype.clearPath = function () {
  5858. this._inTransition() || this.player.path.discardPathObject();
  5859. }),
  5860. (n.prototype.allFloors = function () {
  5861. this.model.toggleAllFloors();
  5862. }),
  5863. (n.prototype.actionComplete = function (e) {
  5864. if (
  5865. ((this.interrupted = !1),
  5866. (this.transitionStage = y.None),
  5867. this.resetSpecialTransition(),
  5868. null !== this.destinationItem &&
  5869. this.setCurrentItem(this.destinationItem),
  5870. this.tourIsPlaying ||
  5871. (this.player.disablePreRendering(),
  5872. this.player.mode === c.PANORAMA &&
  5873. this.player.currentPano.isAligned() &&
  5874. this.model.fadePanoMarkers()),
  5875. this.emit("update.controls"),
  5876. this.nextFunc)
  5877. ) {
  5878. var t = this.nextFunc;
  5879. (this.nextFunc = null), t();
  5880. }
  5881. }),
  5882. (n.prototype.awaitCompletion = function (e, t) {
  5883. (this.nextFunc = t), e();
  5884. }),
  5885. (n.prototype.updateSuccessFunction = function (e) {
  5886. this.nextFunc = e;
  5887. }),
  5888. (n.prototype.interrupt = function (e, t) {
  5889. return (
  5890. !!this.wouldInterrupt() &&
  5891. (this.tourIsPlaying &&
  5892. (this.player.zoomEnabled = this.wasZoomEnabled),
  5893. (this.tourIsPlaying = !1),
  5894. //this.bgmReplay(),//xzw
  5895. (this.interrupted = !0),
  5896. (this.nextFunc = null),
  5897. this.emit(p.ActionInterrupted),
  5898. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  5899. this.player.interruptAndFastForward(e, t),
  5900. !0)
  5901. );
  5902. }),
  5903. (n.prototype.wouldInterrupt = function () {
  5904. return this.transitionStage !== y.None;
  5905. }),
  5906. (n.prototype.intermediateState = function () {
  5907. return this.transitionStage !== y.None;
  5908. }),
  5909. (n.prototype.isInterrupted = function () {
  5910. return this.interrupted;
  5911. }),
  5912. (n.prototype.pauseWalkingSection = function () {
  5913. this.walkingSectionPaused = !0;
  5914. }),
  5915. (n.prototype.clearWalkingSectionPaused = function () {
  5916. this.walkingSectionPaused = !1;
  5917. }),
  5918. (n.prototype.autoTour = function () {
  5919. var e = Date.now();
  5920. this.model.auxDataPromise.then(
  5921. function () {
  5922. e = Date.now() - e;
  5923. var t = a.warp.auto,
  5924. i =
  5925. this.model.data &&
  5926. this.model.data
  5927. .player_options; /* && this.model.data.player_options.highlight_reel */
  5928. t >= 0 &&
  5929. this.model.heroCount() > 1 &&
  5930. i &&
  5931. s.trigger({
  5932. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5933. done: function () {
  5934. this.playTour();
  5935. }.bind(this),
  5936. name: "_atr",
  5937. id: I,
  5938. });
  5939. }.bind(this)
  5940. );
  5941. }),
  5942. (n.prototype.atDestinationPano = function (pano) {
  5943. if (null === this.destinationItem) return !1;
  5944. pano = pano || this.player.currentPano;
  5945. if (!pano) {
  5946. return !1;
  5947. }
  5948. var destination =
  5949. this.destinationItem &&
  5950. this.model.getHeroDescriptorByIndex(this.destinationItem);
  5951. return destination && destination.panoId == pano.id;
  5952. }),
  5953. (n.prototype.redirectToItem = function (e, t) {
  5954. if (null === e || void 0 === e)
  5955. return void A.warn(
  5956. "Director.redirectToItem() -> Redirecting to null item."
  5957. );
  5958. if (!this.wouldInterrupt())
  5959. return void A.warn(
  5960. "Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt."
  5961. );
  5962. if (this.player.mode === c.TRANSITIONING)
  5963. return void A.debug(
  5964. "Director.redirectToItem() -> Cannot redirect while transitioning."
  5965. );
  5966. A.debug(
  5967. "Director.redirectToItem() -> Redirecting to " + e + " via " + t
  5968. );
  5969. var i = function () {
  5970. s.setTimeout(
  5971. function () {
  5972. this.setDestinationItem(e),
  5973. this.goToDestination(
  5974. !0,
  5975. g.BEGINNING,
  5976. a.warp.warpInterruptionRedirectTime,
  5977. !1
  5978. );
  5979. }.bind(this),
  5980. 0
  5981. );
  5982. }.bind(this);
  5983. this.interrupt(g.END, 0), this.updateSuccessFunction(i);
  5984. }),
  5985. (n.prototype.useSpecialTransition = function (e) {
  5986. void 0 !== e &&
  5987. this.defaultWarpStyle !== u.BLACK &&
  5988. A.debug("useSpecialTransition(): " + e),
  5989. (this.nextWarpStyle = u.BLACK);
  5990. }),
  5991. (n.prototype.resetSpecialTransition = function () {
  5992. this.nextWarpStyle = this.defaultWarpStyle;
  5993. }),
  5994. (n.prototype.arrivedAtDestination = function (e) {
  5995. if (this.player.flying || this.player.isWarping())
  5996. A.warn(
  5997. "Cannot advance to interlude or aiming while player is flying or warping."
  5998. );
  5999. else {
  6000. this.transitionStage = y.Aiming;
  6001. var t = this.tourIsPlaying
  6002. ? this.tourInterlude.bind(
  6003. this,
  6004. this.nextItem(this.currentItem)
  6005. )
  6006. : null;
  6007. this.player.model.fadePanoMarkers(0),
  6008. this.awaitCompletion(
  6009. function () {
  6010. this.resetSpecialTransition(),
  6011. e
  6012. ? this.player.aimTourCamera(
  6013. this.destinationItem,
  6014. v.Retain,
  6015. v.Slow,
  6016. this.actionComplete.bind(this)
  6017. )
  6018. : this.actionComplete();
  6019. }.bind(this),
  6020. t
  6021. );
  6022. }
  6023. }),
  6024. (n.prototype.goToDestination = function (e, t, i, n) {
  6025. //音频
  6026. var musicInfo =
  6027. this.model.heroLocations[this.destinationItem[0]].musicInfo;
  6028. // zeg 手动导览不播放音频
  6029. if (musicInfo && musicInfo.music && !e) {
  6030. let musicType = localStorage.getItem("xunirole") || "male";
  6031. let isMale = musicType.indexOf("female") < 0;
  6032. let fixMusic = isMale
  6033. ? musicInfo.music
  6034. : musicInfo.fmusic || musicInfo.music;
  6035. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  6036. let src = fixMusic;
  6037. let audioObj = SoundManager.list.find((e) => e.name == "tour");
  6038. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  6039. let audioSrc2 = common.getFileNameFromUrl(src);
  6040. if (audioSrc1 == audioSrc2) {
  6041. //应该是继续播放该folder
  6042. if (this.destinationItem[1] == 0) {
  6043. //从头开始播放 因为可能暂停后然后再点该缩略图播
  6044. SoundManager.play("tour", null, 0); // currentTime = 0;
  6045. } else if (
  6046. audioObj.audio.paused &&
  6047. audioObj.audio.currentTime < audioObj.audio.duration
  6048. ) {
  6049. //未播完
  6050. SoundManager.play("tour"); //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  6051. }
  6052. } else {
  6053. //很可能是该folder的起始
  6054. SoundManager.play("tour", manage.dealURL(src));
  6055. }
  6056. }
  6057. let oldPos = this.player.position.clone();
  6058. let oldPano = this.player.currentPano;
  6059. if (
  6060. ((this.onTheBus = !0),
  6061. this.emit("update.controls"),
  6062. this.player.updateLastView(),
  6063. !n && this.atDestinationPano())
  6064. ) {
  6065. /*
  6066. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  6067. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  6068. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  6069. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  6070. } */
  6071. return void this.arrivedAtDestination(!0);
  6072. }
  6073. if (this.player.flying || this.player.isWarping())
  6074. A.warn(
  6075. "Cannot go to new destination while player is flying or warping."
  6076. );
  6077. else {
  6078. var r = this.model.getHeroDescriptorByIndex(
  6079. this.destinationItem
  6080. ),
  6081. o = null,
  6082. a1 = null;
  6083. if (r.isPano()) {
  6084. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  6085. //var walk = window.DATA.black ? 'black' : 'walk';
  6086. //若是点击item,直接瞬间过渡。
  6087. var s = e
  6088. ? "black"
  6089. : this.getMomentTour(this.destinationItem); //window.DATA.momentTour || "walk";
  6090. if (
  6091. this.destinationItem[0] == 0 &&
  6092. this.destinationItem[1] == 0
  6093. )
  6094. s = "black"; // 周恩光加 返回最初导览点是瞬间过渡
  6095. (a1 = this.player.warpToPanoByHeroIndex.bind(
  6096. this.player,
  6097. this.destinationItem,
  6098. v.Show,
  6099. m.Slow,
  6100. s,
  6101. true,
  6102. i,
  6103. this.actionComplete.bind(this)
  6104. )),
  6105. (o = this.arrivedAtDestination.bind(this, !0));
  6106. if (
  6107. s == "black" &&
  6108. r.zoom &&
  6109. r.zoom != this.player.zoomLevel
  6110. ) {
  6111. //add
  6112. this.player.smoothZoomFovTo(
  6113. null,
  6114. r.zoom,
  6115. a.warp.teleportTime
  6116. ); //瞬间过渡的时间
  6117. }
  6118. } else {
  6119. (a1 = this.player.warpToNonPanoByHeroIndex.bind(
  6120. this.player,
  6121. this.destinationItem,
  6122. this.actionComplete.bind(this)
  6123. )),
  6124. (o = this.arrivedAtDestination.bind(this, !1));
  6125. }
  6126. (this.transitionStage = y.Moving),
  6127. this.model.fadePanoMarkers(0),
  6128. this.awaitCompletion(
  6129. function () {
  6130. a1();
  6131. }.bind(this),
  6132. o
  6133. ),
  6134. this.emit("update.controls");
  6135. }
  6136. }),
  6137. (n.prototype.tourInterlude = function () {
  6138. if (
  6139. (h.trackAlways("reach_highlight", {
  6140. reach_source: this.reachSource,
  6141. }),
  6142. this.model.fadePanoMarkers(0),
  6143. this.emit("update.controls"),
  6144. this.tourIsPlaying)
  6145. )
  6146. return this.atEndOfTour() && !this.endlessLoop
  6147. ? ((this.tourInProgress = !1),
  6148. void this.awaitCompletion(
  6149. function () {
  6150. (this.transitionStage = y.Interlude),
  6151. this.player.tourInterlude(
  6152. this.nextItem(this.currentItem),
  6153. this.actionComplete.bind(this)
  6154. );
  6155. }.bind(this),
  6156. function () {
  6157. (this.currentItem = [0, 0]),
  6158. this.stopTour(true),
  6159. this.emit(p.TourEnd);
  6160. }.bind(this)
  6161. ),
  6162. void (
  6163. this.player.mode === c.PANORAMA &&
  6164. this.model.fadePanoMarkers(a.panorama.markerOpacity)
  6165. ))
  6166. : void this.awaitCompletion(
  6167. function () {
  6168. (this.transitionStage = y.Interlude),
  6169. this.player.tourInterlude(
  6170. this.nextItem(this.currentItem),
  6171. this.actionComplete.bind(this)
  6172. );
  6173. }.bind(this),
  6174. this.goNext.bind(this)
  6175. );
  6176. }),
  6177. (n.prototype.findNearestItem = function (endToStart = true) {
  6178. //找到离currentPano最近的导览
  6179. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  6180. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  6181. } */
  6182. //注:没有判断此刻是否在panorama模式,就使用currentPano
  6183. var result = { item: [0, 0], dis: Infinity };
  6184. var compare = (location, item) => {
  6185. if (location.panoId != void 0 && location.panoId != "outside") {
  6186. var pano = this.model.panos.index[location.panoId];
  6187. var dis = pano.position.distanceTo(
  6188. this.player.currentPano.position
  6189. );
  6190. if (dis < result.dis) {
  6191. (result.item = item), (result.dis = dis);
  6192. } else if (dis == result.dis) {
  6193. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  6194. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  6195. result.item = item, result.dis = dis
  6196. } */
  6197. if (
  6198. this.currentItem &&
  6199. Math.abs(item[0] - this.currentItem[0]) <
  6200. Math.abs(result.item[0] - this.currentItem[0])
  6201. ) {
  6202. (result.item = item), (result.dis = dis);
  6203. }
  6204. }
  6205. }
  6206. };
  6207. this.model.heroLocations.forEach((e, i) => {
  6208. if (e.heroLocations) {
  6209. /* e.heroLocations.forEach((a,j)=>{
  6210. compare(a, [i,j])
  6211. }) */
  6212. var location = e.heroLocations.find(
  6213. (e) => e.panoId != void 0
  6214. );
  6215. location && compare(location, [i, 0]); //跳到此区域开头
  6216. } else {
  6217. compare(e, [i, 0]);
  6218. }
  6219. });
  6220. if (endToStart && this.atEndOfTour(result.item)) {
  6221. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  6222. return [0, 0]; //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  6223. }
  6224. return result.item;
  6225. });
  6226. n.prototype.playTour = function () {
  6227. if (!this.bounceable() && this.model.heroLocations.length) {
  6228. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  6229. // if(!this.currentItem) this.currentItem = []
  6230. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  6231. // // zeg 从当前pano进行自动导览
  6232. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  6233. // // this.model.heroLocations.forEach( (value, index) => {
  6234. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  6235. // // currentPanoDestinations.push(index)
  6236. // // }
  6237. // // })
  6238. // if(!currentPanoDestinations) {
  6239. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  6240. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  6241. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  6242. // for(var i = 0; i < neighbourIndex.length; i++) {
  6243. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  6244. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  6245. // }
  6246. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  6247. // }
  6248. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  6249. // this.currentItem[0] = currentPanoDestinations[0]
  6250. // }
  6251. // }
  6252. return this.tourIsPlaying
  6253. ? void A.info("tour is already playing")
  6254. : void (
  6255. this.wouldInterrupt() ||
  6256. (this.player.emit("tour_auto", this.defaultWarpStyle),
  6257. (this.tourInProgress = !0),
  6258. (this.reachSource = "play"),
  6259. (this.tourIsPlaying = !0),
  6260. (this.wasZoomEnabled = this.player.zoomEnabled),
  6261. (this.player.zoomEnabled = !1),
  6262. this.resetSpecialTransition(),
  6263. this.emit("update.controls"),
  6264. this.emit(p.TourStart),
  6265. this.player.enablePreRendering(),
  6266. // this.currentItem[1] = null,
  6267. this.walkingSectionPaused
  6268. ? (this.clearWalkingSectionPaused(),
  6269. this.goToDestination())
  6270. : /* this.goNext() */ (this.tourAdvance(0),
  6271. this.goToDestination()))
  6272. ); //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  6273. }
  6274. };
  6275. (n.prototype.playTourNearBy = function () {
  6276. //就近导览
  6277. if (!this.bounceable()) {
  6278. return this.tourIsPlaying
  6279. ? void A.info("tour is already playing")
  6280. : void (
  6281. this.wouldInterrupt() ||
  6282. (this.player.emit("tour_auto", this.defaultWarpStyle),
  6283. (this.tourInProgress = !0),
  6284. (this.reachSource = "play"),
  6285. (this.tourIsPlaying = !0),
  6286. (this.wasZoomEnabled = this.player.zoomEnabled),
  6287. (this.player.zoomEnabled = !1),
  6288. this.resetSpecialTransition(),
  6289. this.emit("update.controls"),
  6290. this.emit(p.TourStart),
  6291. this.player.enablePreRendering(),
  6292. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  6293. this.goToDestination()) : this.goNext())) */
  6294. this.setDestinationItem(this.findNearestItem()),
  6295. this.goToDestination())
  6296. );
  6297. }
  6298. }),
  6299. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  6300. } */
  6301. (n.prototype.stopTour = function (isAutoStop) {
  6302. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  6303. SoundManager.pause("tour"), // zeg 自动导览暂停时同时停止语音
  6304. this.isInterrupted() ||
  6305. (this.transitionStage === y.Moving &&
  6306. this.checkAndHandleWalkingtourInterruption(
  6307. this.nextWarpStyle
  6308. )) ||
  6309. (this.tourIsPlaying &&
  6310. (this.player.zoomEnabled = this.wasZoomEnabled),
  6311. (this.tourIsPlaying = !1),
  6312. this.interrupt(),
  6313. this.clearWalkingSectionPaused(),
  6314. this.resetSpecialTransition(),
  6315. this.emit("update.controls"));
  6316. }),
  6317. (n.prototype.endTourProgress = function () {
  6318. (this.tourInProgress = !1),
  6319. this.emit("update.controls"),
  6320. this.emit(p.TourEnd);
  6321. }),
  6322. (n.prototype.goToHighlight = function (e) {
  6323. if (this.wouldInterrupt())
  6324. this.itemCompare(this.destinationItem, e, "equal")
  6325. ? this.interrupt()
  6326. : this.redirectToItem(e, "goToHighlight");
  6327. else {
  6328. if ((A.debug("<tour.goto " + e + ">"), this.isInterrupted()))
  6329. return;
  6330. this.clearWalkingSectionPaused(),
  6331. this.setDestinationItem(e),
  6332. this.useSpecialTransition("Hilight");
  6333. this.goToDestination(true), //add true
  6334. h.trackAlways("reach_highlight", {
  6335. reach_source: "thumb",
  6336. });
  6337. }
  6338. }),
  6339. (n.prototype.prevHighlight = function () {
  6340. this.bounceable() ||
  6341. (this.player.emit("tour_manual", "prev"),
  6342. this.interrupt(g.BEGINNING) ||
  6343. this.isInterrupted() ||
  6344. (this.clearWalkingSectionPaused(),
  6345. (this.reachSource = "prev"),
  6346. this.goPrev()));
  6347. }),
  6348. (n.prototype.nextHighlight = function () {
  6349. this.bounceable() ||
  6350. (this.player.emit("tour_manual", "next"),
  6351. this.interrupt(g.BEGINNING) ||
  6352. this.isInterrupted() ||
  6353. (this.clearWalkingSectionPaused(),
  6354. (this.reachSource = "next"),
  6355. this.goNext()));
  6356. }),
  6357. (n.prototype.changeMode = function (e) {
  6358. var t = $.Deferred(),
  6359. i = t.resolve.bind(t),
  6360. n = t.reject.bind(t);
  6361. this.emit(p.StartModeChange);
  6362. var r = function () {
  6363. return (
  6364. this.clearWalkingSectionPaused(),
  6365. !!this.wouldInterrupt() && (this.interrupt(), !0)
  6366. );
  6367. }.bind(this);
  6368. if (!r()) {
  6369. switch (e) {
  6370. case c.PANORAMA:
  6371. this.player.mode === c.PANORAMA
  6372. ? this.player.currentPano.isAligned() ||
  6373. this.player.goToLastView(!0).done(i).fail(n)
  6374. : this.player
  6375. .insideMode(this.player.lastInsideView.pano)
  6376. .done(i)
  6377. .fail(n);
  6378. break;
  6379. case c.DOLLHOUSE:
  6380. case c.FLOORPLAN:
  6381. this.player
  6382. .flyToNewMode({
  6383. mode: e,
  6384. })
  6385. .done(i)
  6386. .fail(n);
  6387. break;
  6388. case c.OUTDOOR:
  6389. this.player.model.has360Views &&
  6390. (this.player.mode !== c.PANORAMA ||
  6391. (this.player.mode === c.PANORAMA &&
  6392. this.player.currentPano.isAligned())) &&
  6393. this.player.goToLastView(!1).done(i).fail(n);
  6394. }
  6395. return t.promise();
  6396. }
  6397. }),
  6398. (n.prototype.atEndOfTour = function (
  6399. currentItem = this.currentItem
  6400. ) {
  6401. var end = currentItem && currentItem[0] >= this.nItems - 1;
  6402. if (end) {
  6403. var heroLocations =
  6404. this.model.heroLocations[this.nItems - 1].heroLocations;
  6405. if (heroLocations) {
  6406. end = currentItem[1] >= heroLocations.length - 1;
  6407. }
  6408. }
  6409. return end;
  6410. }),
  6411. (n.prototype.firstDestination = function () {
  6412. //return 0 < this.nItems ? 0 : null
  6413. return 0 < this.nItems ? [0, 0] : null;
  6414. }),
  6415. (n.prototype.finalDestination = function () {
  6416. //return 0 < this.nItems ? this.nItems - 1 : null
  6417. return 0 < this.nItems ? [this.nItems - 1, 0] : null;
  6418. }),
  6419. (n.prototype.goPrev = function () {
  6420. this.tourAdvance(-1);
  6421. }),
  6422. (n.prototype.goNext = function () {
  6423. this.tourAdvance(1);
  6424. }),
  6425. (n.prototype.setDestinationItem = function (e) {
  6426. (this.destinationItem = e), this.emit("update.controls");
  6427. }),
  6428. (n.prototype.setCurrentItem = function (e) {
  6429. (this.currentItem = e), this.emit("update.controls");
  6430. }),
  6431. (n.prototype.nextItem = function (currentItem) {
  6432. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  6433. if (currentItem == void 0) return this.firstDestination();
  6434. var currentLocation = this.model.heroLocations[currentItem[0]];
  6435. var currentChildNum = currentLocation.heroLocations
  6436. ? currentLocation.heroLocations.length
  6437. : 1;
  6438. var item;
  6439. if (this.currentItem[1] >= currentChildNum - 1) {
  6440. //子目录中最后一个
  6441. item = [currentItem[0] + 1, 0]; //结果可能超出nItems
  6442. } else {
  6443. item = [currentItem[0], currentItem[1] + 1];
  6444. }
  6445. if (item[0] >= this.nItems) {
  6446. item = this.firstDestination();
  6447. }
  6448. return item;
  6449. //暂时不理会endlessLoop,默认为false
  6450. }),
  6451. (n.prototype.prevItem = function (currentItem) {
  6452. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  6453. if (currentItem == void 0) return this.firstDestination();
  6454. var item;
  6455. var lastLocation = this.model.heroLocations[currentItem[0] - 1];
  6456. if (!lastLocation)
  6457. return this.finalDestination(); //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  6458. else {
  6459. var lastChildNum = lastLocation.heroLocations
  6460. ? lastLocation.heroLocations.length
  6461. : 1;
  6462. if (this.currentItem[1] == 0) {
  6463. //子目录中第一个
  6464. return [currentItem[0] - 1, lastChildNum - 1];
  6465. } else {
  6466. return [currentItem[0], currentItem[1] - 1];
  6467. }
  6468. }
  6469. }),
  6470. (n.prototype.tourAdvance = function (e) {
  6471. //e是1或-1 或 0
  6472. A.debug("tourAdvance(" + e + ")");
  6473. // // zeg改
  6474. if (null === this.currentItem || void 0 === this.currentItem) {
  6475. // this.setDestinationItem(this.firstDestination())
  6476. // this.setDestinationItem([currentPanoDestinations[0], 0])
  6477. this.setDestinationItem([this.currentItem[0], 0]);
  6478. }
  6479. // else if(this.currentItem[1] == null) {
  6480. // this.setDestinationItem([this.currentItem[0], 0])
  6481. // }
  6482. else {
  6483. var item = this.currentItem;
  6484. if (e == 1) {
  6485. item = this.nextItem(this.currentItem);
  6486. } else if (e == -1) {
  6487. item = this.prevItem(this.currentItem);
  6488. }
  6489. this.setDestinationItem(item);
  6490. }
  6491. if (
  6492. this.itemCompare(
  6493. this.destinationItem,
  6494. this.finalDestination(),
  6495. "equal"
  6496. )
  6497. ) {
  6498. this.useSpecialTransition("reverse-looping to end");
  6499. } else if (
  6500. this.itemCompare(
  6501. this.destinationItem,
  6502. this.firstDestination(),
  6503. "equal"
  6504. )
  6505. ) {
  6506. this.useSpecialTransition("looping back to start");
  6507. }
  6508. /* var momentTour = this.getMomentTour(this.destinationItem);
  6509. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  6510. var zoomLevel = this.player.zoomLevel;
  6511. this.player.zoomEnabled = true;
  6512. var zoom = function(e, d) {
  6513. this.player.zoomTo((1-e)*zoomLevel, true)
  6514. }.bind(this)
  6515. s.start(zoom, 1500, function(){
  6516. }, 0, d.easeOutQuad, "zoom")
  6517. } */
  6518. this.goToDestination();
  6519. }),
  6520. (n.prototype.getMomentTour = function (destinationItem) {
  6521. //add
  6522. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层 还有一种是'std'
  6523. if (!destinationItem) return wholeMomentTour;
  6524. else {
  6525. var currentLocation =
  6526. this.model.getHeroDescriptorByIndex(destinationItem); //最内层。 如果有使用最内层
  6527. if (currentLocation.momentTour)
  6528. return currentLocation.momentTour;
  6529. var currentLocation_ =
  6530. this.model.heroLocations[destinationItem[0]];
  6531. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  6532. }
  6533. }),
  6534. (t.exports = n);
  6535. }).call(this, "/js/director.js");
  6536. },
  6537. {
  6538. "./analytics": 4,
  6539. "./enum/BlackoutStyle": 18,
  6540. "./enum/ControlEvents": 21,
  6541. "./enum/DirectorEvents": 23,
  6542. "./enum/ModelManagerEvents": 33,
  6543. "./enum/PathDiscardMode": 38,
  6544. "./enum/PathDisplayMode": 39,
  6545. "./enum/PlayerEvents": 40,
  6546. "./enum/Viewmode": 51,
  6547. "./enum/WarpStyle": 52,
  6548. "./model/ModelManager": 140,
  6549. "./player": 155,
  6550. "./settings": 166,
  6551. "./util/logger": 189,
  6552. "./util/transitions": 195,
  6553. events: 202,
  6554. three: 217,
  6555. },
  6556. ],
  6557. 16: [
  6558. function (e, t, i) {
  6559. "use strict";
  6560. var n = e("three"),
  6561. r = e("./enum/Viewmode"),
  6562. o = (e("./settings"), e("./util/transitions")),
  6563. a = e("./enum/PlayerEvents"),
  6564. s = new n.ShaderPass(n.HorizontalBlurShader),
  6565. l = new n.ShaderPass(n.VerticalBlurShader);
  6566. l.renderToScreen = !0;
  6567. var c = $("#player").width() / $("#player").height();
  6568. isNaN(c) && (c = 1);
  6569. //initTransitionPass(n)
  6570. var h = {
  6571. currentBlur: 0,
  6572. aspect: c,
  6573. blurStrength: 1,
  6574. hblurPass: s,
  6575. vblurPass: l,
  6576. transitionMaskPass: new n.TransitionPass(),
  6577. bindEvents: function (e) {
  6578. e.on(a.ModeChanged, function (e, t) {
  6579. e === r.PANORAMA &&
  6580. (o.cancel(h.blur),
  6581. o.cancel(h.addBlur),
  6582. o.start(h.removeBlur, 500, null, 0, null, "deblur"));
  6583. });
  6584. },
  6585. blur: function (e) {
  6586. h.currentBlur = e;
  6587. var t = e * h.blurStrength;
  6588. (l.uniforms.v.value = (t / 512) * h.aspect),
  6589. (s.uniforms.h.value = t / 512);
  6590. },
  6591. addBlur: function (e) {
  6592. (e = Math.max(e, h.currentBlur)), h.blur(e);
  6593. },
  6594. removeBlur: function (e) {
  6595. (e = Math.min(1 - e, h.currentBlur)), h.blur(e);
  6596. },
  6597. };
  6598. h.blur(0), (t.exports = h);
  6599. },
  6600. {
  6601. "./enum/PlayerEvents": 40,
  6602. "./enum/Viewmode": 51,
  6603. "./settings": 166,
  6604. "./util/transitions": 195,
  6605. three: 217,
  6606. },
  6607. ],
  6608. 17: [
  6609. function (e, t, i) {
  6610. "use strict";
  6611. t.exports = {
  6612. UNKNOWN: 0,
  6613. ALIGNED: 1,
  6614. UNALIGNED: 2,
  6615. PLACED: 3,
  6616. };
  6617. },
  6618. {},
  6619. ],
  6620. 18: [
  6621. function (e, t, i) {
  6622. "use strict";
  6623. t.exports = {
  6624. NONE: 0,
  6625. MIDDLE: 1,
  6626. END: 2,
  6627. BEGINNING: 3,
  6628. FADEIN: 4,
  6629. };
  6630. },
  6631. {},
  6632. ],
  6633. 19: [
  6634. function (e, t, i) {
  6635. "use strict";
  6636. var n = e("three");
  6637. t.exports = {
  6638. newBlue: new n.Color(4967932),
  6639. altBlue: new n.Color(47355),
  6640. tagDefault: new n.Color(223357),
  6641. classicBlue: new n.Color(53759),
  6642. mpYellow: new n.Color(16502016),
  6643. mpOrange: new n.Color(16428055),
  6644. mpBlue: new n.Color(12096),
  6645. mpLtGrey: new n.Color(13751252),
  6646. mpDkGrey: new n.Color(10000019),
  6647. mpRed: new n.Color(12525854),
  6648. mpOrangeDesat: new n.Color(16764529),
  6649. mpBlueDesat: new n.Color(4034734),
  6650. mpRedDesat: new n.Color(14705505),
  6651. white: new n.Color(16777215),
  6652. black: new n.Color(0),
  6653. _desat: function (e, t) {
  6654. var i = t || 0.3,
  6655. r = new n.Color().copy(e).getHSL();
  6656. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l);
  6657. },
  6658. _darken: function (e, t) {
  6659. var i = t || 0.2,
  6660. r = e.getHSL();
  6661. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i));
  6662. },
  6663. };
  6664. },
  6665. {
  6666. three: 217,
  6667. },
  6668. ],
  6669. 20: [
  6670. function (e, t, i) {
  6671. "use strict";
  6672. t.exports = {
  6673. NONE: -1,
  6674. ROTATE: 0,
  6675. DOLLY: 1,
  6676. PAN: 2,
  6677. ROTATE_DOLLY: 3,
  6678. PAN_DOLLY: 4,
  6679. };
  6680. },
  6681. {},
  6682. ],
  6683. 21: [
  6684. function (e, t, i) {
  6685. "use strict";
  6686. t.exports = {
  6687. Move: "move",
  6688. InteractionDirect: "interaction.direct",
  6689. InteractionKey: "interaction.key",
  6690. InteractionGui: "interaction.gui",
  6691. FlyInDirection: "fly.direction",
  6692. InputStart: "input.start",
  6693. Pinch: "input.pinch",
  6694. Scroll: "input.scroll",
  6695. AutoPanInterrupt: "autopan.interrupt",
  6696. AutoPanComplete: "autopan.complete",
  6697. AutoPanClamped: "autopan.clamped",
  6698. LongTap: "longtap",
  6699. };
  6700. },
  6701. {},
  6702. ],
  6703. 22: [
  6704. function (e, t, i) {
  6705. "use strict";
  6706. t.exports = Object.freeze({
  6707. FORWARD: "FORWARD",
  6708. LEFT: "LEFT",
  6709. RIGHT: "RIGHT",
  6710. BACK: "BACK",
  6711. UP: "UP",
  6712. DOWN: "DOWN",
  6713. });
  6714. },
  6715. {},
  6716. ],
  6717. 23: [
  6718. function (e, t, i) {
  6719. "use strict";
  6720. t.exports = {
  6721. ActionInterrupted: "action.interrupted",
  6722. TourStart: "tour.start",
  6723. TourEnd: "tour.end",
  6724. StartModeChange: "mode.startChange",
  6725. };
  6726. },
  6727. {},
  6728. ],
  6729. 24: [
  6730. function (e, t, i) {
  6731. "use strict";
  6732. t.exports = Object.freeze({
  6733. None: 0,
  6734. Queued: 1,
  6735. ForceQueued: 2,
  6736. Downloading: 3,
  6737. Downloaded: 4,
  6738. DownloadFailed: 5,
  6739. });
  6740. },
  6741. {},
  6742. ],
  6743. 25: [
  6744. function (e, t, i) {
  6745. "use strict";
  6746. t.exports = {
  6747. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  6748. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  6749. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  6750. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  6751. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  6752. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5,
  6753. };
  6754. },
  6755. {},
  6756. ],
  6757. 26: [
  6758. function (e, t, i) {
  6759. "use strict";
  6760. t.exports = {
  6761. Texture2D: 0,
  6762. TextureCube: 1,
  6763. };
  6764. },
  6765. {},
  6766. ],
  6767. 27: [
  6768. function (e, t, i) {
  6769. "use strict";
  6770. t.exports = {
  6771. SMALL: "small",
  6772. LARGE: "large",
  6773. };
  6774. },
  6775. {},
  6776. ],
  6777. 28: [
  6778. function (e, t, i) {
  6779. "use strict";
  6780. var n = e("./Viewmode"),
  6781. r = {
  6782. LANDING: {},
  6783. NAVIGATION: "navigation",
  6784. MORE_HELP: "moreHelp",
  6785. TOUR_INTERACTION: {},
  6786. };
  6787. (r.LANDING[n.PANORAMA] = "panorama.landing"),
  6788. (r.LANDING[n.OUTDOOR] = "outdoor.landing"),
  6789. (r.LANDING[n.DOLLHOUSE] = "dollhouse.landing"),
  6790. (r.LANDING[n.FLOORPLAN] = "floorplan.landing"),
  6791. (r.TOUR_INTERACTION.standard = "standard.tour"),
  6792. (r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour"),
  6793. (r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour"),
  6794. (t.exports = r);
  6795. },
  6796. {
  6797. "./Viewmode": 51,
  6798. },
  6799. ],
  6800. 29: [
  6801. function (e, t, i) {
  6802. "use strict";
  6803. var n = {
  6804. UP: 1,
  6805. DOWN: -1,
  6806. LEFT: "L",
  6807. RIGHT: "R",
  6808. FORWARD: "F",
  6809. BACK: "B",
  6810. reverse: {},
  6811. opposite: function (e) {
  6812. return this.reverse[e.toString()];
  6813. },
  6814. };
  6815. !(function () {
  6816. (n.reverse[n.UP] = n.DOWN),
  6817. (n.reverse[n.DOWN] = n.UP),
  6818. (n.reverse[n.LEFT] = n.RIGHT),
  6819. (n.reverse[n.RIGHT] = n.LEFT),
  6820. (n.reverse[n.FORWARD] = n.BACK),
  6821. (n.reverse[n.BACK] = n.FORWARD);
  6822. })(),
  6823. (t.exports = n);
  6824. },
  6825. {},
  6826. ],
  6827. 30: [
  6828. function (e, t, i) {
  6829. "use strict";
  6830. var n = e("../util/browser"),
  6831. r = {
  6832. ZERO: 48,
  6833. ONE: 49,
  6834. TWO: 50,
  6835. THREE: 51,
  6836. FOUR: 52,
  6837. FIVE: 53,
  6838. SIX: 54,
  6839. SEVEN: 55,
  6840. EIGHT: 56,
  6841. NINE: 57,
  6842. LEFTARROW: 37,
  6843. UPARROW: 38,
  6844. RIGHTARROW: 39,
  6845. DOWNARROW: 40,
  6846. A: 65,
  6847. B: 66,
  6848. C: 67,
  6849. D: 68,
  6850. E: 69,
  6851. F: 70,
  6852. G: 71,
  6853. H: 72,
  6854. I: 73,
  6855. J: 74,
  6856. K: 75,
  6857. L: 76,
  6858. M: 77,
  6859. N: 78,
  6860. O: 79,
  6861. P: 80,
  6862. Q: 81,
  6863. R: 82,
  6864. S: 83,
  6865. T: 84,
  6866. U: 85,
  6867. V: 86,
  6868. W: 87,
  6869. X: 88,
  6870. Y: 89,
  6871. Z: 90,
  6872. SPACE: 32,
  6873. RETURN: 13,
  6874. SEMICOLON: 186,
  6875. PLUSEQUALS: 187,
  6876. DASHUNDERSCORE: 189,
  6877. OPENBRACKET: 219,
  6878. };
  6879. n.detectFirefox() &&
  6880. ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)),
  6881. (t.exports = r);
  6882. },
  6883. {
  6884. "../util/browser": 182,
  6885. },
  6886. ],
  6887. 31: [
  6888. function (e, t, i) {
  6889. "use strict";
  6890. t.exports = {
  6891. EN_US: "en-US",
  6892. ES_MX: "es-MX",
  6893. FR_FR: "fr-FR",
  6894. DE_DE: "de-DE",
  6895. RU_RU: "ru-RU",
  6896. CN_CN: "cn-CN",
  6897. JP_JP: "jp-JP",
  6898. };
  6899. },
  6900. {},
  6901. ],
  6902. 32: [
  6903. function (e, t, i) {
  6904. "use strict";
  6905. t.exports = {
  6906. TagActivated: "tag.activated",
  6907. TagDismissed: "tag.dismissed",
  6908. TagNavigation: "tag.navigation",
  6909. };
  6910. },
  6911. {},
  6912. ],
  6913. 33: [
  6914. function (e, t, i) {
  6915. "use strict";
  6916. t.exports = {
  6917. ModelAdded: "model-added",
  6918. ActiveModelChanged: "active-model-changed",
  6919. };
  6920. },
  6921. {},
  6922. ],
  6923. 34: [
  6924. function (e, t, i) {
  6925. "use strict";
  6926. t.exports = {
  6927. LEFT: 0,
  6928. MIDDLE: 1,
  6929. RIGHT: 2,
  6930. };
  6931. },
  6932. {},
  6933. ],
  6934. 35: [
  6935. function (e, t, i) {
  6936. "use strict";
  6937. t.exports = {
  6938. PanoRenderComplete: "panorama.render.complete",
  6939. TileRenderFailure: "panorama.tile.render.failed",
  6940. TileRenderSuccess: "panorama.tile.render.success",
  6941. TileUploadAttempted: "panorama.tile.upload.attempted",
  6942. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  6943. ZoomLevelRenderStarted: "panorama.zoom.render.started",
  6944. };
  6945. },
  6946. {},
  6947. ],
  6948. 36: [
  6949. function (e, t, i) {
  6950. "use strict";
  6951. t.exports = {
  6952. BASE: 1,
  6953. STANDARD: 2,
  6954. HIGH: 3,
  6955. ULTRAHIGH: 4,
  6956. };
  6957. },
  6958. {},
  6959. ],
  6960. 37: [
  6961. function (e, t, i) {
  6962. "use strict";
  6963. t.exports = {
  6964. LoadComplete: "panorama.load.complete",
  6965. LoadFailed: "panorama.load.failed",
  6966. TileLoaded: "panorama.tile.loaded",
  6967. };
  6968. },
  6969. {},
  6970. ],
  6971. 38: [
  6972. function (e, t, i) {
  6973. "use strict";
  6974. t.exports = Object.freeze({
  6975. Standard: 0,
  6976. Slow: 1,
  6977. Retain: 2,
  6978. });
  6979. },
  6980. {},
  6981. ],
  6982. 39: [
  6983. function (e, t, i) {
  6984. "use strict";
  6985. t.exports = Object.freeze({
  6986. Show: 0,
  6987. Hide: 1,
  6988. Retain: 2,
  6989. });
  6990. },
  6991. {},
  6992. ],
  6993. 40: [
  6994. function (e, t, i) {
  6995. "use strict";
  6996. t.exports = {
  6997. Move: "move",
  6998. MoveComplete: "move.complete",
  6999. ModeChanged: "mode.changed",
  7000. ModeChanging: "mode.changing",
  7001. PanoChosen: "pano.chosen",
  7002. ClosestPanoChanging: "closest.pano.changing",
  7003. WarpStarted: "warp.started",
  7004. WarpInterrupted: "warp.interrupted",
  7005. WarpEnded: "warp.ended",
  7006. FlyinFinished: "flyin.finished",
  7007. FlyingStarted: "flying.started",
  7008. FlyingInterrupted: "flying.interrupted",
  7009. FlyingEnded: "flying.ended",
  7010. Ready: "ready",
  7011. StartInside: "start.inside",
  7012. StartOutside: "start.outside",
  7013. ViewChanged: "view.changed",
  7014. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  7015. InputStart: "input.start",
  7016. };
  7017. },
  7018. {},
  7019. ],
  7020. 41: [
  7021. function (e, t, i) {
  7022. "use strict";
  7023. t.exports = Object.freeze({
  7024. DEFAULT: 0,
  7025. PANOMARKERS: 1,
  7026. RETICULE: 2,
  7027. TAG: 3,
  7028. });
  7029. },
  7030. {},
  7031. ],
  7032. 42: [
  7033. function (e, t, i) {
  7034. "use strict";
  7035. t.exports = {
  7036. visibleFloor: 1,
  7037. ghostFloor: 3,
  7038. boundingSkybox: 1,
  7039. panoMarker: 2,
  7040. reticule: 3,
  7041. tagStem: 4,
  7042. tagDisc: 5,
  7043. ribbon: 100,
  7044. };
  7045. },
  7046. {},
  7047. ],
  7048. 43: [
  7049. function (e, t, i) {
  7050. "use strict";
  7051. t.exports = {
  7052. ContextCreated: "scene-renderer-context-created",
  7053. AfterRender: "after-render",
  7054. MemoryUsageUpdated: "scene-renderer-memory-usage-updated",
  7055. };
  7056. },
  7057. {},
  7058. ],
  7059. 44: [
  7060. function (e, t, i) {
  7061. "use strict";
  7062. t.exports = {
  7063. IDLE: "idle",
  7064. BROWSE: "browse",
  7065. EXAMINE: "examine",
  7066. };
  7067. },
  7068. {},
  7069. ],
  7070. 45: [
  7071. function (e, t, i) {
  7072. "use strict";
  7073. t.exports = {
  7074. TileDownloadSuccess: "tiledownloader.download.success",
  7075. TileDownloadFailure: "tiledownloader.download.failure",
  7076. PanoDownloadComplete: "tiledownloader.pano.download.complete",
  7077. };
  7078. },
  7079. {},
  7080. ],
  7081. 46: [
  7082. function (e, t, i) {
  7083. "use strict";
  7084. t.exports = {
  7085. CardboardAndroid: "googlevr",
  7086. GearVR: "gearvr",
  7087. CardboardIOS: "googlevrios",
  7088. Cardboard: "googlevr",
  7089. };
  7090. },
  7091. {},
  7092. ],
  7093. 47: [
  7094. function (e, t, i) {
  7095. "use strict";
  7096. t.exports = {
  7097. NONE: 0,
  7098. CONTEXTUAL: 1,
  7099. ANDROID: 2,
  7100. };
  7101. },
  7102. {},
  7103. ],
  7104. 48: [
  7105. function (e, t, i) {
  7106. "use strict";
  7107. var n = {
  7108. Title: 0,
  7109. Cardboard: 1,
  7110. },
  7111. r = {
  7112. Title: 0,
  7113. Cardboard: 1,
  7114. Gear: 2,
  7115. };
  7116. !(function () {
  7117. [n, r].forEach(function (e) {
  7118. e.pageCount = Object.keys(e).length;
  7119. });
  7120. })(),
  7121. (t.exports.ios = n),
  7122. (t.exports.standard = r);
  7123. },
  7124. {},
  7125. ],
  7126. 49: [
  7127. function (e, t, i) {
  7128. "use strict";
  7129. t.exports = {
  7130. Android: "android",
  7131. IOS: "ios",
  7132. Desktop: "desktop",
  7133. UnsupportedAndroid: "android-unsupported",
  7134. };
  7135. },
  7136. {},
  7137. ],
  7138. 50: [
  7139. function (e, t, i) {
  7140. "use strict";
  7141. var n = e("three");
  7142. t.exports = {
  7143. UP: new n.Vector3(0, 1, 0),
  7144. DOWN: new n.Vector3(0, -1, 0),
  7145. LEFT: new n.Vector3(-1, 0, 0),
  7146. RIGHT: new n.Vector3(1, 0, 0),
  7147. FORWARD: new n.Vector3(0, 0, -1),
  7148. BACK: new n.Vector3(0, 0, 1),
  7149. };
  7150. },
  7151. {
  7152. three: 217,
  7153. },
  7154. ],
  7155. 51: [
  7156. function (e, t, i) {
  7157. "use strict";
  7158. var n = e("../exception/ViewmodeConvertException"),
  7159. r = e("./coreViewmodes"),
  7160. o = e("../util/common"),
  7161. a = {
  7162. MESH: "mesh",
  7163. OUTDOOR: "outdoor",
  7164. TRANSITIONING: "transitioning",
  7165. toInt: function (e) {
  7166. switch (e) {
  7167. case this.PANORAMA:
  7168. return 1;
  7169. case this.DOLLHOUSE:
  7170. return 2;
  7171. case this.FLOORPLAN:
  7172. return 3;
  7173. case this.OUTDOOR:
  7174. return 4;
  7175. case this.TRANSITIONING:
  7176. return -1;
  7177. }
  7178. throw new n(
  7179. "No known conversion for Viewmode to int for mode: " + e
  7180. );
  7181. },
  7182. fromInt: function (e) {
  7183. switch (e) {
  7184. case "1":
  7185. case 1:
  7186. return this.PANORAMA;
  7187. case "2":
  7188. case 2:
  7189. return this.DOLLHOUSE;
  7190. case "3":
  7191. case 3:
  7192. return this.FLOORPLAN;
  7193. case "4":
  7194. case 4:
  7195. return this.OUTDOOR;
  7196. }
  7197. throw new n(
  7198. "No known conversion for int to viewmode for int: " + e
  7199. );
  7200. },
  7201. convertWorkshopModeInt: function (e) {
  7202. switch (e) {
  7203. case "0":
  7204. case 0:
  7205. case undefined: //xzw add
  7206. return this.PANORAMA;
  7207. case "1":
  7208. case 1:
  7209. return this.FLOORPLAN;
  7210. case "2":
  7211. case 2:
  7212. return this.DOLLHOUSE;
  7213. case "3":
  7214. case 3:
  7215. return this.MESH;
  7216. }
  7217. throw new n(
  7218. "No known conversion for Workshop int to viewmode for int: " + e
  7219. );
  7220. },
  7221. };
  7222. o.extendObject(a, r), (t.exports = a);
  7223. },
  7224. {
  7225. "../exception/ViewmodeConvertException": 58,
  7226. "../util/common": 185,
  7227. "./coreViewmodes": 54,
  7228. },
  7229. ],
  7230. 52: [
  7231. function (e, t, i) {
  7232. "use strict";
  7233. t.exports = {
  7234. BLACK: "black",
  7235. STD: "std",
  7236. WALK: "walk",
  7237. };
  7238. },
  7239. {},
  7240. ],
  7241. 53: [
  7242. function (e, t, i) {
  7243. "use strict";
  7244. t.exports = {
  7245. ZoomIn: "zoom.in",
  7246. ZoomOut: "zoom.out",
  7247. ZoomMax: "zoom.max",
  7248. ZoomMin: "zoom.min",
  7249. };
  7250. },
  7251. {},
  7252. ],
  7253. 54: [
  7254. function (e, t, i) {
  7255. "use strict";
  7256. t.exports = {
  7257. PANORAMA: "panorama",
  7258. DOLLHOUSE: "dollhouse",
  7259. FLOORPLAN: "floorplan",
  7260. };
  7261. },
  7262. {},
  7263. ],
  7264. 55: [
  7265. function (e, t, i) {
  7266. "use strict";
  7267. function n(e) {
  7268. this.message = e;
  7269. }
  7270. t.exports = n;
  7271. },
  7272. {},
  7273. ],
  7274. 56: [
  7275. function (e, t, i) {
  7276. "use strict";
  7277. function n(e) {
  7278. r.call(this, e);
  7279. }
  7280. var r = e("./BasicException");
  7281. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  7282. },
  7283. {
  7284. "./BasicException": 55,
  7285. },
  7286. ],
  7287. 57: [
  7288. function (e, t, i) {
  7289. "use strict";
  7290. function n(e) {
  7291. r.call(this, e);
  7292. }
  7293. var r = e("./BasicException");
  7294. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  7295. },
  7296. {
  7297. "./BasicException": 55,
  7298. },
  7299. ],
  7300. 58: [
  7301. function (e, t, i) {
  7302. "use strict";
  7303. function n(e) {
  7304. r.call(this, e);
  7305. }
  7306. var r = e("./BasicException");
  7307. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  7308. },
  7309. {
  7310. "./BasicException": 55,
  7311. },
  7312. ],
  7313. 59: [
  7314. function (e, t, i) {
  7315. (function (i) {
  7316. "use strict";
  7317. function n(e) {
  7318. var t = {};
  7319. if (e) {
  7320. var i = e.flags;
  7321. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0);
  7322. return t;
  7323. }
  7324. return (
  7325. l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  7326. null
  7327. );
  7328. }
  7329. var r = e("./util/ajax"),
  7330. o = e("./util/showcase"),
  7331. a = e("./util/logger"),
  7332. s = "",
  7333. l = new a(i),
  7334. c = {};
  7335. t.exports = {
  7336. loadFeatureFlags: function (e) {
  7337. var t = $.Deferred();
  7338. return (
  7339. r
  7340. .get(e.urlBase + s, {
  7341. responseType: "json",
  7342. prefetchFrom: "user",
  7343. auth: o.getAuthorizationHeader(),
  7344. })
  7345. .done(function (e) {
  7346. (c = n(e)), c ? t.resolve(c) : t.reject("loading-failed");
  7347. })
  7348. .fail(function () {
  7349. l.debug("Retrieval of feature flags failed."),
  7350. t.reject("loading-failed");
  7351. }),
  7352. t.promise()
  7353. );
  7354. },
  7355. getFlags: function () {
  7356. return c;
  7357. },
  7358. updateDependentSettings: function (e, t) {
  7359. (e = e || c),
  7360. e.labels && (t.labels.enabled = !0),
  7361. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  7362. e.showcase_sdk && (t.sdkInit = !0),
  7363. e.mobile_highq_override &&
  7364. (t.tiling.mobileHighQualityOverride = !0),
  7365. e.showcase_webvr && (t.vr.allowWebVR = !0),
  7366. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  7367. e.hide_sc_sharing && (t.share.enabled = !1);
  7368. },
  7369. };
  7370. }).call(this, "/js/featureflags.js");
  7371. },
  7372. {
  7373. "./util/ajax": 181,
  7374. "./util/logger": 189,
  7375. "./util/showcase": 193,
  7376. },
  7377. ],
  7378. 60: [
  7379. function (e, t, i) {
  7380. "use strict";
  7381. var n =
  7382. (e("../util/common"),
  7383. {
  7384. status: 0,
  7385. set: function (e) {
  7386. if (isNaN(e)) return !1;
  7387. var t = $(".progressbar");
  7388. 0 > e && (e = 0);
  7389. e > 100 && (e = 100);
  7390. var width = parseInt(t.css("width").replace("px", "")) / 100; //获取进度条总长度除以100
  7391. var barperc = e * width;
  7392. var perc = Math.round(e);
  7393. var labelpos = parseInt(barperc) - 15;
  7394. t.find(".bar").css("width", barperc); //已经再跑颜色的百分比
  7395. t.find(".label").css("left", labelpos); //上面跟着的字的百分比
  7396. t.find(".perc").text(perc + "%"); //具体数字的百分比
  7397. this.status = e;
  7398. },
  7399. done: function (e) {
  7400. return e || this.status
  7401. ? ((this.status = null), this.set(100))
  7402. : this;
  7403. },
  7404. });
  7405. t.exports.circleLoader = n;
  7406. },
  7407. {
  7408. "../util/common": 185,
  7409. },
  7410. ],
  7411. 61: [
  7412. function (e, t, i) {
  7413. "use strict";
  7414. t.exports = Object.freeze({
  7415. CLOSE: "modal.closer.close",
  7416. });
  7417. },
  7418. {},
  7419. ],
  7420. 62: [
  7421. function (e, t, i) {
  7422. "use strict";
  7423. function n(e, t) {
  7424. t && (t.stopPropagation(), t.preventDefault()),
  7425. e && this.emit(l.CLOSE, e),
  7426. g.reset();
  7427. }
  7428. function r(e, t) {
  7429. function i() {
  7430. var t =
  7431. e.offsetHeight >= $("#player").height() &&
  7432. e.offsetWidth >= $("#player").width();
  7433. t !== f &&
  7434. ((f = t),
  7435. t
  7436. ? (e.classList.add("closeByFooter"),
  7437. h.classList.add("closeByFooter"))
  7438. : (e.classList.remove("closeByFooter"),
  7439. h.classList.remove("closeByFooter")));
  7440. }
  7441. t ? setTimeout(i, o.guiAnimationSpeed) : i();
  7442. }
  7443. var o = e("../../settings"),
  7444. a = (e("../../tag/Media/MediaEvent"), e("../../util/browser")),
  7445. s = e("../../util/common"),
  7446. l = e("./ModalCloserEvent"),
  7447. c = e("events").EventEmitter,
  7448. h = document.getElementsByClassName("footer")[0],
  7449. u = h.querySelectorAll(".close")[0],
  7450. d = null,
  7451. p = null,
  7452. f = null,
  7453. g =
  7454. (a.isMobile(),
  7455. {
  7456. open: function (e) {
  7457. e &&
  7458. (r(e),
  7459. d && u.removeEventListener("click", d, !0),
  7460. (d = n.bind(this, e.id)),
  7461. u.addEventListener("click", d, !0),
  7462. p && window.removeEventListener("resize", p, !0),
  7463. (p = r.bind(this, e)),
  7464. window.addEventListener("resize", p, !0));
  7465. },
  7466. reset: function () {
  7467. h.classList.remove("closeByFooter"),
  7468. u.removeEventListener("click", d, !0),
  7469. window.removeEventListener("resize", p, !0),
  7470. (d = p = f = null);
  7471. },
  7472. });
  7473. s.extendObject(g, c.prototype), (t.exports = g);
  7474. },
  7475. {
  7476. "../../tag/Media/MediaEvent": 131,
  7477. "../../settings": 166,
  7478. "../../util/browser": 182,
  7479. "../../util/common": 185,
  7480. "./ModalCloserEvent": 61,
  7481. events: 202,
  7482. },
  7483. ],
  7484. 63: [
  7485. function (e, t, i) {
  7486. "use strict";
  7487. function n(e, t, i) {
  7488. var n = new r.GUI({
  7489. width: 400,
  7490. }),
  7491. u = n.addFolder("Flydown from Dollhouse");
  7492. u.add(h.flydown, "movementEasing", Object.keys(a)),
  7493. u.add(h.flydown, "movementDelay", 0, 1).step(0.01),
  7494. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  7495. u.add(h.flydown, "rotationDelay", 0, 1).step(0.01),
  7496. u.add(h.flydown, "modelTextureDelay", 0, 1).step(0.01),
  7497. u.add(h.flydown, "skyboxDelay", 0, 1).step(0.01),
  7498. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  7499. u.add(
  7500. h.dollhouseDefault,
  7501. "maxPolarAngle",
  7502. o.Math.degToRad(50),
  7503. o.Math.degToRad(170)
  7504. );
  7505. var d = n.addFolder("Transition between panos");
  7506. d.add(h.transition, "blur", 0, 10).onFinishChange(function () {}),
  7507. d
  7508. .add(h.transition, "flySpeed", 0, 10)
  7509. .step(0.01)
  7510. .onFinishChange(function () {
  7511. (h.transition.flyTime = 0),
  7512. d.__controllers.forEach(function (e) {
  7513. e.updateDisplay();
  7514. });
  7515. }),
  7516. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function () {
  7517. (h.transition.flySpeed = 0),
  7518. d.__controllers.forEach(function (e) {
  7519. e.updateDisplay();
  7520. });
  7521. }),
  7522. d.add(h.transition, "aimTime", 500, 2500).step(50),
  7523. d.add(h.transition, "aimSlowFactor", 1, 3).step(0.1),
  7524. d.add(h.transition, "movementEasing", Object.keys(a));
  7525. var p = n.addFolder("Path Display");
  7526. p
  7527. .add(h.path, "opacity", 0, 1)
  7528. .step(0.01)
  7529. .onFinishChange(function () {}),
  7530. p
  7531. .add(h.path, "height", 0, 0.2)
  7532. .step(0.01)
  7533. .onFinishChange(function () {}),
  7534. p
  7535. .add(h.path, "outsideHeight", 0, 2)
  7536. .step(0.01)
  7537. .onFinishChange(function () {}),
  7538. p
  7539. .add(h.path, "ribbonWidth", 0.01, 0.35)
  7540. .step(0.01)
  7541. .onFinishChange(function () {}),
  7542. p
  7543. .add(h.path, "waypointRadius", 0.01, 1.2)
  7544. .step(0.01)
  7545. .onFinishChange(function () {}),
  7546. p
  7547. .add(h.path, "waypointPulse", 0, 3600)
  7548. .step(20)
  7549. .onFinishChange(function () {}),
  7550. p
  7551. .add(h.path, "waypointIndoorRadius", 0.01, 1.2)
  7552. .step(0.01)
  7553. .onFinishChange(function () {}),
  7554. p
  7555. .add(h.path, "fadeInTime", 0, 1200)
  7556. .step(10)
  7557. .onFinishChange(function () {}),
  7558. p
  7559. .add(h.path, "fadeOutTime", 0, 1200)
  7560. .step(10)
  7561. .onFinishChange(function () {}),
  7562. p.add(h.path, "color", Object.keys(l)).onFinishChange(function () {
  7563. (h.path.color = l[h.path.color]),
  7564. (h.path.colorUp = l._desat(h.path.color)),
  7565. (h.path.colorDown = l.darken(h.path.color));
  7566. }),
  7567. p
  7568. .add(h, "reticuleColor", Object.keys(l))
  7569. .onFinishChange(function () {
  7570. h.reticuleColor = l[h.reticuleColor];
  7571. });
  7572. var f = n.addFolder("Warping"),
  7573. g = f.addFolder("Warp/Teleport");
  7574. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function () {}),
  7575. g
  7576. .add(h.warp, "softPushEnd", 0, 1)
  7577. .step(0.01)
  7578. .onFinishChange(function () {}),
  7579. g
  7580. .add(h.warp, "softBendAngle", 0, 45)
  7581. .onFinishChange(function () {}),
  7582. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function () {}),
  7583. g
  7584. .add(h.warp, "softBendEnd", 0, 1)
  7585. .step(0.01)
  7586. .onFinishChange(function () {}),
  7587. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function () {}),
  7588. g
  7589. .add(h.warp, "minBurnsAngle", 0, 10)
  7590. .onFinishChange(function () {}),
  7591. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function () {}),
  7592. g
  7593. .add(h.warp, "minBrakeAngle", 0, 5)
  7594. .step(0.01)
  7595. .onFinishChange(function () {}),
  7596. g
  7597. .add(h.warp, "maxBrakeAngle", 0, 5)
  7598. .step(0.01)
  7599. .onFinishChange(function () {}),
  7600. g.add(h.path, "mapGuides").onFinishChange(function () {}),
  7601. g
  7602. .add(h.warp, "teleportTime", 0, 5e3)
  7603. .step(10)
  7604. .onFinishChange(function () {}),
  7605. g
  7606. .add(h.warp, "outsideTime", 0, 5e3)
  7607. .step(10)
  7608. .onFinishChange(function () {}),
  7609. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function () {
  7610. h.path.typ = c[h.path.typ];
  7611. }),
  7612. g
  7613. .add(h.warp, "loop")
  7614. .onChange(function () {})
  7615. .onFinishChange(function () {
  7616. t.endlessLoop = h.warp.loop;
  7617. }),
  7618. g
  7619. .add(h.warp, "walkSlideShowThreshhold", 1, 1e4)
  7620. .step(1)
  7621. .onFinishChange(function () {}),
  7622. g
  7623. .add(h.warp, "walkExtraPanosDistance", 0, 3)
  7624. .step(0.1)
  7625. .onFinishChange(function () {}),
  7626. g
  7627. .add(h.transition, "fastForwardFactor", 1, 10)
  7628. .step(1)
  7629. .onFinishChange(function () {});
  7630. var m = f.addFolder("Long Warp Only");
  7631. m
  7632. .add(h.warp, "minWarpTime", 0, 5e3)
  7633. .step(10)
  7634. .onFinishChange(function () {
  7635. (h.warp.flySpeed = 0),
  7636. m.__controllers.forEach(function (e) {
  7637. e.updateDisplay();
  7638. });
  7639. }),
  7640. m
  7641. .add(h.warp, "timePerMeter", 0, 5e3)
  7642. .step(10)
  7643. .onFinishChange(function () {}),
  7644. m
  7645. .add(h.warp, "lookAheadMax", 0.01, 1)
  7646. .step(0.01)
  7647. .onFinishChange(function () {}),
  7648. m
  7649. .add(h.warp, "lookAheadDist", 0.01, 4)
  7650. .step(0.01)
  7651. .onFinishChange(function () {}),
  7652. m
  7653. .add(h.warp, "maxTurnPerSec", 0, 720)
  7654. .step(1)
  7655. .onFinishChange(function () {}),
  7656. m
  7657. .add(h.warp, "maxAimPerSec", 0, 720)
  7658. .step(1)
  7659. .onFinishChange(function () {}),
  7660. m
  7661. .add(h.warp, "turnFriction", 0, 1)
  7662. .step(0.01)
  7663. .onFinishChange(function () {}),
  7664. m
  7665. .add(h.warp, "walkDelay", 0, 2e3)
  7666. .step(10)
  7667. .onFinishChange(function () {}),
  7668. m
  7669. .add(h.transition, "flytimeMaxDistanceThreshold", 0, 25)
  7670. .step(10)
  7671. .onFinishChange(function () {}),
  7672. m
  7673. .add(h.warp, "walkMaxDist", 0, 100)
  7674. .step(1)
  7675. .onFinishChange(function () {});
  7676. var v = n.addFolder("Warp Esoterica");
  7677. v
  7678. .add(h.warp, "nearPanoDist", 0.01, 12)
  7679. .step(0)
  7680. .onFinishChange(function () {}),
  7681. v.add(h.warp, "blur", 0.01, 1).onFinishChange(function () {}),
  7682. v
  7683. .add(h.warp, "flySpeed", 0, 10)
  7684. .step(0.01)
  7685. .onFinishChange(function () {
  7686. (h.warp.minWarpTime = 0),
  7687. v.__controllers.forEach(function (e) {
  7688. e.updateDisplay();
  7689. });
  7690. }),
  7691. v.add(h.warp, "showBunny").onFinishChange(function () {}),
  7692. v
  7693. .add(h.warp, "fastTime", 0, 2500)
  7694. .step(10)
  7695. .onFinishChange(function () {}),
  7696. v.add(h.warp, "movementEasing", Object.keys(a));
  7697. var A = n.addFolder("Misc");
  7698. A.add(h, "dollhouseFOV", 10, 180).onChange(function () {
  7699. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV;
  7700. }),
  7701. A.add(h, "insideFOV", 10, 180).onChange(function () {
  7702. i.cameras[s.PANORAMA].fov = h.insideFOV;
  7703. }),
  7704. A.add(h, "insideLookSpeed", 0.01, 0.3)
  7705. .step(0.01)
  7706. .onChange(function () {}),
  7707. A.add(h, "rotationAccelerationInside", 0.1, 10)
  7708. .step(0.1)
  7709. .onChange(function () {}),
  7710. A.add(h, "rotationAccelerationOutside", 0.1, 10)
  7711. .step(0.1)
  7712. .onChange(function () {});
  7713. var y = n.addFolder("Navigation");
  7714. y.add(h.navigation, "panoScores").onFinishChange(function () {
  7715. h.navigation.panoScores ||
  7716. e.panos.forEach(function (e) {
  7717. e.floor.remove(e.text3d), (e.text3d = null);
  7718. });
  7719. }),
  7720. y.add(h.navigation, "mouseDirection"),
  7721. y.add(h.navigation, "filterStrictness", 0, 1),
  7722. y.add(h.navigation, "angleFactor", -60, 0),
  7723. y.add(h.navigation, "directionFactor", 1, 20),
  7724. y.add(h.navigation, "distanceFactor", -5, 5),
  7725. y.add(h.navigation, "optionalityFactor", 0.1, 10);
  7726. var C = n.addFolder("tags"),
  7727. I = C.addFolder("Tag Creation");
  7728. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  7729. I.add(h.tags.pole, "height", 0, 2.5).step(0.01).name("poleHeight"),
  7730. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  7731. I.add(h.tags.pole, "opacity", 0.1, 1).step(0.1).name("poleOpacity");
  7732. var E = C.addFolder("Visibility");
  7733. E.add(h.tags.visibility, "anyDistance"),
  7734. E.add(h.tags.visibility, "visibleDistance", 0.1, 30).step(0.1),
  7735. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(0.01),
  7736. E.add(h.tags.visibility, "hideViaFloor"),
  7737. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  7738. E.add(h.tags.visibility, "hideOffScreenObject").name(
  7739. "hideEdgeObject"
  7740. );
  7741. var b = C.addFolder("Disc Parameters");
  7742. b.add(h.tags.disc.scale, "nearBound", 0.1, 10).step(0.1),
  7743. b.add(h.tags.disc.scale, "farBound", 0.1, 20).step(0.1).listen(),
  7744. b.add(h.tags.disc.scale, "linkFarBound").onChange(function (e) {
  7745. e &&
  7746. (h.tags.disc.scale.farBound =
  7747. h.tags.visibility.visibleDistance *
  7748. (1 - h.tags.disc.scale.linkPercent / 100));
  7749. }),
  7750. b
  7751. .add(h.tags.disc.scale, "linkPercent", 0, 100)
  7752. .step(1)
  7753. .onChange(function (e) {
  7754. h.tags.disc.scale.linkFarBound &&
  7755. (h.tags.disc.scale.farBound =
  7756. h.tags.visibility.visibleDistance * (1 - e / 100));
  7757. }),
  7758. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  7759. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  7760. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  7761. var w = C.addFolder("Navigate");
  7762. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  7763. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  7764. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  7765. w
  7766. .add(h.tags.navigate, "aimAt", [
  7767. "disc",
  7768. "object",
  7769. "pole",
  7770. "nothing",
  7771. ])
  7772. .name("aim at"),
  7773. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  7774. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(0.1);
  7775. var _ = n.addFolder("Debug");
  7776. _.add(h, "wireframe").onFinishChange(function () {
  7777. e.chunks.forEach(function (t) {
  7778. t.material &&
  7779. (t.wireframeTwin ||
  7780. ((t.wireframeTwin = new o.WireframeHelper(t)),
  7781. (t.wireframeTwin.material.depthWrite = !1),
  7782. (t.wireframeTwin.material.depthTest = !1),
  7783. (t.wireframeTwin.material.opacity = 0.5),
  7784. (t.wireframeTwin.material.transparent = !0)),
  7785. h.wireframe
  7786. ? e.add(t.wireframeTwin)
  7787. : e.remove(t.wireframeTwin));
  7788. });
  7789. }),
  7790. _.add(h, "skyboxWireframe").onFinishChange(function () {
  7791. h.skyboxWireframe
  7792. ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)),
  7793. e.add(e.skybox.wireframe))
  7794. : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null));
  7795. }),
  7796. _.add(h, "showSweeps").onFinishChange(function () {
  7797. e.setSweepVisibility(h.showSweeps);
  7798. }),
  7799. _.add(h, "showMesh").onFinishChange(function () {
  7800. e.chunks.forEach(function (e) {
  7801. e.visible = h.showMesh;
  7802. });
  7803. }),
  7804. _.add(h, "showFloors").onFinishChange(function () {
  7805. e.floors.forEach(function (e) {
  7806. e.collider.children.forEach(function (e) {
  7807. e.material.visible = h.showFloors;
  7808. });
  7809. });
  7810. }),
  7811. _.add(h, "showSkyboxes").onFinishChange(function () {
  7812. e.panos.forEach(function (e) {
  7813. e.skyboxMesh.visible = h.showSkyboxes;
  7814. });
  7815. }),
  7816. _.add(h, "showNeighbors").onChange(function () {}),
  7817. _.add(e, "alpha", 0, 1);
  7818. }
  7819. var r = e("../lib/dat.gui"),
  7820. o = e("three"),
  7821. a = e("../util/easing"),
  7822. s = e("../enum/Viewmode"),
  7823. l = e("../enum/Colors"),
  7824. c = e("../enum/WarpStyle"),
  7825. h = e("../settings");
  7826. e("../tag/tag");
  7827. (r.GUI.prototype.removeFolder = function (e) {
  7828. var t = this.__folders[e];
  7829. t &&
  7830. (t.close(),
  7831. this.__ul.removeChild(t.domElement.parentNode),
  7832. delete this.__folders[e],
  7833. this.onResize());
  7834. }),
  7835. (t.exports.toggle = n);
  7836. },
  7837. {
  7838. "../enum/Colors": 19,
  7839. "../enum/Viewmode": 51,
  7840. "../enum/WarpStyle": 52,
  7841. "../lib/dat.gui": 93,
  7842. "../tag/tag": 123,
  7843. "../settings": 166,
  7844. "../util/easing": 186,
  7845. three: 217,
  7846. },
  7847. ],
  7848. 64: [
  7849. function (e, t, i) {
  7850. (function (i) {
  7851. "use strict";
  7852. function n(e, t, i, n) {
  7853. $(".gui-error .error-problem-text").text(e),
  7854. $(".gui-error .error-solution-text").text(t),
  7855. $(".gui-error .error-explanation").text(i),
  7856. $(".gui-error .error-actions").html(n),
  7857. $(window).resize(),
  7858. $(".gui-error").fadeIn(),
  7859. $("#bottom-logo").fadeIn();
  7860. }
  7861. function r(e) {
  7862. var t = [
  7863. '<div class="browser-tiles">',
  7864. '<div class="tile">',
  7865. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  7866. '<img class="icon" src="static/images/icon_Google_Chrome_2011.png" ',
  7867. 'rel="tiletip" title="Chrome"></a>',
  7868. "</div>",
  7869. '<div class="tile">',
  7870. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  7871. '<img class="icon" src="static/images/icon_Mozilla_Firefox.png" ',
  7872. 'rel="tiletip" title="Firefox"></a>',
  7873. "</div>",
  7874. '<div class="tile">',
  7875. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  7876. '<img class="icon" src="static/images/icon_Internet_Explorer_10.png" ',
  7877. 'rel="tiletip" title="Internet Explorer"></a>',
  7878. "</div>",
  7879. '<div class="tile">',
  7880. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  7881. '<img class="icon" src="static/images/icon_MacOSX_Safari.png" ',
  7882. 'rel="tiletip" title="Safari"></a>',
  7883. "</div>",
  7884. "</div>",
  7885. ].join("");
  7886. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  7887. s.isMobile() ||
  7888. $("[rel=tiletip]").tooltip({
  7889. placement: "bottom",
  7890. delay: {
  7891. show: 50,
  7892. hide: 0,
  7893. },
  7894. trigger: "hover",
  7895. viewport: {
  7896. selector: "body",
  7897. padding: 10,
  7898. },
  7899. });
  7900. }
  7901. function o() {
  7902. var e = s.isMobile()
  7903. ? ""
  7904. : '<span class="link install-browser">' +
  7905. h.ERROR_GENERIC_ACTIONS_2 +
  7906. "</span>" +
  7907. h.ERROR_GENERIC_ACTIONS_3,
  7908. t = [h.ERROR_GENERIC_ACTIONS_1, e].join("");
  7909. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  7910. s.isMobile() ||
  7911. $(".install-browser").on("click touchstart", function (e) {
  7912. e.preventDefault(), e.stopPropagation(), r(" ");
  7913. });
  7914. }
  7915. function a(e) {
  7916. if (
  7917. ($("head title").text(c.pageTitle),
  7918. $(
  7919. "#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo"
  7920. ).hide(),
  7921. $("#gui-loading").fadeOut(250),
  7922. $("#quick-blackout").hide(),
  7923. l.track("showcase_error", {
  7924. error_key: e,
  7925. }),
  7926. h.locale || h.init(),
  7927. "webgl-unsupported" === e)
  7928. )
  7929. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  7930. else if ("webgl-ios" === e)
  7931. n(
  7932. h.ERROR_WEBGL_IOS_PROBLEM,
  7933. h.ERROR_WEBGL_IOS_SOLUTION,
  7934. "",
  7935. h.ERROR_WEBGL_IOS_ACTIONS_1 +
  7936. "<strong>" +
  7937. h.ERROR_WEBGL_IOS_ACTIONS_2 +
  7938. "</strong>."
  7939. );
  7940. else if ("webgl-safari" === e)
  7941. n(
  7942. h.ERROR_WEBGL_SAFARI_PROBLEM,
  7943. "",
  7944. "",
  7945. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  7946. "<strong>" +
  7947. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  7948. "</strong>. " +
  7949. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  7950. "<strong>" +
  7951. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  7952. "</strong>."
  7953. );
  7954. else if ("webgl-generic" === e) o();
  7955. else if ("missing-urls" === e)
  7956. n(
  7957. h.ERROR_MISSING_URLS_PROBLEM,
  7958. "",
  7959. h.ERROR_MISSING_URLS_EXPLANATION
  7960. );
  7961. else if ("loading-failed" === e)
  7962. n(
  7963. h.ERROR_LOADING_FAILED_PROBLEM,
  7964. "",
  7965. "",
  7966. h.ERROR_LOADING_FAILED_ACTIONS_1 +
  7967. '<a class="link" target="_blank" href=' +
  7968. p +
  7969. ">" +
  7970. h.ERROR_LOADING_FAILED_ACTIONS_2 +
  7971. "</a>."
  7972. );
  7973. else {
  7974. if ("loading-failed-maintenance" !== e)
  7975. return void d.error("Unhandled error: " + e);
  7976. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION);
  7977. }
  7978. }
  7979. var s = e("./../util/browser"),
  7980. l = e("./../analytics"),
  7981. c = e("./../settings"),
  7982. h = e("../localization/localize"),
  7983. u = e("./../util/logger"),
  7984. d = new u(i),
  7985. p = '"https://support.port.com/hc/articles/208220058"';
  7986. t.exports.error = a;
  7987. }).call(this, "/js/gui/error.js");
  7988. },
  7989. {
  7990. "../localization/localize": 108,
  7991. "./../analytics": 4,
  7992. "./../settings": 166,
  7993. "./../util/browser": 182,
  7994. "./../util/logger": 189,
  7995. },
  7996. ],
  7997. 65: [
  7998. function (e, t, i) {
  7999. (function (i) {
  8000. "use strict";
  8001. function n() {
  8002. (Ue = []),
  8003. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  8004. Ue.push(".hideTarget", ".pinTop.right");
  8005. }
  8006. function r() {
  8007. for (var e in je)
  8008. if (je.hasOwnProperty(e)) {
  8009. var t = je[e];
  8010. if (!t.visible)
  8011. for (var i = 0; i < t.elements.length; i++)
  8012. $(t.elements[i]).hide();
  8013. }
  8014. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  8015. je.tourControls.visible === !1 &&
  8016. $("#drawer").addClass("fullWidth"),
  8017. n();
  8018. }
  8019. function o(e, t) {
  8020. var i =
  8021. !K.isMobile() &&
  8022. Q.zoom.enabled &&
  8023. t.mode === _e.PANORAMA &&
  8024. !e.tourIsPlaying;
  8025. $("#gui-zoomin").toggle(i), $("#gui-zoomout").toggle(i);
  8026. }
  8027. function a() {
  8028. c(),
  8029. $(".pinBottom").toggleClass("open"),
  8030. $("#drawer").toggleClass("open"),
  8031. $(".footer").toggleClass("open"),
  8032. $("#drawer").hasClass("open")
  8033. ? ($("#pullTab .icon").attr(
  8034. "data-original-title",
  8035. Re.CLOSE_HIGHLIGHTS
  8036. ),
  8037. Ze("highlights"))
  8038. : ($("#pullTab .icon").attr(
  8039. "data-original-title",
  8040. Re.OPEN_HIGHLIGHTS
  8041. ),
  8042. ie.resetDrawer()),
  8043. setTimeout(
  8044. function () {
  8045. $("#pullTab").toggleClass("opened");
  8046. },
  8047. $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration
  8048. ),
  8049. $(".pinBottom").hasClass("open") &&
  8050. s($(".vr-popup")) &&
  8051. $(".vr-popup").is(":visible") &&
  8052. Ae.dismiss();
  8053. }
  8054. function s(e) {
  8055. var t;
  8056. "none" !== e.css("display")
  8057. ? (t = e.position().top + e.outerHeight())
  8058. : (e.attr("style", "visibility: hidden"),
  8059. (t = e.position().top + e.outerHeight()),
  8060. e.attr("style", "display: none"));
  8061. var i = $("#player").outerHeight(),
  8062. n = i - 130;
  8063. return n < t + 25;
  8064. }
  8065. function l(e) {
  8066. "touchstart" === e.type && e.preventDefault(), e.stopPropagation();
  8067. }
  8068. function c() {
  8069. W && (W.reload(), W.init());
  8070. }
  8071. function h(e) {
  8072. ne.show(e), r();
  8073. }
  8074. function u(e) {
  8075. ne.progress(e);
  8076. }
  8077. function d(e, t, i) {
  8078. var n = t.player;
  8079. $("#gui-thumb").fadeOut(2500),
  8080. ne.hide(function () {
  8081. Ge = !1;
  8082. }),
  8083. me.init(e, i),
  8084. de.finishSetup(Object.keys(e.tags).length),
  8085. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  8086. var s = function () {
  8087. i.dismissExaminedTag(), i.disableHovering();
  8088. };
  8089. Ae.on(ye.OPENED, s),
  8090. Ce.on(Me.OPENED, s),
  8091. he.on(ue.OPENED, s),
  8092. fe.on(ge.OPENED, s);
  8093. var l = i.enableHovering.bind(i);
  8094. if (
  8095. (Ae.on(ye.CLOSED, l),
  8096. Ce.on(Me.CLOSED, l),
  8097. he.on(ue.CLOSED, l),
  8098. fe.on(ge.CLOSED, l),
  8099. Q.labels.enabled && Object.keys(e.labels).length,
  8100. e.floors.length <= 1 || !je.floors.visible
  8101. ? (je.floors.visible = !1)
  8102. : (y(e, t), C(e.currentFloor, n.mode)),
  8103. getQueryVariable("m") === "372" &&
  8104. ((je.floors.visible = 1), y(e, t)),
  8105. r(),
  8106. o(t, t.player),
  8107. $("#gui").fadeIn(1500),
  8108. je.highlight.visible &&
  8109. (2 !== Q.startHighlights || e.has360Views) &&
  8110. setTimeout(function () {
  8111. a(),
  8112. ((!e.has360Views && 1 !== Q.startHighlights) ||
  8113. (e.has360Views && 0 === Q.startHighlights)) &&
  8114. setTimeout(a, 2e3);
  8115. }, 2e3),
  8116. !K.isMobile())
  8117. )
  8118. for (
  8119. var c = [
  8120. "a",
  8121. "#title-toggle",
  8122. ".next-button",
  8123. ".prev-button",
  8124. ".gui-floor",
  8125. ".meta-toggle",
  8126. ".thumbImg",
  8127. "logo-button",
  8128. ],
  8129. h = 0;
  8130. h < c.length;
  8131. h++
  8132. )
  8133. $(c[h]).addClass("hasHover");
  8134. O(e), de.setupToggling();
  8135. //xzw:
  8136. window.editHotPanel && editHotPanel();
  8137. //czj
  8138. navBorderRadius(e);
  8139. //czj 编辑界面
  8140. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  8141. window.EditTools && new EditTools(n.sceneRenderer);
  8142. }
  8143. function navBorderRadius(e) {
  8144. var pullTab = $("#pullTab"),
  8145. mobileRadius = {
  8146. bottom: {
  8147. "border-bottom-left-radius": "10px",
  8148. "border-bottom-right-radius": "10px",
  8149. },
  8150. top: {
  8151. "border-top-left-radius": "10px",
  8152. "border-top-right-radius": "10px",
  8153. },
  8154. },
  8155. topRadius = {
  8156. bottom: {
  8157. "border-top-right-radius": "10px",
  8158. "border-bottom-right-radius": "10px",
  8159. },
  8160. top: {
  8161. "border-bottom-left-radius": "10px",
  8162. "border-top-left-radius": "10px",
  8163. },
  8164. };
  8165. function BorderRadius(bottom, top) {
  8166. $("#gui-modes-map > div:visible:last").css(bottom);
  8167. if (pullTab.is(":visible")) {
  8168. $(".viewContainer > div:visible:first").css(top);
  8169. } else {
  8170. $("#gui-modes-map > div:visible:first").css(top);
  8171. }
  8172. }
  8173. if (
  8174. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)
  8175. ) {
  8176. BorderRadius(mobileRadius.bottom, mobileRadius.top);
  8177. } else {
  8178. BorderRadius(topRadius.bottom, topRadius.top);
  8179. }
  8180. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  8181. if (window.DATA.model.special || window.DATA.special) {
  8182. window.specialScene && specialScene.special().afterImplement();
  8183. }
  8184. }
  8185. function p(e) {
  8186. e || (e = 0),
  8187. (We = !1),
  8188. window.setTimeout(
  8189. function () {
  8190. We || ((ze = !0), $("#gui-spinner").stop(!0, !0).show());
  8191. }.bind(this),
  8192. e
  8193. );
  8194. }
  8195. function f() {
  8196. $("#gui-spinner").stop(!0, !0),
  8197. $("#gui-spinner").fadeOut(1e3),
  8198. (We = !0),
  8199. (ze = !1);
  8200. }
  8201. function g(e, t) {
  8202. var i = e.mode,
  8203. n = t || e.currentPano;
  8204. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  8205. $("#gui-modes-floorplan").toggleClass(
  8206. "active",
  8207. i === _e.FLOORPLAN
  8208. ),
  8209. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  8210. i === _e.PANORAMA
  8211. ? ($("#view-controllers").slideUp(500),
  8212. Q.show360Views.enabled && !n.isAligned()
  8213. ? ($(".gui-floor").addClass("hidden"),
  8214. $("#gui-modes-outside").addClass("desktop-only"))
  8215. : ($(".gui-floor").removeClass("hidden"),
  8216. $("#gui-modes-outside").removeClass("desktop-only")),
  8217. $("#gui-modes-outside").removeClass("hidden"))
  8218. : i !== _e.TRANSITIONING &&
  8219. (f(),
  8220. (Be = i),
  8221. $("#gui-modes-outside").addClass("hidden"),
  8222. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  8223. $("#view-controllers").is(":visible") ||
  8224. $("#view-controllers").slideDown(Q.guiAnimationSpeed));
  8225. }
  8226. function m(e, t) {
  8227. var i = t.player;
  8228. $("#gui-modes-inside").on("mousedown touchstart", function (e) {
  8229. l(e),
  8230. J.updateInteraction(Se.InteractionGui, "inside-button"),
  8231. J.track("USER", {
  8232. event_type: "showcase_gui",
  8233. gui_action: "click_inside_mode_button",
  8234. }),
  8235. t.changeMode(_e.PANORAMA);
  8236. }),
  8237. $("#gui-modes-outside")
  8238. .find("a")
  8239. .on("click", function (e) {
  8240. l(e),
  8241. J.track("showcase_gui", {
  8242. gui_action: "click_outside_mode_button",
  8243. }),
  8244. t.changeMode(Be);
  8245. }),
  8246. $("#gui-modes-floorplan").on("click", function (e) {
  8247. l(e),
  8248. i.mode !== _e.FLOORPLAN &&
  8249. (J.track("showcase_gui", {
  8250. gui_action: "click_floorplan_mode_button",
  8251. }),
  8252. t.changeMode(_e.FLOORPLAN));
  8253. }),
  8254. $("#gui-modes-dollhouse").on("click", function (e) {
  8255. l(e),
  8256. i.mode !== _e.DOLLHOUSE &&
  8257. (J.track("showcase_gui", {
  8258. gui_action: "click_dollhouse_mode_button",
  8259. }),
  8260. t.changeMode(_e.DOLLHOUSE));
  8261. });
  8262. }
  8263. function v(e, t) {
  8264. function i() {
  8265. document.getElementById("vr").classList.remove("hidden"),
  8266. Q.vr.allowWebVR
  8267. ? K.getVRDisplay().then(
  8268. function (e) {
  8269. K.supportsFullscreen()
  8270. ? n(e)
  8271. : (De.warn(
  8272. "Unable to use WebVR when full screen is not supported"
  8273. ),
  8274. $(".improper-embed").toggleClass("hidden", !1),
  8275. r());
  8276. },
  8277. function (e) {
  8278. r();
  8279. }
  8280. )
  8281. : r();
  8282. }
  8283. function n(i) {
  8284. De.info(
  8285. i.displayName +
  8286. " detected, VR button activates WebVR experience"
  8287. ),
  8288. Ie.init(e.data, t, i, q),
  8289. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  8290. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe));
  8291. }
  8292. function r() {
  8293. De.info(
  8294. "WebVR support not found, VR button activates native app VR modal"
  8295. ),
  8296. Ae.init(e.data, q),
  8297. Ae.on(
  8298. ye.OPENED,
  8299. (function () {
  8300. var e = document.getElementById("vr-modal");
  8301. return function () {
  8302. Ze("vr"), le.open(e);
  8303. };
  8304. })()
  8305. ),
  8306. Ae.on(ye.CLOSED, le.reset);
  8307. }
  8308. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)) {
  8309. /*********************** 方奕卓 VR功能事件监听 ********************/
  8310. K.isMobile() && $("#vr").css("display", ""); // 显示vr功能按钮
  8311. switch (Q.vr.option) {
  8312. case Pe.CONTEXTUAL:
  8313. i();
  8314. break;
  8315. case Pe.ANDROID:
  8316. K.detectAndroid() && i();
  8317. break;
  8318. case Pe.NONE:
  8319. }
  8320. }
  8321. }
  8322. function A(e, t) {
  8323. $("#play").on("mousedown touchstart", function (e) {
  8324. l(e);
  8325. Ze("tour");
  8326. ve.play();
  8327. J.trackAlways("showcase_gui", {
  8328. gui_action: "play_highlights",
  8329. });
  8330. console.log('开始了')
  8331. // 开始导航,关闭导航栏,鼠标移动时,开启导航栏
  8332. // const pinBottomDom = document.querySelector('.duringTour')
  8333. // console.log(pinBottomDom)
  8334. $('.pinBottom-container').hide()
  8335. // PC端
  8336. document.body.addEventListener('mousemove', () => {
  8337. $('.pinBottom-container').show()
  8338. document.body.removeEventListener('mousemove',() => {
  8339. $('.pinBottom-container').show()
  8340. })
  8341. })
  8342. // 移动端
  8343. document.body.addEventListener('touchmove', () => {
  8344. $('.pinBottom-container').show()
  8345. document.body.removeEventListener('touchmove',() => {
  8346. $('.pinBottom-container').show()
  8347. })
  8348. })
  8349. document.body.addEventListener('touchstart', () => {
  8350. $('.pinBottom-container').show()
  8351. document.body.removeEventListener('touchstart',() => {
  8352. $('.pinBottom-container').show()
  8353. })
  8354. })
  8355. $('#leftInfo').hide()
  8356. }),
  8357. (window.startAndPlay = function (e) {
  8358. // l(e);
  8359. Ze("tour");
  8360. ve.play();
  8361. J.trackAlways("showcase_gui", {
  8362. gui_action: "play_highlights",
  8363. });
  8364. });
  8365. $("#pause").on("mousedown touchstart", function (e) {
  8366. l(e),
  8367. ve.pause(),
  8368. J.trackAlways("showcase_gui", {
  8369. gui_action: "pause_highlights",
  8370. });
  8371. console.log('暂停了')
  8372. window.innerWidth > 768 ? $('#leftInfo').show() :''
  8373. }),
  8374. $("#gui-zoomin")
  8375. .find("a")
  8376. .on("click", function (e) {
  8377. l(e), t.player.zoomInIncrementally();
  8378. }),
  8379. $("#gui-zoomout")
  8380. .find("a")
  8381. .on("click", function (e) {
  8382. l(e), t.player.zoomOutIncrementally();
  8383. });
  8384. }
  8385. function y(e, t) {
  8386. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  8387. if (getQueryVariable("m") === "372") continue;
  8388. var r = $(
  8389. '<div class="floorChoice" data-index="' + n + '"></div>'
  8390. ).text(e.floors.get(n).name);
  8391. $(".gui-floor").find(".container").prepend(r);
  8392. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  8393. }
  8394. i
  8395. .find(".container")
  8396. .prepend(
  8397. '<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' +
  8398. Re.FLOOR_ALL +
  8399. "</div>"
  8400. ),
  8401. i.on("click", function (e) {
  8402. l(e), Ze("floor"), i.toggleClass("open");
  8403. }),
  8404. $(".floorChoice").on("click", function (e) {
  8405. l(e);
  8406. var n = $(this).data("index");
  8407. "all" !== n
  8408. ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  8409. t.player.gotoFloor(n),
  8410. J.track("showcase_gui", {
  8411. gui_action: "click_floor_select_button",
  8412. interaction_source: "gui",
  8413. }))
  8414. : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  8415. Ze("move"),
  8416. t.allFloors(),
  8417. J.track("showcase_gui", {
  8418. gui_action: "click_toggle_all_floors_button",
  8419. interaction_source: "gui",
  8420. })),
  8421. i.removeClass("open");
  8422. });
  8423. }
  8424. function C(e, t) {
  8425. e &&
  8426. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  8427. ? ($(".allFloorBtn").show(),
  8428. $(".gui-floor-icon").hide(),
  8429. $(".gui-floor-title").show())
  8430. : ($(".allFloorBtn").hide(),
  8431. $(".gui-floor-icon").show(),
  8432. $(".gui-floor-title").hide()),
  8433. e.model.allFloorsVisible
  8434. ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  8435. $(".gui-floor-number").text(Re.FLOOR_ALL),
  8436. $(".floorChoice").removeClass("active"),
  8437. $('.floorChoice[data-index="all"]').addClass("active"))
  8438. : ($(".gui-floor-title").text(e.name),
  8439. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  8440. $(".floorChoice").removeClass("active"),
  8441. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass(
  8442. "active"
  8443. )));
  8444. }
  8445. function I(e) {
  8446. return e.describe().inTransition;
  8447. }
  8448. function b(e, t, i) {
  8449. Fe = e.heroLocations.length;
  8450. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  8451. r = 100 / Fe + "%",
  8452. o = $("#thumb-container"),
  8453. a = $("#progressBar");
  8454. $("#status").find(".totalSteps").text(Fe);
  8455. for (var s = 0; s < Fe; s++) {
  8456. var c = e.heroLocations[s],
  8457. h = $(n);
  8458. var thumbUrl;
  8459. if (c.heroLocations) {
  8460. //有子项,选第一张截图
  8461. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl); //.replace('https://','').replace('http://','')
  8462. } else {
  8463. thumbUrl = manage.dealURL(c.thumbUrl); //.replace('https://','').replace('http://','')
  8464. }
  8465. h.attr("data-index", s);
  8466. je.highlight.visible && h.find("img").attr("src", thumbUrl);
  8467. if (c.name) {
  8468. var u = $('<div class="overlay"></div>').text(c.name);
  8469. h.prepend(u);
  8470. }
  8471. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  8472. var d = e.panos.get(c.panoId),
  8473. p = d && !d.isAligned(),
  8474. f = p
  8475. ? '<div><img class="mark360View" src="static/images/mark-360-white-v2.png"></div>'
  8476. : '<div><img class="markInsideView" src="static/images/mark-inside-white.png"></div>';
  8477. h.prepend(f);
  8478. }
  8479. o.append(h),
  8480. a.append(
  8481. '<div class="step" data-idx="' +
  8482. s +
  8483. '" style="width:' +
  8484. r +
  8485. '"></div>'
  8486. );
  8487. }
  8488. (j = 144 * Fe),
  8489. (Y = 111 * Fe),
  8490. $(".thumbImg").on("mouseover", function () {
  8491. I(t) || i.showPathToHeroLocation([$(this).data("index"), 0]); //改
  8492. }),
  8493. $(".thumbImg").on("mouseout", function () {
  8494. t.clearPath();
  8495. }),
  8496. $(".thumbImg").on("click", function (e) {
  8497. l(e);
  8498. var i = $(this);
  8499. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  8500. J.trackAlways("showcase_gui", {
  8501. gui_action: "click_highlight",
  8502. }),
  8503. t.goToHighlight([i.data("index"), 0]); //改
  8504. }),
  8505. $(".previous")
  8506. .find("a")
  8507. .on("click", function (e) {
  8508. l(e),
  8509. J.trackAlways("showcase_gui", {
  8510. gui_action: "prev_highlight",
  8511. }),
  8512. t.prevHighlight();
  8513. }),
  8514. $(".next")
  8515. .find("a")
  8516. .on("click", function (e) {
  8517. l(e),
  8518. J.trackAlways("showcase_gui", {
  8519. gui_action: "next_highlight",
  8520. }),
  8521. t.nextHighlight();
  8522. }),
  8523. $("#drawer").on("mouseleave", function (e) {
  8524. l(e);
  8525. var t;
  8526. try {
  8527. t = new MouseEvent("mouseup", {
  8528. clientX: e.clientX,
  8529. clientY: e.clientY,
  8530. screenX: e.screenX,
  8531. screenY: e.screenY,
  8532. });
  8533. } catch (i) {
  8534. (t = document.createEvent("MouseEvents")),
  8535. t.initMouseEvent(
  8536. "mouseup",
  8537. e.bubbles,
  8538. e.cancelable,
  8539. e.view,
  8540. e.detail,
  8541. e.screenX,
  8542. e.screenY,
  8543. e.clientX,
  8544. e.clientY,
  8545. e.ctrlKey,
  8546. e.altKey,
  8547. e.shiftKey,
  8548. e.metaKey,
  8549. e.button,
  8550. e.relatedTarget
  8551. );
  8552. }
  8553. document.dispatchEvent(t);
  8554. }),
  8555. (W = new Sly($("#scrollFrame"), {
  8556. horizontal: !0,
  8557. itemNav: "centered",
  8558. smart: !0,
  8559. scrollTrap: !0,
  8560. scrollBy: 1,
  8561. mouseDragging: !0,
  8562. touchDragging: !0,
  8563. speed: 300,
  8564. dragHandle: !0,
  8565. dynamicHandle: !0,
  8566. clickBar: !0,
  8567. scrollBar: $("#scroller"),
  8568. activateOn: null,
  8569. }).init()),
  8570. W.on("active", function (e, t) {
  8571. (Ve = t),
  8572. Ze("tour"),
  8573. $(".step").removeClass("active"),
  8574. $("#status")
  8575. .find(".curIdx")
  8576. .text(t + 1);
  8577. for (var i = 0; i <= t; i++)
  8578. $("#progressBar")
  8579. .find("[data-idx='" + i + "']")
  8580. .addClass("active");
  8581. }),
  8582. w();
  8583. //add :
  8584. let scrollFrame = $(W.frame);
  8585. scrollFrame.on("wheel.sly", function () {
  8586. lastMoveScrollTime = Date.now();
  8587. });
  8588. let dragstart;
  8589. /* scrollFrame.on("pointerdown", function() {
  8590. dragstart = true
  8591. })
  8592. scrollFrame.on("pointerup", function() {
  8593. dragstart = false
  8594. }) */
  8595. scrollFrame.on("pointermove", function () {
  8596. //if(dragstart){
  8597. lastMoveScrollTime = Date.now();
  8598. //}
  8599. });
  8600. }
  8601. function w() {
  8602. var e = $("#player").width() - 20,
  8603. t = $("#scroller"),
  8604. i = $("#drawer"),
  8605. n = $(".pinBottom");
  8606. if ($("#player").width() < 488 || $("#player").height() < 488)
  8607. t.addClass("hidden"),
  8608. i.addClass("noScroll"),
  8609. n.addClass("noScroll");
  8610. else {
  8611. var r = j > e,
  8612. o = !i.hasClass("noScroll"),
  8613. a = r !== o;
  8614. a &&
  8615. (t.toggleClass("hidden"),
  8616. i.toggleClass("noScroll"),
  8617. n.toggleClass("noScroll"));
  8618. }
  8619. }
  8620. function _(e) {
  8621. je.tourControls.visible = true; //e.tour_buttons && K.valueFromHash("gt", 1),
  8622. (je.coBrand.visible =
  8623. e.presented_by &&
  8624. 1 !== Q.specialEdition &&
  8625. Q.brand &&
  8626. !K.valueFromHash("mls", !1)),
  8627. (je.highlight.visible =
  8628. /* e.highlight_reel && */ 1 !== Q.specialEdition &&
  8629. Q.showHighlights);
  8630. }
  8631. function T(e) {
  8632. function t(t, i) {
  8633. return !!e.player_options[t] && e[i || t];
  8634. }
  8635. $(".model-title").text(e.name);
  8636. var i = Q.pageTitle;
  8637. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  8638. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  8639. (document.title = i),
  8640. K.isMobile()
  8641. ? $("#gui-fullscreen").css("display", "none")
  8642. : ($("[rel=tooltip]").tooltip({
  8643. delay: {
  8644. show: 50,
  8645. hide: 0,
  8646. },
  8647. trigger: "hover",
  8648. html: !1,
  8649. viewport: {
  8650. selector: "body",
  8651. padding: 10,
  8652. },
  8653. }),
  8654. K.inIframe() &&
  8655. document
  8656. .getElementsByClassName("pinBottom-container")[0]
  8657. .classList.add("embed")),
  8658. // t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  8659. de.populate({
  8660. name: t("model_name", "name"),
  8661. coBrand: t("presented_by"),
  8662. description: t("model_summary", "summary") || "暂无内容",
  8663. contactName: t("contact_name"),
  8664. address: t("address"),
  8665. phone: t("contact_phone"),
  8666. formattedPhone: e.formatted_contact_phone,
  8667. email: t("contact_email"),
  8668. url: t("external_url"),
  8669. socialSharing: e.enable_social_sharing && e.is_public,
  8670. });
  8671. }
  8672. function x(e, t, i, n, r, o) {
  8673. function a() {
  8674. o.setLoadingStartTime(),
  8675. H(),
  8676. r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l);
  8677. }
  8678. var s = $.Deferred(),
  8679. l = s.resolve.bind(s);
  8680. return (
  8681. (Ge = !0),
  8682. O(e),
  8683. e.data.player_options && _(e.data.player_options),
  8684. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  8685. Re.localizeGUI(),
  8686. T(e.data),
  8687. r || $(".quick").addClass("hidden"),
  8688. //e.data.image && !r && E(e.data.image),
  8689. n
  8690. ? (J.impression(), a())
  8691. : (o.setWaitingStartTime(), oe.show(r, a)),
  8692. s
  8693. );
  8694. }
  8695. function S(e, t, i, n, r, a, s) {
  8696. (q = s),
  8697. e.outsideAllowed() ||
  8698. $("#gui-modes-outside").addClass("invisible"),
  8699. e.supportedModes[_e.PANORAMA] ||
  8700. $("#gui-modes-inside").addClass("invisible"),
  8701. ae.init(),
  8702. re.init(e, a),
  8703. Oe.init(e, t, n),
  8704. $(".icon").on("mouseover", function () {
  8705. t.player && t.player.reticule.hide();
  8706. }),
  8707. m(e, t),
  8708. A(e, t),
  8709. e.data.enable_social_sharing &&
  8710. e.data.is_public &&
  8711. Q.share.enabled &&
  8712. (Ce.init(window.DATA.name /* e.data.name */),
  8713. Ce.on(
  8714. Me.OPENED,
  8715. (function () {
  8716. var e = document.getElementById("share-modal");
  8717. return function () {
  8718. Ze("share"), le.open(e);
  8719. };
  8720. })()
  8721. ),
  8722. Ce.on(Me.CLOSED, le.reset)),
  8723. e.heroLocations.length > 0
  8724. ? b(e, t, i)
  8725. : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  8726. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  8727. z(),
  8728. g(i),
  8729. v(e, r),
  8730. e.on("floor.changed", C),
  8731. e.on("waiting", R.bind(this, e)),
  8732. e.on("waiting-done", P.bind(this, e)),
  8733. i.on(xe.ModeChanged, function (e, n) {
  8734. g(i),
  8735. o(t, i),
  8736. n === _e.PANORAMA &&
  8737. i.currentPano &&
  8738. !i.currentPano.isAligned() &&
  8739. (n = _e.OUTDOOR),
  8740. he.updateMode(n);
  8741. }),
  8742. n.on(Se.Move, Ze.bind(this, "move")),
  8743. i.on(xe.Ready, function () {
  8744. ie.init(n, i, i.tagManager, t),
  8745. i.on(xe.ModeChanged, function (e, t) {
  8746. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss();
  8747. });
  8748. }),
  8749. i.on(xe.PanoChosen, function (e, t) {
  8750. g(i, t),
  8751. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA);
  8752. }),
  8753. le.on(ce.CLOSE, function (e) {
  8754. switch (e) {
  8755. case "vr-modal":
  8756. Ae.dismiss();
  8757. break;
  8758. case "share-modal":
  8759. Ce.hide();
  8760. break;
  8761. case "terms-modal":
  8762. fe.hide();
  8763. }
  8764. });
  8765. var l = $("#play").eq(0),
  8766. c = $("#pause").eq(0),
  8767. h = $(".pinBottom").toArray(),
  8768. u = $("#drawer").eq(0),
  8769. d = $("#playHead").eq(0),
  8770. p = $("#progressBar").eq(0),
  8771. f = $("#thumb-container").eq(0),
  8772. y = f.children(),
  8773. I = p.children();
  8774. t.on("update.controls", function () {
  8775. //导览控制
  8776. var n = t.describe();
  8777. n.tourIsPlaying || i.isWarping()
  8778. ? (je.tourControls.visible && (l.hide(), c.show()),
  8779. n.tourInProgress &&
  8780. (h.forEach(function (e) {
  8781. e.classList.add("playing");
  8782. }),
  8783. u.addClass("playing"),
  8784. d.addClass("playing")))
  8785. : (je.tourControls.visible && (l.show(), c.hide()),
  8786. n.tourInProgress ||
  8787. (ve.stopTour(),
  8788. h.forEach(function (e) {
  8789. e.classList.remove("playing");
  8790. }),
  8791. u.removeClass("playing"),
  8792. d.removeClass("playing")));
  8793. var r, a, s;
  8794. if (null !== n.currentItem) {
  8795. var p, f;
  8796. $("#status")
  8797. .find(".curIdx")
  8798. .text(n.currentItem[0] + 1),
  8799. n.onTheBus
  8800. ? ((p = "active"), (f = "recent"))
  8801. : ((f = "active"), (p = "recent"));
  8802. var g =
  8803. null === n.destinationItem ||
  8804. n.currentItem[0] === n.destinationItem[0];
  8805. /* for (r = 0; r < e.heroLocations.length; r += 1)
  8806. s = y.eq(r),
  8807. a = I.eq(r),
  8808. s.removeClass(f),
  8809. a.removeClass(f),
  8810. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  8811. a.addClass(p),
  8812. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  8813. a.addClass(p)) : (s.removeClass(p),
  8814. a.removeClass(p)) */
  8815. for (r = 0; r < e.heroLocations.length; r += 1) {
  8816. (s = y.eq(r)),
  8817. (a = I.eq(r)),
  8818. s.removeClass(f),
  8819. a.removeClass(f);
  8820. if (n.onTheBus && r === n.destinationItem[0]) {
  8821. s.addClass(p);
  8822. a.addClass(p);
  8823. if (Date.now() - lastMoveScrollTime > 2000) {
  8824. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  8825. W.activate(r); // scrollbar slide to this
  8826. }
  8827. } else {
  8828. n.onTheBus && g && r === n.currentItem[0]
  8829. ? (s.addClass(p), a.addClass(p))
  8830. : (s.removeClass(p), a.removeClass(p));
  8831. }
  8832. }
  8833. } else for (r = 0; r < e.heroLocations.length; r += 1) (s = y.eq(r)), (a = I.eq(r)), s.removeClass("active recent"), a.removeClass("active recent");
  8834. o(t, i);
  8835. }),
  8836. document.addEventListener(
  8837. "keydown",
  8838. function (n) {
  8839. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  8840. case we.ZERO:
  8841. Q.debug && e.toggleAlpha();
  8842. break;
  8843. case we.NINE:
  8844. Q.debug && se.toggle();
  8845. break;
  8846. case we.ONE:
  8847. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  8848. break;
  8849. case we.TWO:
  8850. e.outsideAllowed() &&
  8851. !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) &&
  8852. t.changeMode(_e.DOLLHOUSE);
  8853. break;
  8854. case we.THREE:
  8855. e.outsideAllowed() &&
  8856. !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) &&
  8857. t.changeMode(_e.FLOORPLAN);
  8858. break;
  8859. case we.FOUR:
  8860. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  8861. break;
  8862. case we.SPACE:
  8863. je.tourControls.visible &&
  8864. ($("#playHead").hasClass("playing") || Ze("tour"));
  8865. break;
  8866. case we.RETURN:
  8867. Q.debug && e.toggleExplodeUp();
  8868. break;
  8869. case we.P:
  8870. k();
  8871. break;
  8872. case we.U:
  8873. B();
  8874. break;
  8875. case we.X:
  8876. Q.debug && e.toggleExplode();
  8877. break;
  8878. case we.PLUSEQUALS:
  8879. t.player.activatePersistentZooming(!0), ie.hideUi();
  8880. break;
  8881. case we.DASHUNDERSCORE:
  8882. t.player.activatePersistentZooming(!1), ie.hideUi();
  8883. break;
  8884. case we.SEVEN:
  8885. De.info(
  8886. "Zoom level: " +
  8887. t.player.zoomLevel +
  8888. ", FOV: " +
  8889. t.player.zoomFov
  8890. );
  8891. break;
  8892. case we.EIGHT:
  8893. t.player.decreaseZoomSpeed();
  8894. break;
  8895. case we.NINE:
  8896. t.player.increaseZoomSpeed();
  8897. }
  8898. return i && i.reticule.hide(), !0;
  8899. }.bind(this)
  8900. ),
  8901. document.addEventListener(
  8902. "keyup",
  8903. function (e) {
  8904. switch (e.which) {
  8905. case we.PLUSEQUALS:
  8906. t.player.deactivatePersistentZooming();
  8907. break;
  8908. case we.DASHUNDERSCORE:
  8909. t.player.deactivatePersistentZooming();
  8910. }
  8911. }.bind(this)
  8912. ),
  8913. F(e),
  8914. L(e, t.player),
  8915. M(i),
  8916. te.setAutoPlay(e.heroCount()),
  8917. he.init(i, a.mode),
  8918. he.on(ue.OPENED, Ze.bind(this, "help")),
  8919. fe.init(),
  8920. fe.on(
  8921. ge.OPENED,
  8922. (function () {
  8923. var e = document.getElementById("terms-modal");
  8924. return function () {
  8925. Ze("terms"), le.open(e);
  8926. };
  8927. })()
  8928. ),
  8929. fe.on(ge.CLOSED, le.reset),
  8930. Q.quickstart.enabled ||
  8931. re
  8932. .delayLanding(a.mode)
  8933. .then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  8934. (Q.quickstart.enabled || i.model.outsideAllowed()) &&
  8935. ie.init(n, i, i.tagManager, t),
  8936. Q.profiling.enabled && se.show(),
  8937. ve.init(t);
  8938. }
  8939. function M(e) {
  8940. var t = function (e, t) {
  8941. $(e)
  8942. .find("a")
  8943. .each(function (e, i) {
  8944. t
  8945. ? $(i)
  8946. .removeClass("buttonZoomDisabled")
  8947. .addClass("buttonZoomEnabled")
  8948. : $(i)
  8949. .addClass("buttonZoomDisabled")
  8950. .removeClass("buttonZoomEnabled"),
  8951. (i.style.pointerEvents = t ? "auto" : "none");
  8952. });
  8953. },
  8954. i = function () {
  8955. e.zoomLevel >= Q.zoom.max
  8956. ? t("#gui-zoomin", !1)
  8957. : t("#gui-zoomin", !0),
  8958. e.zoomLevel <= Q.zoom.min
  8959. ? t("#gui-zoomout", !1)
  8960. : t("#gui-zoomout", !0);
  8961. };
  8962. e.on(Ne.ZoomMax, function () {
  8963. t("#gui-zoomin", !1), t("#gui-zoomout", !0);
  8964. }),
  8965. e.on(Ne.ZoomMin, function () {
  8966. t("#gui-zoomin", !0), t("#gui-zoomout", !1);
  8967. }),
  8968. e.on(Ne.ZoomIn, function () {
  8969. t("#gui-zoomout", !0);
  8970. }),
  8971. e.on(Ne.ZoomOut, function () {
  8972. t("#gui-zoomin", !0);
  8973. }),
  8974. i();
  8975. }
  8976. function R(e) {
  8977. O(e);
  8978. }
  8979. function P(e) {
  8980. O(e);
  8981. }
  8982. function O(e) {
  8983. var t = e.waitQueue.length;
  8984. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay);
  8985. }
  8986. function L(e, t) {
  8987. He = {
  8988. gui: null,
  8989. visible: !1,
  8990. model: e,
  8991. player: t,
  8992. };
  8993. }
  8994. function D(e, t) {
  8995. function i() {
  8996. var i = t.toJSON();
  8997. (n.linkToLocation =
  8998. window.location.protocol +
  8999. "//" +
  9000. window.location.host +
  9001. window.location.pathname +
  9002. "?m=" +
  9003. e.sid +
  9004. "&start=" +
  9005. be.serialize(i)),
  9006. t.tagManager.activeTag &&
  9007. (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid);
  9008. }
  9009. var n = {},
  9010. r = new Le.GUI({
  9011. autoPlace: !0,
  9012. width: "60%",
  9013. });
  9014. i(),
  9015. t.on(xe.ViewChanged, i),
  9016. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  9017. (r.domElement.id = "datLinks");
  9018. var o = [].slice.call(
  9019. r.domElement.querySelectorAll(".property-name")
  9020. );
  9021. return (
  9022. o.forEach(function (e) {
  9023. if (!K.detectSafari()) {
  9024. var t = document.createElement("button");
  9025. t.classList.add("btn-deep-link"),
  9026. (t.innerText = Re.MENU_COPY),
  9027. e.nextSibling.appendChild(t);
  9028. var i = function () {
  9029. alert(Re.LINK_ALERT_COPY), t.hide();
  9030. };
  9031. t.addEventListener("click", function (e) {
  9032. try {
  9033. var t = e.target.parentNode.childNodes[0];
  9034. t.select();
  9035. var n = document.execCommand("copy");
  9036. t.blur(), n || i();
  9037. } catch (e) {
  9038. i();
  9039. }
  9040. });
  9041. }
  9042. }),
  9043. $(r.__closeButton).hide(),
  9044. r
  9045. );
  9046. }
  9047. function N(e) {
  9048. He.gui || (He.gui = D(He.model, He.player)),
  9049. (He.visible = e),
  9050. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide();
  9051. }
  9052. function B() {
  9053. N(!He.visible);
  9054. }
  9055. function F(e) {
  9056. ke = {
  9057. gui: null,
  9058. visible: !1,
  9059. model: e,
  9060. };
  9061. }
  9062. function V(e) {
  9063. var t = new Le.GUI();
  9064. return (
  9065. t
  9066. .add(Q, "showSweeps")
  9067. .name("Show sweeps")
  9068. .onFinishChange(function () {
  9069. e.setSweepVisibility(Q.showSweeps);
  9070. }),
  9071. t
  9072. .add(Q, "rotationAccelerationInside", 0.1, 10)
  9073. .name("Rotation speed")
  9074. .step(0.1),
  9075. t
  9076. .add(Q.transition, "flyTime", 0, 5e3)
  9077. .name("Transition time")
  9078. .onFinishChange(function () {
  9079. (Q.transition.flySpeed = 0),
  9080. t.__controllers.forEach(function (e) {
  9081. e.updateDisplay();
  9082. });
  9083. }),
  9084. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  9085. $(t.__closeButton).hide(),
  9086. t
  9087. );
  9088. }
  9089. function U(e) {
  9090. ke.gui || (ke.gui = V(ke.model)),
  9091. (ke.visible = e),
  9092. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide();
  9093. }
  9094. function k() {
  9095. U(!ke.visible);
  9096. }
  9097. function H() {
  9098. function e(e) {
  9099. e.target === t ||
  9100. $.contains(t, e.target) ||
  9101. e.target === i ||
  9102. $.contains(i, e.target) ||
  9103. e.target === n ||
  9104. $.contains(n, e.target); /* || e.preventDefault()*/
  9105. }
  9106. $("body").css("touch-action", "none"),
  9107. $("#gui-parent")
  9108. .find("*:not(#tag-billboards)")
  9109. .on("touchmove", function (e) {
  9110. // e.preventDefault()
  9111. });
  9112. var t = document.getElementById("terms-text"),
  9113. i = document.getElementById("more-help-wrapper"),
  9114. n =
  9115. (document.getElementById("navigation-help-wrapper"),
  9116. document.getElementById("help-dialog"),
  9117. document.getElementById("tag-billboards"));
  9118. Q.useWheel &&
  9119. (document.body.addEventListener("mousewheel", e, {
  9120. passive: false,
  9121. }),
  9122. document.body.addEventListener("DOMMouseScroll", e)),
  9123. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper")
  9124. .off("touchmove")
  9125. .on("touchmove", function (e) {
  9126. e.stopPropagation();
  9127. });
  9128. }
  9129. function G(e, t) {
  9130. for (var i = []; e; ) i.push(e), (e = e.parentNode);
  9131. for (; t && i.indexOf(t) === -1; ) t = t.parentNode;
  9132. return t;
  9133. }
  9134. function z() {
  9135. var e,
  9136. t = function (t) {
  9137. e = 0 === t.button || 1 === t.which ? t.target : null;
  9138. },
  9139. i = function (t) {
  9140. e !== t.target && (e = G(e, t.target));
  9141. var i = document.getElementById("gui-parent");
  9142. if ((G(i, e) !== i && (e = null), e)) {
  9143. var n;
  9144. try {
  9145. n = new MouseEvent("click", t);
  9146. } catch (e) {
  9147. (n = document.createEvent("MouseEvents")),
  9148. n.initMouseEvent(
  9149. "click",
  9150. t.bubbles,
  9151. t.cancelable,
  9152. t.view,
  9153. t.detail,
  9154. t.screenX,
  9155. t.screenY,
  9156. t.clientX,
  9157. t.clientY,
  9158. t.ctrlKey,
  9159. t.altKey,
  9160. t.shiftKey,
  9161. t.metaKey,
  9162. t.button,
  9163. t.relatedTarget
  9164. );
  9165. }
  9166. (n.syntheticClick = !0), e.dispatchEvent(n), (e = null);
  9167. }
  9168. };
  9169. document.body.addEventListener("mousedown", t, !0),
  9170. document.body.addEventListener("mouseup", i, !0),
  9171. document.getElementById("gui-parent").addEventListener(
  9172. "click",
  9173. function (e) {
  9174. e.syntheticClick ||
  9175. (e.stopPropagation(),
  9176. "A" === e.target.nodeName && e.preventDefault());
  9177. },
  9178. !0
  9179. );
  9180. }
  9181. var lastMoveScrollTime = 0; //add
  9182. var W,
  9183. j,
  9184. Y,
  9185. X,
  9186. Z,
  9187. q,
  9188. K = (e("three"), e("../util/ajax"), e("../util/browser")),
  9189. Q = e("../settings"),
  9190. J = e("../analytics"),
  9191. ee =
  9192. (e("../util/transitions"),
  9193. e("../util/camera"),
  9194. e("../util/logger")),
  9195. te = (e("../objects/Snapshot"), e("./helpManager")),
  9196. ie = e("./immersiveMode"),
  9197. ne = e("./loadingScreen"),
  9198. re = e("./landingScreen"),
  9199. oe = e("./playButton"),
  9200. ae = e("./populateModal"),
  9201. se = e("./memoryUsage"),
  9202. le = e("./closer/modalCloser"),
  9203. ce = e("./closer/ModalCloserEvent"),
  9204. he = e("./help/help"),
  9205. ue = e("./help/HelpEvent"),
  9206. de = e("./title/titleBar"),
  9207. pe = e("./title/TitleEvents"),
  9208. fe = e("./terms/terms"),
  9209. ge = e("./terms/TermsEvent"),
  9210. me = e("./title/tagToggle"),
  9211. ve = e("./tourInteraction"),
  9212. Ae = e("./vr/vrModal"),
  9213. ye = e("./vr/vrEvent"),
  9214. Ce = e("./sharing/modal"),
  9215. Ie = e("./webvr/webVRgui"),
  9216. Ee = e("./webvr/WebVrEvent"),
  9217. be = e("../controls/serializer"),
  9218. we = e("../enum/Keys"),
  9219. _e = e("../enum/Viewmode"),
  9220. Te = (e("../enum/BlackoutStyle"), e("../tag/Media/MediaEvent")),
  9221. xe =
  9222. (e("../enum/PathDiscardMode"),
  9223. e("../enum/PathDisplayMode"),
  9224. e("../enum/DirectorEvents"),
  9225. e("../enum/PlayerEvents")),
  9226. Se = e("../enum/ControlEvents"),
  9227. Me = e("./sharing/ShareEvents"),
  9228. Re = e("../localization/localize"),
  9229. Pe =
  9230. (e("../enum/Vectors"),
  9231. e("../enum/WarpStyle"),
  9232. e("../enum/AlignmentType"),
  9233. e("../enum/VROption")),
  9234. Oe = e("./konami"),
  9235. Le = e("../lib/dat.gui"),
  9236. De = new ee(i),
  9237. Ne = (e("../util/showcase"), e("../enum/ZoomEvents")),
  9238. Be = _e.DOLLHOUSE,
  9239. Fe = 0,
  9240. Ve = 0,
  9241. Ue = [".hideTarget"],
  9242. ke = null,
  9243. He = null,
  9244. Ge = !1,
  9245. ze = !1,
  9246. We = !1,
  9247. je = {
  9248. coBrand: {
  9249. visible: !0,
  9250. elements: [".co-brand", "#loaderCoBrand"],
  9251. },
  9252. help: {
  9253. visible: !0,
  9254. elements: [".nav-help", "#nav-help"],
  9255. },
  9256. tourControls: {
  9257. visible: !0,
  9258. elements: [".next", ".previous", "#play"],
  9259. },
  9260. highlight: {
  9261. visible: !0,
  9262. elements: ["#drawer", "#pullTab"],
  9263. },
  9264. share: {
  9265. visible: !0,
  9266. elements: [".socialButton", "#share"],
  9267. },
  9268. fullScreen: {
  9269. visible: !0,
  9270. elements: ["#gui-fullscreen"],
  9271. },
  9272. floors: {
  9273. visible: !0,
  9274. elements: [".gui-floor"],
  9275. },
  9276. },
  9277. Ye = (function () {
  9278. var e = document.getElementById("drawer");
  9279. return function () {
  9280. $("#player").height() < 400 &&
  9281. e.classList.contains("open") &&
  9282. a();
  9283. };
  9284. })(),
  9285. Xe = (function () {
  9286. var e = document.getElementById("meta-info");
  9287. return function () {
  9288. $("#player").height() < 400 &&
  9289. e.classList.contains("expand") &&
  9290. de.toggleMeta(!0);
  9291. };
  9292. })(),
  9293. Ze = (function (e) {
  9294. function t() {
  9295. u.classList.contains("expand") && de.toggleMeta(!0);
  9296. }
  9297. function i() {
  9298. fe.hide();
  9299. }
  9300. function n() {
  9301. he.close();
  9302. }
  9303. function r() {
  9304. Ae.dismiss();
  9305. }
  9306. function o() {
  9307. p.hasClass("open") && a(!0);
  9308. }
  9309. function l() {
  9310. Ce.hide();
  9311. }
  9312. function c() {
  9313. f.hasClass("open") && f.removeClass("open");
  9314. }
  9315. function h() {
  9316. d.classList.contains("fadeIn") &&
  9317. (d.classList.contains("landing")
  9318. ? re.dismissModal()
  9319. : d.classList.contains("tour") && ve.dismissModal());
  9320. }
  9321. var u = document.getElementById("meta-info"),
  9322. d = document.getElementById("interaction-modal"),
  9323. p = $("#drawer").eq(0),
  9324. f = $(".gui-floor").eq(0),
  9325. g = $(".vr-popup").eq(0);
  9326. return function (e) {
  9327. switch (e) {
  9328. case "info":
  9329. i(), n(), Ye(), l(), c(), r(), h();
  9330. break;
  9331. case "terms":
  9332. t(), n(), o(), l(), c(), r(), h();
  9333. break;
  9334. case "help":
  9335. t(), i(), l(), c(), r(), h();
  9336. break;
  9337. case "vr":
  9338. t(), i(), l(), c(), n(), h(), s(g) && o();
  9339. break;
  9340. case "highlights":
  9341. Xe(), i(), l(), c();
  9342. break;
  9343. case "share":
  9344. t(), i(), n(), c(), r(), h();
  9345. break;
  9346. case "floor":
  9347. i(), l(), r();
  9348. break;
  9349. case "view":
  9350. c(), l(), i(), r();
  9351. break;
  9352. case "tour":
  9353. i(), l(), c(), r();
  9354. break;
  9355. case "move":
  9356. i(), l(), c(), r();
  9357. break;
  9358. case "resize":
  9359. t(), Ye(), c();
  9360. break;
  9361. case "tag":
  9362. i(), n(), l(), c(), r();
  9363. }
  9364. };
  9365. })();
  9366. $(document).on(
  9367. "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",
  9368. function (e) {
  9369. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  9370. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  9371. setTimeout(function () {
  9372. $(".icon:visible").hide().show(0);
  9373. }, 100);
  9374. }
  9375. ),
  9376. $("#gui-fullscreen")
  9377. .find("a")
  9378. .on("click", function (e) {
  9379. l(e),
  9380. K.requestFullscreen($("body")[0]),
  9381. J.track("showcase_gui", {
  9382. gui_action: "click_enter_fullscreen",
  9383. interaction_source: "gui",
  9384. });
  9385. //czj
  9386. //W.reload()
  9387. }),
  9388. $("#gui-fullscreen-exit")
  9389. .find("a")
  9390. .on("click", function (e) {
  9391. l(e),
  9392. K.exitFullscreen(),
  9393. J.track("showcase_gui", {
  9394. gui_action: "click_exit_fullscreen",
  9395. interaction_source: "gui",
  9396. });
  9397. });
  9398. $(window)
  9399. .on("resize", function (e) {
  9400. var t = e.target.innerHeight,
  9401. i = e.target.innerWidth;
  9402. (t === X && i === Z) ||
  9403. (je.highlight.visible && w(),
  9404. Ze("resize"),
  9405. $(".pinTop.right").removeClass("hideUnderMeta"),
  9406. c(),
  9407. (X = t),
  9408. (Z = i));
  9409. })
  9410. .resize(),
  9411. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  9412. $("#pullTab").on("click", function (e) {
  9413. l(e),
  9414. $("#drawer").hasClass("open")
  9415. ? (J.trackAlways("showcase_gui", {
  9416. gui_action: "hide_highlight_reel",
  9417. }),
  9418. $(this)
  9419. .addClass("open")
  9420. .children("img")
  9421. .attr("src", "static/images/auto.png"))
  9422. : (J.trackAlways("showcase_gui", {
  9423. gui_action: "show_highlight_reel",
  9424. }),
  9425. $(this)
  9426. .removeClass("open")
  9427. .children("img")
  9428. .attr("src", "static/images/auto-suspend.png"));
  9429. a();
  9430. });
  9431. /***********************方奕卓 热点列表事件监听 ************************/
  9432. if (window.DATA.showHotListSta) {
  9433. $("#hotList").css("display", "");
  9434. $("#hotList").on("click", function (e) {
  9435. l(e);
  9436. var hotList = $("#hotListWrap")[0];
  9437. var isActive = hotList.classList.contains("hotListActive");
  9438. if (isActive) {
  9439. hotList.classList.remove("hotListActive");
  9440. this.classList.remove("active");
  9441. } else {
  9442. hotList.classList.add("hotListActive");
  9443. this.classList.add("active");
  9444. }
  9445. }),
  9446. $("#hotListContent ul").on("mouseover", function (e) {
  9447. l(e);
  9448. var target = e.target;
  9449. var hotList = document.getElementById("hotListWrap");
  9450. if (target.tagName === "SPAN") {
  9451. var targetParent = target.parentElement.parentElement;
  9452. if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  9453. hotList.style.width = target.offsetWidth + 116 + "px";
  9454. } else {
  9455. hotList.style.width = "";
  9456. }
  9457. } else if (target.tagName === "LI") {
  9458. var targetParent = target.parentElement;
  9459. if (
  9460. target.children[0].offsetWidth + 116 >=
  9461. targetParent.clientWidth
  9462. ) {
  9463. hotList.style.width =
  9464. target.children[0].offsetWidth + 116 + "px";
  9465. } else {
  9466. hotList.style.width = "";
  9467. }
  9468. } else {
  9469. hotList.style.width = "";
  9470. }
  9471. });
  9472. $("#hotListContent ul").on("click", function (e) {
  9473. l(e);
  9474. this.preElem && this.preElem.classList.remove("active");
  9475. if (e.target.tagName === "SPAN") {
  9476. e.target.parentElement.classList.add("active");
  9477. e.target.parentElement.hot &&
  9478. e.target.parentElement.hot.examine(window.player, true); // 打开热点
  9479. this.preElem = e.target.parentElement;
  9480. } else {
  9481. e.target.classList.add("active");
  9482. e.target.hot && e.target.hot.examine(window.player, true); // 打开热点
  9483. this.preElem = e.target;
  9484. }
  9485. });
  9486. $("#hotListClose").on("click", function (e) {
  9487. l(e);
  9488. var hotList = $("#hotListWrap")[0];
  9489. hotList.classList.remove("hotListActive");
  9490. $("#hotListContent ul .active").removeClass("active");
  9491. $("#hotList")[0].classList.remove("active");
  9492. });
  9493. }
  9494. /*****************************************************************/
  9495. $("#more-menu-button").on("click", function (e) {
  9496. l(e);
  9497. var t = $("#more-menu");
  9498. t.toggleClass("open");
  9499. }),
  9500. (t.exports.init = S),
  9501. (t.exports.startLoading = x),
  9502. (t.exports.endLoading = d),
  9503. (t.exports.onProgress = u);
  9504. }).call(this, "/js/gui/gui.js");
  9505. },
  9506. {
  9507. "../analytics": 4,
  9508. "../controls/serializer": 14,
  9509. "../enum/AlignmentType": 17,
  9510. "../enum/BlackoutStyle": 18,
  9511. "../enum/ControlEvents": 21,
  9512. "../enum/DirectorEvents": 23,
  9513. "../enum/Keys": 30,
  9514. "../enum/PathDiscardMode": 38,
  9515. "../enum/PathDisplayMode": 39,
  9516. "../enum/PlayerEvents": 40,
  9517. "../enum/VROption": 47,
  9518. "../enum/Vectors": 50,
  9519. "../enum/Viewmode": 51,
  9520. "../enum/WarpStyle": 52,
  9521. "../enum/ZoomEvents": 53,
  9522. "../lib/dat.gui": 93,
  9523. "../localization/localize": 108,
  9524. "../tag/Media/MediaEvent": 131,
  9525. "../objects/Snapshot": 153,
  9526. "../settings": 166,
  9527. "../util/ajax": 181,
  9528. "../util/browser": 182,
  9529. "../util/camera": 183,
  9530. "../util/logger": 189,
  9531. "../util/showcase": 193,
  9532. "../util/transitions": 195,
  9533. "./closer/ModalCloserEvent": 61,
  9534. "./closer/modalCloser": 62,
  9535. "./help/HelpEvent": 66,
  9536. "./help/help": 67,
  9537. "./helpManager": 68,
  9538. "./immersiveMode": 69,
  9539. "./konami": 70,
  9540. "./landingScreen": 71,
  9541. "./loadingScreen": 72,
  9542. "./memoryUsage": 73,
  9543. "./playButton": 74,
  9544. "./populateModal": 75,
  9545. "./sharing/ShareEvents": 76,
  9546. "./sharing/modal": 77,
  9547. "./terms/TermsEvent": 78,
  9548. "./terms/terms": 79,
  9549. "./title/TitleEvents": 80,
  9550. "./title/tagToggle": 81,
  9551. "./title/titleBar": 82,
  9552. "./tourInteraction": 84,
  9553. "./vr/vrEvent": 85,
  9554. "./vr/vrModal": 87,
  9555. "./webvr/WebVrEvent": 88,
  9556. "./webvr/webVRgui": 89,
  9557. three: 217,
  9558. },
  9559. ],
  9560. 66: [
  9561. function (e, t, i) {
  9562. "use strict";
  9563. t.exports = Object.freeze({
  9564. OPENED: "help.opened",
  9565. CLOSED: "help.closed",
  9566. });
  9567. },
  9568. {},
  9569. ],
  9570. 67: [
  9571. function (e, t, i) {
  9572. "use strict";
  9573. function n() {
  9574. g.on("click", function (e) {
  9575. if (S && S !== l.TRANSITIONING) {
  9576. var t =
  9577. window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  9578. t && !M ? R.close() : r();
  9579. }
  9580. }),
  9581. w.on("click", function (e) {
  9582. R.close();
  9583. }),
  9584. E.on("click", function (e) {
  9585. S && S !== l.TRANSITIONING && (s(), o());
  9586. }),
  9587. b.on("click", function (e) {
  9588. s(), a();
  9589. });
  9590. }
  9591. function r() {
  9592. S &&
  9593. S !== l.TRANSITIONING &&
  9594. ((M = !0),
  9595. setTimeout(function () {
  9596. M = !1;
  9597. }, d.help.modalStayDuration),
  9598. R.emit(h.OPENED),
  9599. m.addClass("open " + S),
  9600. g.addClass("open"),
  9601. s(),
  9602. o(),
  9603. y.style.removeProperty
  9604. ? y.style.removeProperty("display")
  9605. : y.style.removeAttribute("display"),
  9606. y.classList.add("fadeIn"));
  9607. }
  9608. function o() {
  9609. E.addClass("underline-tab"),
  9610. u.fill(_, c.NAVIGATION, S),
  9611. m.addClass(S);
  9612. }
  9613. function a() {
  9614. b.addClass("underline-tab"),
  9615. u.fill(T, c.MORE_HELP),
  9616. m.addClass("more-help");
  9617. }
  9618. function s(e, t) {
  9619. m.removeClass(
  9620. "more-help " +
  9621. l.PANORAMA +
  9622. " " +
  9623. l.DOLLHOUSE +
  9624. " " +
  9625. l.FLOORPLAN +
  9626. " " +
  9627. l.OUTDOOR
  9628. ),
  9629. I.forEach(function (e) {
  9630. e.classList.remove("underline-tab");
  9631. });
  9632. }
  9633. var l = e("../../enum/Viewmode"),
  9634. c = e("../../enum/HelpModalType"),
  9635. h = e("./HelpEvent"),
  9636. u = (e("../helpManager"), e("./../populateModal")),
  9637. d = e("../../settings"),
  9638. p = e("../../util/common"),
  9639. f = e("events").EventEmitter,
  9640. g = $(".footer-help").eq(0),
  9641. m = $("#help-dialog").eq(0),
  9642. v = document.querySelector("#quick-logo"),
  9643. A = document.querySelector("#loaderCoBrand"),
  9644. y = document.querySelector("#help-dialog"),
  9645. C = document.querySelector(".footer"),
  9646. I = $(".help-tabs").children().toArray(),
  9647. E = $(".navigation-tab").eq(0),
  9648. b = $(".more-help-tab").eq(0),
  9649. w =
  9650. ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  9651. m.find(".close").eq(0)),
  9652. _ = m.find(".interactions").toArray(),
  9653. T = m.find(".ui-instructions").toArray(),
  9654. x = l.PANORAMA,
  9655. S = l.PANORAMA,
  9656. M = !1,
  9657. R = {
  9658. init: function (e, t) {
  9659. (S = t),
  9660. (x = t),
  9661. [y, A, v, C].forEach(function (e) {
  9662. e.classList.add(u.deviceType);
  9663. }),
  9664. n();
  9665. },
  9666. close: function () {
  9667. if (
  9668. m.hasClass("open") &&
  9669. (this.emit(h.CLOSED),
  9670. g.removeClass("open"),
  9671. m.removeClass("open"),
  9672. y.classList.contains("fadeIn"))
  9673. ) {
  9674. y.classList.remove("fadeIn");
  9675. var e = S === l.TRANSITIONING ? x : S;
  9676. u.clear(_, c.NAVIGATION, e);
  9677. }
  9678. },
  9679. updateMode: function (e) {
  9680. (x = S), (S = e);
  9681. },
  9682. };
  9683. p.extendObject(R, f.prototype), (t.exports = R);
  9684. },
  9685. {
  9686. "../../enum/HelpModalType": 28,
  9687. "../../enum/Viewmode": 51,
  9688. "../../settings": 166,
  9689. "../../util/common": 185,
  9690. "../helpManager": 68,
  9691. "./../populateModal": 75,
  9692. "./HelpEvent": 66,
  9693. events: 202,
  9694. },
  9695. ],
  9696. 68: [
  9697. function (e, t, i) {
  9698. (function (i) {
  9699. "use strict";
  9700. var n = e("../util/browser"),
  9701. r = e("./../util/logger"),
  9702. o = e("./../settings"),
  9703. a = new r(i),
  9704. s = (function () {
  9705. var e;
  9706. try {
  9707. return (
  9708. (e = window.localStorage.getItem("visitCount") || "0"),
  9709. (e = (parseFloat(e) + 1).toString()),
  9710. window.localStorage.setItem("visitCount", e),
  9711. a.debug("visitCount = " + e),
  9712. e
  9713. );
  9714. } catch (t) {
  9715. (e = "1"), a.debug("couldn't set local storage");
  9716. }
  9717. })(),
  9718. l = !1;
  9719. t.exports = {
  9720. isHelpDisabled: function () {
  9721. return "0" === n.valueFromHash("help", null) || l;
  9722. },
  9723. isLargeHelpEnabled: function () {
  9724. return (
  9725. ("1" === s || "1" === n.valueFromHash("help", null)) &&
  9726. !this.isHelpDisabled()
  9727. );
  9728. },
  9729. isSmallHelpEnabled: function () {
  9730. return (
  9731. "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  9732. );
  9733. },
  9734. isHelpEnabled: function () {
  9735. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled();
  9736. },
  9737. setAutoPlay: function (e) {
  9738. l = o.warp.auto >= 0 && e > 1;
  9739. },
  9740. };
  9741. }).call(this, "/js/gui/helpManager.js");
  9742. },
  9743. {
  9744. "../util/browser": 182,
  9745. "./../settings": 166,
  9746. "./../util/logger": 189,
  9747. },
  9748. ],
  9749. 69: [
  9750. function (e, t, i) {
  9751. "use strict";
  9752. function n(e, t, i, n) {
  9753. (F = n), r(e, t, i, F), o(), (N = t.mode);
  9754. }
  9755. function r(e, t, i, n) {
  9756. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  9757. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c);
  9758. }),
  9759. M.on("mousewheel DOMMouseScroll", a),
  9760. i.on(m.TagActivated, a),
  9761. i.on(m.TagNavigation, a),
  9762. t.on(A.FlyingEnded, s),
  9763. t.on(A.ModeChanging, function (e, t) {
  9764. B = t !== C.PANORAMA && e !== C.PANORAMA;
  9765. }),
  9766. t.on(A.ModeChanged, function (e, i) {
  9767. (N = t.mode), i !== C.TRANSITIONING ? l() : a("modeChange");
  9768. }),
  9769. n.on(y.TourStart, function () {
  9770. (L = !0), a();
  9771. }),
  9772. n.on(y.TourEnd, function () {
  9773. (L = !1), l();
  9774. }),
  9775. n.on(y.ActionInterrupted, function () {
  9776. L = !1;
  9777. }),
  9778. R.addEventListener(
  9779. "touchend",
  9780. function () {
  9781. $("#pullTab").hasClass("opened") && !L && l();
  9782. },
  9783. !0
  9784. );
  9785. }
  9786. function o() {
  9787. p.isMobile()
  9788. ? (b.forEach(function (e) {
  9789. e.classList.add("mobile");
  9790. }),
  9791. w.click(l))
  9792. : (b.forEach(function (e) {
  9793. e.addEventListener(
  9794. "mouseleave",
  9795. function () {
  9796. !M.is(":hover") &&
  9797. b[0].classList.contains("detectHover") &&
  9798. l();
  9799. },
  9800. !0
  9801. );
  9802. }),
  9803. M.mouseleave(function () {
  9804. b[0].classList.contains("detectHover") && l();
  9805. }));
  9806. }
  9807. function a(e) {
  9808. D ||
  9809. (d(e) && _.hasClass("playing")) ||
  9810. (clearTimeout(O),
  9811. (P = !0),
  9812. g.close(),
  9813. h(e),
  9814. N !== C.DOLLHOUSE &&
  9815. N !== C.FLOORPLAN &&
  9816. ((x.hasClass("expand") && !S.hasClass("closed")) ||
  9817. 2 === p.valueFromHash("title", 1),
  9818. _.hasClass("playing") ||
  9819. (b.forEach(function (e) {
  9820. e.classList.add("detectHover");
  9821. }),
  9822. (O = setTimeout(l, f.immersive.timeToShowAgain)))));
  9823. }
  9824. function s() {
  9825. _.hasClass("playing") ||
  9826. (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)));
  9827. }
  9828. function l() {
  9829. clearTimeout(O),
  9830. (P = !1),
  9831. I.forEach(function (e) {
  9832. e.classList.remove("drawerOpen");
  9833. }),
  9834. L ||
  9835. E.forEach(function (e) {
  9836. e.classList.remove("duringTour");
  9837. }),
  9838. b.forEach(function (e) {
  9839. e.classList.remove("detectHover");
  9840. });
  9841. }
  9842. function c() {
  9843. P ? l() : a(),
  9844. (D = !0),
  9845. setTimeout(function () {
  9846. D = !1;
  9847. }, f.immersive.uiStayDuration);
  9848. }
  9849. function h(e) {
  9850. !d(e) && L
  9851. ? E.forEach(function (e) {
  9852. e.classList.remove("drawerOpen"), e.classList.add("duringTour");
  9853. })
  9854. : _.hasClass("open")
  9855. ? E.forEach(function (e) {
  9856. e.classList.remove("duringTour"), e.classList.add("drawerOpen");
  9857. })
  9858. : B ||
  9859. N === C.FLOORPLAN ||
  9860. N === C.DOLLHOUSE ||
  9861. E.forEach(function (e) {
  9862. e.classList.add("fadeOut");
  9863. });
  9864. }
  9865. function u() {
  9866. T.hasClass("duringTour") || ((L = !1), a("gui"), l());
  9867. }
  9868. function d(e) {
  9869. return "mouse" === e || "touch" === e || "key" === e || "gui" === e;
  9870. }
  9871. var p = e("../util/browser"),
  9872. f = e("../settings"),
  9873. g = e("./help/help"),
  9874. m = e("../enum/tagEvents"),
  9875. v = e("../enum/ControlEvents"),
  9876. A = e("../enum/PlayerEvents"),
  9877. y = e("../enum/DirectorEvents"),
  9878. A = e("../enum/PlayerEvents"),
  9879. C = e("../enum/Viewmode"),
  9880. I = $(
  9881. ".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer"
  9882. ).toArray(),
  9883. E = $(".pinBottom-container, #drawer-container, .footer").toArray(),
  9884. b = $("#hover-bottom, #hover-top").toArray(),
  9885. w =
  9886. ($("#pullTab").eq(0),
  9887. $("#playHead").eq(0),
  9888. $(".pinBottom-container").eq(0)),
  9889. _ = $("#drawer").eq(0),
  9890. T = $("#drawer-container").eq(0),
  9891. x = $("#meta-info").eq(0),
  9892. S = $(".pinTop.left").eq(0),
  9893. M = $("#player").eq(0),
  9894. R = document.getElementById("pullTab"),
  9895. P = !1,
  9896. O = null,
  9897. L = !1,
  9898. D = !1,
  9899. N = null,
  9900. B = !1,
  9901. F = null;
  9902. (t.exports.init = n),
  9903. (t.exports.hideUi = a),
  9904. (t.exports.resetDrawer = u);
  9905. },
  9906. {
  9907. "../enum/ControlEvents": 21,
  9908. "../enum/DirectorEvents": 23,
  9909. "../enum/tagEvents": 32,
  9910. "../enum/PlayerEvents": 40,
  9911. "../enum/Viewmode": 51,
  9912. "../settings": 166,
  9913. "../util/browser": 182,
  9914. "./help/help": 67,
  9915. },
  9916. ],
  9917. 70: [
  9918. function (e, t, i) {
  9919. (function (i) {
  9920. "use strict";
  9921. function n(e, t, i) {
  9922. l.debug("konami has the modelInstance");
  9923. var n = [];
  9924. $(window).on("keydown", function (e) {
  9925. n.push(e.which),
  9926. n.length > o.secretPanelWord.length && n.shift(),
  9927. s.equalLists(n, o.secretPanelWord) &&
  9928. (l.debug("Developer mode active."), (o.debug = !0));
  9929. }),
  9930. $(window).on("keydown", function n(r) {
  9931. o.debug &&
  9932. 72 === r.which &&
  9933. (e && i
  9934. ? (a.toggle(e, t, i), $(window).off("keydown", n))
  9935. : console.warn("sorry we're not ready yet"));
  9936. });
  9937. }
  9938. var r = e("./../util/logger"),
  9939. o = e("./../settings"),
  9940. a = e("./debug"),
  9941. s = e("./../util/common"),
  9942. l = (e("./gui"), new r(i));
  9943. o.console && $("body").append('<div id="debug-console"></div>'),
  9944. (t.exports.init = n);
  9945. }).call(this, "/js/gui/konami.js");
  9946. },
  9947. {
  9948. "./../settings": 166,
  9949. "./../util/common": 185,
  9950. "./../util/logger": 189,
  9951. "./debug": 63,
  9952. "./gui": 65,
  9953. },
  9954. ],
  9955. 71: [
  9956. function (e, t, i) {
  9957. "use strict";
  9958. function n(e, t) {
  9959. E =
  9960. t.mode === p.PANORAMA && t.pano && !t.pano.isAligned()
  9961. ? p.OUTDOOR
  9962. : t.mode;
  9963. }
  9964. function r(e) {
  9965. var t = $.Deferred();
  9966. e || t.resolve();
  9967. var i = c.startupFlyinDelay;
  9968. return (
  9969. e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  9970. setTimeout(t.resolve.bind(t), i),
  9971. t
  9972. );
  9973. }
  9974. function o(e, t, i) {
  9975. var n = 0;
  9976. c.quickstart.enabled &&
  9977. (a(i),
  9978. (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay));
  9979. var r = function () {
  9980. e.once(g.Move, l), t.once(f.TourStart, l);
  9981. };
  9982. s(n, r);
  9983. }
  9984. function a(e) {
  9985. return; /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  9986. v.before(y),
  9987. A = $(".quick-brand").toArray()),*/
  9988. m.addClass("fadeOut"),
  9989. setTimeout(function () {
  9990. A.forEach(function (e) {
  9991. e.classList.add("fadeIn");
  9992. });
  9993. }, c.quickstart.showTextDelay),
  9994. setTimeout(function () {
  9995. A.forEach(function (e) {
  9996. e.classList.add("fadeOut");
  9997. });
  9998. }, c.quickstart.fadeOutDelay),
  9999. !0;
  10000. }
  10001. function s(e, t) {
  10002. setTimeout(function () {
  10003. if (h.isHelpEnabled()) {
  10004. if (
  10005. (t(),
  10006. u.init(),
  10007. C.addClass("fadeIn landing " + u.deviceType),
  10008. h.isSmallHelpEnabled())
  10009. )
  10010. return void C.addClass("small");
  10011. u.fill(I, d.LANDING[E]), C.addClass(E);
  10012. }
  10013. }, e);
  10014. //csz 用户引导界面
  10015. var helpData = {
  10016. pc: [
  10017. "static/images/pc_step1.png",
  10018. "static/images/pc_step2.png",
  10019. "static/images/pc_step3.png",
  10020. ],
  10021. mobile: [
  10022. "static/images/phone_step1.png",
  10023. "static/images/phone_step2.png",
  10024. "static/images/phone_step3.png",
  10025. ],
  10026. };
  10027. var navIcon = $(".nav-icon .icon");
  10028. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
  10029. navIcon.attr("src", helpData.mobile[0]);
  10030. function paging(id) {
  10031. id.on("click", function () {
  10032. var navPage = null;
  10033. $(this).attr("data-id") == "plus"
  10034. ? (navPage = +navIcon.attr("data-page") + 1)
  10035. : (navPage = +navIcon.attr("data-page") - 1);
  10036. if (navPage > helpData.length || navPage < 1) return false;
  10037. if (
  10038. /Android|webOS|iPhone|iPod|BlackBerry/i.test(
  10039. navigator.userAgent
  10040. )
  10041. ) {
  10042. navIcon.attr({
  10043. "data-page": navPage,
  10044. src: helpData.mobile[navPage - 1],
  10045. });
  10046. } else {
  10047. navIcon.attr({
  10048. "data-page": navPage,
  10049. src: helpData.pc[navPage - 1],
  10050. });
  10051. }
  10052. });
  10053. }
  10054. paging($(".next-button"));
  10055. paging($(".prev-button"));
  10056. }
  10057. function l() {
  10058. u.clear(I, d.LANDING[E]), C.removeClass("fadeIn");
  10059. }
  10060. var c = e("../settings"),
  10061. h = (e("./help/help"), e("./helpManager")),
  10062. u = e("./populateModal"),
  10063. d = e("../enum/HelpModalType"),
  10064. p = e("../enum/Viewmode"),
  10065. f = e("../enum/DirectorEvents"),
  10066. g = e("../enum/PlayerEvents"),
  10067. m = $("#quick-blackout").eq(0),
  10068. v = $("#quick-logo").eq(0),
  10069. A = $(".quick-brand").toArray(),
  10070. y = $("#loaderCoBrand").eq(0),
  10071. C = $("#interaction-modal").eq(0),
  10072. I = C.find(".interaction").toArray(),
  10073. E =
  10074. ($(
  10075. "#model-title, .pinBottom-container, #drawer-container, #drawer, .footer"
  10076. ).toArray(),
  10077. "");
  10078. (t.exports.delayLanding = r),
  10079. (t.exports.showMessage = o),
  10080. (t.exports.init = n),
  10081. (t.exports.dismissModal = l);
  10082. },
  10083. {
  10084. "../enum/DirectorEvents": 23,
  10085. "../enum/HelpModalType": 28,
  10086. "../enum/PlayerEvents": 40,
  10087. "../enum/Viewmode": 51,
  10088. "../settings": 166,
  10089. "./help/help": 67,
  10090. "./helpManager": 68,
  10091. "./populateModal": 75,
  10092. },
  10093. ],
  10094. 72: [
  10095. function (e, t, i) {
  10096. "use strict";
  10097. var n = e("./circleLoader").circleLoader;
  10098. t.exports = {
  10099. element: $("#gui-loading"),
  10100. hide: function (e) {
  10101. n.done(), this.element.fadeOut(1500, e);
  10102. },
  10103. show: function (e) {
  10104. this.element.fadeIn(
  10105. 500,
  10106. function () {
  10107. this.element.css("display", "table"), e && e();
  10108. }.bind(this)
  10109. );
  10110. },
  10111. progress: function (e) {
  10112. n.set(e);
  10113. },
  10114. };
  10115. },
  10116. {
  10117. "./circleLoader": 60,
  10118. },
  10119. ],
  10120. 73: [
  10121. function (e, t, i) {
  10122. "use strict";
  10123. var n = e("../settings"),
  10124. r = $("#memory-info"),
  10125. o = r.find("#memory-gpu"),
  10126. a = !1;
  10127. t.exports = {
  10128. show: function () {
  10129. n.profiling.enabled && (r.show(), (a = !0));
  10130. },
  10131. hide: function () {
  10132. r.hide(), (a = !1);
  10133. },
  10134. toggle: function () {
  10135. a ? this.hide() : this.show();
  10136. },
  10137. update: function (e) {
  10138. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB");
  10139. },
  10140. };
  10141. },
  10142. {
  10143. "../settings": 166,
  10144. },
  10145. ],
  10146. 74: [
  10147. function (e, t, i) {
  10148. "use strict";
  10149. var n = e("../util/browser"),
  10150. r = e("../analytics");
  10151. e("../settings");
  10152. t.exports = {
  10153. show: function (e, t) {
  10154. $("#gui-message").fadeOut(500, function () {
  10155. t();
  10156. });
  10157. },
  10158. };
  10159. },
  10160. {
  10161. "../analytics": 4,
  10162. "../settings": 166,
  10163. "../util/browser": 182,
  10164. },
  10165. ],
  10166. 75: [
  10167. function (e, t, i) {
  10168. "use strict";
  10169. function n(e, t, i, n) {
  10170. function r(e) {
  10171. return e.classList.contains(a);
  10172. }
  10173. var o = i
  10174. ? this.assets[t][i][this.deviceType]
  10175. : this.assets[t][this.deviceType];
  10176. //for (var a in o) {
  10177. //var s = e.find(r);
  10178. //for (var l in o[a]) {
  10179. //var c = o[a][l];
  10180. //if ("top-info" === l || "bottom-info" === l) {
  10181. //var h = n ? c : "";
  10182. //czj 注释掉第一次打开的用户引导
  10183. //s.querySelector("." + l).textContent = h
  10184. //} else {
  10185. //var u = n ? c : "";
  10186. //, d = s.querySelector("." + l);
  10187. //d.src = u,
  10188. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  10189. //}
  10190. //}
  10191. //}
  10192. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  10193. // p.forEach(function(e) {
  10194. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  10195. // })
  10196. }
  10197. var r = e("../util/browser"),
  10198. o = e("../localization/localize"),
  10199. a = e("../enum/HelpModalType"),
  10200. s = (e("../enum/HelpModalSize"), e("../enum/Viewmode"));
  10201. t.exports = {
  10202. init: function () {
  10203. if (!this.hasInitialized) {
  10204. (this.hasInitialized = !0),
  10205. (this.deviceType = r.isMobile() ? "mobile" : "desktop"),
  10206. (this.assets = {}),
  10207. (this.assets[a.LANDING[s.PANORAMA]] = {
  10208. desktop: {
  10209. left: {
  10210. "top-info": o.ROTATE,
  10211. "big-image": "static/images/nav_help_mouse_drag_left.png",
  10212. keyboard: "static/images/nav_help_keyboard_left_right.png",
  10213. },
  10214. middle: {
  10215. "top-info": o.MOVE,
  10216. "big-image": "static/images/nav_help_mouse_click.png",
  10217. keyboard: "static/images/nav_help_keyboard_up_down.png",
  10218. },
  10219. right: {
  10220. "top-info": o.ZOOM,
  10221. "big-image": "static/images/nav_help_mouse_zoom.png",
  10222. keyboard: "static/images/nav_help_zoom_keys.png",
  10223. },
  10224. },
  10225. mobile: {
  10226. left: {
  10227. "top-info": o.ROTATE,
  10228. "big-image": "static/images/nav_help_gesture_drag.png",
  10229. },
  10230. middle: {
  10231. "top-info": o.MOVE,
  10232. "big-image": "static/images/nav_help_gesture_tap.png",
  10233. },
  10234. right: {
  10235. "top-info": o.ZOOM,
  10236. "big-image": "static/images/nav_help_gesture_pinch.png",
  10237. },
  10238. },
  10239. }),
  10240. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(
  10241. JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])
  10242. )),
  10243. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  10244. desktop: {
  10245. left: {
  10246. "top-info": o.ROTATE,
  10247. "big-image": "static/images/nav_help_mouse_drag_left.png",
  10248. keyboard: "static/images/nav_help_keyboard_left_right.png",
  10249. },
  10250. middle: {
  10251. "top-info": o.MOVE,
  10252. "big-image": "static/images/nav_help_mouse_position_right.png",
  10253. },
  10254. },
  10255. mobile: {
  10256. left: {
  10257. "top-info": o.ROTATE,
  10258. "big-image": "static/images/nav_help_gesture_drag.png",
  10259. },
  10260. middle: {
  10261. "top-info": o.MOVE,
  10262. "big-image":
  10263. "static/images/nav_help_gesture_position_two_finger.png",
  10264. },
  10265. },
  10266. }),
  10267. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  10268. desktop: {
  10269. left: {
  10270. "top-info": o.MOVE,
  10271. "big-image": "static/images/nav_help_mouse_position_left.png",
  10272. },
  10273. middle: {
  10274. "top-info": o.ROTATE,
  10275. "big-image": "static/images/nav_help_mouse_drag_right.png",
  10276. keyboard: "static/images/nav_help_keyboard_left_right.png",
  10277. },
  10278. },
  10279. mobile: {
  10280. left: {
  10281. "top-info": o.MOVE,
  10282. "big-image": "static/images/nav_help_gesture_position.png",
  10283. },
  10284. middle: {
  10285. "top-info": o.ROTATE,
  10286. "big-image":
  10287. "static/images/nav_help_gesture_drag_two_finger.png",
  10288. },
  10289. },
  10290. });
  10291. var e = {
  10292. "top-info": o.INSIDE,
  10293. "big-image": "static/images/nav_help_click_inside.png",
  10294. keyboard: "static/images/nav_help_inside_key.png",
  10295. };
  10296. (this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e),
  10297. (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e),
  10298. (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e);
  10299. var t = {
  10300. "top-info": o.INSIDE,
  10301. "big-image": "static/images/nav_help_tap_inside.png",
  10302. };
  10303. (this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  10304. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  10305. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  10306. (this.assets[a.NAVIGATION] = {}),
  10307. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  10308. desktop: {
  10309. left: {
  10310. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  10311. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  10312. "big-image": "static/images/nav_help_mouse_drag_left.png",
  10313. keyboard: "static/images/nav_help_keyboard_left_right.png",
  10314. },
  10315. middle: {
  10316. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  10317. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  10318. "big-image": "static/images/nav_help_mouse_click.png",
  10319. keyboard: "static/images/nav_help_keyboard_up_down.png",
  10320. },
  10321. right: {
  10322. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  10323. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  10324. "big-image": "static/images/nav_help_mouse_zoom.png",
  10325. keyboard: "static/images/nav_help_zoom_keys.png",
  10326. },
  10327. },
  10328. mobile: {
  10329. left: {
  10330. "top-info": o.HELP_MOBILE_PANORAMA_1,
  10331. "big-image": "static/images/nav_help_gesture_drag.png",
  10332. },
  10333. middle: {
  10334. "top-info": o.HELP_MOBILE_PANORAMA_2,
  10335. "big-image": "static/images/nav_help_gesture_tap.png",
  10336. },
  10337. right: {
  10338. "top-info": o.HELP_MOBILE_3,
  10339. "big-image": "static/images/nav_help_gesture_pinch.png",
  10340. },
  10341. },
  10342. }),
  10343. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  10344. desktop: {
  10345. left: {
  10346. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  10347. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  10348. "big-image": "static/images/nav_help_mouse_drag_left.png",
  10349. keyboard: "static/images/nav_help_keyboard_all.png",
  10350. },
  10351. middle: {
  10352. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  10353. "big-image": "static/images/nav_help_mouse_position_right.png",
  10354. },
  10355. right: {
  10356. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  10357. "big-image": "static/images/nav_help_mouse_zoom.png",
  10358. },
  10359. },
  10360. mobile: {
  10361. left: {
  10362. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  10363. "big-image": "static/images/nav_help_gesture_drag.png",
  10364. },
  10365. middle: {
  10366. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  10367. "big-image":
  10368. "static/images/nav_help_gesture_position_two_finger.png",
  10369. },
  10370. right: {
  10371. "top-info": o.HELP_MOBILE_3,
  10372. "big-image": "static/images/nav_help_gesture_pinch.png",
  10373. },
  10374. },
  10375. }),
  10376. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  10377. desktop: {
  10378. left: {
  10379. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  10380. "big-image": "static/images/nav_help_mouse_position_left.png",
  10381. },
  10382. middle: {
  10383. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  10384. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  10385. "big-image": "static/images/nav_help_mouse_drag_right.png",
  10386. keyboard: "static/images/nav_help_keyboard_left_right.png",
  10387. },
  10388. right: {
  10389. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  10390. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  10391. "big-image": "static/images/nav_help_mouse_zoom.png",
  10392. keyboard: "static/images/nav_help_keyboard_up_down.png",
  10393. },
  10394. },
  10395. mobile: {
  10396. left: {
  10397. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  10398. "big-image": "static/images/nav_help_gesture_position.png",
  10399. },
  10400. middle: {
  10401. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  10402. "big-image":
  10403. "static/images/nav_help_gesture_drag_two_finger.png",
  10404. },
  10405. right: {
  10406. "top-info": o.HELP_MOBILE_3,
  10407. "big-image": "static/images/nav_help_gesture_pinch.png",
  10408. },
  10409. },
  10410. }),
  10411. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(
  10412. JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])
  10413. )),
  10414. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  10415. "top-info": o.HELP_DESKTOP_360_2A,
  10416. "bottom-info": o.HELP_DESKTOP_360_2B,
  10417. "big-image": "static/images/nav_help_click_inside.png",
  10418. keyboard: "static/images/nav_help_inside_key.png",
  10419. }),
  10420. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  10421. "top-info": o.HELP_MOBILE_360_2,
  10422. "big-image": "static/images/nav_help_tap_inside.png",
  10423. }),
  10424. (this.assets[a.MORE_HELP] = {
  10425. desktop: {
  10426. "more-help-hlr": {
  10427. "top-info": o.HELP_MORE_HLR_A,
  10428. "big-image": "static/images/nav_help_expand.svg",
  10429. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B,
  10430. },
  10431. "more-help-dollhouse": {
  10432. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  10433. "big-image": "static/images/nav_help_dollhouse.svg",
  10434. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B,
  10435. },
  10436. "more-help-floors": {
  10437. "top-info": o.HELP_MORE_FLOORS_A,
  10438. "big-image": "static/images/nav_help_floor picker.svg",
  10439. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B,
  10440. },
  10441. "more-help-tag": {
  10442. "top-info": o.HELP_MORE_TAG_A,
  10443. "big-image": "static/images/nav_help_tag.svg",
  10444. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B,
  10445. },
  10446. "more-help-zoom": {
  10447. "top-info": o.HELP_MORE_ZOOM_A,
  10448. "big-image": "static/images/nav_help_zoom.svg",
  10449. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B,
  10450. },
  10451. "more-help-tour": {
  10452. "top-info": o.HELP_MORE_TOUR_A,
  10453. "big-image": "static/images/nav_help_play.png",
  10454. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B,
  10455. },
  10456. "more-help-inside": {
  10457. "top-info": o.HELP_MORE_INSIDE_A,
  10458. "big-image": "static/images/nav_help_inside.svg",
  10459. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B,
  10460. },
  10461. "more-help-vr": {
  10462. "top-info": o.HELP_MORE_VR_A,
  10463. "big-image": "static/images/nav_help_vr.svg",
  10464. "bottom-info": o.HELP_DESKTOP_MORE_VR_B,
  10465. },
  10466. "more-help-360": {
  10467. "top-info": o.HELP_MORE_360_A,
  10468. "big-image": "static/images/nav_help_360.svg",
  10469. "bottom-info": o.HELP_DESKTOP_MORE_360_B,
  10470. },
  10471. "more-help-fullscreen": {
  10472. "top-info": o.HELP_MORE_FULLSCREEN_A,
  10473. "big-image": "static/images/nav_help_fullscreen.svg",
  10474. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B,
  10475. },
  10476. },
  10477. mobile: {
  10478. "more-help-hlr": {
  10479. "top-info": o.HELP_MORE_HLR_A,
  10480. "big-image": "static/images/nav_help_expand.svg",
  10481. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B,
  10482. },
  10483. "more-help-dollhouse": {
  10484. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  10485. "big-image": "static/images/nav_help_dollhouse.svg",
  10486. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B,
  10487. },
  10488. "more-help-floors": {
  10489. "top-info": o.HELP_MORE_FLOORS_A,
  10490. "big-image": "static/images/nav_help_floor picker.svg",
  10491. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B,
  10492. },
  10493. "more-help-tag": {
  10494. "top-info": o.HELP_MORE_TAG_A,
  10495. "big-image": "static/images/nav_help_tag.svg",
  10496. "bottom-info": o.HELP_MOBILE_MORE_TAG_B,
  10497. },
  10498. "more-help-tour": {
  10499. "top-info": o.HELP_MORE_TOUR_A,
  10500. "big-image": "static/images/nav_help_play.png",
  10501. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B,
  10502. },
  10503. "more-help-inside": {
  10504. "top-info": o.HELP_MORE_INSIDE_A,
  10505. "big-image": "static/images/nav_help_inside.svg",
  10506. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B,
  10507. },
  10508. "more-help-vr": {
  10509. "top-info": o.HELP_MORE_VR_A,
  10510. "big-image": "static/images/webvr.svg",
  10511. "bottom-info": o.HELP_MOBILE_MORE_VR_B,
  10512. },
  10513. "more-help-360": {
  10514. "top-info": o.HELP_MORE_360_A,
  10515. "big-image": "static/images/nav_help_360.svg",
  10516. "bottom-info": o.HELP_MOBILE_MORE_360_B,
  10517. },
  10518. },
  10519. }),
  10520. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  10521. desktop: {
  10522. left: {
  10523. "top-info": o.ROTATE,
  10524. "big-image": "static/images/nav_help_mouse_drag_left.png",
  10525. keyboard: "static/images/nav_help_keyboard_left_right.png",
  10526. },
  10527. middle: {
  10528. "top-info": o.MOVE,
  10529. "big-image": "static/images/nav_help_mouse_click.png",
  10530. keyboard: "static/images/nav_help_keyboard_up_down.png",
  10531. },
  10532. right: {
  10533. "top-info": o.PLAY,
  10534. "big-image": "static/images/Desktop-help-play-button.svg",
  10535. keyboard: "static/images/Desktop-help-spacebar-2.svg",
  10536. },
  10537. },
  10538. mobile: {
  10539. left: {
  10540. "top-info": o.ROTATE,
  10541. "big-image": "static/images/nav_help_gesture_drag.png",
  10542. },
  10543. middle: {
  10544. "top-info": o.MOVE,
  10545. "big-image": "static/images/nav_help_gesture_tap.png",
  10546. },
  10547. right: {
  10548. "top-info": o.PLAY,
  10549. "big-image": "static/images/mobile-help-play-button.svg",
  10550. },
  10551. },
  10552. }),
  10553. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(
  10554. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])
  10555. )),
  10556. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle =
  10557. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  10558. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle =
  10559. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  10560. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(
  10561. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])
  10562. )),
  10563. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left =
  10564. this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  10565. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left =
  10566. this.assets[a.LANDING[s.FLOORPLAN]].mobile.left);
  10567. }
  10568. },
  10569. fill: function (e, t, i) {
  10570. n.call(this, e, t, i, !0);
  10571. },
  10572. clear: function (e, t, i) {
  10573. n.call(this, e, t, i, !1);
  10574. },
  10575. };
  10576. },
  10577. {
  10578. "../enum/HelpModalSize": 27,
  10579. "../enum/HelpModalType": 28,
  10580. "../enum/Viewmode": 51,
  10581. "../localization/localize": 108,
  10582. "../util/browser": 182,
  10583. },
  10584. ],
  10585. 76: [
  10586. function (e, t, i) {
  10587. "use strict";
  10588. t.exports = Object.freeze({
  10589. OPENED: "share.open",
  10590. CLOSED: "share.closed",
  10591. LINK_CLICKED: "share.linked",
  10592. });
  10593. },
  10594. {},
  10595. ],
  10596. 77: [
  10597. function (e, t, i) {
  10598. "use strict";
  10599. function n(e) {
  10600. function t(t, i) {
  10601. var n = window.screenY + ($("#player").height() - i) / 2,
  10602. r = window.screenX + ($("#player").width() - t) / 2,
  10603. o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  10604. I.emit(l.LINK_CLICKED, {
  10605. channel: e,
  10606. }),
  10607. window.open(C[e], "shareWindow", o);
  10608. }
  10609. switch (e) {
  10610. case y.FACEBOOK:
  10611. t(580, 420);
  10612. break;
  10613. case y.TWITTER:
  10614. t(550, 440);
  10615. break;
  10616. case y.MAIL:
  10617. I.emit(l.LINK_CLICKED, {
  10618. channel: "email",
  10619. }),
  10620. window.open(C[e], "_blank");
  10621. break;
  10622. case y.LINKEDIN:
  10623. }
  10624. }
  10625. function r(e) {
  10626. I.emit(l.LINK_CLICKED, {
  10627. channel: "copylink",
  10628. });
  10629. var t = document.createRange();
  10630. t.selectNodeContents(v);
  10631. var i = window.getSelection();
  10632. i.removeAllRanges(),
  10633. i.addRange(t),
  10634. document.execCommand("copy"),
  10635. A.classList.remove("hidden"),
  10636. v.classList.add("highlighted");
  10637. }
  10638. function o(e) {
  10639. (e && (e.stopPropagation(), e.target === v)) ||
  10640. (window.getSelection().removeAllRanges(),
  10641. v.classList.remove("highlighted"),
  10642. A.classList.add("hidden"));
  10643. }
  10644. var a = e("../../util/browser"),
  10645. s = e("../../localization/localize"),
  10646. l = e("./ShareEvents"),
  10647. c = e("../../util/common"),
  10648. h = e("events").EventEmitter,
  10649. u = document.getElementById("sharing"),
  10650. d = document.getElementById("share-modal"),
  10651. p = document.getElementById("share-close"),
  10652. f = document.getElementById("facebook-share"),
  10653. g = document.getElementById("twitter-share"),
  10654. m = document.getElementById("mail-share"),
  10655. v = document.getElementById("share-url-text"),
  10656. A = document.getElementById("copy-success"),
  10657. y = Object.freeze({
  10658. FACEBOOK: "facebook",
  10659. TWITTER: "twitter",
  10660. MAIL: "mail",
  10661. LINKEDIN: "linkedin",
  10662. }),
  10663. C = {};
  10664. (C[y.FACEBOOK] =
  10665. "http://www.facebook.com/sharer.php?u=" +
  10666. encodeURIComponent(window.location.href + "&utm_source=1") +
  10667. "&t="),
  10668. (C[y.TWITTER] = "http://twitter.com/intent/tweet?text="),
  10669. (C[y.MAIL] = "mailto:?subject=");
  10670. var I = {
  10671. init: function (e) {
  10672. var t = encodeURIComponent(
  10673. s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " "
  10674. );
  10675. (C[y.FACEBOOK] +=
  10676. t + encodeURIComponent(window.location.href + "&utm_source=1")),
  10677. (C[y.TWITTER] +=
  10678. t +
  10679. encodeURIComponent(
  10680. window.location.href +
  10681. "&utm_source=2 " +
  10682. s.SHARE_WITH +
  10683. " #port"
  10684. )),
  10685. (C[y.MAIL] +=
  10686. encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) +
  10687. "&body=" +
  10688. t +
  10689. encodeURIComponent(window.location.href + "&utm_source=3")),
  10690. u.addEventListener("click", this.toggle.bind(this)),
  10691. p.addEventListener("click", this.hide.bind(this)),
  10692. v.addEventListener("click", r),
  10693. d.addEventListener("click", o),
  10694. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  10695. g.addEventListener("click", n.bind(this, y.TWITTER)),
  10696. m.addEventListener("click", n.bind(this, y.MAIL)),
  10697. (v.textContent = window.location.href + "&utm_source=4"),
  10698. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  10699. u.classList.remove("hidden");
  10700. },
  10701. show: function () {
  10702. this.emit(l.OPENED), d.classList.add("fadeIn");
  10703. },
  10704. hide: function () {
  10705. d.classList.contains("fadeIn") &&
  10706. (this.emit(l.CLOSED),
  10707. document.selection && document.selection.empty(),
  10708. window.getSelection().removeAllRanges(),
  10709. o(),
  10710. d.classList.remove("fadeIn"));
  10711. },
  10712. toggle: function () {
  10713. d.classList.contains("fadeIn") ? this.hide() : this.show();
  10714. },
  10715. };
  10716. c.extendObject(I, h.prototype), (t.exports = I);
  10717. },
  10718. {
  10719. "../../localization/localize": 108,
  10720. "../../util/browser": 182,
  10721. "../../util/common": 185,
  10722. "./ShareEvents": 76,
  10723. events: 202,
  10724. },
  10725. ],
  10726. 78: [
  10727. function (e, t, i) {
  10728. "use strict";
  10729. t.exports = Object.freeze({
  10730. OPENED: "terms.opened",
  10731. CLOSED: "terms.closed",
  10732. });
  10733. },
  10734. {},
  10735. ],
  10736. 79: [
  10737. function (e, t, i) {
  10738. "use strict";
  10739. var n = e("./TermsEvent"),
  10740. r = e("../../localization/localize"),
  10741. o = e("../../analytics"),
  10742. a = e("../../util/ajax"),
  10743. s = e("../../util/common"),
  10744. l = e("events").EventEmitter,
  10745. c = document.getElementById("terms-modal"),
  10746. h = {
  10747. init: function () {
  10748. $(".footer-terms").on(
  10749. "click",
  10750. function (e) {
  10751. e.preventDefault(), this.show();
  10752. }.bind(this)
  10753. ),
  10754. $("#terms-modal .close").on("click", this.hide.bind(this));
  10755. },
  10756. show: function () {
  10757. this.emit(n.OPENED),
  10758. a
  10759. .get("static/" + r.TERMS_TEXT_FILE)
  10760. .done(function (e) {
  10761. var t = $("#terms-text").html(e);
  10762. o.track("showcase_gui", {
  10763. gui_action: "click_terms_button",
  10764. interaction_source: "gui",
  10765. }),
  10766. t.find("a").attr("target", "_blank");
  10767. })
  10768. .fail(function () {
  10769. $("#terms-text").html(
  10770. "<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL
  10771. );
  10772. }),
  10773. c.classList.add("fadeIn");
  10774. },
  10775. hide: function (e) {
  10776. e && e.preventDefault(),
  10777. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  10778. c.classList.remove("fadeIn");
  10779. },
  10780. };
  10781. s.extendObject(h, l.prototype), (t.exports = h);
  10782. },
  10783. {
  10784. "../../analytics": 4,
  10785. "../../localization/localize": 108,
  10786. "../../util/ajax": 181,
  10787. "../../util/common": 185,
  10788. "./TermsEvent": 78,
  10789. events: 202,
  10790. },
  10791. ],
  10792. 80: [
  10793. function (e, t, i) {
  10794. "use strict";
  10795. t.exports = Object.freeze({
  10796. OPEN_INFO: "title.open.info",
  10797. CLOSE_INFO: "title.close.info",
  10798. SHOW_INFO: "title.show.info",
  10799. HIDE_INFO: "title.hide.info",
  10800. LINK_CLICKED: "title.link.click",
  10801. CONTACT_LINK_CLICKED: "title.contact.click",
  10802. ORIGIN_LINK_CLICKED: "title.origin.click",
  10803. });
  10804. },
  10805. {},
  10806. ],
  10807. 81: [
  10808. function (e, t, i) {
  10809. "use strict";
  10810. function n(e, t) {
  10811. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t);
  10812. }
  10813. function r(e, t) {
  10814. function i(i) {
  10815. (e.shouldShowtags = "show" === this.value),
  10816. e.shouldShowtags
  10817. ? t.showAlltags(o.tags.startup.fadeInDuration)
  10818. : t.hideAlltags(o.tags.startup.fadeInDuration);
  10819. }
  10820. document.getElementById("tag-toggles").classList.remove("hidden"),
  10821. (document.getElementById("radio-tag-show").checked = !0);
  10822. for (
  10823. var n = document
  10824. .getElementById("tag-inputs")
  10825. .querySelectorAll("input"),
  10826. r = 0;
  10827. r < n.length;
  10828. r++
  10829. )
  10830. n[r].addEventListener("change", i);
  10831. }
  10832. var o = e("../../settings");
  10833. t.exports.init = n;
  10834. },
  10835. {
  10836. "../../settings": 166,
  10837. },
  10838. ],
  10839. 82: [
  10840. function (e, t, i) {
  10841. (function (i) {
  10842. "use strict";
  10843. function n(e, t) {
  10844. return e &&
  10845. u.valueFromHash("title", 1) &&
  10846. 2 !== u.valueFromHash("mls", 0)
  10847. ? ((document.getElementsByClassName("titleText")[0].innerText =
  10848. e),
  10849. (g_weixinObj.title = e),
  10850. e.length > g.minTooltipCharacters &&
  10851. I.parentElement.setAttribute("data-original-title", e),
  10852. t && 1 !== m.specialEdition && m.brand && !m.mls
  10853. ? (document.getElementById("cobrandTitle").innerText = t)
  10854. : (document
  10855. .getElementsByClassName("co-brand")[0]
  10856. .classList.add("hidden"),
  10857. document
  10858. .getElementById("gui-name")
  10859. .classList.add("noCoBrand"),
  10860. document
  10861. .getElementById("cobrandTitle")
  10862. .classList.add("hidden")),
  10863. !0)
  10864. : (document.getElementById("model-title").classList.add("hidden"),
  10865. !1);
  10866. }
  10867. function r(e) {
  10868. return e
  10869. ? ((L = !0), void (_.innerHTML = e))
  10870. : void _.classList.add("hidden");
  10871. }
  10872. function o(e, t, i, n) {
  10873. if ((!e && !t && !i) || !m.brand || u.valueFromHash("mls", !1))
  10874. return void T.classList.add("hidden");
  10875. L = !0;
  10876. var r = [],
  10877. o = c(r, "<br>");
  10878. if ((e && o('<span id="contactName">' + e + "</span>"), t)) {
  10879. var a = n || t,
  10880. s = u.isMobile()
  10881. ? '<a id="phone" href="callto:' + t + '">' + a + "</a>"
  10882. : "<span>" + a + "</span>";
  10883. o(s);
  10884. }
  10885. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  10886. (r[0] = ""),
  10887. (x.innerHTML = r.join(""));
  10888. }
  10889. function a(e) {
  10890. if ("string" == typeof e)
  10891. try {
  10892. e = JSON.parse(e);
  10893. } catch (e) {
  10894. return (
  10895. y.warn("Unable to parse address data"),
  10896. void S.parentElement.classList.add("hidden")
  10897. );
  10898. }
  10899. if (
  10900. !(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip))
  10901. )
  10902. return void S.parentElement.classList.add("hidden");
  10903. L = !0;
  10904. var t = [],
  10905. i = c(t, " ");
  10906. e.address_1 && i(e.address_1),
  10907. e.address_2 && i(e.address_2),
  10908. e.city && i(e.city, ", "),
  10909. e.state && i(e.state, ", "),
  10910. e.zip && i(e.zip, e.state ? " " : ", "),
  10911. (t[0] = ""),
  10912. (S.innerText = t.join(""));
  10913. }
  10914. function s(e) {
  10915. var t = document.createElement("a");
  10916. return (
  10917. (t.id = "url"),
  10918. (t.target = "_blank"),
  10919. (t.href = e),
  10920. (t.innerText = e),
  10921. t.addEventListener(
  10922. "click",
  10923. N.emit.bind(N, v.ORIGIN_LINK_CLICKED)
  10924. ),
  10925. t
  10926. );
  10927. }
  10928. function l(e) {
  10929. return (
  10930. !(!e || (u.inIframe() && document.referrer === e)) &&
  10931. (R.classList.remove("hidden"),
  10932. (P.innerHTML = f.WEBVR_LEARN_MORE + ": "),
  10933. P.appendChild(s(e)),
  10934. O.forEach(function (e) {
  10935. e.classList.add("share-link");
  10936. }),
  10937. !0)
  10938. );
  10939. }
  10940. function c(e, t) {
  10941. var i = e,
  10942. n = t;
  10943. return function (e, t) {
  10944. i.push(t || n, e);
  10945. };
  10946. }
  10947. function h() {
  10948. document
  10949. .getElementById("title-toggle")
  10950. .addEventListener("click", N.toggleTitle.bind(N)),
  10951. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  10952. var e = [].slice.call(_.querySelectorAll("a"));
  10953. e.forEach(function (e) {
  10954. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED));
  10955. });
  10956. var t = [].slice.call(T.querySelectorAll("a"));
  10957. t.forEach(function (e) {
  10958. e.addEventListener(
  10959. "click",
  10960. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  10961. contact_type: e.getAttribute("id"),
  10962. })
  10963. );
  10964. });
  10965. }
  10966. var u = e("../../util/browser"),
  10967. d = e("../../util/common"),
  10968. p = e("../../util/logger"),
  10969. f = e("../../localization/localize"),
  10970. g = e("./titleBarSettings"),
  10971. m = e("../../settings"),
  10972. v = e("./TitleEvents"),
  10973. A = e("events").EventEmitter,
  10974. y = new p(i),
  10975. C = document.querySelector(".pinTop.left"),
  10976. I = document.getElementsByClassName("title-container")[0],
  10977. E = document.getElementById("title-toggle").querySelector("i"),
  10978. b = document.getElementById("meta-info-wrapper"),
  10979. w = document.getElementById("meta-info"),
  10980. _ = document.getElementById("meta-description"),
  10981. T = document.getElementsByClassName("contact-info")[0],
  10982. x = document.getElementById("contact-data"),
  10983. S = document.getElementById("addressTxt"),
  10984. M = document.getElementById("tag-toggles"),
  10985. R = document.getElementById("share-origin"),
  10986. P = document.getElementById("share-link-wrapper"),
  10987. O = [w, b, I],
  10988. L = !1,
  10989. D = !1,
  10990. N = {
  10991. populate: function (e) {
  10992. if (n(window.DATA.name, e.coBrand)) {
  10993. if (
  10994. (r(e.description),
  10995. o(
  10996. e.contactName,
  10997. e.phone,
  10998. e.email,
  10999. e.formatted_contact_phone
  11000. ),
  11001. a(e.address),
  11002. L)
  11003. ) {
  11004. var t = document.createElement("br");
  11005. M.insertBefore(t, M.firstElementChild);
  11006. }
  11007. e.socialSharing && m.share.enabled && (D = l(e.url));
  11008. }
  11009. },
  11010. finishSetup: function (e) {
  11011. (L = L || !!e),
  11012. h(),
  11013. L ||
  11014. (D
  11015. ? I.classList.add("share-only")
  11016. : I.classList.add("no-meta"));
  11017. },
  11018. toggleMeta: function (e, t) {
  11019. var title = document.getElementById("model-title");
  11020. t && t.preventDefault();
  11021. var i = w.classList.contains("expand");
  11022. (e && !i) ||
  11023. (i
  11024. ? (O.forEach(function (e) {
  11025. e.classList.remove("expand");
  11026. }),
  11027. this.emit(v.CLOSE_INFO),
  11028. title.classList.remove("expand"))
  11029. : (O.forEach(function (e) {
  11030. e.classList.add("expand");
  11031. }),
  11032. title.classList.add("expand"),
  11033. this.emit(v.OPEN_INFO)));
  11034. },
  11035. setupToggling: function () {
  11036. (b.style.height = w.offsetHeight + "px"),
  11037. w.addEventListener("transitionend", function () {
  11038. b.style.height = w.offsetHeight + "px";
  11039. });
  11040. },
  11041. toggleTitle: function (e) {
  11042. e && e.preventDefault(),
  11043. C.classList.contains("closed")
  11044. ? (C.classList.add("open"),
  11045. E.classList.remove("icon-dpad-right"),
  11046. E.classList.add("icon-dpad-left"),
  11047. this.emit(v.SHOW_INFO),
  11048. setTimeout(function () {
  11049. C.classList.remove("closed"),
  11050. C.classList.remove("open");
  11051. }, g.removeAnimationClasses))
  11052. : (C.classList.add("closed"),
  11053. E.classList.remove("icon-dpad-left"),
  11054. E.classList.add("icon-dpad-right"),
  11055. this.emit(v.HIDE_INFO));
  11056. },
  11057. };
  11058. d.extendObject(N, A.prototype), (t.exports = N);
  11059. }).call(this, "/js/gui/title/titleBar.js");
  11060. },
  11061. {
  11062. "../../localization/localize": 108,
  11063. "../../settings": 166,
  11064. "../../util/browser": 182,
  11065. "../../util/common": 185,
  11066. "../../util/logger": 189,
  11067. "./TitleEvents": 80,
  11068. "./titleBarSettings": 83,
  11069. events: 202,
  11070. },
  11071. ],
  11072. 83: [
  11073. function (e, t, i) {
  11074. "use strict";
  11075. t.exports = Object.freeze({
  11076. minTooltipCharacters: 19,
  11077. removeAnimationClasses: 500,
  11078. });
  11079. },
  11080. {},
  11081. ],
  11082. 84: [
  11083. function (e, t, i) {
  11084. "use strict";
  11085. function n(e) {
  11086. (C = e),
  11087. P.forEach(function (e) {
  11088. b.addEventListener(e, u.bind(this, !1), !0),
  11089. w.addEventListener(e, u.bind(this, !0), !0),
  11090. E.addEventListener(e, o, !0);
  11091. S.forEach(function (t) {
  11092. //会触发导览停止
  11093. t.addEventListener(e, a, !0);
  11094. });
  11095. $("#drawer img").on(e, a);
  11096. });
  11097. document.addEventListener("keydown", u.bind(this, !1), !0);
  11098. C.on(v.TourStart, function () {
  11099. E.classList.add("playing");
  11100. });
  11101. }
  11102. function r() {
  11103. // C.playTour(),
  11104. C.playTourNearBy(),
  11105. I && clearTimeout(I),
  11106. d(),
  11107. _.removeClass("fadeIn");
  11108. }
  11109. function o() {
  11110. E.classList.contains("playing") &&
  11111. (C.stopTour(),
  11112. _.addClass("fadeIn"),
  11113. setTimeout(function () {
  11114. _.removeClass("fadeIn");
  11115. }, p.tourInteraction.showPauseButton),
  11116. O ||
  11117. (clearTimeout(I),
  11118. (I = setTimeout(h, p.tourInteraction.showModal))),
  11119. setTimeout(function () {
  11120. E.classList.remove("playing");
  11121. }, p.tourInteraction.allowNextClick));
  11122. }
  11123. function a() {
  11124. C.tourInProgress &&
  11125. (C.stopTour(), C.endTourProgress(), E.classList.remove("playing"));
  11126. }
  11127. function s() {
  11128. T.is(":visible") ? r() : o();
  11129. }
  11130. function l() {
  11131. x.hasClass("playing") &&
  11132. (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass("fadeIn"));
  11133. }
  11134. function c() {
  11135. E.classList.remove("playing"), h();
  11136. }
  11137. function h() {
  11138. //去掉导览结束时的提示
  11139. /* if (!p.tourInteraction.disabled) {
  11140. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  11141. M.addClass("fadeIn tour " + m.deviceType);
  11142. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  11143. if (!p.tourInteraction.smallModal) {
  11144. var t;
  11145. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  11146. m.fill(R, A.TOUR_INTERACTION[t]),
  11147. M.addClass(t)
  11148. }
  11149. M.addClass(e)
  11150. } */
  11151. }
  11152. function u(e, t) {
  11153. if (t) {
  11154. var i = "keydown" === t.type,
  11155. n = t.which === f.SPACE || C.tourIsPlaying;
  11156. (i && n) || e || (O = !0),
  11157. C.atEndOfTour() && d(),
  11158. !C.tourIsPlaying &&
  11159. C.tourInProgress &&
  11160. (_.removeClass("fadeIn"), d(), t.which !== f.SPACE && a()),
  11161. i && n && s();
  11162. }
  11163. }
  11164. function d() {
  11165. M.removeClass("fadeIn");
  11166. }
  11167. var p = (e("../util/browser"), e("../settings")),
  11168. f = e("../enum/Keys"),
  11169. g = e("../enum/Viewmode"),
  11170. m = (e("./helpManager"), e("./populateModal")),
  11171. v = e("../enum/DirectorEvents"),
  11172. A = e("../enum/HelpModalType"),
  11173. y = e("../enum/HelpModalSize"),
  11174. C = null,
  11175. I = null,
  11176. E = document.getElementById("pause-overlay"),
  11177. b = document.getElementById("player"),
  11178. w = document.getElementById("gui"),
  11179. _ = $("#pause-icon").eq(0),
  11180. T = $("#play").eq(0),
  11181. x = $("#playHead").eq(0),
  11182. S = $(
  11183. ".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan"
  11184. ).toArray(),
  11185. M = $("#interaction-modal").eq(0),
  11186. R = $("#interaction-modal .interaction").toArray(),
  11187. P = ["touchstart", "mousedown", "pointerdown"],
  11188. O = !1;
  11189. (t.exports.init = n),
  11190. (t.exports.play = r),
  11191. (t.exports.pause = o),
  11192. (t.exports.pauseWithoutCTA = a),
  11193. (t.exports.togglePlay = s),
  11194. (t.exports.stopTour = l),
  11195. (t.exports.dismissModal = d);
  11196. },
  11197. {
  11198. "../enum/DirectorEvents": 23,
  11199. "../enum/HelpModalSize": 27,
  11200. "../enum/HelpModalType": 28,
  11201. "../enum/Keys": 30,
  11202. "../enum/Viewmode": 51,
  11203. "../settings": 166,
  11204. "../util/browser": 182,
  11205. "./helpManager": 68,
  11206. "./populateModal": 75,
  11207. },
  11208. ],
  11209. 85: [
  11210. function (e, t, i) {
  11211. "use strict";
  11212. t.exports = Object.freeze({
  11213. OPENED: "vr.modal.opened",
  11214. LAUNCH: "vr.modal.launch",
  11215. CLOSED: "vr.modal.closed",
  11216. NEXT: "vr.modal.next",
  11217. PREV: "vr.modal.prev",
  11218. STORE: "vr.modal.store",
  11219. falseICECHOSEN: "vr.modal.device",
  11220. });
  11221. },
  11222. {},
  11223. ],
  11224. 86: [
  11225. function (e, t, i) {
  11226. "use strict";
  11227. function n(e, t, i) {
  11228. function n(e, t, n, r) {
  11229. function o() {
  11230. return p + "&m=" + t + "&display=" + e;
  11231. }
  11232. function s() {
  11233. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct"),
  11234. t = "&utm_source=" + u,
  11235. n = "&utm_showcase_session_id=" + i;
  11236. return e + t + n;
  11237. }
  11238. function l() {
  11239. return (
  11240. d +
  11241. "&sids=" +
  11242. t +
  11243. "&lsid=" +
  11244. t +
  11245. "&ln=" +
  11246. encodeURIComponent(n) +
  11247. "&ld=" +
  11248. encodeURIComponent(r) +
  11249. "&display=" +
  11250. e
  11251. );
  11252. }
  11253. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s();
  11254. }
  11255. function r(e, t, i, r) {
  11256. var o = "https://api.branch.io/v1/url",
  11257. a = n(e, t, i, r),
  11258. s = {
  11259. responseType: "json",
  11260. data: {
  11261. branch_key: h.appConfig.branch_key,
  11262. data: {
  11263. m: t,
  11264. full_url: a,
  11265. $desktop_url: m,
  11266. $og_app_id: "331853976762864119",
  11267. $og_title: i,
  11268. $og_description: r,
  11269. $og_image_url:
  11270. location.origin + "/api/v1/player/models/" + t + "/thumb",
  11271. $canonical_url: window.location.href,
  11272. },
  11273. },
  11274. };
  11275. c.post(o, s)
  11276. .done(function (t) {
  11277. f[e] = t.url;
  11278. })
  11279. .fail(
  11280. function (t) {
  11281. f[e] = t;
  11282. }.bind(this, a)
  11283. );
  11284. }
  11285. function o(e, t, i) {
  11286. for (var r in s) {
  11287. var o = s[r],
  11288. a = n(o, e, t, i);
  11289. f[o] = a;
  11290. }
  11291. }
  11292. var u = a.inIframe()
  11293. ? encodeURIComponent(document.referrer)
  11294. : encodeURIComponent(window.location.href),
  11295. d = g + "/vr/dlist/?ret=" + u,
  11296. p = g + "/vr/show/?ret=" + u,
  11297. m = "";
  11298. switch (e) {
  11299. case l.IOS:
  11300. r(s.CardboardIOS, t.sid, t.name, t.summary);
  11301. break;
  11302. default:
  11303. o(t.sid, t.name, t.summary);
  11304. }
  11305. }
  11306. function r(e) {
  11307. var t = f[e];
  11308. window.open(t, "_blank");
  11309. }
  11310. function o(e) {
  11311. var t = u[e];
  11312. window.open(t, "_blank");
  11313. }
  11314. var a = e("../../util/browser"),
  11315. s = e("../../enum/VRApps"),
  11316. l = e("../../enum/VRPlatforms"),
  11317. c = e("../../util/ajax"),
  11318. h = e("../../settings"),
  11319. u = {};
  11320. (u[s.CardboardAndroid] =
  11321. "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri="),
  11322. (u[s.CardboardIOS] =
  11323. "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri="),
  11324. (u[s.GearVR] =
  11325. "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=");
  11326. for (var d in s) {
  11327. var p = s[d];
  11328. u[p] += encodeURIComponent(document.referrer + "&display=" + p);
  11329. }
  11330. var f = {},
  11331. g = (function () {
  11332. var e = window.location.host;
  11333. return (
  11334. e.indexOf(".port.com") === -1 &&
  11335. e.indexOf("localhost") === -1 &&
  11336. (e = "my.port.com"),
  11337. "https://" + e
  11338. );
  11339. })();
  11340. (t.exports.init = n),
  11341. (t.exports.launch = r),
  11342. (t.exports.launchStore = o);
  11343. },
  11344. {
  11345. "../../enum/VRApps": 46,
  11346. "../../enum/VRPlatforms": 49,
  11347. "../../settings": 166,
  11348. "../../util/ajax": 181,
  11349. "../../util/browser": 182,
  11350. },
  11351. ],
  11352. 87: [
  11353. function (e, t, i) {
  11354. "use strict";
  11355. function n(e) {
  11356. var t;
  11357. switch (e) {
  11358. case m.IOS:
  11359. return (
  11360. (t = p.iosVersion()),
  11361. t.major > 9 || (9 === t.major && t.minor >= 1)
  11362. );
  11363. case m.Android:
  11364. return (
  11365. (t = p.androidVersion()),
  11366. t.major > 4 ||
  11367. (4 === t.major && t.minor > 4) ||
  11368. (4 === t.major && 4 === t.minor && t.patch >= 4)
  11369. );
  11370. }
  11371. return !1;
  11372. }
  11373. function r(e, t) {
  11374. function i(e) {
  11375. K.emit(A.STORE, {
  11376. type: e,
  11377. }),
  11378. f.launchStore(e);
  11379. }
  11380. function r(e) {
  11381. switch (
  11382. (e !== _.pageCount && (a(e), N.text(e + 1 + " / " + _.pageCount)),
  11383. e)
  11384. ) {
  11385. case _.Title:
  11386. O.css("display", "none"), L.text(u[e]), o(s);
  11387. break;
  11388. case _.Cardboard:
  11389. O.css("display", "block"),
  11390. L.text(u[e]),
  11391. M.filter(".cardboard").off(),
  11392. M.filter(".gearvr").off(),
  11393. c(e, s),
  11394. h(H, X, Z);
  11395. break;
  11396. case _.Gear:
  11397. L.text(u[e]), c(e, s), T.addClass("lastPage"), h(G, X, Z);
  11398. break;
  11399. case _.pageCount:
  11400. T.removeClass("fadeIn"), K.emit(A.CLOSED);
  11401. }
  11402. B.filter("[src='']").hide();
  11403. }
  11404. var s = (function () {
  11405. return p.detectAndroid()
  11406. ? p.detectAndroidMobile() && n(m.Android)
  11407. ? (T.addClass("supported"), (w = ".show-supported"), m.Android)
  11408. : (T.addClass("unsupported"),
  11409. (w = ".show-unsupported"),
  11410. m.UnsupportedAndroid)
  11411. : p.detectIPhone() || p.detectIPod()
  11412. ? (T.addClass("ios"), (w = ".show-ios"), (_ = v.ios), m.IOS)
  11413. : (T.addClass("desktop"), (w = ".show-desktop"), m.Desktop);
  11414. })();
  11415. f.init(s, e, t), s !== m.Desktop && T.addClass("mobile");
  11416. var l = function (e) {
  11417. K.emit(A.LAUNCH, {
  11418. vr_platform: s,
  11419. vr_app: e,
  11420. }),
  11421. f.launch(e);
  11422. };
  11423. (q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  11424. (q.gear = l.bind(this, g.GearVR)),
  11425. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  11426. d(),
  11427. $(
  11428. ".show-supported, .show-unsupported, .show-ios, .show-desktop"
  11429. ).hide(),
  11430. $(w).show();
  11431. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  11432. y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  11433. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  11434. $("#vr").on("click", function (e) {
  11435. e.preventDefault();
  11436. player.FlyToMode("panorama", () => {
  11437. if (!window.vrEnabled) {
  11438. // 开启VR
  11439. window.vrEnabled = true;
  11440. this.classList.add("active");
  11441. $("#gui div").not("#vrOff").addClass("vrHide");
  11442. $("#vrOffImg").css({ display: "inline-block" });
  11443. } else {
  11444. }
  11445. });
  11446. });
  11447. let exitVR = function () {
  11448. $("#gui div").not("#vrOff").removeClass("vrHide");
  11449. $("#vrOffImg").css({ display: "none" });
  11450. $("#player canvas").css({ width: "", height: "" }); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  11451. $("#vr").removeClass("active"); // 清除vr按钮的激活样式
  11452. };
  11453. $("#vrOff").on("click", function () {
  11454. window.vrEnabled = false;
  11455. exitVR();
  11456. });
  11457. window.bus.addEventListener("exitWebXR", (e) => {
  11458. exitVR();
  11459. });
  11460. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  11461. s === m.IOS
  11462. ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS))
  11463. : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  11464. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  11465. $("span.modelLink").text(I),
  11466. O.on("click", function (e) {
  11467. K.emit(A.PREV), b--, r(b);
  11468. }),
  11469. L.on("click", function (e) {
  11470. L.text();
  11471. K.emit(A.NEXT, {
  11472. nextAction: y[b],
  11473. }),
  11474. b++,
  11475. r(b);
  11476. }),
  11477. T.find(".close").on("click", K.dismiss);
  11478. }
  11479. function o(e) {
  11480. switch (e) {
  11481. case m.Android:
  11482. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  11483. M.filter(".gearvr").off().on("click", q.gear),
  11484. s(H, G, "logo-button", "same-line");
  11485. break;
  11486. case m.UnsupportedAndroid:
  11487. s("", z, "", "");
  11488. break;
  11489. case m.IOS:
  11490. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  11491. s(H, "", "logo-button", "");
  11492. break;
  11493. case m.Desktop:
  11494. M.filter(".cardboard")
  11495. .off()
  11496. .on("click", l.bind(this, null, F, U)),
  11497. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  11498. s(H, G, "logo-button", "same-line"),
  11499. Q.cardboard();
  11500. }
  11501. }
  11502. function a(e) {
  11503. $(".p1, .p2, .p3").hide(),
  11504. x.insertAfter(S),
  11505. T.removeClass("front-page"),
  11506. T.removeClass("details-page"),
  11507. T.removeClass("lastPage"),
  11508. M.removeClass("logo-button"),
  11509. M.removeClass("same-line"),
  11510. S.removeClass("headsetOptions"),
  11511. R.attr("src", ""),
  11512. R.filter(".second").removeClass("gear"),
  11513. R.css("display", "inline-block"),
  11514. R.off(),
  11515. P.filter(".second").css("display", ""),
  11516. D.css("display", "none"),
  11517. $(".p" + (e + 1) + w).show(),
  11518. R.filter(".third").insertBefore(P.filter(".third"));
  11519. }
  11520. function s(e, t, i, n) {
  11521. T.addClass("front-page"),
  11522. R.filter(".first").attr("src", e),
  11523. R.filter(".second").attr("src", t),
  11524. M.filter(".first").addClass(i),
  11525. M.filter(".second").addClass(i),
  11526. M.addClass(n),
  11527. ".show-desktop" === w && S.insertAfter(x);
  11528. }
  11529. function l(e, t, i) {
  11530. S.addClass("headsetOptions"),
  11531. M.off(),
  11532. R.filter(".second").attr("src", t),
  11533. D.css("display", "block"),
  11534. P.filter(".second").css("display", "none"),
  11535. D.on("click", function () {
  11536. a(_.Title), o(m.Desktop);
  11537. }),
  11538. e &&
  11539. (K.emit(A.falseICECHOSEN, {
  11540. name: g.GearVR,
  11541. }),
  11542. R.filter(".first").attr("src", e),
  11543. R.filter(".second").addClass("gear"),
  11544. R.filter(".second").on(
  11545. "click",
  11546. f.launchStore.bind(this, g.GearVR)
  11547. ),
  11548. Q.gearvr()),
  11549. i &&
  11550. (K.emit(A.falseICECHOSEN, {
  11551. name: g.Cardboard,
  11552. }),
  11553. R.filter(".third").attr("src", i),
  11554. R.filter(".third").show(),
  11555. R.filter(".third").insertAfter(R.filter(".second")),
  11556. R.filter(".third").addClass("link"),
  11557. R.filter(".second").addClass("link"),
  11558. R.filter(".second").on(
  11559. "click",
  11560. f.launchStore.bind(this, g.CardboardIOS)
  11561. ),
  11562. R.filter(".third").on(
  11563. "click",
  11564. f.launchStore.bind(this, g.CardboardAndroid)
  11565. ),
  11566. Q.cardboard());
  11567. }
  11568. function c(e, t) {
  11569. switch (t) {
  11570. case m.IOS:
  11571. (X = Y), (Z = j);
  11572. break;
  11573. case m.Desktop:
  11574. e === _.Cardboard
  11575. ? ((X = F),
  11576. (Z = U),
  11577. R.filter(".second").on(
  11578. "click",
  11579. f.launchStore.bind(this, g.CardboardIOS)
  11580. ),
  11581. R.filter(".third").on(
  11582. "click",
  11583. f.launchStore.bind(this, g.CardboardAndroid)
  11584. ))
  11585. : ((X = V),
  11586. R.filter(".second").on(
  11587. "click",
  11588. f.launchStore.bind(this, g.GearVR)
  11589. ),
  11590. (Z = ""));
  11591. break;
  11592. default:
  11593. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W));
  11594. }
  11595. }
  11596. function h(e, t, i) {
  11597. T.find(".inner").addClass("details-page"),
  11598. T.addClass("details-page"),
  11599. R.filter(".first").attr("src", e),
  11600. R.filter(".second").attr("src", t),
  11601. R.filter(".third").attr("src", i);
  11602. }
  11603. function u() {
  11604. T.hasClass("fadeIn") && (T.removeClass("fadeIn"), K.emit(A.CLOSED));
  11605. }
  11606. function d() {
  11607. var e = p.aspectRatio() > 1 && p.isMobile();
  11608. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  11609. T.toggleClass(
  11610. "tiny",
  11611. $("#player").height() <= y.narrowLandscapeHeight
  11612. ),
  11613. T.toggleClass(
  11614. "tinier",
  11615. $("#player").height() <= y.reallyNarrowLandscapeHeight
  11616. );
  11617. }
  11618. var p = e("../../util/browser"),
  11619. f = e("./vrLink"),
  11620. g = e("../../enum/VRApps"),
  11621. m = e("../../enum/VRPlatforms"),
  11622. v = e("../../enum/VRPages"),
  11623. A = e("./vrEvent"),
  11624. y = (e("../../settings"), e("../../constants")),
  11625. C = e("../../localization/localize"),
  11626. I = e("../../util/common"),
  11627. E = e("events").EventEmitter,
  11628. b = 0,
  11629. w = null,
  11630. _ = v.standard,
  11631. T = $(".vr-popup"),
  11632. x = T.find(".vr-popup-body"),
  11633. S = T.find(".vr-images"),
  11634. M = T.find(".img-container"),
  11635. R = T.find(".vr-sm-image"),
  11636. P = M.find(".vr-img-caption"),
  11637. O = $(".vr-buttons").find(".prev-button"),
  11638. L = $(".vr-buttons").find(".next-button"),
  11639. D = S.find(".front-close"),
  11640. N = $(".vr-page"),
  11641. B = T.find("img"),
  11642. F = "static/images/apple-store.png",
  11643. V = "static/images/badge-oculus.png",
  11644. U = "static/images/badge-cardboard.png",
  11645. k = "static/images/logo-samsung.png",
  11646. H = "static/images/headset-cardboard.png",
  11647. G = "static/images/headset-gearvr.png",
  11648. z = "static/images/ico-android-robot.png",
  11649. W = "static/images/ico-gearvr.png",
  11650. j = "static/images/ico-vr.png",
  11651. Y = "static/images/apple-logo-white.svg",
  11652. X = null,
  11653. Z = null,
  11654. q = {},
  11655. K = {
  11656. init: r,
  11657. dismiss: u,
  11658. isDeviceSupported: n,
  11659. };
  11660. I.extendObject(K, E.prototype), $(window).resize(d);
  11661. var Q = (function () {
  11662. var e = P.filter(".first").find(".cardboard"),
  11663. t = P.filter(".first").find(".gearvr");
  11664. return {
  11665. cardboard: function () {
  11666. t.addClass("hidden"), e.removeClass("hidden");
  11667. },
  11668. gearvr: function () {
  11669. e.addClass("hidden"), t.removeClass("hidden");
  11670. },
  11671. };
  11672. })();
  11673. t.exports = K;
  11674. },
  11675. {
  11676. "../../constants": 8,
  11677. "../../enum/VRApps": 46,
  11678. "../../enum/VRPages": 48,
  11679. "../../enum/VRPlatforms": 49,
  11680. "../../localization/localize": 108,
  11681. "../../settings": 166,
  11682. "../../util/browser": 182,
  11683. "../../util/common": 185,
  11684. "./vrEvent": 85,
  11685. "./vrLink": 86,
  11686. events: 202,
  11687. },
  11688. ],
  11689. 88: [
  11690. function (e, t, i) {
  11691. "use strict";
  11692. t.exports = Object.freeze({
  11693. OPENED: "webvr.modal.opened",
  11694. SHOW_TERMS: "webvr.footer.show.terms",
  11695. });
  11696. },
  11697. {},
  11698. ],
  11699. 89: [
  11700. function (e, t, i) {
  11701. (function (i) {
  11702. "use strict";
  11703. function n(e, t, i, n) {
  11704. function r(e) {
  11705. e.preventDefault(), a(e.currentTarget.id);
  11706. }
  11707. function a(e) {
  11708. ne[e](),
  11709. Object.keys(ne).map(function (t, i) {
  11710. $("#" + t).toggleClass("tabs-underlined", t === e);
  11711. });
  11712. }
  11713. (y = i), (v = t), w.init(E.Android, e, n), m();
  11714. var l = new RegExp("daydream", "i"),
  11715. c = l.test(y.displayName);
  11716. c
  11717. ? (a("tabdaydream"),
  11718. B.filter(".device-headset-side").attr("src", H),
  11719. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM")))
  11720. : (a("tabcardboard"),
  11721. B.filter(".device-headset-side").attr("src", Y),
  11722. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  11723. $("#vr").on("click", function (e) {
  11724. e.preventDefault(),
  11725. g("click_webvr_button"),
  11726. L.is(":hidden") && (ie.emit(_.OPENED), o());
  11727. }),
  11728. $(".webvr-popup .close").on("click", function (e) {
  11729. e.preventDefault(),
  11730. D.hasClass("hidden") ? (g("webvr_help_close"), p()) : s();
  11731. }),
  11732. $("#tabcardboard").on("click", r),
  11733. $("#tabdaydream").on("click", r),
  11734. $("#tabnative").on("click", r),
  11735. $(".webvr-popup .open-with-app").on("click", function (e) {
  11736. e.preventDefault(), g("webvr_learn_more"), a("tabnative"), p();
  11737. }),
  11738. $(".webvr-popup .help").on("click", function (e) {
  11739. e.preventDefault(),
  11740. g(
  11741. D.hasClass("hidden")
  11742. ? "webvr_help_close"
  11743. : "webvr_help_show"
  11744. ),
  11745. p();
  11746. }),
  11747. $(".webvr-popup .terms").on("click", function (e) {
  11748. e.preventDefault(),
  11749. g("webvr_click_terms"),
  11750. s(),
  11751. ie.emit(_.SHOW_TERMS);
  11752. }),
  11753. F.on("click", function (e) {
  11754. e.preventDefault(), g(ee), window.open(J, "_blank");
  11755. }),
  11756. V.on("click", function (e) {
  11757. e.preventDefault(),
  11758. g("webvr_phone_link"),
  11759. window.open(te, "_blank");
  11760. }),
  11761. $(".webvr-popup .badge-cardboard").on("click", function (e) {
  11762. e.preventDefault(),
  11763. g("webvr_cardboard_link"),
  11764. w.launch(b.CardboardAndroid);
  11765. }),
  11766. $(".webvr-popup .badge-oculus").on("click", function (e) {
  11767. e.preventDefault(), g("webvr_oculus_link"), w.launch(b.GearVR);
  11768. });
  11769. }
  11770. function r() {
  11771. function e() {
  11772. y.isPresenting ||
  11773. (f(), window.removeEventListener("vrdisplaypresentchange", e));
  11774. }
  11775. R.info("Headset mounted"), v.suspend();
  11776. var t = document.createElement("canvas");
  11777. for (
  11778. t.getContext("webgl"),
  11779. t.className = "webvr-canvas",
  11780. document.bgColor = "#000",
  11781. document.body.style.backgroundColor = "#000";
  11782. document.body.firstChild;
  11783. )
  11784. document.body.removeChild(document.body.firstChild);
  11785. document.body.appendChild(t),
  11786. g("webvr_enter_app"),
  11787. y
  11788. .requestPresent([
  11789. {
  11790. source: t,
  11791. predistorted: !0,
  11792. },
  11793. ])
  11794. .catch(function (t) {
  11795. R.error("Failed to present: " + t),
  11796. g("webvr_exit_calibrate"),
  11797. e();
  11798. }),
  11799. A.then(function () {
  11800. window.dispatchEvent(new Event("vrapp-start"));
  11801. }),
  11802. window.addEventListener("vrdisplaypresentchange", e);
  11803. }
  11804. function o() {
  11805. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a();
  11806. }
  11807. function a() {
  11808. if (!A) {
  11809. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version,
  11810. t = "https://static.port.com/webvr/" + e + "/js/main.js";
  11811. A = new Promise(function (e, i) {
  11812. var n = document.createElement("script");
  11813. (n.type = "text/javascript"),
  11814. (n.src = t),
  11815. (n.onload = e),
  11816. document.head.appendChild(n);
  11817. });
  11818. }
  11819. D.find(".enter-button").on("click", r);
  11820. }
  11821. function s() {
  11822. g("webvr_modal_close"),
  11823. D.find(".enter-button").off("click", r),
  11824. L.fadeOut(I.guiAnimationSpeed, function () {
  11825. D.toggleClass("hidden", !1),
  11826. N.toggleClass("hidden", !0),
  11827. C.exitFullscreen();
  11828. }),
  11829. O.fadeIn(I.guiAnimationSpeed);
  11830. }
  11831. function l() {
  11832. k.toggleClass("hidden", !1), U.toggleClass("hidden", !0);
  11833. }
  11834. function c() {
  11835. k.toggleClass("hidden", !0), U.toggleClass("hidden", !1);
  11836. }
  11837. function h() {
  11838. B.filter(".device-headset").attr("src", G),
  11839. B.filter(".device-phone").attr("src", z),
  11840. (J = Z),
  11841. (ee = K),
  11842. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  11843. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  11844. $(".webvr-popup .detail.daydream-label").toggleClass(
  11845. "hidden",
  11846. !1
  11847. ),
  11848. c();
  11849. }
  11850. function u() {
  11851. B.filter(".badge-cardboard").attr("src", j),
  11852. B.filter(".badge-oculus").attr("src", X),
  11853. l();
  11854. }
  11855. function d() {
  11856. B.filter(".device-headset").attr("src", Y),
  11857. B.filter(".device-phone").attr("src", W),
  11858. (J = q),
  11859. (ee = Q),
  11860. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  11861. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  11862. $(".webvr-popup .detail.daydream-label").toggleClass(
  11863. "hidden",
  11864. !0
  11865. ),
  11866. c();
  11867. }
  11868. function p() {
  11869. D.toggleClass("hidden"), N.toggleClass("hidden");
  11870. }
  11871. function f() {
  11872. R.info("exiting webVR"),
  11873. g("webvr_exit_app"),
  11874. window.location.search.indexOf("&qs=1") === -1
  11875. ? (window.location = window.location + "&qs=1")
  11876. : (window.location = window.location);
  11877. }
  11878. function g(e) {
  11879. var t = C.isLandscape() ? "landscape" : "portrait";
  11880. T.trackAlways("showcase_gui", {
  11881. gui_action: e,
  11882. orientation: t,
  11883. });
  11884. }
  11885. function m() {
  11886. var e = C.isLandscape();
  11887. L.toggleClass("landscape", e).toggleClass("portrait", !e);
  11888. }
  11889. var v,
  11890. A,
  11891. y,
  11892. C = e("../../util/browser"),
  11893. I = e("../../settings"),
  11894. E = (e("./../gui"), e("../../enum/VRPlatforms")),
  11895. b = e("../../enum/VRApps"),
  11896. w = e("./../vr/vrLink"),
  11897. _ = e("./WebVrEvent"),
  11898. T = e("../../analytics"),
  11899. x = (e("../../constants"), e("../../localization/localize")),
  11900. S = e("../../util/common"),
  11901. M = e("../../util/logger"),
  11902. R = new M(i),
  11903. P = e("events").EventEmitter,
  11904. O = $("#gui"),
  11905. L = $(".webvr-popup"),
  11906. D = $(".webvr-popup .page.p1"),
  11907. N = $(".webvr-popup .page.p2"),
  11908. B = L.find(".image"),
  11909. F = $(".webvr-popup .detail.headset"),
  11910. V = $(".webvr-popup .detail.phone"),
  11911. U = $(".webvr-popup .tab-content.webvr"),
  11912. k = $(".webvr-popup .tab-content.native"),
  11913. H = "static/images/device-daydream-side.png",
  11914. G = "static/images/device-daydream.png",
  11915. z = "static/images/device-pixel.png",
  11916. W = "static/images/ico-android-robot.png",
  11917. j = "static/images/badge-cardboard.png",
  11918. Y = "static/images/headset-cardboard.png",
  11919. X = "static/images/badge-oculus.png",
  11920. Z = "https://madeby.google.com/vr/",
  11921. q = "https://vr.google.com/cardboard/get-cardboard/",
  11922. K = "webvr_daydream_link",
  11923. Q = "webvr_cardboard_link",
  11924. J = Z,
  11925. ee = K,
  11926. te = "https://vr.google.com/daydream/phones/",
  11927. ie = {
  11928. init: n,
  11929. },
  11930. ne = {
  11931. tabcardboard: d,
  11932. tabdaydream: h,
  11933. tabnative: u,
  11934. };
  11935. S.extendObject(ie, P.prototype),
  11936. $(window).resize(m),
  11937. (t.exports = ie);
  11938. }).call(this, "/js/gui/webvr/webVRgui.js");
  11939. },
  11940. {
  11941. "../../analytics": 4,
  11942. "../../constants": 8,
  11943. "../../enum/VRApps": 46,
  11944. "../../enum/VRPlatforms": 49,
  11945. "../../localization/localize": 108,
  11946. "../../settings": 166,
  11947. "../../util/browser": 182,
  11948. "../../util/common": 185,
  11949. "../../util/logger": 189,
  11950. "./../gui": 65,
  11951. "./../vr/vrLink": 86,
  11952. "./WebVrEvent": 88,
  11953. events: 202,
  11954. },
  11955. ],
  11956. 90: [
  11957. function (e, t, i) {
  11958. "use strict";
  11959. function n(e, t, i, n, o) {
  11960. n || 0 === n ? (this.floorId = n) : (this.floorId = -1),
  11961. (this.roomId = o || ""),
  11962. (this.labelId = e),
  11963. (this.position = new r.Vector3().copy(t)),
  11964. (this.text = i);
  11965. }
  11966. var r = e("three"),
  11967. o = e("../util/browser");
  11968. (n.prototype.build = function () {
  11969. var e = window.document.createElement("div");
  11970. o.isMobile()
  11971. ? e.setAttribute(
  11972. "class",
  11973. "gui-floorplan-label gui-floorplan-label-mobile"
  11974. )
  11975. : e.setAttribute("class", "gui-floorplan-label");
  11976. var t = window.document.createElement("div");
  11977. t.setAttribute("class", "gui-floorplan-label-text");
  11978. var i = window.document.createTextNode(this.text);
  11979. t.appendChild(i),
  11980. e.appendChild(t),
  11981. window.document.body.appendChild(e),
  11982. (this.labelGui = e),
  11983. (this.textBlock = t),
  11984. $(this.labelGui).hide();
  11985. var n = window.getComputedStyle(this.labelGui);
  11986. this.initialTransform = n.transform || n.webkitTransform;
  11987. }),
  11988. (t.exports = n);
  11989. },
  11990. {
  11991. "../util/browser": 182,
  11992. three: 217,
  11993. },
  11994. ],
  11995. 91: [
  11996. function (e, t, i) {
  11997. "use strict";
  11998. function n() {
  11999. (this.player = null),
  12000. (this.modelManager = null),
  12001. (this.container = null);
  12002. }
  12003. var r = e("three"),
  12004. o = (e("../util/common"), e("../enum/PlayerEvents")),
  12005. a = (e("../enum/DirectorEvents"), e("../enum/ModelManagerEvents")),
  12006. s = e("../settings"),
  12007. l = e("../enum/Viewmode"),
  12008. c =
  12009. (e("../enum/WarpStyle"),
  12010. e("../util/transitions"),
  12011. e("../util/lerp"),
  12012. e("../util/browser"));
  12013. //场景初始化
  12014. (n.prototype.init = function (e, t, i) {
  12015. (this.player = e),
  12016. (this.modelManager = t),
  12017. (this.container = i),
  12018. this.updateModel(),
  12019. this.bindEvents();
  12020. }),
  12021. (n.prototype.bindEvents = function () {
  12022. this.modelManager.on(
  12023. a.ActiveModelChanged,
  12024. this.updateModel.bind(this)
  12025. ),
  12026. this.player.on(
  12027. o.ViewChanged,
  12028. this.handlePlayerViewChanged.bind(this)
  12029. ),
  12030. this.player.on(
  12031. o.ModeChanged,
  12032. this.handlePlayerViewChanged.bind(this)
  12033. ),
  12034. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  12035. this.player.on(
  12036. o.StartOutside,
  12037. this.handleStartOutside.bind(this)
  12038. );
  12039. }),
  12040. (n.prototype.updateModel = function () {
  12041. this.model = this.modelManager.getActiveModel();
  12042. }),
  12043. (n.prototype.handlePlayerViewChanged = function () {
  12044. this.updateLabelVisibility(), this.updateLabelDisplay();
  12045. }),
  12046. (n.prototype.getLabelsForFloor = function (e, t) {
  12047. return (
  12048. (t = t || []),
  12049. (t.length = 0),
  12050. this.model.labels.forEach(
  12051. function (i) {
  12052. this.labelVisibleForFloor(i, e) && t.push(i);
  12053. }.bind(this)
  12054. ),
  12055. t
  12056. );
  12057. }),
  12058. (n.prototype.getLabelsForCurrentFloor = function (e) {
  12059. return this.getLabelsForFloor(
  12060. this.model.currentFloor.floorIndex,
  12061. e
  12062. );
  12063. }),
  12064. (n.prototype.labelVisibleForFloor = function (e, t) {
  12065. var i =
  12066. (c.isMobile() &&
  12067. this.player.getLabelScaleFactor() <
  12068. s.labels.zoomHideThreshhold.mobile) ||
  12069. (!c.isMobile() &&
  12070. this.player.getLabelScaleFactor() <
  12071. s.labels.zoomHideThreshhold.desktop);
  12072. if (!this.model.showingLabels || !e.labelGui || !i) return !1;
  12073. var n = e.floorId === this.model.floors.size() - 1;
  12074. return this.model.allFloorsVisible ? n : e.floorId === t;
  12075. }),
  12076. (n.prototype.updateLabelVisibility = function (e) {
  12077. this.model.labels.forEach(
  12078. function (e) {
  12079. this.supportedMode() &&
  12080. this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  12081. ? this.showLabel(
  12082. e,
  12083. s.labels.fadeInDelay,
  12084. s.labels.fadeInDuration
  12085. )
  12086. : this.hideLabel(
  12087. e,
  12088. s.labels.fadeOutDelay,
  12089. s.labels.fadeOutDuration
  12090. );
  12091. }.bind(this)
  12092. );
  12093. }),
  12094. (n.prototype.showAllLabels = function (e, t) {
  12095. this.model.labels.forEach(
  12096. function (i) {
  12097. this.showLabel(i, e, t);
  12098. }.bind(this)
  12099. );
  12100. }),
  12101. (n.prototype.hideAllLabels = function (e, t) {
  12102. this.model.labels.forEach(
  12103. function (i) {
  12104. this.hideLabel(i, e, t);
  12105. }.bind(this)
  12106. );
  12107. }),
  12108. (n.prototype.showLabel = function (e, t, i) {
  12109. this.model.showingLabels &&
  12110. (e.visible ||
  12111. ((e.visible = !0),
  12112. (e.labelGui.style.display = "block"),
  12113. (e.labelGui.style.opacity = 0),
  12114. $(e.labelGui).delay(t).fadeTo(i, 1)));
  12115. }),
  12116. (n.prototype.hideLabel = function (e, t, i) {
  12117. e.visible &&
  12118. ((e.visible = !1),
  12119. c.isMobile()
  12120. ? $(e.labelGui).hide()
  12121. : $(e.labelGui).delay(t).fadeOut(i));
  12122. }),
  12123. (n.prototype.supportedMode = function () {
  12124. return this.player.mode === l.FLOORPLAN;
  12125. }),
  12126. (n.prototype.updateLabelDisplay = (function () {
  12127. var e = (new r.Vector3(), new r.Vector3(), []);
  12128. return function () {
  12129. var t = this.player.getLabelScaleFactor(),
  12130. i = 0.6,
  12131. n = 1.2,
  12132. r = (1 - t) * n + i,
  12133. o = c.isMobile()
  12134. ? s.labels.zoomTruncateThreshhold.mobile
  12135. : s.labels.zoomTruncateThreshhold.desktop;
  12136. this.getLabelsForCurrentFloor(e);
  12137. for (var a = 0; a < e.length; a++) {
  12138. var l = e[a];
  12139. this.supportedMode() &&
  12140. l.labelGui &&
  12141. (this.updateProjectedGuiElement(
  12142. l.labelGui,
  12143. l.textBlock,
  12144. l.position,
  12145. r,
  12146. r
  12147. ),
  12148. t >= o && l.text.length >= s.labels.minLengthForTruncate
  12149. ? (l.textBlock.innerText =
  12150. l.text.substring(0, s.labels.truncateLength) +
  12151. s.labels.truncateSuffix)
  12152. : (l.textBlock.innerText = l.text));
  12153. }
  12154. };
  12155. })()),
  12156. (n.prototype.updateProjectedGuiElement = (function () {
  12157. var e = new r.Vector3();
  12158. new r.Vector3();
  12159. return function (t, i, n, r, o) {
  12160. i.style.fontSize = 100 * o + "%";
  12161. var a = $("#player").width(),
  12162. s = $("#player").height(),
  12163. l = 0.5 * a,
  12164. c = 0.5 * s;
  12165. e.copy(n), e.project(this.player.camera);
  12166. var h = e.x * l + l,
  12167. u = -(e.y * c) + c;
  12168. (h -= t.offsetWidth / 2),
  12169. (u -= t.offsetHeight / 2),
  12170. (t.style.left = h + "px"),
  12171. (t.style.top = u + "px");
  12172. };
  12173. })()),
  12174. (n.prototype.handleStartInside = function (e) {
  12175. this.updateLabelVisibility();
  12176. }),
  12177. (n.prototype.handleStartOutside = function () {
  12178. this.updateLabelVisibility();
  12179. }),
  12180. (t.exports = n);
  12181. },
  12182. {
  12183. "../enum/DirectorEvents": 23,
  12184. "../enum/ModelManagerEvents": 33,
  12185. "../enum/PlayerEvents": 40,
  12186. "../enum/Viewmode": 51,
  12187. "../enum/WarpStyle": 52,
  12188. "../settings": 166,
  12189. "../util/browser": 182,
  12190. "../util/common": 185,
  12191. "../util/lerp": 188,
  12192. "../util/transitions": 195,
  12193. three: 217,
  12194. },
  12195. ],
  12196. 92: [
  12197. function (e, t, i) {
  12198. "use strict";
  12199. Array.prototype.findIndex ||
  12200. (Array.prototype.findIndex = function (e) {
  12201. if (null == this)
  12202. throw new TypeError(
  12203. "Array.prototype.findIndex called on null or undefined"
  12204. );
  12205. if ("function" != typeof e)
  12206. throw new TypeError("predicate must be a function");
  12207. for (
  12208. var t,
  12209. i = Object(this),
  12210. n = i.length >>> 0,
  12211. r = arguments[1],
  12212. o = 0;
  12213. o < n;
  12214. o++
  12215. )
  12216. if (((t = i[o]), e.call(r, t, o, i))) return o;
  12217. return -1;
  12218. }),
  12219. Array.prototype.find ||
  12220. Object.defineProperty(Array.prototype, "find", {
  12221. value: function (e) {
  12222. if (null == this)
  12223. throw new TypeError('"this" is null or not defined');
  12224. var t = Object(this),
  12225. i = t.length >>> 0;
  12226. if ("function" != typeof e)
  12227. throw new TypeError("predicate must be a function");
  12228. for (var n = arguments[1], r = 0; r < i; ) {
  12229. var o = t[r];
  12230. if (e.call(n, o, r, t)) return o;
  12231. r++;
  12232. }
  12233. },
  12234. });
  12235. },
  12236. {},
  12237. ],
  12238. 93: [
  12239. function (e, t, i) {
  12240. "use strict";
  12241. var n = n || {};
  12242. (t.exports = n),
  12243. (n.gui = n.gui || {}),
  12244. (n.utils = n.utils || {}),
  12245. (n.controllers = n.controllers || {}),
  12246. (n.dom = n.dom || {}),
  12247. (n.color = n.color || {}),
  12248. (n.utils.css = (function () {
  12249. return {
  12250. load: function (e, t) {
  12251. t = t || document;
  12252. var i = t.createElement("link");
  12253. (i.type = "text/css"),
  12254. (i.rel = "stylesheet"),
  12255. (i.href = e),
  12256. t.getElementsByTagName("head")[0].appendChild(i);
  12257. },
  12258. inject: function (e, t) {
  12259. t = t || document;
  12260. var i = document.createElement("style");
  12261. (i.type = "text/css"),
  12262. (i.innerHTML = e),
  12263. t.getElementsByTagName("head")[0].appendChild(i);
  12264. },
  12265. };
  12266. })()),
  12267. (n.utils.common = (function () {
  12268. var e = Array.prototype.forEach,
  12269. t = Array.prototype.slice;
  12270. return {
  12271. BREAK: {},
  12272. extend: function (e) {
  12273. return (
  12274. this.each(
  12275. t.call(arguments, 1),
  12276. function (t) {
  12277. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i]);
  12278. },
  12279. this
  12280. ),
  12281. e
  12282. );
  12283. },
  12284. defaults: function (e) {
  12285. return (
  12286. this.each(
  12287. t.call(arguments, 1),
  12288. function (t) {
  12289. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i]);
  12290. },
  12291. this
  12292. ),
  12293. e
  12294. );
  12295. },
  12296. compose: function () {
  12297. var e = t.call(arguments);
  12298. return function () {
  12299. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  12300. i = [e[n].apply(this, i)];
  12301. return i[0];
  12302. };
  12303. },
  12304. each: function (t, i, n) {
  12305. if (t)
  12306. if (e && t.forEach && t.forEach === e) t.forEach(i, n);
  12307. else if (t.length === t.length + 0) {
  12308. for (var r = 0, o = t.length; r < o; r++)
  12309. if (r in t && i.call(n, t[r], r) === this.BREAK) return;
  12310. } else
  12311. for (var r in t)
  12312. if (i.call(n, t[r], r) === this.BREAK) return;
  12313. },
  12314. defer: function (e) {
  12315. setTimeout(e, 0);
  12316. },
  12317. toArray: function (e) {
  12318. return e.toArray ? e.toArray() : t.call(e);
  12319. },
  12320. isUndefined: function (e) {
  12321. return void 0 === e;
  12322. },
  12323. isNull: function (e) {
  12324. return null === e;
  12325. },
  12326. isNaN: function (e) {
  12327. return e !== e;
  12328. },
  12329. isArray:
  12330. Array.isArray ||
  12331. function (e) {
  12332. return e.constructor === Array;
  12333. },
  12334. isObject: function (e) {
  12335. return e === Object(e);
  12336. },
  12337. isNumber: function (e) {
  12338. return e === e + 0;
  12339. },
  12340. isString: function (e) {
  12341. return e === e + "";
  12342. },
  12343. isBoolean: function (e) {
  12344. return e === !1 || e === !0;
  12345. },
  12346. isFunction: function (e) {
  12347. return (
  12348. "[object Function]" === Object.prototype.toString.call(e)
  12349. );
  12350. },
  12351. };
  12352. })()),
  12353. (n.controllers.Controller = (function (e) {
  12354. var t = function (e, t) {
  12355. (this.initialValue = e[t]),
  12356. (this.domElement = document.createElement("div")),
  12357. (this.object = e),
  12358. (this.property = t),
  12359. (this.__onChange = void 0),
  12360. (this.__onFinishChange = void 0);
  12361. };
  12362. return (
  12363. e.extend(t.prototype, {
  12364. onChange: function (e) {
  12365. return (this.__onChange = e), this;
  12366. },
  12367. onFinishChange: function (e) {
  12368. return (this.__onFinishChange = e), this;
  12369. },
  12370. setValue: function (e) {
  12371. return (
  12372. (this.object[this.property] = e),
  12373. this.__onChange && this.__onChange.call(this, e),
  12374. this.updateDisplay(),
  12375. this
  12376. );
  12377. },
  12378. getValue: function () {
  12379. return this.object[this.property];
  12380. },
  12381. updateDisplay: function () {
  12382. return this;
  12383. },
  12384. isModified: function () {
  12385. return this.initialValue !== this.getValue();
  12386. },
  12387. }),
  12388. t
  12389. );
  12390. })(n.utils.common)),
  12391. (n.dom.dom = (function (e) {
  12392. function t(t) {
  12393. if ("0" === t || e.isUndefined(t)) return 0;
  12394. var i = t.match(r);
  12395. return e.isNull(i) ? 0 : parseFloat(i[1]);
  12396. }
  12397. var i = {
  12398. HTMLEvents: ["change"],
  12399. MouseEvents: [
  12400. "click",
  12401. "mousemove",
  12402. "mousedown",
  12403. "mouseup",
  12404. "mouseover",
  12405. ],
  12406. KeyboardEvents: ["keydown"],
  12407. },
  12408. n = {};
  12409. e.each(i, function (t, i) {
  12410. e.each(t, function (e) {
  12411. n[e] = i;
  12412. });
  12413. });
  12414. var r = /(\d+(\.\d+)?)px/,
  12415. o = {
  12416. makeSelectable: function (e, t) {
  12417. void 0 !== e &&
  12418. void 0 !== e.style &&
  12419. ((e.onselectstart = t
  12420. ? function () {
  12421. return !1;
  12422. }
  12423. : function () {}),
  12424. (e.style.MozUserSelect = t ? "auto" : "none"),
  12425. (e.style.KhtmlUserSelect = t ? "auto" : "none"),
  12426. (e.unselectable = t ? "on" : "off"));
  12427. },
  12428. makeFullscreen: function (t, i, n) {
  12429. e.isUndefined(i) && (i = !0),
  12430. e.isUndefined(n) && (n = !0),
  12431. (t.style.position = "absolute"),
  12432. i && ((t.style.left = 0), (t.style.right = 0)),
  12433. n && ((t.style.top = 0), (t.style.bottom = 0));
  12434. },
  12435. fakeEvent: function (t, i, r, o) {
  12436. r = r || {};
  12437. var a = n[i];
  12438. if (!a)
  12439. throw new Error("Event type " + i + " not supported.");
  12440. var s = document.createEvent(a);
  12441. switch (a) {
  12442. case "MouseEvents":
  12443. var l = r.x || r.clientX || 0,
  12444. c = r.y || r.clientY || 0;
  12445. s.initMouseEvent(
  12446. i,
  12447. r.bubbles || !1,
  12448. r.cancelable || !0,
  12449. window,
  12450. r.clickCount || 1,
  12451. 0,
  12452. 0,
  12453. l,
  12454. c,
  12455. !1,
  12456. !1,
  12457. !1,
  12458. !1,
  12459. 0,
  12460. null
  12461. );
  12462. break;
  12463. case "KeyboardEvents":
  12464. var h = s.initKeyboardEvent || s.initKeyEvent;
  12465. e.defaults(r, {
  12466. cancelable: !0,
  12467. ctrlKey: !1,
  12468. altKey: !1,
  12469. shiftKey: !1,
  12470. metaKey: !1,
  12471. keyCode: void 0,
  12472. charCode: void 0,
  12473. }),
  12474. h(
  12475. i,
  12476. r.bubbles || !1,
  12477. r.cancelable,
  12478. window,
  12479. r.ctrlKey,
  12480. r.altKey,
  12481. r.shiftKey,
  12482. r.metaKey,
  12483. r.keyCode,
  12484. r.charCode
  12485. );
  12486. break;
  12487. default:
  12488. s.initEvent(i, r.bubbles || !1, r.cancelable || !0);
  12489. }
  12490. e.defaults(s, o), t.dispatchEvent(s);
  12491. },
  12492. bind: function (e, t, i, n) {
  12493. return (
  12494. (n = n || !1),
  12495. e.addEventListener
  12496. ? e.addEventListener(t, i, n)
  12497. : e.attachEvent && e.attachEvent("on" + t, i),
  12498. o
  12499. );
  12500. },
  12501. unbind: function (e, t, i, n) {
  12502. return (
  12503. (n = n || !1),
  12504. e.removeEventListener
  12505. ? e.removeEventListener(t, i, n)
  12506. : e.detachEvent && e.detachEvent("on" + t, i),
  12507. o
  12508. );
  12509. },
  12510. addClass: function (e, t) {
  12511. if (void 0 === e.className) e.className = t;
  12512. else if (e.className !== t) {
  12513. var i = e.className.split(/ +/);
  12514. i.indexOf(t) == -1 &&
  12515. (i.push(t),
  12516. (e.className = i
  12517. .join(" ")
  12518. .replace(/^\s+/, "")
  12519. .replace(/\s+$/, "")));
  12520. }
  12521. return o;
  12522. },
  12523. removeClass: function (e, t) {
  12524. if (t)
  12525. if (void 0 === e.className);
  12526. else if (e.className === t) e.removeAttribute("class");
  12527. else {
  12528. var i = e.className.split(/ +/),
  12529. n = i.indexOf(t);
  12530. n != -1 && (i.splice(n, 1), (e.className = i.join(" ")));
  12531. }
  12532. else e.className = void 0;
  12533. return o;
  12534. },
  12535. hasClass: function (e, t) {
  12536. return (
  12537. new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(
  12538. e.className
  12539. ) || !1
  12540. );
  12541. },
  12542. getWidth: function (e) {
  12543. var i = getComputedStyle(e);
  12544. return (
  12545. t(i["border-left-width"]) +
  12546. t(i["border-right-width"]) +
  12547. t(i["padding-left"]) +
  12548. t(i["padding-right"]) +
  12549. t(i.width)
  12550. );
  12551. },
  12552. getHeight: function (e) {
  12553. var i = getComputedStyle(e);
  12554. return (
  12555. t(i["border-top-width"]) +
  12556. t(i["border-bottom-width"]) +
  12557. t(i["padding-top"]) +
  12558. t(i["padding-bottom"]) +
  12559. t(i.height)
  12560. );
  12561. },
  12562. getOffset: function (e) {
  12563. var t = {
  12564. left: 0,
  12565. top: 0,
  12566. };
  12567. if (e.offsetParent)
  12568. do (t.left += e.offsetLeft), (t.top += e.offsetTop);
  12569. while ((e = e.offsetParent));
  12570. return t;
  12571. },
  12572. isActive: function (e) {
  12573. return e === document.activeElement && (e.type || e.href);
  12574. },
  12575. };
  12576. return o;
  12577. })(n.utils.common)),
  12578. (n.controllers.OptionController = (function (e, t, i) {
  12579. var n = function (e, r, o) {
  12580. n.superclass.call(this, e, r);
  12581. var a = this;
  12582. if (
  12583. ((this.__select = document.createElement("select")),
  12584. i.isArray(o))
  12585. ) {
  12586. var s = {};
  12587. i.each(o, function (e) {
  12588. s[e] = e;
  12589. }),
  12590. (o = s);
  12591. }
  12592. i.each(o, function (e, t) {
  12593. var i = document.createElement("option");
  12594. (i.innerHTML = t),
  12595. i.setAttribute("value", e),
  12596. a.__select.appendChild(i);
  12597. }),
  12598. this.updateDisplay(),
  12599. t.bind(this.__select, "change", function () {
  12600. var e = this.options[this.selectedIndex].value;
  12601. a.setValue(e);
  12602. }),
  12603. this.domElement.appendChild(this.__select);
  12604. };
  12605. return (
  12606. (n.superclass = e),
  12607. i.extend(n.prototype, e.prototype, {
  12608. setValue: function (e) {
  12609. var t = n.superclass.prototype.setValue.call(this, e);
  12610. return (
  12611. this.__onFinishChange &&
  12612. this.__onFinishChange.call(this, this.getValue()),
  12613. t
  12614. );
  12615. },
  12616. updateDisplay: function () {
  12617. return (
  12618. (this.__select.value = this.getValue()),
  12619. n.superclass.prototype.updateDisplay.call(this)
  12620. );
  12621. },
  12622. }),
  12623. n
  12624. );
  12625. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12626. (n.controllers.NumberController = (function (e, t) {
  12627. function i(e) {
  12628. return (
  12629. (e = e.toString()),
  12630. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  12631. );
  12632. }
  12633. var n = function (e, r, o) {
  12634. n.superclass.call(this, e, r),
  12635. (o = o || {}),
  12636. (this.__min = o.min),
  12637. (this.__max = o.max),
  12638. (this.__step = o.step),
  12639. t.isUndefined(this.__step)
  12640. ? 0 == this.initialValue
  12641. ? (this.__impliedStep = 1)
  12642. : (this.__impliedStep =
  12643. Math.pow(
  12644. 10,
  12645. Math.floor(Math.log(this.initialValue) / Math.LN10)
  12646. ) / 10)
  12647. : (this.__impliedStep = this.__step),
  12648. (this.__precision = i(this.__impliedStep));
  12649. };
  12650. return (
  12651. (n.superclass = e),
  12652. t.extend(n.prototype, e.prototype, {
  12653. setValue: function (e) {
  12654. return (
  12655. void 0 !== this.__min && e < this.__min
  12656. ? (e = this.__min)
  12657. : void 0 !== this.__max &&
  12658. e > this.__max &&
  12659. (e = this.__max),
  12660. void 0 !== this.__step &&
  12661. e % this.__step != 0 &&
  12662. (e = Math.round(e / this.__step) * this.__step),
  12663. n.superclass.prototype.setValue.call(this, e)
  12664. );
  12665. },
  12666. min: function (e) {
  12667. return (this.__min = e), this;
  12668. },
  12669. max: function (e) {
  12670. return (this.__max = e), this;
  12671. },
  12672. step: function (e) {
  12673. return (
  12674. (this.__step = e),
  12675. (this.__impliedStep = e),
  12676. (this.__precision = i(e)),
  12677. this
  12678. );
  12679. },
  12680. }),
  12681. n
  12682. );
  12683. })(n.controllers.Controller, n.utils.common)),
  12684. (n.controllers.NumberControllerBox = (function (e, t, i) {
  12685. function n(e, t) {
  12686. var i = Math.pow(10, t);
  12687. return Math.round(e * i) / i;
  12688. }
  12689. var r = function (e, n, o) {
  12690. function a() {
  12691. var e = parseFloat(d.__input.value);
  12692. i.isNaN(e) || d.setValue(e);
  12693. }
  12694. function s() {
  12695. a(),
  12696. d.__onFinishChange &&
  12697. d.__onFinishChange.call(d, d.getValue());
  12698. }
  12699. function l(e) {
  12700. t.bind(window, "mousemove", c),
  12701. t.bind(window, "mouseup", h),
  12702. (u = e.clientY);
  12703. }
  12704. function c(e) {
  12705. var t = u - e.clientY;
  12706. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY);
  12707. }
  12708. function h() {
  12709. t.unbind(window, "mousemove", c),
  12710. t.unbind(window, "mouseup", h);
  12711. }
  12712. (this.__truncationSuspended = !1),
  12713. r.superclass.call(this, e, n, o);
  12714. var u,
  12715. d = this;
  12716. (this.__input = document.createElement("input")),
  12717. this.__input.setAttribute("type", "text"),
  12718. t.bind(this.__input, "change", a),
  12719. t.bind(this.__input, "blur", s),
  12720. t.bind(this.__input, "mousedown", l),
  12721. t.bind(this.__input, "keydown", function (e) {
  12722. 13 === e.keyCode &&
  12723. ((d.__truncationSuspended = !0),
  12724. this.blur(),
  12725. (d.__truncationSuspended = !1));
  12726. }),
  12727. this.updateDisplay(),
  12728. this.domElement.appendChild(this.__input);
  12729. };
  12730. return (
  12731. (r.superclass = e),
  12732. i.extend(r.prototype, e.prototype, {
  12733. updateDisplay: function () {
  12734. return (
  12735. (this.__input.value = this.__truncationSuspended
  12736. ? this.getValue()
  12737. : n(this.getValue(), this.__precision)),
  12738. r.superclass.prototype.updateDisplay.call(this)
  12739. );
  12740. },
  12741. }),
  12742. r
  12743. );
  12744. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  12745. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  12746. function o(e, t, i, n, r) {
  12747. return n + (r - n) * ((e - t) / (i - t));
  12748. }
  12749. var a = function (e, i, n, r, s) {
  12750. function l(e) {
  12751. t.bind(window, "mousemove", c),
  12752. t.bind(window, "mouseup", h),
  12753. c(e);
  12754. }
  12755. function c(e) {
  12756. e.preventDefault();
  12757. var i = t.getOffset(u.__background),
  12758. n = t.getWidth(u.__background);
  12759. return (
  12760. u.setValue(
  12761. o(e.clientX, i.left, i.left + n, u.__min, u.__max)
  12762. ),
  12763. !1
  12764. );
  12765. }
  12766. function h() {
  12767. t.unbind(window, "mousemove", c),
  12768. t.unbind(window, "mouseup", h),
  12769. u.__onFinishChange &&
  12770. u.__onFinishChange.call(u, u.getValue());
  12771. }
  12772. a.superclass.call(this, e, i, {
  12773. min: n,
  12774. max: r,
  12775. step: s,
  12776. });
  12777. var u = this;
  12778. (this.__background = document.createElement("div")),
  12779. (this.__foreground = document.createElement("div")),
  12780. t.bind(this.__background, "mousedown", l),
  12781. t.addClass(this.__background, "slider"),
  12782. t.addClass(this.__foreground, "slider-fg"),
  12783. this.updateDisplay(),
  12784. this.__background.appendChild(this.__foreground),
  12785. this.domElement.appendChild(this.__background);
  12786. };
  12787. return (
  12788. (a.superclass = e),
  12789. (a.useDefaultStyles = function () {
  12790. i.inject(r);
  12791. }),
  12792. n.extend(a.prototype, e.prototype, {
  12793. updateDisplay: function () {
  12794. var e =
  12795. (this.getValue() - this.__min) / (this.__max - this.__min);
  12796. return (
  12797. (this.__foreground.style.width = 100 * e + "%"),
  12798. a.superclass.prototype.updateDisplay.call(this)
  12799. );
  12800. },
  12801. }),
  12802. a
  12803. );
  12804. })(
  12805. n.controllers.NumberController,
  12806. n.dom.dom,
  12807. n.utils.css,
  12808. n.utils.common,
  12809. "/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"
  12810. )),
  12811. (n.controllers.FunctionController = (function (e, t, i) {
  12812. var n = function (e, i, r) {
  12813. n.superclass.call(this, e, i);
  12814. var o = this;
  12815. (this.__button = document.createElement("div")),
  12816. (this.__button.innerHTML = void 0 === r ? "Fire" : r),
  12817. t.bind(this.__button, "click", function (e) {
  12818. return e.preventDefault(), o.fire(), !1;
  12819. }),
  12820. t.addClass(this.__button, "button"),
  12821. this.domElement.appendChild(this.__button);
  12822. };
  12823. return (
  12824. (n.superclass = e),
  12825. i.extend(n.prototype, e.prototype, {
  12826. fire: function () {
  12827. this.__onChange && this.__onChange.call(this),
  12828. this.__onFinishChange &&
  12829. this.__onFinishChange.call(this, this.getValue()),
  12830. this.getValue().call(this.object);
  12831. },
  12832. }),
  12833. n
  12834. );
  12835. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12836. (n.controllers.BooleanController = (function (e, t, i) {
  12837. var n = function (e, i) {
  12838. function r() {
  12839. o.setValue(!o.__prev);
  12840. }
  12841. n.superclass.call(this, e, i);
  12842. var o = this;
  12843. (this.__prev = this.getValue()),
  12844. (this.__checkbox = document.createElement("input")),
  12845. this.__checkbox.setAttribute("type", "checkbox"),
  12846. t.bind(this.__checkbox, "change", r, !1),
  12847. this.domElement.appendChild(this.__checkbox),
  12848. this.updateDisplay();
  12849. };
  12850. return (
  12851. (n.superclass = e),
  12852. i.extend(n.prototype, e.prototype, {
  12853. setValue: function (e) {
  12854. var t = n.superclass.prototype.setValue.call(this, e);
  12855. return (
  12856. this.__onFinishChange &&
  12857. this.__onFinishChange.call(this, this.getValue()),
  12858. (this.__prev = this.getValue()),
  12859. t
  12860. );
  12861. },
  12862. updateDisplay: function () {
  12863. return (
  12864. this.getValue() === !0
  12865. ? (this.__checkbox.setAttribute("checked", "checked"),
  12866. (this.__checkbox.checked = !0))
  12867. : (this.__checkbox.checked = !1),
  12868. n.superclass.prototype.updateDisplay.call(this)
  12869. );
  12870. },
  12871. }),
  12872. n
  12873. );
  12874. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12875. (n.color.toString = (function (e) {
  12876. return function (t) {
  12877. if (1 == t.a || e.isUndefined(t.a)) {
  12878. for (var i = t.hex.toString(16); i.length < 6; ) i = "0" + i;
  12879. return "#" + i;
  12880. }
  12881. return (
  12882. "rgba(" +
  12883. Math.round(t.r) +
  12884. "," +
  12885. Math.round(t.g) +
  12886. "," +
  12887. Math.round(t.b) +
  12888. "," +
  12889. t.a +
  12890. ")"
  12891. );
  12892. };
  12893. })(n.utils.common)),
  12894. (n.color.interpret = (function (e, t) {
  12895. var i,
  12896. n,
  12897. r = function () {
  12898. n = !1;
  12899. var e =
  12900. arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  12901. return (
  12902. t.each(o, function (r) {
  12903. if (r.litmus(e))
  12904. return (
  12905. t.each(r.conversions, function (r, o) {
  12906. if (((i = r.read(e)), n === !1 && i !== !1))
  12907. return (
  12908. (n = i),
  12909. (i.conversionName = o),
  12910. (i.conversion = r),
  12911. t.BREAK
  12912. );
  12913. }),
  12914. t.BREAK
  12915. );
  12916. }),
  12917. n
  12918. );
  12919. },
  12920. o = [
  12921. {
  12922. litmus: t.isString,
  12923. conversions: {
  12924. THREE_CHAR_HEX: {
  12925. read: function (e) {
  12926. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  12927. return (
  12928. null !== t && {
  12929. space: "HEX",
  12930. hex: parseInt(
  12931. "0x" +
  12932. t[1].toString() +
  12933. t[1].toString() +
  12934. t[2].toString() +
  12935. t[2].toString() +
  12936. t[3].toString() +
  12937. t[3].toString()
  12938. ),
  12939. }
  12940. );
  12941. },
  12942. write: e,
  12943. },
  12944. SIX_CHAR_HEX: {
  12945. read: function (e) {
  12946. var t = e.match(/^#([A-F0-9]{6})$/i);
  12947. return (
  12948. null !== t && {
  12949. space: "HEX",
  12950. hex: parseInt("0x" + t[1].toString()),
  12951. }
  12952. );
  12953. },
  12954. write: e,
  12955. },
  12956. CSS_RGB: {
  12957. read: function (e) {
  12958. var t = e.match(
  12959. /^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/
  12960. );
  12961. return (
  12962. null !== t && {
  12963. space: "RGB",
  12964. r: parseFloat(t[1]),
  12965. g: parseFloat(t[2]),
  12966. b: parseFloat(t[3]),
  12967. }
  12968. );
  12969. },
  12970. write: e,
  12971. },
  12972. CSS_RGBA: {
  12973. read: function (e) {
  12974. var t = e.match(
  12975. /^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/
  12976. );
  12977. return (
  12978. null !== t && {
  12979. space: "RGB",
  12980. r: parseFloat(t[1]),
  12981. g: parseFloat(t[2]),
  12982. b: parseFloat(t[3]),
  12983. a: parseFloat(t[4]),
  12984. }
  12985. );
  12986. },
  12987. write: e,
  12988. },
  12989. },
  12990. },
  12991. {
  12992. litmus: t.isNumber,
  12993. conversions: {
  12994. HEX: {
  12995. read: function (e) {
  12996. return {
  12997. space: "HEX",
  12998. hex: e,
  12999. conversionName: "HEX",
  13000. };
  13001. },
  13002. write: function (e) {
  13003. return e.hex;
  13004. },
  13005. },
  13006. },
  13007. },
  13008. {
  13009. litmus: t.isArray,
  13010. conversions: {
  13011. RGB_ARRAY: {
  13012. read: function (e) {
  13013. return (
  13014. 3 == e.length && {
  13015. space: "RGB",
  13016. r: e[0],
  13017. g: e[1],
  13018. b: e[2],
  13019. }
  13020. );
  13021. },
  13022. write: function (e) {
  13023. return [e.r, e.g, e.b];
  13024. },
  13025. },
  13026. RGBA_ARRAY: {
  13027. read: function (e) {
  13028. return (
  13029. 4 == e.length && {
  13030. space: "RGB",
  13031. r: e[0],
  13032. g: e[1],
  13033. b: e[2],
  13034. a: e[3],
  13035. }
  13036. );
  13037. },
  13038. write: function (e) {
  13039. return [e.r, e.g, e.b, e.a];
  13040. },
  13041. },
  13042. },
  13043. },
  13044. {
  13045. litmus: t.isObject,
  13046. conversions: {
  13047. RGBA_OBJ: {
  13048. read: function (e) {
  13049. return (
  13050. !!(
  13051. t.isNumber(e.r) &&
  13052. t.isNumber(e.g) &&
  13053. t.isNumber(e.b) &&
  13054. t.isNumber(e.a)
  13055. ) && {
  13056. space: "RGB",
  13057. r: e.r,
  13058. g: e.g,
  13059. b: e.b,
  13060. a: e.a,
  13061. }
  13062. );
  13063. },
  13064. write: function (e) {
  13065. return {
  13066. r: e.r,
  13067. g: e.g,
  13068. b: e.b,
  13069. a: e.a,
  13070. };
  13071. },
  13072. },
  13073. RGB_OBJ: {
  13074. read: function (e) {
  13075. return (
  13076. !!(
  13077. t.isNumber(e.r) &&
  13078. t.isNumber(e.g) &&
  13079. t.isNumber(e.b)
  13080. ) && {
  13081. space: "RGB",
  13082. r: e.r,
  13083. g: e.g,
  13084. b: e.b,
  13085. }
  13086. );
  13087. },
  13088. write: function (e) {
  13089. return {
  13090. r: e.r,
  13091. g: e.g,
  13092. b: e.b,
  13093. };
  13094. },
  13095. },
  13096. HSVA_OBJ: {
  13097. read: function (e) {
  13098. return (
  13099. !!(
  13100. t.isNumber(e.h) &&
  13101. t.isNumber(e.s) &&
  13102. t.isNumber(e.v) &&
  13103. t.isNumber(e.a)
  13104. ) && {
  13105. space: "HSV",
  13106. h: e.h,
  13107. s: e.s,
  13108. v: e.v,
  13109. a: e.a,
  13110. }
  13111. );
  13112. },
  13113. write: function (e) {
  13114. return {
  13115. h: e.h,
  13116. s: e.s,
  13117. v: e.v,
  13118. a: e.a,
  13119. };
  13120. },
  13121. },
  13122. HSV_OBJ: {
  13123. read: function (e) {
  13124. return (
  13125. !!(
  13126. t.isNumber(e.h) &&
  13127. t.isNumber(e.s) &&
  13128. t.isNumber(e.v)
  13129. ) && {
  13130. space: "HSV",
  13131. h: e.h,
  13132. s: e.s,
  13133. v: e.v,
  13134. }
  13135. );
  13136. },
  13137. write: function (e) {
  13138. return {
  13139. h: e.h,
  13140. s: e.s,
  13141. v: e.v,
  13142. };
  13143. },
  13144. },
  13145. },
  13146. },
  13147. ];
  13148. return r;
  13149. })(n.color.toString, n.utils.common)),
  13150. (n.GUI = n.gui.GUI =
  13151. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  13152. function g(e, t, i, o) {
  13153. if (void 0 === t[i])
  13154. throw new Error(
  13155. "Object " + t + ' has no property "' + i + '"'
  13156. );
  13157. var a;
  13158. if (o.color) a = new h(t, i);
  13159. else {
  13160. var s = [t, i].concat(o.factoryArgs);
  13161. a = n.apply(e, s);
  13162. }
  13163. o.before instanceof r && (o.before = o.before.__li),
  13164. A(e, a),
  13165. p.addClass(a.domElement, "c");
  13166. var l = document.createElement("span");
  13167. p.addClass(l, "property-name"), (l.innerHTML = a.property);
  13168. var c = document.createElement("div");
  13169. c.appendChild(l), c.appendChild(a.domElement);
  13170. var u = m(e, c, o.before);
  13171. return (
  13172. p.addClass(u, V.CLASS_CONTROLLER_ROW),
  13173. p.addClass(u, typeof a.getValue()),
  13174. v(e, u, a),
  13175. e.__controllers.push(a),
  13176. a
  13177. );
  13178. }
  13179. function m(e, t, i) {
  13180. var n = document.createElement("li");
  13181. return (
  13182. t && n.appendChild(t),
  13183. i
  13184. ? e.__ul.insertBefore(n, params.before)
  13185. : e.__ul.appendChild(n),
  13186. e.onResize(),
  13187. n
  13188. );
  13189. }
  13190. function v(e, t, i) {
  13191. if (
  13192. ((i.__li = t),
  13193. (i.__gui = e),
  13194. f.extend(i, {
  13195. options: function (t) {
  13196. return arguments.length > 1
  13197. ? (i.remove(),
  13198. g(e, i.object, i.property, {
  13199. before: i.__li.nextElementSibling,
  13200. factoryArgs: [f.toArray(arguments)],
  13201. }))
  13202. : f.isArray(t) || f.isObject(t)
  13203. ? (i.remove(),
  13204. g(e, i.object, i.property, {
  13205. before: i.__li.nextElementSibling,
  13206. factoryArgs: [t],
  13207. }))
  13208. : void 0;
  13209. },
  13210. name: function (e) {
  13211. return (
  13212. (i.__li.firstElementChild.firstElementChild.innerHTML =
  13213. e),
  13214. i
  13215. );
  13216. },
  13217. listen: function () {
  13218. return i.__gui.listen(i), i;
  13219. },
  13220. remove: function () {
  13221. return i.__gui.remove(i), i;
  13222. },
  13223. }),
  13224. i instanceof l)
  13225. ) {
  13226. var n = new s(i.object, i.property, {
  13227. min: i.__min,
  13228. max: i.__max,
  13229. step: i.__step,
  13230. });
  13231. f.each(
  13232. ["updateDisplay", "onChange", "onFinishChange"],
  13233. function (e) {
  13234. var t = i[e],
  13235. r = n[e];
  13236. i[e] = n[e] = function () {
  13237. var e = Array.prototype.slice.call(arguments);
  13238. return t.apply(i, e), r.apply(n, e);
  13239. };
  13240. }
  13241. ),
  13242. p.addClass(t, "has-slider"),
  13243. i.domElement.insertBefore(
  13244. n.domElement,
  13245. i.domElement.firstElementChild
  13246. );
  13247. } else if (i instanceof s) {
  13248. var r = function (t) {
  13249. return f.isNumber(i.__min) && f.isNumber(i.__max)
  13250. ? (i.remove(),
  13251. g(e, i.object, i.property, {
  13252. before: i.__li.nextElementSibling,
  13253. factoryArgs: [i.__min, i.__max, i.__step],
  13254. }))
  13255. : t;
  13256. };
  13257. (i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max));
  13258. } else
  13259. i instanceof o
  13260. ? (p.bind(t, "click", function () {
  13261. p.fakeEvent(i.__checkbox, "click");
  13262. }),
  13263. p.bind(i.__checkbox, "click", function (e) {
  13264. e.stopPropagation();
  13265. }))
  13266. : i instanceof a
  13267. ? (p.bind(t, "click", function () {
  13268. p.fakeEvent(i.__button, "click");
  13269. }),
  13270. p.bind(t, "mouseover", function () {
  13271. p.addClass(i.__button, "hover");
  13272. }),
  13273. p.bind(t, "mouseout", function () {
  13274. p.removeClass(i.__button, "hover");
  13275. }))
  13276. : i instanceof h &&
  13277. (p.addClass(t, "color"),
  13278. (i.updateDisplay = f.compose(function (e) {
  13279. return (
  13280. (t.style.borderLeftColor = i.__color.toString()), e
  13281. );
  13282. }, i.updateDisplay)),
  13283. i.updateDisplay());
  13284. i.setValue = f.compose(function (t) {
  13285. return (
  13286. e.getRoot().__preset_select &&
  13287. i.isModified() &&
  13288. T(e.getRoot(), !0),
  13289. t
  13290. );
  13291. }, i.setValue);
  13292. }
  13293. function A(e, t) {
  13294. var i = e.getRoot(),
  13295. n = i.__rememberedObjects.indexOf(t.object);
  13296. if (n != -1) {
  13297. var r = i.__rememberedObjectIndecesToControllers[n];
  13298. if (
  13299. (void 0 === r &&
  13300. ((r = {}),
  13301. (i.__rememberedObjectIndecesToControllers[n] = r)),
  13302. (r[t.property] = t),
  13303. i.load && i.load.remembered)
  13304. ) {
  13305. var o,
  13306. a = i.load.remembered;
  13307. if (a[e.preset]) o = a[e.preset];
  13308. else {
  13309. if (!a[L]) return;
  13310. o = a[L];
  13311. }
  13312. if (o[n] && void 0 !== o[n][t.property]) {
  13313. var s = o[n][t.property];
  13314. (t.initialValue = s), t.setValue(s);
  13315. }
  13316. }
  13317. }
  13318. }
  13319. function y(e, t) {
  13320. return document.location.href + "." + t;
  13321. }
  13322. function C(e) {
  13323. var t = (e.__save_row = document.createElement("li"));
  13324. p.addClass(e.domElement, "has-save"),
  13325. e.__ul.insertBefore(t, e.__ul.firstChild),
  13326. p.addClass(t, "save-row");
  13327. var i = document.createElement("span");
  13328. (i.innerHTML = "&nbsp;"), p.addClass(i, "button gears");
  13329. var n = document.createElement("span");
  13330. (n.innerHTML = "Save"),
  13331. p.addClass(n, "button"),
  13332. p.addClass(n, "save");
  13333. var r = document.createElement("span");
  13334. (r.innerHTML = "New"),
  13335. p.addClass(r, "button"),
  13336. p.addClass(r, "save-as");
  13337. var o = document.createElement("span");
  13338. (o.innerHTML = "Revert"),
  13339. p.addClass(o, "button"),
  13340. p.addClass(o, "revert");
  13341. var a = (e.__preset_select = document.createElement("select"));
  13342. if (
  13343. (e.load && e.load.remembered
  13344. ? f.each(e.load.remembered, function (t, i) {
  13345. w(e, i, i == e.preset);
  13346. })
  13347. : w(e, L, !1),
  13348. p.bind(a, "change", function () {
  13349. for (var t = 0; t < e.__preset_select.length; t++)
  13350. e.__preset_select[t].innerHTML =
  13351. e.__preset_select[t].value;
  13352. e.preset = this.value;
  13353. }),
  13354. t.appendChild(a),
  13355. t.appendChild(i),
  13356. t.appendChild(n),
  13357. t.appendChild(r),
  13358. t.appendChild(o),
  13359. D)
  13360. ) {
  13361. var s = document.getElementById("dg-save-locally"),
  13362. l = document.getElementById("dg-local-explain");
  13363. s.style.display = "block";
  13364. var c = document.getElementById("dg-local-storage");
  13365. "true" === localStorage.getItem(y(e, "isLocal")) &&
  13366. c.setAttribute("checked", "checked");
  13367. var h = function () {
  13368. l.style.display = e.useLocalStorage ? "block" : "none";
  13369. };
  13370. h(),
  13371. p.bind(c, "change", function () {
  13372. (e.useLocalStorage = !e.useLocalStorage), h();
  13373. });
  13374. }
  13375. var u = document.getElementById("dg-new-constructor");
  13376. p.bind(u, "keydown", function (e) {
  13377. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide();
  13378. }),
  13379. p.bind(i, "click", function () {
  13380. (u.innerHTML = JSON.stringify(
  13381. e.getSaveObject(),
  13382. void 0,
  13383. 2
  13384. )),
  13385. S.show(),
  13386. u.focus(),
  13387. u.select();
  13388. }),
  13389. p.bind(n, "click", function () {
  13390. e.save();
  13391. }),
  13392. p.bind(r, "click", function () {
  13393. var t = prompt("Enter a new preset name.");
  13394. t && e.saveAs(t);
  13395. }),
  13396. p.bind(o, "click", function () {
  13397. e.revert();
  13398. });
  13399. }
  13400. function I(e) {
  13401. function t(t) {
  13402. return (
  13403. t.preventDefault(),
  13404. (r = t.clientX),
  13405. p.addClass(e.__closeButton, V.CLASS_DRAG),
  13406. p.bind(window, "mousemove", i),
  13407. p.bind(window, "mouseup", n),
  13408. !1
  13409. );
  13410. }
  13411. function i(t) {
  13412. return (
  13413. t.preventDefault(),
  13414. (e.width += r - t.clientX),
  13415. e.onResize(),
  13416. (r = t.clientX),
  13417. !1
  13418. );
  13419. }
  13420. function n() {
  13421. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  13422. p.unbind(window, "mousemove", i),
  13423. p.unbind(window, "mouseup", n);
  13424. }
  13425. (e.__resize_handle = document.createElement("div")),
  13426. f.extend(e.__resize_handle.style, {
  13427. width: "6px",
  13428. marginLeft: "-3px",
  13429. height: "200px",
  13430. cursor: "ew-resize",
  13431. position: "absolute",
  13432. });
  13433. var r;
  13434. p.bind(e.__resize_handle, "mousedown", t),
  13435. p.bind(e.__closeButton, "mousedown", t),
  13436. e.domElement.insertBefore(
  13437. e.__resize_handle,
  13438. e.domElement.firstElementChild
  13439. );
  13440. }
  13441. function E(e, t) {
  13442. (e.domElement.style.width = t + "px"),
  13443. e.__save_row &&
  13444. e.autoPlace &&
  13445. (e.__save_row.style.width = t + "px"),
  13446. e.__closeButton && (e.__closeButton.style.width = t + "px");
  13447. }
  13448. function b(e, t) {
  13449. var i = {};
  13450. return (
  13451. f.each(e.__rememberedObjects, function (n, r) {
  13452. var o = {},
  13453. a = e.__rememberedObjectIndecesToControllers[r];
  13454. f.each(a, function (e, i) {
  13455. o[i] = t ? e.initialValue : e.getValue();
  13456. }),
  13457. (i[r] = o);
  13458. }),
  13459. i
  13460. );
  13461. }
  13462. function w(e, t, i) {
  13463. var n = document.createElement("option");
  13464. (n.innerHTML = t),
  13465. (n.value = t),
  13466. e.__preset_select.appendChild(n),
  13467. i &&
  13468. (e.__preset_select.selectedIndex =
  13469. e.__preset_select.length - 1);
  13470. }
  13471. function _(e) {
  13472. for (var t = 0; t < e.__preset_select.length; t++)
  13473. e.__preset_select[t].value == e.preset &&
  13474. (e.__preset_select.selectedIndex = t);
  13475. }
  13476. function T(e, t) {
  13477. var i = e.__preset_select[e.__preset_select.selectedIndex];
  13478. t ? (i.innerHTML = i.value + "*") : (i.innerHTML = i.value);
  13479. }
  13480. function x(e) {
  13481. 0 != e.length &&
  13482. u(function () {
  13483. x(e);
  13484. }),
  13485. f.each(e, function (e) {
  13486. e.updateDisplay();
  13487. });
  13488. }
  13489. e.inject(i);
  13490. var S,
  13491. M,
  13492. R = "dg",
  13493. P = 72,
  13494. O = 20,
  13495. L = "Default",
  13496. D = (function () {
  13497. try {
  13498. return (
  13499. "localStorage" in window && null !== window.localStorage
  13500. );
  13501. } catch (e) {
  13502. return !1;
  13503. }
  13504. })(),
  13505. N = !0,
  13506. B = !1,
  13507. F = [],
  13508. V = function (e) {
  13509. function t() {
  13510. var e = i.getRoot();
  13511. (e.width += 1),
  13512. f.defer(function () {
  13513. e.width -= 1;
  13514. });
  13515. }
  13516. var i = this;
  13517. (this.domElement = document.createElement("div")),
  13518. (this.__ul = document.createElement("ul")),
  13519. this.domElement.appendChild(this.__ul),
  13520. p.addClass(this.domElement, R),
  13521. (this.__folders = {}),
  13522. (this.__controllers = []),
  13523. (this.__rememberedObjects = []),
  13524. (this.__rememberedObjectIndecesToControllers = []),
  13525. (this.__listening = []),
  13526. (e = e || {}),
  13527. (e = f.defaults(e, {
  13528. autoPlace: !0,
  13529. width: V.DEFAULT_WIDTH,
  13530. })),
  13531. (e = f.defaults(e, {
  13532. resizable: e.autoPlace,
  13533. hideable: e.autoPlace,
  13534. })),
  13535. f.isUndefined(e.load)
  13536. ? (e.load = {
  13537. preset: L,
  13538. })
  13539. : e.preset && (e.load.preset = e.preset),
  13540. f.isUndefined(e.parent) && e.hideable && F.push(this),
  13541. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  13542. e.autoPlace &&
  13543. f.isUndefined(e.scrollable) &&
  13544. (e.scrollable = !0);
  13545. var n,
  13546. r =
  13547. D && "true" === localStorage.getItem(y(this, "isLocal"));
  13548. if (
  13549. (Object.defineProperties(this, {
  13550. parent: {
  13551. get: function () {
  13552. return e.parent;
  13553. },
  13554. },
  13555. scrollable: {
  13556. get: function () {
  13557. return e.scrollable;
  13558. },
  13559. },
  13560. autoPlace: {
  13561. get: function () {
  13562. return e.autoPlace;
  13563. },
  13564. },
  13565. preset: {
  13566. get: function () {
  13567. return i.parent ? i.getRoot().preset : e.load.preset;
  13568. },
  13569. set: function (t) {
  13570. i.parent
  13571. ? (i.getRoot().preset = t)
  13572. : (e.load.preset = t),
  13573. _(this),
  13574. i.revert();
  13575. },
  13576. },
  13577. width: {
  13578. get: function () {
  13579. return e.width;
  13580. },
  13581. set: function (t) {
  13582. (e.width = t), E(i, t);
  13583. },
  13584. },
  13585. name: {
  13586. get: function () {
  13587. return e.name;
  13588. },
  13589. set: function (t) {
  13590. (e.name = t), a && (a.innerHTML = e.name);
  13591. },
  13592. },
  13593. closed: {
  13594. get: function () {
  13595. return e.closed;
  13596. },
  13597. set: function (t) {
  13598. (e.closed = t),
  13599. e.closed
  13600. ? p.addClass(i.__ul, V.CLASS_CLOSED)
  13601. : p.removeClass(i.__ul, V.CLASS_CLOSED),
  13602. this.onResize(),
  13603. i.__closeButton &&
  13604. (i.__closeButton.innerHTML = t
  13605. ? V.TEXT_OPEN
  13606. : V.TEXT_CLOSED);
  13607. },
  13608. },
  13609. load: {
  13610. get: function () {
  13611. return e.load;
  13612. },
  13613. },
  13614. useLocalStorage: {
  13615. get: function () {
  13616. return r;
  13617. },
  13618. set: function (e) {
  13619. D &&
  13620. ((r = e),
  13621. e
  13622. ? p.bind(window, "unload", n)
  13623. : p.unbind(window, "unload", n),
  13624. localStorage.setItem(y(i, "isLocal"), e));
  13625. },
  13626. },
  13627. }),
  13628. f.isUndefined(e.parent))
  13629. ) {
  13630. if (
  13631. ((e.closed = !1),
  13632. p.addClass(this.domElement, V.CLASS_MAIN),
  13633. p.makeSelectable(this.domElement, !1),
  13634. D && r)
  13635. ) {
  13636. i.useLocalStorage = !0;
  13637. var o = localStorage.getItem(y(this, "gui"));
  13638. o && (e.load = JSON.parse(o));
  13639. }
  13640. (this.__closeButton = document.createElement("div")),
  13641. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  13642. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  13643. this.domElement.appendChild(this.__closeButton),
  13644. p.bind(this.__closeButton, "click", function () {
  13645. i.closed = !i.closed;
  13646. });
  13647. } else {
  13648. void 0 === e.closed && (e.closed = !0);
  13649. var a = document.createTextNode(e.name);
  13650. p.addClass(a, "controller-name");
  13651. var s = m(i, a),
  13652. l = function (e) {
  13653. return e.preventDefault(), (i.closed = !i.closed), !1;
  13654. };
  13655. p.addClass(this.__ul, V.CLASS_CLOSED),
  13656. p.addClass(s, "title"),
  13657. p.bind(s, "click", l),
  13658. e.closed || (this.closed = !1);
  13659. }
  13660. e.autoPlace &&
  13661. (f.isUndefined(e.parent) &&
  13662. (N &&
  13663. ((M = document.createElement("div")),
  13664. p.addClass(M, R),
  13665. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  13666. document.body.appendChild(M),
  13667. (N = !1)),
  13668. M.appendChild(this.domElement),
  13669. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  13670. this.parent || E(i, e.width)),
  13671. p.bind(window, "resize", function () {
  13672. i.onResize();
  13673. }),
  13674. p.bind(this.__ul, "webkitTransitionEnd", function () {
  13675. i.onResize();
  13676. }),
  13677. p.bind(this.__ul, "transitionend", function () {
  13678. i.onResize();
  13679. }),
  13680. p.bind(this.__ul, "oTransitionEnd", function () {
  13681. i.onResize();
  13682. }),
  13683. this.onResize(),
  13684. e.resizable && I(this),
  13685. (n = function () {
  13686. D &&
  13687. "true" === localStorage.getItem(y(i, "isLocal")) &&
  13688. localStorage.setItem(
  13689. y(i, "gui"),
  13690. JSON.stringify(i.getSaveObject())
  13691. );
  13692. }),
  13693. (this.saveToLocalStorageIfPossible = n);
  13694. i.getRoot();
  13695. e.parent || t();
  13696. };
  13697. return (
  13698. (V.toggleHide = function () {
  13699. (B = !B),
  13700. f.each(F, function (e) {
  13701. (e.domElement.style.zIndex = B ? -999 : 999),
  13702. (e.domElement.style.opacity = B ? 0 : 1);
  13703. });
  13704. }),
  13705. (V.CLASS_AUTO_PLACE = "a"),
  13706. (V.CLASS_AUTO_PLACE_CONTAINER = "ac"),
  13707. (V.CLASS_MAIN = "main"),
  13708. (V.CLASS_CONTROLLER_ROW = "cr"),
  13709. (V.CLASS_TOO_TALL = "taller-than-window"),
  13710. (V.CLASS_CLOSED = "closed"),
  13711. (V.CLASS_CLOSE_BUTTON = "close-button"),
  13712. (V.CLASS_DRAG = "drag"),
  13713. (V.DEFAULT_WIDTH = 245),
  13714. (V.TEXT_CLOSED = "Close Controls"),
  13715. (V.TEXT_OPEN = "Open Controls"),
  13716. p.bind(
  13717. window,
  13718. "keydown",
  13719. function (e) {
  13720. "text" === document.activeElement.type ||
  13721. (e.which !== P && e.keyCode != P) ||
  13722. V.toggleHide();
  13723. },
  13724. !1
  13725. ),
  13726. f.extend(V.prototype, {
  13727. add: function (e, t) {
  13728. return g(this, e, t, {
  13729. factoryArgs: Array.prototype.slice.call(arguments, 2),
  13730. });
  13731. },
  13732. addColor: function (e, t) {
  13733. return g(this, e, t, {
  13734. color: !0,
  13735. });
  13736. },
  13737. remove: function (e) {
  13738. this.__ul.removeChild(e.__li),
  13739. this.__controllers.slice(
  13740. this.__controllers.indexOf(e),
  13741. 1
  13742. );
  13743. var t = this;
  13744. f.defer(function () {
  13745. t.onResize();
  13746. });
  13747. },
  13748. destroy: function () {
  13749. this.autoPlace && M.removeChild(this.domElement);
  13750. },
  13751. addFolder: function (e) {
  13752. if (void 0 !== this.__folders[e])
  13753. throw new Error(
  13754. 'You already have a folder in this GUI by the name "' +
  13755. e +
  13756. '"'
  13757. );
  13758. var t = {
  13759. name: e,
  13760. parent: this,
  13761. };
  13762. (t.autoPlace = this.autoPlace),
  13763. this.load &&
  13764. this.load.folders &&
  13765. this.load.folders[e] &&
  13766. ((t.closed = this.load.folders[e].closed),
  13767. (t.load = this.load.folders[e]));
  13768. var i = new V(t);
  13769. this.__folders[e] = i;
  13770. var n = m(this, i.domElement);
  13771. return p.addClass(n, "folder"), i;
  13772. },
  13773. open: function () {
  13774. this.closed = !1;
  13775. },
  13776. close: function () {
  13777. this.closed = !0;
  13778. },
  13779. onResize: function () {
  13780. var e = this.getRoot();
  13781. if (e.scrollable) {
  13782. var t = p.getOffset(e.__ul).top,
  13783. i = 0;
  13784. f.each(e.__ul.childNodes, function (t) {
  13785. (e.autoPlace && t === e.__save_row) ||
  13786. (i += p.getHeight(t));
  13787. }),
  13788. $("#player").height() - t - O < i
  13789. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  13790. (e.__ul.style.height =
  13791. $("#player").height() - t - O + "px"))
  13792. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  13793. (e.__ul.style.height = "auto"));
  13794. }
  13795. e.__resize_handle &&
  13796. f.defer(function () {
  13797. e.__resize_handle.style.height =
  13798. e.__ul.offsetHeight + "px";
  13799. }),
  13800. e.__closeButton &&
  13801. (e.__closeButton.style.width = e.width + "px");
  13802. },
  13803. remember: function () {
  13804. if (
  13805. (f.isUndefined(S) &&
  13806. ((S = new d()), (S.domElement.innerHTML = t)),
  13807. this.parent)
  13808. )
  13809. throw new Error(
  13810. "You can only call remember on a top level GUI."
  13811. );
  13812. var e = this;
  13813. f.each(Array.prototype.slice.call(arguments), function (t) {
  13814. 0 == e.__rememberedObjects.length && C(e),
  13815. e.__rememberedObjects.indexOf(t) == -1 &&
  13816. e.__rememberedObjects.push(t);
  13817. }),
  13818. this.autoPlace && E(this, this.width);
  13819. },
  13820. getRoot: function () {
  13821. for (var e = this; e.parent; ) e = e.parent;
  13822. return e;
  13823. },
  13824. getSaveObject: function () {
  13825. var e = this.load;
  13826. return (
  13827. (e.closed = this.closed),
  13828. this.__rememberedObjects.length > 0 &&
  13829. ((e.preset = this.preset),
  13830. e.remembered || (e.remembered = {}),
  13831. (e.remembered[this.preset] = b(this))),
  13832. (e.folders = {}),
  13833. f.each(this.__folders, function (t, i) {
  13834. e.folders[i] = t.getSaveObject();
  13835. }),
  13836. e
  13837. );
  13838. },
  13839. save: function () {
  13840. this.load.remembered || (this.load.remembered = {}),
  13841. (this.load.remembered[this.preset] = b(this)),
  13842. T(this, !1),
  13843. this.saveToLocalStorageIfPossible();
  13844. },
  13845. saveAs: function (e) {
  13846. this.load.remembered ||
  13847. ((this.load.remembered = {}),
  13848. (this.load.remembered[L] = b(this, !0))),
  13849. (this.load.remembered[e] = b(this)),
  13850. (this.preset = e),
  13851. w(this, e, !0),
  13852. this.saveToLocalStorageIfPossible();
  13853. },
  13854. revert: function (e) {
  13855. f.each(
  13856. this.__controllers,
  13857. function (t) {
  13858. this.getRoot().load.remembered
  13859. ? A(e || this.getRoot(), t)
  13860. : t.setValue(t.initialValue);
  13861. },
  13862. this
  13863. ),
  13864. f.each(this.__folders, function (e) {
  13865. e.revert(e);
  13866. }),
  13867. e || T(this.getRoot(), !1);
  13868. },
  13869. listen: function (e) {
  13870. var t = 0 == this.__listening.length;
  13871. this.__listening.push(e), t && x(this.__listening);
  13872. },
  13873. }),
  13874. V
  13875. );
  13876. })(
  13877. n.utils.css,
  13878. '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>',
  13879. ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n",
  13880. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  13881. return function (s, l) {
  13882. var c = s[l];
  13883. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  13884. ? new e(s, l, arguments[2])
  13885. : a.isNumber(c)
  13886. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  13887. ? new i(s, l, arguments[2], arguments[3])
  13888. : new t(s, l, {
  13889. min: arguments[2],
  13890. max: arguments[3],
  13891. })
  13892. : a.isString(c)
  13893. ? new n(s, l)
  13894. : a.isFunction(c)
  13895. ? new r(s, l, "")
  13896. : a.isBoolean(c)
  13897. ? new o(s, l)
  13898. : void 0;
  13899. };
  13900. })(
  13901. n.controllers.OptionController,
  13902. n.controllers.NumberControllerBox,
  13903. n.controllers.NumberControllerSlider,
  13904. (n.controllers.StringController = (function (e, t, i) {
  13905. var n = function (e, i) {
  13906. function r() {
  13907. a.setValue(a.__input.value);
  13908. }
  13909. function o() {
  13910. a.__onFinishChange &&
  13911. a.__onFinishChange.call(a, a.getValue());
  13912. }
  13913. n.superclass.call(this, e, i);
  13914. var a = this;
  13915. (this.__input = document.createElement("input")),
  13916. this.__input.setAttribute("type", "text"),
  13917. t.bind(this.__input, "keyup", r),
  13918. t.bind(this.__input, "change", r),
  13919. t.bind(this.__input, "blur", o),
  13920. t.bind(this.__input, "keydown", function (e) {
  13921. 13 === e.keyCode && this.blur();
  13922. }),
  13923. this.updateDisplay(),
  13924. this.domElement.appendChild(this.__input);
  13925. };
  13926. return (
  13927. (n.superclass = e),
  13928. i.extend(n.prototype, e.prototype, {
  13929. updateDisplay: function () {
  13930. return (
  13931. t.isActive(this.__input) ||
  13932. (this.__input.value = this.getValue()),
  13933. n.superclass.prototype.updateDisplay.call(this)
  13934. );
  13935. },
  13936. }),
  13937. n
  13938. );
  13939. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  13940. n.controllers.FunctionController,
  13941. n.controllers.BooleanController,
  13942. n.utils.common
  13943. )),
  13944. n.controllers.Controller,
  13945. n.controllers.BooleanController,
  13946. n.controllers.FunctionController,
  13947. n.controllers.NumberControllerBox,
  13948. n.controllers.NumberControllerSlider,
  13949. n.controllers.OptionController,
  13950. (n.controllers.ColorController = (function (e, t, i, n, r) {
  13951. function o(e, t, i, n) {
  13952. (e.style.background = ""),
  13953. r.each(l, function (r) {
  13954. e.style.cssText +=
  13955. "background: " +
  13956. r +
  13957. "linear-gradient(" +
  13958. t +
  13959. ", " +
  13960. i +
  13961. " 0%, " +
  13962. n +
  13963. " 100%); ";
  13964. });
  13965. }
  13966. function a(e) {
  13967. (e.style.background = ""),
  13968. (e.style.cssText +=
  13969. "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);"),
  13970. (e.style.cssText +=
  13971. "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
  13972. (e.style.cssText +=
  13973. "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
  13974. (e.style.cssText +=
  13975. "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"),
  13976. (e.style.cssText +=
  13977. "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);");
  13978. }
  13979. var s = function (e, l) {
  13980. function c(e) {
  13981. p(e),
  13982. t.bind(window, "mousemove", p),
  13983. t.bind(window, "mouseup", h);
  13984. }
  13985. function h() {
  13986. t.unbind(window, "mousemove", p),
  13987. t.unbind(window, "mouseup", h);
  13988. }
  13989. function u() {
  13990. var e = n(this.value);
  13991. e !== !1
  13992. ? ((g.__color.__state = e),
  13993. g.setValue(g.__color.toOriginal()))
  13994. : (this.value = g.__color.toString());
  13995. }
  13996. function d() {
  13997. t.unbind(window, "mousemove", f),
  13998. t.unbind(window, "mouseup", d);
  13999. }
  14000. function p(e) {
  14001. e.preventDefault();
  14002. var i = t.getWidth(g.__saturation_field),
  14003. n = t.getOffset(g.__saturation_field),
  14004. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  14005. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  14006. return (
  14007. o > 1 ? (o = 1) : o < 0 && (o = 0),
  14008. r > 1 ? (r = 1) : r < 0 && (r = 0),
  14009. (g.__color.v = o),
  14010. (g.__color.s = r),
  14011. g.setValue(g.__color.toOriginal()),
  14012. !1
  14013. );
  14014. }
  14015. function f(e) {
  14016. e.preventDefault();
  14017. var i = t.getHeight(g.__hue_field),
  14018. n = t.getOffset(g.__hue_field),
  14019. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  14020. return (
  14021. r > 1 ? (r = 1) : r < 0 && (r = 0),
  14022. (g.__color.h = 360 * r),
  14023. g.setValue(g.__color.toOriginal()),
  14024. !1
  14025. );
  14026. }
  14027. s.superclass.call(this, e, l),
  14028. (this.__color = new i(this.getValue())),
  14029. (this.__temp = new i(0));
  14030. var g = this;
  14031. (this.domElement = document.createElement("div")),
  14032. t.makeSelectable(this.domElement, !1),
  14033. (this.__selector = document.createElement("div")),
  14034. (this.__selector.className = "selector"),
  14035. (this.__saturation_field = document.createElement("div")),
  14036. (this.__saturation_field.className = "saturation-field"),
  14037. (this.__field_knob = document.createElement("div")),
  14038. (this.__field_knob.className = "field-knob"),
  14039. (this.__field_knob_border = "2px solid "),
  14040. (this.__hue_knob = document.createElement("div")),
  14041. (this.__hue_knob.className = "hue-knob"),
  14042. (this.__hue_field = document.createElement("div")),
  14043. (this.__hue_field.className = "hue-field"),
  14044. (this.__input = document.createElement("input")),
  14045. (this.__input.type = "text"),
  14046. (this.__input_textShadow = "0 1px 1px "),
  14047. t.bind(this.__input, "keydown", function (e) {
  14048. 13 === e.keyCode && u.call(this);
  14049. }),
  14050. t.bind(this.__input, "blur", u),
  14051. t.bind(this.__selector, "mousedown", function (e) {
  14052. t.addClass(this, "drag").bind(
  14053. window,
  14054. "mouseup",
  14055. function (e) {
  14056. t.removeClass(g.__selector, "drag");
  14057. }
  14058. );
  14059. });
  14060. var m = document.createElement("div");
  14061. r.extend(this.__selector.style, {
  14062. width: "122px",
  14063. height: "102px",
  14064. padding: "3px",
  14065. backgroundColor: "#222",
  14066. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)",
  14067. }),
  14068. r.extend(this.__field_knob.style, {
  14069. position: "absolute",
  14070. width: "12px",
  14071. height: "12px",
  14072. border:
  14073. this.__field_knob_border +
  14074. (this.__color.v < 0.5 ? "#fff" : "#000"),
  14075. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  14076. borderRadius: "12px",
  14077. zIndex: 1,
  14078. }),
  14079. r.extend(this.__hue_knob.style, {
  14080. position: "absolute",
  14081. width: "15px",
  14082. height: "2px",
  14083. borderRight: "4px solid #fff",
  14084. zIndex: 1,
  14085. }),
  14086. r.extend(this.__saturation_field.style, {
  14087. width: "100px",
  14088. height: "100px",
  14089. border: "1px solid #555",
  14090. marginRight: "3px",
  14091. display: "inline-block",
  14092. cursor: "pointer",
  14093. }),
  14094. r.extend(m.style, {
  14095. width: "100%",
  14096. height: "100%",
  14097. background: "none",
  14098. }),
  14099. o(m, "top", "rgba(0,0,0,0)", "#000"),
  14100. r.extend(this.__hue_field.style, {
  14101. width: "15px",
  14102. height: "100px",
  14103. display: "inline-block",
  14104. border: "1px solid #555",
  14105. cursor: "ns-resize",
  14106. }),
  14107. a(this.__hue_field),
  14108. r.extend(this.__input.style, {
  14109. outline: "none",
  14110. textAlign: "center",
  14111. color: "#fff",
  14112. border: 0,
  14113. fontWeight: "bold",
  14114. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)",
  14115. }),
  14116. t.bind(this.__saturation_field, "mousedown", c),
  14117. t.bind(this.__field_knob, "mousedown", c),
  14118. t.bind(this.__hue_field, "mousedown", function (e) {
  14119. f(e),
  14120. t.bind(window, "mousemove", f),
  14121. t.bind(window, "mouseup", d);
  14122. }),
  14123. this.__saturation_field.appendChild(m),
  14124. this.__selector.appendChild(this.__field_knob),
  14125. this.__selector.appendChild(this.__saturation_field),
  14126. this.__selector.appendChild(this.__hue_field),
  14127. this.__hue_field.appendChild(this.__hue_knob),
  14128. this.domElement.appendChild(this.__input),
  14129. this.domElement.appendChild(this.__selector),
  14130. this.updateDisplay();
  14131. };
  14132. (s.superclass = e),
  14133. r.extend(s.prototype, e.prototype, {
  14134. updateDisplay: function () {
  14135. var e = n(this.getValue());
  14136. if (e !== !1) {
  14137. var t = !1;
  14138. r.each(
  14139. i.COMPONENTS,
  14140. function (i) {
  14141. if (
  14142. !r.isUndefined(e[i]) &&
  14143. !r.isUndefined(this.__color.__state[i]) &&
  14144. e[i] !== this.__color.__state[i]
  14145. )
  14146. return (t = !0), {};
  14147. },
  14148. this
  14149. ),
  14150. t && r.extend(this.__color.__state, e);
  14151. }
  14152. r.extend(this.__temp.__state, this.__color.__state),
  14153. (this.__temp.a = 1);
  14154. var a =
  14155. this.__color.v < 0.5 || this.__color.s > 0.5
  14156. ? 255
  14157. : 0,
  14158. s = 255 - a;
  14159. r.extend(this.__field_knob.style, {
  14160. marginLeft: 100 * this.__color.s - 7 + "px",
  14161. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  14162. backgroundColor: this.__temp.toString(),
  14163. border:
  14164. this.__field_knob_border +
  14165. "rgb(" +
  14166. a +
  14167. "," +
  14168. a +
  14169. "," +
  14170. a +
  14171. ")",
  14172. }),
  14173. (this.__hue_knob.style.marginTop =
  14174. 100 * (1 - this.__color.h / 360) + "px"),
  14175. (this.__temp.s = 1),
  14176. (this.__temp.v = 1),
  14177. o(
  14178. this.__saturation_field,
  14179. "left",
  14180. "#fff",
  14181. this.__temp.toString()
  14182. ),
  14183. r.extend(this.__input.style, {
  14184. backgroundColor: (this.__input.value =
  14185. this.__color.toString()),
  14186. color: "rgb(" + a + "," + a + "," + a + ")",
  14187. textShadow:
  14188. this.__input_textShadow +
  14189. "rgba(" +
  14190. s +
  14191. "," +
  14192. s +
  14193. "," +
  14194. s +
  14195. ",.7)",
  14196. });
  14197. },
  14198. });
  14199. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  14200. return s;
  14201. })(
  14202. n.controllers.Controller,
  14203. n.dom.dom,
  14204. (n.color.Color = (function (e, t, i, n) {
  14205. function r(e, t, i) {
  14206. Object.defineProperty(e, t, {
  14207. get: function () {
  14208. return "RGB" === this.__state.space
  14209. ? this.__state[t]
  14210. : (a(this, t, i), this.__state[t]);
  14211. },
  14212. set: function (e) {
  14213. "RGB" !== this.__state.space &&
  14214. (a(this, t, i), (this.__state.space = "RGB")),
  14215. (this.__state[t] = e);
  14216. },
  14217. });
  14218. }
  14219. function o(e, t) {
  14220. Object.defineProperty(e, t, {
  14221. get: function () {
  14222. return "HSV" === this.__state.space
  14223. ? this.__state[t]
  14224. : (s(this), this.__state[t]);
  14225. },
  14226. set: function (e) {
  14227. "HSV" !== this.__state.space &&
  14228. (s(this), (this.__state.space = "HSV")),
  14229. (this.__state[t] = e);
  14230. },
  14231. });
  14232. }
  14233. function a(e, i, r) {
  14234. if ("HEX" === e.__state.space)
  14235. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  14236. else {
  14237. if ("HSV" !== e.__state.space)
  14238. throw "Corrupted color state";
  14239. n.extend(
  14240. e.__state,
  14241. t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v)
  14242. );
  14243. }
  14244. }
  14245. function s(e) {
  14246. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  14247. n.extend(e.__state, {
  14248. s: i.s,
  14249. v: i.v,
  14250. }),
  14251. n.isNaN(i.h)
  14252. ? n.isUndefined(e.__state.h) && (e.__state.h = 0)
  14253. : (e.__state.h = i.h);
  14254. }
  14255. var l = function () {
  14256. if (
  14257. ((this.__state = e.apply(this, arguments)),
  14258. this.__state === !1)
  14259. )
  14260. throw "Failed to interpret color arguments";
  14261. this.__state.a = this.__state.a || 1;
  14262. };
  14263. return (
  14264. (l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"]),
  14265. n.extend(l.prototype, {
  14266. toString: function () {
  14267. return i(this);
  14268. },
  14269. toOriginal: function () {
  14270. return this.__state.conversion.write(this);
  14271. },
  14272. }),
  14273. r(l.prototype, "r", 2),
  14274. r(l.prototype, "g", 1),
  14275. r(l.prototype, "b", 0),
  14276. o(l.prototype, "h"),
  14277. o(l.prototype, "s"),
  14278. o(l.prototype, "v"),
  14279. Object.defineProperty(l.prototype, "a", {
  14280. get: function () {
  14281. return this.__state.a;
  14282. },
  14283. set: function (e) {
  14284. this.__state.a = e;
  14285. },
  14286. }),
  14287. Object.defineProperty(l.prototype, "hex", {
  14288. get: function () {
  14289. return (
  14290. "HEX" !== !this.__state.space &&
  14291. (this.__state.hex = t.rgb_to_hex(
  14292. this.r,
  14293. this.g,
  14294. this.b
  14295. )),
  14296. this.__state.hex
  14297. );
  14298. },
  14299. set: function (e) {
  14300. (this.__state.space = "HEX"), (this.__state.hex = e);
  14301. },
  14302. }),
  14303. l
  14304. );
  14305. })(
  14306. n.color.interpret,
  14307. (n.color.math = (function () {
  14308. var e;
  14309. return {
  14310. hsv_to_rgb: function (e, t, i) {
  14311. var n = Math.floor(e / 60) % 6,
  14312. r = e / 60 - Math.floor(e / 60),
  14313. o = i * (1 - t),
  14314. a = i * (1 - r * t),
  14315. s = i * (1 - (1 - r) * t),
  14316. l = [
  14317. [i, s, o],
  14318. [a, i, o],
  14319. [o, i, s],
  14320. [o, a, i],
  14321. [s, o, i],
  14322. [i, o, a],
  14323. ][n];
  14324. return {
  14325. r: 255 * l[0],
  14326. g: 255 * l[1],
  14327. b: 255 * l[2],
  14328. };
  14329. },
  14330. rgb_to_hsv: function (e, t, i) {
  14331. var n,
  14332. r,
  14333. o = Math.min(e, t, i),
  14334. a = Math.max(e, t, i),
  14335. s = a - o;
  14336. return 0 == a
  14337. ? {
  14338. h: NaN,
  14339. s: 0,
  14340. v: 0,
  14341. }
  14342. : ((r = s / a),
  14343. (n =
  14344. e == a
  14345. ? (t - i) / s
  14346. : t == a
  14347. ? 2 + (i - e) / s
  14348. : 4 + (e - t) / s),
  14349. (n /= 6),
  14350. n < 0 && (n += 1),
  14351. {
  14352. h: 360 * n,
  14353. s: r,
  14354. v: a / 255,
  14355. });
  14356. },
  14357. rgb_to_hex: function (e, t, i) {
  14358. var n = this.hex_with_component(0, 2, e);
  14359. return (
  14360. (n = this.hex_with_component(n, 1, t)),
  14361. (n = this.hex_with_component(n, 0, i))
  14362. );
  14363. },
  14364. component_from_hex: function (e, t) {
  14365. return (e >> (8 * t)) & 255;
  14366. },
  14367. hex_with_component: function (t, i, n) {
  14368. return (n << (e = 8 * i)) | (t & ~(255 << e));
  14369. },
  14370. };
  14371. })()),
  14372. n.color.toString,
  14373. n.utils.common
  14374. )),
  14375. n.color.interpret,
  14376. n.utils.common
  14377. )),
  14378. (n.utils.requestAnimationFrame = (function () {
  14379. return (
  14380. window.requestAnimationFrame ||
  14381. window.webkitRequestAnimationFrame ||
  14382. window.mozRequestAnimationFrame ||
  14383. window.oRequestAnimationFrame ||
  14384. window.msRequestAnimationFrame ||
  14385. function (e, t) {
  14386. window.setTimeout(e, 1e3 / 60);
  14387. }
  14388. );
  14389. })()),
  14390. (n.dom.CenteredDiv = (function (e, t) {
  14391. var i = function () {
  14392. (this.backgroundElement = document.createElement("div")),
  14393. t.extend(this.backgroundElement.style, {
  14394. backgroundColor: "rgba(0,0,0,0.8)",
  14395. top: 0,
  14396. left: 0,
  14397. display: "none",
  14398. zIndex: "1000",
  14399. opacity: 0,
  14400. WebkitTransition: "opacity 0.2s linear",
  14401. }),
  14402. e.makeFullscreen(this.backgroundElement),
  14403. (this.backgroundElement.style.position = "fixed"),
  14404. (this.domElement = document.createElement("div")),
  14405. t.extend(this.domElement.style, {
  14406. position: "fixed",
  14407. display: "none",
  14408. zIndex: "1001",
  14409. opacity: 0,
  14410. WebkitTransition:
  14411. "-webkit-transform 0.2s ease-out, opacity 0.2s linear",
  14412. }),
  14413. document.body.appendChild(this.backgroundElement),
  14414. document.body.appendChild(this.domElement);
  14415. var i = this;
  14416. e.bind(this.backgroundElement, "click", function () {
  14417. i.hide();
  14418. });
  14419. };
  14420. return (
  14421. (i.prototype.show = function () {
  14422. var e = this;
  14423. (this.backgroundElement.style.display = "block"),
  14424. (this.domElement.style.display = "block"),
  14425. (this.domElement.style.opacity = 0),
  14426. (this.domElement.style.webkitTransform = "scale(1.1)"),
  14427. this.layout(),
  14428. t.defer(function () {
  14429. (e.backgroundElement.style.opacity = 1),
  14430. (e.domElement.style.opacity = 1),
  14431. (e.domElement.style.webkitTransform = "scale(1)");
  14432. });
  14433. }),
  14434. (i.prototype.hide = function () {
  14435. var t = this,
  14436. i = function () {
  14437. (t.domElement.style.display = "none"),
  14438. (t.backgroundElement.style.display = "none"),
  14439. e.unbind(t.domElement, "webkitTransitionEnd", i),
  14440. e.unbind(t.domElement, "transitionend", i),
  14441. e.unbind(t.domElement, "oTransitionEnd", i);
  14442. };
  14443. e.bind(this.domElement, "webkitTransitionEnd", i),
  14444. e.bind(this.domElement, "transitionend", i),
  14445. e.bind(this.domElement, "oTransitionEnd", i),
  14446. (this.backgroundElement.style.opacity = 0),
  14447. (this.domElement.style.opacity = 0),
  14448. (this.domElement.style.webkitTransform = "scale(1.1)");
  14449. }),
  14450. (i.prototype.layout = function () {
  14451. (this.domElement.style.left =
  14452. $("#player").width() / 2 -
  14453. e.getWidth(this.domElement) / 2 +
  14454. "px"),
  14455. (this.domElement.style.top =
  14456. $("#player").height() / 2 -
  14457. e.getHeight(this.domElement) / 2 +
  14458. "px");
  14459. }),
  14460. i
  14461. );
  14462. })(n.dom.dom, n.utils.common)),
  14463. n.dom.dom,
  14464. n.utils.common
  14465. ));
  14466. },
  14467. {},
  14468. ],
  14469. 94: [
  14470. function (e, t, i) {
  14471. (function (e) {
  14472. "use strict";
  14473. function i(t) {
  14474. function i(e) {
  14475. for (
  14476. var t = [
  14477. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60,
  14478. 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87,
  14479. 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64,
  14480. 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72,
  14481. 92, 95, 98, 112, 100, 103, 99,
  14482. ],
  14483. i = 0;
  14484. i < 64;
  14485. i++
  14486. ) {
  14487. var n = _((t[i] * e + 50) / 100);
  14488. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n);
  14489. }
  14490. for (
  14491. var r = [
  14492. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99,
  14493. 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99,
  14494. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  14495. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  14496. 99, 99, 99, 99,
  14497. ],
  14498. o = 0;
  14499. o < 64;
  14500. o++
  14501. ) {
  14502. var a = _((r[o] * e + 50) / 100);
  14503. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a);
  14504. }
  14505. for (
  14506. var s = [
  14507. 1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958,
  14508. 0.5411961, 0.275899379,
  14509. ],
  14510. l = 0,
  14511. c = 0;
  14512. c < 8;
  14513. c++
  14514. )
  14515. for (var h = 0; h < 8; h++)
  14516. (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)),
  14517. (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)),
  14518. l++;
  14519. }
  14520. function n(e, t) {
  14521. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  14522. for (var a = 1; a <= e[o]; a++)
  14523. (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++;
  14524. i *= 2;
  14525. }
  14526. return r;
  14527. }
  14528. function r() {
  14529. (C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K));
  14530. }
  14531. function o() {
  14532. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  14533. for (var n = e; n < t; n++)
  14534. (P[32767 + n] = i),
  14535. (R[32767 + n] = []),
  14536. (R[32767 + n][1] = i),
  14537. (R[32767 + n][0] = n);
  14538. for (var r = -(t - 1); r <= -e; r++)
  14539. (P[32767 + r] = i),
  14540. (R[32767 + r] = []),
  14541. (R[32767 + r][1] = i),
  14542. (R[32767 + r][0] = t - 1 + r);
  14543. (e <<= 1), (t <<= 1);
  14544. }
  14545. }
  14546. function a() {
  14547. for (var e = 0; e < 256; e++)
  14548. (H[e] = 19595 * e),
  14549. (H[(e + 256) >> 0] = 38470 * e),
  14550. (H[(e + 512) >> 0] = 7471 * e + 32768),
  14551. (H[(e + 768) >> 0] = -11059 * e),
  14552. (H[(e + 1024) >> 0] = -21709 * e),
  14553. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  14554. (H[(e + 1536) >> 0] = -27439 * e),
  14555. (H[(e + 1792) >> 0] = -5329 * e);
  14556. }
  14557. function s(e) {
  14558. for (var t = e[0], i = e[1] - 1; i >= 0; )
  14559. t & (1 << i) && (N |= 1 << B),
  14560. i--,
  14561. B--,
  14562. B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0));
  14563. }
  14564. function l(e) {
  14565. D.push(e);
  14566. }
  14567. function c(e) {
  14568. l((e >> 8) & 255), l(255 & e);
  14569. }
  14570. function h(e, t) {
  14571. var i,
  14572. n,
  14573. r,
  14574. o,
  14575. a,
  14576. s,
  14577. l,
  14578. c,
  14579. h,
  14580. u = 0,
  14581. d = 8,
  14582. p = 64;
  14583. for (h = 0; h < d; ++h) {
  14584. (i = e[u]),
  14585. (n = e[u + 1]),
  14586. (r = e[u + 2]),
  14587. (o = e[u + 3]),
  14588. (a = e[u + 4]),
  14589. (s = e[u + 5]),
  14590. (l = e[u + 6]),
  14591. (c = e[u + 7]);
  14592. var f = i + c,
  14593. g = i - c,
  14594. m = n + l,
  14595. v = n - l,
  14596. A = r + s,
  14597. y = r - s,
  14598. C = o + a,
  14599. I = o - a,
  14600. E = f + C,
  14601. b = f - C,
  14602. w = m + A,
  14603. _ = m - A;
  14604. (e[u] = E + w), (e[u + 4] = E - w);
  14605. var T = 0.707106781 * (_ + b);
  14606. (e[u + 2] = b + T),
  14607. (e[u + 6] = b - T),
  14608. (E = I + y),
  14609. (w = y + v),
  14610. (_ = v + g);
  14611. var x = 0.382683433 * (E - _),
  14612. S = 0.5411961 * E + x,
  14613. M = 1.306562965 * _ + x,
  14614. R = 0.707106781 * w,
  14615. P = g + R,
  14616. L = g - R;
  14617. (e[u + 5] = L + S),
  14618. (e[u + 3] = L - S),
  14619. (e[u + 1] = P + M),
  14620. (e[u + 7] = P - M),
  14621. (u += 8);
  14622. }
  14623. for (u = 0, h = 0; h < d; ++h) {
  14624. (i = e[u]),
  14625. (n = e[u + 8]),
  14626. (r = e[u + 16]),
  14627. (o = e[u + 24]),
  14628. (a = e[u + 32]),
  14629. (s = e[u + 40]),
  14630. (l = e[u + 48]),
  14631. (c = e[u + 56]);
  14632. var D = i + c,
  14633. N = i - c,
  14634. B = n + l,
  14635. F = n - l,
  14636. V = r + s,
  14637. U = r - s,
  14638. k = o + a,
  14639. H = o - a,
  14640. G = D + k,
  14641. z = D - k,
  14642. W = B + V,
  14643. j = B - V;
  14644. (e[u] = G + W), (e[u + 32] = G - W);
  14645. var Y = 0.707106781 * (j + z);
  14646. (e[u + 16] = z + Y),
  14647. (e[u + 48] = z - Y),
  14648. (G = H + U),
  14649. (W = U + F),
  14650. (j = F + N);
  14651. var X = 0.382683433 * (G - j),
  14652. Z = 0.5411961 * G + X,
  14653. q = 1.306562965 * j + X,
  14654. K = 0.707106781 * W,
  14655. Q = N + K,
  14656. J = N - K;
  14657. (e[u + 40] = J + Z),
  14658. (e[u + 24] = J - Z),
  14659. (e[u + 8] = Q + q),
  14660. (e[u + 56] = Q - q),
  14661. u++;
  14662. }
  14663. var $;
  14664. for (h = 0; h < p; ++h)
  14665. ($ = e[h] * t[h]),
  14666. (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0);
  14667. return O;
  14668. }
  14669. function u() {
  14670. c(65504),
  14671. c(16),
  14672. l(74),
  14673. l(70),
  14674. l(73),
  14675. l(70),
  14676. l(0),
  14677. l(1),
  14678. l(1),
  14679. l(0),
  14680. c(1),
  14681. c(1),
  14682. l(0),
  14683. l(0);
  14684. }
  14685. function d(e, t) {
  14686. c(65472),
  14687. c(17),
  14688. l(8),
  14689. c(t),
  14690. c(e),
  14691. l(3),
  14692. l(1),
  14693. l(17),
  14694. l(0),
  14695. l(2),
  14696. l(17),
  14697. l(1),
  14698. l(3),
  14699. l(17),
  14700. l(1);
  14701. }
  14702. function p() {
  14703. c(65499), c(132), l(0);
  14704. for (var e = 0; e < 64; e++) l(T[e]);
  14705. l(1);
  14706. for (var t = 0; t < 64; t++) l(x[t]);
  14707. }
  14708. function f() {
  14709. c(65476), c(418), l(0);
  14710. for (var e = 0; e < 16; e++) l(z[e + 1]);
  14711. for (var t = 0; t <= 11; t++) l(W[t]);
  14712. l(16);
  14713. for (var i = 0; i < 16; i++) l(j[i + 1]);
  14714. for (var n = 0; n <= 161; n++) l(Y[n]);
  14715. l(1);
  14716. for (var r = 0; r < 16; r++) l(X[r + 1]);
  14717. for (var o = 0; o <= 11; o++) l(Z[o]);
  14718. l(17);
  14719. for (var a = 0; a < 16; a++) l(q[a + 1]);
  14720. for (var s = 0; s <= 161; s++) l(K[s]);
  14721. }
  14722. function g() {
  14723. c(65498),
  14724. c(12),
  14725. l(3),
  14726. l(1),
  14727. l(0),
  14728. l(2),
  14729. l(17),
  14730. l(3),
  14731. l(17),
  14732. l(0),
  14733. l(63),
  14734. l(0);
  14735. }
  14736. function m(e, t, i, n, r) {
  14737. for (
  14738. var o,
  14739. a = r[0],
  14740. l = r[240],
  14741. c = 16,
  14742. u = 63,
  14743. d = 64,
  14744. p = h(e, t),
  14745. f = 0;
  14746. f < d;
  14747. ++f
  14748. )
  14749. L[G[f]] = p[f];
  14750. var g = L[0] - i;
  14751. (i = L[0]),
  14752. 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]));
  14753. for (var m = 63; m > 0 && 0 == L[m]; m--);
  14754. if (0 == m) return s(a), i;
  14755. for (var v, A = 1; A <= m; ) {
  14756. for (var y = A; 0 == L[A] && A <= m; ++A);
  14757. var C = A - y;
  14758. if (C >= c) {
  14759. v = C >> 4;
  14760. for (var I = 1; I <= v; ++I) s(l);
  14761. C &= 15;
  14762. }
  14763. (o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++;
  14764. }
  14765. return m != u && s(a), i;
  14766. }
  14767. function v() {
  14768. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  14769. k[t] = e(t);
  14770. }
  14771. function A(e) {
  14772. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  14773. var t = 0;
  14774. (t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  14775. i(t),
  14776. (w = e);
  14777. }
  14778. }
  14779. function y() {
  14780. var e = new Date().getTime();
  14781. t || (t = 50), v(), r(), o(), a(), A(t);
  14782. new Date().getTime() - e;
  14783. }
  14784. var C,
  14785. I,
  14786. E,
  14787. b,
  14788. w,
  14789. _ = (Math.round, Math.floor),
  14790. T = new Array(64),
  14791. x = new Array(64),
  14792. S = new Array(64),
  14793. M = new Array(64),
  14794. R = new Array(65535),
  14795. P = new Array(65535),
  14796. O = new Array(64),
  14797. L = new Array(64),
  14798. D = [],
  14799. N = 0,
  14800. B = 7,
  14801. F = new Array(64),
  14802. V = new Array(64),
  14803. U = new Array(64),
  14804. k = new Array(256),
  14805. H = new Array(2048),
  14806. G = [
  14807. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8,
  14808. 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19,
  14809. 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34,
  14810. 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63,
  14811. ],
  14812. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  14813. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  14814. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  14815. Y = [
  14816. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113,
  14817. 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240,
  14818. 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40,
  14819. 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73,
  14820. 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104,
  14821. 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133,
  14822. 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153,
  14823. 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180,
  14824. 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200,
  14825. 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226,
  14826. 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245,
  14827. 246, 247, 248, 249, 250,
  14828. ],
  14829. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  14830. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  14831. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  14832. K = [
  14833. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34,
  14834. 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21,
  14835. 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38,
  14836. 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72,
  14837. 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103,
  14838. 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131,
  14839. 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151,
  14840. 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178,
  14841. 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198,
  14842. 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218,
  14843. 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245,
  14844. 246, 247, 248, 249, 250,
  14845. ];
  14846. (this.encode = function (t, i) {
  14847. var n = (new Date().getTime(), i.quality);
  14848. n && A(n),
  14849. (D = new Array()),
  14850. (N = 0),
  14851. (B = 7),
  14852. c(65496),
  14853. u(),
  14854. p(),
  14855. d(t.width, t.height),
  14856. f(),
  14857. g();
  14858. var r = 0,
  14859. o = 0,
  14860. a = 0;
  14861. (N = 0), (B = 7), (this.encode.displayName = "_encode_");
  14862. for (
  14863. var l,
  14864. h,
  14865. v,
  14866. y,
  14867. w,
  14868. _,
  14869. T,
  14870. x,
  14871. R,
  14872. P = t.data,
  14873. O = t.width,
  14874. L = t.height,
  14875. k = i.flipY,
  14876. G = 4 * O,
  14877. z = k ? L : 0,
  14878. W = k ? -8 : 8;
  14879. (k && z > 0) || (!k && z < L);
  14880. ) {
  14881. for (l = 0; l < G; ) {
  14882. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  14883. (x = (k ? 63 - R : R) >> 3),
  14884. (T = 4 * (7 & R)),
  14885. (_ = w + x * G + T),
  14886. z + x >= L && (_ -= G * (z + 1 + x - L)),
  14887. l + T >= G && (_ -= l + T - G + 4),
  14888. (h = P[_++]),
  14889. (v = P[_++]),
  14890. (y = P[_++]),
  14891. (F[R] =
  14892. ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) -
  14893. 128),
  14894. (V[R] =
  14895. ((H[(h + 768) >> 0] +
  14896. H[(v + 1024) >> 0] +
  14897. H[(y + 1280) >> 0]) >>
  14898. 16) -
  14899. 128),
  14900. (U[R] =
  14901. ((H[(h + 1280) >> 0] +
  14902. H[(v + 1536) >> 0] +
  14903. H[(y + 1792) >> 0]) >>
  14904. 16) -
  14905. 128);
  14906. (r = m(F, S, r, C, E)),
  14907. (o = m(V, M, o, I, b)),
  14908. (a = m(U, M, a, I, b)),
  14909. (l += 32);
  14910. }
  14911. z += W;
  14912. }
  14913. if (B >= 0) {
  14914. var j = [];
  14915. (j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j);
  14916. }
  14917. return c(65497), new e(D);
  14918. }),
  14919. y();
  14920. }
  14921. function n(e, t) {
  14922. (t = t || {}), (t.quality = t.quality || 50);
  14923. var n = t.quality,
  14924. r = new i(n),
  14925. o = r.encode(e, t);
  14926. return {
  14927. data: o,
  14928. width: e.width,
  14929. height: e.height,
  14930. };
  14931. }
  14932. t.exports.encode = n;
  14933. }).call(this, e("buffer").Buffer);
  14934. },
  14935. {
  14936. buffer: 198,
  14937. },
  14938. ],
  14939. 95: [
  14940. function (e, t, i) {
  14941. "use strict";
  14942. !(function () {
  14943. if (
  14944. ("performance" in window == !1 && (window.performance = {}),
  14945. (Date.now =
  14946. Date.now ||
  14947. function () {
  14948. return new Date().getTime();
  14949. }),
  14950. "now" in window.performance == !1)
  14951. ) {
  14952. var e = Date.now();
  14953. performance.timing &&
  14954. performance.timing.navigationStart &&
  14955. (e = performance.timing.navigationStart),
  14956. (window.performance.now = function () {
  14957. return Date.now() - e;
  14958. });
  14959. }
  14960. })();
  14961. },
  14962. {},
  14963. ],
  14964. 96: [
  14965. function (e, t, i) {
  14966. "use strict";
  14967. var n = e("three");
  14968. (n.EffectComposer = function (e, t) {
  14969. if (((this.renderer = e), void 0 === t)) {
  14970. var i = {
  14971. minFilter: n.LinearFilter,
  14972. magFilter: n.LinearFilter,
  14973. format: n.RGBAFormat,
  14974. stencilBuffer: !1,
  14975. },
  14976. r = e.getSize();
  14977. t = new n.WebGLRenderTarget(r.width, r.height, i);
  14978. }
  14979. (this.renderTarget1 = t),
  14980. (this.renderTarget2 = t.clone()),
  14981. (this.writeBuffer = this.renderTarget1),
  14982. (this.readBuffer = this.renderTarget2),
  14983. (this.passes = []),
  14984. void 0 === n.CopyShader &&
  14985. console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  14986. (this.copyPass = new n.ShaderPass(n.CopyShader));
  14987. }),
  14988. (n.EffectComposer.prototype = {
  14989. swapBuffers: function () {
  14990. var e = this.readBuffer;
  14991. (this.readBuffer = this.writeBuffer), (this.writeBuffer = e);
  14992. },
  14993. addPass: function (e) {
  14994. this.passes.push(e);
  14995. },
  14996. insertPass: function (e, t) {
  14997. this.passes.splice(t, 0, e);
  14998. },
  14999. render: function (e) {
  15000. (this.writeBuffer = this.renderTarget1),
  15001. (this.readBuffer = this.renderTarget2);
  15002. var t,
  15003. i,
  15004. r = !1,
  15005. o = this.passes.length;
  15006. for (i = 0; i < o; i++)
  15007. if (((t = this.passes[i]), t.enabled)) {
  15008. if (
  15009. (t.render(
  15010. this.renderer,
  15011. this.writeBuffer,
  15012. this.readBuffer,
  15013. e,
  15014. r
  15015. ),
  15016. t.needsSwap)
  15017. ) {
  15018. if (r) {
  15019. var a = this.renderer.context;
  15020. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  15021. this.copyPass.render(
  15022. this.renderer,
  15023. this.writeBuffer,
  15024. this.readBuffer,
  15025. e
  15026. ),
  15027. a.stencilFunc(a.EQUAL, 1, 4294967295);
  15028. }
  15029. this.swapBuffers();
  15030. }
  15031. t instanceof n.MaskPass
  15032. ? (r = !0)
  15033. : t instanceof n.ClearMaskPass && (r = !1);
  15034. }
  15035. },
  15036. reset: function (e) {
  15037. if (void 0 === e) {
  15038. var t = this.renderer.getSize();
  15039. (e = this.renderTarget1.clone()), e.setSize(t.width, t.height);
  15040. }
  15041. this.renderTarget1.dispose(),
  15042. this.renderTarget2.dispose(),
  15043. (this.renderTarget1 = e),
  15044. (this.renderTarget2 = e.clone()),
  15045. (this.writeBuffer = this.renderTarget1),
  15046. (this.readBuffer = this.renderTarget2);
  15047. },
  15048. setSize: function (e, t) {
  15049. this.renderTarget1.setSize(e, t),
  15050. this.renderTarget2.setSize(e, t);
  15051. this.passes.forEach((a) => {
  15052. //add for TransitionPass
  15053. a.setSize && a.setSize(e, t);
  15054. });
  15055. },
  15056. });
  15057. },
  15058. {
  15059. three: 217,
  15060. },
  15061. ],
  15062. 97: [
  15063. function (e, t, i) {
  15064. "use strict";
  15065. var n = e("three");
  15066. (n.MaskPass = function (e, t) {
  15067. (this.scene = e),
  15068. (this.camera = t),
  15069. (this.enabled = !0),
  15070. (this.clear = !0),
  15071. (this.needsSwap = !1),
  15072. (this.inverse = !1);
  15073. }),
  15074. (n.MaskPass.prototype = {
  15075. render: function (e, t, i, n) {
  15076. var r = e.context;
  15077. r.colorMask(!1, !1, !1, !1), r.depthMask(!1);
  15078. var o, a;
  15079. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  15080. r.enable(r.STENCIL_TEST),
  15081. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  15082. r.stencilFunc(r.ALWAYS, o, 4294967295),
  15083. r.clearStencil(a),
  15084. e.render(this.scene, this.camera, i, this.clear),
  15085. e.render(this.scene, this.camera, t, this.clear),
  15086. r.colorMask(!0, !0, !0, !0),
  15087. r.depthMask(!0),
  15088. r.stencilFunc(r.EQUAL, 1, 4294967295),
  15089. r.stencilOp(r.KEEP, r.KEEP, r.KEEP);
  15090. },
  15091. }),
  15092. (n.ClearMaskPass = function () {
  15093. this.enabled = !0;
  15094. }),
  15095. (n.ClearMaskPass.prototype = {
  15096. render: function (e, t, i, n) {
  15097. var r = e.context;
  15098. r.disable(r.STENCIL_TEST);
  15099. },
  15100. });
  15101. },
  15102. {
  15103. three: 217,
  15104. },
  15105. ],
  15106. 98: [
  15107. function (e, t, i) {
  15108. "use strict";
  15109. var n = e("three");
  15110. (n.RenderPass = function (e, t, i, r, o) {
  15111. (this.scene = e),
  15112. (this.camera = t),
  15113. (this.overrideMaterial = i),
  15114. (this.clearColor = r),
  15115. (this.clearAlpha = void 0 !== o ? o : 1),
  15116. (this.oldClearColor = new n.Color()),
  15117. (this.oldClearAlpha = 1),
  15118. (this.enabled = !0),
  15119. (this.clear = !0),
  15120. (this.needsSwap = !1);
  15121. }),
  15122. (n.RenderPass.prototype = {
  15123. render: function (e, t, i, n) {
  15124. (this.scene.overrideMaterial = this.overrideMaterial),
  15125. this.clearColor &&
  15126. (this.oldClearColor.copy(e.getClearColor()),
  15127. (this.oldClearAlpha = e.getClearAlpha()),
  15128. e.setClearColor(this.clearColor, this.clearAlpha)),
  15129. e.render(this.scene, this.camera, i, this.clear),
  15130. this.clearColor &&
  15131. e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  15132. (this.scene.overrideMaterial = null);
  15133. },
  15134. });
  15135. },
  15136. {
  15137. three: 217,
  15138. },
  15139. ],
  15140. 99: [
  15141. function (e, t, i) {
  15142. "use strict";
  15143. var n = e("three");
  15144. (n.ShaderPass = function (e, t) {
  15145. (this.textureID = void 0 !== t ? t : "tDiffuse"),
  15146. e instanceof n.ShaderMaterial
  15147. ? ((this.uniforms = e.uniforms), (this.material = e))
  15148. : e &&
  15149. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  15150. (this.material = new n.ShaderMaterial({
  15151. defines: e.defines || {},
  15152. uniforms: this.uniforms,
  15153. vertexShader: e.vertexShader,
  15154. fragmentShader: e.fragmentShader,
  15155. }))),
  15156. (this.renderToScreen = !1),
  15157. (this.enabled = !0),
  15158. (this.needsSwap = !0),
  15159. (this.clear = !1),
  15160. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  15161. (this.scene = new n.Scene()),
  15162. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  15163. this.scene.add(this.quad);
  15164. }),
  15165. (n.ShaderPass.prototype = {
  15166. render: function (e, t, i, n) {
  15167. this.uniforms[this.textureID] &&
  15168. (this.uniforms[this.textureID].value = i),
  15169. (this.quad.material = this.material),
  15170. this.renderToScreen
  15171. ? e.render(this.scene, this.camera)
  15172. : e.render(this.scene, this.camera, t, this.clear);
  15173. },
  15174. });
  15175. },
  15176. {
  15177. three: 217,
  15178. },
  15179. ],
  15180. 100: [
  15181. function (e, t, i) {
  15182. "use strict";
  15183. var n = e("three");
  15184. n.CopyShader = {
  15185. uniforms: {
  15186. tDiffuse: {
  15187. type: "t",
  15188. value: null,
  15189. },
  15190. opacity: {
  15191. type: "f",
  15192. value: 1,
  15193. },
  15194. },
  15195. vertexShader: [
  15196. "varying vec2 vUv;",
  15197. "void main() {",
  15198. "vUv = uv;",
  15199. "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  15200. "}",
  15201. ].join("\n"),
  15202. fragmentShader: [
  15203. "uniform float opacity;",
  15204. "uniform sampler2D tDiffuse;",
  15205. "varying vec2 vUv;",
  15206. "void main() {",
  15207. "vec4 texel = texture2D( tDiffuse, vUv );",
  15208. "gl_FragColor = opacity * texel;",
  15209. "}",
  15210. ].join("\n"),
  15211. };
  15212. },
  15213. {
  15214. three: 217,
  15215. },
  15216. ],
  15217. 101: [
  15218. function (e, t, i) {
  15219. "use strict";
  15220. var n = e("three");
  15221. n.HorizontalBlurShader = {
  15222. uniforms: {
  15223. tDiffuse: {
  15224. type: "t",
  15225. value: null,
  15226. },
  15227. h: {
  15228. type: "f",
  15229. value: 1 / 512,
  15230. },
  15231. },
  15232. vertexShader: [
  15233. "varying vec2 vUv;",
  15234. "void main() {",
  15235. "vUv = uv;",
  15236. "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  15237. "}",
  15238. ].join("\n"),
  15239. fragmentShader: [
  15240. "uniform sampler2D tDiffuse;",
  15241. "uniform float h;",
  15242. "varying vec2 vUv;",
  15243. "void main() {",
  15244. "vec4 sum = vec4( 0.0 );",
  15245. "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;",
  15246. "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;",
  15247. "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;",
  15248. "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;",
  15249. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
  15250. "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;",
  15251. "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;",
  15252. "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;",
  15253. "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;",
  15254. "gl_FragColor = sum;",
  15255. "}",
  15256. ].join("\n"),
  15257. };
  15258. },
  15259. {
  15260. three: 217,
  15261. },
  15262. ],
  15263. 102: [
  15264. function (e, t, i) {
  15265. "use strict";
  15266. var n = e("three");
  15267. n.VerticalBlurShader = {
  15268. uniforms: {
  15269. tDiffuse: {
  15270. type: "t",
  15271. value: null,
  15272. },
  15273. v: {
  15274. type: "f",
  15275. value: 1 / 512,
  15276. },
  15277. },
  15278. vertexShader: [
  15279. "varying vec2 vUv;",
  15280. "void main() {",
  15281. "vUv = uv;",
  15282. "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  15283. "}",
  15284. ].join("\n"),
  15285. fragmentShader: [
  15286. "uniform sampler2D tDiffuse;",
  15287. "uniform float v;",
  15288. "varying vec2 vUv;",
  15289. "void main() {",
  15290. "vec4 sum = vec4( 0.0 );",
  15291. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;",
  15292. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;",
  15293. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;",
  15294. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;",
  15295. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;",
  15296. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;",
  15297. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;",
  15298. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;",
  15299. "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;",
  15300. "gl_FragColor = sum;",
  15301. "}",
  15302. ].join("\n"),
  15303. };
  15304. },
  15305. {
  15306. three: 217,
  15307. },
  15308. ],
  15309. 103: [
  15310. function (e, t, i) {
  15311. "use strict";
  15312. var n = e("three");
  15313. !(function () {
  15314. if (
  15315. ("performance" in window == 0 && (window.performance = {}),
  15316. "now" in window.performance == 0)
  15317. ) {
  15318. var e = Date.now();
  15319. performance.timing &&
  15320. performance.timing.navigationStart &&
  15321. (e = performance.timing.navigationStart),
  15322. (window.performance.now = function () {
  15323. return Date.now() - e;
  15324. });
  15325. }
  15326. })(),
  15327. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  15328. var t,
  15329. i = this.extensions,
  15330. r = this.context;
  15331. if (e === n.RepeatWrapping) return r.REPEAT;
  15332. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE;
  15333. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT;
  15334. if (e === n.NearestFilter) return r.NEAREST;
  15335. if (e === n.NearestMipMapNearestFilter)
  15336. return r.NEAREST_MIPMAP_NEAREST;
  15337. if (e === n.NearestMipMapLinearFilter)
  15338. return r.NEAREST_MIPMAP_LINEAR;
  15339. if (e === n.LinearFilter) return r.LINEAR;
  15340. if (e === n.LinearMipMapNearestFilter)
  15341. return r.LINEAR_MIPMAP_NEAREST;
  15342. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR;
  15343. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE;
  15344. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4;
  15345. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1;
  15346. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5;
  15347. if (e === n.ByteType) return r.BYTE;
  15348. if (e === n.ShortType) return r.SHORT;
  15349. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT;
  15350. if (e === n.IntType) return r.INT;
  15351. if (e === n.UnsignedIntType) return r.UNSIGNED_INT;
  15352. if (e === n.FloatType) return r.FLOAT;
  15353. if (
  15354. ((t = i.get("OES_texture_half_float")),
  15355. null !== t && e === n.HalfFloatType)
  15356. )
  15357. return t.HALF_FLOAT_OES;
  15358. if (e === n.AlphaFormat) return r.ALPHA;
  15359. if (e === n.RGBFormat) return r.RGB;
  15360. if (e === n.RGBAFormat) return r.RGBA;
  15361. if (e === n.LuminanceFormat) return r.LUMINANCE;
  15362. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA;
  15363. if (e === n.AddEquation) return r.FUNC_ADD;
  15364. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT;
  15365. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT;
  15366. if (e === n.ZeroFactor) return r.ZERO;
  15367. if (e === n.OneFactor) return r.ONE;
  15368. if (e === n.SrcColorFactor) return r.SRC_COLOR;
  15369. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR;
  15370. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA;
  15371. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA;
  15372. if (e === n.DstAlphaFactor) return r.DST_ALPHA;
  15373. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA;
  15374. if (e === n.DstColorFactor) return r.DST_COLOR;
  15375. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR;
  15376. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE;
  15377. if (((t = i.get("WEBGL_compressed_texture_s3tc")), null !== t)) {
  15378. if (e === n.RGB_S3TC_DXT1_Format)
  15379. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  15380. if (e === n.RGBA_S3TC_DXT1_Format)
  15381. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  15382. if (e === n.RGBA_S3TC_DXT3_Format)
  15383. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  15384. if (e === n.RGBA_S3TC_DXT5_Format)
  15385. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  15386. }
  15387. if (((t = i.get("WEBGL_compressed_texture_pvrtc")), null !== t)) {
  15388. if (e === n.RGB_PVRTC_4BPPV1_Format)
  15389. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  15390. if (e === n.RGB_PVRTC_2BPPV1_Format)
  15391. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  15392. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  15393. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  15394. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  15395. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  15396. }
  15397. if (
  15398. ((t = i.get("WEBGL_compressed_texture_etc1")),
  15399. null !== t && e === n.RGB_ETC1_Format)
  15400. )
  15401. return t.COMPRESSED_RGB_ETC1_WEBGL;
  15402. if (((t = i.get("EXT_blend_minmax")), null !== t)) {
  15403. if (e === n.MinEquation) return t.MIN_EXT;
  15404. if (e === n.MaxEquation) return t.MAX_EXT;
  15405. }
  15406. return 0;
  15407. }),
  15408. (n.WebGLState = function (e, t, i) {
  15409. var r = this,
  15410. o = new n.Vector4(),
  15411. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  15412. s = new Uint8Array(a),
  15413. l = new Uint8Array(a),
  15414. c = new Uint8Array(a),
  15415. h = {},
  15416. u = null,
  15417. d = null,
  15418. p = null,
  15419. f = null,
  15420. g = null,
  15421. m = null,
  15422. v = null,
  15423. A = null,
  15424. y = !1,
  15425. C = null,
  15426. I = null,
  15427. E = null,
  15428. b = null,
  15429. w = null,
  15430. _ = null,
  15431. T = null,
  15432. x = null,
  15433. S = null,
  15434. M = null,
  15435. R = null,
  15436. P = null,
  15437. O = null,
  15438. L = null,
  15439. D = null,
  15440. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  15441. B = void 0,
  15442. F = {},
  15443. V = new n.Vector4(),
  15444. U = null,
  15445. k = null,
  15446. H = new n.Vector4(),
  15447. G = new n.Vector4();
  15448. (this.init = function () {
  15449. this.clearColor(0, 0, 0, 1),
  15450. this.clearDepth(1),
  15451. this.clearStencil(0),
  15452. this.enable(e.DEPTH_TEST),
  15453. e.depthFunc(e.LEQUAL),
  15454. e.frontFace(e.CCW),
  15455. e.cullFace(e.BACK),
  15456. this.enable(e.CULL_FACE),
  15457. this.enable(e.BLEND),
  15458. e.blendEquation(e.FUNC_ADD),
  15459. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  15460. }),
  15461. (this.initAttributes = function () {
  15462. for (var e = 0, t = s.length; e < t; e++) s[e] = 0;
  15463. }),
  15464. (this.enableAttribute = function (i) {
  15465. if (
  15466. ((s[i] = 1),
  15467. 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)),
  15468. 0 !== c[i])
  15469. ) {
  15470. var n = t.get("ANGLE_instanced_arrays");
  15471. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0);
  15472. }
  15473. }),
  15474. (this.enableAttributeAndDivisor = function (t, i, n) {
  15475. (s[t] = 1),
  15476. 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)),
  15477. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i));
  15478. }),
  15479. (this.disableUnusedAttributes = function () {
  15480. for (var t = 0, i = l.length; t < i; t++)
  15481. l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  15482. }),
  15483. (this.enable = function (t) {
  15484. h[t] !== !0 && (e.enable(t), (h[t] = !0));
  15485. }),
  15486. (this.disable = function (t) {
  15487. h[t] !== !1 && (e.disable(t), (h[t] = !1));
  15488. }),
  15489. (this.getCompressedTextureFormats = function () {
  15490. if (
  15491. null === u &&
  15492. ((u = []),
  15493. t.get("WEBGL_compressed_texture_pvrtc") ||
  15494. t.get("WEBGL_compressed_texture_s3tc") ||
  15495. t.get("WEBGL_compressed_texture_etc1"))
  15496. )
  15497. for (
  15498. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  15499. n < i.length;
  15500. n++
  15501. )
  15502. u.push(i[n]);
  15503. return u;
  15504. }),
  15505. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  15506. t === n.NoBlending
  15507. ? this.disable(e.BLEND)
  15508. : this.enable(e.BLEND),
  15509. (t === d && h === y) ||
  15510. (t === n.AdditiveBlending
  15511. ? h
  15512. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15513. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  15514. : (e.blendEquation(e.FUNC_ADD),
  15515. e.blendFunc(e.SRC_ALPHA, e.ONE))
  15516. : t === n.SubtractiveBlending
  15517. ? h
  15518. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15519. e.blendFuncSeparate(
  15520. e.ZERO,
  15521. e.ZERO,
  15522. e.ONE_MINUS_SRC_COLOR,
  15523. e.ONE_MINUS_SRC_ALPHA
  15524. ))
  15525. : (e.blendEquation(e.FUNC_ADD),
  15526. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  15527. : t === n.MultiplyBlending
  15528. ? h
  15529. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15530. e.blendFuncSeparate(
  15531. e.ZERO,
  15532. e.ZERO,
  15533. e.SRC_COLOR,
  15534. e.SRC_ALPHA
  15535. ))
  15536. : (e.blendEquation(e.FUNC_ADD),
  15537. e.blendFunc(e.ZERO, e.SRC_COLOR))
  15538. : h
  15539. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15540. e.blendFuncSeparate(
  15541. e.ONE,
  15542. e.ONE_MINUS_SRC_ALPHA,
  15543. e.ONE,
  15544. e.ONE_MINUS_SRC_ALPHA
  15545. ))
  15546. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  15547. e.blendFuncSeparate(
  15548. e.SRC_ALPHA,
  15549. e.ONE_MINUS_SRC_ALPHA,
  15550. e.ONE,
  15551. e.ONE_MINUS_SRC_ALPHA
  15552. )),
  15553. (d = t),
  15554. (y = h)),
  15555. t === n.CustomBlending
  15556. ? ((s = s || r),
  15557. (l = l || o),
  15558. (c = c || a),
  15559. (r === p && s === m) ||
  15560. (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  15561. (o === f && a === g && l === v && c === A) ||
  15562. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  15563. (f = o),
  15564. (g = a),
  15565. (v = l),
  15566. (A = c)))
  15567. : ((p = null),
  15568. (f = null),
  15569. (g = null),
  15570. (m = null),
  15571. (v = null),
  15572. (A = null));
  15573. }),
  15574. (this.setDepthFunc = function (t) {
  15575. if (C !== t) {
  15576. if (t)
  15577. switch (t) {
  15578. case n.NeverDepth:
  15579. e.depthFunc(e.NEVER);
  15580. break;
  15581. case n.AlwaysDepth:
  15582. e.depthFunc(e.ALWAYS);
  15583. break;
  15584. case n.LessDepth:
  15585. e.depthFunc(e.LESS);
  15586. break;
  15587. case n.LessEqualDepth:
  15588. e.depthFunc(e.LEQUAL);
  15589. break;
  15590. case n.EqualDepth:
  15591. e.depthFunc(e.EQUAL);
  15592. break;
  15593. case n.GreaterEqualDepth:
  15594. e.depthFunc(e.GEQUAL);
  15595. break;
  15596. case n.GreaterDepth:
  15597. e.depthFunc(e.GREATER);
  15598. break;
  15599. case n.NotEqualDepth:
  15600. e.depthFunc(e.NOTEQUAL);
  15601. break;
  15602. default:
  15603. e.depthFunc(e.LEQUAL);
  15604. }
  15605. else e.depthFunc(e.LEQUAL);
  15606. C = t;
  15607. }
  15608. }),
  15609. (this.setDepthTest = function (t) {
  15610. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  15611. }),
  15612. (this.setDepthWrite = function (t) {
  15613. I !== t && (e.depthMask(t), (I = t));
  15614. }),
  15615. (this.setColorWrite = function (t) {
  15616. E !== t && (e.colorMask(t, t, t, t), (E = t));
  15617. }),
  15618. (this.setStencilFunc = function (t, i, n) {
  15619. (w === t && _ === i && T === n) ||
  15620. (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n));
  15621. }),
  15622. (this.setStencilOp = function (t, i, n) {
  15623. (x === t && S === i && M === n) ||
  15624. (e.stencilOp(t, i, n), (x = t), (S = i), (M = n));
  15625. }),
  15626. (this.setStencilTest = function (t) {
  15627. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  15628. }),
  15629. (this.setStencilWrite = function (t) {
  15630. b !== t && (e.stencilMask(t), (b = t));
  15631. }),
  15632. (this.setFlipSided = function (t) {
  15633. R !== t &&
  15634. (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t));
  15635. }),
  15636. (this.setLineWidth = function (t) {
  15637. t !== P && (e.lineWidth(t), (P = t));
  15638. }),
  15639. (this.setPolygonOffset = function (t, i, n) {
  15640. t
  15641. ? this.enable(e.POLYGON_OFFSET_FILL)
  15642. : this.disable(e.POLYGON_OFFSET_FILL),
  15643. !t ||
  15644. (O === i && L === n) ||
  15645. (e.polygonOffset(i, n), (O = i), (L = n));
  15646. }),
  15647. (this.getScissorTest = function () {
  15648. return D;
  15649. }),
  15650. (this.setScissorTest = function (t) {
  15651. (D = t),
  15652. t
  15653. ? this.enable(e.SCISSOR_TEST)
  15654. : this.disable(e.SCISSOR_TEST);
  15655. }),
  15656. (this.activeTexture = function (t) {
  15657. void 0 === t && (t = e.TEXTURE0 + N - 1),
  15658. B !== t && (e.activeTexture(t), (B = t));
  15659. }),
  15660. (this.bindTexture = function (t, i) {
  15661. void 0 === B && r.activeTexture();
  15662. var n = F[B];
  15663. void 0 === n &&
  15664. ((n = {
  15665. type: void 0,
  15666. texture: void 0,
  15667. }),
  15668. (F[B] = n)),
  15669. (n.type === t && n.texture === i) ||
  15670. (e.bindTexture(t, i), (n.type = t), (n.texture = i));
  15671. }),
  15672. (this.compressedTexImage2D = function () {
  15673. try {
  15674. e.compressedTexImage2D.apply(e, arguments);
  15675. } catch (e) {
  15676. console.error(e);
  15677. }
  15678. }),
  15679. (this.texImage2D = function () {
  15680. try {
  15681. e.texImage2D.apply(e, arguments);
  15682. } catch (e) {
  15683. console.error(e);
  15684. }
  15685. }),
  15686. (this.clearColor = function (t, i, n, r) {
  15687. o.set(t, i, n, r),
  15688. V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o));
  15689. }),
  15690. (this.clearDepth = function (t) {
  15691. U !== t && (e.clearDepth(t), (U = t));
  15692. }),
  15693. (this.clearStencil = function (t) {
  15694. k !== t && (e.clearStencil(t), (k = t));
  15695. }),
  15696. (this.scissor = function (t) {
  15697. H.equals(t) === !1 &&
  15698. (e.scissor(t.x, t.y, t.z, t.w), H.copy(t));
  15699. }),
  15700. (this.viewport = function (t) {
  15701. G.equals(t) === !1 &&
  15702. (e.viewport(t.x, t.y, t.z, t.w), G.copy(t));
  15703. }),
  15704. (this.reset = function () {
  15705. for (var t = 0; t < l.length; t++)
  15706. 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  15707. (h = {}),
  15708. (u = null),
  15709. (B = void 0),
  15710. (F = {}),
  15711. (d = null),
  15712. (E = null),
  15713. (I = null),
  15714. (b = null),
  15715. (R = null);
  15716. });
  15717. });
  15718. },
  15719. {
  15720. three: 217,
  15721. },
  15722. ],
  15723. 104: [
  15724. function (e, t, i) {
  15725. (function (i, n) {
  15726. "use strict";
  15727. function r(e) {
  15728. this.urls = e;
  15729. var t = i(
  15730. "bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==",
  15731. "base64"
  15732. );
  15733. (this.builder = a.loadProto(t)),
  15734. (this.decoder = this.builder.build("binary_mesh"));
  15735. }
  15736. var o = e("three"),
  15737. a = e("protobufjs"),
  15738. s = e("../util/logger"),
  15739. l = (e("../util/common"), e("../util/ajax")),
  15740. c = e("../objects/Chunk"),
  15741. h = new s(n);
  15742. (r.prototype = {
  15743. constructor: r,
  15744. load: function (e, t, i, n) {
  15745. return (
  15746. h.time("download"),
  15747. l
  15748. .get(e, {
  15749. responseType: "arraybuffer",
  15750. })
  15751. .done(
  15752. function (r) {
  15753. h.timeEnd("download"), this.parse(r, e, t, i, n);
  15754. }.bind(this)
  15755. )
  15756. .fail(n)
  15757. );
  15758. },
  15759. parse: function (e, t, i, n, r) {
  15760. var o = this.readProtobuf(e);
  15761. if (!o) return r();
  15762. try {
  15763. h.time("convert to webgl"),
  15764. this.convertProtobufToSceneObject(o, t, i, n, r),
  15765. h.timeEnd("convert to webgl");
  15766. } catch (e) {
  15767. return h.error("failed parsing .dam"), h.error(e.message), r();
  15768. }
  15769. },
  15770. readProtobuf: function (e) {
  15771. var t;
  15772. try {
  15773. h.time("parse proto"),
  15774. (t = this.decoder.decode(e)),
  15775. h.timeEnd("parse proto");
  15776. } catch (e) {
  15777. return (
  15778. h.error("failed parsing proto for .dam"),
  15779. h.error(e.message),
  15780. null
  15781. );
  15782. }
  15783. return t;
  15784. },
  15785. convertProtobufToSceneObject: function (e, t, i, n, r) {
  15786. function a(e) {
  15787. var i = new o.BufferGeometry();
  15788. return (
  15789. i.addAttribute(
  15790. "position",
  15791. new o.BufferAttribute(
  15792. new Float32Array(e.vertices.xyz, 0, 3),
  15793. 3
  15794. )
  15795. ),
  15796. e.vertices.uv.length > 0 &&
  15797. i.addAttribute(
  15798. "uv",
  15799. new o.BufferAttribute(
  15800. new Float32Array(e.vertices.uv, 0, 2),
  15801. 2
  15802. )
  15803. ),
  15804. i.setIndex(
  15805. new o.BufferAttribute(
  15806. new Uint32Array(e.faces.faces, 0, 1),
  15807. 1
  15808. )
  15809. ),
  15810. i.applyMatrix(s),
  15811. i.computeBoundingBox(),
  15812. new c({
  15813. geometry: i,
  15814. textureName: e.material_name,
  15815. name: e.chunk_name,
  15816. meshUrl: t,
  15817. })
  15818. );
  15819. }
  15820. if (0 === e.chunk.length)
  15821. return h.warn("No chunks in damfile..."), i([]);
  15822. var s = new o.Matrix4();
  15823. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  15824. var l = e.chunk.map(a);
  15825. return l
  15826. ? i(l)
  15827. : (h.error(".dam protobuf came out with no chunks..."), r());
  15828. },
  15829. }),
  15830. (t.exports = r);
  15831. }).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js");
  15832. },
  15833. {
  15834. "../objects/Chunk": 144,
  15835. "../util/ajax": 181,
  15836. "../util/common": 185,
  15837. "../util/logger": 189,
  15838. buffer: 198,
  15839. protobufjs: 214,
  15840. three: 217,
  15841. },
  15842. ],
  15843. 105: [
  15844. function (e, t, i) {
  15845. (function (i) {
  15846. "use strict";
  15847. var n =
  15848. (e("three"),
  15849. e("../settings"),
  15850. e("../util/browser"),
  15851. e("./DamLoader")),
  15852. r = e("../util/logger"),
  15853. o = (e("../ab"), new r(i));
  15854. t.exports = {
  15855. getLoaders: function () {
  15856. return [
  15857. ["_50k", ".dam", n],
  15858. ["", ".dam", n],
  15859. ];
  15860. },
  15861. load: function (e, t, i, n, r, a) {
  15862. var s = this.getLoaders();
  15863. a = a || 0;
  15864. var l = s[a];
  15865. if (!l) return void (r && r("No suitable model file found..."));
  15866. var c = l[0],
  15867. h = l[1],
  15868. u = new l[2](t),
  15869. d = t.get(e + c + h);
  15870. d
  15871. ? (o.debug("Trying " + c + h),
  15872. u.load(
  15873. d,
  15874. i,
  15875. n,
  15876. function () {
  15877. this.load(e, t, i, n, r, ++a);
  15878. }.bind(this)
  15879. ))
  15880. : (o.debug("Skipping " + h + ", not available"),
  15881. this.load(e, t, i, n, r, ++a));
  15882. },
  15883. };
  15884. }).call(this, "/js/loaders/ModelLoader.js");
  15885. },
  15886. {
  15887. "../ab": 3,
  15888. "../settings": 166,
  15889. "../util/browser": 182,
  15890. "../util/logger": 189,
  15891. "./DamLoader": 104,
  15892. three: 217,
  15893. },
  15894. ],
  15895. 106: [
  15896. function (e, t, i) {
  15897. (function (i) {
  15898. "use strict";
  15899. var n = e("../util/common"),
  15900. r = e("../util/texture"),
  15901. o = e("../util/browser"),
  15902. a = e("../util/logger"),
  15903. s = e("../settings"),
  15904. l = new a(i);
  15905. t.exports = {
  15906. load: function (e, t) {
  15907. function i(e, i) {
  15908. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve());
  15909. }
  15910. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when();
  15911. var a = n.countUnique(
  15912. e.chunks.map(function (e) {
  15913. return e.textureName;
  15914. })
  15915. ),
  15916. c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : "",
  15917. h = "_50k" === c ? "high" : "low";
  15918. s.minimalMemoryMode &&
  15919. "high" === h &&
  15920. (o.detectSamsungS6()
  15921. ? (l.warn(
  15922. "Galaxy S6 cannot handle large textures, turning down quality."
  15923. ),
  15924. (h = "low"))
  15925. : a > s.maxMobileTextures &&
  15926. (l.warn(
  15927. "Model probably too large for mobile, turning down quality."
  15928. ),
  15929. (h = "low")));
  15930. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/",
  15931. d = $.Deferred(),
  15932. p = 0;
  15933. return (
  15934. e.chunks.forEach(function (t) {
  15935. if (!t.material.map && t.textureName) {
  15936. var n = e.urls.get(u + t.textureName);
  15937. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))));
  15938. }
  15939. }),
  15940. d.promise()
  15941. );
  15942. },
  15943. };
  15944. }).call(this, "/js/loaders/ModelTextureLoader.js");
  15945. },
  15946. {
  15947. "../settings": 166,
  15948. "../util/browser": 182,
  15949. "../util/common": 185,
  15950. "../util/logger": 189,
  15951. "../util/texture": 194,
  15952. },
  15953. ],
  15954. 107: [
  15955. function (e, t, i) {
  15956. (function (i, n) {
  15957. "use strict";
  15958. function r(e) {
  15959. (this.model = e),
  15960. (this.modelDataPath =
  15961. this.model.urls.get("vision.modeldata") +
  15962. "?m=" +
  15963. new Date().getTime()),
  15964. (this.sweepLocationsPath = this.model.urls.get(
  15965. "sweep_locations.csv"
  15966. ));
  15967. var t = i(
  15968. "Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K",
  15969. "base64"
  15970. ),
  15971. n = o.loadProto(t);
  15972. this.decoder = n.build("VisionModeldata");
  15973. }
  15974. var o = e("protobufjs"),
  15975. a = e("../util/ajax"),
  15976. s = (e("../util/common"), e("../util/math")),
  15977. l = e("../util/logger"),
  15978. c = new l(n);
  15979. (r.prototype.load = function () {
  15980. return this.modelDataPath
  15981. ? (c.info("Using vision.modeldata"), this.loadVisionModelData())
  15982. : this.sweepLocationsPath
  15983. ? (c.warn("Using sweep_locations.csv"),
  15984. this.loadSweepLocationsCSV())
  15985. : (c.warn("No sweep file found"), $.when([]));
  15986. }),
  15987. (r.prototype.loadVisionModelData = function () {
  15988. return a
  15989. .get(this.modelDataPath, {
  15990. responseType: "arraybuffer",
  15991. })
  15992. .then(
  15993. function (e) {
  15994. var t;
  15995. try {
  15996. t = this.decoder.decode(e);
  15997. } catch (e) {
  15998. return (
  15999. c.warn(
  16000. "Could not decode vision.modeldata, trying sweep_locations.csv"
  16001. ),
  16002. this.loadSweepLocationsCSV()
  16003. );
  16004. }
  16005. var i = t.sweepLocations
  16006. .map(function (e) {
  16007. return {
  16008. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  16009. position: {
  16010. x: e.pose.translation.x,
  16011. y: e.pose.translation.y,
  16012. z: e.pose.translation.z,
  16013. },
  16014. quaternion: {
  16015. x: e.pose.rotation.x,
  16016. y: e.pose.rotation.y,
  16017. z: e.pose.rotation.z,
  16018. w: e.pose.rotation.w,
  16019. },
  16020. puck: {
  16021. x: e.puck.x,
  16022. y: e.puck.y,
  16023. z: e.puck.z,
  16024. },
  16025. floor:
  16026. window.sceneFrom == "kankan" ? e.subgroup : e.group,
  16027. neighbours: e.visibles,
  16028. alignmentType: e.alignment_type,
  16029. };
  16030. })
  16031. .map(function (e) {
  16032. return (
  16033. (e.position = s.convertVisionVector(e.position)),
  16034. (e.quaternion = s.convertVisionQuaternion(
  16035. e.quaternion
  16036. )),
  16037. (e.puck = s.convertVisionVector(e.puck)),
  16038. e
  16039. );
  16040. });
  16041. return (
  16042. i.forEach(function (e) {
  16043. e.neighbours = e.neighbours.map(function (e) {
  16044. return i[e].uuid;
  16045. });
  16046. }),
  16047. i
  16048. );
  16049. }.bind(this),
  16050. function () {
  16051. return (
  16052. c.warn(
  16053. "Could not load vision.modeldata, trying sweep_locations.csv"
  16054. ),
  16055. this.loadSweepLocationsCSV()
  16056. );
  16057. }.bind(this)
  16058. );
  16059. }),
  16060. (r.prototype.loadSweepLocationsCSV = function () {
  16061. return a
  16062. .get(this.sweepLocationsPath)
  16063. .then(function (e) {
  16064. var t = e
  16065. .split("\n")
  16066. .map(function (e) {
  16067. return e.split(", ");
  16068. })
  16069. .filter(function (e) {
  16070. return e.length > 1;
  16071. })
  16072. .map(function (e) {
  16073. return {
  16074. uuid: e[0],
  16075. position: {
  16076. x: parseFloat(e[1]),
  16077. y: parseFloat(e[2]),
  16078. z: parseFloat(e[3]),
  16079. },
  16080. quaternion: {
  16081. x: parseFloat(e[4]),
  16082. y: parseFloat(e[5]),
  16083. z: parseFloat(e[6]),
  16084. w: parseFloat(e[7]),
  16085. },
  16086. };
  16087. })
  16088. .map(function (e) {
  16089. return (
  16090. (e.position = s.convertVisionVector(e.position)),
  16091. (e.quaternion = s.convertVisionQuaternion(
  16092. e.quaternion
  16093. )),
  16094. e
  16095. );
  16096. });
  16097. return t;
  16098. })
  16099. .fail(function () {
  16100. c.warn(
  16101. "Could not load sweep_locations.csv, no sweeps loaded."
  16102. );
  16103. });
  16104. }),
  16105. (t.exports = r);
  16106. }).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js");
  16107. },
  16108. {
  16109. "../util/ajax": 181,
  16110. "../util/common": 185,
  16111. "../util/logger": 189,
  16112. "../util/math": 190,
  16113. buffer: 198,
  16114. protobufjs: 214,
  16115. },
  16116. ],
  16117. 108: [
  16118. function (e, t, i) {
  16119. (function (i) {
  16120. "use strict";
  16121. function n() {
  16122. this.locale = null;
  16123. }
  16124. var r = e("../settings"),
  16125. o = e("../util/common"),
  16126. a = e("../util/logger"),
  16127. s = e("../enum/Locale"),
  16128. l = new a(i);
  16129. (n.prototype.init = function () {
  16130. var t;
  16131. switch (r.languageTag) {
  16132. case null:
  16133. case "en":
  16134. case s.EN_US:
  16135. (this.locale = s.EN_US), (t = e("./strings-en-US"));
  16136. break;
  16137. case "es":
  16138. case s.ES_MX:
  16139. (this.locale = s.ES_MX), (t = e("./strings-es-MX"));
  16140. break;
  16141. case "fr":
  16142. case s.FR_FR:
  16143. (this.locale = s.FR_FR), (t = e("./strings-fr-FR"));
  16144. break;
  16145. case "de":
  16146. case s.DE_DE:
  16147. (this.locale = s.DE_DE), (t = e("./strings-de-DE"));
  16148. break;
  16149. case "ru":
  16150. case s.RU_RU:
  16151. (this.locale = s.RU_RU), (t = e("./strings-ru-RU"));
  16152. break;
  16153. case "cn":
  16154. case s.CN_CN:
  16155. (this.locale = s.CN_CN), (t = e("./strings-cn-CN"));
  16156. break;
  16157. case "jp":
  16158. case s.JP_JP:
  16159. (this.locale = s.JP_JP), (t = e("./strings-jp-JP"));
  16160. break;
  16161. default:
  16162. l.info("Unsupported language tag, defaulting to 'en-US'"),
  16163. (this.locale = s.EN_US),
  16164. (t = e("./strings-en-US"));
  16165. }
  16166. l.info("Using locale '" + this.locale + "'"),
  16167. o.extendObject(this, t);
  16168. }),
  16169. (n.prototype.localizeGUI = function () {
  16170. var e = document.querySelector("#gui-parent");
  16171. this.localizeTree(e), this.localizeLoadingText();
  16172. }),
  16173. (n.prototype.localizeLoadingText = function () {
  16174. // var e = document.querySelector("#loader-cont")
  16175. // , t = e.getAttribute("title");
  16176. // e.removeAttribute("title"),
  16177. // e.setAttribute("data-status", t),
  16178. // e.classList.add(this.locale),
  16179. document.querySelector("#help-dialog").classList.add(this.locale),
  16180. document
  16181. .querySelector("#interaction-modal")
  16182. .classList.add(this.locale),
  16183. document.querySelector("#gui").classList.add(this.locale);
  16184. }),
  16185. (n.prototype.localizeTree = function (e) {
  16186. var t,
  16187. i,
  16188. n = /{\[{ ?(\w+) ?}\]}/;
  16189. if (e.nodeType === Node.TEXT_NODE)
  16190. (t = e.data.match(n)),
  16191. t && ((i = t[1]), (e.data = this.localizeText(i) || i));
  16192. else if (e.nodeType === Node.ELEMENT_NODE) {
  16193. var r = e.getAttribute("title");
  16194. r &&
  16195. ((t = r.match(n)),
  16196. t &&
  16197. ((i = t[1]),
  16198. e.setAttribute("title", this.localizeText(i) || i)));
  16199. }
  16200. for (e = e.firstChild; e; )
  16201. this.localizeTree(e), (e = e.nextSibling);
  16202. }),
  16203. (n.prototype.localizeText = function (t) {
  16204. var i = this[t];
  16205. return (
  16206. i ||
  16207. this.locale === s.EN_US ||
  16208. (l.warn(
  16209. "Localization key '" +
  16210. t +
  16211. "' not available for locale '" +
  16212. this.locale +
  16213. "', defaulting to English."
  16214. ),
  16215. (i = e("./strings-en-US")[t])),
  16216. i ||
  16217. l.warn(
  16218. "Localization key '" +
  16219. t +
  16220. "' not available for locale 'en-US'"
  16221. ),
  16222. i
  16223. );
  16224. }),
  16225. (t.exports = new n());
  16226. }).call(this, "/js/localization/localize.js");
  16227. },
  16228. {
  16229. "../enum/Locale": 31,
  16230. "../settings": 166,
  16231. "../util/common": 185,
  16232. "../util/logger": 189,
  16233. "./strings-cn-CN": 109,
  16234. "./strings-de-DE": 110,
  16235. "./strings-en-US": 111,
  16236. "./strings-es-MX": 112,
  16237. "./strings-fr-FR": 113,
  16238. "./strings-jp-JP": 114,
  16239. "./strings-ru-RU": 115,
  16240. },
  16241. ],
  16242. 109: [
  16243. function (e, t, i) {
  16244. "use strict";
  16245. t.exports = {
  16246. PAGE_TITLE: "",
  16247. LOADING: "正在加载",
  16248. PRESENTED_BY_CAPS: "呈现者:",
  16249. POWERED_BY: "技术支持:",
  16250. POWERED_BY_CAPS: "技术支持:",
  16251. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  16252. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  16253. PRESENTED_BY: "呈现者:",
  16254. MORE: "更多 ",
  16255. LESS: "更少 ",
  16256. TAG_CONTENT: "tag™ 内容",
  16257. SHOW: "显示",
  16258. HIDE: "隐藏",
  16259. DOLLHOUSE: "场景屋",
  16260. FLOOR_PLAN: "楼层平面图",
  16261. OPEN_HIGHLIGHTS: "打开精彩片段",
  16262. CLOSE_HIGHLIGHTS: "关闭",
  16263. PREVIOUS: "上一个",
  16264. PLAY: "播放",
  16265. PAUSE: "暂停",
  16266. NEXT: "下一个",
  16267. EXPLORE_3D_SPACE: "探索 3D 空间",
  16268. VIEW_DOLLHOUSE: "观看场景屋",
  16269. SOCIAL_SHARING: "分享这个空间",
  16270. VIEW_IN_VR: "以 VR 观看",
  16271. VIEW_FULLSCREEN: "全屏观看",
  16272. EXIT_FULLSCREEN: " 退出全屏",
  16273. ZOOM_IN: "放大",
  16274. ZOOM_OUT: "缩小",
  16275. FLOOR_NAME: "楼层",
  16276. FLOOR_ALL: "ALL",
  16277. FLOOR_Lang: ["Floor", ""],
  16278. TERMS: "条款",
  16279. PORT_TERMS: "port 条款",
  16280. TERMS_OF_USE: "使用条款",
  16281. CLOSE_TERMS: "关闭",
  16282. TERMS_TEXT_FILE: "terms-cn-CN.html",
  16283. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  16284. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  16285. WEBVR_ENTER_WEBVR: "进入 VR",
  16286. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  16287. WEBVR_LEARN_MORE: "了解更多",
  16288. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  16289. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  16290. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  16291. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  16292. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  16293. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  16294. VR_LEARN_MORE_CAPS: "了解更多",
  16295. VR_PREVIOUS_CAPS: "上一个’,",
  16296. VR_NEXT_CAPS: "下一个",
  16297. VR_GOT_IT_CAPS: "明白了",
  16298. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  16299. VR_SHOW_UNSUPPORTED:
  16300. "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  16301. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  16302. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  16303. VR_WHAT_YOU_NEED: "关于...您需要什么",
  16304. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  16305. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  16306. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  16307. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  16308. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  16309. VR_GOOGLE_DAYDREAM: "Google Daydream",
  16310. VR_APP: "port VR 应用程序",
  16311. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  16312. VR_COMPATIBLE_IPHONES_1: "iPhones",
  16313. VR_COMPATIBLE_IPHONES_2:
  16314. "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  16315. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  16316. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  16317. VR_COMPATIBLE_ANDROID_LONG:
  16318. "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  16319. VR_ANDROID_DETAIL:
  16320. "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  16321. VR_ANDROID_DVICES: "Android 设备",
  16322. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  16323. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  16324. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  16325. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  16326. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  16327. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  16328. VR_DOWNLOAD_HERE: "在此下载",
  16329. VR_REQUIRE_HEADSET:
  16330. "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  16331. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  16332. VR_IMPROPER_EMBED:
  16333. "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  16334. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  16335. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  16336. SHARE_TO: "分享到",
  16337. SHARE_LINK: "直接链接",
  16338. SHARE_EXPLORE: "探索",
  16339. SHARE_AT: "在",
  16340. SHARE_WITH: "使用",
  16341. SHARE_3D: "以 3D",
  16342. SHARE_COPIED: "已复制!",
  16343. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  16344. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  16345. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  16346. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  16347. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  16348. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  16349. ERROR_GENERIC_ACTIONS_3: " 或",
  16350. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  16351. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  16352. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  16353. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  16354. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  16355. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  16356. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  16357. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  16358. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16359. "菜单栏中的首选项 > 高级 > 显示开发菜单",
  16360. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  16361. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  16362. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  16363. ERROR_MISSING_URLS_EXPLANATION:
  16364. "这是较早的模型。网站所有者可能正在开发一种新模型。",
  16365. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  16366. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  16367. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  16368. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  16369. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  16370. LINK_TO_LOCATION: "地点链接",
  16371. MENU_COPY: "复制",
  16372. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  16373. ROTATE: "旋转",
  16374. MOVE: "移动",
  16375. INSIDE: "内部",
  16376. ZOOM: "缩放",
  16377. HELP: "小帮手",
  16378. HELP_NAVIGATION_TAB: "导航",
  16379. HELP_MORE_HELP_TAB: "更多帮助",
  16380. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  16381. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  16382. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  16383. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  16384. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  16385. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  16386. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  16387. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  16388. HELP_DESKTOP_DOLLHOUSE_1A:
  16389. "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  16390. HELP_DESKTOP_DOLLHOUSE_2A:
  16391. "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  16392. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  16393. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  16394. HELP_DESKTOP_FLOORPLAN_1A:
  16395. "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  16396. HELP_DESKTOP_FLOORPLAN_2A:
  16397. "右键单击并向左或向右拖动以旋转楼层平面图。",
  16398. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  16399. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  16400. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  16401. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  16402. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  16403. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  16404. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  16405. HELP_MOBILE_DOLLHOUSE_1:
  16406. "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  16407. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  16408. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  16409. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  16410. HELP_MORE_HLR_A: "精彩片段集锦",
  16411. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  16412. HELP_MORE_DOLLHOUSE_A: "场景屋",
  16413. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16414. "单击以查看和旋转 3D 内整个空间的俯视图。",
  16415. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16416. "点击以查看和旋转 3D 内整个空间的俯视图。",
  16417. HELP_MORE_FLOORS_A: "楼层选择器",
  16418. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  16419. HELP_MORE_TAG_A: "tag™ 贴文",
  16420. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  16421. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  16422. HELP_MORE_ZOOM_A: "缩放控件",
  16423. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  16424. HELP_MORE_TOUR_A: "导览控件",
  16425. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  16426. HELP_MORE_INSIDE_A: "内部视图",
  16427. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  16428. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  16429. HELP_MORE_VR_A: "VR 模式",
  16430. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  16431. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  16432. HELP_MORE_360_A: "360° 视图",
  16433. HELP_DESKTOP_MORE_360_B:
  16434. "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  16435. HELP_MOBILE_MORE_360_B:
  16436. "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  16437. HELP_MORE_FULLSCREEN_A: "全屏",
  16438. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  16439. CLOSE: "关闭",
  16440. };
  16441. },
  16442. {},
  16443. ],
  16444. 110: [
  16445. function (e, t, i) {
  16446. "use strict";
  16447. t.exports = {
  16448. PAGE_TITLE: "",
  16449. LOADING: "Lädt",
  16450. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  16451. POWERED_BY: "Angetrieben von",
  16452. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  16453. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  16454. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  16455. PRESENTED_BY: "Präsentiert von ",
  16456. MORE: "Mehr ",
  16457. LESS: "Weniger ",
  16458. TAG_CONTENT: "tag™ Inhalt",
  16459. SHOW: "Anzeigen",
  16460. HIDE: "Verbergen",
  16461. DOLLHOUSE: "Puppenhaus",
  16462. FLOOR_PLAN: "Grundriss",
  16463. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  16464. CLOSE_HIGHLIGHTS: "Schließen",
  16465. PREVIOUS: "Vorheriges",
  16466. PLAY: "Abspielen",
  16467. PAUSE: "Pausieren",
  16468. NEXT: "Nächstes",
  16469. EXPLORE_3D_SPACE: "Innenraum betreten",
  16470. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  16471. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  16472. VIEW_IN_VR: "In VR ansehen",
  16473. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  16474. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  16475. ZOOM_IN: "Vergrößern",
  16476. ZOOM_OUT: "Verkleinern",
  16477. FLOOR_NAME: "Etage ",
  16478. FLOOR_ALL: "Alle",
  16479. TERMS: "Bedingungen",
  16480. PORT_TERMS: "port Bedingungen",
  16481. TERMS_OF_USE: "Nutzungsbedingungen",
  16482. TERMS_TEXT_FILE: "terms-de-DE.html",
  16483. CLOSE_TERMS: "Schließen",
  16484. TERMS_FAIL:
  16485. "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  16486. HELP: "Hilfe",
  16487. HELP_NAVIGATION_TAB: "Navigation",
  16488. HELP_MORE_HELP_TAB: "Hilfe-Details",
  16489. CLOSE: "Schließen",
  16490. HELP_DESKTOP_PANORAMA_1A:
  16491. "Klicken und ziehen Sie um sich im Raum umzusehen.",
  16492. HELP_DESKTOP_PANORAMA_2A:
  16493. "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  16494. HELP_DESKTOP_PANORAMA_3A:
  16495. "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  16496. HELP_DESKTOP_PANORAMA_1B:
  16497. "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  16498. HELP_DESKTOP_PANORAMA_2B:
  16499. "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  16500. HELP_DESKTOP_PANORAMA_3B:
  16501. "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  16502. HELP_DESKTOP_360_2A:
  16503. "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  16504. HELP_DESKTOP_360_2B:
  16505. "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  16506. HELP_DESKTOP_DOLLHOUSE_1A:
  16507. "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  16508. HELP_DESKTOP_DOLLHOUSE_2A:
  16509. "Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.",
  16510. HELP_DESKTOP_DOLLHOUSE_3A:
  16511. "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  16512. HELP_DESKTOP_DOLLHOUSE_1B:
  16513. "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  16514. HELP_DESKTOP_FLOORPLAN_1A:
  16515. "Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.",
  16516. HELP_DESKTOP_FLOORPLAN_2A:
  16517. "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  16518. HELP_DESKTOP_FLOORPLAN_3A:
  16519. "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  16520. HELP_DESKTOP_FLOORPLAN_2B:
  16521. "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  16522. HELP_DESKTOP_FLOORPLAN_3B:
  16523. "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  16524. HELP_MOBILE_PANORAMA_1:
  16525. "Berühren und ziehen an dem Raum um sich umzusehen.",
  16526. HELP_MOBILE_PANORAMA_2:
  16527. "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  16528. HELP_MOBILE_3:
  16529. "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  16530. HELP_MOBILE_360_2:
  16531. "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  16532. HELP_MOBILE_DOLLHOUSE_1:
  16533. "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  16534. HELP_MOBILE_DOLLHOUSE_2:
  16535. "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  16536. HELP_MOBILE_FLOORPLAN_1:
  16537. "Berühren und ziehen, um den Grundriss zu positionieren.",
  16538. HELP_MOBILE_FLOORPLAN_2:
  16539. "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  16540. HELP_MORE_HLR_A: "Liste das Highlight",
  16541. HELP_DESKTOP_MORE_HLR_B:
  16542. "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  16543. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  16544. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16545. "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  16546. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16547. "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  16548. HELP_MORE_FLOORS_A: "Etage auswählen",
  16549. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  16550. HELP_MORE_TAG_A: "tag™ Posts",
  16551. HELP_DESKTOP_MORE_TAG_B:
  16552. "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  16553. HELP_MOBILE_MORE_TAG_B:
  16554. "Tippen Sie für Informationen über die Funktionen im Raum.",
  16555. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  16556. HELP_DESKTOP_MORE_ZOOM_B:
  16557. "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  16558. HELP_MORE_TOUR_A: "Tour Steuerung",
  16559. HELP_DESKTOP_MORE_TOUR_B:
  16560. "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  16561. HELP_MORE_INSIDE_A: "Innenansicht",
  16562. HELP_DESKTOP_MORE_INSIDE_B:
  16563. "Klicken Sie hier um sich im Raum umzusehen.",
  16564. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  16565. HELP_MORE_VR_A: "VR Modus",
  16566. HELP_DESKTOP_MORE_VR_B:
  16567. "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  16568. HELP_MOBILE_MORE_VR_B:
  16569. "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  16570. HELP_MORE_360_A: "360° Views Ansicht ",
  16571. HELP_DESKTOP_MORE_360_B:
  16572. "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  16573. HELP_MOBILE_MORE_360_B:
  16574. "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  16575. HELP_MORE_FULLSCREEN_A: "Vollbild",
  16576. HELP_DESKTOP_MORE_FULLSCREEN_B:
  16577. "Erweitern Sie 3D Showcase im Vollbildmodus.",
  16578. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  16579. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  16580. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  16581. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  16582. WEBVR_LEARN_MORE: "Mehr Infos",
  16583. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  16584. WEBVR_DAYDREAM_VIEW: "Daydream View",
  16585. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  16586. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  16587. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  16588. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  16589. VR_GOOGLE_DAYDREAM: "Google Daydream",
  16590. VR_APP: "port VR App",
  16591. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  16592. VR_COMPATIBLE_ANDROID_LONG:
  16593. "Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  16594. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  16595. VR_APP_FOR_ANDROID: "port VR app für Android",
  16596. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  16597. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  16598. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  16599. VR_PREVIOUS_CAPS: "ZURÜCK",
  16600. VR_NEXT_CAPS: "WEITER",
  16601. VR_GOT_IT_CAPS: "VERSTANDEN",
  16602. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  16603. VR_SHOW_UNSUPPORTED:
  16604. "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  16605. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  16606. VR_SHOW_IOS_2:
  16607. "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  16608. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  16609. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  16610. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  16611. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  16612. VR_COMPATIBLE_IPHONES_1: "iPhones",
  16613. VR_COMPATIBLE_IPHONES_2:
  16614. "iPhone 5s oder neuer, mit iOS 9.1 und später",
  16615. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  16616. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  16617. VR_ANDROID_DETAIL:
  16618. "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  16619. VR_ANDROID_DVICES: "Android Geräte",
  16620. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  16621. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  16622. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  16623. VR_DOWNLOAD_HERE: "Hier runterladen",
  16624. VR_REQUIRE_HEADSET:
  16625. "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  16626. VR_REDIRECT_TO_STORE:
  16627. "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  16628. VR_IMPROPER_EMBED:
  16629. "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  16630. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  16631. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  16632. SHARE_TO: "Teilen auf",
  16633. SHARE_LINK: "Direkter Link",
  16634. SHARE_EXPLORE: "Umsehen",
  16635. SHARE_AT: "auf",
  16636. SHARE_WITH: "mit",
  16637. SHARE_3D: "in 3D",
  16638. SHARE_COPIED: "Kopiert!",
  16639. ERROR_BROWSER_SOLUTION:
  16640. "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  16641. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  16642. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  16643. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  16644. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  16645. ERROR_GENERIC_ACTIONS_2:
  16646. "Installieren Sie einen unterstützten Browser",
  16647. ERROR_GENERIC_ACTIONS_3: " oder ",
  16648. ERROR_GENERIC_ACTIONS_4:
  16649. "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  16650. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  16651. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  16652. ERROR_WEBGL_IOS_SOLUTION:
  16653. "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  16654. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  16655. ERROR_WEBGL_IOS_ACTIONS_2:
  16656. "Einstellungen > Allgemein > Softwareaktualisierung",
  16657. ERROR_WEBGL_SAFARI_PROBLEM:
  16658. "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  16659. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  16660. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16661. "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  16662. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  16663. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  16664. ERROR_MISSING_URLS_PROBLEM:
  16665. "Huch, es gibt keine Panoramen für dieses Modell .",
  16666. ERROR_MISSING_URLS_EXPLANATION:
  16667. "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  16668. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  16669. ERROR_LOADING_FAILED_ACTIONS_1:
  16670. "Wenn das Problem weiterhin besteht, ",
  16671. ERROR_LOADING_FAILED_ACTIONS_2:
  16672. "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  16673. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  16674. ERROR_MAINTENANCE_SOLUTION:
  16675. "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  16676. LINK_TO_LOCATION: "Link zu",
  16677. MENU_COPY: "Kopieren",
  16678. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  16679. ROTATE: "Drehen",
  16680. INSIDE: "Drinnen",
  16681. MOVE: "Bewegen",
  16682. ZOOM: "Vergrößern",
  16683. };
  16684. },
  16685. {},
  16686. ],
  16687. 111: [
  16688. function (e, t, i) {
  16689. "use strict";
  16690. t.exports = {
  16691. PAGE_TITLE: "",
  16692. LOADING: "Loading",
  16693. PRESENTED_BY_CAPS: "PRESENTED BY",
  16694. POWERED_BY: "powered by ",
  16695. POWERED_BY_CAPS: "POWERED BY",
  16696. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  16697. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  16698. PRESENTED_BY: "Presented by ",
  16699. MORE: "More ",
  16700. LESS: "Less ",
  16701. TAG_CONTENT: "tag™ Content",
  16702. SHOW: "Show",
  16703. HIDE: "Hide",
  16704. DOLLHOUSE: "Dollhouse",
  16705. FLOOR_PLAN: "Floor plan",
  16706. OPEN_HIGHLIGHTS: "Open Highlights",
  16707. CLOSE_HIGHLIGHTS: "Close",
  16708. PREVIOUS: "Previous",
  16709. PLAY: "Play",
  16710. PAUSE: "Pause",
  16711. NEXT: "Next",
  16712. EXPLORE_3D_SPACE: "Explore 3D Space",
  16713. VIEW_DOLLHOUSE: "View dollhouse",
  16714. SOCIAL_SHARING: "Share this Space",
  16715. VIEW_IN_VR: "View in VR",
  16716. VIEW_FULLSCREEN: "全屏",
  16717. EXIT_FULLSCREEN: "退出全屏",
  16718. ZOOM_IN: "Zoom in",
  16719. ZOOM_OUT: "Zoom out",
  16720. FLOOR_NAME: "Floor ",
  16721. FLOOR_ALL: "全部",
  16722. TERMS: "Terms",
  16723. PORT_TERMS: "port terms",
  16724. TERMS_OF_USE: "Terms of Use",
  16725. TERMS_TEXT_FILE: "terms-en-US.html",
  16726. CLOSE_TERMS: "Close",
  16727. TERMS_FAIL:
  16728. "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  16729. HELP: "Help",
  16730. HELP_NAVIGATION_TAB: "Navigation",
  16731. HELP_MORE_HELP_TAB: "More Help",
  16732. CLOSE: "Close",
  16733. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  16734. HELP_DESKTOP_PANORAMA_2A:
  16735. "Click on the rings throughout the space to move around.",
  16736. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  16737. HELP_DESKTOP_PANORAMA_1B:
  16738. "Or, use the arrow keys to turn left and right.",
  16739. HELP_DESKTOP_PANORAMA_2B:
  16740. "Or, use the arrow keys to move forward and back.",
  16741. HELP_DESKTOP_PANORAMA_3B:
  16742. "Or, use the plus and minus keys to zoom in and out.",
  16743. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  16744. HELP_DESKTOP_360_2B:
  16745. "Or, press the number 1 key to enter Inside View.",
  16746. HELP_DESKTOP_DOLLHOUSE_1A:
  16747. "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  16748. HELP_DESKTOP_DOLLHOUSE_2A:
  16749. "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  16750. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  16751. HELP_DESKTOP_DOLLHOUSE_1B:
  16752. "Or, use the arrow keys to rotate the Dollhouse.",
  16753. HELP_DESKTOP_FLOORPLAN_1A:
  16754. "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  16755. HELP_DESKTOP_FLOORPLAN_2A:
  16756. "Right click and drag left or right to rotate the Floorplan.",
  16757. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  16758. HELP_DESKTOP_FLOORPLAN_2B:
  16759. "Or, use the arrow keys to rotate left or right.",
  16760. HELP_DESKTOP_FLOORPLAN_3B:
  16761. "Or, use the arrow keys to zoom in and out.",
  16762. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  16763. HELP_MOBILE_PANORAMA_2:
  16764. "Tap on the rings throughout the Space to move around.",
  16765. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  16766. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  16767. HELP_MOBILE_DOLLHOUSE_1:
  16768. "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  16769. HELP_MOBILE_DOLLHOUSE_2:
  16770. "Touch and drag with two fingers to position the Dollhouse.",
  16771. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  16772. HELP_MOBILE_FLOORPLAN_2:
  16773. "Touch and drag with two fingers to rotate the Floorplan.",
  16774. HELP_MORE_HLR_A: "Highlight Reel",
  16775. HELP_DESKTOP_MORE_HLR_B:
  16776. "Open to navigate through the Space using thumbnail images.",
  16777. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  16778. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16779. "Click to view and rotate a top-down view of the entire Space in 3D.",
  16780. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16781. "Tap to view and rotate a top-down view of the entire Space in 3D.",
  16782. HELP_MORE_FLOORS_A: "Floor Selector",
  16783. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  16784. HELP_MORE_TAG_A: "tag™ Posts",
  16785. HELP_DESKTOP_MORE_TAG_B:
  16786. "Click or hover over for information about features in the Space.",
  16787. HELP_MOBILE_MORE_TAG_B:
  16788. "Tap for information about features in the Space.",
  16789. HELP_MORE_ZOOM_A: "Zoom Controls",
  16790. HELP_DESKTOP_MORE_ZOOM_B:
  16791. "Use these controls to zoom in and out or use the scroll wheel.",
  16792. HELP_MORE_TOUR_A: "Tour Controls",
  16793. HELP_DESKTOP_MORE_TOUR_B:
  16794. "Play, pause, and navigate forward and backward through a Guided Tour.",
  16795. HELP_MORE_INSIDE_A: "Inside View",
  16796. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  16797. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  16798. HELP_MORE_VR_A: "VR Mode",
  16799. HELP_DESKTOP_MORE_VR_B:
  16800. "Click to launch the Space in virtual reality.",
  16801. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  16802. HELP_MORE_360_A: "360° Views",
  16803. HELP_DESKTOP_MORE_360_B:
  16804. "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  16805. HELP_MOBILE_MORE_360_B:
  16806. "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  16807. HELP_MORE_FULLSCREEN_A: "Full screen",
  16808. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  16809. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  16810. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  16811. WEBVR_FOR_DAYDREAM: "For Daydream View",
  16812. WEBVR_ENTER_WEBVR: "ENTER VR",
  16813. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  16814. WEBVR_LEARN_MORE: "Learn more",
  16815. WEBVR_VIEW_SPACE: "View Space in VR",
  16816. WEBVR_DAYDREAM_VIEW: "Daydream View",
  16817. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  16818. VR_VIEW_SPACE: "View Space in Virtual Reality",
  16819. VR_LEARN_MORE_CAPS: "LEARN MORE",
  16820. VR_PREVIOUS_CAPS: "PREVIOUS",
  16821. VR_NEXT_CAPS: "NEXT",
  16822. VR_GOT_IT_CAPS: "GOT IT",
  16823. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  16824. VR_SHOW_UNSUPPORTED:
  16825. "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  16826. VR_SHOW_IOS_1: "Tap to view the space in VR",
  16827. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  16828. VR_WHAT_YOU_NEED: "What You'll Need For...",
  16829. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  16830. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  16831. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  16832. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  16833. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  16834. VR_GOOGLE_DAYDREAM: "Google Daydream",
  16835. VR_APP: "port VR App",
  16836. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  16837. VR_COMPATIBLE_IPHONES_1: "iPhones",
  16838. VR_COMPATIBLE_IPHONES_2:
  16839. "iPhone 5s and newer, running iOS 9.1 and higher",
  16840. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  16841. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  16842. VR_COMPATIBLE_ANDROID_LONG:
  16843. 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  16844. VR_ANDROID_DETAIL:
  16845. 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  16846. VR_ANDROID_DVICES: "Android Devices",
  16847. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  16848. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  16849. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  16850. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  16851. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  16852. VR_APP_OPEN: "Open with the port VR app instead",
  16853. VR_DOWNLOAD_HERE: "Download here",
  16854. VR_REQUIRE_HEADSET:
  16855. "Requires a VR headset and port VR app for Android to be installed",
  16856. VR_REDIRECT_TO_STORE:
  16857. "If app is not installed, you will be redirected to the app store.",
  16858. VR_IMPROPER_EMBED:
  16859. "The port Space is not embedded properly to support VR in your web browser.",
  16860. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  16861. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  16862. SHARE_TO: "Share to",
  16863. SHARE_LINK: "Direct Link",
  16864. SHARE_EXPLORE: "Explore ",
  16865. SHARE_AT: "at",
  16866. SHARE_WITH: "with",
  16867. SHARE_3D: " in 3D",
  16868. SHARE_COPIED: "Copied!",
  16869. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  16870. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  16871. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  16872. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  16873. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  16874. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  16875. ERROR_GENERIC_ACTIONS_3: " or ",
  16876. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  16877. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  16878. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  16879. ERROR_WEBGL_IOS_SOLUTION:
  16880. "Upgrade to iOS 8 or higher to explore in 3D.",
  16881. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  16882. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  16883. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  16884. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  16885. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16886. "Preferences > Advanced > Show Develop menu",
  16887. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  16888. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  16889. ERROR_MISSING_URLS_PROBLEM:
  16890. "Oops, there are no panoramas for this model.",
  16891. ERROR_MISSING_URLS_EXPLANATION:
  16892. "This is an older model. The website owner may have a new model on the way.",
  16893. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  16894. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  16895. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  16896. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  16897. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  16898. LINK_TO_LOCATION: "Link to location",
  16899. MENU_COPY: "Copy",
  16900. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  16901. ROTATE: "Rotate",
  16902. INSIDE: "Inside",
  16903. MOVE: "Move",
  16904. ZOOM: "Zoom",
  16905. };
  16906. },
  16907. {},
  16908. ],
  16909. 112: [
  16910. function (e, t, i) {
  16911. "use strict";
  16912. t.exports = {
  16913. PAGE_TITLE: "",
  16914. LOADING: "Cargando",
  16915. PRESENTED_BY_CAPS: "PRESENTADO POR",
  16916. POWERED_BY: "potenciando por ",
  16917. POWERED_BY_CAPS: "POTENCIADO POR ",
  16918. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  16919. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  16920. PRESENTED_BY: "Presentado por ",
  16921. MORE: "Más ",
  16922. LESS: "Menos ",
  16923. TAG_CONTENT: "Contenido de tag™",
  16924. SHOW: "Mostrar",
  16925. HIDE: "Ocultar",
  16926. DOLLHOUSE: "Dollhouse",
  16927. FLOOR_PLAN: "Planos",
  16928. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  16929. CLOSE_HIGHLIGHTS: "Cerrar",
  16930. PREVIOUS: "Anterior",
  16931. PLAY: "Play",
  16932. PAUSE: "Pausa",
  16933. NEXT: "Siguiente",
  16934. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  16935. VIEW_DOLLHOUSE: "Ver dollhouse",
  16936. SOCIAL_SHARING: "Compartir este espacio",
  16937. VIEW_IN_VR: "Ver en realidad virtual",
  16938. VIEW_FULLSCREEN: "Ver en pantalla completa",
  16939. EXIT_FULLSCREEN: "Salir de pantalla completa",
  16940. ZOOM_IN: "Acercar",
  16941. ZOOM_OUT: "Alejar",
  16942. FLOOR_NAME: "Piso ",
  16943. FLOOR_ALL: "Todas",
  16944. TERMS: "Condiciones",
  16945. PORT_TERMS: "port términos de uso",
  16946. TERMS_OF_USE: "Términos de uso",
  16947. TERMS_TEXT_FILE: "terms-es-MX.html",
  16948. CLOSE_TERMS: "Cerrar",
  16949. TERMS_FAIL:
  16950. "No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.",
  16951. HELP: "Ayuda",
  16952. HELP_NAVIGATION_TAB: "Navegación",
  16953. HELP_MORE_HELP_TAB: "Más Ayuda",
  16954. CLOSE: "Cerrar",
  16955. HELP_DESKTOP_PANORAMA_1A:
  16956. "Haga clic y arrastre para mirar alrededor del espacio.",
  16957. HELP_DESKTOP_PANORAMA_2A:
  16958. "Haga clic en los aros a lo largo del espacio para moverse.",
  16959. HELP_DESKTOP_PANORAMA_3A:
  16960. "Use la rueda de desplazamiento para acercar o alejar.",
  16961. HELP_DESKTOP_PANORAMA_1B:
  16962. "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  16963. HELP_DESKTOP_PANORAMA_2B:
  16964. "O use las teclas de dirección para adelantar o retroceder.",
  16965. HELP_DESKTOP_PANORAMA_3B:
  16966. "O use la tecla más para acercar y la tecla menos para alejar.",
  16967. HELP_DESKTOP_360_2A:
  16968. "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  16969. HELP_DESKTOP_360_2B:
  16970. "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  16971. HELP_DESKTOP_DOLLHOUSE_1A:
  16972. "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  16973. HELP_DESKTOP_DOLLHOUSE_2A:
  16974. "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  16975. HELP_DESKTOP_DOLLHOUSE_3A:
  16976. "Use la rueda de desplazamiento para acercar o alejar.",
  16977. HELP_DESKTOP_DOLLHOUSE_1B:
  16978. "O use las teclas de dirección para girar la Dollhouse.",
  16979. HELP_DESKTOP_FLOORPLAN_1A:
  16980. "Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.",
  16981. HELP_DESKTOP_FLOORPLAN_2A:
  16982. "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  16983. HELP_DESKTOP_FLOORPLAN_3A:
  16984. "Use la rueda de desplazamiento para acercar o alejar.",
  16985. HELP_DESKTOP_FLOORPLAN_2B:
  16986. "O use las teclas para girar hacia la izquierda o derecha.",
  16987. HELP_DESKTOP_FLOORPLAN_3B:
  16988. "O use las teclas de dirección para acercar o alejar.",
  16989. HELP_MOBILE_PANORAMA_1:
  16990. "Toque y arrastre para mirar alrededor del espacio.",
  16991. HELP_MOBILE_PANORAMA_2:
  16992. "Toque en los aros a lo largo del espacio para moverse.",
  16993. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  16994. HELP_MOBILE_360_2:
  16995. "Toque el ícono Vista Interior para entrar en el Espacio.",
  16996. HELP_MOBILE_DOLLHOUSE_1:
  16997. "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  16998. HELP_MOBILE_DOLLHOUSE_2:
  16999. "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  17000. HELP_MOBILE_FLOORPLAN_1:
  17001. "Toque y arrastre para cambiar la posición de la planta.",
  17002. HELP_MOBILE_FLOORPLAN_2:
  17003. "Toque y arrastre con dos dedos para girar la planta.",
  17004. HELP_MORE_HLR_A: "Galería destacada",
  17005. HELP_DESKTOP_MORE_HLR_B:
  17006. "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  17007. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  17008. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  17009. "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  17010. HELP_MOBILE_MORE_DOLLHOUSE_B:
  17011. "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  17012. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  17013. HELP_DESKTOP_MORE_FLOORS_B:
  17014. "Cambie de una planta a otra en el espacio.",
  17015. HELP_MORE_TAG_A: "tag™ Posts",
  17016. HELP_DESKTOP_MORE_TAG_B:
  17017. "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  17018. HELP_MOBILE_MORE_TAG_B:
  17019. "Toque para obtener más información acerca de las características del espacio.",
  17020. HELP_MORE_ZOOM_A: "Controles de zoom",
  17021. HELP_DESKTOP_MORE_ZOOM_B:
  17022. "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  17023. HELP_MORE_TOUR_A: "Controles de recorrido",
  17024. HELP_DESKTOP_MORE_TOUR_B:
  17025. "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  17026. HELP_MORE_INSIDE_A: "Vista interior",
  17027. HELP_DESKTOP_MORE_INSIDE_B:
  17028. "Haga clic para explorar el interior del espacio.",
  17029. HELP_MOBILE_MORE_INSIDE_B:
  17030. "Toque para explorar el interior del espacio.",
  17031. HELP_MORE_VR_A: "Modo de realidad virtual",
  17032. HELP_DESKTOP_MORE_VR_B:
  17033. "Toque para ver el espacio en realidad virtual.",
  17034. HELP_MOBILE_MORE_VR_B:
  17035. "Toque para ver el espacio en realidad virtual.",
  17036. HELP_MORE_360_A: "360° Views",
  17037. HELP_DESKTOP_MORE_360_B:
  17038. "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  17039. HELP_MOBILE_MORE_360_B:
  17040. "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  17041. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  17042. HELP_DESKTOP_MORE_FULLSCREEN_B:
  17043. "Expanda el escenario 3D para verlo en pantalla completa.",
  17044. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  17045. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  17046. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  17047. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  17048. WEBVR_LEARN_MORE: "Más información",
  17049. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  17050. WEBVR_DAYDREAM_VIEW: "Daydream View",
  17051. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  17052. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  17053. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  17054. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  17055. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  17056. VR_APP: "port VR App",
  17057. VR_COMPATIBLE_ANDROID_LONG:
  17058. 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  17059. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  17060. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  17061. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  17062. VR_LEARN_MORE_CAPS: "SABER MÁS",
  17063. VR_PREVIOUS_CAPS: "ANTERIOR",
  17064. VR_NEXT_CAPS: "SIGUIENTE",
  17065. VR_GOT_IT_CAPS: "COMPRENDIDO",
  17066. VR_SHOW_SUPPORTED:
  17067. "Pulse para ver el Espacio en realidad virtual con",
  17068. VR_SHOW_UNSUPPORTED:
  17069. "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  17070. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  17071. VR_SHOW_IOS_2:
  17072. "Necesita la aplicación port VR y un iPhone compatible para ver",
  17073. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  17074. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  17075. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  17076. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17077. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17078. VR_COMPATIBLE_IPHONES_1: "iPhones",
  17079. VR_COMPATIBLE_IPHONES_2:
  17080. "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  17081. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  17082. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  17083. VR_ANDROID_DETAIL:
  17084. "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  17085. VR_ANDROID_DVICES: "Dispositivos Android",
  17086. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  17087. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  17088. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  17089. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  17090. VR_DOWNLOAD_HERE: "Descargar aquí",
  17091. VR_REQUIRE_HEADSET:
  17092. "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  17093. VR_REDIRECT_TO_STORE:
  17094. "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  17095. VR_IMPROPER_EMBED:
  17096. "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  17097. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  17098. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  17099. SHARE_TO: "Compartir en",
  17100. SHARE_LINK: "Enlace directo",
  17101. SHARE_EXPLORE: "Explorar ",
  17102. SHARE_AT: "en",
  17103. SHARE_WITH: "con",
  17104. SHARE_3D: " en 3D",
  17105. SHARE_COPIED: "¡Copiado!",
  17106. ERROR_BROWSER_SOLUTION:
  17107. "Instale un nuevo navegador para explorar en 3D.",
  17108. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  17109. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  17110. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  17111. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  17112. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  17113. ERROR_GENERIC_ACTIONS_3: " o ",
  17114. ERROR_GENERIC_ACTIONS_4:
  17115. "consulte nuestra guía de solución de problemas",
  17116. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  17117. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  17118. ERROR_WEBGL_IOS_SOLUTION:
  17119. "Actualice a iOS 8 o superior para explorar en 3D.",
  17120. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  17121. ERROR_WEBGL_IOS_ACTIONS_2:
  17122. "Ajustes > General > Actualización de software",
  17123. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  17124. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  17125. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17126. "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  17127. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  17128. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  17129. ERROR_MISSING_URLS_PROBLEM:
  17130. "Vaya, no hay panoramas para este modelo.",
  17131. ERROR_MISSING_URLS_EXPLANATION:
  17132. "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  17133. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  17134. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  17135. ERROR_LOADING_FAILED_ACTIONS_2:
  17136. "consulte nuestra guía de solución de problemas",
  17137. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  17138. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  17139. LINK_TO_LOCATION: "Enlace a la ubicación",
  17140. MENU_COPY: "Copiar",
  17141. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  17142. ROTATE: "Girar",
  17143. INSIDE: "Interior",
  17144. MOVE: "Moverse",
  17145. ZOOM: "Acercar o alejar",
  17146. };
  17147. },
  17148. {},
  17149. ],
  17150. 113: [
  17151. function (e, t, i) {
  17152. "use strict";
  17153. t.exports = {
  17154. PAGE_TITLE: "",
  17155. LOADING: "Chargement",
  17156. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  17157. POWERED_BY: "alimenté par ",
  17158. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  17159. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  17160. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  17161. PRESENTED_BY: "Présenté par ",
  17162. MORE: "Plus ",
  17163. LESS: "Moins ",
  17164. TAG_CONTENT: "Contenu tag™",
  17165. SHOW: "Montrer",
  17166. HIDE: "Cacher",
  17167. DOLLHOUSE: "Dollhouse",
  17168. FLOOR_PLAN: "Plan de sol",
  17169. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  17170. CLOSE_HIGHLIGHTS: "Fermer",
  17171. PREVIOUS: "Précédent",
  17172. PLAY: "Lecture",
  17173. PAUSE: "Pause",
  17174. NEXT: "Suivant",
  17175. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  17176. VIEW_DOLLHOUSE: "Voir dollhouse",
  17177. SOCIAL_SHARING: "Partager cet espace",
  17178. VIEW_IN_VR: "Voir en VR",
  17179. VIEW_FULLSCREEN: "Plein écran",
  17180. EXIT_FULLSCREEN: "Fermer plein écran",
  17181. ZOOM_IN: "Zoom avant",
  17182. ZOOM_OUT: "Zoom arrière",
  17183. FLOOR_NAME: "Étage ",
  17184. FLOOR_ALL: "Tous",
  17185. TERMS: "Mentions légales",
  17186. PORT_TERMS: "port mentions légales",
  17187. TERMS_OF_USE: "Conditions d'utilisation",
  17188. TERMS_TEXT_FILE: "terms-fr-FR.html",
  17189. CLOSE_TERMS: "Fermer",
  17190. TERMS_FAIL:
  17191. "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  17192. HELP: "Aide",
  17193. HELP_NAVIGATION_TAB: "Navigation",
  17194. HELP_MORE_HELP_TAB: "Aide",
  17195. CLOSE: "Fermer",
  17196. HELP_DESKTOP_PANORAMA_1A:
  17197. "Cliquez et faites glisser pour regarder autour de l’espace.",
  17198. HELP_DESKTOP_PANORAMA_2A:
  17199. "Cliquez sur les anneaux pour vous déplacer.",
  17200. HELP_DESKTOP_PANORAMA_3A:
  17201. "Utilisez la molette de votre souris pour zoomer.",
  17202. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  17203. HELP_DESKTOP_PANORAMA_2B:
  17204. "Ou utilisez les touches pour avancer et reculer.",
  17205. HELP_DESKTOP_PANORAMA_3B:
  17206. "Ou utilisez les touches plus et moins pour zoomer.",
  17207. HELP_DESKTOP_360_2A:
  17208. "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  17209. HELP_DESKTOP_360_2B:
  17210. "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  17211. HELP_DESKTOP_DOLLHOUSE_1A:
  17212. "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  17213. HELP_DESKTOP_DOLLHOUSE_2A:
  17214. "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  17215. HELP_DESKTOP_DOLLHOUSE_3A:
  17216. "Utilisez la molette de votre souris pour zoomer.",
  17217. HELP_DESKTOP_DOLLHOUSE_1B:
  17218. "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  17219. HELP_DESKTOP_FLOORPLAN_1A:
  17220. "Faites un clic droit pour changer la position du plan sur l’écran.",
  17221. HELP_DESKTOP_FLOORPLAN_2A:
  17222. "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  17223. HELP_DESKTOP_FLOORPLAN_3A:
  17224. "Utilisez la molette de votre souris pour zoomer.",
  17225. HELP_DESKTOP_FLOORPLAN_2B:
  17226. "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  17227. HELP_DESKTOP_FLOORPLAN_3B:
  17228. "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  17229. HELP_MOBILE_PANORAMA_1:
  17230. "Touchez et faites glisser pour regarder autour de l’espace.",
  17231. HELP_MOBILE_PANORAMA_2:
  17232. "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  17233. HELP_MOBILE_3:
  17234. "Utilisez un geste de pincement pour zoomer avant/arrière.",
  17235. HELP_MOBILE_360_2:
  17236. "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  17237. HELP_MOBILE_DOLLHOUSE_1:
  17238. "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  17239. HELP_MOBILE_DOLLHOUSE_2:
  17240. "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  17241. HELP_MOBILE_FLOORPLAN_1:
  17242. "Touchez et faites glisser pour positionner le plan.",
  17243. HELP_MOBILE_FLOORPLAN_2:
  17244. "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  17245. HELP_MORE_HLR_A: "Carrousel",
  17246. HELP_DESKTOP_MORE_HLR_B:
  17247. "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  17248. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  17249. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  17250. "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  17251. HELP_MOBILE_MORE_DOLLHOUSE_B:
  17252. "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  17253. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  17254. HELP_DESKTOP_MORE_FLOORS_B:
  17255. "Basculer entre les étages dans l’espace.",
  17256. HELP_MORE_TAG_A: "tag™ Posts",
  17257. HELP_DESKTOP_MORE_TAG_B:
  17258. "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  17259. HELP_MOBILE_MORE_TAG_B:
  17260. "Tapez pour obtenir des informations sur l’espace.",
  17261. HELP_MORE_ZOOM_A: "Commandes de zoom",
  17262. HELP_DESKTOP_MORE_ZOOM_B:
  17263. "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  17264. HELP_MORE_TOUR_A: "Commandes de la visite",
  17265. HELP_DESKTOP_MORE_TOUR_B:
  17266. "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  17267. HELP_MORE_INSIDE_A: "Vue intérieure",
  17268. HELP_DESKTOP_MORE_INSIDE_B:
  17269. "Cliquez pour explorer l’intérieur de l’espace.",
  17270. HELP_MOBILE_MORE_INSIDE_B:
  17271. "Tapez pour explorer l’intérieur de l’espace.",
  17272. HELP_MORE_VR_A: "Mode RV",
  17273. HELP_DESKTOP_MORE_VR_B:
  17274. "Cliquez pour lancer l’espace en réalité virtuelle.",
  17275. HELP_MOBILE_MORE_VR_B:
  17276. "Tapez pour lancer l’espace en réalité virtuelle.",
  17277. HELP_MORE_360_A: "Vues 360°",
  17278. HELP_DESKTOP_MORE_360_B:
  17279. "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  17280. HELP_MOBILE_MORE_360_B:
  17281. "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  17282. HELP_MORE_FULLSCREEN_A: "Plein écran",
  17283. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  17284. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  17285. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  17286. WEBVR_ENTER_WEBVR: "ENTRER VR",
  17287. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  17288. WEBVR_LEARN_MORE: "En savoir plus",
  17289. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  17290. WEBVR_DAYDREAM_VIEW: "Daydream View",
  17291. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  17292. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  17293. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  17294. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  17295. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  17296. VR_NEXT_CAPS: "SUIVANT",
  17297. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  17298. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  17299. VR_SHOW_UNSUPPORTED:
  17300. "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  17301. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  17302. VR_SHOW_IOS_2:
  17303. "Nécessite l’application port VR et un iPhone compatible pour voir",
  17304. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  17305. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  17306. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  17307. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  17308. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  17309. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17310. VR_GOOGLE_DAYDREAM: "Google Daydream",
  17311. VR_APP: "port VR App",
  17312. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17313. VR_COMPATIBLE_IPHONES_1: "iPhones",
  17314. VR_COMPATIBLE_IPHONES_2:
  17315. "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  17316. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  17317. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  17318. VR_COMPATIBLE_ANDROID_LONG:
  17319. "Compatible avec les écrans des appareils Android de 11,5 à 14 cm (4,5 à 5,5 po) fonctionnant sous Android OS 4.4.4 et plus",
  17320. VR_ANDROID_DETAIL:
  17321. 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  17322. VR_ANDROID_DVICES: "Appareils Android",
  17323. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  17324. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  17325. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  17326. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  17327. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  17328. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  17329. VR_DOWNLOAD_HERE: "Télécharger ici",
  17330. VR_REQUIRE_HEADSET:
  17331. "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  17332. VR_REDIRECT_TO_STORE:
  17333. "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  17334. VR_IMPROPER_EMBED:
  17335. "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  17336. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  17337. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  17338. SHARE_TO: "Partager sur",
  17339. SHARE_LINK: "Lien direct",
  17340. SHARE_EXPLORE: "Explorer ",
  17341. SHARE_AT: "à",
  17342. SHARE_WITH: "avec",
  17343. SHARE_3D: " en 3D",
  17344. SHARE_COPIED: "Copié!",
  17345. ERROR_BROWSER_SOLUTION:
  17346. "Installer un nouveau navigateur pour explorer en 3D.",
  17347. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  17348. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  17349. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  17350. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  17351. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  17352. ERROR_GENERIC_ACTIONS_3: " ou ",
  17353. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  17354. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  17355. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  17356. ERROR_WEBGL_IOS_SOLUTION:
  17357. "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  17358. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  17359. ERROR_WEBGL_IOS_ACTIONS_2:
  17360. "Paramètres > Général > Mise à jour Software",
  17361. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  17362. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  17363. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17364. "Préferences > Avancés > Voir menu développeur",
  17365. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  17366. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  17367. ERROR_MISSING_URLS_PROBLEM:
  17368. "Il n'y a pas de panoromas pour ce modèle.",
  17369. ERROR_MISSING_URLS_EXPLANATION:
  17370. "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  17371. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  17372. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  17373. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  17374. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  17375. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  17376. LINK_TO_LOCATION: "Lien vers l'emplacement",
  17377. MENU_COPY: "Copie",
  17378. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  17379. ROTATE: "Faire pivoter",
  17380. INSIDE: "Intérieure",
  17381. MOVE: "Se déplacer",
  17382. ZOOM: "Zoom",
  17383. };
  17384. },
  17385. {},
  17386. ],
  17387. 114: [
  17388. function (e, t, i) {
  17389. "use strict";
  17390. t.exports = {
  17391. PAGE_TITLE: "",
  17392. LOADING: "読み込み中",
  17393. PRESENTED_BY_CAPS: "PRESENTED BY",
  17394. POWERED_BY: "powered by",
  17395. POWERED_BY_CAPS: "POWERED BY",
  17396. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  17397. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  17398. PRESENTED_BY: "Presented by ",
  17399. MORE: "全て表示 ",
  17400. LESS: "閉じる ",
  17401. TAG_CONTENT: "tag™コンテンツ ",
  17402. SHOW: "表示",
  17403. HIDE: "非表示",
  17404. DOLLHOUSE: "ドールハウス",
  17405. FLOOR_PLAN: "フロアプラン",
  17406. OPEN_HIGHLIGHTS: "ハイライトを開く",
  17407. CLOSE_HIGHLIGHTS: "閉じる",
  17408. PREVIOUS: "前へ",
  17409. PLAY: "再生",
  17410. PAUSE: "一時停止",
  17411. NEXT: "次へ",
  17412. EXPLORE_3D_SPACE: "3DSpaceの探索",
  17413. VIEW_DOLLHOUSE: "ドールハウスの表示",
  17414. SOCIAL_SHARING: "このSpaceを共有する",
  17415. VIEW_IN_VR: "VRで表示",
  17416. VIEW_FULLSCREEN: "フルスクリーン表示",
  17417. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  17418. ZOOM_IN: "ズームイン",
  17419. ZOOM_OUT: "ズームアウト",
  17420. FLOOR_NAME: "フロア ",
  17421. FLOOR_ALL: "すべて",
  17422. TERMS: "規約",
  17423. PORT_TERMS: "port規約",
  17424. TERMS_OF_USE: "利用規約",
  17425. CLOSE_TERMS: "閉じる",
  17426. TERMS_TEXT_FILE: "terms-jp-JP.html",
  17427. TERMS_FAIL:
  17428. "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  17429. WEBVR_FOR_DAYDREAM: "Daydream View用",
  17430. WEBVR_ENTER_WEBVR: "VRに入る",
  17431. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  17432. WEBVR_LEARN_MORE: "もっと詳しく",
  17433. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  17434. WEBVR_DAYDREAM_VIEW: "Daydream View",
  17435. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  17436. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  17437. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  17438. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  17439. VR_LEARN_MORE_CAPS: "もっと詳しく",
  17440. VR_PREVIOUS_CAPS: "前へ",
  17441. VR_NEXT_CAPS: "次へ",
  17442. VR_GOT_IT_CAPS: "了解",
  17443. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  17444. VR_SHOW_UNSUPPORTED:
  17445. "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  17446. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  17447. VR_SHOW_IOS_2:
  17448. "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  17449. VR_WHAT_YOU_NEED: "必要なもの",
  17450. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  17451. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  17452. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  17453. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  17454. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17455. VR_GOOGLE_DAYDREAM: "Google Daydream",
  17456. VR_APP: "port VRアプリ",
  17457. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17458. VR_COMPATIBLE_IPHONES_1: "iPhone",
  17459. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  17460. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  17461. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  17462. VR_COMPATIBLE_ANDROID_LONG:
  17463. "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  17464. VR_ANDROID_DETAIL:
  17465. "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  17466. VR_ANDROID_DVICES: "Androidデバイス",
  17467. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  17468. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  17469. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  17470. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  17471. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  17472. VR_APP_OPEN: "port VRアプリで開く",
  17473. VR_DOWNLOAD_HERE: "ここからダウンロード",
  17474. VR_REQUIRE_HEADSET:
  17475. "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  17476. VR_REDIRECT_TO_STORE:
  17477. "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  17478. VR_IMPROPER_EMBED:
  17479. "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  17480. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  17481. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  17482. SHARE_TO: "共有先",
  17483. SHARE_LINK: "ダイレクトリンク",
  17484. SHARE_EXPLORE: "探索",
  17485. SHARE_AT: "場所",
  17486. SHARE_WITH: "使用アプリ",
  17487. SHARE_3D: "3Dで",
  17488. SHARE_COPIED: "コピーされました!",
  17489. ERROR_BROWSER_SOLUTION:
  17490. "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  17491. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  17492. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  17493. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  17494. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  17495. ERROR_GENERIC_ACTIONS_2:
  17496. "サポートされているブラウザをインストールしてください",
  17497. ERROR_GENERIC_ACTIONS_3: "または",
  17498. ERROR_GENERIC_ACTIONS_4:
  17499. "トラブルシューティングガイドを参照してください",
  17500. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  17501. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  17502. ERROR_WEBGL_IOS_SOLUTION:
  17503. "3D探索するには、iOS 8以降にアップグレードしてください。",
  17504. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  17505. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  17506. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  17507. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  17508. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17509. "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  17510. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  17511. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  17512. ERROR_MISSING_URLS_PROBLEM:
  17513. "このモデルではパノラマを使用できません。",
  17514. ERROR_MISSING_URLS_EXPLANATION:
  17515. "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  17516. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  17517. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  17518. ERROR_LOADING_FAILED_ACTIONS_2:
  17519. "トラブルシューティングガイドを参照してください",
  17520. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  17521. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  17522. LINK_TO_LOCATION: "ロケーションへのリンク",
  17523. MENU_COPY: "コピー",
  17524. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  17525. ROTATE: "回転",
  17526. MOVE: "移動",
  17527. INSIDE: "内側",
  17528. ZOOM: "ズーム",
  17529. HELP: "ヘルプ",
  17530. HELP_NAVIGATION_TAB: "ナビゲーション",
  17531. HELP_MORE_HELP_TAB: "その他のヘルプ",
  17532. HELP_DESKTOP_PANORAMA_1A:
  17533. "Spaceを見回すには、クリックしてドラッグします。",
  17534. HELP_DESKTOP_PANORAMA_2A:
  17535. "移動するには、Space全体にあるリングをクリックします。",
  17536. HELP_DESKTOP_PANORAMA_3A:
  17537. "スクロールホイールを使用してズームイン、ズームアウトします。",
  17538. HELP_DESKTOP_PANORAMA_1B:
  17539. "または、矢印キーを使用して左右に向きを変えます。",
  17540. HELP_DESKTOP_PANORAMA_2B:
  17541. "または、矢印キーを使用して前後に向きを変えます。",
  17542. HELP_DESKTOP_PANORAMA_3B:
  17543. "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  17544. HELP_DESKTOP_360_2A:
  17545. "内側ビューアイコンをクリックしてSpaceに入ります。",
  17546. HELP_DESKTOP_360_2B:
  17547. "または、数字キー1を押して内側ビューに入ります。",
  17548. HELP_DESKTOP_DOLLHOUSE_1A:
  17549. "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  17550. HELP_DESKTOP_DOLLHOUSE_2A:
  17551. "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  17552. HELP_DESKTOP_DOLLHOUSE_3A:
  17553. "スクロールホイールを使用してズームイン、ズームアウトします。",
  17554. HELP_DESKTOP_DOLLHOUSE_1B:
  17555. "または、矢印キーを使用してドールハウスを回転します。",
  17556. HELP_DESKTOP_FLOORPLAN_1A:
  17557. "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  17558. HELP_DESKTOP_FLOORPLAN_2A:
  17559. "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  17560. HELP_DESKTOP_FLOORPLAN_3A:
  17561. "スクロールホイールを使用してズームイン、ズームアウトします。",
  17562. HELP_DESKTOP_FLOORPLAN_2B:
  17563. "または、矢印キーを使用して左右に回転します。",
  17564. HELP_DESKTOP_FLOORPLAN_3B:
  17565. "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  17566. HELP_MOBILE_PANORAMA_1:
  17567. "Spaceを見回すには、タッチしてドラッグします。",
  17568. HELP_MOBILE_PANORAMA_2:
  17569. "移動するには、Space全体にあるリングをタップします。",
  17570. HELP_MOBILE_3:
  17571. "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  17572. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  17573. HELP_MOBILE_DOLLHOUSE_1:
  17574. "タッチして上下左右にドラッグしてドールハウスを回転します。",
  17575. HELP_MOBILE_DOLLHOUSE_2:
  17576. "タッチして、2本指でドラッグしてドールハウスを配置します。",
  17577. HELP_MOBILE_FLOORPLAN_1:
  17578. "タッチ&ドラッグしてフロアプランを配置します。",
  17579. HELP_MOBILE_FLOORPLAN_2:
  17580. "タッチして、2本指でドラッグしてフロアプランを回転します。",
  17581. HELP_MORE_HLR_A: "ハイライト",
  17582. HELP_DESKTOP_MORE_HLR_B:
  17583. "サムネイル画像を使用してSpaceを移動するために開きます。",
  17584. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  17585. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  17586. "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  17587. HELP_MOBILE_MORE_DOLLHOUSE_B:
  17588. "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  17589. HELP_MORE_FLOORS_A: "フロアセレクター",
  17590. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  17591. HELP_MORE_TAG_A: "tag™ Posts",
  17592. HELP_DESKTOP_MORE_TAG_B:
  17593. "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  17594. HELP_MOBILE_MORE_TAG_B:
  17595. "タップするとSpace内の機能についての説明が表示されます。",
  17596. HELP_MORE_ZOOM_A: "ズームコントロール",
  17597. HELP_DESKTOP_MORE_ZOOM_B:
  17598. "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  17599. HELP_MORE_TOUR_A: "ツアーコントロール",
  17600. HELP_DESKTOP_MORE_TOUR_B:
  17601. "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  17602. HELP_MORE_INSIDE_A: "内側ビュー",
  17603. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  17604. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  17605. HELP_MORE_VR_A: "VRモード",
  17606. HELP_DESKTOP_MORE_VR_B:
  17607. "クリックしてバーチャルリアリティでSpaceを起動します。",
  17608. HELP_MOBILE_MORE_VR_B:
  17609. "タップしてバーチャルリアリティでSpaceを起動します。",
  17610. HELP_MORE_360_A: "360° Views",
  17611. HELP_DESKTOP_MORE_360_B:
  17612. "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  17613. HELP_MOBILE_MORE_360_B:
  17614. "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  17615. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  17616. HELP_DESKTOP_MORE_FULLSCREEN_B:
  17617. "3D Showcaseをフルスクリーン表示にします。",
  17618. CLOSE: "閉じる",
  17619. };
  17620. },
  17621. {},
  17622. ],
  17623. 115: [
  17624. function (e, t, i) {
  17625. "use strict";
  17626. t.exports = {
  17627. PAGE_TITLE: "",
  17628. LOADING: "Загрузка",
  17629. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  17630. POWERED_BY: "разработано на платформе ",
  17631. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  17632. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  17633. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  17634. PRESENTED_BY: "Представлено ",
  17635. MORE: "Больше ",
  17636. LESS: "Меньше ",
  17637. TAG_CONTENT: "tag™ Контент",
  17638. SHOW: "Показать",
  17639. HIDE: "Скрыть",
  17640. DOLLHOUSE: "Dollhouse",
  17641. FLOOR_PLAN: "Планировка",
  17642. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  17643. CLOSE_HIGHLIGHTS: "Закрыть",
  17644. PREVIOUS: "Предыдущий",
  17645. PLAY: "Воспроизвести",
  17646. PAUSE: "Пауза",
  17647. NEXT: "Следующий",
  17648. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  17649. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  17650. SOCIAL_SHARING: "Поделиться этой моделью",
  17651. VIEW_IN_VR: "Посмотреть в VR",
  17652. VIEW_FULLSCREEN: "Полный экран",
  17653. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  17654. ZOOM_IN: "Увеличить",
  17655. ZOOM_OUT: "Уменьшить",
  17656. FLOOR_NAME: "Этаж ",
  17657. FLOOR_ALL: "Все",
  17658. TERMS: "Условия",
  17659. PORT_TERMS: "Правила пользования",
  17660. TERMS_OF_USE: "Условия использования",
  17661. TERMS_TEXT_FILE: "terms-ru-RU.html",
  17662. CLOSE_TERMS: "Закрыть",
  17663. TERMS_FAIL:
  17664. "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  17665. HELP: "Помощь",
  17666. HELP_NAVIGATION_TAB: "Навигация",
  17667. HELP_MORE_HELP_TAB: "Доп. Помощь",
  17668. CLOSE: "Закрыть",
  17669. HELP_DESKTOP_PANORAMA_1A:
  17670. "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  17671. HELP_DESKTOP_PANORAMA_2A:
  17672. "Для передвижения по модели нажимайте на круги .",
  17673. HELP_DESKTOP_PANORAMA_3A:
  17674. "Используйте колесо прокрутки для увеличения и уменьшения.",
  17675. HELP_DESKTOP_PANORAMA_1B:
  17676. "Или используйте клавиши со стрелками для поворота влево и вправо.",
  17677. HELP_DESKTOP_PANORAMA_2B:
  17678. "Или используйте стрелки для перемещения вперед и назад.",
  17679. HELP_DESKTOP_PANORAMA_3B:
  17680. "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  17681. HELP_DESKTOP_360_2A:
  17682. "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  17683. HELP_DESKTOP_360_2B:
  17684. "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  17685. HELP_DESKTOP_DOLLHOUSE_1A:
  17686. "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  17687. HELP_DESKTOP_DOLLHOUSE_2A:
  17688. "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  17689. HELP_DESKTOP_DOLLHOUSE_3A:
  17690. "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  17691. HELP_DESKTOP_DOLLHOUSE_1B:
  17692. "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  17693. HELP_DESKTOP_FLOORPLAN_1A:
  17694. "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  17695. HELP_DESKTOP_FLOORPLAN_2A:
  17696. "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  17697. HELP_DESKTOP_FLOORPLAN_3A:
  17698. "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  17699. HELP_DESKTOP_FLOORPLAN_2B:
  17700. "Или используйте клавиши со стрелками для поворота влево или вправо.",
  17701. HELP_DESKTOP_FLOORPLAN_3B:
  17702. "Или используйте стрелки для увеличения и уменьшения.",
  17703. HELP_MOBILE_PANORAMA_1:
  17704. "Нажмите и перетащите, чтобы осмотреть модель.",
  17705. HELP_MOBILE_PANORAMA_2:
  17706. "Для передвижения по модели нажимайте на круги.",
  17707. HELP_MOBILE_3:
  17708. "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  17709. HELP_MOBILE_360_2:
  17710. "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  17711. HELP_MOBILE_DOLLHOUSE_1:
  17712. "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  17713. HELP_MOBILE_DOLLHOUSE_2:
  17714. "Нажмите и перетащите, чтобы расположить Dollhouse.",
  17715. HELP_MOBILE_FLOORPLAN_1:
  17716. "Нажмите и перетащите, чтобы расположить план здания.",
  17717. HELP_MOBILE_FLOORPLAN_2:
  17718. "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  17719. HELP_MORE_HLR_A: "Фотоколлаж",
  17720. HELP_DESKTOP_MORE_HLR_B:
  17721. "Откройте для перемещения по модели, используя иконки изображений.",
  17722. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  17723. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  17724. "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  17725. HELP_MOBILE_MORE_DOLLHOUSE_B:
  17726. "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  17727. HELP_MORE_FLOORS_A: "Выбор Этажа",
  17728. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  17729. HELP_MORE_TAG_A: "tag™ Posts",
  17730. HELP_DESKTOP_MORE_TAG_B:
  17731. "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  17732. HELP_MOBILE_MORE_TAG_B:
  17733. "Нажмите для получения информации о функциях.",
  17734. HELP_MORE_ZOOM_A: "Масштаб",
  17735. HELP_DESKTOP_MORE_ZOOM_B:
  17736. "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  17737. HELP_MORE_TOUR_A: "Управление Туром",
  17738. HELP_DESKTOP_MORE_TOUR_B:
  17739. "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  17740. HELP_MORE_INSIDE_A: "Вид Изнутри",
  17741. HELP_DESKTOP_MORE_INSIDE_B:
  17742. "Нажмите, чтобы просмотреть модель изнутри.",
  17743. HELP_MOBILE_MORE_INSIDE_B:
  17744. "Нажмите, чтобы просмотреть модель изнутри.",
  17745. HELP_MORE_VR_A: "Режим VR",
  17746. HELP_DESKTOP_MORE_VR_B:
  17747. "Нажмите, чтобы запустить модель в виртуальной реальности.",
  17748. HELP_MOBILE_MORE_VR_B:
  17749. "Нажмите, чтобы запустить модель в виртуальной реальности.",
  17750. HELP_MORE_360_A: "360° Views",
  17751. HELP_DESKTOP_MORE_360_B:
  17752. "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  17753. HELP_MOBILE_MORE_360_B:
  17754. "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  17755. HELP_MORE_FULLSCREEN_A: "Полный экран",
  17756. HELP_DESKTOP_MORE_FULLSCREEN_B:
  17757. "Развернуть 3D Showcase во весь экран.",
  17758. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  17759. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  17760. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  17761. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  17762. WEBVR_LEARN_MORE: "Узнать больше",
  17763. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  17764. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  17765. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  17766. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  17767. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  17768. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  17769. VR_GOOGLE_DAYDREAM: "Google Daydream",
  17770. VR_APP: "port VR App",
  17771. VR_APP_OPEN: "Или открыть через приложение port VR",
  17772. VR_COMPATIBLE_ANDROID_LONG:
  17773. 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  17774. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  17775. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  17776. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  17777. VR_VIEW_SPACE: "Запустить модель в VR",
  17778. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  17779. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  17780. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  17781. VR_GOT_IT_CAPS: "ЯСНО",
  17782. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  17783. VR_SHOW_UNSUPPORTED:
  17784. "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  17785. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  17786. VR_SHOW_IOS_2:
  17787. "Для просмотра требуется приложение port VR и совместимый iPhone",
  17788. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  17789. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  17790. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  17791. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  17792. VR_COMPATIBLE_IPHONES_1: "iPhones",
  17793. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  17794. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  17795. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  17796. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  17797. VR_ANDROID_DVICES: "Android устройства",
  17798. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  17799. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  17800. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  17801. VR_DOWNLOAD_HERE: "Скачать здесь",
  17802. VR_REQUIRE_HEADSET:
  17803. "Требуется VR-шлем и установленное приложение port VR для Android",
  17804. VR_REDIRECT_TO_STORE:
  17805. "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  17806. VR_IMPROPER_EMBED:
  17807. "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  17808. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  17809. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  17810. SHARE_TO: "Поделиться",
  17811. SHARE_LINK: "Прямая ссылка",
  17812. SHARE_EXPLORE: "просмотреть",
  17813. SHARE_AT: "на",
  17814. SHARE_WITH: "с",
  17815. SHARE_3D: "в 3D",
  17816. SHARE_COPIED: "Скопировано!",
  17817. ERROR_BROWSER_SOLUTION:
  17818. "установите новый браузер, чтобы просмотреть 3D пространство.",
  17819. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  17820. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  17821. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  17822. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  17823. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  17824. ERROR_GENERIC_ACTIONS_3: " или ",
  17825. ERROR_GENERIC_ACTIONS_4:
  17826. "смотрите наше руководство по устранению неполадок",
  17827. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  17828. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  17829. ERROR_WEBGL_IOS_SOLUTION:
  17830. "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  17831. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  17832. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  17833. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  17834. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  17835. ERROR_WEBGL_SAFARI_ACTIONS_2:
  17836. "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  17837. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  17838. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  17839. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  17840. ERROR_MISSING_URLS_EXPLANATION:
  17841. "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  17842. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  17843. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  17844. ERROR_LOADING_FAILED_ACTIONS_2:
  17845. "посмотрите наше руководство по устранению неполадок",
  17846. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  17847. ERROR_MAINTENANCE_SOLUTION:
  17848. "Пожалуйста, попробуйте снова через несколько минут.",
  17849. LINK_TO_LOCATION: "Ссылка на местоположение",
  17850. MENU_COPY: "Копировать",
  17851. LINK_ALERT_COPY:
  17852. "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  17853. ROTATE: "Вращать",
  17854. MOVE: "Передвигаться",
  17855. INSIDE: "Вид изнутри",
  17856. ZOOM: "Масштаб",
  17857. };
  17858. },
  17859. {},
  17860. ],
  17861. 116: [
  17862. function (e, t, i) {
  17863. //main.js
  17864. (function (t) {
  17865. "use strict";
  17866. var modelProgressBase = 0.4;
  17867. var progressUpdate = function (e) {
  17868. // 0 <= e <= 1
  17869. console.log("e1:" + e);
  17870. e = Math.round(modelProgressBase * e * 100);
  17871. console.log("e2:" + e);
  17872. var t = $(".progressbar");
  17873. t.find(".bar").css("width", e + "%");
  17874. t.find(".label").css("left", (t.width() * e) / 100 - 15 + "px"); //上面跟着的字的百分比
  17875. t.find(".perc").text(e + "%"); //具体数字的百分比
  17876. };
  17877. $("#gui-loading").fadeIn(200);
  17878. progressUpdate(0.1);
  17879. var fileName = g_version ? "modeldata.js" : "someData.json";
  17880. $.ajax(
  17881. g_Prefix +
  17882. "data/" +
  17883. window.number +
  17884. "/" +
  17885. fileName +
  17886. "?" +
  17887. randomTime().getTime(),
  17888. { dataType: "json" }
  17889. )
  17890. .done(function (e) {
  17891. //改
  17892. var data = matcher(e);
  17893. data.files.templates[0] =
  17894. g_Prefix +
  17895. e.files.templates[0].replace("{{number}}", window.number);
  17896. data.user = {
  17897. is_authenticated: false,
  17898. flags: [
  17899. "payment_show_past_due",
  17900. "sc_imgopt_100",
  17901. "mattertags",
  17902. "labels",
  17903. "fastly_v2_urls",
  17904. "vr",
  17905. "uhql",
  17906. "sc_segment_100",
  17907. "show_segment_metrics",
  17908. "content_distribution",
  17909. "workshop_webgl",
  17910. "show360views",
  17911. "showcase_vr",
  17912. "ws_zooming",
  17913. "model_settings",
  17914. "ws_360snapshots",
  17915. "img_multi_dl",
  17916. "vrworkshop",
  17917. "tag_links",
  17918. "ws_img_multi_dl",
  17919. "mattertag_links",
  17920. "billing_tab_hidden",
  17921. "static_cloud_ui",
  17922. "metrics",
  17923. "mattertag_media",
  17924. "img_size_download",
  17925. "show_360snapshots",
  17926. "floorplan",
  17927. "sc_tilegen_0",
  17928. "showcase_webvr",
  17929. "sc_mixpanel_0",
  17930. "show_clickbait",
  17931. "zooming",
  17932. "showcase_tiling",
  17933. "list_signed_urls_default_3",
  17934. "fastly_image_opto",
  17935. ],
  17936. };
  17937. try {
  17938. //处理一下导览数据
  17939. data.model.images = data.model.images.filter((e) => {
  17940. if (!e.locations && !e.thumbnail_signed_src) return; //旧的曾有导览数据是错误的,将它删除
  17941. if (e.locations && e.locations.length == 0) return;
  17942. return e;
  17943. });
  17944. } catch (e) {
  17945. console.log(e);
  17946. }
  17947. window.DATA = data;
  17948. data.model.summary = data.summary;
  17949. data.model.name = data.name;
  17950. for (let i in data) {
  17951. data[i] == "false" && (data[i] = false);
  17952. }
  17953. progressUpdate(0.7);
  17954. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  17955. if (data.weixinDesc) {
  17956. g_weixinObj.desc = data.weixinDesc;
  17957. }
  17958. if (data.shareImgUrl) {
  17959. g_weixinObj.imgUrl = data.shareImgUrl;
  17960. }
  17961. window.wx && manage.weixinShare();
  17962. //初始画面
  17963. data.camera_start &&
  17964. data.camera_start.thumbImg &&
  17965. E(manage.dealURL(data.camera_start.thumbImg));
  17966. function E(e) {
  17967. $("<img/>")
  17968. .attr("src", e)
  17969. .on("load", function () {
  17970. $("#gui-thumb")
  17971. .css("backgroundImage", "url(" + e + ")")
  17972. .fadeIn(500),
  17973. $(this).remove();
  17974. });
  17975. }
  17976. //背景
  17977. (settings.transparentBg =
  17978. settings.transparentBg || data.transparentBg || false),
  17979. (settings.bgImg = settings.bgImg || data.bgImg || null);
  17980. if (settings.bgImg) {
  17981. $("#player").css({
  17982. "background-image": "url(" + settings.bgImg + ")",
  17983. "background-position": "center center",
  17984. });
  17985. }
  17986. {
  17987. //初始化导览时间
  17988. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100;
  17989. window._settings.warp.teleportTime =
  17990. (settings.teleportTime / DATA.tourBlackSpeed) * 100;
  17991. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100;
  17992. if (DATA.tourRotTime == "" || DATA.tourRotTime == void 0) {
  17993. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  17994. }
  17995. }
  17996. {
  17997. //其他
  17998. _settings.floorPlanAngle = DATA.floorPlanAngle || 0;
  17999. }
  18000. })
  18001. .fail((e) => {
  18002. alert("缺少someData文件,请检查场景码是否正确。");
  18003. });
  18004. function StartLoad() {
  18005. //当加载完data后
  18006. function i() {
  18007. var e = window.number; //Y.getModelIDFromQueryString();
  18008. if (!e) return b(null, "loading-failed");
  18009. var t = Y.parseSidUrl(e),
  18010. i = l(),
  18011. a = c(),
  18012. s = o(),
  18013. u = V.quickstart.enabled,
  18014. g = null,
  18015. m = null,
  18016. v = null,
  18017. w = null,
  18018. T = null,
  18019. x = null,
  18020. S = null,
  18021. M = null,
  18022. R = null,
  18023. P = null,
  18024. O = null,
  18025. L = null,
  18026. N = new ue();
  18027. r(s);
  18028. h({
  18029. //MP开头写法
  18030. urlBase: t.urlBase,
  18031. })
  18032. .then(function () {
  18033. return re.init(), d(t, e); //getModel and load
  18034. })
  18035. .then(function (e) {
  18036. progressUpdate(0.9);
  18037. return (
  18038. (P = e),
  18039. p(
  18040. P,
  18041. V.appConfig.segment_key,
  18042. V.appConfig.keen_write_key,
  18043. V.appConfig.keen_project_id,
  18044. {
  18045. startSource: i,
  18046. autoplay: V.autoplay,
  18047. quickstart: u,
  18048. }
  18049. ),
  18050. P.urls.init()
  18051. );
  18052. })
  18053. .then(function () {
  18054. return P.loadPanos();
  18055. })
  18056. .then(function () {
  18057. (m = X.getStartCameraOptions(P, P.panos)),
  18058. (S = A(P)),
  18059. (O = y(u, m.mode)),
  18060. (v = O.controls),
  18061. (w = O.player),
  18062. (T = O.director),
  18063. (x = O.tagManager),
  18064. (M = O.tileDownloader),
  18065. (R = O.qualityManager),
  18066. (L = O.panoRenderer),
  18067. C(P, S, O, s),
  18068. (w.director = T), //xzw add
  18069. P.supportsTiles && M.start(),
  18070. !u ||
  18071. (m.mode === D.PANORAMA && m.pano) ||
  18072. (de.warn(
  18073. "Tried to quickstart, but failed as we are not starting in inside mode."
  18074. ),
  18075. (u = !1));
  18076. var e = null;
  18077. if (u) {
  18078. de.warn("Quickstart engaged. Hold on to your knickers.");
  18079. var t = v.controls[D.PANORAMA];
  18080. (g = new ie(R, S.scene, S.camera, t, s)),
  18081. _(S, s, P),
  18082. (e = g.load(m).then(function () {
  18083. S.addComponent(g),
  18084. S.once(le.AfterRender, function () {
  18085. de.warn(
  18086. "First render after quickstart load finished."
  18087. );
  18088. });
  18089. }));
  18090. }
  18091. window.flyToFirst = function () {
  18092. //xzw add
  18093. var pano = w.model.panos.get(
  18094. "8d778e19657f433fb9cf8947d823bb70"
  18095. );
  18096. var q = new _x.Quaternion(
  18097. 0.7099827027821568,
  18098. -0.07708150183830938,
  18099. 0.6958985789714591,
  18100. 0.07555241737970636
  18101. );
  18102. var lookAtPoint = new _x.Vector3(0, 0, -1)
  18103. .applyQuaternion(q)
  18104. .add(pano.position);
  18105. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint });
  18106. };
  18107. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N));
  18108. })
  18109. .then(function () {
  18110. return f(P, U.onProgress, i, !u, a);
  18111. })
  18112. .then(function () {
  18113. if (
  18114. ((m.quickstart = u),
  18115. I(P, S, O, s),
  18116. S.started || _(S, s, P),
  18117. H.modelLoaded(P, w, v, V.autoplay),
  18118. E(w, P, m, V.autoplay).done(function () {
  18119. T.autoTour();
  18120. }),
  18121. !P.supportsTiles)
  18122. ) {
  18123. var e = new Z(P, w);
  18124. e.start();
  18125. }
  18126. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  18127. U.init(P, T, w, v, S, m, H.getSessionId()),
  18128. U.endLoading(P, T, x),
  18129. S.once(le.AfterRender, function () {
  18130. N.setAppReadyTime();
  18131. var e = N.calcFullLoadingTime();
  18132. de.warn("Total load time: " + e / 1e3),
  18133. H.loadComplete(e),
  18134. de.warn("First render after model load finished.");
  18135. try {
  18136. window.evt && window.dispatchEvent(window.evt);
  18137. parent.postMessage(
  18138. {
  18139. cmd: "loaded",
  18140. },
  18141. "*"
  18142. );
  18143. } catch (err) {}
  18144. }),
  18145. S.on(le.MemoryUsageUpdated, n);
  18146. })
  18147. .fail(b.bind(this, e));
  18148. }
  18149. function n(e) {
  18150. ce.update(e);
  18151. }
  18152. function r(e) {
  18153. de.info("Version", "2.25.6-0-gd87e5b1"),
  18154. (q.defaultMaxListeners = 1e3),
  18155. a(e),
  18156. s();
  18157. }
  18158. function o() {
  18159. return document.getElementById("player");
  18160. }
  18161. function a(e) {
  18162. e.addEventListener("dragenter", T, !1),
  18163. e.addEventListener("dragover", T, !1);
  18164. }
  18165. function s() {
  18166. F.valueFromHash("title", !0) ||
  18167. $(document).ready(function () {
  18168. var e = $(".model-title");
  18169. e.hide();
  18170. });
  18171. }
  18172. function l() {
  18173. return F.valueFromHash("play", !1)
  18174. ? "autoplay"
  18175. : F.inIframe()
  18176. ? "click"
  18177. : "fullpage";
  18178. }
  18179. function c() {
  18180. return {
  18181. panoElementsToLoad: 6,
  18182. modelElementsToLoad: 0,
  18183. totalElementsLoaded: 0,
  18184. totalElementsToLoad: 0,
  18185. totalPercentageLoaded: 0,
  18186. progressCallback: null,
  18187. };
  18188. }
  18189. function h(e) {
  18190. return K.loadFeatureFlags(e).done(function (e) {
  18191. K.updateDependentSettings(e, V);
  18192. });
  18193. }
  18194. // function u(e) {
  18195. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  18196. // responseType: "json",
  18197. // prefetchFrom: "config"
  18198. // }).then(function(e) {
  18199. // return e ? void j.extendObject(V.appConfig, e) : {}
  18200. // }, function(e) {
  18201. // return de.warn("Failed loading runtime config, using defaults."),
  18202. // $.when({})
  18203. // })
  18204. // }
  18205. function d(e, t) {
  18206. var i = B.getModel({
  18207. url: t,
  18208. floors: F.valueFromHash("f", !0),
  18209. autoload: !1,
  18210. });
  18211. return $.when(i, n).then(null, function (e) {
  18212. return this;
  18213. });
  18214. }
  18215. function p(e, t, i, n, r) {
  18216. de.info("Model data loaded"),
  18217. de.debug("UUID: " + e.data.job.uuid),
  18218. J.init(K.getFlags()),
  18219. i &&
  18220. H.initKeen({
  18221. token: i,
  18222. appId: n,
  18223. }),
  18224. H.initSegment({
  18225. model: e.sid,
  18226. version: "2.25.6-0-gd87e5b1",
  18227. startSource: r.startSource,
  18228. token: t,
  18229. autoplay: r.autoplay,
  18230. quickstart: r.quickstart,
  18231. });
  18232. }
  18233. function f(e, t, i, n, r) {
  18234. return (
  18235. (r.progressCallback = t),
  18236. H.sessionStart(),
  18237. e.load(n).progress(g.bind(this, r))
  18238. );
  18239. }
  18240. function g(e, t) {
  18241. (e.modelElementsToLoad = t[1]), v(e), m(e);
  18242. }
  18243. function m(e) {
  18244. e.totalElementsLoaded++,
  18245. (e.totalPercentageLoaded =
  18246. e.totalElementsLoaded / e.totalElementsToLoad),
  18247. //----许钟文-----------------模型进度条向后调整
  18248. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  18249. e.totalPercentageLoaded =
  18250. modelProgressBase +
  18251. (1 - modelProgressBase) * e.totalPercentageLoaded;
  18252. //console.log('pro:'+e.totalPercentageLoaded)
  18253. //---------------------------
  18254. e.progressCallback &&
  18255. e.progressCallback(100 * e.totalPercentageLoaded);
  18256. }
  18257. function v(e) {
  18258. e.totalElementsToLoad =
  18259. e.modelElementsToLoad + e.panoElementsToLoad;
  18260. }
  18261. function A(e) {
  18262. var t = new x.PerspectiveCamera();
  18263. t.layers.enable(he.PANOMARKERS),
  18264. t.layers.enable(he.RETICULE),
  18265. t.layers.enable(he.TAG);
  18266. var i = new x.Scene(),
  18267. n = new x.AmbientLight(16777215);
  18268. i.add(n),
  18269. (i.plane = new x.Mesh(
  18270. new x.PlaneBufferGeometry(1e5, 1e5),
  18271. new x.RawShaderMaterial({
  18272. side: x.DoubleSide,
  18273. })
  18274. )),
  18275. (i.plane.position.y = 0),
  18276. i.plane.rotateX(-Math.PI / 2),
  18277. (i.plane.material.visible = !1),
  18278. i.add(i.plane),
  18279. i.updateMatrixWorld(),
  18280. V.showScreenshotLocations &&
  18281. e.data.images.forEach(function (e) {
  18282. if (e.metadata && e.metadata.camera_position) {
  18283. var t = e.metadata.camera_position,
  18284. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3));
  18285. (n.position = t.clone()), i.add(n);
  18286. var r = e.metadata.camera_quaternion,
  18287. o = new x.Vector3(0, 0, -1).applyQuaternion(r);
  18288. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680));
  18289. }
  18290. }),
  18291. V.showAxis &&
  18292. (i.add(
  18293. new x.ArrowHelper(
  18294. new x.Vector3(0, 1, 0),
  18295. new x.Vector3(0, 0, 0),
  18296. 1,
  18297. 255
  18298. )
  18299. ),
  18300. i.add(
  18301. new x.ArrowHelper(
  18302. new x.Vector3(0, 0, 1),
  18303. new x.Vector3(0, 0, 0),
  18304. 1,
  18305. 16711680
  18306. )
  18307. ),
  18308. i.add(
  18309. new x.ArrowHelper(
  18310. new x.Vector3(1, 0, 0),
  18311. new x.Vector3(0, 0, 0),
  18312. 1,
  18313. 65280
  18314. )
  18315. ));
  18316. //背景
  18317. if (!settings.transparentBg && !settings.bgImg) {
  18318. i.skybox = new W();
  18319. i.add(i.skybox);
  18320. }
  18321. var r = new te(i, t, z);
  18322. return r;
  18323. }
  18324. function y(e, t) {
  18325. var i = e ? 1 : 1e3,
  18326. n = J.tilegen || J.imgopt ? 6 : 2;
  18327. n = F.valueFromHash("tileconc", n);
  18328. var r = new ne(),
  18329. o = new ae({
  18330. concurrentDownloads: n,
  18331. }),
  18332. a = new se(),
  18333. s = new P(),
  18334. l = new M(),
  18335. c = new S(t),
  18336. h = new R(),
  18337. u = new O(i),
  18338. d = new L(),
  18339. p = new oe();
  18340. return {
  18341. qualityManager: r,
  18342. panoRenderer: a,
  18343. tileDownloader: o,
  18344. player: c,
  18345. director: l,
  18346. modelManager: s,
  18347. tagManager: p,
  18348. displayController: u,
  18349. labelDisplayController: d,
  18350. controls: h,
  18351. };
  18352. }
  18353. function C(e, t, i, n) {
  18354. var r = i.controls,
  18355. o = i.qualityManager,
  18356. a = i.panoRenderer,
  18357. s = i.tileDownloader,
  18358. l = i.modelManager;
  18359. r.init(n, l),
  18360. ee.init(i.director, r, i.player, l, t),
  18361. o.init(l),
  18362. s.init(o),
  18363. a.init(t, s, o),
  18364. l.init(s, a, o),
  18365. l.addModel(e),
  18366. t.addComponent(G);
  18367. }
  18368. function I(e, t, i, n) {
  18369. var r = i.qualityManager,
  18370. o = i.panoRenderer,
  18371. a = i.tileDownloader,
  18372. s = i.modelManager,
  18373. l = i.player,
  18374. c = i.director,
  18375. h = i.tagManager,
  18376. u = i.displayController,
  18377. d = i.labelDisplayController,
  18378. p = i.controls;
  18379. t.scene.add(e), (t.qualityManager = r);
  18380. var f = {
  18381. camera: t.camera,
  18382. director: c,
  18383. modelManager: s,
  18384. tileDownloader: a,
  18385. panoRenderer: o,
  18386. qualityManager: r,
  18387. tagManager: h,
  18388. container: n,
  18389. controls: p,
  18390. };
  18391. l.init(f),
  18392. l.setScene(t.scene),
  18393. h.init(s, l),
  18394. c.init(l, s),
  18395. u.init(c, l, s, h, n),
  18396. d.init(l, s, n),
  18397. z.bindEvents(l),
  18398. t.addComponent(h),
  18399. t.addComponent(l),
  18400. t.addComponent(o),
  18401. (l.sceneRenderer = t); //xzw add 方便resize
  18402. }
  18403. function E(e, t, i, n) {
  18404. return (
  18405. de.info("Starting player in " + i.mode),
  18406. H.report(t.sid, "started-playing", n, i.quickstart),
  18407. e.start(i)
  18408. );
  18409. }
  18410. function b(e, t) {
  18411. de.error(t), k.error(t), H.report(e, "error-" + t);
  18412. }
  18413. function w(e) {
  18414. var t = F.details();
  18415. t && "Safari" === t.name && t.version > 500 && t.version < 600
  18416. ? (k.error("webgl-safari"), H.report(e, "error-webgl-safari"))
  18417. : (k.error("webgl-generic"),
  18418. H.report(e, "error-webgl-generic"));
  18419. }
  18420. function _(e, t, i) {
  18421. try {
  18422. e.start(t);
  18423. } catch (e) {
  18424. throw (de.warn(e.message), w(i.sid), e);
  18425. }
  18426. }
  18427. function T(e) {
  18428. e.stopPropagation(), e.preventDefault();
  18429. }
  18430. //czj 判断someData 有没有hoticon字段 修改热点的样式
  18431. if (window.DATA.hoticon) {
  18432. g_HotImage = {
  18433. point:
  18434. window.DATA.hoticon.default ||
  18435. "https://super.4dage.com/images/4dagePoint2.png",
  18436. point2:
  18437. window.DATA.hoticon.higt ||
  18438. "https://super.4dage.com/images/4dagePoint.png",
  18439. };
  18440. }
  18441. //czj 判断someData 有没有backgroundMusic 添加音乐
  18442. if (window.DATA.backgroundMusic) {
  18443. if (window.isLocal) {
  18444. SoundManager.setSrc(
  18445. "bgm",
  18446. manage.dealURL(window.DATA.backgroundMusic)
  18447. );
  18448. } else {
  18449. SoundManager.setSrc("bgm", window.DATA.backgroundMusic);
  18450. }
  18451. $("#volume").show();
  18452. } else if (g_version === "one") {
  18453. SoundManager.setSrc(
  18454. "bgm",
  18455. manage.dealURL(
  18456. g_Prefix +
  18457. "/audio/" +
  18458. "audio" +
  18459. window.number +
  18460. "/background.mp3"
  18461. )
  18462. );
  18463. $("#volume").show();
  18464. }
  18465. //隐藏公司logo
  18466. if (window.DATA.loadlogo) {
  18467. showLogo();
  18468. }
  18469. e("./lib/three75-shim"),
  18470. e("./lib/array-polyfill"),
  18471. e("./lib/performance-polyfill"),
  18472. e("./lib/shaders/CopyShader.js"),
  18473. e("./lib/shaders/HorizontalBlurShader.js"),
  18474. e("./lib/shaders/VerticalBlurShader.js"),
  18475. e("./lib/postprocessing/EffectComposer.js"),
  18476. e("./lib/postprocessing/RenderPass.js"),
  18477. e("./lib/postprocessing/MaskPass.js"),
  18478. e("./lib/postprocessing/ShaderPass.js"),
  18479. window.Promise || (window.Promise = e("promise-polyfill"));
  18480. var x = e("three"),
  18481. _x = e("three"),
  18482. S = (e("./util/sentry"), e("./player")),
  18483. M = e("./director"),
  18484. R = e("./controls/CameraControls"),
  18485. P = e("./model/ModelManager"),
  18486. O = e("./DisplayController"),
  18487. L = e("./label/LabelDisplayController"),
  18488. D = e("./enum/Viewmode"),
  18489. N = e("./util/logger"),
  18490. B = e("./showcase"),
  18491. F = e("./util/browser"),
  18492. V = e("./settings"),
  18493. U = e("./gui/gui"),
  18494. k = e("./gui/error"),
  18495. H = e("./analytics"),
  18496. G = e("./util/transitions"),
  18497. z = e("./effects"),
  18498. W = e("./objects/Skybox"),
  18499. j = e("./util/common"),
  18500. Y =
  18501. (e("./util/PanoramaCollection"),
  18502. e("./util/math"),
  18503. e("./util/showcase")),
  18504. X = e("./util/camera"),
  18505. Z =
  18506. (e("./objects/Panorama"),
  18507. e("./cameras/PanoramaCamera"),
  18508. e("./preloaders")),
  18509. q = e("events").EventEmitter,
  18510. K = e("./featureflags"),
  18511. Q = (e("./util/lerp"), e("./util/ajax")),
  18512. J = e("./ab"),
  18513. ee = e("./sdk/automation.js"),
  18514. te = e("./scene/SceneRenderer"),
  18515. ie = e("./scene/QuickstartManager"),
  18516. ne = e("./tile/QualityManager.js"),
  18517. re = e("./localization/localize"),
  18518. oe = e("./tag/tagManager"),
  18519. ae = e("./tile/TileDownloader"),
  18520. se = e("./tile/PanoRenderer"),
  18521. le =
  18522. (e("./enum/PanoSizeClass"),
  18523. e("./enum/PanoramaEvents"),
  18524. e("./enum/SceneRendererEvents")),
  18525. ce = e("./gui/memoryUsage"),
  18526. he = e("./enum/RenderLayers"),
  18527. ue = e("./TimingData"),
  18528. de = new N(t);
  18529. (N.level = V.logLevel), (N.consoleEnabled = V.console), i();
  18530. }
  18531. }).call(this, "/js/main.js");
  18532. },
  18533. {
  18534. "./DisplayController": 1,
  18535. "./TimingData": 2,
  18536. "./ab": 3,
  18537. "./analytics": 4,
  18538. "./cameras/PanoramaCamera": 7,
  18539. "./controls/CameraControls": 9,
  18540. "./director": 15,
  18541. "./effects": 16,
  18542. "./enum/PanoSizeClass": 36,
  18543. "./enum/PanoramaEvents": 37,
  18544. "./enum/RenderLayers": 41,
  18545. "./enum/SceneRendererEvents": 43,
  18546. "./enum/Viewmode": 51,
  18547. "./featureflags": 59,
  18548. "./gui/error": 64,
  18549. "./gui/gui": 65,
  18550. "./gui/memoryUsage": 73,
  18551. "./label/LabelDisplayController": 91,
  18552. "./lib/array-polyfill": 92,
  18553. "./lib/performance-polyfill": 95,
  18554. "./lib/postprocessing/EffectComposer.js": 96,
  18555. "./lib/postprocessing/MaskPass.js": 97,
  18556. "./lib/postprocessing/RenderPass.js": 98,
  18557. "./lib/postprocessing/ShaderPass.js": 99,
  18558. "./lib/shaders/CopyShader.js": 100,
  18559. "./lib/shaders/HorizontalBlurShader.js": 101,
  18560. "./lib/shaders/VerticalBlurShader.js": 102,
  18561. "./lib/three75-shim": 103,
  18562. "./localization/localize": 108,
  18563. "./tag/tagManager": 124,
  18564. "./model/ModelManager": 140,
  18565. "./objects/Panorama": 148,
  18566. "./objects/Skybox": 152,
  18567. "./player": 155,
  18568. "./preloaders": 156,
  18569. "./scene/QuickstartManager": 157,
  18570. "./scene/SceneRenderer": 158,
  18571. "./sdk/automation.js": 164,
  18572. "./settings": 166,
  18573. "./showcase": 168,
  18574. "./tile/PanoRenderer": 169,
  18575. "./tile/QualityManager.js": 170,
  18576. "./tile/TileDownloader": 171,
  18577. "./util/PanoramaCollection": 178,
  18578. "./util/ajax": 181,
  18579. "./util/browser": 182,
  18580. "./util/camera": 183,
  18581. "./util/common": 185,
  18582. "./util/lerp": 188,
  18583. "./util/logger": 189,
  18584. "./util/math": 190,
  18585. "./util/sentry": 192,
  18586. "./util/showcase": 193,
  18587. "./util/transitions": 195,
  18588. events: 202,
  18589. "promise-polyfill": 213,
  18590. three: 217,
  18591. },
  18592. ],
  18593. 117: [
  18594. function (e, t, i) {
  18595. "use strict";
  18596. function n(e) {
  18597. e = e || {};
  18598. r.RawShaderMaterial.call(
  18599. this,
  18600. a.extendObject(
  18601. {
  18602. fragmentShader: o.cube.fragmentShader,
  18603. vertexShader: o.cube.vertexShader,
  18604. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  18605. name: "CubemapMaterial",
  18606. },
  18607. e
  18608. )
  18609. );
  18610. }
  18611. var r = e("three"),
  18612. o = e("../shaders"),
  18613. a = e("../util/common");
  18614. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  18615. (n.prototype.constructor = n),
  18616. (t.exports = n);
  18617. },
  18618. {
  18619. "../shaders": 167,
  18620. "../util/common": 185,
  18621. three: 217,
  18622. },
  18623. ],
  18624. 118: [
  18625. function (e, t, i) {
  18626. "use strict";
  18627. function n(e) {
  18628. e = e || {};
  18629. r.RawShaderMaterial.call(
  18630. this,
  18631. a.extendObject(
  18632. {
  18633. fragmentShader: o.model.fragmentShader,
  18634. vertexShader: o.model.vertexShader,
  18635. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  18636. name: "ModelTextureMaterial",
  18637. },
  18638. e
  18639. )
  18640. );
  18641. }
  18642. var r = e("three"),
  18643. o = e("../shaders"),
  18644. a = e("../util/common");
  18645. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  18646. (n.prototype.constructor = n),
  18647. (n.prototype.setProjectedPanos = function (e, t, i) {
  18648. i && (this.uniforms.progress.value = 0),
  18649. e.ensureSkyboxReadyForRender(),
  18650. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  18651. this.uniforms.pano0Position.value.copy(e.position),
  18652. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  18653. t.ensureSkyboxReadyForRender(),
  18654. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  18655. this.uniforms.pano1Position.value.copy(t.position),
  18656. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld);
  18657. }),
  18658. /* n.prototype.setEyeDir = function(dir, pos) {//加
  18659. this.uniforms.eyeDir.value.copy(dir)
  18660. this.uniforms.eyePos.value.copy(pos)
  18661. }
  18662. n.prototype.setBendCameraQua = function(matrix) {//加
  18663. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  18664. } */
  18665. (t.exports = n);
  18666. },
  18667. {
  18668. "../shaders": 167,
  18669. "../util/common": 185,
  18670. three: 217,
  18671. },
  18672. ],
  18673. 119: [
  18674. function (e, t, i) {
  18675. (function (i) {
  18676. "use strict";
  18677. function n(e, t, i, n) {
  18678. (this.div = null),
  18679. (this.body = null),
  18680. (this.label = e),
  18681. (this.description = t),
  18682. (this.parsedDescription = []),
  18683. (this.media = i || {
  18684. type: null,
  18685. }),
  18686. (this.loadingSpinner = null),
  18687. (this.parser = new r({
  18688. supportLinks: !u.valueFromHash("mls"),
  18689. keepLinkLabels: !0,
  18690. })),
  18691. (this.state = I.CLOSED),
  18692. (this.orientation = ""),
  18693. (this.initialTransform = ""),
  18694. (this.hovering = !1),
  18695. (this.openTransition = null),
  18696. (this.closeTransition = null),
  18697. (this.openPromise = null),
  18698. (this.closePromise = null),
  18699. (this.animationTransition = null),
  18700. (this.animationScale = 0);
  18701. }
  18702. var r = e("../Parser/DescriptionParser"),
  18703. o = e("../Media/Link"),
  18704. a = e("../Media/Image"),
  18705. s = e("../Media/EmbedlyPlayer"),
  18706. l = e("../Media/EmbedlyEmbed"),
  18707. c = e("../../util/transitions"),
  18708. h = e("../../util/lerp"),
  18709. u = e("../../util/browser"),
  18710. d = e("./BillboardEvent"),
  18711. p = e("../Media/MediaEvent"),
  18712. f = e("../Parser/DescriptionChunkType"),
  18713. g = e("events").EventEmitter,
  18714. m = e("./billboardSettings"),
  18715. v = e("./overlaySettings"),
  18716. A = e("../../util/logger"),
  18717. y = new A(i),
  18718. C = document.getElementById("tag-billboards");
  18719. C.addEventListener("touchend", function (e) {
  18720. C.style.pointerEvents = "none";
  18721. }),
  18722. C.addEventListener("touchcancel", function (e) {
  18723. C.style.pointerEvents = "none";
  18724. });
  18725. var I = {
  18726. CLOSED: "closed",
  18727. OPENING: "opening",
  18728. OPEN: "open",
  18729. CLOSING: "closing",
  18730. ACTIVE: "active",
  18731. };
  18732. (n.prototype = Object.create(g.prototype)),
  18733. (n.prototype.build = function (e) {
  18734. this.parsedDescription = this.parser.parse(this.description);
  18735. var t = document.createElement("div");
  18736. (t.className = "tag-container has-hotzone"),
  18737. (this.div = t),
  18738. (this.body = document.createElement("div")),
  18739. (this.body.className = "tag-body");
  18740. var i = document.createElement("div");
  18741. i.classList.add("tag-content");
  18742. var n = document.createElement("div");
  18743. n.classList.add("tag-text-content");
  18744. var r = document.createElement("div");
  18745. (r.className = "tag-label"),
  18746. (r.textContent = this.label),
  18747. n.appendChild(r);
  18748. var o = document.createElement("div");
  18749. (o.className = "tag-desc"),
  18750. n.appendChild(o),
  18751. i.appendChild(n),
  18752. this.body.appendChild(i),
  18753. this.appendDescriptionElements(this.parsedDescription, o),
  18754. this.appendMedia(),
  18755. t.appendChild(this.body),
  18756. C.appendChild(t),
  18757. this.bindEvents(t, this.body);
  18758. }),
  18759. (n.prototype.bindEvents = function (e, t) {
  18760. var i = function (e) {
  18761. return function (t) {
  18762. if (!this.div.classList.contains("overlay")) {
  18763. var i,
  18764. n = document.getElementById("player");
  18765. try {
  18766. i = new MouseEvent(e, t);
  18767. } catch (n) {
  18768. (i = document.createEvent("MouseEvents")),
  18769. i.initMouseEvent(
  18770. e,
  18771. t.bubbles,
  18772. t.cancelable,
  18773. t.view,
  18774. t.detail,
  18775. t.screenX,
  18776. t.screenY,
  18777. t.clientX,
  18778. t.clientY,
  18779. t.ctrlKey,
  18780. t.altKey,
  18781. t.shiftKey,
  18782. t.metaKey,
  18783. t.button,
  18784. t.relatedTarget
  18785. );
  18786. }
  18787. n.dispatchEvent(i);
  18788. }
  18789. };
  18790. };
  18791. t.addEventListener("mousedown", function (e) {
  18792. e.stopPropagation();
  18793. }),
  18794. t.addEventListener("mouseup", function (e) {
  18795. e.stopPropagation();
  18796. }),
  18797. e.addEventListener("touchstart", function (e) {
  18798. C.style.pointerEvents = "auto";
  18799. }),
  18800. e.addEventListener("mousedown", i("mousedown").bind(this)),
  18801. e.addEventListener("mouseup", i("mouseup").bind(this)),
  18802. t.addEventListener(
  18803. "mouseover",
  18804. function (t) {
  18805. this.state === I.OPEN && e.classList.remove("has-hotzone");
  18806. }.bind(this)
  18807. ),
  18808. e.addEventListener(
  18809. "mouseenter",
  18810. function (e) {
  18811. this.state !== I.CLOSING &&
  18812. ((this.hovering = !0), this.emit(d.ENTER));
  18813. }.bind(this)
  18814. ),
  18815. e.addEventListener(
  18816. "mouseleave",
  18817. function (e) {
  18818. (this.hovering = !1), this.emit(d.LEAVE);
  18819. }.bind(this)
  18820. ),
  18821. e.addEventListener("gesturestart", function (e) {
  18822. e.preventDefault();
  18823. });
  18824. var n = e.querySelector(".tag-text-content"),
  18825. r = 0;
  18826. n.addEventListener("touchstart", function (e) {
  18827. r = e.changedTouches[0].clientY;
  18828. }),
  18829. n.addEventListener("touchmove", function (t) {
  18830. function i(e) {
  18831. e &&
  18832. ((0 === e.scrollTop && t.changedTouches[0].clientY > r) ||
  18833. (e.scrollTop + e.clientHeight - e.scrollHeight === 0 &&
  18834. t.changedTouches[0].clientY < r)) &&
  18835. t.preventDefault();
  18836. }
  18837. return e.classList.contains("overlay")
  18838. ? i(this.querySelector(".tag-desc"))
  18839. : void i(this);
  18840. }),
  18841. e.addEventListener("touchmove", function (e) {
  18842. 0 ===
  18843. (n.compareDocumentPosition(e.target) &
  18844. Node.DOCUMENT_POSITION_CONTAINED_BY) &&
  18845. e.preventDefault();
  18846. });
  18847. }),
  18848. (n.prototype.appendDescriptionElements = function (e, t) {
  18849. e.length > 0 && this.div.classList.add("has-text"),
  18850. e.forEach(
  18851. function (e, i) {
  18852. switch (e.type) {
  18853. case f.TEXT:
  18854. t.appendChild(this.createTextElement(e.text));
  18855. break;
  18856. case f.LINK:
  18857. t.appendChild(this.createLinkElement(e.link));
  18858. }
  18859. }.bind(this)
  18860. );
  18861. }),
  18862. (n.prototype.appendLoadingSpinner = function () {
  18863. (this.loadingSpinner = document.createElement("div")),
  18864. this.loadingSpinner.classList.add("loading-spinner");
  18865. var e = document.createElement("div");
  18866. e.classList.add("gui-spinner-icon"),
  18867. this.loadingSpinner.appendChild(e),
  18868. this.body.appendChild(this.loadingSpinner);
  18869. }),
  18870. (n.prototype.onMediaLoadFinished = function () {
  18871. this.loadingSpinner &&
  18872. (this.loadingSpinner.parentNode.removeChild(
  18873. this.loadingSpinner
  18874. ),
  18875. this.applyOrientation(this.orientation),
  18876. (this.loadingSpinner = null));
  18877. }),
  18878. (n.prototype.appendMedia = function () {
  18879. if (
  18880. this.media &&
  18881. this.media.type &&
  18882. "error" !== this.media.type &&
  18883. (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)
  18884. ) {
  18885. this.appendLoadingSpinner();
  18886. var e = document.createElement("div");
  18887. e.classList.add("tag-media-content");
  18888. var t = document.createElement("i");
  18889. switch (
  18890. (["icon", "icon-close-thin", "close"].forEach(function (e) {
  18891. t.classList.add(e);
  18892. }),
  18893. this.body.appendChild(t),
  18894. this.body.appendChild(e),
  18895. this.media.type)
  18896. ) {
  18897. case f.IMAGE:
  18898. e.appendChild(
  18899. this.createImageElement(this.media, this.body)
  18900. );
  18901. break;
  18902. case f.VIDEO:
  18903. e.appendChild(
  18904. this.createVideoElement(this.media, this.body)
  18905. );
  18906. break;
  18907. case f.RICH:
  18908. e.appendChild(
  18909. this.createEmbedElement(this.media, this.body)
  18910. );
  18911. }
  18912. }
  18913. }),
  18914. (n.prototype.createTextElement = function (e) {
  18915. var t = document.createElement("span");
  18916. return (t.textContent = e), t;
  18917. });
  18918. (n.prototype.createLinkElement = function (e) {
  18919. var t = new o(e);
  18920. return (
  18921. t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  18922. t.createDomElement()
  18923. );
  18924. }),
  18925. (n.prototype.createImageElement = function (e, t) {
  18926. function i() {
  18927. function e() {
  18928. m ||
  18929. (r.classList.remove("view-image"),
  18930. c.classList.add("overlay"),
  18931. i(),
  18932. window.addEventListener("resize", b),
  18933. c.addEventListener("click", a),
  18934. g.addEventListener("click", l),
  18935. f.addEventListener("click", s),
  18936. (m = !0),
  18937. o.emit(p.IMAGE_OPENED));
  18938. }
  18939. function i() {
  18940. t.classList.add("show-info"),
  18941. h.classList.remove("collapsible"),
  18942. (h.style.height = "");
  18943. var e = parseFloat(getComputedStyle(I).lineHeight),
  18944. i = y + e,
  18945. r = c.clientWidth - 2 * v.boundaryWidth - C,
  18946. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  18947. s = a,
  18948. l = s * n.aspect;
  18949. l > r && ((l = r), (s = l / n.aspect)),
  18950. s > a && ((s = a), (l = s * n.aspect)),
  18951. (l += C),
  18952. (s += C + i),
  18953. (t.style.width = l + "px"),
  18954. (t.style.height = s + "px"),
  18955. (u.style.paddingTop = e + C + "px"),
  18956. o.description.length > 0 &&
  18957. (h.classList.add("collapsible"),
  18958. (h.style.height = h.clientHeight + 12 + "px"),
  18959. (E.style.height =
  18960. "calc(100% - " + I.clientHeight + "px)"));
  18961. }
  18962. function a(e) {
  18963. e.target === c && s();
  18964. }
  18965. function s() {
  18966. m &&
  18967. ((m = !1),
  18968. r.classList.add("view-image"),
  18969. c.classList.remove("overlay"),
  18970. (h.style.height = ""),
  18971. (u.style.paddingTop = ""),
  18972. (t.style.width = ""),
  18973. (t.style.height = ""),
  18974. window.removeEventListener("resize", b),
  18975. c.removeEventListener("click", a),
  18976. g.removeEventListener("click", l),
  18977. f.removeEventListener("click", s),
  18978. o.emit(p.IMAGE_CLOSED),
  18979. o.close(!0));
  18980. }
  18981. function l(e) {
  18982. t.classList.toggle("show-info");
  18983. }
  18984. var c = o.div,
  18985. h = c.getElementsByClassName("tag-content")[0],
  18986. u = c.getElementsByClassName("tag-media-content")[0],
  18987. f = t.getElementsByClassName("close")[0],
  18988. g = h.getElementsByClassName("tag-label")[0];
  18989. c.classList.add("has-image"),
  18990. r.classList.add("view-image"),
  18991. c.classList.add(
  18992. n.aspect >= 1 ? "image-landscape" : "image-portrait"
  18993. ),
  18994. o.applyOrientation(o.orientation);
  18995. var m = !1,
  18996. A = getComputedStyle(h),
  18997. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  18998. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  18999. I = h.querySelector(".tag-label"),
  19000. E = h.querySelector(".tag-desc"),
  19001. b = (function () {
  19002. var e,
  19003. t,
  19004. n = 0;
  19005. return function () {
  19006. clearInterval(e),
  19007. clearTimeout(t),
  19008. (e = setInterval(function () {
  19009. var e = c.clientHeight;
  19010. n !== e && (i(), (n = e));
  19011. }, 100)),
  19012. (t = setTimeout(clearInterval.bind(this, e), 1e3));
  19013. };
  19014. })();
  19015. n.on(p.IMAGE_OPENING, e),
  19016. o.on(d.ACTIVATE, e),
  19017. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  19018. o.on(d.CLOSING, s);
  19019. }
  19020. var n = new a(),
  19021. r = n.createDomElement();
  19022. this.once(d.OPENED, function () {
  19023. n.load(e.src)
  19024. .then(i)
  19025. .catch(function (t) {
  19026. y.warn("Failed to load image:", e.src),
  19027. y.warn("with error:", t);
  19028. })
  19029. .then(this.onMediaLoadFinished.bind(this));
  19030. });
  19031. var o = this;
  19032. return r;
  19033. }),
  19034. (n.prototype.createVideoElement = function (e, t) {
  19035. var i = new s({
  19036. autoPlay: !0,
  19037. autoResume: !0,
  19038. startMuted: !1,
  19039. loop: !1,
  19040. }),
  19041. n = i.createDomElement();
  19042. return (
  19043. this.once(
  19044. d.OPENED,
  19045. function () {
  19046. i.load(e.src)
  19047. .then(
  19048. function () {
  19049. this.div.classList.add("has-video"),
  19050. (this.state !== I.OPEN &&
  19051. this.state !== I.ACTIVE) ||
  19052. (i.show(), i.play()),
  19053. this.on(d.OPENING, i.show.bind(i)),
  19054. this.on(d.OPENED, i.play.bind(i)),
  19055. this.on(d.CLOSING, i.pause.bind(i)),
  19056. this.on(d.CLOSED, i.hide.bind(i));
  19057. }.bind(this)
  19058. )
  19059. .catch(function (t) {
  19060. y.warn("Failed to embed video:", e.src),
  19061. y.warn("with error:", t);
  19062. })
  19063. .then(this.onMediaLoadFinished.bind(this));
  19064. }.bind(this)
  19065. ),
  19066. n
  19067. );
  19068. }),
  19069. (n.prototype.createEmbedElement = function (e, t) {
  19070. var i = new l(),
  19071. n = i.createDomElement();
  19072. return (
  19073. this.once(
  19074. d.OPENED,
  19075. function () {
  19076. i.load(e.src)
  19077. .then(
  19078. function () {
  19079. this.div.classList.add("has-embed"),
  19080. (this.state !== I.OPEN &&
  19081. this.state !== I.ACTIVE) ||
  19082. i.show(),
  19083. this.applyOrientation(this.orientation),
  19084. this.on(d.OPENING, i.show.bind(i)),
  19085. this.on(d.CLOSED, i.hide.bind(i));
  19086. }.bind(this)
  19087. )
  19088. .catch(function (t) {
  19089. y.warn("Failed to embed:", e.src),
  19090. y.warn("with error:", t);
  19091. })
  19092. .then(this.onMediaLoadFinished.bind(this));
  19093. }.bind(this)
  19094. ),
  19095. n
  19096. );
  19097. }),
  19098. (n.prototype.open = function (e) {
  19099. return (
  19100. (this.openPromise = $.Deferred()),
  19101. this.state === I.ACTIVE
  19102. ? this.openPromise.resolve().promise()
  19103. : (this.hovering || this.div.classList.add("has-hotzone"),
  19104. this.openTransition
  19105. ? e && this.setActiveState()
  19106. : (this.openTransition = c.setTimeout(
  19107. function () {
  19108. this.state !== I.OPEN &&
  19109. (this.emit(d.OPENING),
  19110. e && this.emit(d.ACTIVATING),
  19111. (this.state = I.OPENING),
  19112. this.animateOpen(
  19113. function () {
  19114. e && this.setActiveState(),
  19115. this.openPromise.resolve();
  19116. }.bind(this)
  19117. ));
  19118. }.bind(this),
  19119. m.animation.openDelay
  19120. )),
  19121. c.cancel(this.closeTransition),
  19122. this.closePromise && this.closePromise.reject(),
  19123. (this.closeTransition = void 0),
  19124. this.openPromise.promise())
  19125. );
  19126. }),
  19127. (n.prototype.close = function (e) {
  19128. return (
  19129. (this.closePromise = $.Deferred()),
  19130. !e && this.hovering
  19131. ? this.closePromise.reject().promise()
  19132. : (this.closeTransition ||
  19133. (this.closeTransition = c.setTimeout(
  19134. function () {
  19135. this.state !== I.CLOSED &&
  19136. (this.emit(d.CLOSING),
  19137. (this.state = I.CLOSING),
  19138. this.animateClose());
  19139. }.bind(this),
  19140. m.animation.closeDelay
  19141. )),
  19142. c.cancel(this.openTransition),
  19143. this.openPromise && this.openPromise.reject(),
  19144. (this.openTransition = void 0),
  19145. this.closePromise.resolve(),
  19146. this.closePromise.promise())
  19147. );
  19148. }),
  19149. (n.prototype.setActiveState = function () {
  19150. this.state !== I.CLOSED &&
  19151. ((this.state = I.ACTIVE),
  19152. this.emit(d.ACTIVATE),
  19153. this.div.classList.remove("has-hotzone"));
  19154. }),
  19155. (n.prototype.animateOpen = function (e) {
  19156. if (this.state === I.OPENING) {
  19157. if (
  19158. (c.cancel(this.animationTransition), u.detectSamsungNative())
  19159. )
  19160. return (
  19161. (this.boardOrientation = null),
  19162. (this.div.style.visibility = "visible"),
  19163. this.emit(d.OPENED),
  19164. (this.state = I.OPEN),
  19165. void (e && e())
  19166. );
  19167. (this.div.style.webkitTransform = "scale(0)"),
  19168. (this.div.style.transform = "scale(0)"),
  19169. (this.div.style.visibility = "visible"),
  19170. (this.animationTransition = c.start(
  19171. h.property(this, "animationScale", 1),
  19172. m.animation.openDuration,
  19173. function () {
  19174. this.emit(d.OPENED), (this.state = I.OPEN), e && e();
  19175. }.bind(this)
  19176. ));
  19177. }
  19178. }),
  19179. (n.prototype.animateClose = function (e) {
  19180. this.state === I.CLOSING &&
  19181. (c.cancel(this.animationTransition),
  19182. (this.animationTransition = c.start(
  19183. h.property(this, "animationScale", 0),
  19184. m.animation.closeDuration,
  19185. function () {
  19186. this.emit(d.CLOSED),
  19187. (this.state = I.CLOSED),
  19188. (this.div.style.visibility = "hidden"),
  19189. this.div.classList.contains("has-hotzone") ||
  19190. this.div.classList.add("has-hotzone"),
  19191. e && e();
  19192. }.bind(this)
  19193. )));
  19194. }),
  19195. (n.prototype.needsUpdate = function () {
  19196. return this.state !== I.CLOSED;
  19197. }),
  19198. (n.prototype.update = function (e, t) {
  19199. if (this.needsUpdate()) {
  19200. var i = (this.updateOrientation(e), this.calcScale(t)),
  19201. n = {
  19202. x: ((e.x + 1) * $("#player").width()) / 2,
  19203. y: ((e.y + 1) * $("#player").height()) / 2,
  19204. };
  19205. (this.div.screenTransform =
  19206. this.initialTransform +
  19207. " translate(" +
  19208. n.x +
  19209. "px, " +
  19210. n.y +
  19211. "px) scale(" +
  19212. i * this.animationScale +
  19213. ")"),
  19214. (this.div.style.webkitTransform = this.div.screenTransform),
  19215. (this.div.style.transform = this.div.screenTransform);
  19216. }
  19217. }),
  19218. (n.prototype.getDimensions = function () {
  19219. return this.div.getBoundingClientRect();
  19220. }),
  19221. (n.prototype.calcScale = function (e) {
  19222. return Math.sqrt(e / 40) * m.boardToDiscRatio;
  19223. }),
  19224. (n.prototype.updateOrientation = function (e) {
  19225. if (this.state !== I.ACTIVE) {
  19226. var t = 1 / 3,
  19227. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  19228. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  19229. r = "";
  19230. (r += 0 === n ? "right" : 2 === n ? "left" : ""),
  19231. (r += 0 === i ? "-down" : 2 === i ? "-up" : ""),
  19232. 1 === n &&
  19233. ((r = 0 === i ? "bottom" : 2 === i ? "top" : ""),
  19234. 1 === i &&
  19235. (r =
  19236. $("#player").width() > $("#player").height()
  19237. ? e.x < 0
  19238. ? "right"
  19239. : "left"
  19240. : e.y < 0
  19241. ? "bottom"
  19242. : "top")),
  19243. (1 === n && 1 === i && r === this.orientation) ||
  19244. this.applyOrientation(r);
  19245. }
  19246. }),
  19247. (n.prototype.applyOrientation = function (e) {
  19248. (this.div.style.transform = this.div.style.webkitTransform = ""),
  19249. this.div.classList.remove("tag-container-" + this.orientation),
  19250. this.div.classList.add("tag-container-" + e);
  19251. var t = window.getComputedStyle(this.div);
  19252. (this.initialTransform = t.transform || t.webkitTransform),
  19253. "none" === this.initialTransform &&
  19254. (this.initialTransform = "");
  19255. var i = t.transform.slice(7, -1).split(","),
  19256. n = -i[4],
  19257. r = -i[5];
  19258. (this.div.style.webkitTransformOrigin = n + "px " + r + "px"),
  19259. (this.div.style.transformOrigin = n + "px " + r + "px"),
  19260. (this.orientation = e);
  19261. }),
  19262. (t.exports = n);
  19263. }).call(this, "/js/tag/Billboard/Billboard.js");
  19264. },
  19265. {
  19266. "../../util/browser": 182,
  19267. "../../util/lerp": 188,
  19268. "../../util/logger": 189,
  19269. "../../util/transitions": 195,
  19270. "../Media/EmbedlyEmbed": 125,
  19271. "../Media/EmbedlyPlayer": 126,
  19272. "../Media/Image": 128,
  19273. "../Media/Link": 129,
  19274. "../Media/MediaEvent": 131,
  19275. "../Parser/DescriptionChunkType": 133,
  19276. "../Parser/DescriptionParser": 134,
  19277. "./BillboardEvent": 120,
  19278. "./billboardSettings": 121,
  19279. "./overlaySettings": 122,
  19280. events: 202,
  19281. },
  19282. ],
  19283. 120: [
  19284. function (e, t, i) {
  19285. "use strict";
  19286. t.exports = Object.freeze({
  19287. ENTER: "billboard.enter",
  19288. LEAVE: "billboard.leave",
  19289. OPENING: "billboard.opening",
  19290. OPENED: "billboard.open",
  19291. CLOSING: "billboard.closing",
  19292. CLOSED: "billboard.closed",
  19293. ACTIVATING: "billboard.activating",
  19294. ACTIVATE: "billboard.activate",
  19295. });
  19296. },
  19297. {},
  19298. ],
  19299. 121: [
  19300. function (e, t, i) {
  19301. "use strict";
  19302. t.exports = Object.freeze({
  19303. animation: Object.freeze({
  19304. hoverOnClosing: !1,
  19305. openDelay: 100,
  19306. closeDelay: 50,
  19307. openDuration: 200,
  19308. closeDuration: 100,
  19309. }),
  19310. boardToDiscRatio: 1.2,
  19311. });
  19312. },
  19313. {},
  19314. ],
  19315. 122: [
  19316. function (e, t, i) {
  19317. "use strict";
  19318. t.exports = Object.freeze({
  19319. boundaryWidth: 30,
  19320. boundaryHeight: 0,
  19321. });
  19322. },
  19323. {},
  19324. ],
  19325. 123: [
  19326. function (e, t, i) {
  19327. //tag
  19328. (function (i) {
  19329. "use strict";
  19330. function n(e, t, i) {
  19331. var n = i.version || "0";
  19332. "0" !== n && I.info("tag defined using version " + n),
  19333. (this.model = e),
  19334. (this.sid = t),
  19335. (this.color = new r.Color().set(i.color || l.tagDefault)),
  19336. (this.hoverColor = l._darken(this.color, 0.2)),
  19337. (this.floor = null),
  19338. (this.floorIndex = i.floor),
  19339. (this.mode = s.PANORAMA),
  19340. i.preferred_camera &&
  19341. i.preferred_camera.mode &&
  19342. (this.mode = i.preferred_camera.mode),
  19343. (this.obj3d = null),
  19344. (this.disc = null),
  19345. (this.materials = {
  19346. disc: null,
  19347. pole: null,
  19348. }),
  19349. (this.position = new r.Vector3().copy(i.position)),
  19350. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  19351. (this.discWorldPosition = null),
  19352. (this.discScale = 0.05),
  19353. (this.poleEnabled = i.stem.enabled),
  19354. (this.billboard = new o(i.label, i.description, i.media, this)),
  19355. (this.visibleTransition = null),
  19356. (this.hoveringDisc = !1);
  19357. }
  19358. var r = e("three"),
  19359. o = e("./Billboard/Billboard"),
  19360. a = e("../settings"),
  19361. s = e("../enum/Viewmode"),
  19362. l = e("../enum/Colors"),
  19363. c = e("../enum/RenderLayers"),
  19364. h = e("../enum/RenderOrder"),
  19365. u = (e("../util/common"), e("../util/math")),
  19366. d = e("../util/texture"),
  19367. p = e("../objects/Panorama"),
  19368. f = e("../shaders"),
  19369. g = e("../util/transitions"),
  19370. m = e("../util/lerp"),
  19371. v = e("../util/easing"),
  19372. A = e("./Billboard/BillboardEvent"),
  19373. y = e("events").EventEmitter,
  19374. C = e("../util/logger"),
  19375. I = new C(i),
  19376. E = d.loadBase64(
  19377. "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=="
  19378. ),
  19379. b = d.loadBase64(
  19380. "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC"
  19381. ),
  19382. w = new r.PlaneBufferGeometry(1, 1);
  19383. (n.prototype = Object.create(y.prototype)),
  19384. (n.raycaster = new r.Raycaster()),
  19385. (n.prototype.bindEvents = function () {
  19386. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  19387. this.billboard.on(A.LEAVE, this.setFreeState.bind(this));
  19388. }),
  19389. (n.prototype.build = function () {
  19390. return (
  19391. (this.floor =
  19392. this.model.floors.get(this.floorIndex) ||
  19393. this.model.floors.first()),
  19394. this.floor &&
  19395. (this.billboard.build(this.model.sid),
  19396. (this.obj3d = this.buildObject3D()),
  19397. this.floor.add(this.obj3d)),
  19398. this
  19399. );
  19400. }),
  19401. (n.prototype.buildObject3D = function () {
  19402. var e = new r.Object3D();
  19403. e.position.copy(this.position);
  19404. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  19405. (t.bg.value = b),
  19406. (t.mask.value = E),
  19407. t.color.value.copy(this.color),
  19408. (this.materials.disc = new r.RawShaderMaterial({
  19409. transparent: !0,
  19410. vertexShader: f.tagDisc.vertexShader,
  19411. fragmentShader: f.tagDisc.fragmentShader,
  19412. uniforms: t,
  19413. })),
  19414. (this.disc = new r.Mesh(w, this.materials.disc)),
  19415. this.disc.layers.set(c.TAG),
  19416. this.disc.position.copy(this.discPosition),
  19417. (this.disc.renderOrder = h.tagDisc),
  19418. (this.disc.tag = this);
  19419. var i = this.buildPole();
  19420. return (
  19421. i.layers.set(c.TAG),
  19422. (i.renderOrder = h.tagStem),
  19423. e.add(i),
  19424. e.layers.set(c.TAG),
  19425. e.add(this.disc)
  19426. );
  19427. }),
  19428. (n.prototype.buildPole = function () {
  19429. var e = new r.BufferGeometry(),
  19430. t = new Float32Array(6);
  19431. return (
  19432. (t[0] = t[1] = t[2] = 0),
  19433. (t[3] = this.discPosition.x),
  19434. (t[4] = this.discPosition.y),
  19435. (t[5] = this.discPosition.z),
  19436. e.addAttribute("position", new r.BufferAttribute(t, 3)),
  19437. (this.materials.pole = new r.LineBasicMaterial({
  19438. linewidth: a.tags.pole.width,
  19439. color: a.tags.pole.color,
  19440. opacity: 0,
  19441. visible: this.poleEnabled,
  19442. transparent: !0,
  19443. depthWrite: !1,
  19444. })),
  19445. new r.Line(e, this.materials.pole)
  19446. );
  19447. }),
  19448. (n.prototype.setFreeState = function (e) {
  19449. (!e && this.hoveringDisc) ||
  19450. this.billboard.close(e).then(
  19451. function () {
  19452. this.materials.disc.uniforms.color.value = this.color;
  19453. }.bind(this)
  19454. );
  19455. }),
  19456. (n.prototype.setHoverState = function (e) {
  19457. this.billboard.open(e),
  19458. (this.materials.disc.uniforms.color.value = this.hoverColor);
  19459. }),
  19460. (n.prototype.hide = function (e, t) {
  19461. var i = $.Deferred();
  19462. if (
  19463. 0 === this.materials.disc.uniforms.opacity.value &&
  19464. !g.isRunning(this.visibleTransition)
  19465. )
  19466. return i.resolve().promise();
  19467. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  19468. var n =
  19469. this.materials.disc.uniforms.opacity.value /
  19470. a.tags.disc.opacity,
  19471. r = t + e,
  19472. o = t / r;
  19473. return (
  19474. (this.visibleTransition = g.start(
  19475. (function (e) {
  19476. var t = m.property(
  19477. e.materials.disc.uniforms.opacity,
  19478. "value",
  19479. 0
  19480. ),
  19481. i = m.property(e.materials.pole, "opacity", 0);
  19482. return function (n) {
  19483. t(n), e.materials.pole && i(n);
  19484. };
  19485. })(this),
  19486. r * n,
  19487. function () {
  19488. i.resolve();
  19489. },
  19490. o,
  19491. v[a.warp.blendEasing]
  19492. )),
  19493. i.promise()
  19494. );
  19495. }),
  19496. (n.prototype.show = function (e, t) {
  19497. var i = $.Deferred();
  19498. if (
  19499. this.materials.disc.uniforms.opacity.value ===
  19500. a.tags.disc.opacity &&
  19501. !g.isRunning(this.visibleTransition)
  19502. )
  19503. return i.resolve().promise();
  19504. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  19505. var n =
  19506. (a.tags.disc.opacity -
  19507. this.materials.disc.uniforms.opacity.value) /
  19508. a.tags.disc.opacity,
  19509. r = t + e,
  19510. o = t / r;
  19511. return (
  19512. (this.visibleTransition = g.start(
  19513. (function (e) {
  19514. var t = m.property(
  19515. e.materials.disc.uniforms.opacity,
  19516. "value",
  19517. a.tags.disc.opacity
  19518. ),
  19519. i = m.property(
  19520. e.materials.pole,
  19521. "opacity",
  19522. a.tags.pole.opacity
  19523. );
  19524. return function (n) {
  19525. t(n), e.materials.pole && i(n);
  19526. };
  19527. })(this),
  19528. r * n,
  19529. function () {
  19530. i.resolve();
  19531. },
  19532. o,
  19533. v[a.warp.blendEasing]
  19534. )),
  19535. i.promise()
  19536. );
  19537. }),
  19538. (n.prototype.closestPanoTowardTag = function (e, t) {
  19539. var i = [],
  19540. o = [],
  19541. l = this.disc.getWorldPosition();
  19542. if (e === s.PANORAMA) {
  19543. var c = 0.5,
  19544. h = t.position.clone().sub(l).normalize();
  19545. i.push(p.filters.isPanoAligned()),
  19546. i.push(p.filters.isNeighbourPanoTo(t)),
  19547. i.push(p.filters.inPanoDirection(l, h, c)),
  19548. o.push(p.scoreFunctions.direction(l, h));
  19549. }
  19550. var u = new r.Vector3(),
  19551. d = function (e) {
  19552. u.copy(l).sub(e.position);
  19553. var t = -r.Math.radToDeg(
  19554. Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))
  19555. ),
  19556. i = a.tags.navigate.tiltTolerance;
  19557. return (
  19558. a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  19559. );
  19560. },
  19561. f = function (e) {
  19562. return (
  19563. Math.abs(e.position.x - l.x) >
  19564. a.tags.visibility.cameraClearance ||
  19565. Math.abs(e.position.z - l.z) >
  19566. a.tags.visibility.cameraClearance
  19567. );
  19568. };
  19569. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2));
  19570. var g = this.model.panos.sortByScore(i, o);
  19571. if (a.tags.navigate.lineOfSight) {
  19572. for (var m = 0; m < g.length; m++) {
  19573. var v = g[m].item,
  19574. A = v.position.distanceTo(l);
  19575. if (
  19576. !a.tags.visibility.anyDistance &&
  19577. A > a.tags.visibility.visibleDistance
  19578. )
  19579. return null;
  19580. n.raycaster.set(
  19581. v.position,
  19582. l.clone().sub(v.position).normalize()
  19583. );
  19584. var y = n.raycaster.intersectObjects(this.model.colliders);
  19585. if (0 === y.length || y[0].distance > A) return v;
  19586. }
  19587. return null;
  19588. }
  19589. return g.length > 0 && g[0].item;
  19590. }),
  19591. (n.prototype.examine = function (e) {
  19592. var t = e.mode,
  19593. i =
  19594. (a.tags.navigate.nearestPano &&
  19595. this.closestPanoTowardTag(t, e.currentPano)) ||
  19596. e.currentPano,
  19597. n = this.disc.getWorldPosition();
  19598. this.billboard.setActiveState();
  19599. var o = function () {
  19600. var t = this.billboard.getDimensions(),
  19601. n = new r.Vector3();
  19602. u.convertScreenPositionToNDC(
  19603. t.left + t.width / 2,
  19604. t.top + t.height / 2,
  19605. n
  19606. ),
  19607. n.unproject(e.camera),
  19608. e.flyToPano({
  19609. pano: i,
  19610. lookAtPoint: n,
  19611. });
  19612. }.bind(this);
  19613. if (t === s.PANORAMA)
  19614. if (i !== e.currentPano) {
  19615. var l = {
  19616. pano: i,
  19617. lookAtPoint: n,
  19618. duration: null,
  19619. maxDistanceOverride: null,
  19620. skipWarpingCheck: !1,
  19621. };
  19622. e.flyToPano(l, o);
  19623. } else
  19624. setTimeout(
  19625. function () {
  19626. this.billboard.open().then(function () {
  19627. o();
  19628. });
  19629. }.bind(this),
  19630. 0
  19631. );
  19632. else {
  19633. var c = {
  19634. pano: i,
  19635. };
  19636. if (n) {
  19637. var h = new r.Matrix4().lookAt(
  19638. i.position,
  19639. n,
  19640. new r.Vector3(0, 1, 0)
  19641. );
  19642. c.quaternion = new r.Quaternion().setFromRotationMatrix(h);
  19643. }
  19644. (c.callback = o),
  19645. (c.duration = 1500),
  19646. (c.mode = s.PANORAMA),
  19647. e.flyToNewMode(c);
  19648. }
  19649. }),
  19650. (n.prototype.update = (function (e, t) {
  19651. var i = new r.Vector3();
  19652. return function (e, t) {
  19653. (this.discWorldPosition = this.disc.getWorldPosition()),
  19654. this.updateDisc(e, t),
  19655. this.billboard.needsUpdate() &&
  19656. (i.copy(this.discWorldPosition).project(t),
  19657. i.z < 1 &&
  19658. ((i.y *= -1),
  19659. this.billboard.update(i, this.getDiscRadius(i, t))));
  19660. };
  19661. })()),
  19662. (n.prototype.updateDisc = (function (e, t) {
  19663. var i = new r.Vector3(),
  19664. o = new r.Vector3(),
  19665. l = new r.Vector3(),
  19666. c = new r.Vector3(),
  19667. h = new r.Vector3();
  19668. return function (e, t) {
  19669. var u = a.tags.visibility,
  19670. d = a.tags.disc.scale,
  19671. p =
  19672. e === s.DOLLHOUSE || e === s.FLOORPLAN
  19673. ? a.tags.visibility.visibleDistance
  19674. : t.position.distanceTo(this.discWorldPosition);
  19675. if (
  19676. ((this.obj3d.visible =
  19677. 0 !== this.disc.material.opacity &&
  19678. (u.anyDistance ||
  19679. p <= u.visibleDistance ||
  19680. e === s.TRANSITIONING) &&
  19681. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  19682. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  19683. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  19684. this.obj3d.visible)
  19685. ) {
  19686. this.disc.quaternion.copy(t.quaternion);
  19687. var f =
  19688. d.maxSize -
  19689. (d.maxSize - d.minSize) *
  19690. r.Math.smoothstep(p, d.nearBound, d.farBound);
  19691. i.copy(this.discWorldPosition).project(t),
  19692. o
  19693. .set(
  19694. $("#player").width() / 2,
  19695. $("#player").height() / 2,
  19696. 1
  19697. )
  19698. .multiply(i),
  19699. l.set(f / 2, 0, 0).add(o),
  19700. c
  19701. .set(
  19702. 2 / $("#player").width(),
  19703. 2 / $("#player").height(),
  19704. 1
  19705. )
  19706. .multiply(l),
  19707. h.copy(c).unproject(t);
  19708. var g = h.distanceTo(this.discWorldPosition),
  19709. m =
  19710. 1 +
  19711. (a.tags.disc.scale.responsiveness / 100) *
  19712. (n.viewportScale() - 1);
  19713. (this.discScale = g * m),
  19714. this.disc.scale.set(
  19715. this.discScale,
  19716. this.discScale,
  19717. this.discScale
  19718. );
  19719. }
  19720. };
  19721. })()),
  19722. (n.prototype.getDiscRadius = (function (e, t) {
  19723. var i = new r.Vector3();
  19724. return function (e, t) {
  19725. return (
  19726. i
  19727. .set(-this.discScale / 2, 0, 0)
  19728. .applyQuaternion(t.quaternion)
  19729. .add(this.discWorldPosition)
  19730. .project(t),
  19731. Math.abs(e.x - i.x) * $("#player").width()
  19732. );
  19733. };
  19734. })()),
  19735. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  19736. return (
  19737. !(e === s.DOLLHOUSE || e === s.FLOORPLAN) ||
  19738. this.model.allFloorsVisible ||
  19739. !this.floor.hidden
  19740. );
  19741. }),
  19742. (n.prototype.offScreen = function (e, t) {
  19743. var i = e.getWorldPosition().project(t);
  19744. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1);
  19745. }),
  19746. (n.viewportScale = function () {
  19747. return (
  19748. (n.viewportWidth === $("#player").width() &&
  19749. n.viewportHeight === $("#player").height()) ||
  19750. ((n.viewportWidth = $("#player").width()),
  19751. (n.viewportHeight = $("#player").height()),
  19752. (n.currentViewportScale = Math.sqrt(
  19753. Math.min(n.viewportWidth, n.viewportHeight) /
  19754. a.tags.disc.scale.baseViewportSize
  19755. ))),
  19756. n.currentViewportScale
  19757. );
  19758. }),
  19759. (t.exports = n);
  19760. }).call(this, "/js/tag/tag.js");
  19761. },
  19762. {
  19763. "../enum/Colors": 19,
  19764. "../enum/RenderLayers": 41,
  19765. "../enum/RenderOrder": 42,
  19766. "../enum/Viewmode": 51,
  19767. "../objects/Panorama": 148,
  19768. "../settings": 166,
  19769. "../shaders": 167,
  19770. "../util/common": 185,
  19771. "../util/easing": 186,
  19772. "../util/lerp": 188,
  19773. "../util/logger": 189,
  19774. "../util/math": 190,
  19775. "../util/texture": 194,
  19776. "../util/transitions": 195,
  19777. "./Billboard/Billboard": 119,
  19778. "./Billboard/BillboardEvent": 120,
  19779. events: 202,
  19780. three: 217,
  19781. },
  19782. ],
  19783. 124: [
  19784. function (e, t, i) {
  19785. (function (i) {
  19786. "use strict";
  19787. function n() {
  19788. (this.tagState = y.IDLE),
  19789. (this.intersectTag = null),
  19790. (this.hoveredTag = null),
  19791. (this.activeTag = null),
  19792. (this.tagDiscs = []),
  19793. (this.raycaster = new r.Raycaster()),
  19794. (this.modelManager = null),
  19795. (this.player = null),
  19796. (this.totaltags = 0),
  19797. (this.navigatingViaTag = !1),
  19798. (this.enabled = !1);
  19799. }
  19800. var r = e("three"),
  19801. o = e("../util/logger"),
  19802. a = e("../util/common"),
  19803. s = e("../controls/serializer"),
  19804. l = e("../objects/Snapshot"),
  19805. c = e("../settings"),
  19806. h = e("./Billboard/BillboardEvent"),
  19807. u = e("./Media/MediaEvent"),
  19808. d = e("./Media/LinkType"),
  19809. p = e("../enum/Viewmode"),
  19810. f = e("../enum/WarpStyle"),
  19811. g = e("../enum/BlackoutStyle"),
  19812. m = e("../enum/ModelManagerEvents"),
  19813. v = e("../enum/tagEvents"),
  19814. A = e("../enum/PlayerEvents"),
  19815. y = (e("../util/lerp"), e("../enum/TagStates")),
  19816. C = e("events").EventEmitter,
  19817. I = new o(i);
  19818. a.extend(n, C),
  19819. (n.prototype.init = function (e, t) {
  19820. (this.modelManager = e),
  19821. (this.player = t),
  19822. this.updateModel(),
  19823. this.bindEvents();
  19824. }),
  19825. (n.prototype.update = function (e) {
  19826. this.updateTags(
  19827. this.player.mode,
  19828. this.player.camera,
  19829. this.player.currentPano,
  19830. this.player.flying
  19831. );
  19832. }),
  19833. (n.prototype.updateTags = function (e, t, i, n) {
  19834. for (var r in this.model.tags)
  19835. this.model.tags[r].update(e, t, i, n);
  19836. }),
  19837. (n.prototype.updateModel = function () {
  19838. (this.model = this.modelManager.getActiveModel()),
  19839. this.gettagsFromModel(),
  19840. (this.totaltags = Object.keys(this.model.tags).length);
  19841. }),
  19842. (n.prototype.gettagsFromModel = function () {
  19843. this.tagDiscs = [];
  19844. for (var e in this.model.tags) {
  19845. var t = this.model.tags[e].disc;
  19846. t && this.tagDiscs.push(t);
  19847. }
  19848. }),
  19849. (n.prototype.bindEvents = function () {
  19850. function e() {
  19851. Object.keys(this.model.tags).forEach(
  19852. function (e) {
  19853. var t = this.model.tags[e];
  19854. t.bindEvents(),
  19855. t.billboard.on(
  19856. u.LINK_CLICK,
  19857. function (e) {
  19858. e.type === d.NAVIGATION &&
  19859. this.navigateViaLink(e.url);
  19860. }.bind(this)
  19861. ),
  19862. t.billboard.on(
  19863. u.IMAGE_OPENED,
  19864. function () {
  19865. (this.tagState = y.EXAMINE),
  19866. this.emit(u.IMAGE_OPENED);
  19867. }.bind(this)
  19868. ),
  19869. t.billboard.on(
  19870. h.CLOSING,
  19871. this.dismissExaminedTag.bind(this)
  19872. );
  19873. }.bind(this)
  19874. );
  19875. }
  19876. this.modelManager.on(
  19877. m.ActiveModelChanged,
  19878. this.updateModel.bind(this)
  19879. ),
  19880. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  19881. this.player.on(
  19882. A.ModeChanging,
  19883. this.onPlayerModeChanging.bind(this)
  19884. ),
  19885. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  19886. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  19887. this.player.on(
  19888. A.FlyingEnded,
  19889. this.onPlayerFlyingEnded.bind(this)
  19890. ),
  19891. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  19892. this.player.on(
  19893. A.WarpInterrupted,
  19894. this.handleWarpInterruption.bind(this)
  19895. ),
  19896. e.call(this);
  19897. }),
  19898. (n.prototype.navigateViaLink = function (e) {
  19899. var t = s.deserialize(e);
  19900. if (t)
  19901. if (t.mode === p.PANORAMA) {
  19902. try {
  19903. this.player.model.panos.get(t.panoId);
  19904. } catch (e) {
  19905. return void I.warn(
  19906. "Unable to find panorama location",
  19907. t.panoId
  19908. );
  19909. }
  19910. this.player.warpToPanoById(
  19911. t.panoId,
  19912. t.quaternion,
  19913. null,
  19914. null,
  19915. f.BLACK
  19916. );
  19917. } else {
  19918. var i = {
  19919. cameraMode: t.mode,
  19920. position: t.position,
  19921. quaternion: t.quaternion,
  19922. scanId: t.panoId,
  19923. orthoZoom: t.zoom,
  19924. floorVisibility: t.floorVisibility,
  19925. thumbUrl: null,
  19926. name: null,
  19927. };
  19928. this.player.flyToNewMode({
  19929. mode: t.mode,
  19930. duration: c.warp.outsideTime,
  19931. warpDest: new l(i),
  19932. force: !0,
  19933. });
  19934. }
  19935. }),
  19936. (n.prototype.handleWarpStart = function (e, t, i, n) {
  19937. this.dismissExaminedTag(),
  19938. t === f.BLACK &&
  19939. ((null !== n && void 0 !== n) || (n = c.warp.teleportTime),
  19940. e && (i = g.END),
  19941. this.hideShowTagsForBlackoutStyle(i, n));
  19942. }),
  19943. (n.prototype.handleWarpInterruption = function (e, t, i) {
  19944. (null !== i && void 0 !== i) || (i = c.warp.teleportTime),
  19945. this.hideShowTagsForBlackoutStyle(t, i);
  19946. }),
  19947. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  19948. var i = 0,
  19949. n = 0,
  19950. r = t / 2;
  19951. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  19952. case g.END:
  19953. this.hideAlltags(r);
  19954. break;
  19955. case g.BEGINNING:
  19956. this.hideAlltags().done(this.showAlltags.bind(this, r));
  19957. break;
  19958. case g.NONE:
  19959. break;
  19960. case g.MIDDLE:
  19961. (i = r),
  19962. (n = r),
  19963. this.hideAlltags(n),
  19964. setTimeout(
  19965. function () {
  19966. this.showAlltags(i);
  19967. }.bind(this),
  19968. n
  19969. );
  19970. break;
  19971. case g.FADEIN:
  19972. setTimeout(
  19973. function () {
  19974. this.showAlltags(r);
  19975. }.bind(this),
  19976. r
  19977. );
  19978. }
  19979. }),
  19980. (n.prototype.onPlayerModeChanging = function (e, t) {
  19981. t !== p.PANORAMA && this.dismissExaminedTag(),
  19982. t === p.PANORAMA &&
  19983. player.currentPano &&
  19984. !player.currentPano.isAligned() &&
  19985. (t = p.OUTDOOR);
  19986. var i = t !== p.OUTDOOR;
  19987. i !== this.model.tagsShown &&
  19988. (i
  19989. ? this.showAlltags(c.tags.startup.fadeInDuration)
  19990. : this.hideAlltags(c.tags.startup.fadeInDuration));
  19991. }),
  19992. (n.prototype.onPanoChange = function (e, t) {
  19993. var i = this.navigatingViaTag;
  19994. if (((this.navigatingViaTag = !1), !i)) {
  19995. this.dismissExaminedTag();
  19996. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  19997. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  19998. n !== r &&
  19999. (r === p.PANORAMA
  20000. ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0)
  20001. : this.hideAlltags(c.tags.startup.fadeInDuration));
  20002. }
  20003. }),
  20004. (n.prototype.onPlayerReady = function (e, t, i) {
  20005. this.startAlltags(e, t ? i : null);
  20006. }),
  20007. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  20008. this.updateClosestTags(e);
  20009. }),
  20010. (n.prototype.dismissExaminedTag = function () {
  20011. this.activeTag &&
  20012. this.tagState === y.EXAMINE &&
  20013. this.dismissActiveTag(),
  20014. this.hoveredTag &&
  20015. (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null));
  20016. }),
  20017. (n.prototype.startAlltags = function (e, t) {
  20018. (this.model.shouldShowtags = c.tags.enabled),
  20019. (this.enabled = !0),
  20020. e ||
  20021. (this.showAlltags(
  20022. c.tags.startup.fadeInDuration,
  20023. c.tags.startup.fadeInDelay
  20024. ),
  20025. t &&
  20026. setTimeout(
  20027. function () {
  20028. this.activateTag(this.model.getTagBySid(t));
  20029. }.bind(this),
  20030. c.tags.startup.fadeInDuration / 2
  20031. ));
  20032. }),
  20033. (n.prototype.showAlltags = function (e, t, i) {
  20034. function n() {
  20035. o++,
  20036. o === this.totaltags &&
  20037. ((this.model.tagsShown = !0), r.resolve());
  20038. }
  20039. var r = $.Deferred();
  20040. if (
  20041. (!i &&
  20042. this.player.mode === p.PANORAMA &&
  20043. this.player.currentPano &&
  20044. !this.player.currentPano.isAligned()) ||
  20045. !this.model.shouldShowtags
  20046. )
  20047. return r.resolve().promise();
  20048. var o = 0;
  20049. for (var a in this.model.tags) {
  20050. var s = this.model.tags[a];
  20051. s.show(e, t).done(n.bind(this));
  20052. }
  20053. return r.promise();
  20054. }),
  20055. (n.prototype.hideAlltags = function (e, t) {
  20056. function i() {
  20057. r++,
  20058. r === this.totaltags &&
  20059. ((this.model.tagsShown = !1), n.resolve());
  20060. }
  20061. var n = $.Deferred(),
  20062. r = 0;
  20063. for (var o in this.model.tags) {
  20064. var a = this.model.tags[o];
  20065. a.hide(e, t).done(i.bind(this)),
  20066. a === this.activeTag && this.dismissActiveTag();
  20067. }
  20068. return n.promise();
  20069. }),
  20070. (n.prototype.enableHovering = function () {
  20071. this.enabled = !0;
  20072. }),
  20073. (n.prototype.disableHovering = function () {
  20074. this.enabled = !1;
  20075. }),
  20076. (n.prototype.activateTag = function (e, t) {
  20077. (t = t || y.EXAMINE),
  20078. (this.activeTag = e),
  20079. (this.activeTag.hoveringDisc = !0),
  20080. this.activeTag.setHoverState(t === y.EXAMINE),
  20081. (this.tagState = t),
  20082. this.emit(v.TagActivated, e);
  20083. }),
  20084. (n.prototype.dismissActiveTag = function () {
  20085. (this.activeTag.hoveringDisc = !1),
  20086. this.activeTag.setFreeState(!0);
  20087. var e = this.activeTag;
  20088. (this.activeTag = null),
  20089. (this.tagState = y.IDLE),
  20090. this.emit(v.TagDismissed, e);
  20091. }),
  20092. (n.prototype.clickedOnTag = function (e) {
  20093. var t = function () {
  20094. (this.navigatingViaTag = !0),
  20095. this.activeTag.examine(this.player),
  20096. this.emit(v.TagNavigation, this.activeTag);
  20097. }.bind(this);
  20098. return this.tagState !== y.EXAMINE
  20099. ? (this.activateTag(this.intersectTag, y.EXAMINE),
  20100. (this.activeTag = this.intersectTag),
  20101. t(),
  20102. !0)
  20103. : (this.dismissActiveTag(), !1);
  20104. }),
  20105. (n.prototype.intersecttag = (function () {
  20106. var e = new r.Vector3(),
  20107. t = new r.Vector3(),
  20108. i = new r.Vector3();
  20109. return function (n, r, o) {
  20110. if (!this.enabled) return null;
  20111. var a = null,
  20112. s = this.tagDiscs.filter(function (e) {
  20113. return e.parent.visible;
  20114. });
  20115. if (s.length > 0) {
  20116. var l = this.model.floors.reduce(function (e, t) {
  20117. return t.hidden ? e : e.concat(t.collider.children);
  20118. }, s);
  20119. e.set(n.x, n.y, -1).unproject(o),
  20120. t.set(n.x, n.y, 1).unproject(o),
  20121. i.copy(t).sub(e).normalize(),
  20122. this.raycaster.set(e, i);
  20123. var c = this.raycaster.intersectObjects(l);
  20124. c.length > 0 &&
  20125. s.indexOf(c[0].object) !== -1 &&
  20126. (a = c[0].object.tag);
  20127. }
  20128. return (
  20129. (this.intersectTag = a),
  20130. r &&
  20131. (this.activeTag &&
  20132. a !== this.activeTag &&
  20133. (this.tagState === y.BROWSE ||
  20134. (this.tagState === y.EXAMINE && a)) &&
  20135. this.dismissActiveTag(),
  20136. a &&
  20137. a !== this.activeTag &&
  20138. (a.listeners(h.ENTER).length < 1 &&
  20139. (a.billboard.on(
  20140. h.ENTER,
  20141. function () {
  20142. this.hoveredTag = a;
  20143. }.bind(this)
  20144. ),
  20145. a.billboard.on(
  20146. h.LEAVE,
  20147. function () {
  20148. this.hoveredTag = null;
  20149. }.bind(this)
  20150. )),
  20151. this.activateTag(a, y.BROWSE))),
  20152. a
  20153. );
  20154. };
  20155. })()),
  20156. (n.prototype.rankedtagInDirection = (function () {
  20157. var e = [],
  20158. t = [],
  20159. i = new r.Vector3(),
  20160. n = new r.Vector3(),
  20161. o = new r.Vector3();
  20162. return function (r, a, s, l) {
  20163. var c = 0;
  20164. t.length = 0;
  20165. for (var h = 0; h < this.closesttags.length; h++) {
  20166. var u = this.closesttags[h];
  20167. n.copy(u.position),
  20168. n.add(u.discPosition),
  20169. i.copy(a),
  20170. i.sub(n).negate(),
  20171. i.normalize();
  20172. var d = i.dot(l);
  20173. if (d >= 0) {
  20174. o.copy(n), o.project(s);
  20175. var p = this.intersecttag(o, !1, s);
  20176. if (p) {
  20177. if (c >= e.length)
  20178. for (var f = 0; f < 64; f++)
  20179. e.push({
  20180. tag: u,
  20181. dot: d,
  20182. });
  20183. var g = e[c];
  20184. (g.tag = u),
  20185. (g.dot = d),
  20186. (g.position = math.projectPositionToCanvas(n, s)),
  20187. t.push(g),
  20188. c++;
  20189. }
  20190. }
  20191. }
  20192. return (
  20193. t.sort(function (e, t) {
  20194. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0;
  20195. }),
  20196. r < t.length ? t[r].tag : null
  20197. );
  20198. };
  20199. })()),
  20200. (n.prototype.updateClosestTags = (function () {
  20201. var e = new r.Vector3(),
  20202. t = 30;
  20203. return function (i) {
  20204. this.closesttags || (this.closesttags = []),
  20205. (this.closesttags.length = 0);
  20206. var n = this.model.tags;
  20207. if (n)
  20208. for (var r in n)
  20209. if (n.hasOwnProperty(r)) {
  20210. var o = n[r],
  20211. a = o.position;
  20212. e.copy(i), e.sub(a).negate();
  20213. var s = e.lengthSq();
  20214. s < t && this.closesttags.push(o);
  20215. }
  20216. };
  20217. })()),
  20218. (t.exports = n);
  20219. }).call(this, "/js/tag/tagManager.js");
  20220. },
  20221. {
  20222. "../controls/serializer": 14,
  20223. "../enum/BlackoutStyle": 18,
  20224. "../enum/tagEvents": 32,
  20225. "../enum/ModelManagerEvents": 33,
  20226. "../enum/PlayerEvents": 40,
  20227. "../enum/TagStates": 44,
  20228. "../enum/Viewmode": 51,
  20229. "../enum/WarpStyle": 52,
  20230. "../objects/Snapshot": 153,
  20231. "../settings": 166,
  20232. "../util/common": 185,
  20233. "../util/lerp": 188,
  20234. "../util/logger": 189,
  20235. "./Billboard/BillboardEvent": 120,
  20236. "./Media/LinkType": 130,
  20237. "./Media/MediaEvent": 131,
  20238. events: 202,
  20239. three: 217,
  20240. },
  20241. ],
  20242. 125: [
  20243. function (e, t, i) {
  20244. (function (i) {
  20245. "use strict";
  20246. function n() {
  20247. (this.embedWrapper = null), (this.embedElement = null);
  20248. }
  20249. var r = e("../../util/ajax"),
  20250. o = e("./mediaSettings"),
  20251. a = e("../../settings"),
  20252. s = e("../../util/logger"),
  20253. l = new s(i);
  20254. (n.prototype.createDomElement = function () {
  20255. return (
  20256. (this.embedWrapper = document.createElement("div")),
  20257. this.embedWrapper.classList.add("tag-embed"),
  20258. this.embedWrapper.classList.add("hidden"),
  20259. this.embedWrapper
  20260. );
  20261. }),
  20262. (n.prototype.load = function (e) {
  20263. var t =
  20264. "https://api.embedly.com/1/oembed?key=" +
  20265. a.appConfig.embedly_key +
  20266. "&url=" +
  20267. encodeURIComponent(e) +
  20268. "&maxwidth=" +
  20269. o.maxEmbedWidth;
  20270. return new Promise(
  20271. function (e, i) {
  20272. r.get(t).then(
  20273. function (t) {
  20274. if (
  20275. ((t = JSON.parse(t)),
  20276. t.html && t.html.indexOf("<script") === -1)
  20277. ) {
  20278. this.embedWrapper.innerHTML = t.html;
  20279. var n =
  20280. Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  20281. if (
  20282. ((this.embedWrapper.style.width = n + "px"), t.height)
  20283. ) {
  20284. var r = t.height / t.width;
  20285. this.embedWrapper.style.height = n * r + "px";
  20286. }
  20287. this.embedElement = this.embedWrapper.firstChild;
  20288. var a = [];
  20289. try {
  20290. a = [].slice.call(
  20291. this.embedElement.querySelectorAll("a")
  20292. );
  20293. } catch (e) {
  20294. l.debug(
  20295. "Error getting `a` elements for embed; was it an iframe?"
  20296. );
  20297. }
  20298. a.forEach(function (e) {
  20299. e.setAttribute("target", "_blank");
  20300. }),
  20301. this.embedElement.classList.add("hidden"),
  20302. this.embedWrapper.classList.remove("hidden"),
  20303. e();
  20304. } else i("Not a valid embed");
  20305. }.bind(this),
  20306. function (e) {
  20307. i(e.response);
  20308. }
  20309. );
  20310. }.bind(this)
  20311. );
  20312. }),
  20313. (n.prototype.show = function () {
  20314. this.embedElement && this.embedElement.classList.remove("hidden");
  20315. }),
  20316. (n.prototype.hide = function () {
  20317. this.embedElement && this.embedElement.classList.add("hidden");
  20318. }),
  20319. (t.exports = n);
  20320. }).call(this, "/js/tag/Media/EmbedlyEmbed.js");
  20321. },
  20322. {
  20323. "../../settings": 166,
  20324. "../../util/ajax": 181,
  20325. "../../util/logger": 189,
  20326. "./mediaSettings": 132,
  20327. },
  20328. ],
  20329. 126: [
  20330. function (e, t, i) {
  20331. (function (i) {
  20332. "use strict";
  20333. function n(e) {
  20334. o.call(this),
  20335. (this.options = e),
  20336. (this.playerControls = null),
  20337. (this.state = s.NOT_READY);
  20338. }
  20339. var r = e("../../util/browser"),
  20340. o = e("./EmbedlyEmbed"),
  20341. a = e("../../util/logger"),
  20342. s =
  20343. (new a(i),
  20344. Object.freeze({
  20345. NOT_READY: "player.not.ready",
  20346. CUED: "player.cued",
  20347. PLAYING: "player.playing",
  20348. PAUSED: "player.paused",
  20349. }));
  20350. (n.prototype = Object.create(o.prototype)),
  20351. (n.prototype.createDomElement = function () {
  20352. return (
  20353. (this.embedWrapper = document.createElement("div")),
  20354. this.embedWrapper.classList.add("tag-video"),
  20355. this.embedWrapper.classList.add("hidden"),
  20356. this.embedWrapper
  20357. );
  20358. }),
  20359. (n.prototype.load = function (e) {
  20360. var t = function () {
  20361. function e(e) {
  20362. (this.playerState = s.CUED),
  20363. this.options.startMuted && this.playerControls.mute();
  20364. }
  20365. function t(e) {
  20366. this.playerState = e;
  20367. }
  20368. function i(e) {
  20369. this.playerControls.setCurrentTime(0),
  20370. this.options.loop
  20371. ? this.playerControls.play()
  20372. : this.playerControls.pause();
  20373. }
  20374. (this.playerControls = new playerjs.Player(this.embedElement)),
  20375. this.playerControls.on("ready", e.bind(this)),
  20376. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  20377. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  20378. this.playerControls.on("ended", i.bind(this));
  20379. }.bind(this);
  20380. return o.prototype.load.call(this, e).then(t.bind(this));
  20381. }),
  20382. (n.prototype.play = (function () {
  20383. var e = r.isMobile();
  20384. return function () {
  20385. this.playerState !== s.NOT_READY &&
  20386. this.playerControls &&
  20387. !e &&
  20388. ((this.state === s.CUED && this.options.autoPlay) ||
  20389. this.options.autoResume) &&
  20390. this.playerControls.play();
  20391. };
  20392. })()),
  20393. (n.prototype.pause = function () {
  20394. this.playerState !== s.NOT_READY &&
  20395. this.playerControls &&
  20396. this.playerControls.pause();
  20397. }),
  20398. (t.exports = n);
  20399. }).call(this, "/js/tag/Media/EmbedlyPlayer.js");
  20400. },
  20401. {
  20402. "../../util/browser": 182,
  20403. "../../util/logger": 189,
  20404. "./EmbedlyEmbed": 125,
  20405. },
  20406. ],
  20407. 127: [
  20408. function (e, t, i) {
  20409. (function (i) {
  20410. "use strict";
  20411. function n(e) {
  20412. function t() {
  20413. return (
  20414. a.debug("requesting file from embedly:", e.href),
  20415. r
  20416. .get(e.href, {
  20417. responseType: e.responseType,
  20418. })
  20419. .then(function (t) {
  20420. return a.debug("requesting file finished:", e.href), t;
  20421. })
  20422. );
  20423. }
  20424. function i() {}
  20425. return (s = new Promise(function (e, n) {
  20426. s.catch(i).then(function () {
  20427. t().then(e, n);
  20428. });
  20429. }));
  20430. }
  20431. var r = e("../../util/ajax"),
  20432. o = (e("./mediaSettings"), e("../../util/logger")),
  20433. a = new o(i),
  20434. s = Promise.resolve();
  20435. t.exports.enqueue = n;
  20436. }).call(this, "/js/tag/Media/EmbedlyQueue.js");
  20437. },
  20438. {
  20439. "../../util/ajax": 181,
  20440. "../../util/logger": 189,
  20441. "./mediaSettings": 132,
  20442. },
  20443. ],
  20444. 128: [
  20445. function (e, t, i) {
  20446. (function (i) {
  20447. "use strict";
  20448. function n() {
  20449. (this.imageWrapper = null),
  20450. (this.width = 0),
  20451. (this.height = 0),
  20452. (this.aspect = 1);
  20453. }
  20454. var r = e("./MediaEvent"),
  20455. o = e("./EmbedlyQueue"),
  20456. a = e("events").EventEmitter,
  20457. s = e("../../util/logger"),
  20458. l = e("../../settings");
  20459. new s(i);
  20460. (n.prototype = Object.create(a.prototype)),
  20461. (n.prototype.createDomElement = function () {
  20462. return (
  20463. (this.imageWrapper = document.createElement("div")),
  20464. this.imageWrapper.classList.add("tag-image"),
  20465. this.imageWrapper.classList.add("hidden"),
  20466. this.imageWrapper.addEventListener(
  20467. "click",
  20468. function (e) {
  20469. e.stopPropagation(),
  20470. this.emit(r.IMAGE_OPENING),
  20471. (this.imageWrapper.style.pointerEvents = "none");
  20472. }.bind(this)
  20473. ),
  20474. this.imageWrapper
  20475. );
  20476. }),
  20477. (n.prototype.onClosed = function () {
  20478. this.imageWrapper.style.pointerEvents = "auto";
  20479. }),
  20480. (n.prototype.load = function (e) {
  20481. var t = Math.max(window.screen.height, window.screen.width),
  20482. i =
  20483. "https://i.embed.ly/1/display/resize?key=" +
  20484. l.appConfig.embedly_key +
  20485. "&url=" +
  20486. encodeURIComponent(e) +
  20487. "&width=" +
  20488. t +
  20489. "&height=" +
  20490. t;
  20491. return new Promise(
  20492. function (e, t) {
  20493. function n(t) {
  20494. var i = t.target;
  20495. (this.width = i.naturalWidth),
  20496. (this.height = i.naturalHeight),
  20497. (this.aspect = this.width / this.height);
  20498. var n = t.target.src;
  20499. (this.imageWrapper.style.backgroundImage =
  20500. 'url("' + n + '")'),
  20501. (this.imageWrapper.style.width = this.width + "px"),
  20502. (this.imageWrapper.style.height = this.height + "px"),
  20503. this.imageWrapper.classList.remove("hidden"),
  20504. e();
  20505. }
  20506. o.enqueue({
  20507. href: i,
  20508. responseType: "arraybuffer",
  20509. }).then(
  20510. function (e) {
  20511. var t = new Uint8Array(e),
  20512. i = new Blob([t]),
  20513. r = new window.Image();
  20514. r.addEventListener("load", n.bind(this));
  20515. var o = URL.createObjectURL(i);
  20516. r.src = o;
  20517. }.bind(this),
  20518. t
  20519. );
  20520. }.bind(this)
  20521. );
  20522. }),
  20523. (t.exports = n);
  20524. }).call(this, "/js/tag/Media/Image.js");
  20525. },
  20526. {
  20527. "../../settings": 166,
  20528. "../../util/logger": 189,
  20529. "./EmbedlyQueue": 127,
  20530. "./MediaEvent": 131,
  20531. events: 202,
  20532. },
  20533. ],
  20534. 129: [
  20535. function (e, t, i) {
  20536. "use strict";
  20537. function n(e) {
  20538. (this.label = e.label),
  20539. (this.href = e.url),
  20540. (this.type = this.updateLinkForType()),
  20541. (this.domElement = null),
  20542. (this.id = c++);
  20543. }
  20544. var r = e("./LinkType"),
  20545. o = e("./MediaEvent"),
  20546. a = e("../../util/browser"),
  20547. s = e("../../analytics"),
  20548. l = e("events").EventEmitter,
  20549. c = 0;
  20550. (n.prototype = Object.create(l.prototype)),
  20551. (n.prototype.updateLinkForType = function () {
  20552. function e(e) {
  20553. var t = new RegExp("[#&?]start=([^#&?]*)"),
  20554. i = t.exec(e);
  20555. return i[1];
  20556. }
  20557. function t(e) {
  20558. return e + "&play=1";
  20559. }
  20560. var i = a.valueFromHash("m") || a.valueFromHash("model");
  20561. return this.href.indexOf("port.com/show") !== -1 ||
  20562. this.href.indexOf(window.location.host + "/show") !== -1
  20563. ? this.href.indexOf(i) !== -1 &&
  20564. this.href.indexOf("start=") !== -1
  20565. ? ((this.href = e(this.href)), r.NAVIGATION)
  20566. : ((this.href = t(this.href)), r.MODEL)
  20567. : r.EXT_LINK;
  20568. });
  20569. var h = {};
  20570. (n.prototype.createDomElement = function () {
  20571. function e(e) {
  20572. switch (
  20573. (e.stopPropagation(),
  20574. (h[this.id] = !0),
  20575. s.trackAlways("click_tag_link", {
  20576. link_type: this.type,
  20577. link_count: c,
  20578. links_clicked: Object.keys(h).length,
  20579. }),
  20580. this.type)
  20581. ) {
  20582. case r.MODEL:
  20583. window.location.replace(this.href);
  20584. break;
  20585. case r.EXT_LINK:
  20586. window.open(this.href, "_blank");
  20587. }
  20588. this.emit(o.LINK_CLICK, {
  20589. type: this.type,
  20590. url: this.href,
  20591. });
  20592. }
  20593. if (
  20594. ((this.domElement = document.createElement("a")),
  20595. this.domElement.classList.add("tag-link"),
  20596. (this.domElement.textContent = this.label),
  20597. this.type === r.EXT_LINK)
  20598. ) {
  20599. this.domElement.textContent += " ";
  20600. var t = document.createElement("i");
  20601. t.classList.add("icon-ext-link"),
  20602. (t.title = "Link to external web site"),
  20603. this.domElement.appendChild(t);
  20604. }
  20605. return (
  20606. this.domElement.addEventListener("click", e.bind(this)),
  20607. this.domElement
  20608. );
  20609. }),
  20610. (t.exports = n);
  20611. },
  20612. {
  20613. "../../analytics": 4,
  20614. "../../util/browser": 182,
  20615. "./LinkType": 130,
  20616. "./MediaEvent": 131,
  20617. events: 202,
  20618. },
  20619. ],
  20620. 130: [
  20621. function (e, t, i) {
  20622. "use strict";
  20623. t.exports = {
  20624. NAVIGATION: "navigation",
  20625. MODEL: "model",
  20626. EXT_LINK: "ext-link",
  20627. };
  20628. },
  20629. {},
  20630. ],
  20631. 131: [
  20632. function (e, t, i) {
  20633. "use strict";
  20634. t.exports = Object.freeze({
  20635. LINK_CLICK: "mtmedia.link",
  20636. IMAGE_LOADED: "mtmedia.image.loaded",
  20637. IMAGE_OPENING: "mtmedia.image.opening",
  20638. IMAGE_OPENED: "mtmedia.image.opened",
  20639. IMAGE_CLOSING: "mtmedia.image.closing",
  20640. IMAGE_CLOSED: "mtmedia.image.closed",
  20641. VIDEO_START: "mtmedia.video.start",
  20642. VIDEO_PAUSE: "mtmedia.video.pause",
  20643. VIDEO_ENDED: "mtmedia.video.end",
  20644. });
  20645. },
  20646. {},
  20647. ],
  20648. 132: [
  20649. function (e, t, i) {
  20650. "use strict";
  20651. t.exports = Object.freeze({
  20652. maxEmbedWidth: 350,
  20653. defaultAspectRatio: 0.75,
  20654. });
  20655. },
  20656. {},
  20657. ],
  20658. 133: [
  20659. function (e, t, i) {
  20660. "use strict";
  20661. t.exports = Object.freeze({
  20662. TEXT: "text",
  20663. LINK: "link",
  20664. IMAGE: "photo",
  20665. VIDEO: "video",
  20666. RICH: "rich",
  20667. });
  20668. },
  20669. {},
  20670. ],
  20671. 134: [
  20672. function (e, t, i) {
  20673. "use strict";
  20674. function n(e) {
  20675. this.capabilities = {
  20676. links: {
  20677. enable: e.supportLinks,
  20678. keepLabels: e.keepLinkLabels,
  20679. },
  20680. };
  20681. }
  20682. var r = e("./DescriptionChunkType");
  20683. (n.prototype.parse = function (e, t) {
  20684. var i = [],
  20685. n = e.split("[").map(function (e, t) {
  20686. return 0 === t ? e : "[" + e;
  20687. });
  20688. return (
  20689. n.forEach(
  20690. function (e) {
  20691. var n = this.findMarkdown(e);
  20692. if (n) {
  20693. if (n.url.indexOf("javascript:") !== -1) return;
  20694. this.addLinkChunk(i, n, t),
  20695. this.addTextChunk(i, e.slice(n.markdown.length));
  20696. } else this.addTextChunk(i, e);
  20697. }.bind(this)
  20698. ),
  20699. i
  20700. );
  20701. }),
  20702. (n.prototype.findMarkdown = function (e) {
  20703. var t = /\[([^\]]*)\]\((.*)\)/,
  20704. i = e.match(t);
  20705. if (i) {
  20706. for (
  20707. var n = i[2], r = 1, o = 0;
  20708. o < n.length &&
  20709. ("(" === n[o] ? r++ : ")" === n[o] && r--, 0 !== r);
  20710. )
  20711. o++;
  20712. var a = n.length - o;
  20713. return {
  20714. markdown: i[0].substring(0, i[0].length - a),
  20715. label: i[1],
  20716. url: i[2].substring(0, o),
  20717. };
  20718. }
  20719. }),
  20720. (n.prototype.addTextChunk = function (e, t) {
  20721. 0 !== t.length &&
  20722. e.push({
  20723. type: r.TEXT,
  20724. text: t,
  20725. });
  20726. }),
  20727. (n.prototype.addLinkChunk = function (e, t) {
  20728. if (!this.capabilities.links.enable)
  20729. return void (
  20730. this.capabilities.links.keepLabels &&
  20731. this.addTextChunk(e, t.label)
  20732. );
  20733. var i = {
  20734. label: t.label,
  20735. url: t.url,
  20736. };
  20737. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  20738. e.push({
  20739. type: r.LINK,
  20740. link: i,
  20741. });
  20742. }),
  20743. (t.exports = n);
  20744. },
  20745. {
  20746. "./DescriptionChunkType": 133,
  20747. },
  20748. ],
  20749. 135: [
  20750. function (e, t, i) {
  20751. (function (i) {
  20752. "use strict";
  20753. var n = e("../util/logger"),
  20754. r = new n(i),
  20755. o = {
  20756. parseIdsFromChunkName: function (e, t) {
  20757. (t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e));
  20758. },
  20759. parseFloor: function (e) {
  20760. var t = e.match(/_group([0-9]+)/);
  20761. if (!t) return 0;
  20762. try {
  20763. return parseInt(t[1], 10);
  20764. } catch (e) {
  20765. return (
  20766. r.warn(
  20767. 'Non-int value "' +
  20768. t[1] +
  20769. '" for mesh group, defaulting to floor 0'
  20770. ),
  20771. 0
  20772. );
  20773. }
  20774. },
  20775. parseRoom: function (e) {
  20776. var t = e.match(/_sub([0-9]+)/);
  20777. if (!t) return -1;
  20778. try {
  20779. return parseInt(t[1], 10);
  20780. } catch (e) {
  20781. return (
  20782. r.warn(
  20783. 'Non-int value "' +
  20784. t[1] +
  20785. '" for mesh subgroup, defaulting to subgroup 0'
  20786. ),
  20787. 0
  20788. );
  20789. }
  20790. },
  20791. };
  20792. t.exports = o;
  20793. }).call(this, "/js/model/Chunks.js");
  20794. },
  20795. {
  20796. "../util/logger": 189,
  20797. },
  20798. ],
  20799. 136: [
  20800. function (e, t, i) {
  20801. (function (i) {
  20802. "use strict";
  20803. function n(e) {
  20804. s.call(this), (this.model = e), (this.exploded = !1);
  20805. }
  20806. var r = e("../objects/Floor"),
  20807. o = (e("../settings"), e("../util/logger")),
  20808. a = e("../util/transitions"),
  20809. s = e("../util/IndexedCollection"),
  20810. l = e("../util/common"),
  20811. c = e("../util/easing");
  20812. new o(i);
  20813. l.inherit(n, s),
  20814. (n.prototype.add = function (e) {
  20815. s.prototype.add.call(this, e), this.model.add(e);
  20816. }),
  20817. (n.prototype.getIndex = function (e) {
  20818. return e.floorIndex;
  20819. }),
  20820. (n.prototype.build = function () {
  20821. this.list.forEach(function (e) {
  20822. e.build();
  20823. });
  20824. }),
  20825. (n.prototype.size = function () {
  20826. return this.length;
  20827. }),
  20828. (n.prototype.sort = function () {
  20829. s.prototype.sort.call(this, function (e, t) {
  20830. return e.floorIndex - t.floorIndex;
  20831. });
  20832. }),
  20833. (n.prototype.nextFloor = function (e, t) {
  20834. return this.index[e.floorIndex + t] || null;
  20835. }),
  20836. (n.prototype.getFloorAtPoint = function (e) {
  20837. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  20838. var r = this.list[n],
  20839. o = r.distanceToPoint(e);
  20840. (!t || i > o) && ((i = o), (t = r));
  20841. }
  20842. return t;
  20843. }),
  20844. (n.prototype.getOrMakeFloor = function (e) {
  20845. var t = this.index[e];
  20846. return t || ((t = new r(this.model, e)), this.add(t)), t;
  20847. }),
  20848. (n.prototype.hide = function () {
  20849. this.list.forEach(function (e) {
  20850. e.hide();
  20851. });
  20852. }),
  20853. (n.prototype.show = function () {
  20854. this.list.forEach(function (e) {
  20855. e.show();
  20856. });
  20857. }),
  20858. (n.prototype.names = function () {
  20859. return this.list.reduce(function (e, t) {
  20860. return e.concat(t.name);
  20861. }, []);
  20862. }),
  20863. (n.prototype.toggleExplodeHorizontal = function () {
  20864. function e(e, t) {
  20865. r.copy(e.position),
  20866. (e.position.x = i[e.floorIndex] * t),
  20867. (e.position.y = 1 * e.floorIndex * t),
  20868. r.sub(e.position).multiplyScalar(-1),
  20869. e.panos.forEach(function (e) {
  20870. e.translate(r);
  20871. });
  20872. }
  20873. var t,
  20874. i = [],
  20875. n = 0;
  20876. this.list.forEach(function (e, r, o) {
  20877. (t =
  20878. r > 0
  20879. ? Math.max(
  20880. o[r - 1].boundingBox.max.x - e.boundingBox.min.x,
  20881. e.boundingBox.size().x / 2
  20882. )
  20883. : 0),
  20884. (n += t),
  20885. (i[r] = n);
  20886. }),
  20887. (i = i.map(function (e) {
  20888. return e - n / 2;
  20889. }));
  20890. var r = this.list[0].position.clone();
  20891. this.exploded
  20892. ? this.list.forEach(function (t) {
  20893. a.start(
  20894. function (i) {
  20895. e(t, 1 - i);
  20896. },
  20897. 1500,
  20898. null,
  20899. 0,
  20900. c.easeOutExpo
  20901. );
  20902. })
  20903. : this.list.forEach(function (t) {
  20904. a.start(
  20905. function (i) {
  20906. e(t, i);
  20907. },
  20908. 1500,
  20909. null,
  20910. 0,
  20911. c.easeOutExpo
  20912. );
  20913. }),
  20914. (this.exploded = !this.exploded);
  20915. }),
  20916. (n.prototype.toggleExplodeVertical = function () {
  20917. function e(e, i) {
  20918. var n = n.copy(e.position);
  20919. (e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  20920. n.sub(e.position).multiplyScalar(-1),
  20921. e.panos.forEach(function (e) {
  20922. e.translate(n);
  20923. });
  20924. }
  20925. var t = this.model.size;
  20926. this.list[0].position.clone();
  20927. this.exploded
  20928. ? this.list.forEach(function (t) {
  20929. a.start(
  20930. function (i) {
  20931. e(t, 1 - i);
  20932. },
  20933. 1500,
  20934. null,
  20935. 0,
  20936. c.easeOutExpo
  20937. );
  20938. })
  20939. : this.list.forEach(function (t) {
  20940. a.start(
  20941. function (i) {
  20942. e(t, i);
  20943. },
  20944. 1500,
  20945. null,
  20946. 0,
  20947. c.easeOutExpo
  20948. );
  20949. }),
  20950. (this.exploded = !this.exploded);
  20951. }),
  20952. (t.exports = n);
  20953. }).call(this, "/js/model/FloorCollection.js");
  20954. },
  20955. {
  20956. "../objects/Floor": 146,
  20957. "../settings": 166,
  20958. "../util/IndexedCollection": 175,
  20959. "../util/common": 185,
  20960. "../util/easing": 186,
  20961. "../util/logger": 189,
  20962. "../util/transitions": 195,
  20963. },
  20964. ],
  20965. 137: [
  20966. function (e, t, i) {
  20967. (function (i) {
  20968. "use strict";
  20969. function n() {
  20970. c.call(this);
  20971. }
  20972. var r = e("../settings"),
  20973. o = e("../util/logger"),
  20974. a = e("../enum/Viewmode"),
  20975. s = e("../objects/Snapshot"),
  20976. l = (e("../util/math"), e("../util/common")),
  20977. c = e("../util/IndexedCollection"),
  20978. h = new o(i);
  20979. l.inherit(n, c),
  20980. (n.prototype.getImage = function (e) {
  20981. return e && this.index.hasOwnProperty(e) ? this.index[e] : null;
  20982. }),
  20983. (n.prototype.filterByModesAndReel = function (e, t) {
  20984. for (var i = [], n = 0; n < t.length; n += 1) {
  20985. var r = t[n],
  20986. o = this.index[r.sid];
  20987. o && i.push(o);
  20988. }
  20989. var s = e[a.DOLLHOUSE],
  20990. l = e[a.FLOORPLAN];
  20991. (i = i.filter(function (e) {
  20992. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0;
  20993. var t;
  20994. try {
  20995. t = a.convertWorkshopModeInt(e.metadata.camera_mode);
  20996. } catch (e) {
  20997. return h.debug(e.message), !1;
  20998. }
  20999. return (
  21000. t === a.PANORAMA ||
  21001. (t === a.FLOORPLAN && l) ||
  21002. (t === a.DOLLHOUSE && s)
  21003. );
  21004. })),
  21005. i.length !== this.list.length &&
  21006. h.info(
  21007. "Disallowed " +
  21008. (this.list.length - i.length) +
  21009. " highlight images"
  21010. ),
  21011. (this.list = i),
  21012. this.reIndex();
  21013. }),
  21014. (n.prototype.getHeroLocations = function (panos) {
  21015. //改 增加二级location
  21016. if (0 === this.list.length) return [];
  21017. var locations = [];
  21018. var deal = (info, container) => {
  21019. var src = info.thumbnail_signed_src,
  21020. o = info.name || "";
  21021. if (
  21022. info.metadata &&
  21023. void 0 !== info.metadata.camera_quaternion
  21024. ) {
  21025. if (!r.show360Views.enabled && info.metadata.scan_id) {
  21026. let a = panos.get(info.metadata.scan_id);
  21027. if (a && !a.isAligned()) return;
  21028. }
  21029. var cameraMode = a.convertWorkshopModeInt(
  21030. info.metadata.camera_mode
  21031. );
  21032. if (cameraMode === a.MESH) return;
  21033. if (window.isLocal) src = manage.dealURL(src);
  21034. else
  21035. src =
  21036. "one" === g_version
  21037. ? g_Prefix + src + "?" + randomTime().getTime()
  21038. : src + "?" + randomTime().getTime();
  21039. var l = {
  21040. cameraMode: cameraMode,
  21041. position: info.metadata.camera_position,
  21042. quaternion: info.metadata.camera_quaternion,
  21043. zoom: info.metadata.zoom,
  21044. panoId: info.metadata.scan_id,
  21045. orthoZoom: info.metadata.ortho_zoom,
  21046. floorVisibility:
  21047. void 0 !== info.metadata.floor_visibility
  21048. ? info.metadata.floor_visibility.slice(0)
  21049. : [],
  21050. thumbUrl: src,
  21051. name: n.filterImageName(o),
  21052. sid: info.sid,
  21053. };
  21054. var item = new s(l);
  21055. item.momentTour = info.momentTour;
  21056. item.dontRot = info.dontRot;
  21057. item.rotTime = info.rotTime;
  21058. item.musicInfo =
  21059. info.musicInfo || g_data2.tourAudio[info.sid] || {}; //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  21060. container.push(item);
  21061. return item;
  21062. }
  21063. };
  21064. this.list.forEach((image) => {
  21065. if (image.images) {
  21066. var folder = $.extend({}, image);
  21067. folder.heroLocations = [];
  21068. image.images.list.forEach((child) => {
  21069. deal(child, folder.heroLocations);
  21070. });
  21071. folder.musicInfo = folder.musicInfo || {};
  21072. locations.push(folder);
  21073. delete folder.images;
  21074. delete folder.locations;
  21075. } else {
  21076. var item = deal(image, locations);
  21077. }
  21078. });
  21079. return locations;
  21080. }),
  21081. (n.prototype.getIndex = function (e) {
  21082. return e.sid;
  21083. }),
  21084. (n.filterImageName = function (e) {
  21085. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e;
  21086. }),
  21087. (t.exports = n);
  21088. }).call(this, "/js/model/ImageCollection.js");
  21089. },
  21090. {
  21091. "../enum/Viewmode": 51,
  21092. "../objects/Snapshot": 153,
  21093. "../settings": 166,
  21094. "../util/IndexedCollection": 175,
  21095. "../util/common": 185,
  21096. "../util/logger": 189,
  21097. "../util/math": 190,
  21098. },
  21099. ],
  21100. 138: [
  21101. function (e, t, i) {
  21102. (function (i) {
  21103. "use strict";
  21104. function n() {
  21105. u.call(this);
  21106. }
  21107. var r = e("../label/Label"),
  21108. o = e("../settings"),
  21109. a = e("../util/logger"),
  21110. s = e("../util/math"),
  21111. l = e("../util/ajax"),
  21112. c = e("./RoomCollection"),
  21113. h = e("../util/common"),
  21114. u = e("../util/IndexedCollection");
  21115. new a(i);
  21116. h.inherit(n, u),
  21117. (n.prototype.getIndex = function (e) {
  21118. return e.labelId;
  21119. }),
  21120. (n.prototype.associateWithRooms = function (e) {
  21121. this.forEach(function (t) {
  21122. e.forEach(function (e) {
  21123. e.roomId === t.roomId && (t.room = e);
  21124. });
  21125. });
  21126. }),
  21127. (n.prototype.createFromLabelData = function (e) {
  21128. e.forEach(
  21129. function (e) {
  21130. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  21131. t = c.generateRoomId(e.floorId, t);
  21132. var i = new r(
  21133. e.sid,
  21134. e.position || e.positions[0],
  21135. e.text,
  21136. e.floorId,
  21137. t
  21138. );
  21139. (i.position = s.convertWorkshopVector(i.position)),
  21140. this.add(i),
  21141. i.build();
  21142. }.bind(this)
  21143. );
  21144. }),
  21145. (n.prototype.load = function (e, t) {
  21146. return l
  21147. .get(e, {
  21148. responseType: "json",
  21149. auth: t ? o.authorizationHeader : null,
  21150. })
  21151. .done(
  21152. function (e) {
  21153. var t = [];
  21154. for (var i in e) {
  21155. var n = e[i];
  21156. t.push(n);
  21157. }
  21158. this.createFromLabelData(t);
  21159. }.bind(this)
  21160. );
  21161. }),
  21162. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  21163. var t = -1;
  21164. if (e) {
  21165. if (typeof e == "number") {
  21166. //add
  21167. t = parseInt(e);
  21168. } else {
  21169. var i = e.split("_");
  21170. t = parseInt(i[0]);
  21171. }
  21172. }
  21173. return t;
  21174. }),
  21175. (t.exports = n);
  21176. }).call(this, "/js/model/LabelCollection.js");
  21177. },
  21178. {
  21179. "../label/Label": 90,
  21180. "../settings": 166,
  21181. "../util/IndexedCollection": 175,
  21182. "../util/ajax": 181,
  21183. "../util/common": 185,
  21184. "../util/logger": 189,
  21185. "../util/math": 190,
  21186. "./RoomCollection": 141,
  21187. },
  21188. ],
  21189. 139: [
  21190. function (e, t, i) {
  21191. (function (i) {
  21192. "use strict";
  21193. function n(e, t) {
  21194. o.Object3D.call(this);
  21195. this.sid = window.number; //t.sid,
  21196. (this.data = t),
  21197. (this.options = e),
  21198. (this.urls = new s(e.urlFiles)),
  21199. (this.isPublic = void 0 !== t.is_public && t.is_public),
  21200. //创建heroLocations
  21201. (this.images = new _(this)),
  21202. this.images.extend(t.images),
  21203. this.images.forEach((info) => {
  21204. if (info.locations) {
  21205. info.images = new _(this);
  21206. info.images.extend(info.locations);
  21207. }
  21208. });
  21209. this.heroLocations = [];
  21210. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  21211. (this.outdoorPanoLocations = []),
  21212. (this.floors = new d(this)),
  21213. (this.floorsEnabled = void 0 === e.floors || e.floors),
  21214. (this.changingFloor = !1),
  21215. (this.chunks = []),
  21216. (this.panos = new A()),
  21217. (this.colliders = []),
  21218. (this.loadPanosPromise = null),
  21219. (this.loadMeshTexturesPromise = null),
  21220. (this.auxDataPromise = null),
  21221. (this.meshTexturesLoaded = !1),
  21222. (this.meshTextures = []),
  21223. (this.tags = {}),
  21224. (this.tagsShown = !1),
  21225. (this.shouldShowtags = !1),
  21226. (this.has360Views = !1),
  21227. (this.showingLabels =
  21228. f.labels.enabled && t.player_options.labels),
  21229. (this.supportedModes = {}),
  21230. (this.supportedModes[c.PANORAMA] = !0),
  21231. (this.supportedModes[c.DOLLHOUSE] =
  21232. !t.player_options ||
  21233. (t.player_options.dollhouse && w.valueFromHash("dh", 1))),
  21234. (this.supportedModes[c.FLOORPLAN] =
  21235. !t.player_options ||
  21236. (t.player_options.floor_plan && w.valueFromHash("dh", 1))),
  21237. (this.supportedModes[c.TRANSITIONING] = !0),
  21238. (this.supportsTiles = this.configureTiling()),
  21239. // this.supportsVR = t.is_vr,
  21240. (this.supportsVR = window.DATA.supportsVR || false); //true; // 方奕卓 VR功能可配置
  21241. (this.mode = c.DOLLHOUSE),
  21242. (this.size = null),
  21243. (this.center = null),
  21244. (this.boundingBox = new o.Box3()),
  21245. (this.currentFloor = null),
  21246. (this.allFloorsVisible = !0),
  21247. (this.projectedPano0 = null),
  21248. (this.projectedPano1 = null),
  21249. this.floorsEnabled &&
  21250. t.floors &&
  21251. t.floors.indexOf(",") !== -1 &&
  21252. t.floors.split(",").forEach(
  21253. function (e, t) {
  21254. this.addFloor(new u(this, t, e.trim()));
  21255. }.bind(this)
  21256. ),
  21257. (this.waitQueue = []),
  21258. this.on(
  21259. "load",
  21260. function (e) {
  21261. 0 !== this.waitQueue.length &&
  21262. ((this.waitQueue = this.waitQueue.filter(function (e) {
  21263. return !e.isLoadedCallback();
  21264. })),
  21265. 0 === this.waitQueue.length && this.emit("waiting-done"));
  21266. }.bind(this)
  21267. ),
  21268. this.setupCustomProperties();
  21269. this.hots = {};
  21270. }
  21271. function r() {
  21272. try {
  21273. var e = document.createElement("canvas"),
  21274. t = e.getContext("webgl");
  21275. t || (t = e.getContext("experimental-webgl"));
  21276. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  21277. return i;
  21278. } catch (e) {
  21279. return 0;
  21280. }
  21281. }
  21282. var o = e("three"),
  21283. a = e("../util/ajax"),
  21284. s = e("../util/ModelUrls"),
  21285. l = e("../objects/BoundingTextureSkybox"),
  21286. c = e("../enum/Viewmode"),
  21287. h = e("../enum/RenderOrder"),
  21288. u = (e("../enum/AlignmentType"), e("../objects/Floor")),
  21289. d = e("./FloorCollection"),
  21290. p = e("../objects/Chunk"),
  21291. f =
  21292. (e("../objects/Room"),
  21293. e("../objects/Snapshot"),
  21294. e("../label/Label"),
  21295. e("../util/math"),
  21296. e("../settings")),
  21297. ss = e("../shaders"),
  21298. g = e("../util/logger"),
  21299. m = e("../tag/tag"),
  21300. v = (e("../tag/tagManager"), e("../objects/Panorama")),
  21301. A = e("../util/PanoramaCollection"),
  21302. y = e("../loaders/ModelLoader"),
  21303. C = e("../loaders/ModelTextureLoader"),
  21304. I = e("../loaders/SweepDataLoader"),
  21305. E = e("../util/transitions"),
  21306. b = e("../util/common"),
  21307. es = e("../util/easing"),
  21308. lerp = e("../util/lerp"),
  21309. tex = e("../util/texture"),
  21310. w = e("./../util/browser"),
  21311. _ = e("./ImageCollection"),
  21312. T = e("./RoomCollection"),
  21313. x = e("./LabelCollection"),
  21314. S = e("./Chunks"),
  21315. cameraLight = e("./util/cameraLight"),
  21316. M = e("./../util/showcase"),
  21317. R = e("../exception/BasicException"),
  21318. P = (e("../constants"), e("events").EventEmitter),
  21319. GLCubeFaces = e("../enum/GLCubeFaces"),
  21320. //,Hot = e("hot")
  21321. O = new g(i);
  21322. (n.prototype = Object.create(o.Object3D.prototype)),
  21323. b.extend(n, P),
  21324. (n.prototype.setupCustomProperties = function () {
  21325. var e = f.modelAlpha;
  21326. Object.defineProperty(this, "alpha", {
  21327. get: function () {
  21328. return e;
  21329. },
  21330. set: function (t) {
  21331. e = t;
  21332. //console.log(t)
  21333. this.chunks.forEach(function (chunk) {
  21334. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  21335. chunk.material.uniforms.modelAlpha.value = e;
  21336. //修改一下defines,为了在不需要map时不加载map。 by xzw
  21337. /* if (e>0) {
  21338. if (!('useModelMap' in chunk.material.defines)) {
  21339. chunk.material.defines.useModelMap = ''
  21340. chunk.material.needsUpdate = true
  21341. console.log('add useModelMap')
  21342. }
  21343. } else {
  21344. if ('useModelMap' in chunk.material.defines) {
  21345. delete chunk.material.defines.useModelMap
  21346. chunk.material.needsUpdate = true
  21347. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  21348. console.log('delete useModelMap')
  21349. }
  21350. } */
  21351. }
  21352. });
  21353. },
  21354. });
  21355. }),
  21356. (n.prototype.configureTiling = function () {
  21357. var e = r();
  21358. if (e < 2048) return !1;
  21359. O.warn("Max cube texture size: " + e);
  21360. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  21361. var i = f.tiling.tilingFlagNames[t];
  21362. if ("1" === w.valueFromHash(i, null)) return !0;
  21363. if ("0" === w.valueFromHash(i, null)) return !1;
  21364. }
  21365. //--------------------------------------------许钟文-------------------------------------------
  21366. //return true;
  21367. return !!M.modelDataPromisesTiles(this.data); //免去访问mdoeldata.json的vision_version,不明白这是什么
  21368. //--------------------------------------------e n d -------------------------------------------
  21369. }),
  21370. (n.prototype.toggleAlpha = function () {
  21371. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0);
  21372. }),
  21373. (n.prototype.load = function (e) {
  21374. var t = function () {
  21375. return $.when(this.loadPanos(), this.loadMesh());
  21376. },
  21377. i = this.urls.init().then(t.bind(this));
  21378. return (
  21379. e
  21380. ? (i = i.then(this.loadMeshTextures.bind(this)))
  21381. : i.then(this.loadMeshTextures.bind(this)),
  21382. (this.auxDataPromise = $.when(
  21383. /*this.loadHighlightReel(), this.loadtags() */ this.loadhots(),
  21384. this.loadLabels()
  21385. )),
  21386. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  21387. ); //不要另外使用active_reel文件
  21388. }),
  21389. (n.prototype.loadMesh = function () {
  21390. function e(e) {
  21391. O.error(e), n.reject("loading-failed");
  21392. }
  21393. function t(e, t) {
  21394. n.notify(e, t);
  21395. }
  21396. function i(e, t) {
  21397. if (0 === e.length) {
  21398. O.warn(
  21399. "No geometry found for model, loading faux geometry, disabling outside mode"
  21400. ),
  21401. (r.supportedModes[c.DOLLHOUSE] = !1),
  21402. (r.supportedModes[c.FLOORPLAN] = !1);
  21403. var i = new p({
  21404. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1),
  21405. });
  21406. (i.material.visible = !1),
  21407. i.rotateX(-Math.PI / 2),
  21408. i.geometry.computeBoundingBox(),
  21409. (e = [i]);
  21410. }
  21411. e.forEach(function (e) {
  21412. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  21413. r.addChunk(t, e);
  21414. }),
  21415. r.floors.sort(),
  21416. n.resolve(r);
  21417. }
  21418. var n = $.Deferred(),
  21419. r = this;
  21420. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise();
  21421. }),
  21422. (n.prototype.loadMeshTextures = function () {
  21423. return this.loadTexturesPromise
  21424. ? this.loadTexturesPromise
  21425. : ((this.loadTexturesPromise = C.load(
  21426. this,
  21427. this.meshTextures
  21428. ).then(
  21429. function () {
  21430. this.meshTexturesLoaded = !0;
  21431. }.bind(this)
  21432. )),
  21433. this.loadTexturesPromise);
  21434. }),
  21435. /* n.prototype.loadtags = function() {//xzw改
  21436. var e = $.Deferred();
  21437. if (!f.tags.enabled)
  21438. return e.resolve();
  21439. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  21440. t = "data/" + this.sid + "/tags.json"
  21441. return a.get(t, {
  21442. responseType: "json",
  21443. auth: this.isPublic ? null : f.authorizationHeader
  21444. }).done(function(t) {
  21445. var i = 0
  21446. , n = 0;
  21447. for (var r in t) {
  21448. var o = t[r];
  21449. o.enabled && (n++,
  21450. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  21451. i++))
  21452. }
  21453. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  21454. e.resolve()
  21455. }
  21456. .bind(this)).fail(function() {
  21457. O.warn("Getting tags failed, not displaying tags."),
  21458. e.resolve()
  21459. }),
  21460. e
  21461. } */
  21462. (n.prototype.shineHots = function () {
  21463. //xzw
  21464. E.trigger({
  21465. func: function (e) {
  21466. var opa = e <= 0.5 ? 2 * e : -2 * e + 2;
  21467. for (var i in this.hots) {
  21468. this.hots[i].mesh.material.uniforms.opac.value = opa;
  21469. }
  21470. }.bind(this),
  21471. cycling: true,
  21472. duration: 3000,
  21473. //easing: "easeInOutQuad",
  21474. name: "hotShine",
  21475. });
  21476. }),
  21477. /* n.prototype.loadOverlays = function(overlays){
  21478. var overlays = window.data2 && window.data2.overlays
  21479. overlays && overlays.forEach((info)=>{
  21480. new Overlay(info)
  21481. })
  21482. Overlay.load()
  21483. }
  21484. */
  21485. (n.prototype.loadhots = function () {
  21486. //xzw
  21487. initHot(this);
  21488. var r = $.Deferred();
  21489. var t =
  21490. g_Prefix +
  21491. "data/" +
  21492. this.sid +
  21493. "/data2.js" +
  21494. "?" +
  21495. randomTime().getTime();
  21496. return (
  21497. a
  21498. .get(t, {
  21499. responseType: "json",
  21500. auth: this.isPublic ? null : f.authorizationHeader,
  21501. })
  21502. .done(
  21503. function (e) {
  21504. window.data2 = e;
  21505. this.roomLabels = [];
  21506. if (!e) {
  21507. console.error("data2 is null");
  21508. } else {
  21509. g_data2 = hotMatcher(e);
  21510. this.hotsCount = 0;
  21511. let create = () => {
  21512. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  21513. if (e.hots) {
  21514. var sids = Object.keys(e.hots).sort((a, b) => {
  21515. return e.hots[a].order - e.hots[b].order;
  21516. });
  21517. sids.forEach((sid) => {
  21518. e.hots[sid].sid = sid;
  21519. //if(e.hots[sid].texType == "shine" || e.hots[sid].texType == "photo" ){
  21520. //e.hots[sid].styleImg = []
  21521. new Hot(
  21522. e.hots[sid],
  21523. e.hots[sid].version != "multi" && "byHot"
  21524. );
  21525. //}
  21526. });
  21527. }
  21528. if (e.overlays) {
  21529. e.overlays.forEach((info) => {
  21530. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  21531. new Hot(info, "byOverlay");
  21532. });
  21533. }
  21534. Hot.createHotList();
  21535. Hot.startLoad();
  21536. if (DATA.roomLabels) {
  21537. DATA.roomLabels.forEach((data) => {
  21538. this.roomLabels.push(new RoomLabel(data));
  21539. });
  21540. }
  21541. };
  21542. if (player.currentPano) {
  21543. create();
  21544. } else {
  21545. let f = () => {
  21546. window.bus.removeEventListener(
  21547. "playerAndModelReady",
  21548. f
  21549. );
  21550. create();
  21551. };
  21552. window.bus.addEventListener("playerAndModelReady", f);
  21553. }
  21554. g_index = w.valueFromHash("m");
  21555. }
  21556. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  21557. /* var dataJsPromise = $.Deferred();
  21558. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  21559. a.get(dataJsUrl,{
  21560. responseType: "json",
  21561. auth: this.isPublic ? null : f.authorizationHeader
  21562. }).done(function(data) {
  21563. window.hotData = data;
  21564. this.createHotItem(data, this.hots);
  21565. for(let i in this.hots){//add
  21566. data[i] && this.hots[i].initStyleImg(data[i]);
  21567. }
  21568. dataJsPromise.resolve();
  21569. }.bind(this)).fail(function(){
  21570. console.log('Data.js is empty');
  21571. dataJsPromise.resolve();
  21572. }) */
  21573. r.resolve();
  21574. }.bind(this)
  21575. )
  21576. .fail(function () {
  21577. console.log("没有热点");
  21578. r.resolve();
  21579. }),
  21580. r
  21581. );
  21582. }),
  21583. (n.prototype.loadPanos = function () {
  21584. if (this.loadPanosPromise) return this.loadPanosPromise;
  21585. var e = new I(this);
  21586. return (
  21587. (this.loadPanosPromise = e.load().then(
  21588. function (e) {
  21589. return (
  21590. this.data.sweeps &&
  21591. Object.keys(this.data.sweeps).length > 0 &&
  21592. (e = e.filter(
  21593. function (e) {
  21594. if (this.data.sweeps[e.uuid])
  21595. return this.data.sweeps[e.uuid].enabled;
  21596. else console.log(e.uuid);
  21597. }.bind(this)
  21598. )),
  21599. this.panos.extend(
  21600. e.map(
  21601. function (e) {
  21602. return new v(this, e.uuid, e, this.supportsTiles);
  21603. }.bind(this)
  21604. )
  21605. ),
  21606. this.panos.forEach(
  21607. function (e) {
  21608. e.neighbourUUIDs &&
  21609. (e.neighbourUUIDs.forEach(
  21610. function (t) {
  21611. var i = this.panos.get(t);
  21612. i && this.panos.setNeighbour(e, i, !0);
  21613. }.bind(this)
  21614. ),
  21615. (e.neighbourPanos =
  21616. this.panos.getNeighbours(e) ||
  21617. this.panos.setNeighbour(e, e, !0)));
  21618. }.bind(this)
  21619. ),
  21620. 0 === this.panos.length &&
  21621. (O.warn("Model has no panos, turning off inside mode"),
  21622. (this.supportedModes[c.PANORAMA] = !1)),
  21623. $.when(this)
  21624. );
  21625. }.bind(this)
  21626. )),
  21627. this.loadPanosPromise
  21628. );
  21629. }),
  21630. (n.prototype.loadHighlightReel = function () {
  21631. //xzw
  21632. var e = $.Deferred(),
  21633. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  21634. t =
  21635. this.options.urlBase +
  21636. "data/" +
  21637. this.sid +
  21638. "/active_reel.json";
  21639. return (
  21640. a
  21641. .get(t, {
  21642. responseType: "json",
  21643. auth: this.isPublic ? null : f.authorizationHeader,
  21644. })
  21645. .done(
  21646. function (t) {
  21647. t.reel
  21648. ? (O.info(
  21649. "Got highlight reel with " +
  21650. t.reel.length +
  21651. " items"
  21652. ),
  21653. this.images.filterByModesAndReel(
  21654. this.supportedModes,
  21655. t.reel
  21656. ))
  21657. : O.info("No highlight reel found"),
  21658. e.resolve();
  21659. }.bind(this)
  21660. )
  21661. .fail(function () {
  21662. O.warn(
  21663. "Getting highlight reel failed, no highlights available"
  21664. ),
  21665. e.resolve();
  21666. }),
  21667. e
  21668. );
  21669. }),
  21670. (n.prototype.waitForLoad = function (e, t) {
  21671. t() ||
  21672. (this.waitQueue.push({
  21673. object: e,
  21674. isLoadedCallback: t,
  21675. }),
  21676. 1 === this.waitQueue.length && this.emit("waiting"));
  21677. }),
  21678. (n.prototype.hide = function () {
  21679. this.floors.hide();
  21680. }),
  21681. (n.prototype.show = function () {
  21682. this.floors.show();
  21683. }),
  21684. (n.prototype.floorNames = function () {
  21685. return this.floors.names();
  21686. }),
  21687. (n.prototype.warpDestFloors = function (e, t) {
  21688. if (!e || this.floors.length !== e.length)
  21689. return void this.toggleAllFloors(!0);
  21690. var i = e.findIndex(
  21691. function (e) {
  21692. return e;
  21693. }.bind(this)
  21694. );
  21695. i !== -1 && this.setFloor(this.floors.list[i], null, t);
  21696. }),
  21697. (n.prototype.setFloor = function (e, t, i) {
  21698. this.allFloorsVisible &&
  21699. this.emit("allfloors.toggled", !1, this.currentFloor),
  21700. (this.allFloorsVisible = !1),
  21701. this._setFloor(e, t, i);
  21702. }),
  21703. (n.prototype.toggleAllFloors = function (e) {
  21704. (this.allFloorsVisible =
  21705. void 0 !== e ? e : !this.allFloorsVisible),
  21706. this.emit(
  21707. "allfloors.toggled",
  21708. this.allFloorsVisible,
  21709. this.currentFloor
  21710. ),
  21711. this._setFloor(this.currentFloor);
  21712. }),
  21713. (n.prototype._setFloor = function (e, t, i) {
  21714. (t = t || this.mode),
  21715. this.emit("floor.changed", e, t, this.currentFloor),
  21716. (this.currentFloor = e);
  21717. var n;
  21718. if (t === c.PANORAMA) {
  21719. if ((this.show(), this.shouldShowtags && this.tagsShown))
  21720. for (n in this.tags) this.tags[n].show(f.showFloorDuration);
  21721. } else if (
  21722. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  21723. (this.floors.list.forEach(
  21724. function (e, t) {
  21725. e.toggle(
  21726. e === this.currentFloor || this.allFloorsVisible,
  21727. i || this.allFloorsVisible
  21728. );
  21729. }.bind(this)
  21730. ),
  21731. this.shouldShowtags && this.tagsShown)
  21732. )
  21733. for (n in this.tags) {
  21734. var r = this.tags[n];
  21735. this.allFloorsVisible
  21736. ? r.show(f.showFloorDuration)
  21737. : r.floor === this.currentFloor
  21738. ? r.show(f.showFloorDuration, f.showFloorDelay)
  21739. : r.hide(f.hideFloorDuration, f.hideFloorDelay);
  21740. }
  21741. var o = this,
  21742. a = e;
  21743. E.start(
  21744. function () {},
  21745. f.showFloorDelay,
  21746. function () {
  21747. o.floors.forEach(function (e) {
  21748. e.chunks.forEach(function (t) {
  21749. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor;
  21750. });
  21751. });
  21752. }.bind(this)
  21753. );
  21754. }),
  21755. (n.prototype.toggleExplode = function () {
  21756. this.floors.toggleExplodeHorizontal();
  21757. }),
  21758. (n.prototype.toggleExplodeUp = function () {
  21759. this.floors.toggleExplodeVertical();
  21760. }),
  21761. (n.prototype.nextFloor = function (e) {
  21762. return this.floors.nextFloor(this.currentFloor, e);
  21763. }),
  21764. (n.prototype.addFloor = function (e) {
  21765. this.floors.add(e);
  21766. }),
  21767. (n.prototype.getFloorAtPoint = function (e) {
  21768. return this.floors.getFloorAtPoint(e);
  21769. }),
  21770. (n.prototype.getTagBySid = function (e) {
  21771. return this.tags[e];
  21772. }),
  21773. (n.prototype.addChunk = function (e, t) {
  21774. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t);
  21775. }),
  21776. (n.prototype.setMode = function (e) {
  21777. if (!this.supportedModes[e])
  21778. throw new R("Mode not supported for this model: " + e);
  21779. this.mode = e;
  21780. this.skybox.material.transparent = e == "panorama" ? false : true; //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  21781. this.chunks.forEach(function (t) {
  21782. t.setMode(e);
  21783. });
  21784. }),
  21785. (n.prototype.build = function () {
  21786. this.heroLocations = this.images.getHeroLocations(this.panos);
  21787. var e = function () {
  21788. return (
  21789. !!(
  21790. this.heroImage &&
  21791. this.heroImage.metadata &&
  21792. this.heroImage.metadata.scan_id &&
  21793. this.panos.get(this.heroImage.metadata.scan_id)
  21794. ) &&
  21795. !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  21796. );
  21797. }.bind(this)();
  21798. (this.has360Views =
  21799. (f.show360Views.enabled &&
  21800. this.heroLocations.some(
  21801. function (e) {
  21802. return (
  21803. e.cameraMode === c.PANORAMA &&
  21804. this.panos.get(e.panoId) &&
  21805. !this.panos.get(e.panoId).isAligned()
  21806. );
  21807. }.bind(this)
  21808. )) ||
  21809. e),
  21810. null === this.heroImage && O.warn("No hero image defined."),
  21811. (this.currentFloor = this.floors.last()),
  21812. this.floors.build(),
  21813. (this.colliders = this.floors.reduce(function (e, t) {
  21814. return e.concat(t.collider.children);
  21815. }, [])),
  21816. this.panos.forEach(
  21817. function (e) {
  21818. e.build1(),
  21819. e.on(
  21820. "enter",
  21821. function () {
  21822. e.floor !== this.currentFloor &&
  21823. this.setFloor(e.floor);
  21824. }.bind(this)
  21825. );
  21826. }.bind(this)
  21827. ),
  21828. this.panos.forEach(function (e) {
  21829. e.build2();
  21830. }),
  21831. this.floors.forEach(
  21832. function (e) {
  21833. this.boundingBox.union(e.boundingBox);
  21834. }.bind(this)
  21835. ),
  21836. (this.size = this.boundingBox.size()),
  21837. (this.center = this.boundingBox.center()),
  21838. this.floors.forEach(
  21839. function (e) {
  21840. O.info(
  21841. "Floor " +
  21842. e +
  21843. ": " +
  21844. e.children.length +
  21845. " chunks, " +
  21846. e.panos.length +
  21847. " panos."
  21848. );
  21849. }.bind(this)
  21850. ),
  21851. this.panos.populate_path_graph(),
  21852. (this.skybox = new l(this.boundingBox)),
  21853. (this.skybox.matrixWorldNeedsUpdate = !0),
  21854. this.add(this.skybox);
  21855. /* setTimeout(function() {
  21856. //this.hotsCount && this.shineHots()
  21857. Hot.beginShineHot()
  21858. }
  21859. .bind(this), 1300) */
  21860. //add-----
  21861. {
  21862. let maxCount = browser.isMobile() ? 200000 : 400000;
  21863. let noVisiHots = this.hotGroup.children.filter(
  21864. (e) => !e.info.visiblePanos && e.info.texType != "shine"
  21865. ); //只看非热点的,否则数据太多
  21866. let visiHots = this.hotGroup.children.filter(
  21867. (e) => e.info.visiblePanos
  21868. );
  21869. let c =
  21870. this.panos.list.length *
  21871. this.colliders.length *
  21872. noVisiHots.length;
  21873. if (c > maxCount) {
  21874. //防止加载时间过长,分批计算
  21875. console.log("hot分批setVisiblePanos");
  21876. Hot.visiPanosCountSlice = Math.ceil(
  21877. maxCount / this.colliders.length / noVisiHots.length
  21878. );
  21879. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  21880. let dur =
  21881. Math.ceil(
  21882. this.panos.list.length / Hot.visiPanosCountSlice
  21883. ) * Hot.visiEveryDurSlice;
  21884. console.log(
  21885. Hot.visiPanosCountSlice,
  21886. Hot.visiEveryDurSlice,
  21887. dur,
  21888. Math.round(dur * noVisiHots.length)
  21889. );
  21890. if (noVisiHots.length) {
  21891. let i = 0;
  21892. let hotVisiInterval = setInterval(() => {
  21893. noVisiHots[i].setVisiblePanos(
  21894. noVisiHots[i].info.visiblePanos
  21895. );
  21896. i++;
  21897. if (i >= noVisiHots.length) {
  21898. clearInterval(hotVisiInterval);
  21899. }
  21900. }, dur);
  21901. }
  21902. }
  21903. }
  21904. //---------
  21905. this.createFloorLogo();
  21906. return (
  21907. O.debug("Done building model"),
  21908. v.raycastsDone > 0 &&
  21909. (O.warn("raycasts: " + v.raycastsDone),
  21910. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  21911. this.buildRooms(),
  21912. this.labels.associateWithRooms(this.rooms),
  21913. $.when(this)
  21914. );
  21915. }),
  21916. (n.prototype.createFloorLogo = function () {
  21917. console.log("createFloorLogo");
  21918. if (this.floorLogos || !settings.floorlogoURL) return;
  21919. var url = settings.floorlogoURL;
  21920. var map = tex.load(url); //可以追加done
  21921. this.floorLogos = [];
  21922. for (var i = 0; i < 2; i++) {
  21923. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  21924. var material = new o.MeshBasicMaterial({
  21925. opacity: 0,
  21926. map: map,
  21927. side: o.DoubleSide,
  21928. transparent: !0,
  21929. depthWrite: !1,
  21930. depthTest: false, //改 在chunk\skybox外也可看到
  21931. });
  21932. var logo = new o.Mesh(
  21933. new o.PlaneGeometry(2, 2, 1, 1),
  21934. material
  21935. );
  21936. //var s = (Store.metadata.floorLogoSize || 100)/100;
  21937. //logo.scale.set(s,s,s);
  21938. logo.position.set(0, -1.5, 0);
  21939. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)));
  21940. logo.renderOrder = 100; //cover the videoSkybox
  21941. //logo.layers.set(0)
  21942. this.add(logo);
  21943. this.floorLogos.push(logo);
  21944. }
  21945. this.floorLogos[1].visible = false;
  21946. });
  21947. (n.prototype.adjustfloorLogoHeight = function (o) {
  21948. var h = player.currentPano.floorPosition.y + 0.01;
  21949. this.floorLogos[1].position.setY(h);
  21950. this.floorLogos[0].position.setY(h);
  21951. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  21952. }),
  21953. (n.prototype.changefloorLogoOpa = function (o) {
  21954. //改 i, opacity, time, delay
  21955. if (!this.floorLogos) return;
  21956. E.cancelById("flOpa_" + o.index); //先停止之前该logo的透明度变化
  21957. if (o.from != void 0)
  21958. this.floorLogos[o.index].material.opacity = o.from; //初始透明度
  21959. if (!o.dur) {
  21960. //立刻
  21961. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  21962. this.floorLogos[o.index].material.opacity = o.opa;
  21963. } else {
  21964. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  21965. E.start(
  21966. lerp.property(
  21967. this.floorLogos[o.index].material,
  21968. "opacity",
  21969. o.opa
  21970. ),
  21971. o.dur || 0,
  21972. null,
  21973. o.delay || 0,
  21974. es["easeInQuad"],
  21975. "changefloorLogoOpa",
  21976. "flOpa_" + o.index
  21977. );
  21978. }
  21979. }),
  21980. (n.prototype.updateFloorlogo = (function () {
  21981. //xzw add 更新地标的旋转
  21982. var lastQ, lastP;
  21983. var equals = function (v1, v2, min) {
  21984. return Math.abs(v1 - v2) < min;
  21985. };
  21986. var isSame = function (now, last, k) {
  21987. //如果和上次相同就不改变
  21988. if (!last) return false;
  21989. var R = k.sceneRenderer;
  21990. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  21991. //暂时:
  21992. var min = 0.0008;
  21993. var same =
  21994. equals(now.x, last.x, min) &&
  21995. equals(now.y, last.y, min) &&
  21996. equals(now.z, last.z, min) &&
  21997. (now.w != void 0 ? equals(now.w, last.w, min) : true);
  21998. return same;
  21999. };
  22000. return function (Q, k) {
  22001. if (!Q) return;
  22002. /* if(Config.ifFish && window.lowFPS){
  22003. this.fLCompute++;
  22004. if(R.AFPS < 38){
  22005. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  22006. else if(k.flying && k.fLCompute%2 !=1) return;
  22007. k.fLCompute %= 4;
  22008. }else if(R.AFPS < 45){
  22009. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  22010. else if(k.flying && k.fLCompute%2 !=1) return;
  22011. k.fLCompute %= 6;
  22012. }else{
  22013. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  22014. //else if(k.flying && k.fLCompute%2 !=1) return;
  22015. k.fLCompute %= 2;
  22016. }
  22017. } */
  22018. var sameQ, sameP, quaternion, visible;
  22019. for (var i = 0; i < 2; i++) {
  22020. var logo = this.floorLogos[i];
  22021. if (
  22022. !logo.visible ||
  22023. logo.material.uniforms.opacity.value == 0
  22024. )
  22025. continue;
  22026. visible = true;
  22027. }
  22028. if (!visible) return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  22029. var c = k.cameraControls.activeControl;
  22030. var sameQ = c
  22031. ? c.lat < 10
  22032. ? equals(c.lon, lastQ, 0.1)
  22033. : equals(c.lon, lastQ, 1)
  22034. : false;
  22035. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  22036. for (var i = 0; i < 2; i++) {
  22037. var logo = this.floorLogos[i];
  22038. if (!sameQ) {
  22039. if (!quaternion) {
  22040. var a = new THREE.Vector3(0, 0, -1);
  22041. a.applyQuaternion(Q);
  22042. a.setY(0);
  22043. var _ = new THREE.Matrix4().lookAt(
  22044. a,
  22045. new THREE.Vector3(),
  22046. new THREE.Vector3(0, 1, 0)
  22047. );
  22048. quaternion = new THREE.Quaternion().setFromRotationMatrix(
  22049. _
  22050. );
  22051. var a = new THREE.Quaternion(
  22052. 0,
  22053. 0.7071067811865476,
  22054. 0.7071067811865476,
  22055. 0
  22056. ); //计算得
  22057. quaternion.multiply(a);
  22058. }
  22059. logo.quaternion.copy(quaternion);
  22060. }
  22061. }
  22062. };
  22063. })());
  22064. (n.prototype.loadLabels = function () {
  22065. //xzw
  22066. this.labels = new x(this);
  22067. var e = $.Deferred();
  22068. //加载俯视图的标签 注释这个备注就会加载
  22069. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  22070. window.DATA.showingLabels ? (this.showingLabels = true) : "";
  22071. if (!this.showingLabels) return e.resolve();
  22072. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  22073. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  22074. return (
  22075. this.labels
  22076. .load(t, !this.isPublic)
  22077. .done(e.resolve.bind(e))
  22078. .fail(function () {
  22079. O.warn("Getting labels failed, not displaying labels."),
  22080. e.resolve();
  22081. }),
  22082. e
  22083. );
  22084. }),
  22085. (n.prototype.buildRooms = function () {
  22086. (this.rooms = new T(this)),
  22087. this.rooms.createFromChunks(this.chunks),
  22088. this.rooms.calcRoomBoundaries();
  22089. }),
  22090. (n.prototype.updateProjectedPanos = function () {
  22091. this.projectedPano0 &&
  22092. this.projectedPano1 &&
  22093. this.setProjectedPanos(
  22094. this.projectedPano0,
  22095. this.projectedPano1,
  22096. !1
  22097. );
  22098. }),
  22099. (n.prototype.setProjectedPanos = function (e, t, i) {
  22100. (void 0 !== i && null !== i) || (i = !0),
  22101. (i = !!i),
  22102. (this.projectedPano0 = e),
  22103. (this.projectedPano1 = t),
  22104. this.skybox.material.setProjectedPanos(e, t, i),
  22105. this.chunks.forEach(function (n) {
  22106. n.materialInside.setProjectedPanos(e, t, i);
  22107. });
  22108. }),
  22109. (n.prototype.setSide = function (e) {
  22110. this.floors.forEach(function (t) {
  22111. t.collider.material.side = e;
  22112. });
  22113. }),
  22114. (n.prototype.heroCount = function () {
  22115. return this.heroLocations ? this.heroLocations.length : 0;
  22116. }),
  22117. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  22118. //改 因增加了二级目录
  22119. if (e[0] < 0)
  22120. return (
  22121. O.warn(
  22122. "Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."
  22123. ),
  22124. null
  22125. );
  22126. if (this.heroCount() < 1)
  22127. return (
  22128. O.warn(
  22129. "Model.getHeroDescriptorByIndex() -> No hero locations in this model"
  22130. ),
  22131. null
  22132. );
  22133. var t = this.heroLocations[e[0]];
  22134. if (t.heroLocations && e[1] != void 0) {
  22135. t = t.heroLocations[e[1]];
  22136. }
  22137. return void 0 === t
  22138. ? (O.warn(
  22139. "Model.getHeroDescriptorByIndex() -> Index " +
  22140. e +
  22141. " is not a validindex"
  22142. ),
  22143. null)
  22144. : t;
  22145. }),
  22146. (n.prototype.findPanoramicHero = function () {
  22147. for (var e in this.heroLocations)
  22148. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  22149. return this.heroLocations[e];
  22150. return null;
  22151. }),
  22152. (n.prototype.listImagePanos = function () {
  22153. var e = [],
  22154. t = this;
  22155. return (
  22156. this.images.forEach(function (i) {
  22157. if (i.metadata && i.metadata.scan_id) {
  22158. var n = t.panos.get(i.metadata.scan_id);
  22159. n && (t.supportsTiles || n.isLoaded("high") || e.push(n));
  22160. }
  22161. }),
  22162. e
  22163. );
  22164. }),
  22165. (n.prototype.fadePanoMarkers = function (
  22166. /* e, t */ opacity,
  22167. dur,
  22168. o = {}
  22169. ) {
  22170. //改
  22171. //this.panos.fadeMarkerOpacity(e, t)
  22172. if (window.DATA.hideFloorMarker) return;
  22173. var currentPano = player.currentPano;
  22174. opacity =
  22175. void 0 == opacity ? _settings.panorama.markerOpacity : opacity; //不传opacity代表显示
  22176. var hideWhenFlyOut = () => {
  22177. var shows = [],
  22178. hides = [];
  22179. player.model.panos.forEach((pano) => {
  22180. hides.push(pano);
  22181. });
  22182. this.panos.fadeMarkerOpacity(0, dur, [
  22183. { toOp: 0, member: hides },
  22184. ]);
  22185. };
  22186. if (opacity == 0) {
  22187. hideWhenFlyOut();
  22188. } else {
  22189. if (player.mode == "panorama" && currentPano) {
  22190. var shows = [],
  22191. hides = [];
  22192. player.model.panos.forEach((pano) => {
  22193. //是邻近点就显示否则隐藏
  22194. if (currentPano.neighbourPanos[pano.id]) {
  22195. shows.push(pano);
  22196. } else {
  22197. hides.push(pano);
  22198. }
  22199. });
  22200. this.panos.fadeMarkerOpacity(opacity, dur, [
  22201. { toOp: opacity, member: shows },
  22202. { toOp: 0, member: hides },
  22203. ]);
  22204. } else if (player.modeTran.split("-")[1] != "panorama") {
  22205. //飞出后marker隐藏
  22206. hideWhenFlyOut();
  22207. }
  22208. }
  22209. }),
  22210. (n.prototype.setSweepVisibility = function (e) {
  22211. this.panos.forEach(function (t) {
  22212. t.marker && (t.marker.visible = e);
  22213. });
  22214. }),
  22215. (n.prototype.outsideAllowed = function () {
  22216. return (
  22217. this.supportedModes[c.DOLLHOUSE] &&
  22218. this.supportedModes[c.FLOORPLAN]
  22219. );
  22220. }),
  22221. (n.prototype.addHighMapCube = function () {
  22222. //创建8*8的tile cube
  22223. if (
  22224. player.qualityManager.getMaxZoomClass() == "4k" &&
  22225. player.qualityManager.maxRenderTargetSize == 2048
  22226. ) {
  22227. var geo = new THREE.PlaneGeometry(1, 1, 1, 1);
  22228. var cube = new THREE.Object3D();
  22229. cube.tiles = [];
  22230. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  22231. var face = new THREE.Object3D();
  22232. for (var i = 0; i < 8; i++) {
  22233. for (var j = 0; j < 8; j++) {
  22234. var tile = new THREE.Mesh(
  22235. geo,
  22236. new THREE.MeshBasicMaterial({ side: 2 })
  22237. );
  22238. tile.position.set(i - 3.5, j - 3.5, -4);
  22239. if (highMapAddColor) {
  22240. tile.material.opacity = 0.4;
  22241. var colorHue = Math.random();
  22242. tile.material.color = new THREE.Color().setHSL(
  22243. colorHue,
  22244. 0.6,
  22245. 0.9
  22246. );
  22247. }
  22248. tile.material.transparent = true;
  22249. tile.material.depthTest /* = tile.material.depthWrite */ = false; //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  22250. tile.visible = false;
  22251. tile.tileX = i;
  22252. tile.tileY = j;
  22253. tile.cubeFace = cubeIndex;
  22254. tile.renderOrder = 2; //RenderOrder.highTileCube
  22255. cube.tiles.push(tile);
  22256. face.add(tile);
  22257. }
  22258. }
  22259. switch (cubeIndex) {
  22260. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  22261. face.rotation.set(0, Math.PI / 2, 0);
  22262. break;
  22263. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  22264. face.rotation.set(0, -Math.PI / 2, 0);
  22265. break;
  22266. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  22267. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  22268. new THREE.Vector3(0, 1, 0),
  22269. Math.PI
  22270. );
  22271. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  22272. new THREE.Vector3(1, 0, 0),
  22273. Math.PI / 2
  22274. );
  22275. face.quaternion.copy(rot1).multiply(rot2);
  22276. //face.rotation.set(Math.PI/2,0,0);
  22277. break;
  22278. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22279. //face.rotation.set(-Math.PI/2,0,0);
  22280. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  22281. new THREE.Vector3(0, 1, 0),
  22282. Math.PI
  22283. );
  22284. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  22285. new THREE.Vector3(1, 0, 0),
  22286. -Math.PI / 2
  22287. );
  22288. face.quaternion.copy(rot1).multiply(rot2);
  22289. break;
  22290. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  22291. face.rotation.set(0, Math.PI, 0);
  22292. break;
  22293. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22294. face.rotation.set(0, 0, 0);
  22295. }
  22296. face.scale.set(1, -1, 1);
  22297. cube.add(face);
  22298. }
  22299. cube.name = "highMapCube";
  22300. this.highMapCube = cube;
  22301. this.add(cube);
  22302. cube.scale.set(0.21, 0.21, 0.21); //camera.near is 0.1
  22303. this.highMapCube.visible = false;
  22304. this.highMapCube.texLoadedCount = 0;
  22305. player.once("pano.chosen", () => {
  22306. //wait sceneRenderer
  22307. player.sceneRenderer.on("after-render", (e) => {
  22308. if (this.highMapCube.visibleTiles) {
  22309. this.updateTiles();
  22310. }
  22311. if (player && player.lastFrameChanged) {
  22312. common.intervalTool.isWaiting(
  22313. "update4kTiles",
  22314. () => {
  22315. let vectorForward = player.getDirection();
  22316. this.updateTiles(vectorForward);
  22317. },
  22318. 500
  22319. );
  22320. }
  22321. });
  22322. });
  22323. }
  22324. });
  22325. /*
  22326. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  22327. */
  22328. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  22329. var tile =
  22330. this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  22331. return !!tile.material.map;
  22332. };
  22333. n.prototype.updateTiles = function (direction) {
  22334. if (!this.highMapCube || !this.highMapCube.visible) return;
  22335. if (this.highMapCube.tiles.filter((e) => e.image).length <= 10)
  22336. return; //加载的太少了
  22337. //performance.mark('updateTiles-start')
  22338. if (direction) {
  22339. let camera = player.cameraControls.cameras.panorama;
  22340. let hfov =
  22341. THREE.Math.degToRad(
  22342. cameraLight.getHFOVForCamera(
  22343. camera,
  22344. $("#player").width(),
  22345. $("#player").height()
  22346. )
  22347. ) / 2;
  22348. let vfov = THREE.Math.degToRad(camera.fov) / 2;
  22349. /* let hcos = Math.cos(hfov / 2)
  22350. let vcos = Math.cos(vfov / 2) */
  22351. let list = this.highMapCube.tiles;
  22352. list.forEach((e) => {
  22353. //屏幕外的不显示
  22354. let pos = e.getWorldPosition(new THREE.Vector3());
  22355. let dir = new THREE.Vector3()
  22356. .subVectors(pos, this.highMapCube.position)
  22357. .normalize();
  22358. let hcos_ = dir
  22359. .clone()
  22360. .setY(direction.y)
  22361. .normalize()
  22362. .dot(direction); //在direction的斜面上水平角度差
  22363. let hRad = Math.acos(hcos_);
  22364. let vRad = -200;
  22365. if (hRad > hfov + 0.08) {
  22366. e.score = -100;
  22367. } else {
  22368. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y));
  22369. if (vRad > vfov + 0.08) {
  22370. e.score = -100;
  22371. } else {
  22372. e.score = -(hRad / hfov + vRad / vfov);
  22373. }
  22374. }
  22375. e.scores = hRad.toFixed(3) + ", " + vRad.toFixed(3);
  22376. if (e.score == -100) {
  22377. this.resetTile(e);
  22378. }
  22379. });
  22380. this.highMapCube.visibleTiles = list.filter(
  22381. (e) => e.score > -100
  22382. );
  22383. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  22384. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  22385. */
  22386. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  22387. }
  22388. let needRecover = this.highMapCube.visibleTiles.filter(
  22389. (e) => !e.material.map
  22390. );
  22391. if (needRecover.length) {
  22392. let maxCount = 1; //common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  22393. let count = 0;
  22394. needRecover.forEach((e, i) => {
  22395. //只更新若干个,因为太耗时了, 其余的等下帧更新
  22396. if (count >= maxCount) return;
  22397. let r = this.recoverTile(e);
  22398. if (r) count++;
  22399. });
  22400. }
  22401. };
  22402. n.prototype.getHighImage = function (image, cubeFace, tileX, tileY) {
  22403. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  22404. let tile =
  22405. this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  22406. tile.image = image; //先记录下来
  22407. };
  22408. n.prototype.updateHighMap = function (image, cubeFace, tileX, tileY) {
  22409. let tile =
  22410. this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  22411. if (image) tile.image = image; //先记录下来
  22412. if (tile.material.map) return;
  22413. if (
  22414. this.highMapCube.visibleTiles &&
  22415. !this.highMapCube.visibleTiles.includes(tile)
  22416. ) {
  22417. return;
  22418. }
  22419. //简易创建贴图
  22420. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  22421. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  22422. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  22423. */
  22424. var tex = new THREE.Texture();
  22425. tex.image = image;
  22426. tex.flipY = false;
  22427. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping;
  22428. tex.generateMipmaps = false;
  22429. tex.minFilter = THREE.LinearFilter;
  22430. tex.needsUpdate = true;
  22431. tile.material.map = tex;
  22432. if (highMapAddColor) {
  22433. tile.material.opacity = 1;
  22434. }
  22435. tile.visible = true;
  22436. tile.material.needsUpdate = true; //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  22437. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  22438. };
  22439. n.prototype.recoverTile = function (tile) {
  22440. if (tile.material.map) return;
  22441. if (tile.image) {
  22442. this.updateHighMap(
  22443. tile.image,
  22444. tile.cubeFace,
  22445. tile.tileX,
  22446. tile.tileY
  22447. );
  22448. return true;
  22449. } else {
  22450. //console.log('no image')
  22451. }
  22452. };
  22453. n.prototype.resetTile = function (tile, kill) {
  22454. if (kill) {
  22455. //完全消灭
  22456. tile.image = null;
  22457. }
  22458. let map = tile.material.map;
  22459. if (map) {
  22460. map.dispose(); //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  22461. map.loaded = !1;
  22462. map.version = 0;
  22463. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  22464. var h = player.sceneRenderer.renderer.properties.get(map);
  22465. player.sceneRenderer.renderer
  22466. .getContext()
  22467. .deleteTexture(h.__webglTexture);
  22468. tile.material.map = null;
  22469. if (highMapAddColor) {
  22470. tile.material.opacity = 0.4;
  22471. }
  22472. tile.material.needsUpdate = true;
  22473. tile.visible = false;
  22474. //this.highMapCube.texLoadedCount --
  22475. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  22476. }
  22477. };
  22478. n.prototype.resetHighMap = function () {
  22479. if (!this.highMapCube) return;
  22480. this.highMapCube.children.forEach((e) =>
  22481. e.children.forEach((tile) => {
  22482. this.resetTile(tile, true);
  22483. })
  22484. );
  22485. //this.highMapCube.texLoadedCount = 0
  22486. this.highMapCube.visibleTiles = null;
  22487. this.hideHighMap();
  22488. };
  22489. n.prototype.setHighMap = function (pano) {
  22490. if (!this.highMapCube) return;
  22491. this.highMapCube.position.copy(pano.position);
  22492. this.highMapCube.quaternion.copy(pano.quaternion);
  22493. };
  22494. n.prototype.showHighMap = function () {
  22495. if (!this.highMapCube) return;
  22496. this.highMapCube.visible = true;
  22497. };
  22498. n.prototype.hideHighMap = function () {
  22499. if (!this.highMapCube) return;
  22500. this.highMapCube.visible = false;
  22501. };
  22502. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  22503. t.exports = n;
  22504. }).call(this, "/js/model/Model.js");
  22505. },
  22506. {
  22507. "../constants": 8,
  22508. "../enum/AlignmentType": 17,
  22509. "../enum/RenderOrder": 42,
  22510. "../enum/Viewmode": 51,
  22511. "../exception/BasicException": 55,
  22512. "../label/Label": 90,
  22513. "../loaders/ModelLoader": 105,
  22514. "../loaders/ModelTextureLoader": 106,
  22515. "../loaders/SweepDataLoader": 107,
  22516. "../tag/tag": 123,
  22517. "./util/cameraLight": 184,
  22518. "../tag/tagManager": 124,
  22519. "../objects/BoundingTextureSkybox": 143,
  22520. "../objects/Chunk": 144,
  22521. "../objects/Floor": 146,
  22522. "../objects/Panorama": 148,
  22523. "../objects/Room": 150,
  22524. "../objects/Snapshot": 153,
  22525. "../settings": 166,
  22526. "../shaders": 167,
  22527. "../util/ModelUrls": 177,
  22528. "../util/PanoramaCollection": 178,
  22529. "../util/ajax": 181,
  22530. "../util/common": 185,
  22531. "../util/easing": 186,
  22532. "../util/lerp": 188,
  22533. "../util/logger": 189,
  22534. "../util/math": 190,
  22535. "../util/texture": 194,
  22536. "../util/transitions": 195,
  22537. "./../util/browser": 182,
  22538. "./../util/showcase": 193,
  22539. "./Chunks": 135,
  22540. "./FloorCollection": 136,
  22541. "./ImageCollection": 137,
  22542. "./LabelCollection": 138,
  22543. "./RoomCollection": 141,
  22544. events: 202,
  22545. three: 217,
  22546. hot: "hot",
  22547. "../enum/GLCubeFaces": 25,
  22548. },
  22549. ],
  22550. 140: [
  22551. function (e, t, i) {
  22552. "use strict";
  22553. function n() {
  22554. (this.modelMap = {}),
  22555. (this.activeModel = null),
  22556. (this.modelCount = 0),
  22557. (this.tileDownloader = null),
  22558. (this.panoRenderer = null);
  22559. }
  22560. var r = (e("three"), e("../util/common")),
  22561. o = e("../exception/BasicException"),
  22562. a = e("../enum/ModelManagerEvents"),
  22563. s = e("../enum/PanoRendererEvents"),
  22564. l = e("events").EventEmitter;
  22565. (n.prototype.init = function (e, t, i) {
  22566. (this.tileDownloader = e),
  22567. (this.panoRenderer = t),
  22568. (this.qualityManager = i),
  22569. this.bindEvents();
  22570. }),
  22571. (n.prototype.bindEvents = function () {
  22572. this.panoRenderer.on(
  22573. s.TileRenderSuccess,
  22574. this.onTileRendered.bind(this)
  22575. );
  22576. }),
  22577. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  22578. (n.prototype.addModel = function (e) {
  22579. (this.modelMap[e.sid] = e),
  22580. 0 === this.modelCount && this.activateModel(e.sid),
  22581. this.modelCount++,
  22582. this.emit(a.ModelAdded);
  22583. }),
  22584. (n.prototype.getModel = function (e) {
  22585. return this.modelMap[e];
  22586. }),
  22587. (n.prototype.activateModel = function (e) {
  22588. var t = this.modelMap[e];
  22589. if (!t) throw new o("Tried to activate invalid model!");
  22590. var i = this.activeModel;
  22591. (this.activeModel = t),
  22592. this.tileDownloader.setPanoData(
  22593. t.panos,
  22594. t.listImagePanos(),
  22595. t.sid
  22596. ),
  22597. this.tileDownloader.setUrls(t.urls),
  22598. t.panos.forEach(
  22599. function (e) {
  22600. e.attachToPanoRenderer(this.panoRenderer),
  22601. (e.tileDownloader = this.tileDownloader),
  22602. (e.qualityManager = this.qualityManager);
  22603. }.bind(this)
  22604. ),
  22605. this.emit(a.ActiveModelChanged, {
  22606. oldModel: i,
  22607. model: t,
  22608. });
  22609. }),
  22610. (n.prototype.getActiveModel = function () {
  22611. return this.activeModel;
  22612. }),
  22613. r.extend(n, l),
  22614. (t.exports = n);
  22615. },
  22616. {
  22617. "../enum/ModelManagerEvents": 33,
  22618. "../enum/PanoRendererEvents": 35,
  22619. "../exception/BasicException": 55,
  22620. "../util/common": 185,
  22621. events: 202,
  22622. three: 217,
  22623. },
  22624. ],
  22625. 141: [
  22626. function (e, t, i) {
  22627. (function (i) {
  22628. "use strict";
  22629. function n() {
  22630. s.call(this);
  22631. }
  22632. var r = e("../objects/Room"),
  22633. o = (e("../settings"), e("../util/logger")),
  22634. a =
  22635. (e("../util/transitions"),
  22636. e("../util/easing"),
  22637. e("../util/common")),
  22638. s = e("../util/IndexedCollection"),
  22639. l = e("./Chunks");
  22640. new o(i);
  22641. a.inherit(n, s),
  22642. (n.prototype.getIndex = function (e) {
  22643. return e.roomId;
  22644. }),
  22645. (n.prototype.calcRoomBoundaries = function () {
  22646. this.forEach(function (e) {
  22647. e.calcBoundaries();
  22648. });
  22649. }),
  22650. (n.prototype.createFromChunks = function (e) {
  22651. var t = {
  22652. floorId: -1,
  22653. roomId: -1,
  22654. },
  22655. i = {};
  22656. e.forEach(
  22657. function (e) {
  22658. l.parseIdsFromChunkName(e.name, t);
  22659. var o = i[t.roomId];
  22660. if (!o) {
  22661. var a = n.generateRoomId(t.floorId, t.roomId);
  22662. (o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o);
  22663. }
  22664. o.addChunk(e);
  22665. }.bind(this)
  22666. ),
  22667. this.calcRoomBoundaries();
  22668. }),
  22669. (n.generateRoomId = function (e, t) {
  22670. return e + "_" + t;
  22671. }),
  22672. (t.exports = n);
  22673. }).call(this, "/js/model/RoomCollection.js");
  22674. },
  22675. {
  22676. "../objects/Room": 150,
  22677. "../settings": 166,
  22678. "../util/IndexedCollection": 175,
  22679. "../util/common": 185,
  22680. "../util/easing": 186,
  22681. "../util/logger": 189,
  22682. "../util/transitions": 195,
  22683. "./Chunks": 135,
  22684. },
  22685. ],
  22686. 142: [
  22687. function (e, t, i) {
  22688. "use strict";
  22689. function n(e, t, i) {
  22690. e = e.clone().expandByScalar(0.01); //改
  22691. var n = e.size(),
  22692. o = new r.BoxGeometry(n.x, n.y, n.z);
  22693. (o.boundingBox = e),
  22694. r.Mesh.call(this, o, t),
  22695. this.position.copy(e.center()),
  22696. (this.frustumCulled = !1),
  22697. i && this.add(new r.WireframeHelper(this));
  22698. }
  22699. var r = e("three");
  22700. (n.prototype = Object.create(r.Mesh.prototype)),
  22701. (n.prototype.constructor = n),
  22702. (t.exports = n);
  22703. },
  22704. {
  22705. three: 217,
  22706. },
  22707. ],
  22708. 143: [
  22709. function (e, t, i) {
  22710. (function (i) {
  22711. "use strict";
  22712. function n(e) {
  22713. h.time("Computing a nice bounding cubemap");
  22714. var t = new a({
  22715. side: r.BackSide,
  22716. transparent: !0,
  22717. });
  22718. (t.uniforms.modelAlpha.value = 0),
  22719. (t.uniforms.opacity.value = 1 - s.modelAlpha),
  22720. (this.renderOrder = l.boundingSkybox),
  22721. o.call(this, e, t),
  22722. h.timeEnd("Computing a nice bounding cubemap");
  22723. }
  22724. var r = e("three"),
  22725. o = (e("../enum/Viewmode"), e("../shaders"), e("./BoundingMesh")),
  22726. a = e("../materials/ModelTextureMaterial"),
  22727. s = e("../settings"),
  22728. l = e("../enum/RenderOrder"),
  22729. c = e("../util/logger"),
  22730. h = new c(i);
  22731. (n.prototype = Object.create(o.prototype)),
  22732. (n.prototype.constructor = n),
  22733. (t.exports = n);
  22734. }).call(this, "/js/objects/BoundingTextureSkybox.js");
  22735. },
  22736. {
  22737. "../enum/RenderOrder": 42,
  22738. "../enum/Viewmode": 51,
  22739. "../materials/ModelTextureMaterial": 118,
  22740. "../settings": 166,
  22741. "../shaders": 167,
  22742. "../util/logger": 189,
  22743. "./BoundingMesh": 142,
  22744. three: 217,
  22745. },
  22746. ],
  22747. 144: [
  22748. function (e, t, i) {
  22749. "use strict";
  22750. function n(e) {
  22751. this.materialInside = new s({
  22752. side: r.DoubleSide,
  22753. });
  22754. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  22755. (this.materialOutside = new r.RawShaderMaterial({
  22756. fragmentShader: o.modelOutside.fragmentShader,
  22757. vertexShader: o.modelOutside.vertexShader,
  22758. uniforms: t,
  22759. side: r.FrontSide,
  22760. name: "chunkOut",
  22761. })),
  22762. r.Mesh.call(this, e.geometry, this.materialInside),
  22763. (this.name = e.name || ""),
  22764. (this.textureName = e.textureName),
  22765. (this.meshUrl = e.meshUrl);
  22766. }
  22767. var r = e("three"),
  22768. o = e("../shaders"),
  22769. a = e("../enum/Viewmode"),
  22770. s = e("../materials/ModelTextureMaterial");
  22771. (n.prototype = Object.create(r.Mesh.prototype)),
  22772. (n.prototype.setTextureMap = function (e) {
  22773. (this.materialInside.uniforms.map.value = e),
  22774. (this.materialOutside.uniforms.map.value = e);
  22775. }),
  22776. (n.prototype.setMode = function (e) {
  22777. var t =
  22778. e === a.DOLLHOUSE || e === a.FLOORPLAN
  22779. ? this.materialOutside
  22780. : this.materialInside;
  22781. (t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  22782. (t.transparent = this.material.transparent),
  22783. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  22784. (this.material = t);
  22785. }),
  22786. (t.exports = n);
  22787. },
  22788. {
  22789. "../enum/Viewmode": 51,
  22790. "../materials/ModelTextureMaterial": 118,
  22791. "../shaders": 167,
  22792. three: 217,
  22793. },
  22794. ],
  22795. 145: [
  22796. function (e, t, i) {
  22797. "use strict";
  22798. function n(e) {
  22799. (this.chunksize = e || 10),
  22800. (this.chunks = {}),
  22801. (this.boundingBoxes = {}),
  22802. (this.children = []),
  22803. (this.offset = new r.Vector3(0, 0.5, 0)),
  22804. (this.material = new r.MeshBasicMaterial({
  22805. color: 16777215 * Math.random(),
  22806. side: r.DoubleSide,
  22807. }));
  22808. }
  22809. var r = e("three");
  22810. e("../enum/Viewmode");
  22811. (n.prototype.add = function (e) {
  22812. var t,
  22813. i,
  22814. n,
  22815. o,
  22816. a,
  22817. s,
  22818. l,
  22819. c,
  22820. h,
  22821. u,
  22822. d,
  22823. p,
  22824. f,
  22825. g,
  22826. m = e.attributes;
  22827. m
  22828. ? ((t = m.position.array),
  22829. (i = void 0 !== e.index ? e.index.array : void 0))
  22830. : ((t = e.vertices), (n = e.faces));
  22831. var v = new r.Vector3();
  22832. if (i)
  22833. for (o = 0, a = i.length; o < a; o += 3) {
  22834. var A = 3 * i[o],
  22835. y = 3 * i[o + 1],
  22836. C = 3 * i[o + 2];
  22837. (s = (t[A] + t[y] + t[C]) / 3),
  22838. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  22839. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  22840. (h = Math.floor(s / this.chunksize)),
  22841. (u = Math.floor(l / this.chunksize)),
  22842. (d = Math.floor(c / this.chunksize)),
  22843. (p = h + "." + u + "." + d),
  22844. p in this.chunks
  22845. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  22846. : ((g = this.chunks[p] = []),
  22847. (f = this.boundingBoxes[p] = new r.Box3())),
  22848. g.push(
  22849. t[A],
  22850. t[A + 1],
  22851. t[A + 2],
  22852. t[y],
  22853. t[y + 1],
  22854. t[y + 2],
  22855. t[C],
  22856. t[C + 1],
  22857. t[C + 2]
  22858. ),
  22859. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  22860. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  22861. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]));
  22862. }
  22863. else
  22864. for (o = 0, a = t.length; o < a; o += 9)
  22865. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  22866. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  22867. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  22868. (h = Math.floor(s / this.chunksize)),
  22869. (u = Math.floor(l / this.chunksize)),
  22870. (d = Math.floor(c / this.chunksize)),
  22871. (p = h + "." + u + "." + d),
  22872. p in this.chunks
  22873. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  22874. : ((g = this.chunks[p] = []),
  22875. (f = this.boundingBoxes[p] = new r.Box3())),
  22876. g.push(
  22877. t[o],
  22878. t[o + 1],
  22879. t[o + 2],
  22880. t[o + 3],
  22881. t[o + 4],
  22882. t[o + 5],
  22883. t[o + 6],
  22884. t[o + 7],
  22885. t[o + 8]
  22886. ),
  22887. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  22888. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  22889. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]));
  22890. }),
  22891. (n.prototype.build = function () {
  22892. var e = new r.Object3D();
  22893. e.material = this.material;
  22894. for (var t in this.chunks) {
  22895. var i = this.chunks[t],
  22896. n = new r.BufferGeometry();
  22897. n.addAttribute(
  22898. "position",
  22899. new r.BufferAttribute(new Float32Array(i), 3)
  22900. ),
  22901. (n.boundingBox = this.boundingBoxes[t]);
  22902. var o = new r.Mesh(n, this.material);
  22903. (o.material.visible = !1), e.add(o), (this.chunks[t] = []);
  22904. }
  22905. return e;
  22906. }),
  22907. (t.exports = n);
  22908. },
  22909. {
  22910. "../enum/Viewmode": 51,
  22911. three: 217,
  22912. },
  22913. ],
  22914. 146: [
  22915. function (e, t, i) {
  22916. "use strict";
  22917. var r = e("three"),
  22918. o = e("../settings"),
  22919. a = e("../util/common"),
  22920. s = e("../util/lerp"),
  22921. l = e("./ChunkedCollider"),
  22922. c = e("../util/transitions"),
  22923. h = e("../util/easing"),
  22924. u = (e("../objects/Panorama"), e("../enum/RenderOrder")),
  22925. d = e("../localization/localize");
  22926. function n(e, t, i) {
  22927. r.Object3D.call(this),
  22928. (this.model = e),
  22929. (this.floorIndex = t),
  22930. (this.lang = o.languageTag),
  22931. (this.name =
  22932. i || o.languageTag === "cn"
  22933. ? "Floor " + (t + 1) + ""
  22934. : "第" + (t + 1) + "层"),
  22935. (this.panos = []),
  22936. (this.chunks = []),
  22937. (this.colliderBuilder = new l(3)),
  22938. (this.collider = null),
  22939. (this.center = null),
  22940. (this.boundingBox = new r.Box3()),
  22941. (this.size = null),
  22942. (this.hidden = !1),
  22943. (this.conservativeBoundingBox = new r.Box3()),
  22944. (this.debugColor = 16777215 * Math.random()),
  22945. (this.transition = null);
  22946. }
  22947. (n.prototype = Object.create(r.Object3D.prototype)),
  22948. (n.prototype.enter = function (e) {
  22949. this.model.setFloor(this, e);
  22950. }),
  22951. (n.prototype.hide = function (e) {
  22952. if (!this.hidden || this.transition) {
  22953. this.chunks.forEach(function (e) {
  22954. e.material.transparent = !0;
  22955. }),
  22956. c.cancel(this.transition);
  22957. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  22958. i = e ? 0 : o.hideFloorDelay / t;
  22959. this.transition = c.start(
  22960. s.allUniforms(this.chunks, "opacity", 0.08),
  22961. t,
  22962. function () {
  22963. this.hidden = !0;
  22964. }.bind(this),
  22965. i,
  22966. h.easeInOutQuad
  22967. );
  22968. }
  22969. }),
  22970. (n.prototype.show = function (e) {
  22971. if (this.hidden || this.transition) {
  22972. (this.hidden = !1), c.cancel(this.transition);
  22973. var t = e
  22974. ? o.showFloorDuration
  22975. : o.showFloorDuration + o.showFloorDelay,
  22976. i = e ? 0 : o.showFloorDelay / t;
  22977. this.transition = c.start(
  22978. s.allUniforms(this.chunks, "opacity", 1),
  22979. t,
  22980. function () {
  22981. this.hidden ||
  22982. this.chunks.forEach(function (e) {
  22983. e.material.transparent = !1;
  22984. });
  22985. }.bind(this),
  22986. i,
  22987. h.easeInOutQuad
  22988. );
  22989. }
  22990. }),
  22991. (n.prototype.toggle = function (e, t) {
  22992. (e = void 0 === e ? this.hidden : e),
  22993. e ? this.show(t) : this.hide(t);
  22994. }),
  22995. (n.prototype.containsPoint = function (e) {
  22996. return this.collider.children.some(function (t) {
  22997. return (
  22998. t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  22999. t.geometry.boundingBox.containsPoint(e)
  23000. );
  23001. });
  23002. }),
  23003. (n.prototype.distanceToPoint = function (e) {
  23004. var t = null,
  23005. i = 1 / 0;
  23006. return (
  23007. this.collider.children.forEach(function (n) {
  23008. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  23009. var r = n.geometry.boundingBox.distanceToPoint(e);
  23010. (!t || i > r) && ((i = r), (t = n));
  23011. }),
  23012. i
  23013. );
  23014. }),
  23015. (n.prototype.addChunk = function (e) {
  23016. (e.renderOrder = u.ghostFloor),
  23017. this.add(e),
  23018. this.chunks.push(e),
  23019. this.boundingBox.union(e.geometry.boundingBox),
  23020. (this.size = this.boundingBox.size()),
  23021. this.colliderBuilder.add(e.geometry);
  23022. }),
  23023. (n.prototype.addPano = function (e) {
  23024. this.panos.push(e),
  23025. this.add(e.skyboxMesh),
  23026. e.marker && this.add(e.marker);
  23027. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  23028. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  23029. var t = new r.Vector3(1, 1, 1),
  23030. i = new r.Box3().setFromCenterAndSize(e.position, t);
  23031. this.boundingBox.union(i);
  23032. }
  23033. }),
  23034. (n.prototype.build = function () {
  23035. (this.collider = this.colliderBuilder.build(!0)),
  23036. this.add(this.collider),
  23037. (this.center = this.boundingBox.center()),
  23038. this.conservativeBoundingBox.copy(this.boundingBox),
  23039. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  23040. this.collider.children.map(function (e) {
  23041. return e.geometry.boundingBox.min.y;
  23042. }),
  23043. 5
  23044. )),
  23045. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  23046. this.collider.children.map(function (e) {
  23047. return e.geometry.boundingBox.max.y;
  23048. }),
  23049. 5
  23050. )),
  23051. (this.colliderBuilder = null);
  23052. }),
  23053. (n.prototype.toShortString = function () {
  23054. return a.nth(this.floorIndex + 1);
  23055. }),
  23056. (n.prototype.toString = function () {
  23057. return this.name;
  23058. }),
  23059. (t.exports = n);
  23060. },
  23061. {
  23062. "../enum/RenderOrder": 42,
  23063. "../localization/localize": 108,
  23064. "./strings-cn-CN": 109,
  23065. "../objects/Panorama": 148,
  23066. "../settings": 166,
  23067. "../util/common": 185,
  23068. "../util/easing": 186,
  23069. "../util/lerp": 188,
  23070. "../util/transitions": 195,
  23071. "./ChunkedCollider": 145,
  23072. three: 217,
  23073. },
  23074. ],
  23075. 147: [
  23076. function (e, t, i) {
  23077. "use strict";
  23078. function n(e) {
  23079. (this.player = e),
  23080. (this.obj3d = null),
  23081. (this.UP = new r.Vector3(0, 1, 0));
  23082. }
  23083. var r = e("three"),
  23084. o = e("../settings");
  23085. (n.prototype.prefs = {
  23086. linewidth: 3,
  23087. height: 0.07,
  23088. opacity: 0.45,
  23089. endScale: 0.05,
  23090. }),
  23091. (n.prototype.discard = function () {
  23092. if (this.obj3d) {
  23093. var e = this.obj3d.parent;
  23094. e && e.remove(this.obj3d);
  23095. }
  23096. this.obj3d = null;
  23097. }),
  23098. (n.prototype.draw = function () {
  23099. if ((this.discard(), o.showNeighbors)) {
  23100. var e = this.player.currentPano.floor;
  23101. this.obj3d = new r.Object3D();
  23102. var t = this.player.model.panos.getNeighbours(
  23103. this.player.currentPano
  23104. ),
  23105. i = this.player.currentPano.floorPosition
  23106. .clone()
  23107. .sub(this.player.model.position);
  23108. i.y += this.prefs.height;
  23109. var n = 0.1525,
  23110. a = 0.127,
  23111. s = 0.0127,
  23112. l = 0.1,
  23113. c = 0.19,
  23114. h = 0.2032,
  23115. u = 0.2286,
  23116. d = 0.255,
  23117. p = new r.Matrix4();
  23118. for (var f in t)
  23119. if (t[f]) {
  23120. var g = this.player.model.panos.get(f),
  23121. m =
  23122. (g.position.clone().sub(this.player.model.position),
  23123. g.position.clone().sub(g.floorPosition)),
  23124. v = g.floorPosition.clone().sub(this.player.model.position);
  23125. v.y += this.prefs.height;
  23126. var A = new r.Geometry();
  23127. A.vertices.push(
  23128. new r.Vector3(0, -s, 0),
  23129. new r.Vector3(-s, 0, 0),
  23130. new r.Vector3(0, s, 0),
  23131. new r.Vector3(s, 0, 0),
  23132. new r.Vector3(0, -s, 0)
  23133. ),
  23134. A.vertices.push(
  23135. new r.Vector3(0, -d, 0),
  23136. new r.Vector3(d, -d, 0),
  23137. new r.Vector3(d, n, 0),
  23138. new r.Vector3(-n, n, 0),
  23139. new r.Vector3(-n, a, 0),
  23140. new r.Vector3(-c, l, 0),
  23141. new r.Vector3(-c, -h, 0),
  23142. new r.Vector3(-n, -u, 0),
  23143. new r.Vector3(-n, -d, 0),
  23144. new r.Vector3(0, -d, 0)
  23145. ),
  23146. p.identity().setPosition(m),
  23147. A.applyMatrix(p),
  23148. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  23149. A.vertices.push(
  23150. new r.Vector3(
  23151. -this.prefs.endScale,
  23152. -this.prefs.endScale,
  23153. 0
  23154. ),
  23155. new r.Vector3(
  23156. -this.prefs.endScale,
  23157. this.prefs.endScale,
  23158. 0
  23159. ),
  23160. new r.Vector3(
  23161. this.prefs.endScale,
  23162. this.prefs.endScale,
  23163. 0
  23164. ),
  23165. new r.Vector3(
  23166. this.prefs.endScale,
  23167. -this.prefs.endScale,
  23168. 0
  23169. )
  23170. ),
  23171. p.lookAt(v, i, this.UP).setPosition(v),
  23172. A.applyMatrix(p),
  23173. A.vertices.push(v, i);
  23174. var y = new r.Line(
  23175. A,
  23176. new r.LineBasicMaterial({
  23177. color: g.debugColor.getHex(),
  23178. transparent: !0,
  23179. opacity: this.prefs.opacity,
  23180. depthWrite: !1,
  23181. name: "sLine" + f,
  23182. linewidth: this.prefs.linewidth,
  23183. })
  23184. );
  23185. this.obj3d.add(y);
  23186. }
  23187. e.add(this.obj3d);
  23188. }
  23189. }),
  23190. (n.prototype.update = function () {
  23191. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld();
  23192. }),
  23193. (t.exports = n);
  23194. },
  23195. {
  23196. "../settings": 166,
  23197. three: 217,
  23198. },
  23199. ],
  23200. 148: [
  23201. function (e, t, i) {
  23202. (function (i) {
  23203. "use strict";
  23204. function n(e, t, i, n) {
  23205. (this.model = e),
  23206. (this.id = t),
  23207. (this.alignmentType = i.alignmentType || l.ALIGNED),
  23208. (this.neighbourUUIDs = i.neighbours || null),
  23209. (this.neighbourPanos = null),
  23210. (this.floor = null),
  23211. (this.floorIndex = i.floor),
  23212. (this.failedLoadingAt = 0),
  23213. (this.maxLoadRetries = 4),
  23214. (this.origin = i.position.clone()),
  23215. (this.position =
  23216. this.alignmentType === l.UNALIGNED
  23217. ? new r.Vector3(0, -5, 0)
  23218. : i.position.clone()),
  23219. (this.quaternion = i.quaternion.clone()),
  23220. (this.skyboxMesh = new r.Mesh(E)),
  23221. this.skyboxMesh.position.copy(this.position),
  23222. this.skyboxMesh.quaternion.copy(this.quaternion),
  23223. (this.skyboxMesh.name = "skybox"),
  23224. (this.skyboxMesh.visible = !1),
  23225. this.skyboxMesh.updateMatrix(),
  23226. this.skyboxMesh.updateMatrixWorld(),
  23227. (this.marker = null),
  23228. (this.showFloorMarker = !window.DATA.hideFloorMarker);
  23229. if (this.isAligned()) {
  23230. (this.marker = new r.Mesh(
  23231. b,
  23232. new r.MeshBasicMaterial({
  23233. map: w,
  23234. side: r.DoubleSide,
  23235. opacity: 0,
  23236. transparent: !0,
  23237. depthWrite: !1,
  23238. })
  23239. )),
  23240. (this.marker.visible = false); //改:先不显示,之后根据opacity显示
  23241. (this.marker.renderOrder = s.panoMarker),
  23242. (this.marker.name = "marker"),
  23243. (this.marker.pano = this),
  23244. this.marker.layers.set(v.PANOMARKERS),
  23245. this.marker.updateMatrixWorld();
  23246. if (!window.DATA.hideFloorMarker) {
  23247. //xzw
  23248. let opa = this.marker.material.opacity;
  23249. Object.defineProperty(this.marker.material, "opacity", {
  23250. get: function () {
  23251. return opa;
  23252. },
  23253. set: (o) => {
  23254. opa = o;
  23255. convertTool.updateVisible(
  23256. this.marker,
  23257. "hideWhenZeroOpa",
  23258. o > 0
  23259. );
  23260. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  23261. //console.log(o,this.id,this.marker.visible)
  23262. },
  23263. });
  23264. }
  23265. a.colorMarkerOnLoad &&
  23266. this.on("load", function () {
  23267. this.marker.material.color.set(65280);
  23268. });
  23269. }
  23270. (this.debugColor = new r.Color().setHSL(
  23271. 0.06 + 0.53 * Math.random(),
  23272. 0.8 + 0.2 * Math.random(),
  23273. 0.5 + 0.2 * Math.random()
  23274. )),
  23275. (this.floorPosition = i.puck ? i.puck.clone() : null),
  23276. (this.tiled = n),
  23277. this.tiled
  23278. ? (this.solidSkybox = null)
  23279. : ((this.solidSkybox = new r.Texture([
  23280. null,
  23281. null,
  23282. null,
  23283. null,
  23284. null,
  23285. null,
  23286. ])),
  23287. (this.solidSkybox.flipY = !1),
  23288. a.minimalMemoryMode &&
  23289. ((this.solidSkybox.minFilter = r.LinearFilter),
  23290. (this.solidSkybox.magFilter = r.LinearFilter),
  23291. (this.solidSkybox.generateMipmaps = !1))),
  23292. (this.zoomed = !1),
  23293. (this.panoRenderer = null),
  23294. (this.qualityManager = null),
  23295. (this.tileDownloader = null),
  23296. (this.tiledPanoRenderTarget = null),
  23297. (this.minimumTiledPanoLoaded = !1),
  23298. (this.highestPartialTileRenderOpCompleted = 0),
  23299. (this.highestFullTileRenderOpCompleted = 0),
  23300. (this.shouldRedrawOnBaseLoaded = !1),
  23301. (this.lockUntilRenderingComplete = !1),
  23302. a.colorMarkerOnLoad &&
  23303. this.on("load", function () {
  23304. this.marker.material.color.set(65280);
  23305. });
  23306. /********************************************************************fyz改vr from徐世廷*************************************************************/
  23307. var e = new r.TextureLoader();
  23308. e.setCrossOrigin(!0);
  23309. var g = e.load("static/images/texture.jpg");
  23310. if (
  23311. ((this.vrMarker = new r.Mesh(
  23312. new r.OctahedronGeometry(0.1, 0),
  23313. new r.MeshLambertMaterial({
  23314. color: 16777215,
  23315. transparent: !0,
  23316. opacity: 0.75,
  23317. map: g,
  23318. })
  23319. )),
  23320. (this.vrMarker.boluoType = "vr"),
  23321. (this.vrMarker.position.z = 1),
  23322. (this.vrMarker.enabled = !0),
  23323. (this.vrMarker.visible = !1),
  23324. (window.vrMarkers = window.vrMarkers || []),
  23325. window.vrMarkers.push(this.vrMarker),
  23326. this.marker && this.marker.add(this.vrMarker),
  23327. a.showAxis &&
  23328. (this.skyboxMesh.add(
  23329. new r.ArrowHelper(
  23330. new r.Vector3(0, 1, 0),
  23331. new r.Vector3(0, 0, 0),
  23332. 1,
  23333. 255
  23334. )
  23335. ),
  23336. this.skyboxMesh.add(
  23337. new r.ArrowHelper(
  23338. new r.Vector3(0, 0, 1),
  23339. new r.Vector3(0, 0, 0),
  23340. 1,
  23341. 16711680
  23342. )
  23343. ),
  23344. this.skyboxMesh.add(
  23345. new r.ArrowHelper(
  23346. new r.Vector3(1, 0, 0),
  23347. new r.Vector3(0, 0, 0),
  23348. 1,
  23349. 65280
  23350. )
  23351. )),
  23352. this.adjustAngleEnable)
  23353. ) {
  23354. var i = new r.Quaternion();
  23355. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX),
  23356. this.skyboxMesh.quaternion.multiply(i);
  23357. var m = new r.Quaternion();
  23358. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY),
  23359. this.skyboxMesh.quaternion.multiply(m);
  23360. var n = new r.Quaternion();
  23361. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  23362. this.skyboxMesh.quaternion.multiply(n),
  23363. this.skyboxMesh.updateMatrix(),
  23364. this.skyboxMesh.updateMatrixWorld(),
  23365. this.model.updateProjectedPanos();
  23366. }
  23367. /**************************************************************************************************************************************/
  23368. }
  23369. var r = e("three"),
  23370. o = e("../util/logger"),
  23371. a = e("../settings"),
  23372. s = (e("../enum/Viewmode"), e("../enum/RenderOrder")),
  23373. l = e("../enum/AlignmentType"),
  23374. c = (e("../util/common"), e("../util/transitions")),
  23375. h = e("../util/lerp"),
  23376. u = e("../util/ajax"),
  23377. d = e("../util/texture"),
  23378. p = e("../util/panorama"),
  23379. f =
  23380. (e("../enum/TileDownloaderEvents"), e("../enum/PanoramaEvents")),
  23381. g = e("../enum/PanoRendererEvents"),
  23382. m = e("../enum/PanoSizeClass"),
  23383. v = e("../enum/RenderLayers"),
  23384. A =
  23385. (e("../scene/SceneRenderer"),
  23386. e("../enum/GLCubeFaces"),
  23387. e("../exception/BasicException")),
  23388. y = e("../tile/TileUtils"),
  23389. C = e("events").EventEmitter,
  23390. I = new o(i),
  23391. E = new r.SphereBufferGeometry(0.1),
  23392. b = new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  23393. w = d.load("static/images/marker-256x256.png");
  23394. w.anisotropy = browser.isMobile() ? 1 : 3; //add
  23395. (n.prototype = Object.create(C.prototype)),
  23396. (n.prototype.enter = (function () {
  23397. var e = null;
  23398. return function () {
  23399. this.setZoomed(!1),
  23400. this.emit("enter", {
  23401. oldPano: e,
  23402. newPano: this,
  23403. }),
  23404. (e = this);
  23405. this.model.setHighMap(this); //add
  23406. };
  23407. })()),
  23408. (n.prototype.exit = function () {
  23409. this.tiled
  23410. ? (this.clearWaitDeferreds(),
  23411. (this.minimumTiledPanoLoaded = !1),
  23412. (this.tiledPanoRenderTarget = null),
  23413. this.setZoomed(!1),
  23414. this.panoRenderer.deactivateTiledPano(this),
  23415. (this.highestPartialTileRenderOpCompleted = 0),
  23416. (this.highestFullTileRenderOpCompleted = 0))
  23417. : (this.solidSkybox.dispose(),
  23418. (this.solidSkybox.loaded = !1),
  23419. (this.solidSkybox.version = 0)),
  23420. this.emit("exit");
  23421. }),
  23422. (n.prototype.hoverOn = function (e) {
  23423. this.marker &&
  23424. (c.start(
  23425. h.property(
  23426. this.marker.material,
  23427. "opacity",
  23428. a[e].markerOpacityOnHover
  23429. ),
  23430. 250
  23431. ),
  23432. a.navigation.panoScores & a.navigation.mouseDirection &&
  23433. this.addTextSprite("HIT", 12525854));
  23434. }),
  23435. (n.prototype.hoverOff = function (e) {
  23436. this.marker &&
  23437. c.start(
  23438. h.property(
  23439. this.marker.material,
  23440. "opacity",
  23441. a[e].markerOpacity
  23442. ),
  23443. 250
  23444. );
  23445. }),
  23446. (n.prototype.build1 = function () {
  23447. (this.floor =
  23448. this.floor ||
  23449. this.model.floors.get(this.floorIndex) ||
  23450. (this.model.floors.list.length == 1
  23451. ? this.model.floors.list[0]
  23452. : this.raycastToFindFloor()) ||
  23453. this.model.getFloorAtPoint(this.position)),
  23454. this.floor.addPano(this),
  23455. (this.floorPosition =
  23456. this.floorPosition || this.raycastFloorPosition()),
  23457. (this.neighbourPanos =
  23458. this.neighbourPanos || this.findNeighourPanos()),
  23459. a.colorMarkerByFloor &&
  23460. this.marker &&
  23461. this.marker.material.color.set(this.floor.debugColor);
  23462. }),
  23463. (n.prototype.build2 = function () {
  23464. (this.floorPosition =
  23465. this.floorPosition || this.interpolateFloorPosition()),
  23466. (this.height = this.position.distanceTo(this.floorPosition)),
  23467. this.placeMarker();
  23468. }),
  23469. (n.prototype.interpolateFloorPosition = function () {
  23470. var e = this.model.panos
  23471. .filter(n.filters.isNeighbourPanoTo(this))
  23472. .filter(function (e) {
  23473. return !!e.floorPosition;
  23474. })
  23475. .sort(
  23476. function (e, t) {
  23477. return (
  23478. e.position.distanceTo(this.position) -
  23479. t.position.distanceTo(this.position)
  23480. );
  23481. }.bind(this)
  23482. ),
  23483. t = this.position.clone();
  23484. return (
  23485. e.length >= 2
  23486. ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2)
  23487. : t.add(a.noMeshFloorPositionOffset),
  23488. t
  23489. );
  23490. }),
  23491. (n.prototype.raycastFloorPosition = function () {
  23492. I.warn("Performance warning: Raycasting to find floor position");
  23493. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  23494. t = e.intersectObjects(this.model.colliders);
  23495. return t.length ? t[0].point : null;
  23496. }),
  23497. (n.prototype.raycastToFindFloor = (function () {
  23498. var e = [
  23499. new r.Vector3(0, -1, 0),
  23500. new r.Vector3(1, -1, 0),
  23501. new r.Vector3(0, -1, 1),
  23502. new r.Vector3(-1, -1, 0),
  23503. new r.Vector3(0, -1, -1),
  23504. new r.Vector3(1, 0, 0),
  23505. new r.Vector3(0, 0, 1),
  23506. new r.Vector3(-1, 0, 0),
  23507. new r.Vector3(0, 0, -1),
  23508. ];
  23509. return function () {
  23510. I.warn("Performance warning: Raycasting to find floor index");
  23511. for (var t = 0; t < e.length; t++) {
  23512. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  23513. n = i.intersectObjects(this.model.colliders);
  23514. if (n.length) return n[0].object.parent.parent;
  23515. }
  23516. return null;
  23517. };
  23518. })()),
  23519. (n.prototype.placeMarker = function () {
  23520. this.marker &&
  23521. (this.marker.position.copy(this.floorPosition),
  23522. (this.marker.position.y += 0.05),
  23523. this.marker.lookAt(
  23524. new r.Vector3(0, 1, 0).add(this.marker.position)
  23525. ));
  23526. }),
  23527. (n.prototype.translate = function (e) {
  23528. this.position.add(e), this.floorPosition.add(e);
  23529. }),
  23530. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  23531. new r.Vector3()
  23532. .addVectors(this.position, e.position)
  23533. .divideScalar(2);
  23534. return this.model.panos.find(
  23535. [n.filters.notIn([this, e])],
  23536. [n.sortFunctions.distanceToPoint(point)]
  23537. );
  23538. }),
  23539. (n.prototype.attachToPanoRenderer = function (e) {
  23540. (this.panoRenderer = e),
  23541. this.panoRenderer.on(
  23542. g.TileRenderSuccess,
  23543. this.onTileRendered.bind(this)
  23544. ),
  23545. this.panoRenderer.on(
  23546. g.PanoRenderComplete,
  23547. this.onPanoRendered.bind(this)
  23548. ),
  23549. this.panoRenderer.on(
  23550. g.TileRenderFailure,
  23551. this.onTileRenderFail.bind(this)
  23552. ),
  23553. this.panoRenderer.on(
  23554. g.UploadAttemptedForAllTiles,
  23555. this.onUploadAttemptedForAllTiles.bind(this)
  23556. );
  23557. });
  23558. var _ = {};
  23559. (n.prototype.getWaitDeferred = function (e) {
  23560. var t = _[this.id];
  23561. t || ((t = {}), (_[this.id] = t));
  23562. var i = t[e];
  23563. return (
  23564. i ||
  23565. ((i = {
  23566. deferred: $.Deferred(),
  23567. active: !1,
  23568. }),
  23569. (t[e] = i)),
  23570. i
  23571. );
  23572. }),
  23573. (n.prototype.resetWaitDeferred = function (e) {
  23574. var t = this.getWaitDeferred(e);
  23575. (t.active = !1), (t.deferred = $.Deferred());
  23576. }),
  23577. (n.prototype.clearWaitDeferreds = function () {
  23578. var e = _[this.id];
  23579. e || ((e = {}), (_[this.id] = e));
  23580. for (var t in e)
  23581. if (e.hasOwnProperty(t)) {
  23582. var i = e[t];
  23583. (i.active = !1), (i.deferred = $.Deferred());
  23584. }
  23585. }),
  23586. (n.prototype.loadTiledPano = (function () {
  23587. var e = (new r.Vector3(), []),
  23588. t = [];
  23589. return function (i, n, r, o, a, s) {
  23590. (null !== o && void 0 !== o) || (o = !0),
  23591. (null !== a && void 0 !== a) || (a = !0);
  23592. var l = this.getWaitDeferred(i),
  23593. c = l.deferred,
  23594. h = null,
  23595. u = null;
  23596. if (
  23597. (r &&
  23598. ("number" == typeof r
  23599. ? (h = r)
  23600. : ((h = r.hFov), (u = r.vFov))),
  23601. !this.isLoaded(i))
  23602. ) {
  23603. if (!l.active) {
  23604. if (((l.active = !0), r)) {
  23605. var d = y.matchingTilesInDirection(this, i, n, h, u);
  23606. (e[this.id + ":" + i] = {
  23607. tileCount: 0,
  23608. targetTileCount: d,
  23609. }),
  23610. I.info(
  23611. "Loading partial pano: " +
  23612. this.id +
  23613. " with " +
  23614. d +
  23615. " tiles"
  23616. );
  23617. }
  23618. t[this.id] ||
  23619. ((t[this.id] = !0),
  23620. this.on(
  23621. f.LoadComplete,
  23622. function (e, t) {
  23623. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  23624. var i = this.getWaitDeferred(e).deferred;
  23625. i &&
  23626. "pending" === i.state() &&
  23627. this.highestPartialTileRenderOpCompleted >= e &&
  23628. (i.resolve(e, t), this.resetWaitDeferred(e));
  23629. }.bind(this)
  23630. ),
  23631. this.on(
  23632. f.LoadFailed,
  23633. function (e) {
  23634. var t = this.getWaitDeferred(e).deferred;
  23635. t &&
  23636. "pending" === t.state() &&
  23637. this.highestPartialTileRenderOpCompleted >= e &&
  23638. (t.reject(e), this.resetWaitDeferred(e));
  23639. }.bind(this)
  23640. ),
  23641. this.on(
  23642. f.TileLoaded,
  23643. function (t, i, n) {
  23644. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  23645. var r = this.getWaitDeferred(t).deferred;
  23646. if (r && "pending" === r.state()) {
  23647. r.notify(t, i, n);
  23648. var o = e[this.id + ":" + t];
  23649. o &&
  23650. (o.tileCount++,
  23651. o.tileCount === o.targetTileCount &&
  23652. (this.onPanoRendered(this.id, t, n, !0),
  23653. r.resolve(t, n),
  23654. this.resetWaitDeferred(t)));
  23655. }
  23656. }.bind(this)
  23657. ));
  23658. }
  23659. this.tileDownloader.clearForceQueue(),
  23660. this.tileDownloader.forceQueueTilesForPano(
  23661. this,
  23662. i,
  23663. n,
  23664. h,
  23665. u,
  23666. s
  23667. ),
  23668. (this.tiledPanoRenderTarget =
  23669. this.panoRenderer.activateTiledPano(
  23670. this,
  23671. Math.min(2048, this.qualityManager.getMaxNavPanoSize()),
  23672. o
  23673. )), //不要超过2048否则漫游到下一个点时卡顿
  23674. this.panoRenderer.renderPanoTiles(this.id, n, a);
  23675. }
  23676. return c.promise();
  23677. };
  23678. })()),
  23679. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  23680. if (e === this.id) {
  23681. var n = this.qualityManager.getPanoSize(m.BASE);
  23682. t === n &&
  23683. this.shouldRedrawOnBaseLoaded &&
  23684. ((this.shouldRedrawOnBaseLoaded = !1),
  23685. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  23686. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0));
  23687. }
  23688. }),
  23689. (n.prototype.onTileRendered = function (e, t, i, n) {
  23690. e === this.id && this.emit(f.TileLoaded, t, i, n);
  23691. }),
  23692. (n.prototype.onPanoRendered = function (e, t, i, n) {
  23693. e === this.id &&
  23694. ((this.minimumTiledPanoLoaded = !0),
  23695. this.updateSkyboxForZoomLevel(),
  23696. t > this.highestPartialTileRenderOpCompleted &&
  23697. (this.highestPartialTileRenderOpCompleted = t),
  23698. !n &&
  23699. t > this.highestFullTileRenderOpCompleted &&
  23700. (this.highestFullTileRenderOpCompleted = t),
  23701. this.emit("load", t),
  23702. this.model.emit("load", this),
  23703. this.emit(f.LoadComplete, t, i));
  23704. }),
  23705. (n.prototype.setZoomed = function (e) {
  23706. (this.zoomed = e), this.updateSkyboxForZoomLevel();
  23707. if (e) {
  23708. //add
  23709. if (player.qualityManager.getNavZoomClass() != "1k") {
  23710. this.model.showHighMap();
  23711. }
  23712. } else {
  23713. this.model.hideHighMap();
  23714. }
  23715. }),
  23716. (n.prototype.ensureSkyboxReadyForRender = function () {
  23717. this.tiled ||
  23718. (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  23719. (this.solidSkybox.loaded = !0));
  23720. }),
  23721. (n.prototype.updateSkyboxForZoomLevel = function () {
  23722. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos();
  23723. }),
  23724. (n.prototype.getSkyboxTexture = function () {
  23725. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  23726. if (!this.tiled) {
  23727. return this.solidSkybox;
  23728. }
  23729. if (this.minimumTiledPanoLoaded) {
  23730. if (
  23731. this.zoomed &&
  23732. (this.qualityManager.maxRenderTargetSize >
  23733. this.qualityManager.maxNavPanoSize ||
  23734. player.qualityManager.getNavZoomClass() == "4k")
  23735. ) {
  23736. //change 如果放大后和不放大都是2k就不用这个
  23737. return this.panoRenderer.zoomRenderTarget.texture;
  23738. } else {
  23739. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping; //add
  23740. return this.tiledPanoRenderTarget.texture;
  23741. }
  23742. } else {
  23743. return null;
  23744. }
  23745. }),
  23746. (n.prototype.onTileRenderFail = function (e, t, i) {
  23747. e === this.id && this.emit(f.LoadFailed, t);
  23748. }),
  23749. (n.prototype.isLoaded = function (e) {
  23750. if (this.tiled) {
  23751. if (e && "string" == typeof e)
  23752. throw new A(
  23753. "Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass"
  23754. );
  23755. return (
  23756. !!this.minimumTiledPanoLoaded &&
  23757. (!e || this.highestPartialTileRenderOpCompleted >= e)
  23758. );
  23759. }
  23760. if (e && "number" == typeof e)
  23761. throw new A(
  23762. "Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low."
  23763. );
  23764. return !!this.solidSkybox.high || e in this.solidSkybox;
  23765. }),
  23766. (n.prototype.loadCube = function (e) {
  23767. if (this.isLoaded(e))
  23768. return (
  23769. I.info("Skipping load of pano, already loaded"), $.when()
  23770. );
  23771. this.emit("loading", e), this.model.emit("loading", this);
  23772. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  23773. i = t.filter(function (e) {
  23774. return !e;
  23775. });
  23776. "low" === e &&
  23777. i.length > 0 &&
  23778. (I.info(
  23779. "Pano",
  23780. this.id,
  23781. "not available in low res, loading high res right away"
  23782. ),
  23783. (e = "high"),
  23784. (t = p.getCubemapUrls(this.model.urls, this.id, e)));
  23785. var n = 0,
  23786. r = [0, 1, 2, 3, 4, 5].map(
  23787. function (e, i, n) {
  23788. return u.getImage(t[i]);
  23789. }.bind(this)
  23790. );
  23791. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  23792. function (t, i, n, r, o, a) {
  23793. return (
  23794. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  23795. ("high" !== e && this.solidSkybox.high) ||
  23796. ((this.solidSkybox.image = this.solidSkybox[e]),
  23797. (this.solidSkybox.low = null)),
  23798. (this.solidSkybox.needsUpdate = !0),
  23799. this.emit("load", e),
  23800. this.model.emit("load", this),
  23801. this
  23802. );
  23803. }.bind(this),
  23804. function () {
  23805. I.error("Downloading cubemap for pano", this.id, "failed"),
  23806. (this.failedLoadingAt = Date.now());
  23807. }.bind(this),
  23808. function () {
  23809. return $.when(++n, 6);
  23810. }
  23811. );
  23812. }),
  23813. (n.raycastsSkipped = 0),
  23814. (n.raycastsDone = 0),
  23815. (n.prototype.findNeighourPanos = function () {
  23816. return (
  23817. this.model.panos.setNeighbour(this.id, this.id, !1),
  23818. this.model.panos.forEach(
  23819. function (e) {
  23820. if (
  23821. e !== this &&
  23822. (!this.model.panos.neighbourMap[this.id] ||
  23823. void 0 === this.model.panos.neighbourMap[this.id][e.id])
  23824. ) {
  23825. var t = this.position.distanceTo(e.position);
  23826. if (t > a.panoramaNeighbourMaxDistance)
  23827. return (
  23828. this.model.panos.setNeighbour(this, e, !1),
  23829. void n.raycastsSkipped++
  23830. );
  23831. var i = e.position.clone().sub(this.position).normalize(),
  23832. o = new r.Raycaster(this.position, i.clone(), 0, t),
  23833. s = o.intersectObjects(this.model.colliders);
  23834. n.raycastsDone++,
  23835. this.model.panos.setNeighbour(this, e, 0 === s.length),
  23836. a.showNeighbourRaycasts &&
  23837. (s.length
  23838. ? this.floor.model.add(
  23839. new r.ArrowHelper(
  23840. i,
  23841. this.position,
  23842. s[0].distance,
  23843. 16711680
  23844. )
  23845. )
  23846. : this.floor.model.add(
  23847. new r.ArrowHelper(
  23848. i,
  23849. this.position,
  23850. t,
  23851. 16777215,
  23852. 0,
  23853. 0
  23854. )
  23855. ));
  23856. }
  23857. }.bind(this)
  23858. ),
  23859. this.model.panos.neighbourMap[this.id]
  23860. );
  23861. }),
  23862. (n.prototype.worldPosition = function () {
  23863. return this.position;
  23864. }),
  23865. (n.prototype.addTextSprite = function (e, t) {
  23866. this.removeTextSprite();
  23867. var i = document.createElement("canvas"),
  23868. n = i.getContext("2d");
  23869. (i.width = 256), (i.height = 256);
  23870. var o = "Arial",
  23871. a = 60;
  23872. (n.font = "bold " + a + "px " + o), (n.fillStyle = "white");
  23873. var s = n.measureText(e).width;
  23874. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  23875. var l = new r.Texture(i);
  23876. l.needsUpdate = !0;
  23877. var c = new r.SpriteMaterial({
  23878. map: l,
  23879. color: t || 16428055,
  23880. });
  23881. (this.text3d = new r.Sprite(c)),
  23882. this.text3d.position.copy(this.skyboxMesh.position),
  23883. this.floor.add(this.text3d);
  23884. }),
  23885. (n.prototype.removeTextSprite = function () {
  23886. this.text3d &&
  23887. (this.floor.remove(this.text3d), (this.text3d = null));
  23888. }),
  23889. (n.prototype.isAligned = function () {
  23890. return this.alignmentType === l.ALIGNED;
  23891. }),
  23892. (n.filters = {
  23893. inDirection: function (e, t, i) {
  23894. return function (n) {
  23895. var r = n.position.clone().sub(e).normalize();
  23896. return r.dot(t) > i;
  23897. };
  23898. },
  23899. inFloorDirection: function (e, t, i) {
  23900. return function (n) {
  23901. var r = n.floorPosition.clone().sub(e).normalize();
  23902. return r.dot(t) > i;
  23903. };
  23904. },
  23905. inPanoDirection: function (e, t, i) {
  23906. return (
  23907. (i = a.navigation.panoScores
  23908. ? a.navigation.filterStrictness
  23909. : i),
  23910. function (n) {
  23911. var r = n.floorPosition.clone().sub(e).normalize(),
  23912. o = n.position.clone().sub(e).normalize();
  23913. return r.dot(t) > i || o.dot(t) > i;
  23914. }
  23915. );
  23916. },
  23917. atFloor: function (e) {
  23918. return function (t) {
  23919. return !e || t.floor === e;
  23920. };
  23921. },
  23922. not: function (e) {
  23923. return function (t) {
  23924. return t !== e;
  23925. };
  23926. },
  23927. notIn: function (e) {
  23928. return function (t) {
  23929. return e.indexOf(t) === -1;
  23930. };
  23931. },
  23932. isLoaded: function () {
  23933. return function (e) {
  23934. return e.isLoaded();
  23935. };
  23936. },
  23937. isNotLoaded: function () {
  23938. return function (e) {
  23939. return !e.isLoaded();
  23940. };
  23941. },
  23942. isCloseEnoughTo: function (e, t) {
  23943. return function (i) {
  23944. return e.distanceTo(i.floorPosition) < t;
  23945. };
  23946. },
  23947. hasMinimumHeightDifferenceTo: function (e, t) {
  23948. return function (i) {
  23949. return Math.abs(i.position.y - e.y) > t;
  23950. };
  23951. },
  23952. isNotBehindNormal: function (e, t) {
  23953. var i = new r.Vector3();
  23954. return (
  23955. (t = t.clone()),
  23956. function (n) {
  23957. var r = i.copy(n.position).sub(e).normalize();
  23958. return r.dot(t) > 0;
  23959. }
  23960. );
  23961. },
  23962. isNeighbourPanoTo: function (e) {
  23963. return function (t) {
  23964. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id];
  23965. };
  23966. },
  23967. isNeighbourOfNeighbourTo: function (e) {
  23968. return function (t) {
  23969. return (
  23970. !!e.neighbourPanos[t.id] ||
  23971. e.neighbourUUIDs.some(function (i) {
  23972. var n = e.model.panos.get(i);
  23973. return !!n && n.neighbourPanos[t.id];
  23974. })
  23975. );
  23976. };
  23977. },
  23978. isNotRecentlyFailed: function (e) {
  23979. return function (t) {
  23980. return Date.now() - t.failedLoadingAt > e;
  23981. };
  23982. },
  23983. isOnVisibleFloor: function () {
  23984. return function (e) {
  23985. return !e.floor.hidden;
  23986. };
  23987. },
  23988. isPanoAligned: function () {
  23989. return function (e) {
  23990. return e.isAligned();
  23991. };
  23992. },
  23993. }),
  23994. (n.sortFunctions = {
  23995. distanceToPoint: function (e) {
  23996. return function (t, i) {
  23997. return t.position.distanceTo(e) - i.position.distanceTo(e);
  23998. };
  23999. },
  24000. floorDistanceToPoint: function (e) {
  24001. return function (t, i) {
  24002. return (
  24003. t.floorPosition.distanceTo(e) -
  24004. i.floorPosition.distanceTo(e)
  24005. );
  24006. };
  24007. },
  24008. choose: function (e) {
  24009. return function (t, i) {
  24010. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0;
  24011. };
  24012. },
  24013. }),
  24014. (n.scoreFunctions = {
  24015. distance: function (e, t) {
  24016. return (
  24017. (t = t || a.navigation.distanceFactor),
  24018. function (i) {
  24019. return e ? e.position.distanceTo(i.position) * t : 0;
  24020. }
  24021. );
  24022. },
  24023. distanceSquared: function (e, t) {
  24024. return (
  24025. (t = t || a.navigation.distanceFactor),
  24026. function (i) {
  24027. return e ? e.position.distanceToSquared(i.position) * t : 0;
  24028. }
  24029. );
  24030. },
  24031. direction: function (e, t) {
  24032. return function (i) {
  24033. var n = i.position.clone().sub(e).normalize();
  24034. return n.dot(t) * a.navigation.directionFactor;
  24035. };
  24036. },
  24037. angle: function (e, t) {
  24038. return function (i) {
  24039. var n = i.position.clone().sub(e).normalize();
  24040. return n.angleTo(t) * a.navigation.angleFactor;
  24041. };
  24042. },
  24043. inFieldOfView: function (e, t) {
  24044. return function (i) {
  24045. var n = i.position.clone().sub(e).normalize();
  24046. return n.dot(t) > 0.75 ? 10 : -1;
  24047. };
  24048. },
  24049. optionality: function (e) {
  24050. return function (t) {
  24051. var i = t.neighbourUUIDs.filter(function (t) {
  24052. return !(t in e.neighbourUUIDs) && t !== e.id;
  24053. });
  24054. return i.length * a.navigation.optionalityFactor;
  24055. };
  24056. },
  24057. penalizeHeightDifferenceUnder: function (e, t) {
  24058. return function (i) {
  24059. return e.y - i.position.y < t ? -20 : 0;
  24060. };
  24061. },
  24062. }),
  24063. (t.exports = n);
  24064. }).call(this, "/js/objects/Panorama.js");
  24065. },
  24066. {
  24067. "../enum/AlignmentType": 17,
  24068. "../enum/GLCubeFaces": 25,
  24069. "../enum/PanoRendererEvents": 35,
  24070. "../enum/PanoSizeClass": 36,
  24071. "../enum/PanoramaEvents": 37,
  24072. "../enum/RenderLayers": 41,
  24073. "../enum/RenderOrder": 42,
  24074. "../enum/TileDownloaderEvents": 45,
  24075. "../enum/Viewmode": 51,
  24076. "../exception/BasicException": 55,
  24077. "../scene/SceneRenderer": 158,
  24078. "../settings": 166,
  24079. "../tile/TileUtils": 174,
  24080. "../util/ajax": 181,
  24081. "../util/common": 185,
  24082. "../util/lerp": 188,
  24083. "../util/logger": 189,
  24084. "../util/panorama": 191,
  24085. "../util/texture": 194,
  24086. "../util/transitions": 195,
  24087. events: 202,
  24088. three: 217,
  24089. },
  24090. ],
  24091. 149: [
  24092. function (e, t, i) {
  24093. "use strict";
  24094. function n(e) {
  24095. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  24096. (t.map.value = d),
  24097. (t.opacity.value = 0),
  24098. t.color.value.set(o.reticuleColor),
  24099. (t.showMouseMarker = !window.DATA.hideMouseMarker);
  24100. r.Mesh.call(
  24101. this,
  24102. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  24103. new r.RawShaderMaterial({
  24104. side: r.DoubleSide,
  24105. depthWrite: !1,
  24106. depthTest: !1,
  24107. transparent: !0,
  24108. vertexShader: c.waypoint.vertexShader,
  24109. fragmentShader: c.waypoint.fragmentShader,
  24110. uniforms: t,
  24111. name: "waypoint",
  24112. opacity: 0,
  24113. visible: t.showMouseMarker, // 显示/隐藏鼠标标志
  24114. })
  24115. ),
  24116. this.layers.set(h.RETICULE),
  24117. (this.renderOrder = u.reticule),
  24118. (this.player = e),
  24119. (this.direction = new r.Vector3()),
  24120. (this.hidden = !0),
  24121. (this.mouseLastMoveTime = Date.now());
  24122. }
  24123. var r = e("three"),
  24124. o = e("../settings"),
  24125. a = e("../util/transitions"),
  24126. s = e("../util/texture"),
  24127. l = e("../util/lerp"),
  24128. c = e("../shaders"),
  24129. h = e("../enum/RenderLayers"),
  24130. u = e("../enum/RenderOrder"),
  24131. d = s.load("static/images/reticule-256x256.png");
  24132. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  24133. (n.prototype = Object.create(r.Mesh.prototype)),
  24134. (n.prototype.move = function (e, t, i) {
  24135. (this.hidden = i), (this.mouseLastMoveTime = Date.now());
  24136. }),
  24137. (n.prototype.hide = function () {
  24138. this.hidden ||
  24139. ((this.hidden = !0),
  24140. a.start(
  24141. l.property(this.material.uniforms.opacity, "value", 0),
  24142. o.reticuleOpacityTransitionTime
  24143. ));
  24144. }),
  24145. (n.prototype.show = function () {
  24146. (this.hidden = !1),
  24147. this.material.opacity <= 0 &&
  24148. a.start(
  24149. l.property(
  24150. this.material.uniforms.opacity,
  24151. "value",
  24152. o[this.player.mode].reticuleOpacity
  24153. ),
  24154. o.reticuleOpacityTransitionTime
  24155. );
  24156. }),
  24157. (n.prototype.update = function () {
  24158. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout &&
  24159. !this.hidden &&
  24160. this.hide();
  24161. }),
  24162. (n.prototype.updatePosition = function (e, t) {
  24163. if (!this.hidden) {
  24164. if (!t) return this.hide();
  24165. var i = t.point,
  24166. n = e.distanceTo(i),
  24167. r = 1 + 0.01 * n;
  24168. n < 1 && (r -= 1 - n),
  24169. this.show(),
  24170. this.scale.set(r, r, r),
  24171. (this.direction = this.direction.multiplyScalar(0.8)),
  24172. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  24173. this.position
  24174. .copy(i)
  24175. .add(t.face.normal.clone().multiplyScalar(0.01)),
  24176. this.lookAt(this.position.clone().add(this.direction));
  24177. }
  24178. }),
  24179. (n.prototype.writeAstag = function () {
  24180. var e =
  24181. Math.floor(4294967296 * (1 + Math.random())).toString(16) +
  24182. Math.floor(16 * (1 + Math.random())).toString(16),
  24183. t = new Date();
  24184. this.tagCount =
  24185. "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  24186. var i = {
  24187. enabled: !0,
  24188. version: "0",
  24189. created: t.toISOString(),
  24190. created_by: "APITest",
  24191. position: this.position.clone(),
  24192. stem: {
  24193. enabled: o.tags.pole.enabled,
  24194. direction: this.direction.multiplyScalar(o.tags.pole.height),
  24195. },
  24196. label: "tag " + this.tagCount,
  24197. description: "Description " + e,
  24198. floor: (function (e) {
  24199. if (e.currentFloor) {
  24200. var t = e.floors.indexOf(e.currentFloor);
  24201. return t > -1 ? t : void 0;
  24202. }
  24203. })(this.player.model),
  24204. type: "info",
  24205. metadata: {
  24206. preferred_camera: {
  24207. mode: this.player.mode,
  24208. },
  24209. },
  24210. };
  24211. console.log("--------------------------"),
  24212. console.log(JSON.stringify(i));
  24213. var n = this.player.model.addtag(e, i).build();
  24214. n &&
  24215. (n.disc && this.player.tagDiscs.push(n.disc),
  24216. n.visible || n.show(o.tags.startup.fadeInDuration));
  24217. }),
  24218. (t.exports = n);
  24219. },
  24220. {
  24221. "../enum/RenderLayers": 41,
  24222. "../enum/RenderOrder": 42,
  24223. "../settings": 166,
  24224. "../shaders": 167,
  24225. "../util/lerp": 188,
  24226. "../util/texture": 194,
  24227. "../util/transitions": 195,
  24228. three: 217,
  24229. },
  24230. ],
  24231. 150: [
  24232. function (e, t, i) {
  24233. "use strict";
  24234. function n(e, t) {
  24235. (this.chunks = []),
  24236. (this.floorId = e),
  24237. (this.roomId = t),
  24238. (this.position = new r.Vector3());
  24239. }
  24240. var r = e("three");
  24241. (n.prototype.addChunk = function (e) {
  24242. this.chunks.push(e);
  24243. }),
  24244. (n.prototype.calcBoundaries = function () {
  24245. for (
  24246. var e = new r.Vector3(),
  24247. t = new r.Vector3(0, 0, 0),
  24248. i = new r.Vector3(0, 0, 0),
  24249. n = new r.Vector3(0, 0, 0),
  24250. o = 0,
  24251. a = 0;
  24252. a < this.chunks.length;
  24253. a++
  24254. ) {
  24255. var s = this.chunks[a],
  24256. l = s.geometry.attributes.position;
  24257. if (l)
  24258. for (var c = 0; c < l.array.length; c += 3)
  24259. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  24260. t.add(e),
  24261. 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)),
  24262. o++;
  24263. }
  24264. o > 0
  24265. ? (t.multiplyScalar(1 / o), (this.average = t))
  24266. : (this.average = null),
  24267. (this.boundsMax = i),
  24268. (this.boundsMin = n),
  24269. (this.center = new r.Vector3()),
  24270. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n);
  24271. }),
  24272. (t.exports = n);
  24273. },
  24274. {
  24275. three: 217,
  24276. },
  24277. ],
  24278. 151: [
  24279. function (e, t, i) {
  24280. (function (i) {
  24281. "use strict";
  24282. function n(e, t, i) {
  24283. (this.obj3d = null),
  24284. (this.nodes = []),
  24285. (this.colorHull = []),
  24286. (this.shortPaths = {}),
  24287. (this.floorHull = null),
  24288. (this.cameraHull = null),
  24289. (this.floorPathDistance = 0),
  24290. (this.floorCurvePoints = null),
  24291. (this.floorCurveColors = null),
  24292. (this.camCurvePoints = null),
  24293. (this.warpDestHeroLoc = null),
  24294. (this.warpDestPano = null),
  24295. (this.warpPathPoints = null),
  24296. (this.warpPathLengths = [0]),
  24297. (this.warpLength = 0),
  24298. (this.closeWarpDistance = 4),
  24299. (this.UP = A.UP.clone()),
  24300. (this.longestStep = 0),
  24301. (this.upcomingTransType = null),
  24302. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  24303. (this.prevNextDist = 0),
  24304. (this.nextI = 0),
  24305. (this.activeTransType = null),
  24306. (this.lastTransType = null),
  24307. (this.bunnyObj = null),
  24308. (this.director = e),
  24309. (this.player = t),
  24310. (this.playerControls = i),
  24311. (this.modelManager = t.modelManager),
  24312. this.updateModel(),
  24313. this.updateDefaultsFromModelData(),
  24314. this.bindEvents(),
  24315. (this.warping = !1),
  24316. (this.waitingToWarp = !1),
  24317. (this.warpInterrupted = !1),
  24318. (this.warpInterruptionBlackoutStyle = null),
  24319. (this.warpInterruptionTravelTime = null);
  24320. }
  24321. var r = e("three"),
  24322. o = e("../util/logger"),
  24323. a = e("../enum/Viewmode"),
  24324. s = e("../enum/RenderOrder"),
  24325. l = e("../enum/WarpStyle"),
  24326. c = e("../settings"),
  24327. h = e("../util/math"),
  24328. u = e("../util/lerp"),
  24329. d = e("../util/easing"),
  24330. p = e("../util/transitions"),
  24331. f = e("../objects/Snapshot"),
  24332. g = e("../effects"),
  24333. m = e("../shaders"),
  24334. v = (e("../gui/gui"), e("../util/texture")),
  24335. A = e("../enum/Vectors"),
  24336. y = (e("../model/ModelManager"), new o(i)),
  24337. C = e("../enum/PlayerEvents"),
  24338. I = e("../enum/BlackoutStyle"),
  24339. E = e("../enum/ModelManagerEvents"),
  24340. b = e("../constants"),
  24341. w = {
  24342. path: v.loadBase64(
  24343. "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"
  24344. ),
  24345. pathEnd: v.load("static/images/End.png"),
  24346. pathStart: v.loadBase64(
  24347. "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg=="
  24348. ),
  24349. };
  24350. (n.prototype.setScene = function (e) {
  24351. this.createCpm(e), this.createBunnyObj(e);
  24352. }),
  24353. (n.prototype.updateModel = function () {
  24354. this.model = this.modelManager.getActiveModel();
  24355. }),
  24356. (n.prototype.bindEvents = function () {
  24357. this.modelManager.on(
  24358. E.ActiveModelChanged,
  24359. this.updateModel.bind(this)
  24360. );
  24361. }),
  24362. (n.prototype.updateDefaultsFromModelData = function () {
  24363. this.model.data;
  24364. }),
  24365. (n.prototype.pointPathDistance = function (e) {
  24366. for (var t = 0, i = 1; i < e.length; i += 1)
  24367. t += e[i - 1].distanceTo(e[i]);
  24368. return t;
  24369. }),
  24370. (n.prototype.pointPathLengths = function (e) {
  24371. for (var t = [0], i = 1; i < e.length; i += 1)
  24372. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  24373. return t;
  24374. }),
  24375. (n.prototype.interpAlongPath = function (e, t, i) {
  24376. var n,
  24377. o = new r.Vector3(),
  24378. a = t[t.length - 1];
  24379. if (i < 1) {
  24380. n = i * a;
  24381. for (var s = 1; s < t.length; s += 1)
  24382. if (t[s] > n) {
  24383. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  24384. return (
  24385. o.copy(e[s]),
  24386. o.sub(e[s - 1]),
  24387. o.multiplyScalar(l),
  24388. o.add(e[s - 1]),
  24389. o
  24390. );
  24391. }
  24392. } else o.copy(e[e.length - 1]);
  24393. return o;
  24394. }),
  24395. (n.prototype.pathHeight = function () {
  24396. return this.player.mode !== a.FLOORPLAN
  24397. ? c.path.height
  24398. : c.path.outsideHeight;
  24399. }),
  24400. (n.prototype.createBunnyObj = function (e) {
  24401. this.bunnyObj ||
  24402. ((this.bunnyObj = new r.AxisHelper(0.1)),
  24403. (this.bunnyObj.visible = c.warp.showBunny)),
  24404. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  24405. e.add(this.bunnyObj);
  24406. }),
  24407. (n.prototype.createCpm = function (e) {
  24408. if (!this.currentPanoMarker) {
  24409. var t = this.makeWaypointObj(w.pathEnd, "Current");
  24410. (t.material.uniforms.opacity.value = 0),
  24411. (this.currentPanoMarker = {
  24412. mesh: t,
  24413. placed: !1,
  24414. });
  24415. }
  24416. this.currentPanoMarker.mesh.parent &&
  24417. this.currentPanoMarker.mesh.parent.remove(
  24418. this.currentPanoMarker.mesh
  24419. ),
  24420. this.placeCpm(),
  24421. this.currentPanoMarker.mesh.parent ||
  24422. e.add(this.currentPanoMarker.mesh);
  24423. }),
  24424. (n.prototype.placeCpm = function () {
  24425. if (
  24426. c.path.mapGuides &&
  24427. this.player.currentPano &&
  24428. this.player.currentPano.isAligned()
  24429. ) {
  24430. var e = this.player.currentPano.floor;
  24431. this.currentPanoMarker.mesh.parent !==
  24432. this.player.currentPano.floor &&
  24433. (this.currentPanoMarker.mesh.parent &&
  24434. this.currentPanoMarker.mesh.parent.remove(
  24435. this.currentPanoMarker.mesh
  24436. ),
  24437. e.add(this.currentPanoMarker.mesh)),
  24438. this.currentPanoMarker.mesh.position
  24439. .copy(this.player.currentPano.floorPosition)
  24440. .sub(e.position),
  24441. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  24442. (this.currentPanoMarker.placed = !0);
  24443. } else this.popOutCpm();
  24444. }),
  24445. (n.prototype.fadeInCpm = function (e) {
  24446. (this.player.mode === a.PANORAMA &&
  24447. this.player.currentPano &&
  24448. !this.player.currentPano.isAligned()) ||
  24449. (c.path.mapGuides &&
  24450. this.currentPanoMarker.placed &&
  24451. p.start(
  24452. u.property(
  24453. this.currentPanoMarker.mesh.material.uniforms.opacity,
  24454. "value",
  24455. 1
  24456. ),
  24457. e
  24458. ));
  24459. }),
  24460. (n.prototype.fadeOutCpm = function (e) {
  24461. p.start(
  24462. u.property(
  24463. this.currentPanoMarker.mesh.material.uniforms.opacity,
  24464. "value",
  24465. 0
  24466. ),
  24467. e
  24468. );
  24469. }),
  24470. (n.prototype.popInCpm = function () {
  24471. c.path.mapGuides &&
  24472. this.currentPanoMarker.placed &&
  24473. this.fadeInCpm(2);
  24474. }),
  24475. (n.prototype.popOutCpm = function () {
  24476. this.fadeOutCpm(2);
  24477. }),
  24478. (n.prototype.brushPrefs = {
  24479. linewidth: 7,
  24480. strokeWidth: 15,
  24481. cvSegments: 48,
  24482. paveStep: 0.1,
  24483. paveWidth: 0.2,
  24484. lookBlendDist: 3,
  24485. maxTurn: r.Math.degToRad(2),
  24486. }),
  24487. (n.prototype.panoPathDistance = function (e) {
  24488. var t = this.model.panos;
  24489. if (!e || e.length < 2) return 0;
  24490. for (var i = [], n = 0; n < e.length; n += 1)
  24491. i.push(t.get(e[n]).floorPosition);
  24492. return this.pointPathDistance(i);
  24493. }),
  24494. (n.prototype.loadTileTexture = function (e) {
  24495. var t = v.load(
  24496. e,
  24497. function (t) {
  24498. (t.wrapS = r.RepeatWrapping),
  24499. (t.wrapT = r.RepeatWrapping),
  24500. (t.needsUpdate = !0),
  24501. y.debug('path texture "' + e + '" is ready');
  24502. },
  24503. function () {
  24504. y.error('path texture "' + e + '" failed');
  24505. }
  24506. );
  24507. return (t.mapping = r.UVMapping), t;
  24508. }),
  24509. (n.prototype.buildWarpDestinationDescriptor = function (
  24510. e,
  24511. t,
  24512. i,
  24513. n,
  24514. r,
  24515. o
  24516. ) {
  24517. var a = {
  24518. cameraMode: n,
  24519. position: e,
  24520. quaternion: t,
  24521. panoId: i,
  24522. orthoZoom: o,
  24523. floorVisibility: r,
  24524. thumbUrl: null,
  24525. name: null,
  24526. };
  24527. return new f(a);
  24528. }),
  24529. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  24530. return this.buildWarpDestinationDescriptor(
  24531. e.position,
  24532. e.quaternion,
  24533. this.getHeroId(e),
  24534. e.cameraMode,
  24535. e.floorVisibility,
  24536. e.orthoZoom
  24537. );
  24538. }),
  24539. (n.prototype.setWarpDestination = function (e) {
  24540. this.warpDestHeroLoc = e;
  24541. }),
  24542. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  24543. var t = this.getHeroDescriptorByHeroIndex(e);
  24544. return null !== t && (this.setWarpDestination(t), !0);
  24545. }),
  24546. (n.prototype.setWarpDestinationByPano = function (e, t) {
  24547. var i = this.model.panos.get(e.id);
  24548. return !!i && this.setWarpDestinationByPanoId(e.id, t);
  24549. }),
  24550. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  24551. var i = this.model.panos.get(e);
  24552. if (i) {
  24553. t = t || new r.Quaternion();
  24554. var n = this.buildWarpDestinationDescriptor(
  24555. i.position,
  24556. t,
  24557. i.id,
  24558. "panorama",
  24559. [],
  24560. -1
  24561. );
  24562. return this.setWarpDestination(n), !0;
  24563. }
  24564. return !1;
  24565. }),
  24566. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  24567. var t = this.model.heroCount();
  24568. /* if (null !== this.warpDestHeroLoc && t < 2)
  24569. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  24570. this.model.getHeroDescriptorByIndex(0); */
  24571. var i = this.model.getHeroDescriptorByIndex(e);
  24572. if (i) {
  24573. var n = i.isPano() ? i.panoId : i.cameraMode;
  24574. y.debug(
  24575. 'ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' +
  24576. n +
  24577. '" out of ' +
  24578. t +
  24579. " choices."
  24580. );
  24581. }
  24582. return i;
  24583. }),
  24584. (n.prototype.getHeroDescriptorByPano = function (e) {
  24585. var t = this.model.panos.get(e.id);
  24586. return t ? this.getHeroDescriptorByPanoId(e.id) : null;
  24587. }),
  24588. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  24589. var t = this.getHeroIndexFromPanoId(e);
  24590. return this.getHeroDescriptorByHeroIndex(t);
  24591. }),
  24592. (n.prototype.getHeroIndexFromPanoId = function (e) {
  24593. for (var t = 0; t < this.model.heroLocations.length; t++) {
  24594. var i = this.model.heroLocations[t],
  24595. n = this.getHeroId(i);
  24596. if (n && n === e) return t;
  24597. }
  24598. return -1;
  24599. }),
  24600. (n.prototype.getHeroPano = function (e) {
  24601. if (null === e)
  24602. return y.warn("getHeroPano(): no destination"), null;
  24603. var t = this.getHeroId(e),
  24604. i = this.model.panos.get(t);
  24605. return (
  24606. void 0 === i &&
  24607. ((i = null),
  24608. "" !== t && y.debug('unable to find pano "' + t + '"')),
  24609. i
  24610. );
  24611. }),
  24612. (n.prototype.getHeroId = function (e) {
  24613. return e.panoId;
  24614. }),
  24615. (n.prototype.setWarpDestPano = function () {
  24616. return (
  24617. (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)),
  24618. this.warpDestPano
  24619. );
  24620. }),
  24621. (n.prototype.brushToWarpPano = function (e, t) {
  24622. if ((this.discardPathObject(), !this.setWarpDestPano()))
  24623. return !1;
  24624. if (
  24625. (this.warpDestHeroLoc.cameraMode !== a.PANORAMA &&
  24626. y.warn("Can only brush from pano to pano"),
  24627. !this.warpDestPano)
  24628. )
  24629. return y.info("No brush"), !1;
  24630. if (!this.player.currentPano)
  24631. return y.debug("No current pano, visibility undefined"), !1;
  24632. if (!this.warpDestPano)
  24633. return y.info("No wPano, visibility undefined"), !1;
  24634. if (!this.warpDestPano.isAligned())
  24635. return y.debug("Cannot brush to unaligned pano"), !1;
  24636. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  24637. n = !0;
  24638. if (this.player.currentPano.id === this.warpDestPano.id)
  24639. y.debug("Already at destination pano");
  24640. else {
  24641. (this.nodes = this.findShortestPath(
  24642. this.player.currentPano,
  24643. this.warpDestPano
  24644. )),
  24645. (n =
  24646. void 0 === this.nodes ||
  24647. null === this.nodes ||
  24648. this.nodes.length < 1),
  24649. (this.obj3d = new r.Object3D()),
  24650. y.debug(
  24651. 'Brushing from "' +
  24652. this.player.currentPano.id +
  24653. '" to "' +
  24654. this.warpDestPano.id +
  24655. '" (' +
  24656. (this.nodes ? this.nodes.length : 0) +
  24657. ")"
  24658. ),
  24659. n
  24660. ? (y.info(
  24661. 'No "walkable" route, using fall-back warp style transition'
  24662. ),
  24663. (e = t))
  24664. : (this.setPathHulls(this.nodes),
  24665. this.setFloorCurves(),
  24666. i &&
  24667. ("chevron" === c.path.style
  24668. ? this.obj3d.add(
  24669. this.drawPathPavement(this.floorCurvePoints)
  24670. )
  24671. : "ribbon" === c.path.style &&
  24672. this.obj3d.add(
  24673. this.drawPathRibbon(
  24674. this.floorCurvePoints,
  24675. this.floorCurveColors
  24676. )
  24677. ))),
  24678. this.player.currentPano.floor.add(this.obj3d);
  24679. var o =
  24680. this.player.mode === a.DOLLHOUSE ||
  24681. this.player.mode === a.FLOORPLAN,
  24682. s = e === l.STD;
  24683. if (!n && (i || s)) {
  24684. if (o) {
  24685. var h = this.makeStartMarker(
  24686. this.floorHull[0],
  24687. this.floorCurvePoints
  24688. );
  24689. this.obj3d.add(h);
  24690. }
  24691. var u = this.makeEndMarker(
  24692. this.floorHull[this.floorHull.length - 1]
  24693. );
  24694. this.obj3d.add(u);
  24695. }
  24696. this.appearSlow();
  24697. }
  24698. return (this.upcomingTransType = e), !n;
  24699. }),
  24700. (n.prototype.findShortestPath = function (e, t) {
  24701. if (!e || !t) return null;
  24702. var i = c.warp.walkExtraPanosDistance,
  24703. n = e.id + ":" + t.id + ":" + i;
  24704. if (this.shortPaths.hasOwnProperty(n))
  24705. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  24706. var r = t.id + ":" + e.id + ":" + i;
  24707. if (this.shortPaths.hasOwnProperty(r))
  24708. return this.shortPaths[r]
  24709. ? this.shortPaths[r].slice().reverse()
  24710. : null;
  24711. var o = this.model.panos.aStarSearch(e, t);
  24712. return (
  24713. this.model.panos.includeNodesNearPath(o, i),
  24714. (this.shortPaths[n] = o ? o.slice() : null),
  24715. o
  24716. );
  24717. }),
  24718. (n.prototype.makePathHulls = function (e) {
  24719. var t,
  24720. i,
  24721. n,
  24722. r,
  24723. o,
  24724. a = 0,
  24725. s = [],
  24726. l = [],
  24727. h = [],
  24728. u = this.model.panos;
  24729. (t = u.get(e[0])), (r = t.floor.floorIndex);
  24730. for (var d = 0; d < e.length; d += 1)
  24731. (t = u.get(e[d])),
  24732. (i = t.floorPosition.clone().sub(this.model.position)),
  24733. (i.y += this.pathHeight()),
  24734. s.push(i),
  24735. l.push(t.position.clone()),
  24736. (n = t.floor.floorIndex),
  24737. h.push(
  24738. n > r
  24739. ? c.path.colorUp
  24740. : n < r
  24741. ? c.path.colorDown
  24742. : c.path.color
  24743. ),
  24744. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o));
  24745. return (
  24746. a > this.longestStep &&
  24747. ((this.longestStep = a),
  24748. y.debug("path contains " + a + " meter segment")),
  24749. {
  24750. floor: s,
  24751. camera: l,
  24752. color: h,
  24753. }
  24754. );
  24755. }),
  24756. (n.prototype.makeFloorCurves = function (e, t, i) {
  24757. var n =
  24758. this.player.mode === a.PANORAMA
  24759. ? c.path.waypointIndoorRadius
  24760. : c.path.waypointRadius,
  24761. o = this.pointPathDistance(e) - 2 * n,
  24762. s = e.slice(0),
  24763. l = s[1].clone().sub(s[0]);
  24764. (l.y = 0),
  24765. l.normalize().multiplyScalar(n),
  24766. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  24767. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  24768. (l.y = 0),
  24769. l.normalize().multiplyScalar(n),
  24770. (s[s.length - 1] = new r.Vector3()
  24771. .copy(s[s.length - 1])
  24772. .add(l));
  24773. var h = new r.CatmullRomCurve3(s),
  24774. u = Math.floor(o / i);
  24775. (u = 4 * Math.floor(u / 4)), (u = Math.max(4, u));
  24776. for (
  24777. var d,
  24778. p,
  24779. f,
  24780. g = h.getSpacedPoints(u),
  24781. m = [],
  24782. v = new r.Vector3(),
  24783. A = 0;
  24784. A < g.length;
  24785. A += 1
  24786. ) {
  24787. (f = 0), (d = g[A].distanceTo(e[0]));
  24788. for (var y = 1; y < e.length; y += 1)
  24789. v.copy(g[A]).sub(e[y]),
  24790. (v.y *= 4),
  24791. (p = v.length()),
  24792. p < d && (f = y);
  24793. m.push(t[f]);
  24794. }
  24795. return {
  24796. distance: o,
  24797. points: g,
  24798. colors: m,
  24799. };
  24800. }),
  24801. (n.prototype.makeCameraCurvePoints = function (e, t) {
  24802. var i = this.pointPathDistance(e),
  24803. n = new r.CatmullRomCurve3(e);
  24804. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)));
  24805. }),
  24806. (n.prototype.makeCameraCurveTangents = function (e, t) {
  24807. var i = this.pointPathDistance(e),
  24808. n = new r.CatmullRomCurve3(e),
  24809. o = Math.max(2, Math.floor(i / t));
  24810. o || (o = 5);
  24811. for (var a = [], s = 0; s <= o; s++)
  24812. a.push(n.getTangentAt(s / o));
  24813. return a;
  24814. }),
  24815. (n.prototype.setPathHulls = function (e) {
  24816. var t = this.makePathHulls(e);
  24817. (this.floorHull = t.floor),
  24818. (this.cameraHull = t.camera),
  24819. (this.colorHull = t.color);
  24820. }),
  24821. (n.prototype.setFloorCurves = function () {
  24822. var e = this.makeFloorCurves(
  24823. this.floorHull,
  24824. this.colorHull,
  24825. this.brushPrefs.paveStep
  24826. );
  24827. (this.floorPathDistance = e.distance),
  24828. (this.floorCurvePoints = e.points),
  24829. (this.floorCurveColors = e.colors);
  24830. }),
  24831. (n.prototype.setCameraCurvePoints = function () {
  24832. this.camCurvePoints = this.makeCameraCurvePoints(
  24833. this.cameraHull,
  24834. c.warp.stepFactor * this.brushPrefs.paveStep
  24835. );
  24836. }),
  24837. (n.prototype.chooseWarpPath = function (e) {
  24838. var t,
  24839. i,
  24840. n,
  24841. o = this.playerControls.cameras[a.PANORAMA];
  24842. if (this.player.currentPano === this.warpDestPano || !e)
  24843. return (this.warpPathPoints = null), (this.warpLength = 0), !1;
  24844. (this.nodes = this.findShortestPath(
  24845. this.player.currentPano,
  24846. this.warpDestPano
  24847. )),
  24848. void 0 === this.nodes ||
  24849. null === this.nodes ||
  24850. this.nodes.length < 1
  24851. ? (y.debug("warp path to unreachable node"),
  24852. (t = this.warpDestPano.position.clone().sub(o.position)),
  24853. (i = t.clone().negate()),
  24854. t.multiplyScalar(0.15).add(o.position),
  24855. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  24856. (t.y = o.position.y),
  24857. (i.y = this.warpDestPano.position.y),
  24858. (n = new r.CubicBezierCurve3(
  24859. o.position.clone(),
  24860. t,
  24861. i,
  24862. this.warpDestPano.position.clone()
  24863. )),
  24864. (this.warpPathPoints = n.getSpacedPoints(
  24865. this.brushPrefs.cvSegments
  24866. )))
  24867. : (y.debug(
  24868. "follow warp path (path distance was " +
  24869. this.nodes.length +
  24870. " nodes, " +
  24871. this.floorPathDistance +
  24872. ")"
  24873. ),
  24874. this.setCameraCurvePoints(),
  24875. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  24876. (this.warpLength = 0),
  24877. (this.warpPathLengths = [0]);
  24878. for (
  24879. var s = new r.Vector3(),
  24880. l = new r.Vector3(),
  24881. h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  24882. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)),
  24883. d = 1;
  24884. d < this.warpPathPoints.length;
  24885. d += 1
  24886. ) {
  24887. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  24888. var p = s.length();
  24889. s.y *= c.warp.climbEffort;
  24890. var f = s.length() / p;
  24891. if (d > 1) {
  24892. s.setY(0).normalize(),
  24893. l
  24894. .copy(this.warpPathPoints[d - 2])
  24895. .sub(this.warpPathPoints[d - 1])
  24896. .setY(0)
  24897. .normalize();
  24898. var g = Math.min(1, s.dot(l)),
  24899. m =
  24900. 1 +
  24901. (c.warp.brakeStrength - 1) *
  24902. (1 - r.Math.smoothstep(g, u, h));
  24903. f = Math.max(m, f);
  24904. }
  24905. (this.warpLength += p * f),
  24906. (this.warpPathLengths[d] = this.warpLength);
  24907. }
  24908. return !0;
  24909. }),
  24910. (n.prototype.drawPathRibbon = function (e, t) {
  24911. this.bunnyObj.visible = c.warp.showBunny;
  24912. for (
  24913. var i = 0.6 * c.path.ribbonWidth * 0.5,
  24914. n = new r.Vector3(),
  24915. o = new r.Vector3(0, this.pathHeight(), 0),
  24916. l = new r.Geometry(),
  24917. h = new r.Vector3(),
  24918. u = 0;
  24919. u < e.length;
  24920. u += 1
  24921. ) {
  24922. h.copy(e[u]),
  24923. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  24924. h.normalize(),
  24925. n.crossVectors(h, A.UP),
  24926. n.multiplyScalar(i);
  24927. var d = new r.Vector3().copy(e[u]).add(o);
  24928. d.sub(n),
  24929. l.vertices.push(d),
  24930. (d = new r.Vector3().copy(e[u]).add(o)),
  24931. d.add(n),
  24932. l.vertices.push(d);
  24933. }
  24934. var p,
  24935. f = 0;
  24936. for (u = 0; u < e.length - 1; u += 1) {
  24937. var g = 2 * u,
  24938. v = f;
  24939. f += e[u + 1].distanceTo(e[u]);
  24940. var y = f,
  24941. C = t[u],
  24942. I = t[u + 1];
  24943. (p = new r.Face3(g, g + 1, g + 2)),
  24944. (p.vertexColors = [
  24945. new r.Color(C),
  24946. new r.Color(C),
  24947. new r.Color(I),
  24948. ]),
  24949. l.faces.push(p),
  24950. l.faceVertexUvs[0].push([
  24951. new r.Vector2(0, v),
  24952. new r.Vector2(1, v),
  24953. new r.Vector2(0, y),
  24954. ]),
  24955. (p = new r.Face3(g + 2, g + 1, g + 3)),
  24956. (p.vertexColors = [
  24957. new r.Color(I),
  24958. new r.Color(C),
  24959. new r.Color(I),
  24960. ]),
  24961. l.faces.push(p),
  24962. l.faceVertexUvs[0].push([
  24963. new r.Vector2(0, y),
  24964. new r.Vector2(1, v),
  24965. new r.Vector2(1, y),
  24966. ]);
  24967. }
  24968. l.computeFaceNormals(), l.computeVertexNormals();
  24969. var E, b;
  24970. this.player.mode === a.PANORAMA
  24971. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  24972. (b.map.value = w.path),
  24973. (b.opacity.value = 0),
  24974. b.color.value.set(c.path.color),
  24975. (E = new r.RawShaderMaterial({
  24976. side: r.DoubleSide,
  24977. depthWrite: !1,
  24978. transparent: !0,
  24979. vertexShader: m.ribbon.vertexShader,
  24980. fragmentShader: m.ribbon.fragmentShader,
  24981. uniforms: b,
  24982. name: "ribbonT",
  24983. opacity: 0,
  24984. })))
  24985. : (E = new r.MeshBasicMaterial({
  24986. color: 16777215,
  24987. side: r.DoubleSide,
  24988. name: "ribbonOut",
  24989. vertexColors: r.VertexColors,
  24990. }));
  24991. var _ = new r.Mesh(l, E);
  24992. return (
  24993. (_.name = "ribbon"),
  24994. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  24995. _
  24996. );
  24997. }),
  24998. (n.prototype.drawPathPavement = function (e) {
  24999. for (
  25000. var t,
  25001. i = 0.25,
  25002. n = new r.Vector3(),
  25003. o = new r.Geometry(),
  25004. s = new r.Vector3(),
  25005. l = 0;
  25006. l < e.length;
  25007. l += 1
  25008. )
  25009. s.copy(e[l]),
  25010. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  25011. s.normalize(),
  25012. n.crossVectors(s, A.UP),
  25013. n.multiplyScalar(this.brushPrefs.paveWidth),
  25014. (t = new r.Vector3().copy(e[l])),
  25015. t.sub(n),
  25016. o.vertices.push(t),
  25017. o.vertices.push(new r.Vector3().copy(e[l])),
  25018. (t = new r.Vector3().copy(e[l])),
  25019. t.add(n),
  25020. o.vertices.push(t);
  25021. var h, u, d;
  25022. for (l = 0; l < e.length - 1; l += 1)
  25023. (h = 3 * l + 1),
  25024. (u = l * i),
  25025. (d = u + i),
  25026. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  25027. o.faceVertexUvs[0].push([
  25028. new r.Vector2(0, u),
  25029. new r.Vector2(0.5, u),
  25030. new r.Vector2(0.5, d),
  25031. ]),
  25032. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  25033. o.faceVertexUvs[0].push([
  25034. new r.Vector2(0.5, d),
  25035. new r.Vector2(0, d),
  25036. new r.Vector2(0, u),
  25037. ]),
  25038. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  25039. o.faceVertexUvs[0].push([
  25040. new r.Vector2(0.5, d),
  25041. new r.Vector2(0.5, u),
  25042. new r.Vector2(1, u),
  25043. ]),
  25044. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  25045. o.faceVertexUvs[0].push([
  25046. new r.Vector2(0.5, d),
  25047. new r.Vector2(1, u),
  25048. new r.Vector2(1, d),
  25049. ]);
  25050. var p =
  25051. this.player.mode === a.PANORAMA
  25052. ? new r.MeshBasicMaterial({
  25053. color: c.path.color,
  25054. side: r.DoubleSide,
  25055. transparent: !0,
  25056. depthWrite: !1,
  25057. opacity: 0,
  25058. name: "paveT",
  25059. map: w.path,
  25060. })
  25061. : new r.MeshBasicMaterial({
  25062. color: c.path.color,
  25063. side: r.DoubleSide,
  25064. transparent: !0,
  25065. depthWrite: !1,
  25066. opacity: 1,
  25067. name: "paveO",
  25068. map: w.path,
  25069. });
  25070. return new r.Mesh(o, p);
  25071. }),
  25072. (n.prototype.hintPrefs = {
  25073. rad: 0.18,
  25074. width: 0.0125,
  25075. depth: 0.0625,
  25076. setBack: -0.04,
  25077. markRad: 0.25,
  25078. markInnerRad: 0.16,
  25079. }),
  25080. (n.prototype.makeWaypointObj = function (e, t) {
  25081. var i = new r.Geometry(),
  25082. n =
  25083. this.player.mode === a.PANORAMA
  25084. ? c.path.waypointIndoorRadius
  25085. : c.path.waypointRadius,
  25086. o = this.pathHeight();
  25087. i.vertices.push(
  25088. new r.Vector3(-n, o, n),
  25089. new r.Vector3(-n, o, -n),
  25090. new r.Vector3(n, o, -n),
  25091. new r.Vector3(n, o, n)
  25092. ),
  25093. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  25094. i.faceVertexUvs[0].push([
  25095. new r.Vector2(0, 0),
  25096. new r.Vector2(1, 0),
  25097. new r.Vector2(1, 1),
  25098. ]),
  25099. i.faceVertexUvs[0].push([
  25100. new r.Vector2(1, 1),
  25101. new r.Vector2(0, 1),
  25102. new r.Vector2(0, 0),
  25103. ]);
  25104. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  25105. (s.map.value = e),
  25106. (s.opacity.value = 0),
  25107. s.color.value.set(c.path.color);
  25108. var l = {
  25109. side: r.DoubleSide,
  25110. depthWrite: !1,
  25111. transparent: !0,
  25112. vertexShader: m.waypoint.vertexShader,
  25113. fragmentShader: m.waypoint.fragmentShader,
  25114. uniforms: s,
  25115. name: "waypoint",
  25116. opacity: 0,
  25117. };
  25118. this.player.mode !== a.PANORAMA &&
  25119. ((l.depthTest = !1), (l.name = "wayPtOut"));
  25120. var h = new r.RawShaderMaterial(l),
  25121. u = new r.Mesh(i, h);
  25122. return (u.name = t), u;
  25123. }),
  25124. (n.prototype.makeStartMarker = function (e, t) {
  25125. var i = new r.Vector3().copy(t[1]).sub(t[0]);
  25126. (i.y = 0), i.normalize();
  25127. var n = Math.acos(i.x),
  25128. o = this.makeWaypointObj(w.pathStart, "Start");
  25129. return (
  25130. o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o
  25131. );
  25132. }),
  25133. (n.prototype.makeEndMarker = function (e) {
  25134. var t = this.makeWaypointObj(w.pathEnd, "End"),
  25135. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  25136. n = this.model.panos.get(this.nodes[this.nodes.length - 1])
  25137. .floor.floorIndex;
  25138. return (
  25139. i < n
  25140. ? t.material.uniforms.color.value.set(c.path.colorUp)
  25141. : i > n &&
  25142. t.material.uniforms.color.value.set(c.path.colorDown),
  25143. t.position.copy(e),
  25144. t
  25145. );
  25146. }),
  25147. (n.prototype.pathClean = function (e) {
  25148. if (e) {
  25149. for (var t in e.children) this.pathClean(e.children[t]);
  25150. e.geometry && e.geometry.dispose(),
  25151. e.material && e.material.dispose();
  25152. }
  25153. }),
  25154. (n.prototype.discardPathObject = function () {
  25155. if (this.obj3d) {
  25156. var e = this.obj3d.parent;
  25157. e && e.remove(this.obj3d), this.pathClean(this.obj3d);
  25158. }
  25159. (this.obj3d = null), this.popInCpm();
  25160. }),
  25161. (n.prototype.discardSlow = function () {
  25162. if (this.obj3d) {
  25163. if (this.player.mode !== a.PANORAMA)
  25164. return void this.discardPathObject();
  25165. for (
  25166. var e,
  25167. t = this,
  25168. i = 0,
  25169. n = function () {
  25170. this.discardPathObject();
  25171. }.bind(this),
  25172. r = 0;
  25173. r < t.obj3d.children.length;
  25174. r += 1
  25175. )
  25176. (e = t.obj3d.children[r]),
  25177. void 0 !== e.material &&
  25178. e.material.transparent === !0 &&
  25179. (void 0 !== e.material.uniforms
  25180. ? p.start(
  25181. u.property(e.material.uniforms.opacity, "value", 0),
  25182. c.path.fadeOutTime,
  25183. n,
  25184. 0,
  25185. d[c.warp.blendEasing]
  25186. )
  25187. : p.start(
  25188. u.property(e.material, "opacity", 0),
  25189. c.path.fadeOutTime,
  25190. n,
  25191. 0,
  25192. d[c.warp.blendEasing]
  25193. ),
  25194. (i += 1),
  25195. (n = null));
  25196. 0 === i && this.discardPathObject(),
  25197. this.player.mode !== a.PANORAMA &&
  25198. this.fadeInCpm(c.path.fadeInTime - 3);
  25199. }
  25200. }),
  25201. (n.prototype.appearSlow = function () {
  25202. var e,
  25203. t = this;
  25204. this.fadeOutCpm(c.path.fadeInTime);
  25205. for (
  25206. var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1,
  25207. n = 0;
  25208. n < t.obj3d.children.length;
  25209. n += 1
  25210. )
  25211. (e = t.obj3d.children[n]),
  25212. void 0 !== e.material &&
  25213. e.material.transparent === !0 &&
  25214. (void 0 !== e.material.uniforms
  25215. ? p.start(
  25216. u.property(e.material.uniforms.opacity, "value", i),
  25217. c.path.fadeInTime,
  25218. null,
  25219. 0,
  25220. d[c.warp.blendEasing]
  25221. )
  25222. : p.start(
  25223. u.property(e.material, "opacity", i),
  25224. c.path.fadeInTime,
  25225. null,
  25226. 0,
  25227. d[c.warp.blendEasing]
  25228. ));
  25229. }),
  25230. (n.prototype.update = function () {
  25231. this.obj3d && this.obj3d.updateMatrixWorld();
  25232. }),
  25233. (n.prototype.calcBurnsAmount = function (e) {
  25234. //计算导览点旋转角
  25235. var t = r.Math.degToRad(c.warp.burnsAngle);
  25236. if (this.player.mode === a.PANORAMA) {
  25237. var i = this.burnsDir * t;
  25238. if (this.upcomingTransType === l.BLACK) return i;
  25239. var n = e;
  25240. if (null === n)
  25241. return y.warn("Transition request for non-highlight"), i;
  25242. var o = this.getHeroDescriptorByHeroIndex(n);
  25243. if (null === o) return i;
  25244. if (!o.isPano()) return i;
  25245. var s = this.getHeroPano(o),
  25246. h = this.playerControls.cameras[a.PANORAMA],
  25247. u = A.FORWARD.clone()
  25248. .applyQuaternion(h.quaternion)
  25249. .setY(0)
  25250. .normalize(),
  25251. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  25252. p = function (e) {
  25253. var i = Math.acos(Math.min(1, e.dot(u))),
  25254. n = new r.Vector3().crossVectors(u, e);
  25255. return (
  25256. Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  25257. );
  25258. };
  25259. if (s === this.player.currentPano)
  25260. return (i = p(
  25261. A.FORWARD.clone()
  25262. .applyQuaternion(o.quaternion)
  25263. .setY(0)
  25264. .normalize()
  25265. ));
  25266. var f = this.findShortestPath(this.player.currentPano, s);
  25267. if (void 0 === f || null === f || f.length < 1)
  25268. return y.debug("Empty path ahead..."), i;
  25269. var g = this.makePathHulls(f),
  25270. m = new r.CatmullRomCurve3(g.camera),
  25271. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength());
  25272. return (i = p(
  25273. m.getPointAt(v).clone().sub(h.position).setY(0).normalize()
  25274. ));
  25275. }
  25276. return this.player.mode === a.DOLLHOUSE
  25277. ? 0.02 * this.burnsDir
  25278. : this.burnsDir;
  25279. }),
  25280. (n.prototype.waitNextStep = function (e, t, time) {
  25281. //xzw 改时间
  25282. var i = time == void 0 ? c.warp.tourStepDelay : time;
  25283. i == void 0 &&
  25284. (i =
  25285. this.lastTransType === l.BLACK
  25286. ? b.tourStepDelaySlideShow
  25287. : b.tourStepDelayDefault);
  25288. var n = new r.Euler(),
  25289. o = new r.Vector3();
  25290. y.debug("Starting wait: " + (void 0 !== t));
  25291. var currentLocation = this.model.getHeroDescriptorByIndex(
  25292. this.director.currentItem
  25293. ); //this.model.heroLocations[this.director.currentItem[0]]
  25294. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  25295. h = function () {
  25296. this.endWarpState(),
  25297. this.player.mode === a.DOLLHOUSE &&
  25298. (this.playerControls.cameras[
  25299. a.DOLLHOUSE
  25300. ].controls.rotationAcceleration.x = 0),
  25301. t && t();
  25302. }.bind(this),
  25303. u = function (e, t) {
  25304. if (this.warpInterrupted) return h(), !0;
  25305. var r = t || 1e3 / 60;
  25306. if (c.warp.doBurns && !currentLocation.dontRot)
  25307. if (this.player.mode === a.PANORAMA) {
  25308. var l = this.playerControls.cameras[a.PANORAMA];
  25309. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  25310. var u = i == 0 ? s : (r * s) / i;
  25311. u = Math.sign(u) * Math.max(u, 0.0001); //add 如果音频长的话,使旋转可见,否则以为停住了
  25312. (n.y += u),
  25313. o.set(0, 0, -1),
  25314. o.applyEuler(n),
  25315. o.add(l.position),
  25316. l.controls.lookAt(o),
  25317. l.controls.lookVector.copy(o),
  25318. l.lookAt(o);
  25319. } else
  25320. this.player.mode === a.DOLLHOUSE
  25321. ? (this.playerControls.controls[
  25322. a.DOLLHOUSE
  25323. ].rotationAcceleration.x = s)
  25324. : (this.playerControls.controls[
  25325. a.FLOORPLAN
  25326. ].absoluteScale *= 0.9996);
  25327. }.bind(this);
  25328. this.startWarpState(),
  25329. p.start(u, i, h, 0, d.easeInOutQuad, "wait");
  25330. }),
  25331. (n.prototype.warpToNonPano = function (e) {
  25332. if (
  25333. (this.discardPathObject(),
  25334. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE ||
  25335. this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)
  25336. ) {
  25337. var t = function () {
  25338. e && e();
  25339. }.bind(this);
  25340. this.player.flyToNewMode({
  25341. mode: this.warpDestHeroLoc.cameraMode,
  25342. duration: c.warp.outsideTime,
  25343. warpDest: this.warpDestHeroLoc,
  25344. callback: t,
  25345. force: !0,
  25346. });
  25347. } else y.warn("no warp destination!!!"), e && e();
  25348. }),
  25349. (n.prototype._resetWarpShaderParams = function (e) {
  25350. //
  25351. this.player.mode === a.PANORAMA &&
  25352. (void 0 !== e.material.uniforms.blackout &&
  25353. (e.material.uniforms.blackout.value = 0),
  25354. void 0 !== e.material.uniforms.modelAlpha &&
  25355. (e.material.uniforms.modelAlpha.value = 0));
  25356. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  25357. delete e.material.defines.newBlack;
  25358. e.material.needsUpdate = true
  25359. } */
  25360. }),
  25361. (n.prototype._clearWarpShading = function () {
  25362. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  25363. this._resetWarpShaderParams(e[t]), (e[t].visible = !0);
  25364. this._resetWarpShaderParams(this.model.skybox);
  25365. }),
  25366. (n.prototype._warpStopFlying = function () {
  25367. (this.activeTransType = null), this.placeCpm();
  25368. }),
  25369. (n.prototype._wrapupTravelOnlyBits = function () {
  25370. this._warpStopFlying(),
  25371. this.warpPathPoints &&
  25372. (this.player.currentPano.exit(),
  25373. this.warpDestPano.enter(),
  25374. (this.player.currentPano = this.warpDestPano)),
  25375. this.player.spider.draw(),
  25376. this.placeCpm();
  25377. }),
  25378. (n.prototype._wrapupTravel = function (e) {
  25379. this._wrapupTravelOnlyBits(), this.warpCameraAim(e);
  25380. }),
  25381. (n.prototype._wrapupWarpShading = function (e) {
  25382. this._clearWarpShading(), this._wrapupTravel(e);
  25383. }),
  25384. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  25385. t !== I.END && this._clearWarpShading(),
  25386. this._wrapupTravelOnlyBits(),
  25387. (this.upcomingTransType = null),
  25388. e && e();
  25389. }),
  25390. (n.prototype._warpCameraAim = function (e, t) {
  25391. //到每个片段终点时转向终点朝向。
  25392. var i = this.warpDestHeroLoc.quaternion,
  25393. n = this.playerControls.cameras[a.PANORAMA],
  25394. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  25395. s = new r.Vector3(0, 0, 1)
  25396. .applyQuaternion(n.quaternion)
  25397. .normalize(),
  25398. l = s.dot(o),
  25399. u = r.Math.radToDeg(Math.acos(l)),
  25400. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25401. i,
  25402. c.warp.eOrder
  25403. ),
  25404. g = new r.Euler().setFromQuaternion(
  25405. n.quaternion,
  25406. c.warp.eOrder
  25407. ),
  25408. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder);
  25409. (m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y));
  25410. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  25411. A = new r.Vector3(),
  25412. C = function (e, t) {
  25413. return (
  25414. !!this.warpInterrupted ||
  25415. ((v.x = g.x + e * m.x),
  25416. (v.y = g.y + e * m.y),
  25417. (v.z = g.z + e * m.z),
  25418. A.set(0, 0, -1),
  25419. A.applyEuler(v),
  25420. A.add(n.position),
  25421. n.controls.lookAt(A),
  25422. n.controls.lookVector.copy(A),
  25423. void n.lookAt(A))
  25424. );
  25425. }.bind(this);
  25426. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  25427. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  25428. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  25429. ):
  25430. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  25431. ,void (t && t())
  25432. ) */
  25433. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  25434. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e);
  25435. return u > c.warp.minRotation
  25436. ? p.start(C, e, t, 0, d[c.warp.movementEasing])
  25437. : (y.info(
  25438. "Aim angle only is " +
  25439. u.toPrecision(3) +
  25440. " degrees, skipping explicit re-aim"
  25441. ),
  25442. void (t && t()));
  25443. }),
  25444. (n.prototype._warpBendAim = function (e, t, i, n) {
  25445. var o = n || 0,
  25446. s = this.playerControls.cameras[a.PANORAMA],
  25447. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25448. this.warpDestHeroLoc.quaternion,
  25449. c.warp.eOrder
  25450. ),
  25451. u = new r.Euler().setFromQuaternion(
  25452. s.quaternion,
  25453. c.warp.eOrder
  25454. ),
  25455. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder);
  25456. f.y = h.constrainedTurn(f.y);
  25457. var g = Math.min(
  25458. r.Math.degToRad(c.warp.softBendTilt),
  25459. Math.abs(f.x)
  25460. );
  25461. (f.x = g * Math.sign(f.x)),
  25462. (g = Math.min(
  25463. r.Math.degToRad(Math.max(0, c.warp.softBendAngle)),
  25464. g
  25465. )),
  25466. (this.burnsDir = Math.sign(f.y)),
  25467. (g *= Math.sign(f.y)),
  25468. (f.y = g);
  25469. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  25470. v = new r.Vector3(),
  25471. A = function (e, t) {
  25472. if (e < 0.5)
  25473. (m.x = u.x + e * f.x),
  25474. (m.y = u.y + e * f.y),
  25475. (m.z = u.z + e * f.z);
  25476. else {
  25477. var i = (1 - e) * c.warp.softBendEnd;
  25478. (m.x = l.x - i * f.x),
  25479. (m.y = l.y - i * f.y),
  25480. (m.z = l.z - i * f.z);
  25481. }
  25482. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position);
  25483. s.controls.lookAt(v),
  25484. s.controls.lookVector.copy(v),
  25485. s.lookAt(v);
  25486. }.bind(this);
  25487. if (window.DATA.momentTourBlackNewType) {
  25488. A(1);
  25489. } else return p.start(A, t, i, o, d[c.warp.movementEasing]);
  25490. }),
  25491. (n.prototype._warpStepCameraAim = function (e, t, i) {
  25492. var n = this.playerControls.cameras[a.PANORAMA],
  25493. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25494. this.warpDestHeroLoc.quaternion,
  25495. c.warp.eOrder
  25496. ),
  25497. s = new r.Euler().setFromQuaternion(
  25498. n.quaternion,
  25499. c.warp.eOrder
  25500. ),
  25501. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder);
  25502. (l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y));
  25503. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  25504. f = new r.Vector3(),
  25505. g = function (e, t) {
  25506. e < 0.5 ? u.copy(s) : u.copy(o),
  25507. f.set(0, 0, -1),
  25508. f.applyEuler(u),
  25509. f.add(n.position),
  25510. n.controls.lookAt(f),
  25511. n.controls.lookVector.copy(f),
  25512. n.lookAt(f);
  25513. }.bind(this);
  25514. return p.start(g, t, i, 0, d[c.warp.movementEasing]);
  25515. }),
  25516. (n.prototype.setBurnsDir = function () {
  25517. var e = this.playerControls.cameras[a.PANORAMA],
  25518. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25519. this.warpDestHeroLoc.quaternion,
  25520. c.warp.eOrder
  25521. ),
  25522. i = new r.Euler().setFromQuaternion(
  25523. e.quaternion,
  25524. c.warp.eOrder
  25525. ),
  25526. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder);
  25527. (n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y));
  25528. }),
  25529. (n.prototype.stepWarpPath = function (firstPos, e) {
  25530. var i = this.playerControls.cameras[a.PANORAMA];
  25531. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos;
  25532. if (!n) {
  25533. return i.position.copy(this.warpDestPano.position), !0;
  25534. }
  25535. /* if (!this.warpPathPoints)
  25536. return i.position.copy(this.warpDestPano.position),
  25537. !0;
  25538. var n = this.warpPathPoints[0] */
  25539. var o = this.warpDestPano.position;
  25540. /* console.log(firstPos)
  25541. console.log(o) */
  25542. if (
  25543. null !== this.nodes &&
  25544. this.cameraHull &&
  25545. this.cameraHull.length > 1
  25546. ) {
  25547. var s = new r.Vector3();
  25548. e < 0.5
  25549. ? s
  25550. .copy(this.cameraHull[1])
  25551. .sub(n)
  25552. .normalize()
  25553. .multiplyScalar(c.warp.softPushDist * e)
  25554. .add(n)
  25555. : s
  25556. .copy(this.cameraHull[this.cameraHull.length - 2])
  25557. .sub(o)
  25558. .normalize()
  25559. .multiplyScalar(
  25560. c.warp.softPushDist * c.warp.softPushEnd * (1 - e)
  25561. )
  25562. .add(o),
  25563. i.position.copy(s);
  25564. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o);
  25565. }),
  25566. (n.prototype.interruptAndFastForward = function (e, t) {
  25567. this.warping &&
  25568. ((this.warpInterrupted = !0),
  25569. (this.warpInterruptionBlackoutStyle = e),
  25570. (this.warpInterruptionTravelTime = t),
  25571. (null !== this.warpInterruptionBlackoutStyle &&
  25572. void 0 !== this.warpInterruptionBlackoutStyle) ||
  25573. (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  25574. (null !== this.warpInterruptionTravelTime &&
  25575. void 0 !== this.warpInterruptionTravelTime) ||
  25576. (this.warpInterruptionTravelTime = c.minWarpTime));
  25577. }),
  25578. (n.prototype.warpCameraAim = function (e) {
  25579. var t = c.warp.minWarpTime;
  25580. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime;
  25581. else {
  25582. var i = this.playerControls.cameras[a.PANORAMA],
  25583. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  25584. this.warpDestHeroLoc.quaternion,
  25585. c.warp.eOrder
  25586. ),
  25587. o = new r.Euler().setFromQuaternion(
  25588. i.quaternion,
  25589. c.warp.eOrder
  25590. ),
  25591. s = new r.Euler(
  25592. n.x - o.x,
  25593. n.y - o.y,
  25594. n.z - o.z,
  25595. c.warp.eOrder
  25596. );
  25597. s.y = h.constrainedTurn(s.y);
  25598. var u =
  25599. (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec);
  25600. t = Math.max(t, u);
  25601. }
  25602. var d = function () {
  25603. this._warpStopFlying(), this.discardSlow(), e && e();
  25604. }.bind(this);
  25605. this._warpCameraAim(t, d);
  25606. }),
  25607. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  25608. this.model.skybox.material.uniforms.blackout.value = n;
  25609. var r = u.uniform(this.model.skybox, "progress", 1),
  25610. o = u.allUniforms(this.model.chunks, "progress", 1),
  25611. a = !1,
  25612. s = function () {
  25613. if (this.warpInterrupted) return (a = !0), !0;
  25614. }.bind(this),
  25615. l = function (e, t) {
  25616. return i && a
  25617. ? ((this.model.skybox.material.uniforms.progress.value = 0),
  25618. !0)
  25619. : void r(e, t);
  25620. }.bind(this),
  25621. h = function (e, t) {
  25622. return i && a ? (o(0), !0) : void o(e, t);
  25623. }.bind(this);
  25624. p.start(s, e, null, t, null, "safeHaltWatch"),
  25625. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  25626. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress");
  25627. }),
  25628. (n.prototype.warpTravel_STD = function (e) {
  25629. var t,
  25630. i = Math.min(
  25631. c.warp.lookAheadMax,
  25632. c.warp.lookAheadDist / this.warpLength
  25633. ),
  25634. n = this.playerControls.cameras[a.PANORAMA],
  25635. o =
  25636. (Math.min(0.25, 3 / this.warpLength),
  25637. Math.min(0.35, 7 / this.warpLength)),
  25638. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  25639. f = new r.Vector3(),
  25640. m = new r.Euler().setFromQuaternion(
  25641. n.quaternion,
  25642. c.warp.eOrder
  25643. ),
  25644. v = new r.Euler().copy(m),
  25645. C = n.position.clone(),
  25646. E = new r.Matrix4(),
  25647. b = new r.Euler(),
  25648. w = c.warp.minWarpTime;
  25649. (w += this.warpLength * c.warp.timePerMeter),
  25650. c.warp.flySpeed > 0.01 &&
  25651. (w = (1e3 * this.warpLength) / c.warp.flySpeed);
  25652. var _ = !1,
  25653. T = this.warpDestHeroLoc.quaternion,
  25654. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  25655. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  25656. .clone()
  25657. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  25658. .normalize(),
  25659. M = S.dot(x),
  25660. R = r.Math.radToDeg(Math.acos(M)),
  25661. P = function (e) {
  25662. var t = o,
  25663. i =
  25664. r.Math.smoothstep(e, 0, t) *
  25665. (1 - r.Math.smoothstep(e, 1 - t, 1));
  25666. return i;
  25667. },
  25668. O = function () {
  25669. return (
  25670. E.lookAt(C, t, A.UP),
  25671. s.setFromRotationMatrix(E, c.warp.eOrder),
  25672. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  25673. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  25674. h.constrainedTurn(b.y)
  25675. );
  25676. }.bind(this),
  25677. L = function (e, t) {
  25678. if (this.warpInterrupted) return (_ = !0), !0;
  25679. }.bind(this),
  25680. D = function (e, t) {
  25681. return _ || !this.warpPathPoints
  25682. ? (g.blur(0), !0)
  25683. : void g.blur(e);
  25684. }.bind(this),
  25685. N = u.allUniforms(this.model.chunks, "modelAlpha", 1),
  25686. B = function (e, t) {
  25687. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t);
  25688. }.bind(this),
  25689. F = function (e, t) {
  25690. if (!this.warpPathPoints)
  25691. return n.position.copy(this.warpDestPano.position), !0;
  25692. if (_) return !0;
  25693. var i = this.interpAlongPath(
  25694. this.warpPathPoints,
  25695. this.warpPathLengths,
  25696. e
  25697. );
  25698. n.position.copy(i),
  25699. (C = this.interpAlongPath(
  25700. this.warpPathPoints,
  25701. this.warpPathLengths,
  25702. 0.99 * e
  25703. ));
  25704. }.bind(this),
  25705. V = function (e, n) {
  25706. return this.warpPathPoints
  25707. ? !!_ ||
  25708. void (t = this.interpAlongPath(
  25709. this.warpPathPoints,
  25710. this.warpPathLengths,
  25711. Math.min(e + i, 1)
  25712. ))
  25713. : (y.debug("Lost bunny."), !0);
  25714. }.bind(this),
  25715. U = function (e, o) {
  25716. if (_)
  25717. return y.debug(">>>> Walkthrough interupted at t=" + e), !0;
  25718. if (!this.warpPathPoints) return !0;
  25719. var a = this.warpLength * e,
  25720. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  25721. u = r.Math.smoothstep(
  25722. a,
  25723. this.warpLength - this.brushPrefs.lookBlendDist,
  25724. this.warpLength
  25725. );
  25726. c.warp.matchCam && (l *= 1 - u),
  25727. E.lookAt(C, t, A.UP),
  25728. s.setFromRotationMatrix(E, c.warp.eOrder),
  25729. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  25730. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  25731. (b.y = h.constrainedTurn(b.y)),
  25732. (s.x = m.x + l * b.x),
  25733. (s.y = m.y + l * b.y),
  25734. (s.z = m.z + l * b.z),
  25735. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  25736. (b.y = h.constrainedTurn(b.y));
  25737. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3;
  25738. (b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  25739. (v.x = v.x + b.x * c.warp.turnFriction),
  25740. (v.y = v.y + b.y * c.warp.turnFriction),
  25741. (v.z = v.z + b.z * c.warp.turnFriction),
  25742. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x));
  25743. var p = t.clone().sub(C).normalize();
  25744. if (R < c.warp.maxAimRotation && u > 0) {
  25745. var g = 1 - u;
  25746. (p.x = p.x * g + u * S.x),
  25747. (p.y = p.y * g + u * S.y),
  25748. (p.z = p.z * g + u * S.z),
  25749. p.normalize();
  25750. }
  25751. this.bunnyObj.position.copy(n.position).add(p),
  25752. f.set(0, 0, -1).applyEuler(v).normalize(),
  25753. f.multiplyScalar(8),
  25754. f.add(n.position),
  25755. (e > 1 - i && c.warp.matchCam) ||
  25756. (n.controls.lookAt(f),
  25757. n.controls.lookVector.copy(f),
  25758. n.lookAt(f));
  25759. }.bind(this),
  25760. k = function () {
  25761. _
  25762. ? (this.discardSlow(),
  25763. (this.upcomingTransType = l.BLACK),
  25764. this.warpTravel_BLACK(
  25765. -0.5,
  25766. this.warpInterruptionTravelTime,
  25767. I.BEGINNING,
  25768. e
  25769. ))
  25770. : this._wrapupWarpShading(e);
  25771. }.bind(this);
  25772. V(0);
  25773. var H =
  25774. c.warp.motionLeadTime +
  25775. (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec);
  25776. w += H;
  25777. var G = H / w;
  25778. this.warpCommonParameters(w, G, !0, I.NONE),
  25779. p.start(L, w, null, 0, null, "_haltWatcher"),
  25780. c.warp.blur > 0 &&
  25781. ((g.blurStrength = c.warp.blur),
  25782. p.start(D, w, null, G, P, "blurring")),
  25783. p.start(B, w, null, G, P, "modelAlpha"),
  25784. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  25785. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  25786. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny");
  25787. }),
  25788. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  25789. var r = e || 0;
  25790. (void 0 !== t && null !== t) || (t = c.warp.teleportTime);
  25791. //add
  25792. var done = () => {
  25793. Hot.updateVisibles([this.player.currentPano]); //更新热点显示
  25794. this.player.transitionPos({
  25795. type: "beforeFlytopano",
  25796. pano: this.player.currentPano,
  25797. dur: 100,
  25798. }); //add
  25799. };
  25800. if (window.DATA.momentTourBlackNewType) {
  25801. player.sceneRenderer.effects.transitionMaskPass.start(
  25802. player.sceneRenderer
  25803. );
  25804. var camera = this.playerControls.cameras[a.PANORAMA];
  25805. var end = this.warpDestHeroLoc.position;
  25806. camera.position.copy(end);
  25807. setTimeout(() => {
  25808. player.sceneRenderer.effects.transitionMaskPass.stop();
  25809. this.wrapupWarpShadingOnly(n, i);
  25810. done();
  25811. }, t);
  25812. } else {
  25813. var o = function () {
  25814. this.wrapupWarpShadingOnly(n, i);
  25815. done();
  25816. }.bind(this);
  25817. var firstPos = this.player.position.clone(); //add
  25818. p.start(
  25819. this.stepWarpPath.bind(this, firstPos),
  25820. t,
  25821. o,
  25822. r,
  25823. d[c.warp.blendEasing],
  25824. "stepMotion"
  25825. );
  25826. }
  25827. this.warpCommonParameters(t, r, !1, i);
  25828. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  25829. // 改
  25830. if (window.DATA.momentTourBlackNewType) {
  25831. e.material.uniforms.blackout.value = 5; //i 改
  25832. //e.material.defines.newBlack = ''
  25833. //e.material.needsUpdate = true
  25834. } else {
  25835. e.material.uniforms.blackout.value = i;
  25836. }
  25837. }),
  25838. this._warpBendAim(null, t, null, r);
  25839. }),
  25840. (n.prototype.flightStepWalk = (function (e, t, i) {
  25841. var n = 0.001,
  25842. o = 1,
  25843. a = 1.2,
  25844. s = new r.Vector3(),
  25845. h = new r.Vector3(),
  25846. u = function (e, t) {
  25847. //导览速度
  25848. var i = Math.min(
  25849. this.player.position.distanceTo(e.position),
  25850. c.transition.flytimeMaxDistanceThreshold
  25851. ),
  25852. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  25853. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  25854. h.copy(A.FORWARD),
  25855. this.player.getDirection(h),
  25856. s.copy(t).sub(e.position).normalize();
  25857. var l = s.dot(h),
  25858. u = Math.acos(l),
  25859. d = u / r;
  25860. d > n && ((r *= d / n), u < o && (r *= a));
  25861. return (r / DATA.tourWalkSpeed) * 100; // 改
  25862. };
  25863. return function (e, t, i) {
  25864. if (this.warpInterrupted) i && i();
  25865. else if (this.activeTransType !== l.WALK)
  25866. this._clearWarpShading(),
  25867. this._warpStopFlying(),
  25868. this.player.spider.draw(),
  25869. this.placeCpm(),
  25870. i && i();
  25871. else if (this.player.currentPano !== e) {
  25872. var n = {
  25873. pano: e,
  25874. lookAtPoint: t,
  25875. duration: null,
  25876. maxDistanceOverride: c.warp.walkMaxDist,
  25877. skipWarpingCheck: !1,
  25878. constantMoveSpeed: !0,
  25879. };
  25880. if (e == this.warpDestPano) {
  25881. //到达终点前,放大到终点的zoom
  25882. n.zoomLevel = this.warpDestHeroLoc.zoom;
  25883. }
  25884. (n.duration = u.call(this, e, t)),
  25885. this.player.nonInterruptingFlyToPano(n, i);
  25886. } else i && i();
  25887. };
  25888. })()),
  25889. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  25890. return this.flightStepWalk.bind(this, e, t, i);
  25891. }),
  25892. (n.prototype.warpTravel_WALK = (function () {
  25893. var e = [];
  25894. return function (t) {
  25895. var i = this.player.model.panos;
  25896. e.length = 0;
  25897. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  25898. var s = this.nodes[a],
  25899. l = i.get(s);
  25900. a === this.nodes.length - 1;
  25901. (o =
  25902. n &&
  25903. l.position.distanceTo(n.position) < c.warp.walkMinDist),
  25904. (n && o) || (e.push(s), (n = l));
  25905. }
  25906. o &&
  25907. this.nodes.length > 1 &&
  25908. (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  25909. var h = e.length,
  25910. u = i.get(e[h - 1]),
  25911. d = new Array(h + 1);
  25912. d[d.length - 1] = function () {
  25913. t && t();
  25914. }.bind(this);
  25915. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  25916. var g = e[p];
  25917. u = i.get(g);
  25918. var m = new r.Vector3();
  25919. this.getLookAtForWalkingTourNode(e, p, m),
  25920. (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])),
  25921. p--;
  25922. }
  25923. d[0]();
  25924. };
  25925. })()),
  25926. (n.prototype.getLookAtForWalkingTourNode = (function () {
  25927. var e = new r.Vector3(),
  25928. t = new r.Vector3(),
  25929. i = new r.Vector3(),
  25930. n = new r.Vector3(),
  25931. o = new r.Vector3(),
  25932. a = 0.65,
  25933. s = 0.75,
  25934. l = 0.2,
  25935. c = 0.4,
  25936. h = 0.2,
  25937. u = 3;
  25938. return function (r, d, p) {
  25939. var f = r.length;
  25940. if (d >= f) return !1;
  25941. var g = 1,
  25942. m = 1;
  25943. t.set(0, 0, 0), o.set(0, 0, 0);
  25944. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  25945. if (
  25946. ((v = this.player.model.panos.get(r[A])),
  25947. this.getOrientationForWalkingTourNode(r, A, i),
  25948. A === d && e.copy(i),
  25949. n.copy(i),
  25950. A > d)
  25951. ) {
  25952. var y = n.dot(e) < a;
  25953. (g *= y ? l : s), (m *= y ? h : c);
  25954. }
  25955. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m);
  25956. }
  25957. return t.normalize(), p.copy(o), p.add(t), !0;
  25958. };
  25959. })()),
  25960. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  25961. var n = e.length;
  25962. if (t >= n) return !1;
  25963. if (t === n - 1)
  25964. i.copy(A.FORWARD).applyQuaternion(
  25965. this.warpDestHeroLoc.quaternion
  25966. );
  25967. else {
  25968. var r = this.player.model.panos.get(e[t]),
  25969. o = this.player.model.panos.get(e[t + 1]);
  25970. i.copy(o.position).sub(r.position);
  25971. }
  25972. return i.normalize(), !0;
  25973. }),
  25974. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  25975. if (
  25976. ((this.activeTransType = this.upcomingTransType),
  25977. (this.lastTransType = this.activeTransType),
  25978. (this.upcomingTransType = null),
  25979. !e)
  25980. ) {
  25981. var r = function () {
  25982. this._wrapupTravel(n);
  25983. }.bind(this),
  25984. o = {
  25985. pano: this.warpDestPano,
  25986. lookAtPoint: null,
  25987. duration: null,
  25988. maxDistanceOverride: null,
  25989. skipWarpingCheck: !1,
  25990. };
  25991. return void this.player.flyToPano(o, r);
  25992. }
  25993. this.activeTransType === l.BLACK
  25994. ? this.warpTravel_BLACK(null, i, t, n)
  25995. : this.activeTransType === l.WALK
  25996. ? this.warpTravel_WALK(
  25997. function () {
  25998. this._clearWarpShading(),
  25999. this._warpStopFlying(),
  26000. this.player.spider.draw(),
  26001. this.placeCpm(),
  26002. n && n();
  26003. }.bind(this)
  26004. )
  26005. : this.warpTravel_STD(n);
  26006. }),
  26007. (n.prototype.startWarpState = function () {
  26008. (this.warping = !0),
  26009. (this.warpInterrupted = !1),
  26010. (this.warpInterruptionBlackoutStyle = null),
  26011. (this.warpInterruptionTravelTime = null);
  26012. }),
  26013. (n.prototype.endWarpState = function () {
  26014. this.warping = !1;
  26015. }),
  26016. (n.prototype.warpToPano = function (e, t, i, n) {
  26017. if (this.warping)
  26018. return void y.warn("Cannot warp when already warping");
  26019. if (
  26020. ((this.upcomingTransType = e),
  26021. (this.activeTransType = null),
  26022. !this.setWarpDestPano())
  26023. )
  26024. return (
  26025. (this.upcomingTransType = null), void this.warpToNonPano(n)
  26026. );
  26027. if (this.player.mode !== a.PANORAMA)
  26028. return (
  26029. (this.upcomingTransType = null),
  26030. this.discardSlow(),
  26031. void this.player.flyToNewMode({
  26032. mode: a.PANORAMA,
  26033. pano: this.warpDestPano,
  26034. duration: c.warp.outsideTime,
  26035. warpDest: this.warpDestHeroLoc,
  26036. callback: n,
  26037. force: !0,
  26038. })
  26039. );
  26040. if (!this.warpDestPano)
  26041. return (
  26042. y.warn("no warp destination, callback dropped"),
  26043. void (this.upcomingTransType = null)
  26044. );
  26045. var r = !(
  26046. this.model.panos.isNeighbour(
  26047. this.player.currentPano,
  26048. this.warpDestPano
  26049. ) &&
  26050. this.warpDestPano !== this.player.currentPano &&
  26051. this.warpDestPano.position.distanceTo(
  26052. this.player.currentPano.position
  26053. ) < c.warp.nearPanoDist
  26054. ),
  26055. o = this.chooseWarpPath(r);
  26056. if (o && this.upcomingTransType !== l.WALK) {
  26057. var s = function () {
  26058. (this.waitingToWarp = !1), this.warpToPano(e, t, i, n);
  26059. }.bind(this);
  26060. if (
  26061. this.player.checkAndWaitForPanoLoad(
  26062. this.warpDestPano,
  26063. "high",
  26064. "low",
  26065. this.player.basePanoSize,
  26066. s
  26067. )
  26068. )
  26069. return void (this.waitingToWarp = !0);
  26070. }
  26071. this.player.currentPano ||
  26072. (y.warn("Arrived at a very strange spot!"),
  26073. (this.player.currentPano = this.warpDestPano),
  26074. this.placeCpm(),
  26075. this.fadeOutCpm(c.path.fadeOutTime),
  26076. this.player.spider.draw()),
  26077. y.debug("Warping to pano ", this.warpDestPano.position),
  26078. this.upcomingTransType !== l.WALK &&
  26079. this.player.emit(
  26080. C.PanoChosen,
  26081. this.player.currentPano,
  26082. this.warpDestPano
  26083. ),
  26084. this.startWarpState();
  26085. var h = function () {
  26086. this.endWarpState(), n && n();
  26087. }.bind(this);
  26088. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h);
  26089. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  26090. }),
  26091. (t.exports = n);
  26092. }).call(this, "/js/objects/ShowPath.js");
  26093. },
  26094. {
  26095. "../constants": 8,
  26096. "../effects": 16,
  26097. "../enum/BlackoutStyle": 18,
  26098. "../enum/ModelManagerEvents": 33,
  26099. "../enum/PlayerEvents": 40,
  26100. "../enum/RenderOrder": 42,
  26101. "../enum/Vectors": 50,
  26102. "../enum/Viewmode": 51,
  26103. "../enum/WarpStyle": 52,
  26104. "../gui/gui": 65,
  26105. "../model/ModelManager": 140,
  26106. "../objects/Snapshot": 153,
  26107. "../settings": 166,
  26108. "../shaders": 167,
  26109. "../util/easing": 186,
  26110. "../util/lerp": 188,
  26111. "../util/logger": 189,
  26112. "../util/math": 190,
  26113. "../util/texture": 194,
  26114. "../util/transitions": 195,
  26115. three: 217,
  26116. },
  26117. ],
  26118. 152: [
  26119. function (e, t, i) {
  26120. "use strict";
  26121. function n() {
  26122. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  26123. t = new r.RawShaderMaterial({
  26124. fragmentShader: o.skysphere.fragmentShader,
  26125. vertexShader: o.skysphere.vertexShader,
  26126. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  26127. side: r.BackSide,
  26128. name: "skysphere",
  26129. });
  26130. (t.uniforms.radius.value = e.parameters.radius),
  26131. r.Mesh.call(this, e, t);
  26132. }
  26133. var r = e("three"),
  26134. o = e("../shaders"),
  26135. a = e("../settings");
  26136. (n.prototype = Object.create(r.Mesh.prototype)),
  26137. (n.prototype.constructor = n),
  26138. (t.exports = n);
  26139. },
  26140. {
  26141. "../settings": 166,
  26142. "../shaders": 167,
  26143. three: 217,
  26144. },
  26145. ],
  26146. 153: [
  26147. function (e, t, i) {
  26148. (function (i) {
  26149. "use strict";
  26150. function n(e) {
  26151. o.call(this, e),
  26152. (this.sid = e.sid), //xzw add
  26153. (this.panoId = e.panoId),
  26154. (this.orthoZoom = e.orthoZoom),
  26155. (this.floorVisibility = e.floorVisibility),
  26156. (this.thumbUrl = e.thumbUrl),
  26157. (this.name = e.name),
  26158. (this.zoom = e.zoom);
  26159. }
  26160. var r = (e("three"), e("../util/logger")),
  26161. o =
  26162. (e("../settings"),
  26163. e("../enum/Viewmode"),
  26164. e("../util/common"),
  26165. e("../util/transitions"),
  26166. e("../util/lerp"),
  26167. e("../util/ajax"),
  26168. e("../util/texture"),
  26169. e("./View"));
  26170. e("events").EventEmitter, new r(i);
  26171. (n.prototype = Object.create(o.prototype)),
  26172. (n.prototype.isPano = function () {
  26173. return (
  26174. this.panoId && "" !== this.panoId && this.panoId != "outside"
  26175. );
  26176. }),
  26177. (t.exports = n);
  26178. }).call(this, "/js/objects/Snapshot.js");
  26179. },
  26180. {
  26181. "../enum/Viewmode": 51,
  26182. "../settings": 166,
  26183. "../util/ajax": 181,
  26184. "../util/common": 185,
  26185. "../util/lerp": 188,
  26186. "../util/logger": 189,
  26187. "../util/texture": 194,
  26188. "../util/transitions": 195,
  26189. "./View": 154,
  26190. events: 202,
  26191. three: 217,
  26192. },
  26193. ],
  26194. 154: [
  26195. function (e, t, i) {
  26196. (function (i) {
  26197. "use strict";
  26198. function n(e) {
  26199. (e = e || {}),
  26200. (this.position = new r.Vector3()),
  26201. (this.quaternion = new r.Quaternion()),
  26202. this.update(e);
  26203. }
  26204. var r = e("three"),
  26205. o = e("../util/logger"),
  26206. a =
  26207. (e("../settings"),
  26208. e("../enum/Viewmode"),
  26209. e("../util/common"),
  26210. e("../util/transitions"),
  26211. e("../util/lerp"),
  26212. e("../util/ajax"),
  26213. e("../util/texture"),
  26214. e("events").EventEmitter);
  26215. new o(i);
  26216. (n.prototype = Object.create(a.prototype)),
  26217. (n.prototype.isValid = function () {
  26218. return !!this.cameraMode;
  26219. }),
  26220. (n.prototype.update = function (e) {
  26221. return (
  26222. (this.cameraMode = e.cameraMode || this.cameraMode),
  26223. (this.pano = e.pano || this.pano),
  26224. e.position && this.position.copy(e.position),
  26225. e.quaternion && this.quaternion.copy(e.quaternion),
  26226. this
  26227. );
  26228. }),
  26229. (t.exports = n);
  26230. }).call(this, "/js/objects/View.js");
  26231. },
  26232. {
  26233. "../enum/Viewmode": 51,
  26234. "../settings": 166,
  26235. "../util/ajax": 181,
  26236. "../util/common": 185,
  26237. "../util/lerp": 188,
  26238. "../util/logger": 189,
  26239. "../util/texture": 194,
  26240. "../util/transitions": 195,
  26241. events: 202,
  26242. three: 217,
  26243. },
  26244. ],
  26245. 155: [
  26246. function (e, t, i) {
  26247. //player.js
  26248. (function (i) {
  26249. "use strict";
  26250. function n(e) {
  26251. (this.currentPano = null),
  26252. (this.nextPano = null),
  26253. (this.camera = null),
  26254. (this.paused = !1),
  26255. (this.flying = !1),
  26256. (this.sceneIntersectionPlane = null),
  26257. (this.target = new r.Vector3()),
  26258. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  26259. (this.mouseAtMouseDown = new r.Vector2()),
  26260. (this.mouseCouldBeClickToMove = !1),
  26261. (this.mouseLastMoveTime = Date.now()),
  26262. (this.mouseDown = !1),
  26263. (this.mouseDownTimer = null),
  26264. (this.couldBeLongTap = !1),
  26265. (this.containsMouse = !1), //
  26266. (this.isTouchEvent = !1),
  26267. (this.isPanoHover = !1),
  26268. (this.reticule = new a(this)),
  26269. (this.panoMarkers = []),
  26270. (this.spider = new h(this)),
  26271. (this.quaternion = new r.Quaternion()),
  26272. (this.position = new r.Vector3(15, 10, 15)),
  26273. (this.previousState = null),
  26274. (this.lastInsideView = new c()),
  26275. (this.last360View = new c()),
  26276. (this.raycaster = new r.Raycaster()),
  26277. (this.intersect = null),
  26278. (this.lastChangeTime = Date.now()),
  26279. (this.history = new I()),
  26280. (this.cameraControls = null),
  26281. (this.path = null),
  26282. (this.model = null),
  26283. (this.domElement = null),
  26284. (this.cachedPanoCandidates = null),
  26285. (this.basePanoSize = 0),
  26286. (this.standardPanoSize = 0),
  26287. (this.highPanoSize = 0),
  26288. (this.ultraHighPanoSize = 0),
  26289. (this.zoomLevel = 1),
  26290. (this.zooming = 0),
  26291. (this.zoomSpeed = 0.5),
  26292. (this.scrollZoomSpeed = 0.06),
  26293. (this.zoomSpeedAdjust = 0.05),
  26294. (this.defaultZoomIncrement = 0.2),
  26295. (this.baseFov = f.insideFOV),
  26296. (this.zoomFov = this.baseFov),
  26297. (this.zoomEnabled = !0),
  26298. (this.preRenderingEnabled = !1),
  26299. this.setupCustomProperties(e),
  26300. (this.zoomStats = new L());
  26301. window.player = this;
  26302. this.modeTran = "";
  26303. }
  26304. var r = e("three"),
  26305. o = e("./util/logger"),
  26306. a = e("./objects/Reticule"),
  26307. s = e("./objects/Panorama"),
  26308. l = e("./objects/ShowPath"),
  26309. c = e("./objects/View"),
  26310. h = (e("./objects/Snapshot"), e("./objects/NSpider")),
  26311. u = e("./enum/Viewmode"),
  26312. d = (e("./enum/TagStates"), e("./enum/Vectors")),
  26313. p = e("./enum/Keys"),
  26314. f = (e("./enum/AlignmentType"), e("./settings")),
  26315. g = e("./util/common"),
  26316. m = (e("./util/browser"), e("./util/math")),
  26317. v = e("./util/lerp"),
  26318. A = e("./util/easing"),
  26319. y = e("./util/transitions"),
  26320. C = e("events").EventEmitter,
  26321. I = (e("./shaders"), e("./util/history")),
  26322. E =
  26323. (e("./util/camera"),
  26324. e("./model/ModelManager"),
  26325. e("./enum/PathDiscardMode")),
  26326. b = e("./enum/PathDisplayMode"),
  26327. w = e("./enum/PlayerEvents"),
  26328. _ = e("./enum/ControlEvents"),
  26329. T = e("./enum/ModelManagerEvents"),
  26330. x = e("./enum/WarpStyle"),
  26331. S = e("./enum/BlackoutStyle"),
  26332. M = e("./exception/BasicException"),
  26333. R = e("./enum/PanoSizeClass"),
  26334. P = (e("./tile/TileDownloader"), e("./tile/TilePrioritizer")),
  26335. O = (e("./enum/PanoramaEvents"), e("./enum/ZoomEvents")),
  26336. L = e("./util/ZoomStats"),
  26337. D = e("./constants"),
  26338. N = e("./util/common"),
  26339. B = e("./util/cameraLight"),
  26340. //, Hot = e('hot')
  26341. F = new o(i),
  26342. V = Object.freeze({
  26343. FlyToPano: y.getUniqueId(),
  26344. FlyToNewMode: y.getUniqueId(),
  26345. FlyToSameMode: y.getUniqueId(),
  26346. FlyToViewFloor: y.getUniqueId(),
  26347. LookTransition: y.getUniqueId(),
  26348. ZoomTransition: y.getUniqueId(),
  26349. });
  26350. (n.prototype = Object.create(C.prototype)),
  26351. (n.prototype.init = function (e) {
  26352. (this.modelManager = e.modelManager),
  26353. (this.tileDownloader = e.tileDownloader),
  26354. (this.panoRenderer = e.panoRenderer),
  26355. (this.qualityManager = e.qualityManager),
  26356. (this.domElement = e.container),
  26357. (this.camera = e.camera),
  26358. (this.tagManager = e.tagManager),
  26359. (this.cameraControls = e.controls),
  26360. (this.path = new l(e.director, this, e.controls)),
  26361. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  26362. (this.standardPanoSize = this.qualityManager.getPanoSize(
  26363. R.STANDARD
  26364. )),
  26365. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  26366. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(
  26367. R.ULTRAHIGH
  26368. )),
  26369. (this.tileDownloader.processPriorityQueue = !1),
  26370. (this.tileDownloader.tilePrioritizer = new P(
  26371. this.qualityManager,
  26372. this.basePanoSize,
  26373. this.standardPanoSize,
  26374. this.highPanoSize,
  26375. this.ultraHighPanoSize
  26376. )),
  26377. this.bindEvents(e.container),
  26378. this.updateModel();
  26379. });
  26380. //xzw add: 截图
  26381. function dataURLtoBlob(dataurl) {
  26382. var arr = dataurl.split(","),
  26383. mime = arr[0].match(/:(.*?);/)[1],
  26384. bstr = atob(arr[1]),
  26385. n = bstr.length,
  26386. u8arr = new Uint8Array(n);
  26387. while (n--) {
  26388. u8arr[n] = bstr.charCodeAt(n);
  26389. }
  26390. return new Blob([u8arr], { type: mime });
  26391. }
  26392. n.prototype.screenShot = function (o) {
  26393. if (this.flying || this.flyingToTag) return;
  26394. var R = this.sceneRenderer;
  26395. R.updateScreenSize(o);
  26396. for (var i in this.model.panos.index) {
  26397. if (!this.model.panos.index[i].marker) continue;
  26398. this.model.panos.index[i].marker.forceHide =
  26399. this.model.panos.index[i].marker.visible;
  26400. this.model.panos.index[i].marker.visible = false;
  26401. }
  26402. for (var i in this.model.hots) {
  26403. this.model.hots[i].mesh.visible = false;
  26404. }
  26405. this.reticule.visible = false;
  26406. this.reticule.forceUnvisible = true;
  26407. this.path.currentPanoMarker.mesh.visible = false;
  26408. setTimeout(
  26409. function () {
  26410. //因resize效用没办法立即生效(原因未知),故而延后
  26411. R.renderer.clear(true, true, true);
  26412. R.renderer.render(R.scene, R.camera);
  26413. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9);
  26414. o.f && o.f(imgData);
  26415. R.updateScreenSize({ resize: true });
  26416. this.reticule.visible = true;
  26417. for (var i in this.model.hots) {
  26418. this.model.hots[i].mesh.visible = true;
  26419. }
  26420. for (var i in this.model.panos.index) {
  26421. this.model.panos.index[i].marker.visible =
  26422. this.model.panos.index[i].marker.forceHide;
  26423. }
  26424. this.path.currentPanoMarker.mesh.visible = true;
  26425. R.renderer.render(R.scene, R.camera);
  26426. }.bind(this),
  26427. 30
  26428. ); //这个数字不能太小
  26429. };
  26430. var scaleImg = e("scaleImg");
  26431. var ResizeImg = function (img, option) {
  26432. var img2; //不能直接改img 否则可能触发第二次img.onload
  26433. var compress = function (ratio, type) {
  26434. var image = img2 || img;
  26435. var c = document.createElement("canvas");
  26436. c.width = image.width;
  26437. c.height = image.height;
  26438. var ctx = c.getContext("2d");
  26439. ctx.drawImage(image, 0, 0, image.width, image.height);
  26440. img2 = scaleImg(
  26441. ratio /* option.maxSize/oldSize */,
  26442. c,
  26443. type /* option.type||"png" */
  26444. ); //最大不能超过0.8M
  26445. };
  26446. var reCom = function () {
  26447. //如果有了img2 就只需要img2 否则创造新的img2
  26448. var image = img2 || img;
  26449. var blob = dataURLtoBlob(image.src);
  26450. if (option.maxWeight && blob.size > option.maxWeight) {
  26451. compress(option.maxWeight / blob.size, "jpeg");
  26452. blob = dataURLtoBlob(image.src);
  26453. }
  26454. if (!img2) {
  26455. img2 = new Image();
  26456. }
  26457. img2.base64Src = image.src;
  26458. img2.src = window.URL.createObjectURL(blob);
  26459. };
  26460. var oldSize = Math.max(img.width, img.height);
  26461. if (option.toType != "png") {
  26462. //不是非要png的话
  26463. if (option.oldType == "jpeg") {
  26464. //jpeg先判断尺寸,然后是尺寸
  26465. if (oldSize > option.maxSize) {
  26466. compress(option.maxSize / oldSize, "jpeg");
  26467. }
  26468. reCom();
  26469. } else if (option.oldType == "png") {
  26470. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  26471. if (option.maxWeight && option.weight > option.maxWeight) {
  26472. //如果一开始大小不大就不压缩 还是png
  26473. compress(
  26474. oldSize > option.maxSize ? option.maxSize / oldSize : 1,
  26475. "jpeg"
  26476. );
  26477. reCom();
  26478. }
  26479. }
  26480. } else {
  26481. //?貌似png会越压缩越大?
  26482. }
  26483. return img2 || img;
  26484. };
  26485. var _fixType = function (type) {
  26486. type = type.toLowerCase().replace(/jpg/i, "jpeg");
  26487. var r = type.match(/png|jpeg|bmp|gif/)[0];
  26488. return "image/" + r;
  26489. };
  26490. var saveFile = function (data, filename) {
  26491. var save_link = document.createElementNS(
  26492. "http://www.w3.org/1999/xhtml",
  26493. "a"
  26494. );
  26495. save_link.href = data;
  26496. save_link.download = filename;
  26497. var event = document.createEvent("MouseEvents");
  26498. event.initMouseEvent(
  26499. "click",
  26500. true,
  26501. false,
  26502. window,
  26503. 0,
  26504. 0,
  26505. 0,
  26506. 0,
  26507. 0,
  26508. false,
  26509. false,
  26510. false,
  26511. false,
  26512. 0,
  26513. null
  26514. );
  26515. save_link.dispatchEvent(event);
  26516. };
  26517. (n.prototype.getWrapShot = function () {
  26518. //获取导览点截图/初始画面和信息
  26519. var info = this.getSnapAngleInfo();
  26520. var str = ",{\r\t" + info;
  26521. var arg = arguments[0];
  26522. this.screenShot({
  26523. width: g_snapShotWidth * 4,
  26524. height: g_snapShotHeight * 4,
  26525. type: "image/jpeg",
  26526. f: function (imgData) {
  26527. if (arg && arg.__callback) {
  26528. return arg.__callback(imgData, info);
  26529. }
  26530. var img = new Image();
  26531. img.src = imgData;
  26532. img.onload = function () {
  26533. var img2 = ResizeImg(this, {
  26534. maxSize: g_snapShotWidth,
  26535. oldType: "jpeg",
  26536. }); //暂定缩略图大小
  26537. img2.src.replace(
  26538. _fixType("image/jpeg"),
  26539. "image/octet-stream"
  26540. );
  26541. var filename = "snap" + new Date().getTime();
  26542. saveFile(img2.src, filename + ".jpg");
  26543. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",';
  26544. str += '\r\t"sid":"' + filename + '",';
  26545. str += '\r\t"name":"' + filename + '"\r}';
  26546. logData(str);
  26547. };
  26548. },
  26549. });
  26550. }),
  26551. (n.prototype.getSnapAngleInfo = function () {
  26552. var info = {};
  26553. var str = '"metadata":{';
  26554. var q = this.camera.quaternion.clone();
  26555. switch (this.mode) {
  26556. case "panorama":
  26557. info.scan_id = this.currentPano.id;
  26558. str += '"scan_id":"' + this.currentPano.id + '",';
  26559. break;
  26560. case "floorplan":
  26561. info.camera_mode = 1;
  26562. q = new r.Quaternion().setFromAxisAngle(
  26563. new r.Vector3(0, 1, 0),
  26564. r.Math.degToRad(90)
  26565. );
  26566. q.multiply(this.camera.quaternion);
  26567. str += '"camera_mode":1,';
  26568. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  26569. str +=
  26570. '"ortho_zoom":' +
  26571. m.toPrecision(
  26572. this.cameraControls.activeControl.currentScale,
  26573. 4
  26574. ) +
  26575. ",";
  26576. break;
  26577. case "dollhouse":
  26578. info.camera_mode = 2;
  26579. str += '"camera_mode":2,';
  26580. break;
  26581. }
  26582. info.camera_position = m.toPrecision(
  26583. this.camera.position.toArray(),
  26584. 4
  26585. );
  26586. console.log(info.camera_position);
  26587. if (window.screenSta === "tour") {
  26588. // fyz 导览截屏需要做额外的
  26589. /**fyz 对相机截屏的角度进行校对 */
  26590. var out = new r.Quaternion(q.x, q.y, q.z, q.w);
  26591. out.multiply(
  26592. new r.Quaternion(
  26593. Math.sqrt(2) / 2,
  26594. Math.sqrt(2) / 2,
  26595. 0,
  26596. 0
  26597. ).conjugate()
  26598. );
  26599. out.x *= -1;
  26600. out.w *= -1;
  26601. info.camera_quaternion = m.toPrecision(out.toArray(), 4);
  26602. } else {
  26603. info.camera_quaternion = m.toPrecision(q.toArray(), 4);
  26604. }
  26605. info.zoom = this.zoomLevel;
  26606. console.log(info.camera_quaternion);
  26607. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  26608. // fyz 扩展编辑页面, 加上导览点缩放值
  26609. str +=
  26610. '"camera_position":[' +
  26611. info.camera_position +
  26612. '],"camera_quaternion":[' +
  26613. info.camera_quaternion +
  26614. '], "zoom":' +
  26615. info.zoom +
  26616. "}";
  26617. return str;
  26618. });
  26619. //------end
  26620. (n.prototype.setupCustomProperties = function (e) {
  26621. var t = e || u.PANORAMA;
  26622. Object.defineProperty(this, "mode", {
  26623. get: function () {
  26624. return t;
  26625. },
  26626. set: function (e) {
  26627. var i = t;
  26628. (t = e), this.onModeUpdated(i, t);
  26629. },
  26630. });
  26631. }),
  26632. (n.prototype.isInMode = function () {
  26633. for (var e = 0; e < arguments.length; e++)
  26634. if (this.mode === arguments[e]) return !0;
  26635. return !1;
  26636. }),
  26637. (n.prototype.isOutsideMode = function (e) {
  26638. return (
  26639. (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN
  26640. );
  26641. }),
  26642. (n.prototype.is360View = function (e, t) {
  26643. return e === u.PANORAMA && t && !t.isAligned();
  26644. }),
  26645. (n.prototype.setScene = function (e) {
  26646. (this.sceneIntersectionPlane = e.plane),
  26647. this.path.setScene(e),
  26648. this.moveReticuleToScene(e);
  26649. }),
  26650. (n.prototype.moveReticuleToScene = function (e) {
  26651. this.reticule.parent &&
  26652. this.reticule.parent.remove(this.reticule),
  26653. e.add(this.reticule);
  26654. }),
  26655. (n.prototype.updateModel = function () {
  26656. function e(e, t, n) {
  26657. this.mode === u.DOLLHOUSE &&
  26658. e !== n &&
  26659. i.call(this, e.center.y);
  26660. }
  26661. function t(e, t) {
  26662. if (this.mode === u.DOLLHOUSE) {
  26663. var n = e ? this.model.center.y : (n = t.center.y);
  26664. i.call(this, n);
  26665. }
  26666. }
  26667. function i(e) {
  26668. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  26669. i = this.cameraControls.controls[u.DOLLHOUSE],
  26670. n = t.position.y + (e - i.target.y),
  26671. r = f.showFloorDuration + f.showFloorDelay;
  26672. y.start(
  26673. v.property(i.target, "y", e),
  26674. r,
  26675. null,
  26676. f.flydown.movementDelay,
  26677. A[f.flydown.movementEasing],
  26678. null,
  26679. V.FlyToViewFloor
  26680. ),
  26681. y.start(
  26682. v.property(t.position, "y", n),
  26683. r,
  26684. null,
  26685. f.flydown.movementDelay,
  26686. A[f.flydown.movementEasing],
  26687. null,
  26688. V.FlyToViewFloor
  26689. );
  26690. }
  26691. (this.model = this.modelManager.getActiveModel()),
  26692. this.model.on("floor.changed", e.bind(this)),
  26693. this.model.on("allfloors.toggled", t.bind(this)),
  26694. this.on(
  26695. w.PanoChosen,
  26696. this.model.setProjectedPanos.bind(this.model)
  26697. );
  26698. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  26699. var e2 = this;
  26700. this.model.panos.list.forEach(function (a) {
  26701. a.vrMarker.addEventListener("click", function () {
  26702. e2.flyToPano({
  26703. pano: a,
  26704. });
  26705. });
  26706. });
  26707. /********************************************************************************************************************************************/
  26708. this.model.addHighMapCube(); //add
  26709. this.on(
  26710. w.FlyingStarted,
  26711. this.model.resetHighMap.bind(this.model)
  26712. );
  26713. }),
  26714. (n.prototype.updateModelDependentData = function () {
  26715. this.cameraControls.setModelForControls(this.model),
  26716. this.getPanoMarkersFromModel(this.model);
  26717. }),
  26718. (n.prototype.onModelChanged = function () {
  26719. this.updateModel(), this.updateModelDependentData();
  26720. }),
  26721. (n.prototype.getPanoMarkersFromModel = function (e) {
  26722. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  26723. return t.marker ? e.concat(t.marker) : e;
  26724. }, []);
  26725. }),
  26726. (n.prototype.handleControlMove = function (e) {
  26727. this.emit(w.Move, e);
  26728. }),
  26729. (n.prototype.handleControlInputStart = function (e) {
  26730. this.emit(w.InputStart, e);
  26731. }),
  26732. (n.prototype.onModeUpdated = function (e, t) {
  26733. this.cameraControls.activateControls(t),
  26734. this.emit(w.ModeChanged, e, t);
  26735. }),
  26736. (n.prototype.isWarping = function () {
  26737. //是否导览缓慢走向某个点
  26738. return this.path.warping;
  26739. }),
  26740. (n.prototype.isWaitingToWarp = function () {
  26741. return this.path.waitingToWarp;
  26742. }),
  26743. (n.prototype.getLabelScaleFactor = function () {
  26744. if (this.isOutsideMode()) {
  26745. var e = 10,
  26746. t = Math.sqrt(
  26747. this.cameraControls.controls[u.FLOORPLAN].currentScale / e
  26748. );
  26749. return t;
  26750. }
  26751. return 0.5;
  26752. }),
  26753. /* n.prototype.changeMusic = function() {//xzw add
  26754. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  26755. } */
  26756. (n.prototype.bindEvents = function (e) {
  26757. e !== document && e.setAttribute("tabindex", -1),
  26758. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  26759. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  26760. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  26761. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  26762. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  26763. this.modelManager.on(
  26764. T.ActiveModelChanged,
  26765. this.onModelChanged.bind(this)
  26766. ),
  26767. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  26768. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  26769. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  26770. e.addEventListener(
  26771. "pointerdown",
  26772. this.onPointerDown.bind(this)
  26773. ),
  26774. e.addEventListener(
  26775. "pointermove",
  26776. this.onPointerMove.bind(this)
  26777. ),
  26778. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  26779. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  26780. e.addEventListener(
  26781. "pointercancel",
  26782. this.onPointerCancel.bind(this)
  26783. ),
  26784. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  26785. this.cameraControls.on(
  26786. _.Move,
  26787. this.handleControlMove.bind(this)
  26788. ),
  26789. this.cameraControls.on(
  26790. _.InputStart,
  26791. this.handleControlInputStart.bind(this)
  26792. ),
  26793. this.cameraControls.on(
  26794. _.Pinch,
  26795. this.handleControlPinch.bind(this)
  26796. ),
  26797. this.cameraControls.on(
  26798. _.Scroll,
  26799. this.handleControlScroll.bind(this)
  26800. ),
  26801. window.addEventListener(
  26802. "snapshotBegin",
  26803. this.getWrapShot.bind(this)
  26804. ), //xzw add
  26805. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  26806. // lzb
  26807. window.getSeft && getSeft(this);
  26808. }),
  26809. (n.prototype.onMouseDown = function (e) {
  26810. e.currentTarget !== document && e.currentTarget.focus(),
  26811. 0 === e.button &&
  26812. (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  26813. this.updateIntersect());
  26814. }),
  26815. (n.prototype.onMouseMove = function (e) {
  26816. (this.isTouchEvent = !1),
  26817. this.handleInputMove.call(this, e.clientX, e.clientY, !1);
  26818. }),
  26819. (n.prototype.onMouseOver = function (e) {
  26820. (this.containsMouse = !0),
  26821. !this.mouseDown ||
  26822. (0 !== e.which && 0 !== e.buttons) ||
  26823. (this.mouseDown = !1);
  26824. }),
  26825. (n.prototype.onMouseOut = function (e) {
  26826. this.containsMouse = !1;
  26827. }),
  26828. (n.prototype.onMouseUp = function (e) {
  26829. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  26830. }),
  26831. (n.prototype.onTouchStart = function (e) {
  26832. if (
  26833. (e.currentTarget !== document && e.currentTarget.focus(),
  26834. !this.mouseDown)
  26835. ) {
  26836. this.couldBeLongTap = !0;
  26837. var t = g.average(e.changedTouches, "clientX"),
  26838. i = g.average(e.changedTouches, "clientY");
  26839. this.handleInputStart.call(this, t, i, !0),
  26840. (this.mouseDownTimer = setTimeout(
  26841. function () {
  26842. this.updateIntersect(),
  26843. this.handleInputEnd.call(this, t, i, !0);
  26844. }.bind(this),
  26845. f.input.longTapThreshold
  26846. ));
  26847. }
  26848. }),
  26849. (n.prototype.onTouchMove = function (e) {
  26850. var t = g.average(e.changedTouches, "clientX"),
  26851. i = g.average(e.changedTouches, "clientY");
  26852. this.handleInputMove.call(this, t, i, !0);
  26853. }),
  26854. (n.prototype.onTouchEnd = function (e) {
  26855. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  26856. (this.couldBeLongTap = !1), this.updateIntersect();
  26857. var t = g.average(e.changedTouches, "clientX"),
  26858. i = g.average(e.changedTouches, "clientY");
  26859. this.handleInputEnd.call(this, t, i, !0);
  26860. }
  26861. //add
  26862. if (this.intersectHot) this.intersectHot.setHoverState(false);
  26863. this.intersectHot = null;
  26864. Hot.mobileAutoPlay(this);
  26865. }),
  26866. (n.prototype.onPointerDown = function (e) {
  26867. return (
  26868. e.currentTarget !== document && e.currentTarget.focus(),
  26869. this.mouseDown || "mouse" === e.pointerType
  26870. ? this.onMouseDown(e)
  26871. : ((this.couldBeLongTap = !0),
  26872. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  26873. void (this.mouseDownTimer = setTimeout(
  26874. function () {
  26875. this.updateIntersect(),
  26876. this.handleInputEnd.call(
  26877. this,
  26878. e.clientX,
  26879. e.clientY,
  26880. !0
  26881. );
  26882. }.bind(this),
  26883. f.input.longTapThreshold
  26884. )))
  26885. );
  26886. }),
  26887. (n.prototype.onPointerMove = function (e) {
  26888. "mouse" !== e.pointerType
  26889. ? this.handleInputMove.call(this, e.clientX, e.clientY, !0)
  26890. : this.onMouseMove(e);
  26891. }),
  26892. (n.prototype.onPointerUp = function (e) {
  26893. return this.mouseDown && "mouse" !== e.pointerType
  26894. ? (clearTimeout(this.mouseDownTimer),
  26895. (this.couldBeLongTap = !1),
  26896. this.updateIntersect(),
  26897. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  26898. : this.onMouseUp(e);
  26899. }),
  26900. (n.prototype.onPointerOut = function (e) {
  26901. this.mouseDown = !1;
  26902. }),
  26903. (n.prototype.onPointerCancel = function (e) {
  26904. this.mouseDown = !1;
  26905. }),
  26906. (n.prototype.onKeyDown = function (e) {
  26907. var t = function () {
  26908. this.cameraControls.activeControl &&
  26909. this.cameraControls.activeControl.emit(_.Move, "key");
  26910. }.bind(this),
  26911. i = e.which;
  26912. switch (i) {
  26913. case p.F:
  26914. t(), this.changeFloor(-1);
  26915. break;
  26916. case p.R:
  26917. t(), this.changeFloor(1);
  26918. }
  26919. if (this.mode === u.PANORAMA)
  26920. switch (i) {
  26921. case p.UPARROW:
  26922. case p.W:
  26923. this.flyLocalDirection(d.FORWARD.clone());
  26924. break;
  26925. case p.DOWNARROW:
  26926. case p.S:
  26927. this.flyLocalDirection(d.BACK.clone());
  26928. break;
  26929. case p.A:
  26930. this.flyLocalDirection(d.LEFT.clone());
  26931. break;
  26932. case p.D:
  26933. this.flyLocalDirection(d.RIGHT.clone());
  26934. }
  26935. }),
  26936. (n.prototype.handleScrollPinchZoom = (function () {
  26937. return function (e) {
  26938. var t = e,
  26939. i = this.zoomLevel;
  26940. this.zoomBy(t),
  26941. this.currentPano &&
  26942. this.zoomStats.addZoomAction(
  26943. i,
  26944. this.zoomLevel,
  26945. this.currentPano.id
  26946. );
  26947. };
  26948. })()),
  26949. (n.prototype.handleControlPinch = function (e) {
  26950. f.zoom.enabled
  26951. ? this.handleScrollPinchZoom(1 - e)
  26952. : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize());
  26953. }),
  26954. (n.prototype.handleControlScroll = function (e) {
  26955. f.zoom.enabled
  26956. ? (e > 0
  26957. ? (e = 1 + this.scrollZoomSpeed)
  26958. : e < 0 && (e = 1 - this.scrollZoomSpeed),
  26959. 0 !== e && this.handleScrollPinchZoom(e))
  26960. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize());
  26961. }),
  26962. (n.prototype.handleInputStart = function (e, t, i) {
  26963. //许钟文加
  26964. var pad = this.handelPadding(e, t);
  26965. e = pad.x;
  26966. t = pad.y;
  26967. (this.isTouchEvent = i),
  26968. m.convertScreenPositionToNDC(e, t, this.mouse),
  26969. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  26970. (this.mouseCouldBeClickToMove = !0),
  26971. (this.mouseDown = !0);
  26972. Hot.mobileAutoPlay(this);
  26973. }),
  26974. (n.prototype.handelPadding = function (x, y) {
  26975. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  26976. if (!this.pad)
  26977. this.pad = {
  26978. x: dom.getOffset("left", $("#player")[0]),
  26979. y: dom.getOffset("top", $("#player")[0]),
  26980. };
  26981. return {
  26982. x: x - this.pad.x,
  26983. y: y - this.pad.y,
  26984. };
  26985. });
  26986. (n.prototype.handleInputMove = function (e, t, i) {
  26987. //许钟文加
  26988. var pad = this.handelPadding(e, t);
  26989. e = pad.x;
  26990. t = pad.y;
  26991. (this.isTouchEvent = i),
  26992. m.convertScreenPositionToNDC(e, t, this.mouse),
  26993. this.mouseAtMouseDown.distanceTo(this.mouse) >
  26994. f.input.moveToleranceNDC &&
  26995. ((this.mouseCouldBeClickToMove = !1),
  26996. (this.couldBeLongTap = !1),
  26997. clearTimeout(this.mouseDownTimer)),
  26998. (this.mouseLastMoveTime = Date.now()),
  26999. this.reticule.move(e, t, i);
  27000. }),
  27001. (n.prototype.handleInputEnd = function (e, t, i) {
  27002. //xzw
  27003. if (
  27004. ((this.isTouchEvent = i),
  27005. (this.mouseDown = !1),
  27006. this.cameraControls.controls[u.PANORAMA].emit(
  27007. "interaction.direct"
  27008. ),
  27009. !i && this.couldBeLongTap)
  27010. )
  27011. return !0;
  27012. if (this.handleLongTap()) return !0;
  27013. if (this.mouseCouldBeClickToMove) {
  27014. if (this.flying)
  27015. return (
  27016. this.path.activeTransType === x.WALK &&
  27017. this.emit(
  27018. w.WarpInterruptedWithFlyTo,
  27019. this.path.activeTransType
  27020. ),
  27021. !0
  27022. );
  27023. //add----
  27024. if (this.checkHotClick())
  27025. //add
  27026. return !0;
  27027. if (this.hoveringPlane) {
  27028. this.clickOverlay(this.hoveringPlane);
  27029. return;
  27030. }
  27031. if (
  27032. (this.cameraControls.activeControl &&
  27033. this.cameraControls.activeControl.emit(
  27034. _.Move,
  27035. this.isTouchEvent ? "touch" : "mouse"
  27036. ),
  27037. this.history.invalidate(),
  27038. this.intersect)
  27039. )
  27040. return this.flyToPanoClosestToMouse();
  27041. if (this.mode === u.PANORAMA) {
  27042. var n = this.closestPanoInDirection(this.getMouseDirection());
  27043. return n
  27044. ? this.flyToPano({
  27045. pano: n,
  27046. })
  27047. : this.bump(this.getMouseDirection());
  27048. }
  27049. }
  27050. this.intersect &&
  27051. this.closestPano &&
  27052. this.closestPano.hoverOff(this.mode);
  27053. }),
  27054. (n.prototype.handleLongTap = function () {
  27055. if (
  27056. this.couldBeLongTap &&
  27057. (!this.isPanoHover || this.mode !== u.PANORAMA)
  27058. )
  27059. return (
  27060. this.cameraControls.activeControl &&
  27061. this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  27062. !0
  27063. );
  27064. }),
  27065. (n.prototype.checktagClick = function () {
  27066. if (this.tagManager.intersectTag) {
  27067. var e = this.isTouchEvent,
  27068. t = this.tagManager.clickedOnTag(e, this);
  27069. return e || t || y.cancelById(V.LookTransition), !0;
  27070. }
  27071. if (this.tagManager.activeTag)
  27072. return this.tagManager.dismissActiveTag(), !1;
  27073. }),
  27074. (n.prototype.rankedtagInDirection = function (e, t) {
  27075. return this.tagManager.rankedtagInDirection(
  27076. e,
  27077. this.position,
  27078. this.camera,
  27079. t
  27080. );
  27081. }),
  27082. (n.prototype.start = function (e) {
  27083. //-------------------
  27084. //-------------------
  27085. var t = e.mode,
  27086. i = e.pano,
  27087. n = e.position,
  27088. rr = e.quaternion,
  27089. o = e.tag,
  27090. a = e.quickstart,
  27091. s = $.Deferred();
  27092. this.updateModelDependentData(),
  27093. this.updateFromControls(),
  27094. this.findDefaultViews();
  27095. var l = this.is360View(t, i);
  27096. return (
  27097. !this.model.outsideAllowed() || l || a
  27098. ? this.startInside(i, n, rr, o, s)
  27099. : this.startOutside(e, s),
  27100. s.done(
  27101. function (e) {
  27102. this.emit(w.Ready, l, e, o);
  27103. }.bind(this)
  27104. ),
  27105. s.promise()
  27106. );
  27107. }),
  27108. (n.prototype.startOutside = function (e, t) {
  27109. var i = e.mode,
  27110. n = e.pano,
  27111. r = e.position,
  27112. o = e.quaternion,
  27113. a = e.zoom,
  27114. s = e.floorVisibility,
  27115. l = e.tag;
  27116. this.emit(w.StartOutside, f[i].transitionTime),
  27117. this.isOutsideMode(i)
  27118. ? (this.model.warpDestFloors(s, !0),
  27119. y.cancelById(V.FlyToViewFloor),
  27120. i === u.FLOORPLAN
  27121. ? this.floorplanMode(r, o, a)
  27122. : this.dollhouseMode(r, o),
  27123. t.resolve(!1))
  27124. : this.startInsideWithFlyin(n, r, o, l, t);
  27125. }),
  27126. (n.prototype.startInside = function (e, t, i, n, r) {
  27127. (r = r || $.Deferred()), (this.currentPano = e);
  27128. window.bus.dispatchEvent({ type: "playerAndModelReady" });
  27129. this.ready = true;
  27130. var o = e && !e.isAligned();
  27131. if (
  27132. ((t = o ? e.position : t || e.position),
  27133. (i = i || e.quaternion),
  27134. e)
  27135. ) {
  27136. var a = this.startInside.bind(this, e, t, i, n, r);
  27137. if (
  27138. this.checkAndWaitForPanoLoad(
  27139. e,
  27140. "high",
  27141. "low",
  27142. this.basePanoSize,
  27143. a
  27144. )
  27145. )
  27146. return;
  27147. }
  27148. //add
  27149. this.transitionPos({
  27150. type: "beforeFlytopano",
  27151. pano: this.currentPano,
  27152. dur: 0,
  27153. });
  27154. //this.updateHotVisible()
  27155. Hot.updateVisibles([this.currentPano]);
  27156. this.modeTran = "panorama-panorama";
  27157. return (
  27158. (this.mode = u.PANORAMA),
  27159. e.floor.enter(this.mode),
  27160. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  27161. this.switchCameraMode(this.mode, i),
  27162. this.emit(w.StartInside, o),
  27163. r.resolve(!0),
  27164. r
  27165. );
  27166. }),
  27167. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  27168. if (((r = r || $.Deferred()), this.dollhouseMode(), !e))
  27169. return (
  27170. F.warn(
  27171. "Player.startInsideWithFlyin() -> targetPano is invalid."
  27172. ),
  27173. r.resolve(!1),
  27174. r
  27175. );
  27176. t = t || e.position;
  27177. var o = i || this.cameraControls.activeControl.camera.quaternion,
  27178. a = e.position;
  27179. return (
  27180. this.fitDollhouse(a, t, o),
  27181. setTimeout(
  27182. function (t) {
  27183. this.cameraControls.activeControl &&
  27184. (this.cameraControls.activeControl.maxDistance = t);
  27185. var n = {
  27186. mode: u.PANORAMA,
  27187. pano: e,
  27188. quaternion: i,
  27189. callback: function () {
  27190. this.emit(w.FlyinFinished), r.resolve(!0);
  27191. }.bind(this),
  27192. };
  27193. this.flyToNewMode(n);
  27194. }.bind(this, this.cameraControls.activeControl.maxDistance),
  27195. f.startupFlyinDelay
  27196. ),
  27197. r
  27198. );
  27199. }),
  27200. (n.prototype.checkAndWaitForPanoLoad = (function () {
  27201. var e = {},
  27202. t = {},
  27203. i = 5e3,
  27204. n = function () {
  27205. for (var n in e)
  27206. if (e.hasOwnProperty(n) && e[n]) {
  27207. var r = performance.now() - t[n];
  27208. if (r < i) return !0;
  27209. }
  27210. return !1;
  27211. };
  27212. return function (r, o, a, s, l, c, h, u, d, p) {
  27213. if (n()) return !0;
  27214. var f = function (t, i, n) {
  27215. N.delayOneFrame(
  27216. function () {
  27217. (e[t] = !1), l && l(i, n);
  27218. }.bind(this)
  27219. );
  27220. }.bind(this, r.id),
  27221. g = function (t, i) {
  27222. N.delayOneFrame(
  27223. function () {
  27224. (e[t] = !1), c && c(i);
  27225. }.bind(this)
  27226. );
  27227. }.bind(this, r.id);
  27228. try {
  27229. return (
  27230. (null !== u && void 0 !== u) || (u = !0),
  27231. this.model.supportsTiles
  27232. ? (e[r.id] = this.checkAndWaitForTiledPanoLoad(
  27233. r,
  27234. s,
  27235. f,
  27236. g,
  27237. h,
  27238. u,
  27239. d,
  27240. p
  27241. ))
  27242. : (e[r.id] = this.checkAndWaitForWholePanoLoad(
  27243. r,
  27244. o,
  27245. a,
  27246. f,
  27247. u
  27248. )),
  27249. e[r.id] && (t[r.id] = performance.now()),
  27250. e[r.id]
  27251. );
  27252. } catch (n) {
  27253. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n);
  27254. }
  27255. };
  27256. })()),
  27257. (n.prototype.checkAndWaitForWholePanoLoad = function (
  27258. e,
  27259. t,
  27260. i,
  27261. n,
  27262. r
  27263. ) {
  27264. if (!e)
  27265. throw new M(
  27266. "Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano."
  27267. );
  27268. return (
  27269. r &&
  27270. this.model.waitForLoad(e, function () {
  27271. return e.isLoaded(i);
  27272. }),
  27273. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  27274. );
  27275. }),
  27276. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  27277. var e = new r.Vector3();
  27278. return function (t, i, n, r, o, a, s, l) {
  27279. if (!t)
  27280. throw new M(
  27281. "Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano."
  27282. );
  27283. return (
  27284. e.copy(d.FORWARD),
  27285. this.getDirection(e),
  27286. !t.isLoaded(i) &&
  27287. (a &&
  27288. this.model.waitForLoad(t, function () {
  27289. return t.isLoaded(i);
  27290. }),
  27291. t
  27292. .loadTiledPano(i, e, null, s, l)
  27293. .done(
  27294. function (e, t) {
  27295. n && n(e, t);
  27296. }.bind(this)
  27297. )
  27298. .fail(
  27299. function (e) {
  27300. r && r(e);
  27301. }.bind(this)
  27302. )
  27303. .progress(
  27304. function (e, t, i) {
  27305. o && o(e, t, i);
  27306. }.bind(this)
  27307. ),
  27308. !0)
  27309. );
  27310. };
  27311. })()),
  27312. (n.prototype.switchCameraMode = function (e, t) {
  27313. var i = this.cameraControls.controls[e],
  27314. n = i.camera;
  27315. switch (e) {
  27316. case u.PANORAMA:
  27317. n.position.copy(this.currentPano.position);
  27318. var o = t
  27319. ? d.FORWARD.clone().applyQuaternion(t)
  27320. : this.getDirection().setY(0).normalize();
  27321. i.lookAt(o.add(n.position));
  27322. break;
  27323. case u.DOLLHOUSE:
  27324. /* var a = this.position.clone();
  27325. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  27326. n.position.copy(a),
  27327. i.target.copy(this.target.clone().setY(this.model.center.y));
  27328. break; */
  27329. //for多楼层 且 让模型刚好适应屏幕
  27330. var box = this.model.boundingBox.clone();
  27331. box.applyMatrix4(this.camera.matrixWorld); //将 boundingbox、也就是模型, 转换到当前相机朝向
  27332. var boxSize = box.size(); //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  27333. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  27334. var distance =
  27335. Math.abs(boxSize.x) /
  27336. 2 /
  27337. Math.tan(THREE.Math.degToRad(fov / 2)); //根据上面获得的参数得到target到相机的距离
  27338. //console.log(boxSize.x,distance, boxSize.length() / 2)
  27339. distance += boxSize.length() / 2; //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  27340. if (this.mode === u.PANORAMA) {
  27341. i.target.copy(this.model.center);
  27342. var vec = this.getDirection().negate().setY(1).normalize(); //获得朝向
  27343. } else {
  27344. i.target.copy(
  27345. this.target.clone().setY(this.model.center.y)
  27346. );
  27347. var vec = d.DOWN.clone()
  27348. .applyQuaternion(this.quaternion)
  27349. .setY(1)
  27350. .normalize();
  27351. }
  27352. vec.multiplyScalar(distance);
  27353. n.position.copy(i.target.clone().add(vec));
  27354. break;
  27355. case u.FLOORPLAN:
  27356. n.position
  27357. .copy(this.model.center)
  27358. .setY(f.floorplan.cameraHeight),
  27359. i.target.copy(this.model.center).setY(0),
  27360. i.zoomToContain(this.model.size),
  27361. i.rotateToView(this.model.size, this.getDirection());
  27362. }
  27363. i.update(0);
  27364. }),
  27365. (n.prototype.update = (function () {
  27366. var e = (new r.Vector3(), {}),
  27367. t = [];
  27368. return function (i) {
  27369. this.updatePersistentZooming(i),
  27370. this.updateFromControls(i),
  27371. this.getCurrentNodePanos(t);
  27372. this.lastFrameChanged = false;
  27373. if (this.hasChanged(e)) {
  27374. this.lastFrameChanged = e.cameraChanged3
  27375. ? "level3"
  27376. : e.cameraChanged2
  27377. ? "level2"
  27378. : e.cameraChanged
  27379. ? "level1"
  27380. : false;
  27381. (this.lastChangeTime = Date.now()),
  27382. !this.mouseDown &&
  27383. this.containsMouse &&
  27384. this.updateIntersect(),
  27385. this.emit(w.ViewChanged, e),
  27386. this.intersect &&
  27387. this.magnifier &&
  27388. this.magnifier.update(this.intersect.point);
  27389. }
  27390. if (e.cameraChanged2) {
  27391. //变化要更大些
  27392. }
  27393. if (e.cameraChanged) {
  27394. this.mode == "panorama" &&
  27395. window.cad &&
  27396. cad.setSign(
  27397. { x: this.position.x, y: this.position.z },
  27398. this.cameraControls.controls.panorama.lon
  27399. );
  27400. /* for(var i in this.model.hots){
  27401. this.model.hots[i].updateTitle(this)
  27402. } */
  27403. Hot.updateHots();
  27404. }
  27405. this.model.supportsTiles &&
  27406. (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  27407. this.updatePreRendering(t),
  27408. this.reticule.update(),
  27409. this.path.update(),
  27410. this.spider.update(),
  27411. this.cachedPanoCandidates &&
  27412. f.navigation.panoScores &&
  27413. this.model.panos.showPanoScores(this.cachedPanoCandidates),
  27414. this.updateControlLocks(),
  27415. this.model.supportsTiles && this.updateZoomPano();
  27416. };
  27417. })()),
  27418. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  27419. var lastMode, lastPano;
  27420. return function(){
  27421. var mode = this.mode;
  27422. var pano = mode == "panorama" ? this.currentPano : "";
  27423. if(mode != "panorama" || pano != lastPano){
  27424. overlay.noBlock = null
  27425. }
  27426. this.overlayGroup.children.forEach((overlay)=>{
  27427. if(overlay.overlayType == "video" ){
  27428. var matrix = overlay.plane.matrixWorld;
  27429. var inSight = false;
  27430. var cameraDir = this.getDirection();
  27431. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  27432. var vertexes = []
  27433. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  27434. for(let i=0; i<4; i++){
  27435. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  27436. vertexes.push(vertex)
  27437. if(overlay.noBlock == null){
  27438. if(!m.ifShelter(vertex)){
  27439. overlay.noBlock = true
  27440. }
  27441. inSight = true; break;
  27442. }else{
  27443. overlay.noBlock = true
  27444. }
  27445. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  27446. inSight = true; break;
  27447. }
  27448. }
  27449. }
  27450. overlay.inSight = inSight
  27451. if(!inSight)overlay.plane.material.map.image.pause()
  27452. else overlay.plane.material.map.image.play()//maybe fail
  27453. }
  27454. })
  27455. lastMode = mode, lastPano = pano
  27456. }
  27457. }() */
  27458. (n.prototype.updatePersistentZooming = function (e) {
  27459. 1 === this.zooming
  27460. ? this.zoomBy(1 + this.zoomSpeed * e)
  27461. : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e);
  27462. }),
  27463. (n.prototype.updateControlLocks = function () {
  27464. this.currentPano &&
  27465. this.model.supportsTiles &&
  27466. (this.cameraControls.controls[u.PANORAMA].locked =
  27467. !this.currentPano.highestFullTileRenderOpCompleted &&
  27468. this.currentPano.lockUntilRenderingComplete);
  27469. }),
  27470. (n.prototype.updatePanoRenderer = (function () {
  27471. var e = new r.Vector3();
  27472. return function (t) {
  27473. var i = this.nextPano || this.currentPano;
  27474. this.panoRenderer.hasQueuedTiles() &&
  27475. i &&
  27476. (e.copy(d.FORWARD),
  27477. this.getDirection(e),
  27478. this.panoRenderer.updateDirection(e));
  27479. };
  27480. })()),
  27481. (n.prototype.cleanupInactivePanos = (function () {
  27482. var e = [],
  27483. t = [];
  27484. return function () {
  27485. (e.length = 0),
  27486. e.push(this.currentPano),
  27487. this.nextPano && e.push(this.nextPano),
  27488. (t.length = 0);
  27489. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  27490. t.push(this.panoRenderer.activePanos[i]);
  27491. for (var n = 0; n < t.length; n++) {
  27492. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  27493. r.id === e[a].id && (o = !1);
  27494. o && r.exit();
  27495. }
  27496. };
  27497. })()),
  27498. (n.prototype.updatePreRendering = (function () {
  27499. var e = {};
  27500. return function (t) {
  27501. if (
  27502. 1 === f.tiling.preRenderTourPanos &&
  27503. this.preRenderingEnabled
  27504. ) {
  27505. var i = this.nextPano || this.currentPano;
  27506. if (i && t && t.length > 1) {
  27507. var n = t.findIndex(function (e) {
  27508. if (e.id === i.id) return !0;
  27509. });
  27510. if (n >= 0 && n + 1 < t.length) {
  27511. var r = t[n + 1];
  27512. r.isLoaded(this.basePanoSize) ||
  27513. e[r.id] ||
  27514. (window.setTimeout(
  27515. function (t) {
  27516. this.checkAndWaitForPanoLoad(
  27517. t,
  27518. "high",
  27519. "low",
  27520. this.basePanoSize,
  27521. null,
  27522. null,
  27523. null,
  27524. !1,
  27525. !1,
  27526. !1
  27527. ),
  27528. window.setTimeout(
  27529. function (t) {
  27530. e[t.id] = !1;
  27531. }.bind(this, t),
  27532. f.tiling.panoPreRenderRepeatDelay
  27533. );
  27534. }.bind(this, r),
  27535. f.tiling.panoPreRenderDelay
  27536. ),
  27537. (e[r.id] = !0));
  27538. }
  27539. }
  27540. }
  27541. };
  27542. })()),
  27543. (n.prototype.enablePreRendering = function () {
  27544. this.preRenderingEnabled = !0;
  27545. }),
  27546. (n.prototype.disablePreRendering = function () {
  27547. (this.preRenderingEnabled = !1), this.cleanupInactivePanos();
  27548. }),
  27549. (n.prototype.updateTileDownloader = (function () {
  27550. var e = new r.Vector3();
  27551. return function (t) {
  27552. var i = this.nextPano || this.currentPano;
  27553. i &&
  27554. (e.copy(d.FORWARD),
  27555. this.getDirection(e),
  27556. this.tileDownloader.tilePrioritizer.updateCriteria(
  27557. i,
  27558. this.position,
  27559. e,
  27560. t.length > 0 ? t : null
  27561. ),
  27562. (this.tileDownloader.processPriorityQueue = !0));
  27563. };
  27564. })()),
  27565. (n.prototype.updateFromControls = function (e) {
  27566. (null !== e && void 0 !== e) || (e = 0),
  27567. this.cameraControls.activeControl &&
  27568. (this.cameraControls.activeControl.update(e),
  27569. this.quaternion.copy(
  27570. this.cameraControls.activeControl.camera.quaternion
  27571. ),
  27572. this.position.copy(
  27573. this.cameraControls.activeControl.camera.position
  27574. ),
  27575. this.target.copy(this.cameraControls.activeControl.target),
  27576. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  27577. this.camera.projectionMatrix.copy(
  27578. this.cameraControls.activeControl.camera.projectionMatrix
  27579. )),
  27580. this.camera.position.copy(this.position),
  27581. this.camera.quaternion.copy(this.quaternion),
  27582. this.camera.updateMatrix(),
  27583. this.camera.updateMatrixWorld();
  27584. }),
  27585. (n.prototype.hasChanged = function (e) {
  27586. if (!this.previousState) {
  27587. this.previousState = {
  27588. allFloorsVisible: this.model.allFloorsVisible,
  27589. position: this.position.clone(),
  27590. quaternion: this.quaternion.clone(),
  27591. mouse: this.mouse.clone(),
  27592. //labelScaleFactor: this.getLabelScaleFactor(),
  27593. currentFloor: this.model.currentFloor,
  27594. projectionMatrix: this.camera.projectionMatrix.clone(),
  27595. worldMatrix: this.camera.matrixWorld.clone(),
  27596. mode: this.mode,
  27597. modelPosition: this.model.position.clone(),
  27598. modelCenter: this.model.center.clone(),
  27599. zoomLevel: this.zoomLevel,
  27600. };
  27601. e.cameraChanged = e.cameraChanged2 = true;
  27602. return !0;
  27603. }
  27604. //许钟文改 分成相机是否改变cameraChanged 和其他
  27605. var a =
  27606. this.position.equals(this.previousState.position) &&
  27607. this.quaternion.equals(this.previousState.quaternion) &&
  27608. this.camera.matrixWorld.equals(
  27609. this.previousState.worldMatrix
  27610. ) &&
  27611. this.camera.projectionMatrix.equals(
  27612. this.previousState.projectionMatrix
  27613. ) &&
  27614. this.mode === this.previousState.mode &&
  27615. this.zoomLevel === this.previousState.zoomLevel &&
  27616. this.model.center.equals(this.previousState.modelCenter) &&
  27617. this.model.position.equals(this.previousState.modelPosition);
  27618. var t =
  27619. a &&
  27620. this.mouse.equals(this.previousState.mouse) &&
  27621. this.model.allFloorsVisible ===
  27622. this.previousState
  27623. .allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  27624. this.model.currentFloor === this.previousState.currentFloor &&
  27625. null === this.nextPano;
  27626. e.cameraChanged = !a;
  27627. (e.allFloorsVisible =
  27628. this.model.allFloorsVisible !==
  27629. this.previousState.allFloorsVisible),
  27630. (e.moved = !this.position.equals(this.previousState.position)),
  27631. (e.rotated = !this.quaternion.equals(
  27632. this.previousState.quaternion
  27633. )),
  27634. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  27635. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  27636. (e.floorChanged =
  27637. this.model.currentFloor !== this.previousState.currentFloor),
  27638. (e.cameraProjectionChanged =
  27639. !this.camera.projectionMatrix.equals(
  27640. this.previousState.projectionMatrix
  27641. )),
  27642. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(
  27643. this.previousState.worldMatrix
  27644. )),
  27645. (e.modeChanged = this.mode !== this.previousState.mode),
  27646. (e.modelPositionChanged = !this.model.position.equals(
  27647. this.previousState.modelPosition
  27648. )),
  27649. (e.modelCenterChanged = !this.model.center.equals(
  27650. this.previousState.modelCenter
  27651. )),
  27652. (e.nextPanoActive = null !== this.nextPano),
  27653. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel);
  27654. /* if(e.cameraChanged){//
  27655. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
  27656. }else e.cameraChanged2 = false */
  27657. if (e.cameraChanged) {
  27658. e.cameraChanged2 =
  27659. e.cameraProjectionChanged ||
  27660. !MathLight.closeTo(
  27661. this.quaternion,
  27662. this.previousState.quaternion,
  27663. 5
  27664. ) ||
  27665. !MathLight.closeTo(
  27666. this.position,
  27667. this.previousState.position,
  27668. 4
  27669. );
  27670. e.cameraChanged3 =
  27671. e.cameraProjectionChanged ||
  27672. !MathLight.closeTo(
  27673. this.quaternion,
  27674. this.previousState.quaternion,
  27675. 3
  27676. ) ||
  27677. !MathLight.closeTo(
  27678. this.position,
  27679. this.previousState.position,
  27680. 3
  27681. );
  27682. } else {
  27683. e.cameraChanged2 = false;
  27684. e.cameraChanged3 = false;
  27685. }
  27686. (this.previousState.allFloorsVisible =
  27687. this.model.allFloorsVisible),
  27688. this.previousState.position.copy(this.position),
  27689. this.previousState.quaternion.copy(this.quaternion),
  27690. this.previousState.mouse.copy(this.mouse),
  27691. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  27692. (this.previousState.currentFloor = this.model.currentFloor),
  27693. this.previousState.projectionMatrix.copy(
  27694. this.camera.projectionMatrix
  27695. ),
  27696. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  27697. (this.previousState.mode = this.mode),
  27698. this.previousState.modelPosition.copy(this.model.position),
  27699. this.previousState.modelCenter.copy(this.model.center),
  27700. (this.previousState.zoomLevel = this.zoomLevel);
  27701. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  27702. return !t;
  27703. }),
  27704. (n.prototype.updateIntersect = function () {
  27705. var e = this.flying || this.isWarping(),
  27706. t =
  27707. this.isOutsideMode() &&
  27708. this.cameraControls.controls[this.mode].isEngaged(),
  27709. i = y.getById(V.LookTransition),
  27710. n = !(
  27711. e ||
  27712. t ||
  27713. this.isTouchEvent ||
  27714. (i.length && i[0].running)
  27715. );
  27716. {
  27717. //clear:
  27718. if (this.intersectHot) this.intersectHot.setHoverState(false);
  27719. this.intersectHot = null;
  27720. $("#player").css("cursor", "");
  27721. }
  27722. var deal = () => {
  27723. if (this.intersect && this.intersect.object.visible) {
  27724. if ("hotSprite" == this.intersect.object.type) {
  27725. this.intersectHot = this.intersect.object;
  27726. while (!(this.intersectHot instanceof Hot)) {
  27727. this.intersectHot = this.intersectHot.parent;
  27728. }
  27729. $(
  27730. `.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`
  27731. ).addClass("active");
  27732. this.intersectHot.setHoverState(true);
  27733. }
  27734. }
  27735. };
  27736. if (this.model.hotGroup) {
  27737. var hots = this.model.hotGroup.children.filter(
  27738. (e) =>
  27739. e.info.actionType.examine ||
  27740. e.info.actionType.fastTran ||
  27741. e.info.actionType.openHot ||
  27742. e.info.actionType.playAndPause
  27743. );
  27744. this.intersect = this.getMouseIntersect(
  27745. null,
  27746. hots.concat(this.model.colliders)
  27747. );
  27748. if (this.intersect) {
  27749. deal();
  27750. let intersect = this.intersect;
  27751. if (this.intersectHot) {
  27752. this.intersect = null;
  27753. $("#player").css("cursor", "pointer");
  27754. } else {
  27755. if (intersect.object.parent.parent.hidden) {
  27756. //楼层已隐藏
  27757. this.intersect = null;
  27758. }
  27759. }
  27760. }
  27761. } else {
  27762. this.intersect = this.getMouseIntersect();
  27763. }
  27764. this.intersect && this.updateClosestPano(this.intersect),
  27765. this.closestPano ||
  27766. this.closestPanoInDirection(this.getMouseDirection())
  27767. ? (this.reticule.updatePosition(
  27768. this.position,
  27769. this.intersect
  27770. ),
  27771. f.navigation.panoScores &&
  27772. !f.navigation.mouseDirection &&
  27773. this.closestPanoInDirection(this.getDirection()))
  27774. : this.reticule.hide();
  27775. }),
  27776. (n.prototype.checkHotClick = function () {
  27777. if (this.intersectHot) {
  27778. if (
  27779. this.intersectHot.texType == "video" &&
  27780. this.intersectHot.info.actionType.playAndPause
  27781. ) {
  27782. this.intersectHot.switchPlay(
  27783. !!this.intersectHot.pausedByUser
  27784. );
  27785. }
  27786. this.intersectHot.examine(this);
  27787. return true;
  27788. }
  27789. }),
  27790. (n.prototype.getMouseDirection = function (e) {
  27791. e = e || this.mouse;
  27792. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  27793. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera);
  27794. return i.sub(t).normalize();
  27795. }),
  27796. (n.prototype.hoverOverlay = function (mesh) {
  27797. if (!mesh) {
  27798. this.hoveringPlane = null;
  27799. $("#player").css("cursor", this.currentCursor || "");
  27800. } else {
  27801. var overlay = mesh.parent;
  27802. $("#player").css("cursor", "pointer");
  27803. this.hoveringPlane = overlay;
  27804. return true;
  27805. }
  27806. }),
  27807. (n.prototype.clickOverlay = function (overlay) {
  27808. if (this.openOverlay && !overlay) return;
  27809. var plane = overlay.plane;
  27810. /* if(overlay.overlayType == "video"){
  27811. if(plane.material.map.image.paused) plane.material.map.image.play()
  27812. else plane.material.map.image.pause()
  27813. } */
  27814. if (overlay.overlayType == "video") {
  27815. overlay.switchPlay(!!overlay.pausedByUser);
  27816. }
  27817. /* if(window.EditOverlay &&EditOverlay.editing){
  27818. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  27819. $('#overlayProp').removeClass('atRight').removeClass('hide')
  27820. EditOverlay.endAddPlane();
  27821. EditOverlay.updateOverlayPanel(overlay)
  27822. EditOverlay.controlSelectOverlay(overlay)
  27823. return;
  27824. } */
  27825. }),
  27826. (n.prototype.getMouseIntersect = function (e, t) {
  27827. //xzw change
  27828. (e = e || this.mouse.clone()),
  27829. (t =
  27830. t ||
  27831. this.model.floors.reduce(
  27832. function (e, t) {
  27833. return t.hidden ? e : e.concat(t.collider.children);
  27834. },
  27835. this.mode === u.PANORAMA ? this.panoMarkers : []
  27836. ));
  27837. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  27838. this.raycaster.set(i, this.getMouseDirection(e));
  27839. var n = this.raycaster.intersectObjects(t, true); //add true
  27840. var o = n[0];
  27841. if (o) {
  27842. o.face &&
  27843. ((o.normal = o.face.normal.applyQuaternion(
  27844. o.object.quaternion
  27845. )),
  27846. this.position.clone().sub(o.point).dot(o.normal) < 0 &&
  27847. o.normal.negate(),
  27848. this.currentPano
  27849. ? (o.onFloor =
  27850. o.point.y <
  27851. this.position.y - 0.5 * this.currentPano.height)
  27852. : (o.onFloor = o.point.y < this.position.y - 0.5),
  27853. (o.horizontal = 0.8 < o.normal.y));
  27854. return o;
  27855. }
  27856. }),
  27857. (n.prototype.updateClosestPano = function (e) {
  27858. var t = [s.filters.isPanoAligned()];
  27859. if (this.mode === u.PANORAMA) {
  27860. if (!this.currentPano) return;
  27861. t.push(s.filters.not(this.currentPano)),
  27862. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  27863. t.push(
  27864. s.filters.inFloorDirection(
  27865. this.currentPano.floorPosition,
  27866. this.getDirection(),
  27867. 0.25
  27868. )
  27869. ),
  27870. t.push(
  27871. s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)
  27872. ),
  27873. t.push(s.filters.isNotBehindNormal(e.point, e.normal));
  27874. } else {
  27875. t.push(s.filters.isOnVisibleFloor()),
  27876. t.push(this.checkHasNeighbor); //add
  27877. this.mode !== u.FLOORPLAN &&
  27878. t.push(
  27879. s.filters.inDirection(
  27880. this.position,
  27881. this.getDirection(),
  27882. 0.25
  27883. )
  27884. );
  27885. }
  27886. var i = this.model.panos.find(t, [
  27887. s.sortFunctions.floorDistanceToPoint(e.point),
  27888. ]);
  27889. i !== this.closestPano
  27890. ? (i && (this.isPanoHover = !0),
  27891. this.emit(
  27892. w.ClosestPanoChanging,
  27893. this.closestPano,
  27894. i,
  27895. this.mode
  27896. ),
  27897. (this.closestPano = i))
  27898. : (this.isPanoHover = !1);
  27899. }),
  27900. (n.prototype.dollhouseMode = function (e, t) {
  27901. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  27902. (this.mode = u.DOLLHOUSE),
  27903. this.cameraControls.controls[u.DOLLHOUSE].reset();
  27904. var i = new r.Vector3(
  27905. this.model.center.x,
  27906. 0,
  27907. this.model.center.z
  27908. ),
  27909. n = new r.Vector3(15, 10, 15);
  27910. if (e && t) {
  27911. var o = d.FORWARD.clone().applyQuaternion(t),
  27912. a = this.model.center.clone().sub(e),
  27913. s = a.dot(o);
  27914. s > 0
  27915. ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e))
  27916. : F.warn(
  27917. "Tried to initiate dollhouse mode that wasn't looking at the model",
  27918. e,
  27919. t
  27920. );
  27921. }
  27922. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  27923. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  27924. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  27925. this.updateFromControls(),
  27926. (this.model.alpha = 1),
  27927. (this.model.skybox.material.uniforms.opacity.value = 0);
  27928. }),
  27929. (n.prototype.insideMode = function (e, t) {
  27930. var i = $.Deferred(),
  27931. n = t || null;
  27932. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  27933. var r = [s.filters.isPanoAligned()];
  27934. this.model.currentFloor &&
  27935. r.push(s.filters.atFloor(this.model.currentFloor)),
  27936. (e =
  27937. e ||
  27938. this.currentPano ||
  27939. this.model.panos.find(r, [
  27940. s.sortFunctions.distanceToPoint(
  27941. this.cameraControls.activeControl.target
  27942. ),
  27943. ])),
  27944. this.flyToNewMode({
  27945. mode: u.PANORAMA,
  27946. pano: e,
  27947. callback: n,
  27948. })
  27949. .done(i.resolve.bind(i))
  27950. .fail(i.reject.bind(i));
  27951. } else {
  27952. var o =
  27953. this.mode === u.PANORAMA
  27954. ? "Already in panorama mode"
  27955. : "Cannot change mode during mode transition";
  27956. i.reject(o);
  27957. }
  27958. return i.promise();
  27959. }),
  27960. (n.prototype.fitDollhouse = function (e, t, i) {
  27961. //许钟文改 飞入前寻找和初始视角最合适的位置
  27962. //if(urlHasValue('oldEntry')){
  27963. //搬自一代。
  27964. var maxY = this.model.boundingBox.max.y;
  27965. var n = d.FORWARD.clone().applyQuaternion(i),
  27966. i = n.clone().add(e);
  27967. this.cameraControls.activeControl.target.copy(i),
  27968. this.cameraControls.activeControl.camera.position
  27969. .set(0, maxY * 2.4, 0)
  27970. .add(e)
  27971. .add(n.multiplyScalar(-10));
  27972. //return;
  27973. /* //this.camera.position.copy(this.model.center);
  27974. //this.camera.updateMatrixWorld()
  27975. this.switchCameraMode("dollhouse", i) */
  27976. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  27977. //直接用一代的这个 效果和二代几乎一样,且不会甩
  27978. /* var n = d.FORWARD.clone().applyQuaternion(i);
  27979. this.cameraControls.activeControl.target.copy(n).add(e);
  27980. var o = d.RIGHT.clone().applyQuaternion(i)
  27981. , a = d.UP.clone()
  27982. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  27983. , l = this.model.boundingBox.max.clone()
  27984. , c = this.model.boundingBox.min.clone()
  27985. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  27986. , u = 0
  27987. , p = 0
  27988. , g = 0;
  27989. h.forEach(function(e, t, i) {
  27990. var n = Math.abs(e.dot(o))
  27991. , r = e.dot(s);
  27992. n > u && (u = n,
  27993. p = r),
  27994. r > g && (g = r)
  27995. });
  27996. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  27997. , v = s.clone().multiplyScalar(p).add(t)
  27998. , A = s.clone().multiplyScalar(g).add(t);
  27999. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  28000. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  28001. p = Math.max(p, 10),
  28002. g = Math.max(g, 10);
  28003. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  28004. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  28005. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  28006. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  28007. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  28008. */
  28009. }),
  28010. (n.prototype.floorplanMode = function (e, t, i) {
  28011. this.mode = u.FLOORPLAN;
  28012. var n = this.cameraControls.controls[u.FLOORPLAN];
  28013. n.reset();
  28014. var r = e ? e : this.model.center;
  28015. if (
  28016. (n.target.copy(r).setY(0),
  28017. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  28018. i
  28019. ? ((n.currentScale =
  28020. i / ($("#player").width() / $("#player").height())),
  28021. (n.absoluteScale = n.currentScale))
  28022. : n.zoomToContain(this.model.size),
  28023. t)
  28024. ) {
  28025. var o = d.LEFT.clone().applyQuaternion(t);
  28026. n.rotateLeft(-Math.atan2(o.x, o.z));
  28027. } else n.rotateToView(this.model.size, this.getDirection());
  28028. n.update(0);
  28029. }),
  28030. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  28031. return (e.skipWarpingCheck = !0), this.flyToPano(e, t);
  28032. }),
  28033. (n.prototype.updateMarkerVisi = function () {
  28034. //加
  28035. if (this.mode != "panorama") return;
  28036. this.model.panos.list.forEach((pano) => {
  28037. if (!pano.marker) return;
  28038. pano.marker.material.visible =
  28039. !!pano.neighbourPanos[this.currentPano.id];
  28040. });
  28041. }),
  28042. /* n.prototype.updateHotVisible = function(pano){
  28043. var hots = this.model.hots;
  28044. pano = pano || this.currentPano;
  28045. for (var index in hots){
  28046. var visible;
  28047. if(this.mode != "panorama"){
  28048. visible = true;
  28049. }else{
  28050. //hots[index].mesh.material.depthTest = false;
  28051. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  28052. }
  28053. hots[index].mesh.visible = visible;
  28054. }
  28055. } */
  28056. (n.prototype.flyToPano = function (e, t) {
  28057. var i = e.pano,
  28058. aim = e.lookAtPoint,
  28059. aimQua = e.quaternion, //ADD
  28060. o = e.duration,
  28061. a = e.aimDuration,
  28062. s = e.maxDistanceOverride,
  28063. l = e.skipWarpingCheck,
  28064. c = e.constantMoveSpeed,
  28065. h = null,
  28066. p = null;
  28067. if (aim) {
  28068. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP);
  28069. aimQua = new r.Quaternion().setFromRotationMatrix(_);
  28070. } else aimQua = aimQua;
  28071. var zoomLevel = e.zoomLevel || 1; //add
  28072. if (this.flying) return t && t(e);
  28073. window.specialScene &&
  28074. specialScene.special().specifySpot &&
  28075. specialScene.special().specifySpot(i);
  28076. if (
  28077. this.isWarping() &&
  28078. !l &&
  28079. (this.path.activeTransType === x.BLACK ||
  28080. this.path.activeTransType === x.STD)
  28081. )
  28082. return (
  28083. F.warn("Player.flyToPano() -> Cannot fly when warping"),
  28084. t && t(),
  28085. !1
  28086. );
  28087. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  28088. var m;
  28089. void this.flyToNewMode({
  28090. mode: u.PANORAMA,
  28091. pano: i,
  28092. duration: o,
  28093. quaternion: aimQua,
  28094. callback: t,
  28095. });
  28096. }
  28097. if (
  28098. !i ||
  28099. ((h = g.deepExtend(e)),
  28100. (p = function () {
  28101. N.delayOneFrame(
  28102. function () {
  28103. this.flyToPano(h, t);
  28104. }.bind(this)
  28105. );
  28106. }.bind(this)),
  28107. !this.checkAndWaitForPanoLoad(
  28108. i,
  28109. "high",
  28110. "low",
  28111. this.basePanoSize,
  28112. p
  28113. ))
  28114. ) {
  28115. var C = function (e) {
  28116. t && t(e);
  28117. }.bind(this);
  28118. this.currentPano ||
  28119. ((this.currentPano = i),
  28120. this.path.placeCpm(),
  28121. this.path.fadeOutCpm(f.path.fadeOutTime),
  28122. this.spider.draw());
  28123. var I = o;
  28124. if ("number" != typeof o) {
  28125. var E = s || f.transition.flytimeMaxDistanceThreshold;
  28126. I =
  28127. Math.min(
  28128. this.currentPano.position.distanceTo(i.position),
  28129. E
  28130. ) *
  28131. f.transition.flytimeDistanceMultiplier +
  28132. f.transition.flyTime;
  28133. }
  28134. if (
  28135. (f.transition.flySpeed > 0.01 &&
  28136. (I =
  28137. (1e3 * this.currentPano.position.distanceTo(i.position)) /
  28138. f.transition.flySpeed),
  28139. zoomLevel !== this.zoomLevel)
  28140. )
  28141. switch (f.zoom.transitionStyle) {
  28142. case 1:
  28143. this.smoothZoomFovTo(
  28144. null,
  28145. zoomLevel,
  28146. zoomLevel == 1 ? I / 2 : I
  28147. ); //改
  28148. break;
  28149. case 2:
  28150. return (
  28151. (h = g.deepExtend(e)),
  28152. (p = this.flyToPano.bind(this, h, t)),
  28153. void this.smoothZoomFovTo(
  28154. null,
  28155. zoomLevel,
  28156. f.zoom.restoreTime * (this.zoomLevel - 1),
  28157. p
  28158. )
  28159. );
  28160. }
  28161. if (aimQua) {
  28162. y.cancelById(V.LookTransition),
  28163. (I *= f.transition.aimSlowFactor);
  28164. var b =
  28165. this.cameraControls.activeControl.camera.quaternion.clone(),
  28166. S = b.clone(),
  28167. M = new r.Vector3();
  28168. if (i === this.currentPano) {
  28169. var R = d.FORWARD.clone().applyQuaternion(b),
  28170. P = d.FORWARD.clone().applyQuaternion(aimQua),
  28171. O = R.angleTo(P);
  28172. return (
  28173. (void 0 !== a && null !== a) ||
  28174. (a =
  28175. ((1 * Math.sqrt(O)) /
  28176. f.tags.navigate.rotateSpeedFactor) *
  28177. 1e3),
  28178. void y.start(
  28179. function (e) {
  28180. S.copy(b),
  28181. v.quaternion(S, aimQua)(e),
  28182. M.copy(d.FORWARD)
  28183. .applyQuaternion(S)
  28184. .add(
  28185. this.cameraControls.activeControl.camera
  28186. .position
  28187. ),
  28188. this.cameraControls.activeControl.lookAt(M);
  28189. }.bind(this),
  28190. a,
  28191. C,
  28192. 0,
  28193. A[f.transition.movementEasing],
  28194. null,
  28195. V.LookTransition
  28196. )
  28197. );
  28198. }
  28199. }
  28200. if (i === this.currentPano) return void C();
  28201. this.flying = !0;
  28202. var L = this.position.clone(),
  28203. D = this.currentPano;
  28204. F.debug("Flying to pano ", i.position),
  28205. this.emit(w.PanoChosen, this.currentPano, i),
  28206. this.emit(w.FlyingStarted, i.position, L, i, D);
  28207. //---------before fly--------------- add
  28208. //this.updateHotVisible(i); //更新热点显示
  28209. this.transitionPos({
  28210. type: "beforeFlytopano",
  28211. pano: i,
  28212. dur: I,
  28213. }); //add
  28214. Hot.updateVisibles([this.currentPano, i]);
  28215. //地标变化
  28216. if (this.model.floorLogos) {
  28217. this.model.changefloorLogoOpa({
  28218. index: 0,
  28219. opa: 0,
  28220. dur: p,
  28221. delay: 0.7,
  28222. }); //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  28223. this.model.floorLogos[1].position.copy(
  28224. i.floorPosition.clone().sub(this.model.position)
  28225. );
  28226. //this.model.adjustfloorLogoHeight();
  28227. this.model.floorLogos[1].material.opacity = 0; //uniforms.opacity.value = 0;
  28228. this.model.floorLogos[1].visible = true;
  28229. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }); //this.model.floorLogoShow(1,250);
  28230. }
  28231. //=======================================
  28232. this.nextPano = i;
  28233. let beginTran = () => {
  28234. aimQua &&
  28235. y.start(
  28236. function (e) {
  28237. S.copy(b),
  28238. v.quaternion(S, aimQua)(e),
  28239. M.copy(d.FORWARD)
  28240. .applyQuaternion(S)
  28241. .add(
  28242. this.cameraControls.activeControl.camera.position
  28243. ),
  28244. this.cameraControls.activeControl.lookAt(M);
  28245. }.bind(this),
  28246. I,
  28247. null,
  28248. 0,
  28249. A[f.transition.movementEasing],
  28250. null,
  28251. V.LookTransition
  28252. );
  28253. var B = c ? null : A[f.transition.movementEasing];
  28254. y.start(
  28255. v.uniform(this.model.skybox, "progress", 1),
  28256. I,
  28257. null,
  28258. 0,
  28259. A[f.transition.blendEasing],
  28260. "skyFly",
  28261. V.FlyToPano
  28262. ),
  28263. y.start(
  28264. v.allUniforms(this.model.chunks, "progress", 1),
  28265. I,
  28266. null,
  28267. 0,
  28268. A[f.transition.blendEasing],
  28269. "chunkFly",
  28270. V.FlyToPano
  28271. ),
  28272. y.start(
  28273. v.vector(
  28274. this.cameraControls.cameras[u.PANORAMA].position,
  28275. i.position
  28276. ),
  28277. I,
  28278. function (e) {
  28279. (this.flying = !1),
  28280. this.currentPano !== i && this.currentPano.exit(),
  28281. i.enter(),
  28282. (this.currentPano = i),
  28283. (this.nextPano = null),
  28284. this.path.placeCpm(),
  28285. this.path.fadeOutCpm(f.path.fadeOutTime),
  28286. this.spider.draw(),
  28287. this.emit(w.FlyingEnded, i.position, L, i, D),
  28288. this.updateMarkerVisi(), //add
  28289. C(e);
  28290. //add:
  28291. if (this.mode == "panorama") {
  28292. if (this.model.floorLogos) {
  28293. this.model.floorLogos[0].position.copy(
  28294. this.model.floorLogos[1].position
  28295. );
  28296. //this.model.adjustfloorLogoHeight()
  28297. this.model.changefloorLogoOpa({
  28298. index: 0,
  28299. opa: 1,
  28300. dur: 0,
  28301. }); //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  28302. this.model.floorLogos[1].visible = false;
  28303. }
  28304. this.model.fadePanoMarkers(); //add
  28305. Hot.updateVisibles([this.currentPano]); //add
  28306. }
  28307. }.bind(this),
  28308. 0,
  28309. B,
  28310. "camFly",
  28311. V.FlyToPano
  28312. );
  28313. };
  28314. if (
  28315. !this.model.supportsTiles &&
  28316. i.getSkyboxTexture().image[0].width >
  28317. 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */
  28318. ) {
  28319. setTimeout(() => {
  28320. beginTran();
  28321. }, 50); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  28322. } else {
  28323. beginTran();
  28324. }
  28325. }
  28326. }),
  28327. (n.prototype.warpToPano = function (o = {}) {});
  28328. n.prototype.blackToPano = function (o = {}) {
  28329. //add 瞬间过渡
  28330. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  28331. if (this.flying || this.isWarping()) return;
  28332. let pano = o.pano || this.model.panos.index[o.panoId];
  28333. if (this.mode !== u.PANORAMA) {
  28334. var m;
  28335. void this.flyToNewMode({
  28336. mode: u.PANORAMA,
  28337. pano,
  28338. duration: o.duration,
  28339. quaternion: o.quaternion,
  28340. //callback: t
  28341. });
  28342. }
  28343. let oldPos = this.position.clone();
  28344. let oldPano = this.currentPano;
  28345. this.path.warpDestPano = pano;
  28346. var retry = () => {
  28347. (this.waitingToWarp = !1), this.blackToPano(o);
  28348. };
  28349. if (
  28350. this.checkAndWaitForPanoLoad(
  28351. pano,
  28352. "high",
  28353. "low",
  28354. this.basePanoSize,
  28355. retry
  28356. )
  28357. )
  28358. return void (this.waitingToWarp = !0);
  28359. this.emit("pano.chosen", oldPano, pano);
  28360. this.flying = true;
  28361. this.nextPano = pano; //提前加载高清图片
  28362. this.path.warpDestHeroLoc = {
  28363. panoId: o.panoId,
  28364. position: pano.position,
  28365. quaternion: o.quaternion || this.quaternion.clone(),
  28366. };
  28367. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  28368. pano != this.currentPano && this.currentPano.exit();
  28369. pano.enter();
  28370. this.currentPano = pano;
  28371. this.emit("flying.ended", pano.position, oldPos, pano, oldPano);
  28372. this.flying = false;
  28373. this.nextPano = null;
  28374. this.updateMarkerVisi(); //add
  28375. });
  28376. };
  28377. window._transitionPosId = 9999;
  28378. n.prototype.transitionPos = function (o = {}) {
  28379. //渐变overlay和热点的位置
  28380. y.cancelById(_transitionPosId);
  28381. var begin = function (object, pos, qua, scale) {
  28382. if (pos) {
  28383. if (!same(object.position, pos, 0.01)) {
  28384. y.start(
  28385. v.vector(object.position, pos),
  28386. o.dur,
  28387. (e) => {},
  28388. 0,
  28389. A[f.transition.movementEasing],
  28390. "transitionPos",
  28391. _transitionPosId
  28392. );
  28393. }
  28394. if (qua && !same(object.quaternion, qua, 1e-6)) {
  28395. y.start(
  28396. v.quaternion(object.quaternion, qua),
  28397. o.dur,
  28398. (e) => {},
  28399. 0,
  28400. A[f.transition.movementEasing],
  28401. "transitionPos",
  28402. _transitionPosId
  28403. );
  28404. }
  28405. if (scale && !same(object.scale, scale, 0.001)) {
  28406. y.start(
  28407. v.vector(object.scale, scale),
  28408. o.dur,
  28409. (e) => {},
  28410. 0,
  28411. A[f.transition.movementEasing],
  28412. "transitionPos",
  28413. _transitionPosId
  28414. );
  28415. }
  28416. }
  28417. };
  28418. var same = function (vec1, vec2, diff) {
  28419. var s =
  28420. Math.abs(vec1.x - vec2.x) < diff &&
  28421. Math.abs(vec1.y - vec2.y) < diff &&
  28422. Math.abs(vec1.z - vec2.z) < diff;
  28423. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff;
  28424. return s;
  28425. };
  28426. var sid = o.pano != void 0 ? o.pano.id : "outside";
  28427. for (let i in this.model.hots) {
  28428. //是否判断visible?
  28429. var hot = this.model.hots[i];
  28430. var panoData = hot.info.transformAtPanos[sid];
  28431. var useCustom = !panoData;
  28432. //if(hot.usingTransformData || !useCustom){
  28433. var pos = useCustom ? hot.info.position : panoData.pos;
  28434. begin(hot, pos /* , qua */);
  28435. //}
  28436. }
  28437. };
  28438. window._tranOutsideFocus = 4399;
  28439. n.prototype.focusPoint = function (o = {}) {
  28440. //当在外时,聚焦相机到这一点
  28441. console.log("focusPoint");
  28442. if (this.mode == "floorplan") {
  28443. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8); //可视范围
  28444. var control = this.cameraControls.controls.floorplan;
  28445. var absoluteScale = control.getDefaultAbsoluteScale(modelSize);
  28446. var currentScale = control.absoluteScale;
  28447. var currentTarget = control.target.clone();
  28448. y.cancelById(window._tranOutsideFocus, true);
  28449. y.start(
  28450. function (progress) {
  28451. control.absoluteScale =
  28452. absoluteScale * progress + currentScale * (1 - progress);
  28453. control.target = o.aim
  28454. .clone()
  28455. .multiplyScalar(progress)
  28456. .add(currentTarget.clone().multiplyScalar(1 - progress));
  28457. control.camera.position.copy(
  28458. control.target.clone().add(control.offset)
  28459. ); //维持角度
  28460. }.bind(this),
  28461. o.dur || 600,
  28462. null /* cancelFuc */,
  28463. 0,
  28464. A[f.transition.movementEasing],
  28465. "outsideFocus",
  28466. window._tranOutsideFocus,
  28467. null /* cancelFuc */
  28468. );
  28469. } else if (player.mode == "dollhouse") {
  28470. var control = player.cameraControls.controls.dollhouse;
  28471. var radius = o.radius || 8;
  28472. var currentTarget = control.target.clone();
  28473. var dir = control.offset.clone().normalize();
  28474. var currentRadius = control.offset.length();
  28475. y.cancelById(window._tranOutsideFocus, true);
  28476. y.start(
  28477. function (progress) {
  28478. control.target = o.aim
  28479. .clone()
  28480. .multiplyScalar(progress)
  28481. .add(currentTarget.clone().multiplyScalar(1 - progress));
  28482. let radius_ =
  28483. radius * progress + currentRadius * (1 - progress);
  28484. control.camera.position.copy(
  28485. control.target
  28486. .clone()
  28487. .add(dir.clone().multiplyScalar(radius_))
  28488. );
  28489. }.bind(this),
  28490. o.dur || 600,
  28491. null /* cancelFuc */,
  28492. 0,
  28493. A[f.transition.movementEasing],
  28494. "outsideFocus",
  28495. window._tranOutsideFocus,
  28496. null /* cancelFuc */
  28497. );
  28498. } else if (this.mode == "panorama") {
  28499. this.flyToPano({
  28500. lookAtPoint: o.aim.clone(),
  28501. pano: this.currentPano,
  28502. aimDuration: o.dur || 600,
  28503. });
  28504. }
  28505. };
  28506. /*
  28507. 切换到某个模式后再执行函数
  28508. */
  28509. n.prototype.FlyToMode = function (mode, f1, duration) {
  28510. var f2;
  28511. if (this.mode == mode) {
  28512. f1 && f1();
  28513. } else {
  28514. f2 = f1;
  28515. if (
  28516. this.mode == "transitioning" &&
  28517. this.modeTran.split("-")[1] != mode
  28518. ) {
  28519. //正飞向其他模式,就要先飞完再飞进来然后执行
  28520. this.afterCModeFuc = function () {
  28521. /* objects.gui.modeChange[mode](null, {
  28522. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  28523. }); */
  28524. this.afterCModeFuc = f2;
  28525. this.flyToNewMode({
  28526. mode: mode,
  28527. pano: mode == "panorama" && this.currentPano,
  28528. //callback : f2
  28529. });
  28530. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  28531. }.bind(this);
  28532. } else {
  28533. if (this.afterCModeFuc)
  28534. console.log(
  28535. "已经有afterCModeFuc了!!!!!!!!!!!!!!!"
  28536. );
  28537. this.afterCModeFuc = f2; //飞入后执行
  28538. try {
  28539. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  28540. this.flyToNewMode({
  28541. mode: mode,
  28542. pano: mode == "panorama" && this.currentPano,
  28543. duration: duration,
  28544. });
  28545. } catch (e) {
  28546. console.log("FlyToMode遇到问题?");
  28547. }
  28548. }
  28549. }
  28550. };
  28551. (n.prototype.fastForwardActivePanoFlight = function (e) {
  28552. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1;
  28553. y.adjustSpeed(V.FlyToPano, e);
  28554. y.adjustSpeed(V.LookTransition, e);
  28555. }),
  28556. (n.prototype.flyToPanoClosestToMouse = function () {
  28557. if (
  28558. (Date.now() - this.mouseLastMoveTime > 50 &&
  28559. ((this.intersect = this.getMouseIntersect()),
  28560. this.intersect && this.updateClosestPano(this.intersect)),
  28561. this.closestPano)
  28562. )
  28563. return this.flyToPano({
  28564. pano: this.closestPano,
  28565. });
  28566. var e = this.getMouseDirection();
  28567. this.flyDirection(e) ||
  28568. this.flyToPano({
  28569. pano: this.currentPano,
  28570. });
  28571. }),
  28572. (n.prototype.flyLocalDirection = function (e) {
  28573. var t = this.getDirection(e),
  28574. i = 1 === e.z ? 0.4 : 0.75,
  28575. n = 1 === Math.abs(e.x);
  28576. return this.flyDirection(t, i, n);
  28577. }),
  28578. (n.prototype.flyDirection = function (e, t, i) {
  28579. Hot.closePopup(); //xzw add
  28580. var n = $.Deferred();
  28581. this.history.invalidate();
  28582. var r = this.closestPanoInDirection(e, t, i);
  28583. return (
  28584. r
  28585. ? this.flyToPano(
  28586. {
  28587. pano: r,
  28588. },
  28589. n.resolve.bind(n, !0)
  28590. )
  28591. : (this.bump(e), n.resolve(!1)),
  28592. n.promise()
  28593. );
  28594. }),
  28595. (n.prototype.closestPanoInDirection = function (e, t, i) {
  28596. return this.rankedPanoInDirection(0, e, t, i);
  28597. }),
  28598. (n.prototype.rankedPanoInDirection = (function () {
  28599. var e = {
  28600. pano: null,
  28601. candidates: [],
  28602. };
  28603. return function (t, i, n, r) {
  28604. t || (t = 0), (n = void 0 !== n ? n : 0.75);
  28605. var o = r ? "angle" : "direction";
  28606. return (
  28607. this.model.panos.findRankedByScore(
  28608. t,
  28609. [
  28610. s.filters.isPanoAligned(),
  28611. s.filters.not(this.currentPano),
  28612. s.filters.isNeighbourPanoTo(this.currentPano),
  28613. s.filters.inPanoDirection(this.position, i, n),
  28614. ],
  28615. [
  28616. s.scoreFunctions.distanceSquared(this.currentPano),
  28617. s.scoreFunctions[o](this.position, i),
  28618. ],
  28619. e
  28620. ),
  28621. (this.cachedPanoCandidates = e.candidates),
  28622. e.pano
  28623. );
  28624. };
  28625. })()),
  28626. (n.prototype.bump = function (e) {
  28627. if (
  28628. this.mode === u.PANORAMA &&
  28629. !this.flying &&
  28630. !this.isWarping()
  28631. ) {
  28632. var t,
  28633. i,
  28634. n,
  28635. r = f.transition,
  28636. o =
  28637. (r.flytimeMaxDistanceThreshold *
  28638. r.flytimeDistanceMultiplier +
  28639. r.flyTime) /
  28640. 8,
  28641. a = this.camera.getWorldDirection().dot(e),
  28642. s = Math.abs(a) > 0.5;
  28643. if (s)
  28644. (t = function () {
  28645. y.start(
  28646. v.property(
  28647. this.cameraControls.cameras[u.PANORAMA],
  28648. "zoom",
  28649. a > 0 ? 1.04 : 0.96
  28650. ),
  28651. o,
  28652. i,
  28653. 0,
  28654. A.easeInOutSine,
  28655. "bumpZStart"
  28656. );
  28657. }.bind(this)),
  28658. (i = function () {
  28659. y.start(
  28660. v.property(
  28661. this.cameraControls.cameras[u.PANORAMA],
  28662. "zoom",
  28663. 1
  28664. ),
  28665. 5 * o,
  28666. n,
  28667. 0,
  28668. A.easeInOutSine,
  28669. "bumpZRelax"
  28670. );
  28671. }.bind(this));
  28672. else {
  28673. var l = this.camera.position.clone(),
  28674. c = e.clone();
  28675. this.raycaster.set(l, c);
  28676. var h = this.model.floors.reduce(function (e, t) {
  28677. return e.concat(t.collider.children);
  28678. }, []),
  28679. d = this.raycaster.intersectObjects(h),
  28680. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  28681. g = l.clone().add(c.multiplyScalar(p));
  28682. (t = function () {
  28683. y.start(
  28684. v.vector(
  28685. this.cameraControls.cameras[u.PANORAMA].position,
  28686. g
  28687. ),
  28688. o,
  28689. i,
  28690. 0,
  28691. A.easeInOutSine,
  28692. "bumpTStart"
  28693. );
  28694. }.bind(this)),
  28695. (i = function () {
  28696. y.start(
  28697. v.vector(
  28698. this.cameraControls.cameras[u.PANORAMA].position,
  28699. l
  28700. ),
  28701. 5 * o,
  28702. n,
  28703. 0,
  28704. A.easeInOutSine,
  28705. "bumpTRelax"
  28706. );
  28707. }.bind(this));
  28708. }
  28709. (n = function () {
  28710. this.flying = !1;
  28711. }.bind(this)),
  28712. (this.flying = !0),
  28713. t();
  28714. }
  28715. }),
  28716. (n.prototype.changeFloor = function (e) {
  28717. if (!this.is360View(this.mode, this.currentPano))
  28718. if (this.mode === u.PANORAMA) {
  28719. var t = this.history.reversePano(e);
  28720. t && t.isAligned()
  28721. ? this.flyToPano({
  28722. pano: t,
  28723. })
  28724. : this.changeFloorByScore(e);
  28725. } else
  28726. this.model.setFloor(
  28727. this.model.nextFloor(e) || this.model.currentFloor
  28728. );
  28729. }),
  28730. (n.prototype.changeFloorByScore = (function () {
  28731. var e = {
  28732. pano: null,
  28733. candidates: [],
  28734. };
  28735. return function (t) {
  28736. var i = this.model.nextFloor(t);
  28737. return i
  28738. ? (this.model.panos.lowestByScore(
  28739. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  28740. [
  28741. s.scoreFunctions.distance(this.currentPano),
  28742. s.scoreFunctions.direction(
  28743. this.position,
  28744. new r.Vector3(0, t, 0)
  28745. ),
  28746. s.scoreFunctions.penalizeHeightDifferenceUnder(
  28747. this.position,
  28748. 0.5
  28749. ),
  28750. ],
  28751. e
  28752. ),
  28753. void (e.pano
  28754. ? ((this.cachedPanoCandidates = e.candidates),
  28755. this.history.push(t, this.currentPano),
  28756. this.flyToPano({
  28757. pano: e.pano,
  28758. }))
  28759. : F.warn(
  28760. "No pano found on selected floor, not moving there."
  28761. )))
  28762. : void F.debug(
  28763. "player.changeFloor(" + t + "): no such floor"
  28764. );
  28765. };
  28766. })()),
  28767. (n.prototype.gotoFloor = function (e) {
  28768. var t = e - this.model.currentFloor.floorIndex;
  28769. this.changeFloor(t);
  28770. }),
  28771. (n.prototype.getDirection = function (e) {
  28772. return (
  28773. (e = e ? e : new r.Vector3().copy(d.FORWARD)),
  28774. e.applyQuaternion(this.camera.quaternion)
  28775. );
  28776. }),
  28777. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  28778. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING))
  28779. return (
  28780. F.warn("should not be transitioning here"),
  28781. n && n(!1),
  28782. o.reject().promise()
  28783. );
  28784. var a = i || !1,
  28785. s = i ? i.position : this.position,
  28786. l = this.position.clone(),
  28787. c = this.currentPano;
  28788. if (
  28789. (F.debug("New pose in mode " + this.mode),
  28790. !e ||
  28791. ((retryCallback = function () {
  28792. N.delayOneFrame(
  28793. function () {
  28794. this.flyToSameMode(e, t, i, n, o);
  28795. }.bind(this)
  28796. );
  28797. }.bind(this)),
  28798. !this.checkAndWaitForPanoLoad(
  28799. e,
  28800. "high",
  28801. "low",
  28802. this.basePanoSize,
  28803. retryCallback
  28804. )))
  28805. ) {
  28806. var h = function () {
  28807. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0);
  28808. }.bind(this),
  28809. d = f[this.mode],
  28810. p = void 0 !== t ? t : d.transitionTime,
  28811. g = new r.Vector3(),
  28812. C = new r.Vector3();
  28813. if (
  28814. (this.emit(w.FlyingStarted, s, l, e, c),
  28815. this.mode === u.PANORAMA)
  28816. )
  28817. F.warn("we should not be here for panorama views");
  28818. else if (this.mode === u.DOLLHOUSE)
  28819. if (a) {
  28820. var I = new r.Vector3(0, 1, 0);
  28821. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  28822. 1,
  28823. !0
  28824. ),
  28825. this.model.warpDestFloors(i.floorVisibility),
  28826. C.copy(i.position);
  28827. var E = new r.Vector3(0, 0, -1).applyQuaternion(
  28828. i.quaternion
  28829. ),
  28830. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  28831. _ = b.intersectObjects(this.model.colliders),
  28832. T = 3;
  28833. _.length
  28834. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  28835. : (g.copy(E).multiplyScalar(3).add(C),
  28836. F.debug(
  28837. "Tried to restore dollhouse mode that did not intersect...",
  28838. i.position,
  28839. i.quaternion
  28840. ));
  28841. var x = new r.Matrix4().lookAt(C, g, I),
  28842. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  28843. M = g.distanceTo(C),
  28844. R = new r.Matrix4().lookAt(
  28845. this.cameraControls.cameras[u.DOLLHOUSE].position,
  28846. this.cameraControls.controls[u.DOLLHOUSE].target,
  28847. I
  28848. ),
  28849. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  28850. O = this.cameraControls.cameras[
  28851. u.DOLLHOUSE
  28852. ].position.distanceTo(
  28853. this.cameraControls.controls[u.DOLLHOUSE].target
  28854. );
  28855. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  28856. Math.min(O, T),
  28857. !0
  28858. );
  28859. var L = new r.Euler(
  28860. S.x - P.x,
  28861. S.y - P.y,
  28862. S.z - P.z,
  28863. f.warp.eOrder
  28864. );
  28865. (L.y =
  28866. L.y > Math.PI
  28867. ? (L.y -= 2 * Math.PI)
  28868. : L.y < -Math.PI
  28869. ? (L.y += 2 * Math.PI)
  28870. : L.y),
  28871. (this.path.burnsDir = Math.sign(L.y));
  28872. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  28873. B = new r.Vector3();
  28874. y.start(
  28875. v.vector(
  28876. this.cameraControls.controls[u.DOLLHOUSE].target,
  28877. g
  28878. ),
  28879. p,
  28880. null,
  28881. f.flydown.movementDelay,
  28882. A[f.flydown.movementEasing],
  28883. null,
  28884. V.FlyToSameMode
  28885. ),
  28886. y.start(
  28887. function (e, t) {
  28888. (D.x = P.x + e * L.x),
  28889. (D.y = P.y + e * L.y),
  28890. (D.z = P.z + e * L.z);
  28891. var i = O + e * (M - O);
  28892. B.set(0, 0, i)
  28893. .applyEuler(D)
  28894. .add(
  28895. this.cameraControls.controls[u.DOLLHOUSE].target
  28896. ),
  28897. this.cameraControls.cameras[u.DOLLHOUSE].position
  28898. .copy(B)
  28899. .add(this.model.position);
  28900. }.bind(this),
  28901. p,
  28902. null,
  28903. f.flydown.movementDelay,
  28904. A[f.flydown.movementEasing],
  28905. null,
  28906. V.FlyToSameMode
  28907. ),
  28908. y.start(
  28909. function (e, t) {
  28910. this.cameraControls.controls[u.DOLLHOUSE].update(),
  28911. this.quaternion.copy(
  28912. this.cameraControls.cameras[u.DOLLHOUSE]
  28913. .quaternion
  28914. ),
  28915. this.position.copy(
  28916. this.cameraControls.cameras[u.DOLLHOUSE].position
  28917. );
  28918. }.bind(this),
  28919. p,
  28920. null,
  28921. f.flydown.movementDelay,
  28922. A[f.flydown.movementEasing],
  28923. null,
  28924. V.FlyToSameMode
  28925. );
  28926. } else
  28927. F.warn(
  28928. "invalid warp destination in flyToSameMode()? ignore it then"
  28929. );
  28930. else if (
  28931. (this.path.placeCpm(),
  28932. this.path.fadeInCpm(f.path.fadeInTime),
  28933. i)
  28934. ) {
  28935. this.model.warpDestFloors(i.floorVisibility);
  28936. var U = this.cameraControls.cameras[u.FLOORPLAN],
  28937. k = this.cameraControls.controls[u.FLOORPLAN],
  28938. H = k.target.clone(),
  28939. G = i.position.clone().sub(H),
  28940. z = U.position.clone().sub(k.target),
  28941. W = z.length(),
  28942. j = new r.Vector3(-1, 0, 0)
  28943. .applyQuaternion(i.quaternion)
  28944. .normalize(),
  28945. Y = Math.atan2(k.offset.x, k.offset.z),
  28946. X = Math.atan2(j.x, j.z),
  28947. Z = k.absoluteScale,
  28948. q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  28949. y.start(
  28950. function (e, t) {
  28951. k.target.copy(G).multiplyScalar(e).add(H);
  28952. var i = Y + (X - Y) * e;
  28953. (k.offset.x = W * Math.sin(i)),
  28954. (k.offset.z = W * Math.cos(i)),
  28955. U.position.copy(k.target).add(k.offset),
  28956. (k.absoluteScale = Z + e * (q - Z)),
  28957. k.update(),
  28958. this.quaternion.copy(U.quaternion),
  28959. this.position.copy(U.position),
  28960. this.target.copy(k.target),
  28961. this.camera.projectionMatrix.copy(U.projectionMatrix);
  28962. }.bind(this),
  28963. p,
  28964. null,
  28965. 0,
  28966. A[f.flydown.movementEasing],
  28967. null,
  28968. V.FlyToSameMode
  28969. );
  28970. } else F.info("flyToSameMode() funny floorplan view? skipping");
  28971. return (
  28972. y.setTimeout(
  28973. function (e) {
  28974. (this.mode = e), h(), o.resolve(!0);
  28975. }.bind(this, this.mode),
  28976. p,
  28977. V.FlyToSameMode
  28978. ),
  28979. (this.mode = u.TRANSITIONING),
  28980. o.promise()
  28981. );
  28982. }
  28983. }),
  28984. (n.prototype.flyToNewMode = function (e, t) {
  28985. Hot.closePopup(); //xzw add
  28986. e = e || {};
  28987. var i = e.mode,
  28988. n = e.pano,
  28989. o = e.duration,
  28990. a = e.warpDest,
  28991. s = e.callback,
  28992. l = e.force,
  28993. c = e.quaternion;
  28994. if (((t = t || $.Deferred()), this.isWarping()))
  28995. return (
  28996. F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  28997. s && s(!1),
  28998. t
  28999. .reject("Cannot change mode during tour transition")
  29000. .promise()
  29001. );
  29002. if (this.mode === u.TRANSITIONING)
  29003. return (
  29004. s && s(!1),
  29005. t
  29006. .reject("Cannot change mode during mode transition")
  29007. .promise()
  29008. );
  29009. if (i === this.mode)
  29010. return l
  29011. ? (this.flyToSameMode(n, o, a, s)
  29012. .done(t.resolve.bind(t))
  29013. .fail(t.reject.bind(t)),
  29014. t.promise())
  29015. : (s && s(!1),
  29016. t.reject("Already in " + i + " mode").promise());
  29017. var h = a || !1;
  29018. F.debug("Switching mode to " + i);
  29019. var d = function () {
  29020. N.delayOneFrame(
  29021. function () {
  29022. this.flyToNewMode(e, t);
  29023. }.bind(this)
  29024. );
  29025. }.bind(this);
  29026. if (
  29027. n &&
  29028. this.checkAndWaitForPanoLoad(
  29029. n,
  29030. "low",
  29031. "low",
  29032. this.basePanoSize,
  29033. d
  29034. )
  29035. )
  29036. return t.promise();
  29037. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  29038. return (
  29039. F.info(
  29040. "Waiting for model textures to be loaded before going out to dollhouse"
  29041. ),
  29042. this.model.waitForLoad(
  29043. this.model,
  29044. function () {
  29045. return this.model.meshTexturesLoaded;
  29046. }.bind(this)
  29047. ),
  29048. this.model.loadMeshTextures().done(d),
  29049. t.promise()
  29050. );
  29051. this.history.invalidate(), this.updateLastView();
  29052. var p = this.mode,
  29053. C = this.cameraControls.cameras[i];
  29054. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  29055. var I = void 0 !== o ? o : e.transitionTime;
  29056. this.emit(w.ModeChanging, p, i, n, I),
  29057. n && (this.currentPano = n),
  29058. this.switchCameraMode(i, c),
  29059. y.cancelById(V.LookTransition);
  29060. //before fly---------------------
  29061. this.modeTran = p + "-" + i; //add
  29062. if (this.mode == "panorama") {
  29063. if (this.model.floorLogos) {
  29064. this.model.floorLogos[0].visible = false;
  29065. this.model.floorLogos[1].visible = false;
  29066. }
  29067. }
  29068. if (i == "panorama") {
  29069. this.transitionPos({ type: "beforeFlyIn", pano: n, dur: I }); //add
  29070. } else {
  29071. this.transitionPos({ type: "beforeFlyOut", dur: I / 2 }); //add
  29072. }
  29073. window.bus.dispatchEvent({ type: "playerAndModelReady" });
  29074. this.ready = true;
  29075. //------------------------------------
  29076. var beginTran = () => {
  29077. var _ = new r.Vector3().copy(this.position);
  29078. if (i === u.PANORAMA) {
  29079. this.emit(w.PanoChosen, n, n),
  29080. setTimeout(
  29081. function () {
  29082. n.floor.enter(i);
  29083. }.bind(this),
  29084. I / 2
  29085. ),
  29086. this.path.fadeOutCpm(f.path.fadeOutTime);
  29087. if (this.model.floorLogos) {
  29088. this.model.floorLogos[0].position.copy(
  29089. n.floorPosition.clone().sub(this.model.position)
  29090. ); //改
  29091. this.model.floorLogos[1].position.copy(
  29092. this.model.floorLogos[0].position
  29093. ); //for floorIcon position
  29094. }
  29095. } else if (i === u.DOLLHOUSE) {
  29096. if (
  29097. (h && (this.model.stayPut = !0),
  29098. a
  29099. ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  29100. 1,
  29101. !0
  29102. ),
  29103. this.model.warpDestFloors(a.floorVisibility))
  29104. : this.model.toggleAllFloors(!0),
  29105. this.path.placeCpm(),
  29106. this.path.fadeInCpm(f.path.fadeInTime),
  29107. h)
  29108. ) {
  29109. var T = new r.Vector3(
  29110. this.model.center.x,
  29111. 0,
  29112. this.model.center.z
  29113. );
  29114. _.set(15, 10, 15);
  29115. var M = new r.Vector3(0, 0, -1).applyQuaternion(
  29116. a.quaternion
  29117. ),
  29118. R = new r.Raycaster(
  29119. a.position.clone(),
  29120. M.clone(),
  29121. 0,
  29122. 1 / 0
  29123. ),
  29124. P = R.intersectObjects([this.sceneIntersectionPlane]);
  29125. P.length
  29126. ? (T.copy(P[0].point),
  29127. _.copy(a.position),
  29128. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  29129. 0.75 * _.distanceTo(T),
  29130. !0
  29131. ))
  29132. : (F.warn(
  29133. "Tried to restore dollhouse mode that did not intersect...",
  29134. a.position,
  29135. a.quaternion
  29136. ),
  29137. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  29138. 3,
  29139. !0
  29140. )),
  29141. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  29142. _.add(this.model.position),
  29143. C.position.copy(_),
  29144. this.cameraControls.controls[u.DOLLHOUSE].update();
  29145. }
  29146. } else if (
  29147. (this.path.placeCpm(),
  29148. this.path.fadeInCpm(f.path.fadeInTime),
  29149. a)
  29150. ) {
  29151. this.model.warpDestFloors(a.floorVisibility);
  29152. var O = this.cameraControls.cameras[u.FLOORPLAN],
  29153. L = this.cameraControls.controls[u.FLOORPLAN],
  29154. D = O.position.clone().sub(L.target),
  29155. B = new r.Vector3(-1, 0, 0)
  29156. .applyQuaternion(a.quaternion)
  29157. .normalize(),
  29158. U = Math.atan2(B.x, B.z);
  29159. L.target.copy(a.position);
  29160. var k = D.length();
  29161. (L.offset.x = k * Math.sin(U)),
  29162. (L.offset.y = 0),
  29163. (L.offset.z = k * Math.cos(U)),
  29164. O.position.copy(L.target).add(L.offset);
  29165. L.target.clone().sub(C.position);
  29166. C.quaternion.copy(a.quaternion),
  29167. (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)),
  29168. (L.absoluteScale = L.currentScale),
  29169. L.update();
  29170. } else this.model.currentFloor.enter(i);
  29171. var H = this.currentPano,
  29172. G = this.position.clone();
  29173. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  29174. (this.flying = !0),
  29175. this.isOutsideMode(i) && this.is360View(p, H)
  29176. ? (h ||
  29177. i !== u.DOLLHOUSE ||
  29178. (C.position.set(15, 10, 15),
  29179. C.controls.target.set(
  29180. this.model.center.x,
  29181. 0,
  29182. this.model.center.z
  29183. ),
  29184. C.controls.update()),
  29185. (e.blackoutStyle = S.FADEIN),
  29186. (I = f.show360Views.transitionTime),
  29187. this.fade360View(I, C, e))
  29188. : this.isOutsideMode(p) && this.is360View(i, n)
  29189. ? (h && this.switchCameraMode(i, h.quaternion),
  29190. (this.mode = i),
  29191. this.path && this.path.popOutCpm(),
  29192. (e.blackoutStyle = S.END),
  29193. (I = f.show360Views.transitionTime),
  29194. this.fade360View(I, C, e))
  29195. : (y.start(
  29196. v.property(this.model, "alpha", e.modelAlpha, null),
  29197. I * e.modelAlphaLength,
  29198. null,
  29199. e.modelAlphaDelay,
  29200. null,
  29201. V.FlyToNewMode
  29202. ),
  29203. y.start(
  29204. v.vector(this.position, C.position),
  29205. I,
  29206. null,
  29207. f.flydown.movementDelay,
  29208. A[f.flydown.movementEasing],
  29209. null,
  29210. V.FlyToNewMode
  29211. ),
  29212. y.start(
  29213. v.quaternion(this.quaternion, C.quaternion),
  29214. I * e.rotationDuration,
  29215. null,
  29216. e.rotationDelay,
  29217. A[f.flydown.rotationEasing],
  29218. null,
  29219. V.FlyToNewMode
  29220. ),
  29221. y.start(
  29222. v.matrix4(
  29223. this.camera.projectionMatrix,
  29224. C.projectionMatrix
  29225. ),
  29226. I * e.cameraMatrixDuration,
  29227. null,
  29228. e.cameraMatrixDelay,
  29229. e.cameraMatrixEase,
  29230. null,
  29231. V.FlyToNewMode
  29232. ),
  29233. y.start(
  29234. v.uniform(
  29235. this.model.skybox,
  29236. "opacity",
  29237. e.skyboxOpacity
  29238. ),
  29239. I * e.skyboxOpacityLength,
  29240. null,
  29241. e.skyboxOpacityDelay,
  29242. null,
  29243. V.FlyToNewMode
  29244. ),
  29245. y.start(
  29246. v.property(
  29247. this.reticule.material.uniforms.opacity,
  29248. "value",
  29249. 0
  29250. ),
  29251. I,
  29252. null,
  29253. V.FlyToNewMode
  29254. )),
  29255. y.setTimeout(
  29256. function () {
  29257. (this.flying = !1),
  29258. p === u.PANORAMA && i !== u.PANORAMA
  29259. ? this.currentPano.exit()
  29260. : p !== u.PANORAMA &&
  29261. i === u.PANORAMA &&
  29262. (this.currentPano !== H && H.exit(),
  29263. this.currentPano.enter(),
  29264. this.path.placeCpm(),
  29265. this.path.fadeOutCpm(f.path.fadeOutTime),
  29266. this.spider.draw()),
  29267. p === u.DOLLHOUSE &&
  29268. this.cameraControls.controls[
  29269. u.DOLLHOUSE
  29270. ].resetRanges(),
  29271. (this.mode = i),
  29272. this.emit(w.FlyingEnded, _, G, this.currentPano, H);
  29273. //add:
  29274. this.updateMarkerVisi();
  29275. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  29276. this.mode == u.PANORAMA &&
  29277. this.model.floorLogos &&
  29278. (this.model.changefloorLogoOpa({
  29279. index: 0,
  29280. from: 0,
  29281. opa: 1,
  29282. dur: 150,
  29283. }), //this.model.floorLogoShow(0,150);
  29284. (this.model.floorLogos[0].visible = true));
  29285. if (this.afterCModeFuc) {
  29286. //手动加的函数
  29287. var cf = this.afterCModeFuc;
  29288. this.afterCModeFuc = null; //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  29289. cf();
  29290. }
  29291. if (this.mode == u.PANORAMA) {
  29292. Hot.updateVisibles([this.currentPano]);
  29293. this.model.fadePanoMarkers();
  29294. } else {
  29295. Hot.updateVisibles(true);
  29296. this.model.hotGroup.children.forEach((overlay) => {
  29297. if (overlay.animateInfo) {
  29298. GifTexDeal.start(overlay.animation);
  29299. }
  29300. });
  29301. }
  29302. h && p !== u.PANORAMA && i === u.PANORAMA
  29303. ? this.startWarp(
  29304. b.Retain,
  29305. E.Retain,
  29306. x.BLACK,
  29307. null,
  29308. null,
  29309. s
  29310. )
  29311. : (s && s(), t.resolve());
  29312. }.bind(this),
  29313. I,
  29314. V.FlyToNewMode
  29315. );
  29316. };
  29317. if (
  29318. i == "panorama" &&
  29319. !this.model.supportsTiles &&
  29320. n.getSkyboxTexture().image[0].width > 1024
  29321. ) {
  29322. setTimeout(() => {
  29323. beginTran();
  29324. }, 16); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  29325. } else {
  29326. beginTran();
  29327. }
  29328. this.mode = u.TRANSITIONING;
  29329. //p == "panorama" && this.updateHotVisible(),
  29330. return t.promise();
  29331. }),
  29332. (n.prototype.fade360View = function (e, t, i) {
  29333. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  29334. $(this.domElement).fadeOut(
  29335. 0.5 * e,
  29336. function () {
  29337. (this.model.skybox.material.uniforms.opacity.value =
  29338. i.skyboxOpacity),
  29339. (this.model.alpha = i.modelAlpha),
  29340. this.position.copy(t.position),
  29341. this.quaternion.copy(t.quaternion),
  29342. this.camera.projectionMatrix.copy(t.projectionMatrix),
  29343. $(this.domElement).fadeIn(0.5 * e);
  29344. }.bind(this)
  29345. );
  29346. }),
  29347. (n.prototype.findDefaultViews = function () {
  29348. this.findDefaultView(this.lastInsideView, !0),
  29349. this.findDefaultView(this.last360View, !1);
  29350. }),
  29351. (n.prototype.findDefaultView = function (e, t) {
  29352. var i,
  29353. n = this.model.heroLocations,
  29354. r = this.model.panos,
  29355. o = n.findIndex(function (e) {
  29356. if (e.cameraMode !== u.PANORAMA) return !1;
  29357. var i = r.get(e.panoId);
  29358. return i && i.isAligned() === t;
  29359. });
  29360. o >= 0
  29361. ? ((i = r.get(n[o].panoId)),
  29362. e.update({
  29363. cameraMode: u.PANORAMA,
  29364. pano: i,
  29365. position: n[o].position,
  29366. quaternion: n[o].quaternion,
  29367. }))
  29368. : ((o = r.list.findIndex(function (e) {
  29369. return e.isAligned() === t;
  29370. })),
  29371. o >= 0
  29372. ? ((i = r.list[o]),
  29373. e.update({
  29374. cameraMode: u.PANORAMA,
  29375. pano: i,
  29376. position: i.position,
  29377. }))
  29378. : F.warn(
  29379. "There are no",
  29380. t ? "inside" : "360º",
  29381. "views in this model"
  29382. ));
  29383. }),
  29384. (n.prototype.updateLastView = function () {
  29385. if (this.mode === u.PANORAMA) {
  29386. var e = this.currentPano.isAligned()
  29387. ? this.lastInsideView
  29388. : this.last360View;
  29389. e.update({
  29390. pano: this.currentPano,
  29391. position: this.position,
  29392. quaternion: this.quaternion,
  29393. });
  29394. }
  29395. }),
  29396. (n.prototype.goToLastView = function (e, t) {
  29397. var i = $.Deferred(),
  29398. n = i.resolve.bind(i),
  29399. r = i.reject.bind(i),
  29400. o = e ? this.lastInsideView : this.last360View;
  29401. return (
  29402. this.isInMode(u.PANORAMA) &&
  29403. this.currentPano.isAligned() !== e &&
  29404. this.updateLastView(),
  29405. this.isInMode(u.PANORAMA)
  29406. ? (this.path && this.path.popOutCpm(),
  29407. this.fadeToView(e, o, f.show360Views.transitionTime, t)
  29408. .done(n)
  29409. .fail(r))
  29410. : this.isOutsideMode() &&
  29411. this.flyToNewMode({
  29412. mode: o.cameraMode,
  29413. pano: o.pano,
  29414. quaternion: o.quaternion,
  29415. callback: t,
  29416. })
  29417. .done(n)
  29418. .fail(r),
  29419. i.promise()
  29420. );
  29421. }),
  29422. (n.prototype.fadeToView = function (e, t, i, n) {
  29423. var r = $.Deferred(),
  29424. o = r.resolve.bind(r),
  29425. a = r.reject.bind(r);
  29426. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano))
  29427. return (
  29428. F.warn("Tried to fade to an illegal view", t.cameraMode),
  29429. a("Cannot go to illegal view"),
  29430. r.promise()
  29431. );
  29432. var s =
  29433. (f[t.cameraMode],
  29434. function () {
  29435. $(this.domElement).fadeIn(0.5 * i), n && n(), o();
  29436. }.bind(this)),
  29437. l = e ? S.FADEIN : S.END;
  29438. return (
  29439. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  29440. $(this.domElement).fadeOut(
  29441. 0.5 * i,
  29442. function () {
  29443. this.model.fadePanoMarkers(
  29444. e ? f.panorama.markerOpacity : 0
  29445. ),
  29446. t.cameraMode === u.PANORAMA
  29447. ? this.flyToPano(
  29448. {
  29449. pano: t.pano,
  29450. lookAtPoint: d.FORWARD.clone()
  29451. .applyQuaternion(t.quaternion)
  29452. .add(t.pano.position),
  29453. duration: 0,
  29454. },
  29455. s
  29456. )
  29457. : this.flyToNewMode({
  29458. mode: t.cameraMode,
  29459. quaternion: t.quaternion,
  29460. duration: 0,
  29461. callback: s,
  29462. });
  29463. }.bind(this)
  29464. ),
  29465. r.promise()
  29466. );
  29467. }),
  29468. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  29469. if (
  29470. (this.cameraControls.activeControl &&
  29471. (this.cameraControls.activeControl.enabled = !1),
  29472. this.flying)
  29473. )
  29474. return (
  29475. F.warn("Player.startWarp() -> Cannot warp when flying"),
  29476. o && o(),
  29477. !1
  29478. );
  29479. (null !== e && void 0 !== e) || (e = b.Show),
  29480. this.history.invalidate();
  29481. e !== b.Retain
  29482. ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK)
  29483. : (i = this.path.upcomingTransType);
  29484. var a =
  29485. this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  29486. return (
  29487. this.emit(w.WarpStarted, a, i, n, r),
  29488. (n = n || S.MIDDLE),
  29489. this.path.warpToPano(
  29490. i,
  29491. n,
  29492. r,
  29493. function () {
  29494. t === E.Slow
  29495. ? this.path.discardSlow()
  29496. : t === E.Standard && this.path.discardPathObject(),
  29497. this.emit(w.WarpEnded, i),
  29498. this.cameraControls.activeControl &&
  29499. (this.cameraControls.activeControl.enabled = !0),
  29500. o && o();
  29501. }.bind(this)
  29502. ),
  29503. e === b.Hide && this.path.discardPathObject(),
  29504. !0
  29505. );
  29506. }),
  29507. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  29508. return this.path.setWarpDestinationByPanoId(e, t)
  29509. ? this.startWarp(i, n, r, o, a, s)
  29510. : (F.warn(
  29511. "Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"
  29512. ),
  29513. s && s(),
  29514. !1);
  29515. }),
  29516. (n.prototype.warpToPanoByHeroIndex = function (
  29517. e,
  29518. t,
  29519. i,
  29520. n,
  29521. r,
  29522. o,
  29523. a
  29524. ) {
  29525. return this.path.setWarpDestinationByHeroIndex(e)
  29526. ? this.startWarp(t, i, n, r, o, a)
  29527. : (F.warn(
  29528. "Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"
  29529. ),
  29530. a && a(),
  29531. !1);
  29532. }),
  29533. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  29534. return this.warpToPanoById(e.id, t, i, n, r, o, a, s);
  29535. }),
  29536. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  29537. return this.path.setWarpDestinationByHeroIndex(e)
  29538. ? (this.path.warpToNonPano(t), !0)
  29539. : (F.warn(
  29540. "Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"
  29541. ),
  29542. t && t(),
  29543. !1);
  29544. }),
  29545. (n.prototype.aimTourCamera = function (e, t, i, n) {
  29546. return (
  29547. F.debug(
  29548. "player.aimTourCamera(" +
  29549. e +
  29550. ") calling warpToPanoByHeroIndex(" +
  29551. e +
  29552. ")"
  29553. ),
  29554. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  29555. );
  29556. }),
  29557. (n.prototype.showPathToHeroLocation = function (e) {
  29558. this.path.setWarpDestinationByHeroIndex(e) &&
  29559. this.path.brushToWarpPano(x.STD, x.BLACK);
  29560. }),
  29561. (n.prototype.tourInterlude = function (e, t) {
  29562. this.history.invalidate();
  29563. this.path.discardSlow();
  29564. //xzw:
  29565. var defaultRotTime = DATA.tourRotTime * 1000;
  29566. var timeEachItem =
  29567. (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200; //预估时间假设每个item飞的时间(如果距离远就少了)
  29568. var currentLocation = this.model.getHeroDescriptorByIndex(
  29569. this.director.currentItem
  29570. );
  29571. var currentLocation0 =
  29572. this.model.heroLocations[this.director.currentItem[0]];
  29573. //zeg 标注一下
  29574. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  29575. var rotTime;
  29576. if (
  29577. currentLocation.rotTime == void 0 ||
  29578. currentLocation.rotTime == ""
  29579. ) {
  29580. var restChildCount = currentLocation0.heroLocations
  29581. ? currentLocation0.heroLocations.length -
  29582. this.director.currentItem[1] -
  29583. 1
  29584. : 0;
  29585. var hasMusic =
  29586. currentLocation0 && currentLocation0.musicInfo.music;
  29587. if (hasMusic) {
  29588. var audioObj = SoundManager.list.find(
  29589. (e) => e.name == "tour"
  29590. );
  29591. var current = audioObj.audio.currentTime * 1e3; // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  29592. rotTime = currentLocation0.musicInfo.time - current;
  29593. if (restChildCount) {
  29594. //如果当前folder中还有剩下的item,平分一下时间
  29595. rotTime =
  29596. (rotTime - timeEachItem * restChildCount) /
  29597. (restChildCount + 1);
  29598. }
  29599. } else {
  29600. rotTime = defaultRotTime;
  29601. }
  29602. rotTime = Math.max(0, rotTime);
  29603. Log(
  29604. "rotTime " +
  29605. rotTime +
  29606. " at item " +
  29607. this.director.currentItem +
  29608. (hasMusic
  29609. ? ",musicCurrentTime:" +
  29610. current +
  29611. "音乐总长:" +
  29612. currentLocation0.musicInfo.time
  29613. : ""),
  29614. "#E8E"
  29615. );
  29616. } else {
  29617. rotTime = currentLocation.rotTime * 1000;
  29618. Log(
  29619. "rotTime " +
  29620. rotTime +
  29621. " at item " +
  29622. this.director.currentItem,
  29623. "#E8E"
  29624. );
  29625. }
  29626. this.path.waitNextStep(
  29627. e,
  29628. function () {
  29629. t && t();
  29630. }.bind(this),
  29631. rotTime
  29632. );
  29633. }),
  29634. (n.prototype.stopInterlude = function () {
  29635. this.interruptAndFastForward(null, 0);
  29636. }),
  29637. (n.prototype.interruptAndFastForward = function (e, t) {
  29638. //Log('interruptAndFastForward' , '#f00')
  29639. this.isWarping() &&
  29640. this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  29641. this.flying && this.emit(w.FlyingInterrupted),
  29642. this.path.interruptAndFastForward(e, t);
  29643. }),
  29644. (n.prototype.setSize = function (e, t) {
  29645. var i = e / t;
  29646. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  29647. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  29648. n > f.insideFOVMax
  29649. ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t))
  29650. : (this.baseFov = f.insideFOV);
  29651. for (var r in this.cameraControls.cameras) {
  29652. var o = this.cameraControls.cameras[r];
  29653. (o.fov = this.baseFov * (1 / this.zoomLevel)),
  29654. o.updateAspect(i);
  29655. }
  29656. }),
  29657. (n.prototype.toJSON = function () {
  29658. var e = {};
  29659. return this.cameraControls.activeControl
  29660. ? ((e = this.cameraControls.activeControl.toJSON()),
  29661. (e.camera_mode = u.toInt(this.mode)),
  29662. this.isOutsideMode()
  29663. ? this.model.allFloorsVisible
  29664. ? (e.floor_visibility = [])
  29665. : (e.floor_visibility = this.model.floors.list.map(
  29666. function (e) {
  29667. return e.hidden ? 0 : 1;
  29668. }
  29669. ))
  29670. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  29671. e)
  29672. : e;
  29673. }),
  29674. (n.prototype.getCurrentNodePanos = function (e) {
  29675. this.model.panos.map;
  29676. if (((e.length = 0), this.path.nodes.length)) {
  29677. var momentTour = this.director.getMomentTour(
  29678. this.director.destinationItem
  29679. );
  29680. if (momentTour == "black") {
  29681. //改 upcomingPanos如果是black的只需要起点和终点
  29682. if (this.path.nodes.length) {
  29683. e.push(this.model.panos.get(this.path.nodes[0]));
  29684. }
  29685. if (this.path.nodes.length > 1) {
  29686. e.push(
  29687. this.model.panos.get(
  29688. this.path.nodes[this.path.nodes.length - 1]
  29689. )
  29690. );
  29691. }
  29692. } else {
  29693. for (var t = 0; t < this.path.nodes.length; t++) {
  29694. var i = this.path.nodes[t];
  29695. e.push(this.model.panos.get(i));
  29696. }
  29697. }
  29698. }
  29699. }),
  29700. (n.prototype.zoomIncrementally = function (e) {
  29701. var t = this.zoomLevel;
  29702. this.zoomTo(this.zoomLevel + e),
  29703. t !== this.zoomLevel &&
  29704. this.currentPano &&
  29705. this.zoomStats.addZoomAction(
  29706. t,
  29707. this.zoomLevel,
  29708. this.currentPano.id
  29709. );
  29710. }),
  29711. (n.prototype.zoomInIncrementally = function (e) {
  29712. (e = e || this.defaultZoomIncrement), this.zoomIncrementally(e);
  29713. }),
  29714. (n.prototype.zoomOutIncrementally = function (e) {
  29715. (e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e);
  29716. }),
  29717. (n.prototype.zoomBy = function (e) {
  29718. this.zoomTo(this.zoomLevel * e);
  29719. }),
  29720. (n.prototype.zoomIn = function () {
  29721. this.zoomBy(1 + this.zoomSpeed);
  29722. }),
  29723. (n.prototype.zoomOut = function () {
  29724. this.zoomBy(1 - this.zoomSpeed);
  29725. }),
  29726. (n.prototype.zoomTo = function (e, t) {
  29727. if (
  29728. t ||
  29729. (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)
  29730. ) {
  29731. if (
  29732. (e < f.zoom.min && (e = f.zoom.min),
  29733. e > f.zoom.max && (e = f.zoom.max),
  29734. e > this.zoomLevel
  29735. ? (this.emit(O.ZoomIn),
  29736. e === f.zoom.max && this.emit(O.ZoomMax))
  29737. : e < this.zoomLevel &&
  29738. (this.emit(O.ZoomOut),
  29739. e === f.zoom.min && this.emit(O.ZoomMin)),
  29740. this.cameraControls.activeControl)
  29741. ) {
  29742. var i = this.cameraControls.activeControl.camera;
  29743. (this.zoomLevel = e),
  29744. (i.fov = this.baseFov * (1 / this.zoomLevel)),
  29745. i.updateProjectionMatrix(),
  29746. (this.zoomFov = i.fov);
  29747. }
  29748. }
  29749. }),
  29750. (n.prototype.increaseZoomSpeed = function () {
  29751. this.zoomSpeed = this.clampZoomSpeed(
  29752. this.zoomSpeed + this.zoomSpeedAdjust
  29753. );
  29754. }),
  29755. (n.prototype.decreaseZoomSpeed = function () {
  29756. this.zoomSpeed = this.clampZoomSpeed(
  29757. this.zoomSpeed - this.zoomSpeedAdjust
  29758. );
  29759. }),
  29760. (n.prototype.clampZoomSpeed = function (e) {
  29761. return e < 0 ? 0 : e;
  29762. }),
  29763. (n.prototype.activatePersistentZooming = function (e) {
  29764. this.zooming = e ? 1 : -1;
  29765. }),
  29766. (n.prototype.deactivatePersistentZooming = function () {
  29767. this.zooming = 0;
  29768. }),
  29769. (n.prototype.zoomDefault = function () {
  29770. this.zoomTo(1, !0);
  29771. }),
  29772. (window.fovTranId = 333); //add
  29773. n.prototype.smoothZoomToDefault = function (e, t) {
  29774. y.cancelById(window.fovTranId);
  29775. var i,
  29776. n = this.zoomLevel,
  29777. r = function (e) {
  29778. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0);
  29779. }.bind(this),
  29780. o = function () {
  29781. this.zoomDefault(), t && window.setTimeout(t, 50);
  29782. }.bind(this);
  29783. y.start(
  29784. r,
  29785. e,
  29786. o,
  29787. null,
  29788. 0,
  29789. A[f.transition.blendEasing],
  29790. null,
  29791. window.fovTranId
  29792. );
  29793. };
  29794. n.prototype.smoothZoomFovTo = function (
  29795. fov,
  29796. zoomLevel,
  29797. dur,
  29798. callback
  29799. ) {
  29800. //add
  29801. y.cancelById(window.fovTranId);
  29802. console.log("smoothZoomFovTo " + zoomLevel);
  29803. var i,
  29804. n = this.zoomLevel,
  29805. aimLevel = zoomLevel || this.baseFov / fov;
  29806. if (n == aimLevel) return;
  29807. var fun = function (e) {
  29808. e > 1 && (e = 1),
  29809. (i = n * (1 - e) + e * aimLevel),
  29810. this.zoomTo(i, !0);
  29811. }.bind(this);
  29812. y.start(
  29813. fun,
  29814. dur,
  29815. callback,
  29816. null,
  29817. 0,
  29818. A[f.transition.blendEasing],
  29819. null,
  29820. window.fovTranId
  29821. );
  29822. };
  29823. n.prototype.updateZoomPano = function () {
  29824. if (
  29825. !this.panoRenderer.zoomPanoRenderingDisabled &&
  29826. this.mode === u.PANORAMA &&
  29827. this.currentPano
  29828. ) {
  29829. let navTileClass = this.qualityManager.getNavZoomClass();
  29830. let tileClass = this.qualityManager.getMaxZoomClass();
  29831. if (navTileClass == "4k") {
  29832. var r = true;
  29833. } else {
  29834. var levelThreshold1 = navTileClass == "1k" ? 1.1 : 1.5,
  29835. levelThreshold2 = 1.8; //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  29836. var t = this.zoomLevel > levelThreshold1,
  29837. i =
  29838. this.flying &&
  29839. this.nextPano &&
  29840. this.nextPano !== this.currentPano,
  29841. n = !i && !this.isWarping(),
  29842. r = t; //&& n ; // 允许flying状态下加载4K图
  29843. }
  29844. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  29845. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  29846. var o = function (pano, ifZoom) {
  29847. this.panoRenderer.resetRenderStatus(
  29848. pano.id,
  29849. !1,
  29850. !0,
  29851. this.qualityManager.getMaxNavPanoSize()
  29852. ),
  29853. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  29854. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  29855. pano.setZoomed(ifZoom);
  29856. }.bind(this);
  29857. if (navTileClass == "4k") {
  29858. if (!this.currentPano.zoomed) {
  29859. o(this.currentPano, !0);
  29860. this.panoRenderer.enableUltraHighQualityMode(
  29861. function () {
  29862. //开启4k getMaxZoomPanoSize
  29863. this.qualityManager.useUltraHighResolutionPanos &&
  29864. (f.zoom.max = D.ultraHighQualityMaxZoom);
  29865. o(this.currentPano, !0);
  29866. }.bind(this)
  29867. );
  29868. }
  29869. } else {
  29870. let zoomLevelRes = this.qualityManager.zoomLevelResolution;
  29871. if (
  29872. r &&
  29873. (!this.currentPano.zoomed ||
  29874. (zoomLevelRes && zoomLevelRes != "4k"))
  29875. ) {
  29876. //needZoom
  29877. this.currentPano.zoomed || o(this.currentPano, !0);
  29878. if (
  29879. navTileClass == "1k" &&
  29880. tileClass != "1k" &&
  29881. this.zoomLevel < levelThreshold2
  29882. ) {
  29883. this.panoRenderer.enableHighQuality(
  29884. function () {
  29885. //开启2k
  29886. if (tileClass != "4k") {
  29887. o(this.currentPano, !0);
  29888. }
  29889. }.bind(this)
  29890. );
  29891. } else {
  29892. this.panoRenderer.enableUltraHighQualityMode(
  29893. function () {
  29894. //开启4k getMaxZoomPanoSize
  29895. this.qualityManager.useUltraHighResolutionPanos &&
  29896. !f.zoom.overridemax &&
  29897. (f.zoom.max = D.ultraHighQualityMaxZoom);
  29898. o(this.currentPano, !0);
  29899. }.bind(this)
  29900. );
  29901. }
  29902. } else {
  29903. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  29904. }
  29905. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  29906. if (r && navTileClass == "1k" && tileClass == "4k") {
  29907. //目前只有手机端navTileClass == '1k'
  29908. var change = (zoomedFlag) => {
  29909. this.qualityManager.updateMaximums(); //更新maxZoomPanoSize
  29910. this.panoRenderer.setupZoomRenderTarget(); //更新renderTarget
  29911. //this.currentPano.setZoomed(t);//更新uniforms贴图
  29912. if (this.qualityManager.zoomLevelResolution == "4k") {
  29913. this.model.showHighMap();
  29914. } else {
  29915. this.model.hideHighMap();
  29916. }
  29917. };
  29918. this.qualityManager.zoomLevelResolution =
  29919. this.zoomLevel >= levelThreshold2
  29920. ? "4k"
  29921. : this.zoomLevel > levelThreshold1
  29922. ? "2k"
  29923. : "1k";
  29924. if (
  29925. this.oldZoomLevel < levelThreshold2 &&
  29926. this.zoomLevel >= levelThreshold2
  29927. ) {
  29928. //1k/2k-4k
  29929. change();
  29930. o(this.currentPano, t);
  29931. } else if (
  29932. this.oldZoomLevel <= levelThreshold1 &&
  29933. this.zoomLevel > levelThreshold1
  29934. ) {
  29935. //1k-2k
  29936. change();
  29937. } else if (
  29938. this.oldZoomLevel > levelThreshold2 &&
  29939. this.zoomLevel <= levelThreshold2
  29940. ) {
  29941. //4k-2k/1k
  29942. change();
  29943. o(this.currentPano, t);
  29944. } else if (
  29945. this.oldZoomLevel > levelThreshold1 &&
  29946. this.zoomLevel <= levelThreshold1
  29947. ) {
  29948. //2k-1k
  29949. change();
  29950. }
  29951. this.oldZoomLevel = this.zoomLevel;
  29952. }
  29953. }
  29954. }
  29955. };
  29956. (n.prototype.checkHasNeighbor = function (pano) {
  29957. //add
  29958. for (var i in pano.neighbourPanos) {
  29959. if (i == pano.id) continue;
  29960. if (pano.neighbourPanos[i]) {
  29961. return true;
  29962. }
  29963. }
  29964. }),
  29965. (t.exports = n);
  29966. }).call(this, "/js/player.js");
  29967. },
  29968. {
  29969. "./constants": 8,
  29970. "./enum/AlignmentType": 17,
  29971. "./enum/BlackoutStyle": 18,
  29972. "./enum/ControlEvents": 21,
  29973. "./enum/Keys": 30,
  29974. "./enum/ModelManagerEvents": 33,
  29975. "./enum/PanoSizeClass": 36,
  29976. "./enum/PanoramaEvents": 37,
  29977. "./enum/PathDiscardMode": 38,
  29978. "./enum/PathDisplayMode": 39,
  29979. "./enum/PlayerEvents": 40,
  29980. "./enum/TagStates": 44,
  29981. "./enum/Vectors": 50,
  29982. "./enum/Viewmode": 51,
  29983. "./enum/WarpStyle": 52,
  29984. "./enum/ZoomEvents": 53,
  29985. "./exception/BasicException": 55,
  29986. "./model/ModelManager": 140,
  29987. "./objects/NSpider": 147,
  29988. "./objects/Panorama": 148,
  29989. "./objects/Reticule": 149,
  29990. "./objects/ShowPath": 151,
  29991. "./objects/Snapshot": 153,
  29992. "./objects/View": 154,
  29993. "./settings": 166,
  29994. "./shaders": 167,
  29995. "./tile/TileDownloader": 171,
  29996. "./tile/TilePrioritizer": 172,
  29997. "./util/ZoomStats": 179,
  29998. "./util/browser": 182,
  29999. "./util/camera": 183,
  30000. "./util/cameraLight": 184,
  30001. "./util/common": 185,
  30002. "./util/easing": 186,
  30003. "./util/history": 187,
  30004. "./util/lerp": 188,
  30005. "./util/logger": 189,
  30006. "./util/math": 190,
  30007. "./util/transitions": 195,
  30008. hot: "hot",
  30009. scaleImg: "scaleImg",
  30010. events: 202,
  30011. three: 217,
  30012. },
  30013. ],
  30014. scaleImg: [
  30015. function (t, e) {
  30016. // xzw
  30017. var OUTPUT = e;
  30018. (function () {
  30019. function t(t, a, i, r) {
  30020. function h() {
  30021. (B =
  30022. "object" == typeof i
  30023. ? i
  30024. : a.src || r
  30025. ? u
  30026. : document.createElement("canvas")),
  30027. (B.width = s),
  30028. (B.height = f),
  30029. (G = B.getContext("2d"));
  30030. }
  30031. function n(t) {
  30032. if (t) {
  30033. var e,
  30034. a = G.getImageData(0, 0, s, f),
  30035. i = a.data;
  30036. for (e = 0; at > e; e += 4)
  30037. (i[e] = (t[e] * it) | 0),
  30038. (i[e + 1] = (t[e + 1] * it) | 0),
  30039. (i[e + 2] = (t[e + 2] * it) | 0),
  30040. (i[e + 3] = (t[e + 3] * it) | 0);
  30041. return delete t, a;
  30042. }
  30043. return G.getImageData(0, 0, s, f);
  30044. }
  30045. function o(t, e, a, i, r) {
  30046. return (
  30047. 0.5 *
  30048. (i -
  30049. e +
  30050. (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) *
  30051. t) *
  30052. t +
  30053. a
  30054. );
  30055. }
  30056. a ||
  30057. ((a = t.input),
  30058. (i = t.output),
  30059. (r = t.inputRemovable),
  30060. t.scale && (t = t.scale));
  30061. var u, d;
  30062. if (a.src)
  30063. if (
  30064. ((u = document.createElement("canvas")), null != a.naturalWidth)
  30065. )
  30066. (u.width = a.naturalWidth), (u.height = a.naturalHeight);
  30067. else if (null != a.runtimeStyle) {
  30068. var l = a.runtimeStyle,
  30069. c = l.width,
  30070. g = l.height;
  30071. (l.width = "auto"),
  30072. (l.height = "auto"),
  30073. (u.width = a.width),
  30074. (u.height = a.height),
  30075. (l.width = c),
  30076. (l.height = g);
  30077. } else {
  30078. var c = a.width,
  30079. g = a.height;
  30080. a.removeAttribute &&
  30081. (a.removeAttribute("width"), a.removeAttribute("height")),
  30082. (u.width = a.width),
  30083. (u.height = a.height),
  30084. (a.width = c),
  30085. (a.height = g);
  30086. }
  30087. else u = a;
  30088. (d = u.getContext("2d")), a.src && d.drawImage(a, 0, 0);
  30089. var s,
  30090. f,
  30091. m = u.width,
  30092. w = u.height,
  30093. p = d.getImageData(0, 0, m, w).data;
  30094. if (!m || !w) return !1;
  30095. (a.src || r) && u.clearRect(0, 0, m, w),
  30096. "object" == typeof t
  30097. ? t.width
  30098. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  30099. : ((s = (m * t.scaleX + 0.5) | 0),
  30100. (f = (w * t.scaleY + 0.5) | 0))
  30101. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0));
  30102. var v,
  30103. b,
  30104. y,
  30105. x,
  30106. D,
  30107. I,
  30108. A,
  30109. j,
  30110. R,
  30111. k,
  30112. C,
  30113. E,
  30114. F,
  30115. L,
  30116. S,
  30117. U,
  30118. W,
  30119. H,
  30120. alpha,
  30121. X,
  30122. Y,
  30123. q,
  30124. z,
  30125. B,
  30126. G,
  30127. J,
  30128. K,
  30129. M,
  30130. N,
  30131. O,
  30132. P,
  30133. Q,
  30134. T,
  30135. V,
  30136. Z,
  30137. $ = s << 2,
  30138. _ = m << 2,
  30139. tt = 0,
  30140. et = 0,
  30141. at = $ * f,
  30142. it = 255.99 / 255,
  30143. rt = s / m,
  30144. ht = f / w,
  30145. nt = rt * ht;
  30146. if (rt > 1 || ht > 1)
  30147. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  30148. for (
  30149. b = x / ht,
  30150. R = 0 | b,
  30151. q = b - R,
  30152. N = R * _,
  30153. M = 1 > R ? N : N - _,
  30154. w - 2 > R
  30155. ? ((O = N + _), (P = (R + 2) * _))
  30156. : (O = P = R > w - 2 ? N : N + _),
  30157. y = 0;
  30158. s > y;
  30159. y++, et += 4
  30160. )
  30161. (v = y / rt),
  30162. (j = 0 | v),
  30163. (z = v - j),
  30164. (T = j << 2),
  30165. (Q = 1 > j ? T : T - 4),
  30166. m - 2 > j
  30167. ? ((V = T + 4), (Z = T + 8))
  30168. : (V = Z = j > m - 2 ? T : T + 4),
  30169. (H =
  30170. (o(
  30171. q,
  30172. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30173. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30174. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30175. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30176. ) *
  30177. it) |
  30178. 0),
  30179. ++Q,
  30180. ++T,
  30181. ++V,
  30182. ++Z,
  30183. (X =
  30184. (o(
  30185. q,
  30186. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30187. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30188. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30189. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30190. ) *
  30191. it) |
  30192. 0),
  30193. ++Q,
  30194. ++T,
  30195. ++V,
  30196. ++Z,
  30197. (Y =
  30198. (o(
  30199. q,
  30200. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30201. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30202. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30203. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30204. ) *
  30205. it) |
  30206. 0),
  30207. ++Q,
  30208. ++T,
  30209. ++V,
  30210. ++Z,
  30211. (alpha =
  30212. (o(
  30213. q,
  30214. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  30215. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  30216. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  30217. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  30218. ) *
  30219. it) |
  30220. 0),
  30221. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  30222. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  30223. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  30224. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0);
  30225. else {
  30226. if (e.Float32Array) W = new Float32Array(at);
  30227. else for (W = [], et = 0; at > et; ++et) W[et] = 0;
  30228. for (b = 0; w > b; b++)
  30229. for (
  30230. x = b * ht,
  30231. A = 0 | x,
  30232. D = A * $,
  30233. U = !!((A - ((x + ht) | 0)) * (w - 1 - b)) << 1,
  30234. U && ((F = A + 1 - x), (L = x + ht - A - 1)),
  30235. v = 0;
  30236. m > v;
  30237. v++, tt += 4
  30238. )
  30239. switch (
  30240. ((y = v * rt),
  30241. (I = 0 | y),
  30242. (et = D + (I << 2)),
  30243. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  30244. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  30245. (H = p[tt]),
  30246. (X = p[tt + 1]),
  30247. (Y = p[tt + 2]),
  30248. (alpha = p[tt + 3]),
  30249. S + U)
  30250. ) {
  30251. case 0:
  30252. (W[et] += H * nt),
  30253. (W[et + 1] += X * nt),
  30254. (W[et + 2] += Y * nt),
  30255. (W[et + 3] += alpha * nt);
  30256. break;
  30257. case 1:
  30258. (k = C * ht),
  30259. (W[et] += H * k),
  30260. (W[et + 1] += X * k),
  30261. (W[et + 2] += Y * k),
  30262. (W[et + 3] += alpha * k),
  30263. (k = E * ht),
  30264. (W[et + 4] += H * k),
  30265. (W[et + 5] += X * k),
  30266. (W[et + 6] += Y * k),
  30267. (W[et + 7] += alpha * k);
  30268. break;
  30269. case 2:
  30270. (k = rt * F),
  30271. (W[et] += H * k),
  30272. (W[et + 1] += X * k),
  30273. (W[et + 2] += Y * k),
  30274. (W[et + 3] += alpha * k),
  30275. (k = rt * L),
  30276. (et += $),
  30277. (W[et] += H * k),
  30278. (W[et + 1] += X * k),
  30279. (W[et + 2] += Y * k),
  30280. (W[et + 3] += alpha * k);
  30281. break;
  30282. default:
  30283. (k = C * F),
  30284. (W[et] += H * k),
  30285. (W[et + 1] += X * k),
  30286. (W[et + 2] += Y * k),
  30287. (W[et + 3] += alpha * k),
  30288. (k = E * F),
  30289. (W[et + 4] += H * k),
  30290. (W[et + 5] += X * k),
  30291. (W[et + 6] += Y * k),
  30292. (W[et + 7] += alpha * k),
  30293. (k = C * L),
  30294. (et += $),
  30295. (W[et] += H * k),
  30296. (W[et + 1] += X * k),
  30297. (W[et + 2] += Y * k),
  30298. (W[et + 3] += alpha * k),
  30299. (k = E * L),
  30300. (W[et + 4] += H * k),
  30301. (W[et + 5] += X * k),
  30302. (W[et + 6] += Y * k),
  30303. (W[et + 7] += alpha * k);
  30304. }
  30305. delete p, h(), (J = n(W));
  30306. }
  30307. if ((G.putImageData(J, 0, 0), "string" == typeof i)) {
  30308. if ("png" === i || "jpeg" === i) {
  30309. var ot;
  30310. return (
  30311. (ot = r && a.src ? a : new Image()),
  30312. (ot.width = s),
  30313. (ot.height = f),
  30314. (ot.src = B.toDataURL("image/" + i, 0.85)),
  30315. ot
  30316. );
  30317. }
  30318. if ("png-src" === i || "jpeg-src" === i)
  30319. return B.toDataURL("image/" + i.split("-")[0], 0.85);
  30320. }
  30321. return B;
  30322. }
  30323. var e = this;
  30324. "undefined" != typeof exports
  30325. ? ("undefined" != typeof module &&
  30326. module.exports &&
  30327. (exports = module.exports = t),
  30328. (exports.scale = t))
  30329. : (c = t);
  30330. }).call(this);
  30331. OUTPUT.exports = c;
  30332. },
  30333. {},
  30334. ],
  30335. 156: [
  30336. function (e, t, i) {
  30337. (function (i) {
  30338. "use strict";
  30339. function n(e, t) {
  30340. (this.model = e),
  30341. (this.panos = e.panos),
  30342. (this.player = t),
  30343. (this.imagePanos = this.listImagePanos()),
  30344. (this.retryMinimumTime = 1e4);
  30345. }
  30346. var r = (e("three"), e("./enum/Viewmode")),
  30347. o = (e("./settings"), e("./objects/Panorama")),
  30348. a = e("./util/logger"),
  30349. s = new a(i);
  30350. (n.prototype.start = function () {
  30351. this.loadNextPano(
  30352. function (e) {
  30353. e
  30354. ? this.start()
  30355. : (s.debug(
  30356. "No suitable pano loaded, waiting a little while before looking again"
  30357. ),
  30358. setTimeout(
  30359. function () {
  30360. this.start();
  30361. }.bind(this),
  30362. 1e3
  30363. ));
  30364. }.bind(this)
  30365. );
  30366. }),
  30367. (n.prototype.validLoadTarget = function (e) {
  30368. return (
  30369. e &&
  30370. !e.isLoaded("high") &&
  30371. Date.now() - e.failedLoadingAt > this.retryMinimumTime
  30372. );
  30373. }),
  30374. (n.prototype.listImagePanos = function () {
  30375. var e = [],
  30376. t = this;
  30377. return (
  30378. this.model.images.forEach(function (i) {
  30379. if (i.metadata && i.metadata.scan_id) {
  30380. var n = t.model.panos.get(i.metadata.scan_id);
  30381. n && !n.isLoaded("high") && e.push(n);
  30382. }
  30383. }),
  30384. e
  30385. );
  30386. }),
  30387. (n.prototype.nextNotLoadedImage = function () {
  30388. for (; this.imagePanos.length > 0; ) {
  30389. var e = this.imagePanos[0];
  30390. if (!e.isLoaded("high")) return e;
  30391. this.imagePanos.shift();
  30392. }
  30393. return null;
  30394. }),
  30395. (n.prototype.loadNextPano = function (e) {
  30396. var t,
  30397. i,
  30398. n = this.model.waitQueue.filter(function (e) {
  30399. return e.object instanceof o;
  30400. });
  30401. n.length > 0
  30402. ? ((t = n[0].object),
  30403. s.debug(
  30404. "Overrode pano selection: Flying to an unloaded pano " +
  30405. t.id
  30406. ))
  30407. : this.validLoadTarget(this.player.currentPano)
  30408. ? ((t = this.player.currentPano),
  30409. s.debug(
  30410. "Overrode pano selection: Currently at an unloaded pano " +
  30411. t.id
  30412. ))
  30413. : this.validLoadTarget(this.player.closestPano)
  30414. ? ((t = this.player.closestPano),
  30415. s.debug(
  30416. "Overrode pano selection: Hovering over an unloaded pano " +
  30417. t.id
  30418. ))
  30419. : this.validLoadTarget(this.nextNotLoadedImage())
  30420. ? ((i = "high"),
  30421. (t = this.imagePanos[0]),
  30422. s.debug("Overrode pano selection: Highlight image " + t.id))
  30423. : this.player.mode === r.PANORAMA &&
  30424. ((t = this.panos.lowestByScore(
  30425. [
  30426. this.validLoadTarget.bind(this),
  30427. o.filters.isNeighbourPanoTo(this.player.currentPano),
  30428. ],
  30429. [
  30430. o.scoreFunctions.distance(this.player.currentPano),
  30431. o.scoreFunctions.direction(
  30432. this.player.position,
  30433. this.player.getDirection()
  30434. ),
  30435. o.scoreFunctions.inFieldOfView(
  30436. this.player.position,
  30437. this.player.getDirection()
  30438. ),
  30439. ]
  30440. )),
  30441. t && s.debug("Normal pano selection: neighbor " + t.id)),
  30442. t
  30443. ? ((i = i || t.isLoaded("low") ? "high" : "low"),
  30444. s.debug("Preloading " + i + "-res pano " + t.id),
  30445. t
  30446. .loadCube(i)
  30447. .done(e)
  30448. .fail(function () {
  30449. s.warn(
  30450. "Failed preloading pano",
  30451. t.id,
  30452. ", marking it as failed and forgetting it for a while"
  30453. ),
  30454. e();
  30455. }))
  30456. : e && e(null);
  30457. }),
  30458. (t.exports = n);
  30459. }).call(this, "/js/preloaders.js");
  30460. },
  30461. {
  30462. "./enum/Viewmode": 51,
  30463. "./objects/Panorama": 148,
  30464. "./settings": 166,
  30465. "./util/logger": 189,
  30466. three: 217,
  30467. },
  30468. ],
  30469. 157: [
  30470. function (e, t, i) {
  30471. (function (i) {
  30472. "use strict";
  30473. function n(e, t, i, n, r) {
  30474. (this.qualityManager = e),
  30475. (this.scene = t),
  30476. (this.camera = i),
  30477. (this.container = r),
  30478. (this.controls = n),
  30479. (this.controls.enabled = !0),
  30480. (this.controls.locked = !0),
  30481. (this.quickstartCamera = n.camera),
  30482. (this.quickstartCamera.fov = h.clampVFOV(
  30483. a.insideFOV,
  30484. a.insideFOVMax,
  30485. $("#player").width(),
  30486. $("#player").height()
  30487. )),
  30488. (this.skybox = null);
  30489. }
  30490. var r = e("three"),
  30491. o = e("../util/logger"),
  30492. a = e("../constants"),
  30493. s =
  30494. (e("../util/transitions"),
  30495. e("../util/lerp"),
  30496. e("../util/easing"),
  30497. e("../enum/Vectors")),
  30498. l = e("../enum/PanoSizeClass"),
  30499. c =
  30500. (e("../materials/ModelTextureMaterial"),
  30501. e("../materials/CubemapMaterial")),
  30502. h =
  30503. (e("../cameras/PanoramaCamera"),
  30504. e("../controls/PanoramaControls"),
  30505. e("../tile/TileUtils"),
  30506. e("../util/camera"),
  30507. e("../util/cameraLight")),
  30508. u =
  30509. (e("../util/browser"),
  30510. e("../settings"),
  30511. e("../gui/helpManager"),
  30512. new o(i));
  30513. (n.prototype.load = function (e) {
  30514. e.pano.shouldRedrawOnBaseLoaded = !0;
  30515. var t,
  30516. i,
  30517. n = this,
  30518. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  30519. o = r.clone().negate();
  30520. this.controls.lookAt(r.add(this.quickstartCamera.position));
  30521. var a = this.qualityManager.getPanoSize(l.BASE),
  30522. c = this.qualityManager.getPanoSize(l.STANDARD);
  30523. if (e.pano.tiled) {
  30524. u.warn("Loading startPano, TILED", e.pano.id);
  30525. var d = h.getHFOVForCamera(
  30526. this.quickstartCamera,
  30527. $("#player").width(),
  30528. $("#player").height()
  30529. ),
  30530. p = this.quickstartCamera.fov;
  30531. u.warn(
  30532. "Quickstart loading tiles in frustum: [horizontal FOV: " +
  30533. d +
  30534. ", vertical FOV: " +
  30535. p +
  30536. "]"
  30537. ),
  30538. (t = e.pano.loadTiledPano(
  30539. c,
  30540. r,
  30541. {
  30542. hFov: d,
  30543. vFov: p,
  30544. },
  30545. !1,
  30546. !1,
  30547. !0
  30548. )),
  30549. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0));
  30550. } else
  30551. u.warn("Loading startPano", e.pano.id),
  30552. (t = e.pano.loadCube("high"));
  30553. return $.when(t).then(
  30554. function () {
  30555. n.init(e.pano, e.quaternion),
  30556. e.pano.tiled
  30557. ? i.done(
  30558. function () {
  30559. (e.pano.lockUntilRenderingComplete = !1),
  30560. (this.controls.locked = !1);
  30561. }.bind(this)
  30562. )
  30563. : (this.controls.locked = !1);
  30564. }.bind(this)
  30565. );
  30566. }),
  30567. (n.prototype.init = function (e, t) {
  30568. u.info("Quickstart done loading, adding scene objects"),
  30569. (e.lockUntilRenderingComplete = !0),
  30570. (this.skybox = new r.Mesh(
  30571. new r.CubeGeometry(1, 1, 1),
  30572. new c({
  30573. side: r.BackSide,
  30574. })
  30575. )),
  30576. (this.skybox.material.uniforms.map.value =
  30577. e.getSkyboxTexture()),
  30578. this.skybox.quaternion.copy(e.quaternion),
  30579. this.scene.add(this.skybox),
  30580. $(this.container).show();
  30581. }),
  30582. (n.prototype.update = function (e) {
  30583. this.controls.update(e), this.camera.copy(this.quickstartCamera);
  30584. }),
  30585. (n.prototype.setSize = function (e, t) {
  30586. this.quickstartCamera.updateAspect(e / t);
  30587. }),
  30588. (n.prototype.destroy = function () {
  30589. this.scene.remove(this.skybox);
  30590. }),
  30591. (t.exports = n);
  30592. }).call(this, "/js/scene/QuickstartManager.js");
  30593. },
  30594. {
  30595. "../cameras/PanoramaCamera": 7,
  30596. "../constants": 8,
  30597. "../controls/PanoramaControls": 13,
  30598. "../enum/PanoSizeClass": 36,
  30599. "../enum/Vectors": 50,
  30600. "../gui/helpManager": 68,
  30601. "../materials/CubemapMaterial": 117,
  30602. "../materials/ModelTextureMaterial": 118,
  30603. "../settings": 166,
  30604. "../tile/TileUtils": 174,
  30605. "../util/browser": 182,
  30606. "../util/camera": 183,
  30607. "../util/cameraLight": 184,
  30608. "../util/easing": 186,
  30609. "../util/lerp": 188,
  30610. "../util/logger": 189,
  30611. "../util/transitions": 195,
  30612. three: 217,
  30613. },
  30614. ],
  30615. 158: [
  30616. function (e, t, i) {
  30617. "use strict";
  30618. function n(e, t, i) {
  30619. (this.scene = e),
  30620. (this.camera = t),
  30621. (this.renderer = null),
  30622. (this.effects = i),
  30623. (this.animateCallback = null),
  30624. (this.composer = null),
  30625. (this.qualityManager = null),
  30626. (e.renderWidth = 0),
  30627. (e.renderHeight = 0),
  30628. (this.updateClock = new r.Clock()),
  30629. (this.components = []),
  30630. (this.updateListeners = []),
  30631. (this.resizeListeners = []),
  30632. (this.forceUpdateSize = !1),
  30633. (this.started = !1),
  30634. (this.textures = {}),
  30635. (this.suspendedObjects = []);
  30636. }
  30637. var r = e("three"),
  30638. o = e("../shaders"),
  30639. a = e("../enum/SceneRendererEvents"),
  30640. s = e("../enum/GLTextureType"),
  30641. l = e("../enum/GLCubeFaces"),
  30642. c = e("../exception/BasicException"),
  30643. h = e("../exception/RendererCreationException"),
  30644. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  30645. m = e("../util/browser"),
  30646. /**************************************************************************************************************************************************/
  30647. u = e("../settings"),
  30648. d = e("events").EventEmitter;
  30649. (window.requestAnimationFrame =
  30650. window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  30651. (n.prototype = Object.create(d.prototype)),
  30652. (n.prototype.addComponent = function (e) {
  30653. this.components.push(e),
  30654. e.update && this.updateListeners.push(e),
  30655. e.setSize &&
  30656. (this.resizeListeners.push(e), (this.forceUpdateSize = !0));
  30657. }),
  30658. (n.prototype.removeComponent = function (e) {
  30659. var t = function (t) {
  30660. return t !== e;
  30661. };
  30662. (this.components = this.components.filter(t)),
  30663. (this.updateListeners = this.updateListeners.filter(t)),
  30664. (this.resizeListeners = this.resizeListeners.filter(t));
  30665. }),
  30666. (n.prototype.start = function (e) {
  30667. if (this.started)
  30668. throw new c("Can't start SceneRenderer, already started");
  30669. this.createContext(e),
  30670. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  30671. m.isMobile() && this.boluoVrInit(),
  30672. /*******************************************************************************************************************************/
  30673. this.initComposer(),
  30674. (this.started = !0),
  30675. (p = p.bind(this))();
  30676. }),
  30677. (n.prototype.createContext = function (e) {
  30678. var transparent = !!(settings.transparentBg || settings.bgImg);
  30679. try {
  30680. (this.renderer = new r.WebGLRenderer({
  30681. antialias: !m.isMobile(),
  30682. alpha: transparent,
  30683. })),
  30684. (this.renderer.autoClear = !0),
  30685. this.renderer.setPixelRatio(
  30686. window.devicePixelRatio ? window.devicePixelRatio : 1
  30687. ),
  30688. this.renderer.setSize(
  30689. $("#player").width(),
  30690. $("#player").height(),
  30691. false
  30692. ), //改
  30693. transparent && this.renderer.setClearColor(0x000000, 0); //透明
  30694. this.emit(a.ContextCreated);
  30695. } catch (e) {
  30696. throw new h("Unable to create a WebGL rendering context");
  30697. }
  30698. u.profiling.enabled && this.overrideTextures(),
  30699. e.appendChild(this.renderer.domElement);
  30700. /* window.stats = new Stats();
  30701. e.appendChild( stats.dom ); */
  30702. }),
  30703. (n.prototype.overrideTextures = function () {
  30704. var e = this.renderer.context,
  30705. t = 0,
  30706. i = e.createTexture;
  30707. e.createTexture = function () {
  30708. var n = i.call(e);
  30709. return (n.id = t++), (this.textures[n.id] = n), n;
  30710. }.bind(this);
  30711. var n = e.texImage2D;
  30712. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  30713. var d,
  30714. p = this.getTextureTypeFromTarget(e, t);
  30715. (d =
  30716. p === s.TextureCube
  30717. ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP)
  30718. : e.getParameter(e.TEXTURE_BINDING_2D)),
  30719. void 0 !== c
  30720. ? n.call(e, t, i, r, o, a, l, c, h, u)
  30721. : ((c = o),
  30722. (h = a),
  30723. (u = l),
  30724. (o = u.naturalWidth),
  30725. (a = u.naturalHeight),
  30726. n.call(e, t, i, r, c, h, u));
  30727. var f = this.textures[d.id];
  30728. (f.width = p === s.TextureCube ? 6 * o : o), (f.height = a);
  30729. }.bind(this);
  30730. var r = e.deleteTexture;
  30731. e.deleteTexture = function (t) {
  30732. delete this.textures[t.id], r.call(e, t);
  30733. }.bind(this);
  30734. }),
  30735. (n.prototype.updateTextureMemory = (function () {
  30736. var e = null;
  30737. return function () {
  30738. var t = 0;
  30739. for (var i in this.textures) {
  30740. var n = this.textures[i];
  30741. n.width && n.height && (t += n.width * n.height * 4);
  30742. }
  30743. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t);
  30744. };
  30745. })()),
  30746. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  30747. switch (t) {
  30748. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  30749. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  30750. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  30751. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30752. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  30753. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30754. return s.TextureCube;
  30755. case e.TEXTURE_2D:
  30756. return s.Texture2D;
  30757. default:
  30758. return null;
  30759. }
  30760. }),
  30761. (n.prototype.initComposer = function () {
  30762. (this.composer = new r.EffectComposer(this.renderer)),
  30763. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  30764. //this.composer.addPass(this.effects.hblurPass),
  30765. //this.composer.addPass(this.effects.vblurPass)
  30766. this.composer.addPass(this.effects.transitionMaskPass); //add
  30767. }),
  30768. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  30769. (this.renderWidth = e),
  30770. (this.renderHeight = t),
  30771. (this.effects.aspect = e / t),
  30772. /* this.renderer.setSize(e, t), -----MP */
  30773. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  30774. this.composer.setSize(e, t);
  30775. for (var i = 0; i < this.resizeListeners.length; i++)
  30776. this.resizeListeners[i].setSize(e, t);
  30777. }),
  30778. (n.prototype.render = function () {
  30779. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  30780. this.effects.transitionMaskPass.enabled
  30781. ? this.composer.render()
  30782. : this.renderer.render(this.scene, this.camera);
  30783. });
  30784. /******************************************************************************************************徐世廷**********************************************************************/
  30785. var vrPermission = {};
  30786. var vrPermissionCallBack = function (info1, info2) {
  30787. if (info1 == "reset") {
  30788. vrPermission = {};
  30789. } else {
  30790. vrPermission[info1] = info2;
  30791. if (
  30792. Object.keys(vrPermission).length == 2 &&
  30793. (vrPermission.deviceMotion != "granted" ||
  30794. vrPermission.deviceOrientation != "granted")
  30795. ) {
  30796. alert(
  30797. "运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。"
  30798. );
  30799. }
  30800. }
  30801. };
  30802. (n.prototype.boluoVrInit = function () {
  30803. console.log("boluoVrInit");
  30804. //webxr.init(this.renderer)
  30805. (this.isHuawei5X = m.detectHUAWEI5X()),
  30806. (this.oldRenderer = this.renderer),
  30807. (this.newRenderer = new this.vrRenderer(
  30808. this.renderer,
  30809. this,
  30810. this.camera
  30811. ));
  30812. window.panoCamera = this.camera;
  30813. var a = this;
  30814. (window._vrEnabled = !1),
  30815. Object.defineProperty(window, "vrEnabled", {
  30816. get: function () {
  30817. return window._vrEnabled;
  30818. },
  30819. set: function (b) {
  30820. //if(webxr.xrType)return webxr.enterVR()
  30821. b = !!b;
  30822. b
  30823. ? ((a.renderer = a.newRenderer),
  30824. window.vrMarkers.forEach(function (a) {
  30825. a.visible = !0;
  30826. }))
  30827. : ((a.renderer = a.oldRenderer),
  30828. window.vrMarkers.forEach(function (a) {
  30829. a.visible = !1;
  30830. })),
  30831. (a.cursor.visible = b),
  30832. a.setSize(window.innerWidth, window.innerHeight),
  30833. (window._vrEnabled = b);
  30834. if (b) {
  30835. setTimeout(function () {
  30836. console.log("orientEnable" + window.orientEnable);
  30837. if (window.vrEnabled && !window.orientEnable) {
  30838. //很可能没能触发陀螺仪事件
  30839. if (m.detectIOS() /* && m.detectSafari() */) {
  30840. var b = m.iosVersion(); //{major: 10, minor: 3, patch: 1}
  30841. console.log("开始获取权限 major" + b.major);
  30842. if (b.major == 12 && b.minor >= 2) {
  30843. if (browser.detectSafari())
  30844. alert(
  30845. "浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。"
  30846. );
  30847. else {
  30848. //app??
  30849. alert(
  30850. "浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。"
  30851. );
  30852. }
  30853. } else if (b.major >= 13) {
  30854. if (!window.location.href.includes("https://")) {
  30855. console.log("需要https");
  30856. alert(
  30857. "当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。"
  30858. );
  30859. return;
  30860. }
  30861. var hasFailed =
  30862. window.vrPermission &&
  30863. (window.vrPermission.deviceMotion != "granted" ||
  30864. window.vrPermission.deviceOrientation !=
  30865. "granted");
  30866. setTimeout(
  30867. () => {
  30868. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  30869. if (!window.vrEnabled || window.orientEnable)
  30870. return;
  30871. vrPermissionCallBack("reset");
  30872. console.log(window.DeviceMotionEvent);
  30873. if (
  30874. window.DeviceMotionEvent &&
  30875. window.DeviceMotionEvent.requestPermission &&
  30876. typeof window.DeviceMotionEvent
  30877. .requestPermission === "function"
  30878. ) {
  30879. console.log("开始获取权限1");
  30880. ///注意:需要https 本地服务器permissionState会得到denied
  30881. window.DeviceMotionEvent.requestPermission()
  30882. .then((permissionState) => {
  30883. console.log(
  30884. "permissionState1: " + permissionState
  30885. );
  30886. vrPermissionCallBack(
  30887. "deviceMotion",
  30888. permissionState
  30889. );
  30890. })
  30891. .catch(function (e) {
  30892. vrPermissionCallBack("deviceMotion", false);
  30893. console.log(e);
  30894. });
  30895. } else {
  30896. console.log(
  30897. "window.DeviceMotionEvent undefined"
  30898. );
  30899. vrPermissionCallBack("deviceMotion", false);
  30900. }
  30901. if (
  30902. window.DeviceOrientationEvent &&
  30903. window.DeviceOrientationEvent
  30904. .requestPermission &&
  30905. typeof window.DeviceOrientationEvent
  30906. .requestPermission === "function"
  30907. ) {
  30908. console.log("开始获取权限2");
  30909. window.DeviceOrientationEvent.requestPermission()
  30910. .then((permissionState) => {
  30911. console.log(
  30912. "permissionState2: " + permissionState
  30913. );
  30914. vrPermissionCallBack(
  30915. "deviceOrientation",
  30916. permissionState
  30917. );
  30918. })
  30919. .catch(function (e) {
  30920. vrPermissionCallBack(
  30921. "deviceOrientation",
  30922. false
  30923. );
  30924. console.log(e);
  30925. });
  30926. } else {
  30927. console.log(
  30928. "window.DeviceOrientationEvent undefined"
  30929. );
  30930. vrPermissionCallBack(
  30931. "deviceOrientation",
  30932. false
  30933. );
  30934. }
  30935. },
  30936. hasFailed ? 0 : 150
  30937. );
  30938. /* /* setTimeout(function(){
  30939. if(settings.vrEnabled && !window.orientEnable){
  30940. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  30941. }
  30942. },4000) */
  30943. } else
  30944. console.log(
  30945. "陀螺仪未能启用 ios " + b.major + "." + b.minor
  30946. );
  30947. } else {
  30948. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  30949. }
  30950. } else {
  30951. //已经触发了
  30952. }
  30953. }, 200);
  30954. }
  30955. },
  30956. }),
  30957. this.createCursor(0.5, !1, 1, 16777215, 0);
  30958. var b = {
  30959. setSize: function (b, c) {
  30960. a.camera.aspect = b / c;
  30961. },
  30962. };
  30963. this.resizeListeners.push(b), this.vrLoadingInit();
  30964. }),
  30965. (n.prototype.vrLoadingInit = function () {
  30966. var a = function (camera) {
  30967. var a = this,
  30968. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  30969. c = new r.MeshBasicMaterial({
  30970. color: 4967932,
  30971. side: r.DoubleSide,
  30972. }),
  30973. d = new r.Mesh(b, c);
  30974. (this.mesh = d),
  30975. (d.position.z = -2),
  30976. d.scale.set(0.08, 0.08, 0.08),
  30977. (d.visible = !1),
  30978. camera.add(d),
  30979. //window.player.camera.add(d),
  30980. (a.enabled = !1),
  30981. (this.update = function (b) {
  30982. 1 == a.enabled && (d.rotation.z += 15 * b);
  30983. });
  30984. },
  30985. a = new a(this.camera);
  30986. (window.Loading = a), this.updateListeners.push(a);
  30987. }),
  30988. (n.prototype.createCursor = function (a, b, c, d, e) {
  30989. var g,
  30990. h = new r.SpriteMaterial({
  30991. opacity: c,
  30992. color: d,
  30993. transparent: b,
  30994. map: this.boluoGetTexture("static/images/cursor.png"),
  30995. needsUpdate: !0,
  30996. side: r.DoubleSide,
  30997. });
  30998. (h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  30999. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  31000. (h.depthTest = !1),
  31001. (h.blending = r.AdditiveBlending),
  31002. (g = new r.Sprite(h)),
  31003. // g.scale.set(a, a, a),
  31004. g.scale.set(0.3, 0.3, 0.3);
  31005. (g.position.z = -2),
  31006. (g.visible = !1),
  31007. (g.name = "cursor"),
  31008. this.camera.add(g),
  31009. this.scene.add(this.camera),
  31010. (this.cursor = g);
  31011. var i = new this.CursorAnimation(this.scene, g, this.camera);
  31012. (this.cursor.triggerTargetEvent = i.triggerTargetEvent),
  31013. this.updateListeners.push(i);
  31014. }),
  31015. (window.orientEnable = 0); //是否能触发deviceorientation
  31016. (n.prototype.CursorAnimation = function (a, b, c) {
  31017. function d() {
  31018. g.orient = r.Math.degToRad(window.orientation || 0);
  31019. }
  31020. function e(a) {
  31021. if (!window.vrEnabled && window.orientEnable) return;
  31022. window.orientEnable || (window.orientEnable = 1);
  31023. var b = r.Math.degToRad(a.alpha),
  31024. c = r.Math.degToRad(a.beta),
  31025. d = r.Math.degToRad(a.gamma);
  31026. if (
  31027. (this.isHuawei5X
  31028. ? (-1e3 === g.alpha && (g.alpha = b),
  31029. -1e3 === g.beta && (g.beta = c),
  31030. -1e3 === g.gamma && (g.gamma = d),
  31031. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  31032. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  31033. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  31034. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  31035. n.vrDebug)
  31036. ) {
  31037. $("#info-device-orientation").css("display", "block");
  31038. var e = "";
  31039. (e += "alpha=(" + g.alpha + ")<BR/>"),
  31040. (e += "beta=(" + g.beta + ")<BR/>"),
  31041. (e += "gamma=" + g.gamma + "<BR/>"),
  31042. (document.getElementById("info-device-orientation").innerHTML =
  31043. e);
  31044. }
  31045. }
  31046. (this.cursor = b),
  31047. (this.raycaster = new r.Raycaster()),
  31048. (this.targetEventObj = {}),
  31049. (this.type = 1),
  31050. (this.tweenFlag = !0);
  31051. var g = this;
  31052. (this.target = c),
  31053. console.log(c.uuid),
  31054. (this.euler = new r.Euler()),
  31055. (this.q0 = new r.Quaternion()),
  31056. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  31057. (this.zee = new r.Vector3(0, 0, 1)),
  31058. (this.alpha = -1e3),
  31059. (this.beta = -1e3),
  31060. (this.gamma = -1e3),
  31061. (this.orient = r.Math.degToRad(window.orientation || 0)),
  31062. window.addEventListener("orientationchange", d),
  31063. window.addEventListener("deviceorientation", e),
  31064. (this.setObjectQuaternion = function (a, b, d, e, f) {
  31065. g.euler.set(d, b, -e, "YXZ"),
  31066. a.setFromEuler(g.euler),
  31067. a.multiply(g.q1),
  31068. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  31069. c.updateMatrixWorld();
  31070. }),
  31071. parent !== window &&
  31072. window.addEventListener("message", function (a) {
  31073. var b = JSON.parse(a.data),
  31074. c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  31075. b &&
  31076. b.alpha &&
  31077. b.beta &&
  31078. b.gamma &&
  31079. (function (a) {
  31080. var c = r.Math.degToRad(b.alpha),
  31081. d = r.Math.degToRad(b.beta),
  31082. e = r.Math.degToRad(b.gamma);
  31083. a
  31084. ? (-1e3 === g.alpha && (g.alpha = c),
  31085. -1e3 === g.beta && (g.beta = d),
  31086. -1e3 === g.gamma && (g.gamma = e),
  31087. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  31088. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  31089. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  31090. : ((g.alpha = c), (g.beta = d), (g.gamma = e));
  31091. })(c);
  31092. }),
  31093. (this.update = function (a) {
  31094. TWEEN.update();
  31095. if (window.ifTest && window.vrEnabled)
  31096. this.triggerTargetEvent(); //测试时不根据陀螺仪来转向
  31097. else
  31098. window.vrEnabled &&
  31099. (this.setObjectQuaternion(
  31100. this.target.quaternion,
  31101. this.alpha,
  31102. this.beta,
  31103. this.gamma,
  31104. this.orient
  31105. ),
  31106. this.triggerTargetEvent());
  31107. }),
  31108. (this.triggerTargetEvent = function () {
  31109. var a = this.choseObj(),
  31110. b = a ? a.object : void 0;
  31111. (this.targetEventObj.currentObj = b),
  31112. b !== this.targetEventObj.lastObj &&
  31113. (b && this.autoCursorPosition(a),
  31114. 1 === this.type
  31115. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  31116. b &&
  31117. b.enabled &&
  31118. this.startAnimate(
  31119. function () {
  31120. this.clickCallback(b);
  31121. }.bind(this)
  31122. ))
  31123. : this.type,
  31124. (this.targetEventObj.lastObj = b));
  31125. }),
  31126. (this.choseObj = function () {
  31127. this.raycaster.setFromCamera(
  31128. {
  31129. x: 0,
  31130. y: 0,
  31131. },
  31132. c
  31133. );
  31134. var a = (this.raycaster.ray, window.vrMarkers),
  31135. b = this.raycaster.intersectObjects(a);
  31136. if (b.length > 0) return b[0];
  31137. }),
  31138. (this.clickCallback = function (a) {
  31139. this.runTHREEAction(a, "onclick");
  31140. }),
  31141. (this.runTHREEAction = function (a, b) {
  31142. switch (b) {
  31143. case "onclick":
  31144. a._listeners &&
  31145. a._listeners.click &&
  31146. a._listeners.click.forEach(function (a) {
  31147. a();
  31148. });
  31149. break;
  31150. case "onhover":
  31151. a._listeners &&
  31152. a._listeners.hover &&
  31153. a._listeners.hover.forEach(function (a) {
  31154. a();
  31155. });
  31156. break;
  31157. case "onout":
  31158. a._listeners &&
  31159. a._listeners.out &&
  31160. a._listeners.out.forEach(function (a) {
  31161. a();
  31162. });
  31163. }
  31164. }),
  31165. (this.startAnimate = function (a) {
  31166. this.tweenFlag && this.initAnimation(a);
  31167. }),
  31168. (this.initAnimation = function (a) {
  31169. var b = this,
  31170. c = this.cursor.material.map.offset,
  31171. d = function (a) {
  31172. return Math.floor(17 * a) / 17;
  31173. };
  31174. (b.tweenFlag = !1),
  31175. (this.cursorAnimate = new TWEEN.Tween(c)
  31176. .to(
  31177. {
  31178. x: 1,
  31179. },
  31180. 1e3
  31181. )
  31182. .onStart(function () {
  31183. b.tweenFlag = !1;
  31184. })
  31185. .onStop(function () {
  31186. (b.tweenFlag = !0), (this.x = 0), (c.x = 0);
  31187. })
  31188. .onUpdate(function () {})
  31189. .onComplete(function () {
  31190. a(),
  31191. (c.x = 0),
  31192. setTimeout(function () {
  31193. b.tweenFlag = !0;
  31194. }, 1500);
  31195. })),
  31196. this.cursorAnimate.easing(d),
  31197. this.cursorAnimate.start();
  31198. }),
  31199. (this.autoCursorPosition = function (a) {
  31200. // var b = Math.abs(a.distance - 10);
  31201. // this.cursor.position.z = -b,
  31202. // b /= 10;
  31203. // alert(b);
  31204. // this.cursor.scale.set(b, b, b)
  31205. this.cursor.scale.set(0.3, 0.3, 0.3);
  31206. });
  31207. }),
  31208. (n.prototype.vrRenderer = function (a, b, c) {
  31209. var d = new b.vrCamera(c);
  31210. (d.bananaAspect = 0.8), this.width, this.height;
  31211. var b = this;
  31212. (this.setSize = function (c, d) {
  31213. a.setSize.call(this, c, d), (b.width = c), (b.height = d);
  31214. }),
  31215. (this.render = function (b, c, e, f) {
  31216. window.cameraQua = c.quaternion.clone();
  31217. var g, h;
  31218. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f);
  31219. if ("PerspectiveCamera" === c.type)
  31220. (g = d.cameraL),
  31221. (h = d.cameraR),
  31222. b.updateMatrixWorld(),
  31223. null === c.parent && c.updateMatrixWorld(),
  31224. d.vrCameraUpdate(c);
  31225. else {
  31226. if ("OrthographicCamera" !== c.type)
  31227. return (
  31228. DEBUG && console.error("Unsupported renderer: ", c.type)
  31229. );
  31230. g = h = c;
  31231. }
  31232. a.setScissorTest(!0),
  31233. a.setScissor(0, 0, this.width / 2, this.height),
  31234. a.setViewport(0, 0, this.width / 2, this.height),
  31235. a.render.call(this, b, g, e, f),
  31236. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  31237. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  31238. a.render.call(this, b, h, e, f),
  31239. a.setScissorTest(!1);
  31240. }),
  31241. (this.__proto__ = {
  31242. __proto__: a,
  31243. });
  31244. }),
  31245. (n.prototype.vrCamera = function (a) {
  31246. (this.type = "StereoCamera"),
  31247. (this._aspect = 1),
  31248. (this._overlap = 0.064),
  31249. (this.cameraL = new r.PerspectiveCamera()),
  31250. this.cameraL.layers.enable(1),
  31251. (this.cameraL.near = 0.01), //xzw add
  31252. (this.cameraL.matrixAutoUpdate = !1),
  31253. (this.cameraR = new r.PerspectiveCamera()),
  31254. this.cameraR.layers.enable(2),
  31255. (this.cameraR.near = 0.01), //xzw add
  31256. (this.cameraR.matrixAutoUpdate = !1),
  31257. (this.eyeRight = new r.Matrix4()),
  31258. (this.eyeLeft = new r.Matrix4()),
  31259. (this.vrCameraNeedsUpdate = !0),
  31260. (window.vrCameraL = this.cameraL); // fyz 记录vr相机
  31261. Object.defineProperty(this, "bananaAspect", {
  31262. get: function () {
  31263. return this._aspect;
  31264. },
  31265. set: function (a) {
  31266. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  31267. (this._aspect = a);
  31268. },
  31269. }),
  31270. Object.defineProperty(this, "overlap", {
  31271. get: function () {
  31272. return this._overlap;
  31273. },
  31274. set: function (a) {
  31275. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  31276. (this._overlap = a);
  31277. },
  31278. }),
  31279. (this.vrCameraUpdate = function (a) {
  31280. this.vrCameraNeedsUpdate = true;
  31281. if (
  31282. ((this.vrCameraNeedsUpdate =
  31283. this.vrCameraNeedsUpdate ||
  31284. this.bananaFov !== a.fov ||
  31285. this.bananaReal_aspect !== a.aspect * this.bananaAspect ||
  31286. this.bananaNear !== a.near ||
  31287. this.bananaFar !== a.far),
  31288. this.vrCameraNeedsUpdate)
  31289. ) {
  31290. (this.vrCameraNeedsUpdate = !1),
  31291. //console.debug("vrCameraUpdate"),
  31292. (this.bananaFocus = a.focus),
  31293. (this.bananaFov = a.fov),
  31294. (this.bananaReal_aspect = a.aspect * this.bananaAspect),
  31295. (this.bananaNear = a.near),
  31296. (this.bananaFar = a.far),
  31297. //console.debug(a.aspect),
  31298. (this.bananaFocus = 10);
  31299. var b,
  31300. c,
  31301. d = a.projectionMatrix.clone(),
  31302. e = this.overlap / 2,
  31303. f = (e * this.bananaNear) / this.bananaFocus,
  31304. g =
  31305. this.bananaNear *
  31306. Math.tan((Math.PI / 180) * this.bananaFov * 0.5);
  31307. (this.eyeLeft.elements[12] = -e),
  31308. (this.eyeRight.elements[12] = e),
  31309. (b = -g * this.bananaReal_aspect + f),
  31310. (c = g * this.bananaReal_aspect + f),
  31311. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  31312. (d.elements[8] = (c + b) / (c - b)),
  31313. this.cameraL.projectionMatrix.copy(d),
  31314. (b = -g * this.bananaReal_aspect - f),
  31315. (c = g * this.bananaReal_aspect - f),
  31316. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  31317. (d.elements[8] = (c + b) / (c - b)),
  31318. this.cameraR.projectionMatrix.copy(d);
  31319. }
  31320. this.cameraL.matrixWorld
  31321. .copy(a.matrixWorld)
  31322. .multiply(this.eyeLeft),
  31323. this.cameraR.matrixWorld
  31324. .copy(a.matrixWorld)
  31325. .multiply(this.eyeRight);
  31326. });
  31327. }),
  31328. (n.prototype.boluoGetTexture = function (a) {
  31329. var b = new r.TextureLoader();
  31330. return (b.crossOrigin = "anonymous"), b.load(a);
  31331. });
  31332. /* let webxr = {
  31333. init(renderer) {
  31334. this.renderer = renderer
  31335. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  31336. renderer.xr.enabled = true
  31337. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  31338. //pico firefox
  31339. var mode = 'immersive-vr'
  31340. navigator.xr
  31341. .isSessionSupported(mode)
  31342. .then(supported => {
  31343. if (!supported) {
  31344. this.xrNotFound('isSessionSupported not supported')
  31345. } else {
  31346. this.xrType = 'xr' //showEnterXR();
  31347. }
  31348. })
  31349. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  31350. } else if ('getVRDisplays' in navigator) {
  31351. //pico 的vr browser是这个
  31352. console.log('getVRDisplays')
  31353. let setDevice = device => {
  31354. this.xrType = 'vr'
  31355. this.device = device
  31356. this.renderer.xr.setDevice(device) //新版是renderer.vr
  31357. }
  31358. window.addEventListener(
  31359. 'vrdisplayconnect',
  31360. function (event) {
  31361. setDevice(event.display)
  31362. },
  31363. false
  31364. )
  31365. window.addEventListener(
  31366. 'vrdisplaydisconnect',
  31367. function ( ) {
  31368. console.log('vrdisplaydisconnect')
  31369. window.bus.dispatchEvent({type:'exitWebXR'})
  31370. },
  31371. false
  31372. )
  31373. window.addEventListener(
  31374. 'vrdisplaypresentchange',
  31375. function (event) {
  31376. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  31377. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  31378. },
  31379. false
  31380. )
  31381. window.addEventListener(
  31382. 'vrdisplayactivate',
  31383. function (event) {
  31384. event.display.requestPresent([{ source: this.renderer.domElement }])
  31385. },
  31386. false
  31387. )
  31388. navigator
  31389. .getVRDisplays()
  31390. .then(function (displays) {
  31391. if (displays.length > 0) {
  31392. setDevice(displays[0])
  31393. } else {
  31394. this.xrNotFound('no displays')
  31395. }
  31396. })
  31397. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  31398. } else {
  31399. this.xrNotFound('xr not supported')
  31400. }
  31401. },
  31402. enterVR() {
  31403. if (!this.xrType) return //不支持
  31404. console.log('enterVR', this.xrType)
  31405. if (this.xrType == 'vr') {
  31406. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  31407. } else if (this.xrType == 'xr') {
  31408. if (this.currentSession == void 0) {
  31409. console.log('this.currentSession == void 0 ')
  31410. function getXRSessionInit(mode, options) {
  31411. var space = (options || {}).referenceSpaceType || 'local-floor'
  31412. var sessionInit = (options && options.sessionInit) || {}
  31413. // Nothing to do for default features.
  31414. if (space == 'viewer') return sessionInit
  31415. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  31416. // If the user already specified the space as an optional or required feature, don't do anything.
  31417. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  31418. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  31419. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  31420. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  31421. // request it later.
  31422. var newInit = Object.assign({}, sessionInit)
  31423. newInit.requiredFeatures = [space]
  31424. if (sessionInit.requiredFeatures) {
  31425. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  31426. }
  31427. return newInit
  31428. }
  31429. let onSessionEnded = ( ) => {
  31430. console.log('onSessionEnded')
  31431. this.currentSession.removeEventListener('end', onSessionEnded)
  31432. setTimeout(()=>{
  31433. this.renderer.xr.setSession(null)
  31434. this.currentSession = null
  31435. window.bus.dispatchEvent({type:'exitWebXR'})
  31436. },1)//延迟原因:先使THREE里的onSessionEnded执行
  31437. }
  31438. let onSessionStarted = session => {
  31439. console.log('onSessionStarted')
  31440. session.addEventListener('end', onSessionEnded)
  31441. this.renderer.xr.setSession(session)
  31442. this.currentSession = session
  31443. }
  31444. var mode = 'immersive-vr'
  31445. var sessionInit = getXRSessionInit(mode)
  31446. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  31447. } else {
  31448. console.log('this.currentSession.end()', this.currentSession)
  31449. this.currentSession.end()
  31450. }
  31451. }
  31452. },
  31453. xrNotFound(text) {
  31454. console.log('xrNotFound:', text)
  31455. },
  31456. } */
  31457. /***********************************************************************************************************************************************************************************/
  31458. (n.prototype.updateScreenSize = (function () {
  31459. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  31460. var W, H; //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  31461. return function (o) {
  31462. var render = false;
  31463. var ratio;
  31464. var w, h; //记录应当render的大小
  31465. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  31466. (w = o.width), (h = o.height), (render = true), (ratio = 1);
  31467. } else {
  31468. w = $("#player").width();
  31469. h = $("#player").height();
  31470. o &&
  31471. o.resize &&
  31472. ((W = this.renderWidth), (H = this.renderHeight));
  31473. (w !== W || h !== H || this.forceUpdateSize) &&
  31474. ((W = w),
  31475. (H = h),
  31476. (render = true),
  31477. (ratio = window.devicePixelRatio));
  31478. }
  31479. if (render) {
  31480. this.setSize(w, h, ratio);
  31481. this.forceUpdateSize = !1;
  31482. }
  31483. };
  31484. })()),
  31485. (n.prototype.updateComponents = function () {
  31486. for (
  31487. var e = Math.min(1, this.updateClock.getDelta()), t = 0;
  31488. t < this.updateListeners.length;
  31489. t++
  31490. )
  31491. this.updateListeners[t].update(e);
  31492. }),
  31493. (n.prototype.suspend = function () {
  31494. (this.started = !1),
  31495. (this.suspendedObjects = this.scene.children.map(
  31496. function (e) {
  31497. return this.scene.remove(e), e;
  31498. }.bind(this)
  31499. )),
  31500. this.render();
  31501. }),
  31502. (n.prototype.resume = function () {
  31503. this.suspendedObjects.forEach(
  31504. function (e) {
  31505. this.scene.add(e);
  31506. }.bind(this)
  31507. ),
  31508. (this.suspendedObjects = []),
  31509. (this.started = !0),
  31510. p();
  31511. });
  31512. var p = function () {
  31513. this.started &&
  31514. (window.requestAnimationFrame(p),
  31515. this.updateScreenSize(), // fyz resize
  31516. this.updateComponents(),
  31517. this.updateTextureMemory(),
  31518. this.render(),
  31519. window.stats && (window.fps = stats.update()),
  31520. this.emit(a.AfterRender));
  31521. };
  31522. (n.prototype.getImageData = (function () {
  31523. var e = document.createElement("canvas"),
  31524. t = e.getContext("2d");
  31525. return function (i, n, r) {
  31526. return (
  31527. (e.width === n && e.height === r) ||
  31528. ((e.width = n), (e.height = r)),
  31529. t.drawImage(i, 0, 0, n, r),
  31530. t.getImageData(0, 0, n, r)
  31531. );
  31532. };
  31533. })()),
  31534. (n.prototype.initSizedTexture2D = function (e, t, i) {
  31535. var n = this.renderer,
  31536. o = n.context,
  31537. a = n.state,
  31538. s = new r.Texture(null);
  31539. (s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i);
  31540. var l = n.paramThreeToGL(s.format),
  31541. c = n.paramThreeToGL(s.type),
  31542. h = n.properties.get(s),
  31543. u = o.createTexture();
  31544. a.bindTexture(o.TEXTURE_2D, u),
  31545. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  31546. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  31547. (s.wrapS = t),
  31548. (s.wrapT = t);
  31549. var d = n.paramThreeToGL(t);
  31550. return (
  31551. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  31552. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  31553. i
  31554. ? ((s.magFilter = r.LinearFilter),
  31555. (s.minFilter = r.LinearMipMapLinearFilter),
  31556. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  31557. o.texParameteri(
  31558. o.TEXTURE_2D,
  31559. o.TEXTURE_MIN_FILTER,
  31560. o.LINEAR_MIPMAP_NEAREST
  31561. ),
  31562. o.generateMipmap(o.TEXTURE_2D))
  31563. : ((s.magFilter = r.LinearFilter),
  31564. (s.minFilter = r.LinearFilter),
  31565. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  31566. o.texParameteri(
  31567. o.TEXTURE_2D,
  31568. o.TEXTURE_MIN_FILTER,
  31569. o.LINEAR
  31570. )),
  31571. a.bindTexture(o.TEXTURE_2D, null),
  31572. (h.__webglTexture = u),
  31573. s
  31574. );
  31575. }),
  31576. (n.prototype.initSizedCubeMap = function (e, t) {
  31577. var i = this.renderer,
  31578. n = i.context,
  31579. o = i.state,
  31580. a = new r.CubeTexture([null, null, null, null, null, null]);
  31581. (a.flipY = !1), (a.generateMipmaps = t);
  31582. var s = i.paramThreeToGL(a.format),
  31583. l = i.paramThreeToGL(a.type),
  31584. c = i.properties.get(a),
  31585. h = n.createTexture();
  31586. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  31587. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  31588. for (var u = 0; u < 6; u++)
  31589. n.texImage2D(
  31590. n.TEXTURE_CUBE_MAP_POSITIVE_X + u,
  31591. 0,
  31592. s,
  31593. e,
  31594. e,
  31595. 0,
  31596. s,
  31597. l,
  31598. null
  31599. );
  31600. return (
  31601. t
  31602. ? ((a.magFilter = r.LinearFilter),
  31603. (a.minFilter = r.LinearMipMapLinearFilter),
  31604. n.texParameteri(
  31605. n.TEXTURE_CUBE_MAP,
  31606. n.TEXTURE_MAG_FILTER,
  31607. n.LINEAR
  31608. ),
  31609. n.texParameteri(
  31610. n.TEXTURE_CUBE_MAP,
  31611. n.TEXTURE_MIN_FILTER,
  31612. n.LINEAR_MIPMAP_LINEAR
  31613. ),
  31614. n.texParameteri(
  31615. n.TEXTURE_CUBE_MAP,
  31616. n.GENERATE_MIPMAP,
  31617. n.TRUE
  31618. ),
  31619. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  31620. : ((a.magFilter = r.LinearFilter),
  31621. (a.minFilter = r.LinearFilter),
  31622. n.texParameteri(
  31623. n.TEXTURE_CUBE_MAP,
  31624. n.TEXTURE_MAG_FILTER,
  31625. n.LINEAR
  31626. ),
  31627. n.texParameteri(
  31628. n.TEXTURE_CUBE_MAP,
  31629. n.TEXTURE_MIN_FILTER,
  31630. n.LINEAR
  31631. )),
  31632. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  31633. (c.__image__webglTextureCube = h),
  31634. a
  31635. );
  31636. }),
  31637. (n.prototype.deallocateCubeTexture = function (e) {
  31638. var t = this.renderer,
  31639. i = t.context,
  31640. n = t.properties.get(e);
  31641. i.deleteTexture(n.__image__webglTextureCube);
  31642. }),
  31643. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  31644. var a = this.renderer,
  31645. s = a.context,
  31646. l = a.state,
  31647. c = a.properties.get(t);
  31648. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  31649. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  31650. s.pixelStorei(
  31651. s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
  31652. t.premultiplyAlpha
  31653. ),
  31654. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  31655. s.texParameteri(
  31656. s.TEXTURE_2D,
  31657. s.TEXTURE_WRAP_S,
  31658. a.paramThreeToGL(t.wrapS)
  31659. ),
  31660. s.texParameteri(
  31661. s.TEXTURE_2D,
  31662. s.TEXTURE_WRAP_T,
  31663. a.paramThreeToGL(t.wrapT)
  31664. ),
  31665. s.texParameteri(
  31666. s.TEXTURE_2D,
  31667. s.TEXTURE_MAG_FILTER,
  31668. a.paramThreeToGL(t.magFilter)
  31669. ),
  31670. s.texParameteri(
  31671. s.TEXTURE_2D,
  31672. s.TEXTURE_MIN_FILTER,
  31673. a.paramThreeToGL(t.minFilter)
  31674. ),
  31675. s.texSubImage2D(
  31676. s.TEXTURE_2D,
  31677. 0,
  31678. i,
  31679. n,
  31680. s.RGBA,
  31681. s.UNSIGNED_BYTE,
  31682. e
  31683. ),
  31684. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  31685. l.bindTexture(s.TEXTURE_2D, null);
  31686. }),
  31687. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  31688. var s = this.renderer,
  31689. l = s.context,
  31690. c = s.state,
  31691. h = s.properties.get(t);
  31692. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  31693. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  31694. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  31695. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  31696. c.bindTexture(l.TEXTURE_CUBE_MAP, null);
  31697. }),
  31698. (n.prototype.rebuildMipMaps2D = function (e) {
  31699. var t = this.renderer,
  31700. i = t.context,
  31701. n = t.state;
  31702. t.properties.get(e);
  31703. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null);
  31704. }),
  31705. (n.prototype.rebuildMipMaps3D = function (e) {
  31706. var t = this.renderer,
  31707. i = t.context,
  31708. n = t.state,
  31709. r = t.properties.get(e);
  31710. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  31711. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  31712. n.bindTexture(i.TEXTURE_CUBE_MAP, null);
  31713. }),
  31714. (n.prototype.renderToCubeMap = (function () {
  31715. var e = !1,
  31716. t = null,
  31717. i = null,
  31718. n = null,
  31719. a = null,
  31720. s = null,
  31721. l = 1;
  31722. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  31723. var _ = this.renderer;
  31724. _.context;
  31725. e ||
  31726. ((i = new r.OrthographicCamera(
  31727. l / -2,
  31728. l / 2,
  31729. l / 2,
  31730. l / -2,
  31731. -200,
  31732. 200
  31733. )),
  31734. (i.position.z = 150),
  31735. (t = new r.Scene()),
  31736. t.add(i),
  31737. (n = new r.ShaderMaterial({
  31738. uniforms: {
  31739. tDiffuse: {
  31740. type: "t",
  31741. value: null,
  31742. },
  31743. alpha: {
  31744. type: "f",
  31745. value: 1,
  31746. },
  31747. },
  31748. vertexShader: o.basicTextured.vertexShader,
  31749. fragmentShader: o.basicTextured.fragmentShader,
  31750. depthWrite: !1,
  31751. depthTest: !1,
  31752. side: r.DoubleSide,
  31753. })),
  31754. (a = new r.PlaneBufferGeometry(l, l)),
  31755. (s = new r.Mesh(a, n)),
  31756. (s.position.z = 0),
  31757. t.add(s),
  31758. (e = !0));
  31759. var T = a.getAttribute("uv");
  31760. T.setDynamic(!0), (T.needsUpdate = !0);
  31761. var x = T.array,
  31762. S = p / u,
  31763. M = f / d,
  31764. R = g / u,
  31765. P = m / d;
  31766. (x[0] = S),
  31767. (x[1] = M + P),
  31768. (x[2] = S + R),
  31769. (x[3] = M + P),
  31770. (x[4] = S),
  31771. (x[5] = M),
  31772. (x[6] = S + R),
  31773. (x[7] = M);
  31774. var O = a.getAttribute("position");
  31775. O.setDynamic(!0), (O.needsUpdate = !0);
  31776. var L = O.array,
  31777. D = v / h.width - l / 2,
  31778. N = A / h.height - l / 2,
  31779. B = y / h.width,
  31780. F = C / h.height;
  31781. (L[0] = D),
  31782. (L[1] = N + F),
  31783. (L[3] = D + B),
  31784. (L[4] = N + F),
  31785. (L[6] = D),
  31786. (L[7] = N),
  31787. (L[9] = D + B),
  31788. (L[10] = N);
  31789. this.renderer.properties.get(c);
  31790. (n.uniforms.tDiffuse.value = c),
  31791. (n.blending = E || r.NoBlending),
  31792. (n.transparent = !!b),
  31793. (void 0 !== w && null !== w) || (w = 1),
  31794. (n.uniforms.alpha.value = w),
  31795. (n.needUpdate = !0),
  31796. (h.activeCubeFace = I),
  31797. h.viewport.set(0, 0, h.width, h.height);
  31798. var V = this.renderer.autoClear;
  31799. (this.renderer.autoClear = !1),
  31800. this.renderer.render(t, i, h, !1),
  31801. (this.renderer.autoClear = V);
  31802. };
  31803. })()),
  31804. (n.prototype.copyCubeMap = (function () {
  31805. var e = !1,
  31806. t = null,
  31807. i = null,
  31808. a = null,
  31809. s = null,
  31810. l = null,
  31811. c = new r.Euler();
  31812. new r.Vector3();
  31813. return function (h, u, d, p, f, g, m, v, A) {
  31814. if (f > this.qualityManager.maxRenderTargetSize) return; //add
  31815. this.renderer;
  31816. if (!e) {
  31817. var y = 2;
  31818. (i = new r.OrthographicCamera(
  31819. y / -2,
  31820. y / 2,
  31821. y / 2,
  31822. y / -2,
  31823. 0,
  31824. 200
  31825. )),
  31826. i.position.set(0, 0, 0),
  31827. (t = new r.Scene()),
  31828. t.add(i),
  31829. (a = new r.ShaderMaterial({
  31830. uniforms: {
  31831. tDiffuse: {
  31832. type: "t",
  31833. value: null,
  31834. },
  31835. alpha: {
  31836. type: "f",
  31837. value: 1,
  31838. },
  31839. },
  31840. vertexShader: o.copyCubeMap.vertexShader,
  31841. fragmentShader: o.copyCubeMap.fragmentShader,
  31842. depthWrite: !1,
  31843. depthTest: !1,
  31844. side: r.DoubleSide,
  31845. })),
  31846. (s = new r.BoxGeometry(y, y, y)),
  31847. (l = new r.Mesh(s, a)),
  31848. t.add(l),
  31849. (e = !0);
  31850. }
  31851. for (var C = 0; C < 6; C++)
  31852. n.getCubeOrientationForCubeFace(C, c),
  31853. l.rotation.copy(c),
  31854. (l.matrixWorldNeedsUpdate = !0),
  31855. l.updateMatrixWorld(),
  31856. (a.uniforms.tDiffuse.value = h),
  31857. (a.blending = m || r.NoBlending),
  31858. (a.transparent = !!v),
  31859. (void 0 !== A && null !== A) || (A = 1),
  31860. (a.uniforms.alpha.value = A),
  31861. (a.needUpdate = !0),
  31862. (u.activeCubeFace = C),
  31863. u.viewport.set(0, 0, f, g),
  31864. this.renderer.render(t, i, u, !1);
  31865. };
  31866. })()),
  31867. (n.getLookAtForCubeFace = function (e, t) {
  31868. switch (e) {
  31869. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31870. t.set(1, 0, 0);
  31871. break;
  31872. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31873. t.set(-1, 0, 0);
  31874. break;
  31875. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31876. t.set(0, 1, 0);
  31877. break;
  31878. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31879. t.set(0, -1, 0);
  31880. break;
  31881. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31882. t.set(0, 0, 1);
  31883. break;
  31884. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31885. t.set(0, 0, -1);
  31886. }
  31887. }),
  31888. (n.getCubeOrientationForCubeFace = function (e, t) {
  31889. switch (e) {
  31890. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31891. t.set(0, -Math.PI / 2, 0);
  31892. break;
  31893. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31894. t.set(0, Math.PI / 2, 0);
  31895. break;
  31896. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31897. t.set(Math.PI / 2, Math.PI, 0);
  31898. break;
  31899. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31900. t.set(-Math.PI / 2, Math.PI, 0);
  31901. break;
  31902. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31903. t.set(0, -Math.PI, 0);
  31904. break;
  31905. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31906. t.set(0, 0, 0);
  31907. }
  31908. }),
  31909. (t.exports = n);
  31910. },
  31911. {
  31912. "../enum/GLCubeFaces": 25,
  31913. "../enum/GLTextureType": 26,
  31914. "../enum/SceneRendererEvents": 43,
  31915. "../exception/BasicException": 55,
  31916. "../exception/RendererCreationException": 57,
  31917. "../settings": 166,
  31918. "../shaders": 167,
  31919. /********************************************************************fyz改 from徐世廷**********************************************************************/
  31920. "../util/browser": 182,
  31921. /************************************************************************************************************************************************/
  31922. events: 202,
  31923. three: 217,
  31924. },
  31925. ],
  31926. 159: [
  31927. function (e, t, i) {
  31928. "use strict";
  31929. function n(e) {
  31930. (this.messenger = new a(e)), (this.clientKey = null);
  31931. }
  31932. var r = e("../util/ajax"),
  31933. o = e("./PostMessageType"),
  31934. a = e("./postmessage"),
  31935. s = e("./VersionInfo"),
  31936. l = e("events").EventEmitter,
  31937. c = window.location.origin + "/api/v1/user/";
  31938. (n.prototype = Object.create(l.prototype)),
  31939. (n.prototype.bindEvents = function () {
  31940. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this));
  31941. }),
  31942. (n.prototype.waitForConnection = function () {
  31943. var e = new Promise(
  31944. function (e, t) {
  31945. this.messenger.on(
  31946. o.CONNECT,
  31947. function (i) {
  31948. this.onConnectionReceived(i).then(
  31949. e.bind(this, i.sdkVersion),
  31950. t.bind()
  31951. );
  31952. }.bind(this)
  31953. );
  31954. }.bind(this)
  31955. );
  31956. return e;
  31957. }),
  31958. (n.prototype.onConnectionReceived = function (e) {
  31959. return (
  31960. this.messenger.setTarget(e.source, e.origin),
  31961. this.verifyConnection(e).then(
  31962. function (t, i) {
  31963. this.messenger.send({
  31964. type: o.ACCEPT,
  31965. toId: e.fromId,
  31966. warning: i,
  31967. }),
  31968. (this.clientKey = t),
  31969. this.messenger.removeAllListeners(o.CONNECT),
  31970. this.bindEvents();
  31971. }.bind(this),
  31972. function (t) {
  31973. this.messenger.send({
  31974. type: o.REJECT,
  31975. toId: e.fromId,
  31976. reason: t,
  31977. }),
  31978. this.messenger.setTarget();
  31979. }.bind(this)
  31980. )
  31981. );
  31982. }),
  31983. (n.prototype.verifyConnection = function (e) {
  31984. return new Promise(function (t, i) {
  31985. var n;
  31986. if (s.isDeprecated(e.sdkVersion)) n = "这个版本正在被弃用";
  31987. else if (!s.isSupported(e.sdkVersion))
  31988. return i("不支持此版本的SDK");
  31989. var o = {
  31990. cache: !1,
  31991. headers: {
  31992. "X-port-Application-Key": e.applicationKey,
  31993. "X-port-Referrer": e.origin,
  31994. },
  31995. };
  31996. r.get(c, o)
  31997. .done(t.bind(this, e.applicationKey, n))
  31998. .fail(i.bind(this, "key/referrer mismatch"));
  31999. });
  32000. }),
  32001. (n.prototype.onMessageReceived = function (e) {
  32002. if (this.validateClientApplicationKey(e.applicationKey)) {
  32003. var t = this;
  32004. (e.onDone = function (i) {
  32005. (i.toId = e.fromId),
  32006. (i.uid = e.uid),
  32007. (i.type = o.RESPONSE),
  32008. t.messenger.send(i);
  32009. }),
  32010. this.emit(o.ACTION, e);
  32011. }
  32012. }),
  32013. (n.prototype.validateClientApplicationKey = function (e) {
  32014. return this.clientKey === e;
  32015. }),
  32016. (n.prototype.sendEvent = function (e, t) {
  32017. this.messenger.send({
  32018. type: o.EVENT,
  32019. eventType: e,
  32020. eventData: t,
  32021. });
  32022. }),
  32023. (t.exports = n);
  32024. },
  32025. {
  32026. "../util/ajax": 181,
  32027. "./PostMessageType": 160,
  32028. "./VersionInfo": 163,
  32029. "./postmessage": 165,
  32030. events: 202,
  32031. },
  32032. ],
  32033. 160: [
  32034. function (e, t, i) {
  32035. "use strict";
  32036. t.exports = Object.freeze({
  32037. CONNECT: "postmessage.connect",
  32038. ACCEPT: "postmessage.accept",
  32039. REJECT: "postmessage.reject",
  32040. ACTION: "postmessage.action",
  32041. RESPONSE: "postmessage.response",
  32042. EVENT: "postmessage.event",
  32043. });
  32044. },
  32045. {},
  32046. ],
  32047. 161: [
  32048. function (e, t, i) {
  32049. "use strict";
  32050. t.exports = Object.freeze({
  32051. MOVE: "sdk.move",
  32052. ENTER_PANO: "sdk.enterpano",
  32053. MODEL_LOADED: "sdk.modelloaded",
  32054. });
  32055. },
  32056. {},
  32057. ],
  32058. 162: [
  32059. function (e, t, i) {
  32060. "use strict";
  32061. t.exports = Object.freeze({
  32062. FLY: "transition.fly",
  32063. FADEOUT: "transition.fade",
  32064. INSTANT: "transition.instant",
  32065. });
  32066. },
  32067. {},
  32068. ],
  32069. 163: [
  32070. function (e, t, i) {
  32071. "use strict";
  32072. t.exports = {
  32073. current: "1.0",
  32074. supported: ["1.0"],
  32075. deprecated: [],
  32076. isSupported: function (e) {
  32077. return this.supported.indexOf(e) !== -1;
  32078. },
  32079. isDeprecated: function (e) {
  32080. return this.deprecated.indexOf(e) !== -1;
  32081. },
  32082. isValid: function (e) {
  32083. return this.isSupported(e) || this.isDeprecated(e);
  32084. },
  32085. };
  32086. },
  32087. {},
  32088. ],
  32089. 164: [
  32090. function (e, t, i) {
  32091. (function (i) {
  32092. "use strict";
  32093. function n(e, t, i) {
  32094. e && (e = e.toLowerCase().trim());
  32095. var n = new I.UP.clone(),
  32096. r = Math.PI / 3,
  32097. o = Math.PI / 2;
  32098. switch (e) {
  32099. case "left":
  32100. i.copy(t), i.applyAxisAngle(n, o);
  32101. break;
  32102. case "right":
  32103. i.copy(t), i.applyAxisAngle(n, -o);
  32104. break;
  32105. case "forwardleft":
  32106. i.copy(t), i.applyAxisAngle(n, r);
  32107. break;
  32108. case "forwardright":
  32109. i.copy(t), i.applyAxisAngle(n, -r);
  32110. break;
  32111. case "forward":
  32112. default:
  32113. i.copy(t);
  32114. }
  32115. return i;
  32116. }
  32117. function r(e, t) {
  32118. if (e) {
  32119. var i = {
  32120. pano: e,
  32121. lookAtPoint: null,
  32122. duration: null,
  32123. maxDistanceOverride: null,
  32124. skipWarpingCheck: !1,
  32125. };
  32126. this.player.flyToPano(i, function () {
  32127. t &&
  32128. t({
  32129. success: !0,
  32130. message: "Transition complete.",
  32131. });
  32132. });
  32133. } else
  32134. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  32135. t &&
  32136. t({
  32137. success: !1,
  32138. error: "Unable to find pano.",
  32139. });
  32140. }
  32141. function o(e, t) {
  32142. var i = this.findRankedPano(e, t);
  32143. return i >= 0
  32144. ? this.handleToObject[i]
  32145. : (R.warn(
  32146. "Showcase -> findRankedPanoObject: Unable to find nearby pano."
  32147. ),
  32148. null);
  32149. }
  32150. function a(e, t) {
  32151. var i = this.findRankedtag(e, t);
  32152. return i >= 0
  32153. ? this.handleToObject[i]
  32154. : (R.warn(
  32155. "Showcase -> findRankedtagObject: Unable to find nearby tag."
  32156. ),
  32157. null);
  32158. }
  32159. function s(e, t) {
  32160. t.copy(I.FORWARD), e.getDirection(t);
  32161. }
  32162. function l(e) {
  32163. function t(e) {
  32164. var t = new c.Euler().setFromQuaternion(e.quaternion, "YXZ");
  32165. return {
  32166. x: c.Math.radToDeg(t._x),
  32167. y: c.Math.radToDeg(t._y),
  32168. z: c.Math.radToDeg(t._z),
  32169. };
  32170. }
  32171. var i = function (e) {
  32172. return e.alignmentType !== m.ALIGNED
  32173. ? null
  32174. : {
  32175. x: e.position.x,
  32176. y: e.position.y,
  32177. z: e.position.z,
  32178. };
  32179. };
  32180. return {
  32181. panos: e.panos.list.map(function (n) {
  32182. var r = y.getCubemapUrls(e.urls, n.id, "high")[
  32183. C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
  32184. ];
  32185. return {
  32186. uuid: n.id,
  32187. aligned: n.alignmentType === m.ALIGNED,
  32188. neighbourUUIDs: n.neighbourUUIDs.slice(),
  32189. position: i(n),
  32190. rotation: t(n),
  32191. thumbnail: r,
  32192. };
  32193. }),
  32194. };
  32195. }
  32196. var c = e("three"),
  32197. h = e("./ApiHost"),
  32198. u = e("../util/logger"),
  32199. d = e("../util/common"),
  32200. p = e("../util/math"),
  32201. f = e("../enum/ModelManagerEvents"),
  32202. g = e("./PostMessageType"),
  32203. m = e("../enum/AlignmentType"),
  32204. v = e("../enum/Direction"),
  32205. A = e("./TransitionStyles"),
  32206. y = e("../util/panorama"),
  32207. C = e("../enum/GLCubeFaces"),
  32208. I = e("../enum/Vectors"),
  32209. E = e("../enum/Viewmode"),
  32210. b = e("../enum/WarpStyle"),
  32211. w = (e("../enum/Keys"), e("../enum/PlayerEvents")),
  32212. _ = e("../sdk/SdkEvents"),
  32213. I = e("../enum/Vectors"),
  32214. T = e("../enum/ControlEvents"),
  32215. x = e("../enum/RenderLayers"),
  32216. S = (e("../constants"), e("../settings")),
  32217. M = e("../lib/jpeg_encoder"),
  32218. R = new u(i),
  32219. P = (function () {
  32220. var e = function e() {
  32221. e.playerDirection.copy(
  32222. e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD
  32223. ),
  32224. e.player.getDirection(e.playerDirection),
  32225. e.projectVectors();
  32226. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  32227. if (
  32228. ((e.angleTravelled += Math.abs(t)),
  32229. e.angleTravelled >= Math.abs(e.angle))
  32230. ) {
  32231. if (((e.active = !1), e.onDone)) {
  32232. var i = e.onDone;
  32233. i();
  32234. }
  32235. } else
  32236. e.lastFacingDirection.copy(e.playerDirection),
  32237. window.setTimeout(e, 4);
  32238. };
  32239. return (
  32240. (e.active = !1),
  32241. (e.angle = 0),
  32242. (e.angleTravelled = 0),
  32243. (e.playerDirection = new c.Vector3()),
  32244. (e.lastFacingDirection = new c.Vector3()),
  32245. (e.onDone = null),
  32246. (e.player = null),
  32247. (e.start = function (t, i, n, r) {
  32248. (e.active = !0),
  32249. t && i && (i = 0),
  32250. (e.angle = t || i),
  32251. (e.xAngle = t),
  32252. (e.yAngle = i),
  32253. (e.angleTravelled = 0),
  32254. e.playerDirection.copy(
  32255. n.mode === E.FLOORPLAN ? I.UP : I.FORWARD
  32256. ),
  32257. n.getDirection(e.playerDirection),
  32258. e.lastFacingDirection.copy(e.playerDirection),
  32259. e.projectVectors(),
  32260. (e.onDone = r),
  32261. (e.player = n),
  32262. e();
  32263. }),
  32264. (e.projectVectors = function () {
  32265. e.xAngle &&
  32266. (e.playerDirection.projectOnPlane(I.UP),
  32267. e.lastFacingDirection.projectOnPlane(I.UP));
  32268. }),
  32269. e
  32270. );
  32271. })(),
  32272. O = (function () {
  32273. var e = new c.Vector3();
  32274. return function (t) {
  32275. t
  32276. ? (e.copy(t.position),
  32277. e.add(t.discPosition),
  32278. p.projectPositionToCanvas(e, this.player.camera, e),
  32279. this.click(e.x, e.y))
  32280. : R.warn("Showcase -> clicktagObject: Unable to find tag.");
  32281. };
  32282. })(),
  32283. L = function () {
  32284. return this.player.mode === E.PANORAMA
  32285. ? S.insideLookLimitUp
  32286. : this.player.mode === E.DOLLHOUSE
  32287. ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle)
  32288. : null;
  32289. },
  32290. D = function () {
  32291. return this.player.mode === E.PANORAMA
  32292. ? S.insideLookLimitDown
  32293. : this.player.mode === E.DOLLHOUSE
  32294. ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle)
  32295. : null;
  32296. },
  32297. N = (function (e) {
  32298. var t = new c.Vector3();
  32299. return function (e) {
  32300. var i = this.player.getDirection();
  32301. t.copy(i);
  32302. var n = t.y;
  32303. (t.y = 0), t.normalize();
  32304. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  32305. if (
  32306. this.player.mode !== E.DOLLHOUSE &&
  32307. this.player.mode !== E.PANORAMA
  32308. )
  32309. return (
  32310. 0 !== e &&
  32311. R.warn(
  32312. "Cannot rotate in y direction when in " +
  32313. this.player.mode +
  32314. " mode"
  32315. ),
  32316. 0
  32317. );
  32318. this.player.mode === E.DOLLHOUSE && (r = -r);
  32319. var o = L.call(this) - 0.1,
  32320. a = D.call(this) + 0.1,
  32321. s = r + e;
  32322. s > o ? (s = o) : s < a && (s = a);
  32323. var l = s - r;
  32324. return (
  32325. e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l
  32326. );
  32327. };
  32328. })(),
  32329. B = (function () {
  32330. var e = new c.Euler();
  32331. return function (t) {
  32332. return (
  32333. e.setFromQuaternion(t.quaternion, "YXZ"),
  32334. {
  32335. position: {
  32336. x: t.position.x,
  32337. y: t.position.y,
  32338. z: t.position.z,
  32339. },
  32340. rotation: {
  32341. x: c.Math.radToDeg(e.x),
  32342. y: c.Math.radToDeg(e.y),
  32343. z: 0,
  32344. },
  32345. pano: t.currentPano ? t.currentPano.id : null,
  32346. mode: t.mode,
  32347. }
  32348. );
  32349. };
  32350. })(),
  32351. F = null;
  32352. t.exports = {
  32353. init: function (e, t, i, n, r) {
  32354. V.init(e, t, i, r),
  32355. (F = new Promise(
  32356. function (e, t) {
  32357. i.on(w.Ready, function () {
  32358. e();
  32359. });
  32360. }.bind(this)
  32361. ));
  32362. var o = new h(window),
  32363. a = o.waitForConnection();
  32364. a.then(function (e) {
  32365. o.on(g.ACTION, V.onMessageReceive.bind(V));
  32366. });
  32367. var s = (function () {
  32368. var e = Date.now();
  32369. return function () {
  32370. if (!(Date.now() - e < 100)) {
  32371. var t = B(i);
  32372. o.sendEvent(_.MOVE, {
  32373. state: t,
  32374. }),
  32375. (e = Date.now());
  32376. }
  32377. };
  32378. })();
  32379. i.on(w.Move, s),
  32380. i.on(w.ViewChanged, s),
  32381. n.on(f.ActiveModelChanged, function (e) {
  32382. function t(e) {
  32383. var t,
  32384. i = e.newPano.id;
  32385. e.oldPano && (t = e.oldPano.id),
  32386. i !== t &&
  32387. o.sendEvent(_.ENTER_PANO, {
  32388. oldPano: t,
  32389. newPano: i,
  32390. });
  32391. }
  32392. var i = e.model,
  32393. n = e.oldModel;
  32394. (V.model = i),
  32395. a.then(function () {
  32396. o.sendEvent(_.MODEL_LOADED, {
  32397. metadata: l(i),
  32398. });
  32399. }),
  32400. n &&
  32401. n.panos.forEach(function (e) {
  32402. e.removeEventListener("enter", t);
  32403. }),
  32404. i.panos.forEach(function (e) {
  32405. e.on("enter", t);
  32406. });
  32407. });
  32408. },
  32409. };
  32410. var V = {
  32411. director: null,
  32412. player: null,
  32413. controls: null,
  32414. sceneRenderer: null,
  32415. model: null,
  32416. init: function (e, t, i, n) {
  32417. (this.director = e),
  32418. (this.player = i),
  32419. (this.controls = t),
  32420. (this.sceneRenderer = n);
  32421. },
  32422. handleToObject: {},
  32423. objectToHandle: {},
  32424. handleCount: 0,
  32425. onMessageReceive: function (e) {
  32426. if (e) {
  32427. var t = e.targetFunction,
  32428. i = e.params,
  32429. n = e.onDone;
  32430. t && this[t] && this[t](i, n);
  32431. }
  32432. },
  32433. waitForInit: function (e, t) {
  32434. F.then(
  32435. t.bind({
  32436. success: !0,
  32437. message: "Init complete.",
  32438. })
  32439. );
  32440. },
  32441. moveToPano: (function (e, t) {
  32442. var i = new c.Euler(0, 0, 0, "YXZ"),
  32443. n = new c.Quaternion();
  32444. return function (e, t) {
  32445. var r = e.pano,
  32446. o = e.rotation,
  32447. a = e.transition;
  32448. if (!this.model)
  32449. return t({
  32450. success: !1,
  32451. error: "The model has not been loaded yet",
  32452. });
  32453. var s = this.model.panos.get(r);
  32454. if (!s)
  32455. return t({
  32456. success: !1,
  32457. error: r + " does not exist in this model",
  32458. });
  32459. if (!o)
  32460. return t({
  32461. sucess: !1,
  32462. erorr: o + " is not a valid rotation",
  32463. });
  32464. i.set(
  32465. c.Math.degToRad(o.x || 0),
  32466. c.Math.degToRad(o.y || 0),
  32467. c.Math.degToRad(o.z || 0),
  32468. "YXZ"
  32469. ),
  32470. console.log(o.z);
  32471. var l = {
  32472. success: !0,
  32473. message: r,
  32474. };
  32475. if (a === A.FADEOUT)
  32476. n.setFromEuler(i),
  32477. this.player.warpToPano(
  32478. s,
  32479. n,
  32480. null,
  32481. null,
  32482. b.BLACK,
  32483. null,
  32484. null,
  32485. t.bind(this, l)
  32486. );
  32487. else {
  32488. var h, u;
  32489. a === A.INSTANT && ((h = 0), (u = 0));
  32490. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  32491. this.player.flyToPano(
  32492. {
  32493. pano: s,
  32494. lookAtPoint: d,
  32495. duration: h,
  32496. aimDuration: u,
  32497. },
  32498. t.bind(this, l)
  32499. );
  32500. }
  32501. };
  32502. })(),
  32503. moveInDirection: function (e, t) {
  32504. var i = e.direction;
  32505. return "undefined" == typeof v[i]
  32506. ? (R.warn(
  32507. "Showcase -> moveInDirection: Cannot move in invalid direction."
  32508. ),
  32509. void (
  32510. t &&
  32511. t({
  32512. success: !1,
  32513. error: "Invalid direction.",
  32514. })
  32515. ))
  32516. : void this.player
  32517. .flyLocalDirection(I[i].clone())
  32518. .then(function (e) {
  32519. t(
  32520. e
  32521. ? {
  32522. success: !0,
  32523. message: "moved " + i,
  32524. }
  32525. : {
  32526. success: !1,
  32527. error: "Cannot move in direction: " + i,
  32528. }
  32529. );
  32530. });
  32531. },
  32532. getPose: function (e, t) {
  32533. this.player.camera.position,
  32534. new c.Euler().setFromQuaternion(
  32535. this.player.camera.quaternion,
  32536. "YXZ"
  32537. );
  32538. return t({
  32539. success: !0,
  32540. message: B(this.player),
  32541. });
  32542. },
  32543. takeScreenShot: (function () {
  32544. var e = new c.PerspectiveCamera(),
  32545. t = new c.WebGLRenderTarget();
  32546. return function (i, n) {
  32547. if (!i.resolution)
  32548. return n({
  32549. success: !1,
  32550. error: "An invalid resolution was specified",
  32551. });
  32552. if (i.resolution.width === -1 || i.resolution.height === -1) {
  32553. var r = this.sceneRenderer.renderer.getSize();
  32554. (i.resolution.width = r.width),
  32555. (i.resolution.height = r.height);
  32556. }
  32557. e.layers.set(x.DEFAULT),
  32558. i.visibleObjects &&
  32559. (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  32560. i.visibleObjects.showPucks &&
  32561. e.layers.enable(x.PANOMARKERS),
  32562. i.visibleObjects.showReticule &&
  32563. e.layers.enable(x.RETICULE));
  32564. var o = i.resolution.width,
  32565. a = i.resolution.height,
  32566. s = o / a;
  32567. e.position.copy(this.sceneRenderer.camera.position),
  32568. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  32569. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  32570. (e.projectionMatrix.elements[0] =
  32571. this.player.camera.projectionMatrix.elements[5] / s),
  32572. t.setSize(o, a),
  32573. this.sceneRenderer.renderer.render(
  32574. this.sceneRenderer.scene,
  32575. e,
  32576. t
  32577. );
  32578. var l = new Uint8Array(o * a * 4);
  32579. this.sceneRenderer.renderer.readRenderTargetPixels(
  32580. t,
  32581. 0,
  32582. 0,
  32583. o,
  32584. a,
  32585. l
  32586. );
  32587. var c = M.encode(
  32588. {
  32589. data: l,
  32590. width: o,
  32591. height: a,
  32592. heading: 180,
  32593. pitch: 0,
  32594. },
  32595. {
  32596. quality: 75,
  32597. flipY: !0,
  32598. }
  32599. ),
  32600. h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  32601. n({
  32602. success: !0,
  32603. message: h,
  32604. });
  32605. };
  32606. })(),
  32607. findRankedPano: (function (e, t) {
  32608. var i = new c.Vector3(),
  32609. r = new c.Vector3();
  32610. return function (e, t) {
  32611. s(this.player, r), n(t, r, i);
  32612. var o = this.player.rankedPanoInDirection(e, i);
  32613. if (o) {
  32614. var a = this.objectToHandle[o.id];
  32615. return (
  32616. a ||
  32617. ((this.objectToHandle[o.id] = a = this.handleCount++),
  32618. (this.handleToObject[a] = o)),
  32619. a
  32620. );
  32621. }
  32622. return (
  32623. R.warn(
  32624. "Showcase -> findRankedPano: Unable to find nearby pano."
  32625. ),
  32626. -1
  32627. );
  32628. };
  32629. })(),
  32630. findRankedtag: (function (e, t) {
  32631. var i = new c.Vector3(),
  32632. r = new c.Vector3();
  32633. return function (e, t) {
  32634. s(this.player, r), n(t, r, i);
  32635. var o = this.player.rankedtagInDirection(e, i);
  32636. if (o) {
  32637. var a = this.objectToHandle[o.sid];
  32638. return (
  32639. a ||
  32640. ((this.objectToHandle[o.sid] = a = this.handleCount++),
  32641. (this.handleToObject[a] = o)),
  32642. a
  32643. );
  32644. }
  32645. return (
  32646. R.warn(
  32647. "Showcase -> findRankedtag: Unable to find nearby tag."
  32648. ),
  32649. -1
  32650. );
  32651. };
  32652. })(),
  32653. clickNearesttag: function (e) {
  32654. this.clickRankedtag(0, e);
  32655. },
  32656. clickRankedtag: function (e, t) {
  32657. var i = a.call(this, e, t);
  32658. i && O.call(this, i);
  32659. },
  32660. clickNearestPano: function (e, t) {
  32661. this.clickRankedPano(0, e, t);
  32662. },
  32663. clickRankedPano: function (e, t, i) {
  32664. var n = o.call(this, e, t);
  32665. n ? r.call(this, n, i) : i(null);
  32666. },
  32667. clickPano: function (e, t) {
  32668. var i = this.handleTable[e];
  32669. i ? r.call(this, i, t) : t(null);
  32670. },
  32671. rotateDirection: (function () {
  32672. return function (e, t) {
  32673. var i = e.direction,
  32674. n = e.angle;
  32675. if (!P.active) {
  32676. var r = 0,
  32677. o = 0,
  32678. a = 0,
  32679. s = 0;
  32680. if (!n || isNaN(n))
  32681. return (
  32682. R.warn(
  32683. "Showcase -> rotateDirection: Invalid rotation angle."
  32684. ),
  32685. void (
  32686. t &&
  32687. t({
  32688. success: !1,
  32689. error: "Invalid rotation angle.",
  32690. })
  32691. )
  32692. );
  32693. if (this.player.mode === E.TRANSITIONING)
  32694. return (
  32695. R.warn(
  32696. "Automation -> rotateDirection: Cannot rotate while transitioning"
  32697. ),
  32698. void (
  32699. t &&
  32700. t({
  32701. success: !1,
  32702. error: "Cannot rotate while transitioning",
  32703. })
  32704. )
  32705. );
  32706. if (i === v.RIGHT || i === v.LEFT)
  32707. i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n);
  32708. else {
  32709. if (i !== v.UP && i !== v.DOWN)
  32710. return (
  32711. R.warn(
  32712. "Showcase -> rotateDirection: Invalid direction for rotation: " +
  32713. i
  32714. ),
  32715. void (
  32716. t &&
  32717. t({
  32718. success: !1,
  32719. error: "Invalid direction for rotation.",
  32720. })
  32721. )
  32722. );
  32723. if (this.player.mode === E.FLOORPLAN)
  32724. return (
  32725. R.warn(
  32726. "Showcase -> rotateDirection: Cannot rotate " +
  32727. i +
  32728. " in floorplan mode"
  32729. ),
  32730. void (
  32731. t &&
  32732. t({
  32733. success: !1,
  32734. error: "Cannot rotate " + i + " in floorplan mode",
  32735. })
  32736. )
  32737. );
  32738. if (
  32739. (i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n)
  32740. )
  32741. return (
  32742. R.warn(
  32743. "Showcase -> rotateDirection: Already at maximum rotation in direction: " +
  32744. i
  32745. ),
  32746. void (
  32747. t &&
  32748. t({
  32749. success: !1,
  32750. error:
  32751. "Already at maximum rotation in direction: " + i,
  32752. })
  32753. )
  32754. );
  32755. (o = n > 0 ? 1 : -1), (s = n);
  32756. }
  32757. var l = n;
  32758. (n = c.Math.degToRad(n)),
  32759. (a = c.Math.degToRad(a)),
  32760. (s = c.Math.degToRad(s));
  32761. var h = this.controls.activeControl,
  32762. u = function () {
  32763. h.stopRotating(!0),
  32764. t &&
  32765. t({
  32766. success: !0,
  32767. message:
  32768. "Rotated " +
  32769. l.toFixed(2) +
  32770. "° in direction: " +
  32771. e.direction,
  32772. });
  32773. };
  32774. h.startRotating(r, o), P.start(a, s, this.player, u);
  32775. }
  32776. };
  32777. })(),
  32778. rotate: (function () {
  32779. var e = new c.Vector3(),
  32780. t = new c.Vector3();
  32781. return function (i, n) {
  32782. var r = i.xAngle,
  32783. o = i.yAngle;
  32784. if (!P.active) {
  32785. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  32786. return (
  32787. R.warn("Showcase -> rotate: Invalid rotation angle."),
  32788. void (
  32789. n &&
  32790. n({
  32791. success: !1,
  32792. error: "Invalid rotation angle.",
  32793. })
  32794. )
  32795. );
  32796. if (this.player.mode === E.TRANSITIONING)
  32797. return (
  32798. R.warn(
  32799. "Automation -> rotate: Cannot rotate while transitioning"
  32800. ),
  32801. void (
  32802. n &&
  32803. n({
  32804. success: !1,
  32805. error: "Cannot rotate while transitioning",
  32806. })
  32807. )
  32808. );
  32809. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0);
  32810. var a = o;
  32811. (o = N.call(this, o)), (r = -r);
  32812. var s = a > 0 ? "UP" : "DOWN";
  32813. if (!r && a && !o)
  32814. return (
  32815. R.warn(
  32816. "Showcase -> rotate: Already at maximum rotation in direction: " +
  32817. s
  32818. ),
  32819. void (
  32820. n &&
  32821. n({
  32822. success: !1,
  32823. error:
  32824. "Already at maximum rotation in direction: " + s,
  32825. })
  32826. )
  32827. );
  32828. a > o &&
  32829. R.warn(
  32830. "Showcase -> rotate: Reached maximum rotation in direction: " +
  32831. s
  32832. );
  32833. var l = o;
  32834. (o = c.Math.degToRad(o)),
  32835. (r = c.Math.degToRad(r)),
  32836. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  32837. this.player.getDirection(e),
  32838. t.copy(e).applyAxisAngle(I.UP, r),
  32839. t.applyAxisAngle(I.RIGHT, o);
  32840. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  32841. u = o > 0 ? 1 : o < 0 ? -1 : 0;
  32842. Math.abs(r) > Math.abs(o)
  32843. ? (u *= Math.abs(o / r))
  32844. : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  32845. var d = this.controls.activeControl,
  32846. p = function () {
  32847. d.stopRotating(!0),
  32848. n &&
  32849. n({
  32850. success: !0,
  32851. message:
  32852. "Rotated " +
  32853. i.xAngle.toFixed(2) +
  32854. "° horizontally, " +
  32855. l.toFixed(2) +
  32856. "° vertically",
  32857. });
  32858. };
  32859. d.startRotating(h, u), P.start(r, o, this.player, p);
  32860. }
  32861. };
  32862. })(),
  32863. panCamera: function (e, t) {
  32864. function i(e) {
  32865. switch (
  32866. (r.removeAllListeners(T.AutoPanComplete),
  32867. r.removeAllListeners(T.AutoPanInterrupt),
  32868. r.removeAllListeners(T.AutoPanClamped),
  32869. e)
  32870. ) {
  32871. case T.AutoPanInterrupt:
  32872. t({
  32873. success: !0,
  32874. message: "Camera panning interrupted.",
  32875. });
  32876. break;
  32877. case T.AutoPanClamped:
  32878. if (
  32879. r.autoPanPosition.x !== n.x ||
  32880. r.autoPanPosition.z !== n.z
  32881. ) {
  32882. if (
  32883. Math.abs(this.player.position.x - r.autoPanPosition.x) <
  32884. 0.01 &&
  32885. Math.abs(this.player.position.z - r.autoPanPosition.z) <
  32886. 0.01
  32887. )
  32888. return void t({
  32889. success: !1,
  32890. error: "Already at edge of current model bounds.",
  32891. });
  32892. var i =
  32893. "The view point is outside the bounds for the current model. ";
  32894. (i +=
  32895. "The view point was clamped to " +
  32896. o(r.target.x, r.target.z)),
  32897. console.warn(i);
  32898. }
  32899. case T.AutoPanComplete:
  32900. t({
  32901. success: !0,
  32902. message:
  32903. "Panned camera to position " +
  32904. o(r.autoPanPosition.x, r.autoPanPosition.z),
  32905. });
  32906. }
  32907. }
  32908. if (
  32909. this.player.mode !== E.DOLLHOUSE &&
  32910. this.player.mode !== E.FLOORPLAN
  32911. )
  32912. return t({
  32913. success: !1,
  32914. error:
  32915. "Camera panning is not available in the current mode: " +
  32916. this.player.mode,
  32917. });
  32918. var n = e.position,
  32919. r = this.player.control;
  32920. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0);
  32921. var o = function (e, t) {
  32922. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")";
  32923. };
  32924. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  32925. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  32926. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped));
  32927. },
  32928. click: function (e, t) {
  32929. var i = e.x,
  32930. n = e.y,
  32931. r = e.percentage;
  32932. r === !0 &&
  32933. ((i = (i / 100) * $("#player").width()),
  32934. (n = (n / 100) * $("#player").height())),
  32935. this.player.handleInputStart(i, n),
  32936. this.player.updateIntersect(),
  32937. this.player.handleInputEnd(i, n);
  32938. },
  32939. mouseOver: function (e, t) {
  32940. var i = e.x,
  32941. n = e.y,
  32942. r = e.percentage;
  32943. r === !0 &&
  32944. ((i = (i / 100) * $("#player").width()),
  32945. (n = (n / 100) * $("#player").height())),
  32946. this.player.handleInputMove(i, n),
  32947. this.player.updateIntersect();
  32948. },
  32949. moveToMode: function (e, t) {
  32950. function i(e) {
  32951. t(
  32952. e
  32953. ? {
  32954. success: !1,
  32955. error: "Failed to load new mode: " + e,
  32956. }
  32957. : {
  32958. success: !0,
  32959. message: "Moved to new mode: " + n,
  32960. }
  32961. );
  32962. }
  32963. var n = e.mode;
  32964. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  32965. ? this.director.changeMode(n).then(
  32966. function () {
  32967. i();
  32968. },
  32969. function (e) {
  32970. i(e);
  32971. }
  32972. )
  32973. : t({
  32974. success: !1,
  32975. error: "Invalid mode selection",
  32976. });
  32977. },
  32978. };
  32979. }).call(this, "/js/sdk/automation.js");
  32980. },
  32981. {
  32982. "../constants": 8,
  32983. "../enum/AlignmentType": 17,
  32984. "../enum/ControlEvents": 21,
  32985. "../enum/Direction": 22,
  32986. "../enum/GLCubeFaces": 25,
  32987. "../enum/Keys": 30,
  32988. "../enum/ModelManagerEvents": 33,
  32989. "../enum/PlayerEvents": 40,
  32990. "../enum/RenderLayers": 41,
  32991. "../enum/Vectors": 50,
  32992. "../enum/Viewmode": 51,
  32993. "../enum/WarpStyle": 52,
  32994. "../lib/jpeg_encoder": 94,
  32995. "../sdk/SdkEvents": 161,
  32996. "../settings": 166,
  32997. "../util/common": 185,
  32998. "../util/logger": 189,
  32999. "../util/math": 190,
  33000. "../util/panorama": 191,
  33001. "./ApiHost": 159,
  33002. "./PostMessageType": 160,
  33003. "./TransitionStyles": 162,
  33004. three: 217,
  33005. },
  33006. ],
  33007. 165: [
  33008. function (e, t, i) {
  33009. "use strict";
  33010. function n(e) {
  33011. (this.sourceWindow = e),
  33012. (this.targetWindow = null),
  33013. (this.targetOrigin = null),
  33014. (this.id = Math.floor(1e5 * Math.random())),
  33015. this.bindEvents();
  33016. }
  33017. var r = e("./PostMessageType"),
  33018. o = e("events").EventEmitter;
  33019. (n.prototype = Object.create(o.prototype)),
  33020. (n.prototype.bindEvents = function () {
  33021. this.sourceWindow.addEventListener(
  33022. "message",
  33023. this.onPostmessageReceived.bind(this)
  33024. );
  33025. }),
  33026. (n.prototype.setTarget = function (e, t) {
  33027. (this.targetWindow = e), (this.targetOrigin = t);
  33028. }),
  33029. (n.prototype.onPostmessageReceived = function (e) {
  33030. var t = e.origin || e.originalEvent.origin,
  33031. i = e.source;
  33032. switch (e.data.type) {
  33033. case r.CONNECT:
  33034. break;
  33035. case r.RESPONSE:
  33036. if (this.id !== e.data.toId) return;
  33037. default:
  33038. if (!this.validateMessageOrigin(t)) return;
  33039. }
  33040. var n = e.data;
  33041. (n.source = i),
  33042. (n.origin = t),
  33043. (n.timestamp = Date.now()),
  33044. this.emit(e.data.type, n);
  33045. }),
  33046. (n.prototype.validateMessageOrigin = function (e) {
  33047. return "*" === this.targetOrigin || e === this.targetOrigin;
  33048. }),
  33049. (n.prototype.send = function (e) {
  33050. this.targetWindow &&
  33051. this.targetOrigin &&
  33052. ((e.fromId = this.id),
  33053. this.targetWindow.postMessage(e, this.targetOrigin));
  33054. }),
  33055. (t.exports = n);
  33056. },
  33057. {
  33058. "./PostMessageType": 160,
  33059. events: 202,
  33060. },
  33061. ],
  33062. 166: [
  33063. function (e, t, i) {
  33064. "use strict";
  33065. var n = e("three"),
  33066. r = e("./util/browser"),
  33067. o = e("./enum/Viewmode"),
  33068. a = e("./enum/VROption"),
  33069. s = e("./enum/Colors"),
  33070. l = e("./enum/WarpStyle"),
  33071. c = e("./util/easing"),
  33072. h = e("./util/common"),
  33073. u = e("./util/showcase"),
  33074. d = e("./constants"),
  33075. p = {
  33076. debug: !1,
  33077. version: "2.25.6-0-gd87e5b1",
  33078. languageTag: r.valueFromHash("lang", null),
  33079. pageTitle: "四维虚拟漫游",
  33080. authorizationHeader: u.getAuthorizationHeader(),
  33081. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  33082. logLevel: r.valueFromHash("log", 2),
  33083. skyboxRadius: 2500,
  33084. modelBoundsPadding: 5,
  33085. showNeighbors: !1,
  33086. brand: r.valueFromHash("brand", !0),
  33087. showHighlights:
  33088. r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  33089. startHighlights: r.valueFromHash("hl", -1),
  33090. specialEdition: r.valueFromHash("bn", 0),
  33091. useWheel: r.valueFromHash("wh", !0),
  33092. crossOrigin: "anonymous",
  33093. fancierTransition: !1,
  33094. wireframe: !1,
  33095. skyboxWireframe: !1,
  33096. modelAlpha: 1,
  33097. highlightPanoSelection: !1,
  33098. showSweeps: !0,
  33099. showSkyboxes: !1,
  33100. showMesh: !0,
  33101. showFloors: !1,
  33102. showFloorDuration: 300,
  33103. showFloorDelay: 300,
  33104. hideFloorDuration: 300,
  33105. hideFloorDelay: 0,
  33106. reticuleOpacityTransitionTime: 250,
  33107. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  33108. markerOpacityTransitionTime: 500,
  33109. guiAnimationSpeed: 250,
  33110. highlightAnimationDuration: 500,
  33111. modelComponentLoadSpinnerDelay: 150,
  33112. captureErrors: !1,
  33113. maxMobileTextures: 6,
  33114. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  33115. startupFlyinDelay: 3e3,
  33116. dollhouseDefault: {
  33117. minDistance: 15,
  33118. maxDistance: 50,
  33119. minPolarAngle: n.Math.degToRad(10),
  33120. maxPolarAngle: n.Math.degToRad(90),
  33121. },
  33122. hideReticuleTimeout: 1e3,
  33123. analytics: {
  33124. inactivityThreshold: 30,
  33125. sessionTrackingRate: 0.15,
  33126. maxTrackedErrors: 20,
  33127. sessionDurationPingFrequency: 10,
  33128. sessionDurationTimeout: 15,
  33129. },
  33130. flydown: {
  33131. movementEasing: "easeInOutQuad",
  33132. movementDelay: 0.001,
  33133. rotationEasing: "easeInOutQuad",
  33134. rotationDelay: 0.5,
  33135. modelTextureDelay: 0.75,
  33136. skyboxDelay: 0.75,
  33137. },
  33138. transition: {
  33139. flySpeed: 0.001,
  33140. flyTime: 750,
  33141. flytimeMaxDistanceThreshold: 5,
  33142. flytimeDistanceMultiplier: 150,
  33143. aimTime: 1500,
  33144. aimSlowFactor: 1.5,
  33145. blur: 0.8,
  33146. movementEasing: "easeInOutQuad",
  33147. blendEasing: "easeInOutQuad",
  33148. fastForwardFactor: 4, //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  33149. },
  33150. show360Views: {
  33151. enabled: !0,
  33152. transitionTime: 1e3,
  33153. },
  33154. quickstart: {
  33155. enabled:
  33156. 1 === r.valueFromHash("qust", 0) ||
  33157. 1 === r.valueFromHash("qs", 0),
  33158. animation: 1400,
  33159. showTextDelay: 500,
  33160. fadeOutDelay: 3e3,
  33161. fovChange: 10,
  33162. },
  33163. appConfig: {
  33164. webvr_version: null,
  33165. segment_key: null,
  33166. embedly_key: null,
  33167. branch_key: null,
  33168. keen_write_key: null,
  33169. keen_project_id: null,
  33170. },
  33171. vr: {
  33172. enabled: !0,
  33173. allowWebVR: !1,
  33174. option: r.valueFromHash("vr", a.CONTEXTUAL),
  33175. },
  33176. share: {
  33177. enabled:
  33178. !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0),
  33179. },
  33180. input: {
  33181. longTapThreshold: 200,
  33182. moveToleranceNDC: 0.01, //.08,
  33183. touchMoveThreshold: 25,
  33184. },
  33185. help: {
  33186. modalStayDuration: 600,
  33187. },
  33188. immersive: {
  33189. timeToShowAgain: 1250,
  33190. uiStayDuration: 600,
  33191. },
  33192. tourInteraction: {
  33193. disabled: "0" === r.valueFromHash("tourcta", null),
  33194. showPauseButton: 1e3,
  33195. showModal: 1500,
  33196. allowNextClick: 200,
  33197. largeModal: "1" === r.valueFromHash("tourcta", null),
  33198. smallModal: "2" === r.valueFromHash("tourcta", null),
  33199. },
  33200. labels: {
  33201. enabled: !1,
  33202. hideUntilStart: !0,
  33203. fadeInDuration: 250,
  33204. fadeInDelay: 250,
  33205. fadeOutDuration: 250,
  33206. fadeOutDelay: 0,
  33207. zoomHideThreshhold: {
  33208. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  33209. desktop: 2,
  33210. },
  33211. zoomTruncateThreshhold: {
  33212. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  33213. desktop: 0.85,
  33214. },
  33215. minLengthForTruncate: 16,
  33216. truncateLength: 12,
  33217. truncateSuffix: "...",
  33218. },
  33219. tags: {
  33220. enabled: r.valueFromHash("mt", 1),
  33221. startup: {
  33222. hideUntilStart: !0,
  33223. fadeInDuration: 500,
  33224. fadeInDelay: 100,
  33225. },
  33226. visibility: {
  33227. anyDistance: !0,
  33228. visibleDistance: 8,
  33229. cameraClearance: 0.1,
  33230. alphaTestLevel: 0.05,
  33231. hideViaFloor: !0,
  33232. hideOffScreenDisc: !1,
  33233. hideOffScreenObject: !1,
  33234. },
  33235. disc: {
  33236. opacity: 1,
  33237. disabledOpacity: 0.5,
  33238. scale: {
  33239. nearBound: 1.5,
  33240. farBound: 4.8,
  33241. linkFarBound: !1,
  33242. linkPercent: 40,
  33243. maxSize: 80,
  33244. minSize: 40,
  33245. baseViewportSize: 800,
  33246. responsiveness: 100,
  33247. },
  33248. },
  33249. pole: {
  33250. enabled: !0,
  33251. height: 0.5,
  33252. width: 2,
  33253. opacity: 0.5,
  33254. color: "white",
  33255. },
  33256. navigate: {
  33257. nearestPano: !0,
  33258. lineOfSight: !0,
  33259. reactivate: !0,
  33260. aimAt: "disc",
  33261. tiltTolerance: 25,
  33262. rotateSpeedFactor: 0.6,
  33263. },
  33264. },
  33265. path: {
  33266. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  33267. colorUp: s._desat(s.newBlue, 0.5),
  33268. colorDown: s._darken(s.newBlue, 0.35),
  33269. opacity: 0.5,
  33270. style: "ribbon",
  33271. height: 0.025,
  33272. ribbonWidth: 0.24,
  33273. outsideHeight: 0.5,
  33274. waypointRadius: 0.5,
  33275. waypointIndoorRadius: 0.24,
  33276. waypointPulse: 1e3,
  33277. typ: l.BLACK,
  33278. meshFree: r.valueFromHash("mf", 1),
  33279. mapGuides: r.valueFromHash("guides", !0),
  33280. fadeInTime: 400,
  33281. fadeOutTime: 300,
  33282. },
  33283. warp: {
  33284. nearPanoDist: 0.1,
  33285. matchCam: !1,
  33286. blur: 0.33,
  33287. fastTime: 1500,
  33288. teleportTime: 1500, //瞬间过渡的时间
  33289. flytimeDistanceMultiplier: 150, //add
  33290. flyTime: 750, //add
  33291. outsideTime: 2e3,
  33292. lookAheadMax: 0.3,
  33293. lookAheadDist: 2.5,
  33294. softPushDist: 0.37,
  33295. softPushEnd: 0.3,
  33296. softBendAngle: 8,
  33297. softBendTilt: 4,
  33298. softBendEnd: 0.3,
  33299. doBurns: true, //r.valueFromHash("kb", !0),
  33300. burnsAngle: 8, //导览在每个点停留时的旋转角度
  33301. minBurnsAngle: 35,
  33302. minDownAngle: -35,
  33303. maxTurnPerSec: 280,
  33304. maxAimPerSec: 35,
  33305. minRotation: 12,
  33306. maxAimRotation: 33.2,
  33307. turnFriction: 0.2,
  33308. flySpeed: 0.01,
  33309. minWarpTime: 1200,
  33310. warpInterruptionRedirectTime: 500,
  33311. tourStepDelay: r.valueFromHash("st", 0),
  33312. walkDelay: 0,
  33313. walkMaxDist: 50,
  33314. walkMinDist: 0.8,
  33315. walkSlideShowThreshhold: 3000,
  33316. walkExtraPanosDistance: 0.4,
  33317. timePerMeter: 1200,
  33318. motionLeadTime: 5000,
  33319. movementEasing: "easeInOutQuad",
  33320. blendEasing: "easeInOutQuad",
  33321. showBunny: !1,
  33322. loop: r.valueFromHash("lp", !1),
  33323. auto: r.valueFromHash("ts", -1),
  33324. eOrder: "YXZ", //"YXZ",
  33325. stepFactor: 0.25,
  33326. brakeStrength: 2,
  33327. minBrakeAngle: 0.1,
  33328. maxBrakeAngle: 1.8,
  33329. climbEffort: 4,
  33330. },
  33331. rotationFriction: 0.05,
  33332. rotationAccelerationInside: 4.5,
  33333. rotationAccelerationOutside: 0.15,
  33334. rotationAfterMoveMultiplier: 40,
  33335. rotationAfterMoveHistoryCount: 5,
  33336. panFriction: 0.09,
  33337. panAccelerationOutside: 60,
  33338. onload: r.valueFromHash("onload", o.PANORAMA),
  33339. zoomNearLimit: 0.1,
  33340. zoomFarLimit: 50,
  33341. navigation: {
  33342. panoScores: !1,
  33343. mouseDirection: !0,
  33344. filterStrictness: 0.75,
  33345. angleFactor: -30,
  33346. directionFactor: 10,
  33347. distanceFactor: -1,
  33348. optionalityFactor: 3,
  33349. },
  33350. sdkInit: !1,
  33351. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  33352. console: r.valueFromHash("console", !1),
  33353. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  33354. panoramaNeighbourMaxDistance: 5,
  33355. panoFloorClickRadius: 0.35,
  33356. showScreenshotLocations: !1,
  33357. showAxis: !1,
  33358. showNeighbourRaycasts: !1,
  33359. colorMarkerOnLoad: !1,
  33360. colorMarkerByFloor: !1,
  33361. tiling: {
  33362. panoPreRenderRepeatDelay: 2500,
  33363. panoPreRenderDelay: 500,
  33364. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  33365. tilingFlagNames: ["usetiles", "tiles"],
  33366. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  33367. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  33368. overlayStyle: r.valueFromHash("tileoverlay", 0),
  33369. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  33370. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  33371. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1 /* 2 */),
  33372. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  33373. customCompression: r.valueFromHash("tilecustcomp", 0),
  33374. // mobileHighQualityOverride: !1,
  33375. mobileHighQualityOverride: 1,
  33376. allowUltraHighResolution: true,
  33377. },
  33378. zoom: {
  33379. enabled: true,
  33380. forceOff: r.valueFromHash("nozoom", 0),
  33381. overridemax: r.valueFromHash("maxzoom", null),
  33382. overridemin: r.valueFromHash("minzoom", null),
  33383. max: d.highQualityMaxZoom,
  33384. min: 1,
  33385. transitionStyle: r.valueFromHash("zoomtrans", 1),
  33386. activationThreshold: 1.1,
  33387. restoreTime: 500,
  33388. },
  33389. profiling: {
  33390. enabled: r.valueFromHash("mem", !1),
  33391. },
  33392. };
  33393. (p = h.deepExtend(p, d, {
  33394. insideFOV: r.valueFromHash("fov", d.insideFOV),
  33395. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  33396. panorama: {
  33397. transitionTime: 1e3,
  33398. modelAlpha: 0,
  33399. modelAlphaDelay: p.flydown.modelTextureDelay,
  33400. modelAlphaLength: 1,
  33401. skyboxOpacity: 1,
  33402. skyboxOpacityDelay: p.flydown.skyboxDelay,
  33403. skyboxOpacityLength: 0.9,
  33404. fovLength: 1,
  33405. fovDelay: 0,
  33406. cameraMatrixDuration: 0.8,
  33407. cameraMatrixDelay: 0,
  33408. cameraMatrixEase: c.easeInCubic,
  33409. reticuleOpacity: 1,
  33410. markerOpacity: 0.3,
  33411. markerOpacityOnHover: 1,
  33412. },
  33413. dollhouse: {
  33414. transitionTime: 1e3,
  33415. modelAlpha: 1,
  33416. modelAlphaDelay: 0,
  33417. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  33418. skyboxOpacity: 0,
  33419. skyboxOpacityDelay: 0,
  33420. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  33421. fovLength: 1,
  33422. fovDelay: 0,
  33423. cameraMatrixDuration: 0.8,
  33424. cameraMatrixDelay: 0.3,
  33425. cameraMatrixEase: c.easeInCubic,
  33426. reticuleOpacity: 1,
  33427. markerOpacity: 0,
  33428. markerOpacityOnHover: 0,
  33429. },
  33430. floorplan: {
  33431. transitionTime: 1e3,
  33432. modelAlpha: 1,
  33433. modelAlphaDelay: 0,
  33434. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  33435. skyboxOpacity: 0,
  33436. skyboxOpacityDelay: 0,
  33437. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  33438. fovLength: 1,
  33439. fovDelay: 0,
  33440. cameraMatrixDuration: 0.5,
  33441. cameraMatrixDelay: 0,
  33442. cameraMatrixEase: c.easeOutCubic,
  33443. reticuleOpacity: 1,
  33444. markerOpacity: 0,
  33445. markerOpacityOnHover: 0,
  33446. cameraHeight: 50,
  33447. },
  33448. transitioning: {
  33449. reticuleOpacity: 0,
  33450. markerOpacity: 0.3,
  33451. markerOpacityOnHover: 1,
  33452. },
  33453. "floorplan-dollhouse": {
  33454. rotationDelay: 0,
  33455. rotationDuration: 1,
  33456. },
  33457. "floorplan-panorama": {
  33458. rotationDelay: 0.5,
  33459. rotationDuration: 1,
  33460. },
  33461. "dollhouse-panorama": {
  33462. rotationDelay: 0.5,
  33463. rotationDuration: 1,
  33464. },
  33465. "dollhouse-floorplan": {
  33466. rotationDelay: 0,
  33467. rotationDuration: 1,
  33468. cameraMatrixDuration: 1.05,
  33469. cameraMatrixDelay: 0.5,
  33470. },
  33471. "panorama-dollhouse": {
  33472. rotationDelay: 0,
  33473. rotationDuration: 0.5,
  33474. },
  33475. "panorama-floorplan": {
  33476. transitionTime: 1500,
  33477. rotationDelay: 0,
  33478. rotationDuration: 0.5,
  33479. },
  33480. })),
  33481. p.path.meshFree && (p.path.typ = l.WALK),
  33482. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  33483. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  33484. (window._settings = t.exports = p);
  33485. },
  33486. {
  33487. "./constants": 8,
  33488. "./enum/Colors": 19,
  33489. "./enum/VROption": 47,
  33490. "./enum/Viewmode": 51,
  33491. "./enum/WarpStyle": 52,
  33492. "./util/browser": 182,
  33493. "./util/common": 185,
  33494. "./util/easing": 186,
  33495. "./util/showcase": 193,
  33496. three: 217,
  33497. },
  33498. ],
  33499. 167: [
  33500. function (e, t, i) {
  33501. "use strict";
  33502. var n = e("three"),
  33503. r = e("./settings"),
  33504. o =
  33505. "precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n",
  33506. a =
  33507. "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  33508. t.exports = {
  33509. basicTextured: {
  33510. uniforms: {
  33511. tDiffuse: {
  33512. type: "t",
  33513. value: null,
  33514. },
  33515. alpha: {
  33516. type: "f",
  33517. value: 1,
  33518. },
  33519. },
  33520. vertexShader:
  33521. "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  33522. fragmentShader:
  33523. "varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}",
  33524. },
  33525. copyCubeMap: {
  33526. uniforms: {
  33527. tDiffuse: {
  33528. type: "t",
  33529. value: null,
  33530. },
  33531. alpha: {
  33532. type: "f",
  33533. value: 1,
  33534. },
  33535. },
  33536. vertexShader:
  33537. "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  33538. fragmentShader:
  33539. "varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}",
  33540. },
  33541. cube: {
  33542. uniforms: {
  33543. map: {
  33544. type: "t",
  33545. value: null,
  33546. },
  33547. opacity: {
  33548. type: "f",
  33549. value: 1,
  33550. },
  33551. },
  33552. vertexShader:
  33553. o +
  33554. "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  33555. fragmentShader:
  33556. a +
  33557. "uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n",
  33558. },
  33559. model: {
  33560. uniforms: {
  33561. map: {
  33562. type: "t",
  33563. value: null,
  33564. },
  33565. modelAlpha: {
  33566. type: "f",
  33567. value: r.modelAlpha,
  33568. },
  33569. opacity: {
  33570. type: "f",
  33571. value: 1,
  33572. },
  33573. progress: {
  33574. type: "f",
  33575. value: 0,
  33576. },
  33577. blackout: {
  33578. type: "i",
  33579. value: 0,
  33580. },
  33581. pano0Map: {
  33582. type: "t",
  33583. value: null,
  33584. },
  33585. pano0Position: {
  33586. type: "v3",
  33587. value: new n.Vector3(),
  33588. },
  33589. pano0Matrix: {
  33590. type: "m4",
  33591. value: new n.Matrix4(),
  33592. },
  33593. pano1Map: {
  33594. type: "t",
  33595. value: null,
  33596. },
  33597. pano1Position: {
  33598. type: "v3",
  33599. value: new n.Vector3(),
  33600. },
  33601. pano1Matrix: {
  33602. type: "m4",
  33603. value: new n.Matrix4(),
  33604. },
  33605. },
  33606. vertexShader:
  33607. o +
  33608. `uniform vec3 pano0Position;
  33609. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  33610. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  33611. varying vec3 vWorldPosition0;
  33612. varying vec3 vWorldPosition1;
  33613. uniform int blackout;
  33614. void main() {
  33615. vUv = uv;
  33616. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  33617. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  33618. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  33619. vWorldPosition0.x *= -1.0;
  33620. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  33621. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  33622. vWorldPosition1.x *= -1.0;
  33623. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  33624. }`,
  33625. fragmentShader:
  33626. a +
  33627. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  33628. uniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\n
  33629. void main() {
  33630. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  33631. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  33632. vec4 colorFromPanos;
  33633. if (blackout == 5){//add for TransitionPass
  33634. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  33635. }else{
  33636. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  33637. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  33638. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  33639. else if (blackout == 1) {
  33640. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  33641. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  33642. }
  33643. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  33644. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  33645. }
  33646. //#ifdef useModelMap //起不了作用为啥
  33647. if(modelAlpha>0.0){
  33648. vec4 colorFromTexture = texture2D( map, vUv );
  33649. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  33650. }
  33651. //#endif
  33652. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  33653. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  33654. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  33655. }`,
  33656. },
  33657. hot: {
  33658. uniforms: {
  33659. color: {
  33660. type: "c",
  33661. value: new n.Color(0xff2200),
  33662. },
  33663. opac: {
  33664. type: "f",
  33665. value: 0,
  33666. },
  33667. texture1: {
  33668. type: "t",
  33669. value: null,
  33670. },
  33671. texture2: {
  33672. type: "t",
  33673. value: null,
  33674. },
  33675. },
  33676. vertexShader:
  33677. "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  33678. fragmentShader:
  33679. "varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n",
  33680. },
  33681. modelOutside: {
  33682. uniforms: {
  33683. map: {
  33684. type: "t",
  33685. value: null,
  33686. },
  33687. opacity: {
  33688. type: "f",
  33689. value: 1,
  33690. },
  33691. },
  33692. vertexShader:
  33693. o +
  33694. "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  33695. fragmentShader:
  33696. a +
  33697. "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n",
  33698. },
  33699. ribbon: {
  33700. uniforms: {
  33701. map: {
  33702. type: "t",
  33703. value: null,
  33704. },
  33705. opacity: {
  33706. type: "f",
  33707. value: 1,
  33708. },
  33709. color: {
  33710. type: "c",
  33711. value: new n.Color(r.path.color),
  33712. },
  33713. },
  33714. vertexShader:
  33715. o +
  33716. "varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n",
  33717. fragmentShader:
  33718. a +
  33719. "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n",
  33720. },
  33721. waypoint: {
  33722. uniforms: {
  33723. map: {
  33724. type: "t",
  33725. value: null,
  33726. },
  33727. opacity: {
  33728. type: "f",
  33729. value: 1,
  33730. },
  33731. pulse: {
  33732. type: "f",
  33733. value: 1,
  33734. },
  33735. nearFade: {
  33736. type: "v2",
  33737. value: new n.Vector2(
  33738. 2 * r.insideNear,
  33739. 2 * r.path.waypointIndoorRadius
  33740. ),
  33741. },
  33742. color: {
  33743. type: "c",
  33744. value: new n.Color(r.reticuleColor),
  33745. },
  33746. },
  33747. vertexShader:
  33748. o +
  33749. "varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n",
  33750. fragmentShader:
  33751. a +
  33752. "uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n",
  33753. },
  33754. modelDebug: {
  33755. uniforms: {
  33756. map: {
  33757. type: "t",
  33758. value: null,
  33759. },
  33760. modelAlpha: {
  33761. type: "f",
  33762. value: r.modelAlpha,
  33763. },
  33764. depthmapRatio: {
  33765. type: "f",
  33766. value: 0,
  33767. },
  33768. opacity: {
  33769. type: "f",
  33770. value: 1,
  33771. },
  33772. progress: {
  33773. type: "f",
  33774. value: 0,
  33775. },
  33776. considerOcclusion: {
  33777. type: "i",
  33778. value: r.fancierTransition,
  33779. },
  33780. highlightPanoSelection: {
  33781. type: "i",
  33782. value: 0,
  33783. },
  33784. useThirdPano: {
  33785. type: "i",
  33786. value: r.useThirdPano,
  33787. },
  33788. pano0Map: {
  33789. type: "t",
  33790. value: null,
  33791. },
  33792. pano0Depth: {
  33793. type: "t",
  33794. value: null,
  33795. },
  33796. pano0Position: {
  33797. type: "v3",
  33798. value: new n.Vector3(),
  33799. },
  33800. pano0Matrix: {
  33801. type: "m4",
  33802. value: new n.Matrix4(),
  33803. },
  33804. pano0Weight: {
  33805. type: "f",
  33806. value: r.transition.pano0Weight,
  33807. },
  33808. pano1Map: {
  33809. type: "t",
  33810. value: null,
  33811. },
  33812. pano1Depth: {
  33813. type: "t",
  33814. value: null,
  33815. },
  33816. pano1Position: {
  33817. type: "v3",
  33818. value: new n.Vector3(),
  33819. },
  33820. pano1Matrix: {
  33821. type: "m4",
  33822. value: new n.Matrix4(),
  33823. },
  33824. pano1Weight: {
  33825. type: "f",
  33826. value: r.transition.pano1Weight,
  33827. },
  33828. pano2Map: {
  33829. type: "t",
  33830. value: null,
  33831. },
  33832. pano2Depth: {
  33833. type: "t",
  33834. value: null,
  33835. },
  33836. pano2Position: {
  33837. type: "v3",
  33838. value: new n.Vector3(),
  33839. },
  33840. pano2Matrix: {
  33841. type: "m4",
  33842. value: new n.Matrix4(),
  33843. },
  33844. pano2Weight: {
  33845. type: "f",
  33846. value: r.transition.pano2Weight,
  33847. },
  33848. },
  33849. vertexShader:
  33850. o +
  33851. "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  33852. fragmentShader:
  33853. a +
  33854. "uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n",
  33855. },
  33856. customDepth: {
  33857. uniforms: {
  33858. panoPosition: {
  33859. type: "v3",
  33860. value: new n.Vector3(),
  33861. },
  33862. },
  33863. vertexShader:
  33864. o +
  33865. "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  33866. fragmentShader:
  33867. a +
  33868. "uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n",
  33869. },
  33870. skysphere: {
  33871. uniforms: {
  33872. radius: {
  33873. type: "f",
  33874. value: 0,
  33875. },
  33876. },
  33877. vertexShader:
  33878. o +
  33879. "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  33880. fragmentShader:
  33881. a +
  33882. "varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n",
  33883. },
  33884. tagDisc: {
  33885. uniforms: {
  33886. opacity: {
  33887. type: "f",
  33888. value: 0,
  33889. },
  33890. color: {
  33891. type: "c",
  33892. value: new n.Color(),
  33893. },
  33894. bg: {
  33895. type: "t",
  33896. value: null,
  33897. },
  33898. mask: {
  33899. type: "t",
  33900. value: null,
  33901. },
  33902. },
  33903. vertexShader:
  33904. o +
  33905. "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  33906. fragmentShader:
  33907. a +
  33908. "uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n",
  33909. },
  33910. };
  33911. },
  33912. {
  33913. "./settings": 166,
  33914. three: 217,
  33915. },
  33916. ],
  33917. 168: [
  33918. function (e, t, i) {
  33919. (function (i) {
  33920. "use strict";
  33921. var n = e("three"),
  33922. r = (e("url"), e("./util/ajax")),
  33923. o = e("./settings"),
  33924. a = e("./util/logger"),
  33925. s = e("./util/math"),
  33926. l = e("./util/showcase"),
  33927. c = e("./objects/Panorama"),
  33928. h = new a(i),
  33929. u = e("./model/Model"),
  33930. d = e("./shaders"),
  33931. p = e("./util/transitions"),
  33932. f = e("./objects/Chunk"),
  33933. g = e("./objects/Reticule"),
  33934. m = e("./objects/Skybox"),
  33935. v = e("./objects/Floor"),
  33936. A = e("./cameras/DollhouseCamera"),
  33937. y = e("./cameras/FloorplanCamera"),
  33938. C = e("./cameras/PanoramaCamera"),
  33939. I = e("./controls/DollhouseControls"),
  33940. E = e("./controls/FloorplanControls"),
  33941. b = e("./controls/PanoramaControls");
  33942. (n.ImageUtils.crossOrigin = o.crossOrigin),
  33943. (t.exports = {
  33944. shaders: d,
  33945. transitions: p,
  33946. Model: u,
  33947. Chunk: f,
  33948. Floor: v,
  33949. Skybox: m,
  33950. Reticule: g,
  33951. Panorama: c,
  33952. DollhouseCamera: A,
  33953. FloorplanCamera: y,
  33954. PanoramaCamera: C,
  33955. DollhouseControls: I,
  33956. FloorplanControls: E,
  33957. PanoramaControls: b,
  33958. getModel: function (e) {
  33959. if (!e.url) throw 'getModel(): missing parameter "url"';
  33960. e.autoload = void 0 === e.autoload || e.autoload;
  33961. var t = l.parseSidUrl(e.url);
  33962. (e.urlBase = t.urlBase),
  33963. (e.urlModel = t.urlModel),
  33964. (e.urlFiles = t.urlFiles);
  33965. var i = this._getPlatformError();
  33966. return i
  33967. ? $.Deferred().reject(i).promise()
  33968. : ((this.options = e),
  33969. this._loadModel().then(this._buildModel.bind(this)));
  33970. },
  33971. _getPlatformError: function () {
  33972. return "IE" === $.ua.browser.name &&
  33973. parseInt($.ua.browser.major) < 11
  33974. ? "webgl-unsupported"
  33975. : "iOS" === $.ua.os.name &&
  33976. /^[0-7][$\.]/.test($.ua.os.version)
  33977. ? "webgl-ios"
  33978. : Modernizr.webgl
  33979. ? null
  33980. : "webgl-unsupported";
  33981. },
  33982. _loadModel: function () {
  33983. return r
  33984. .get(this.options.urlModel, {
  33985. responseType: "json",
  33986. prefetchFrom: "model",
  33987. auth: l.getAuthorizationHeader(),
  33988. })
  33989. .then(null, function () {
  33990. return (
  33991. h.warn("Model loading failed at initial metadata load"),
  33992. "loading-failed"
  33993. );
  33994. });
  33995. },
  33996. _buildModel: function (e) {
  33997. e = l.normalizeModeldata(e, s);
  33998. var t = new u(this.options, e);
  33999. return this.options.autoload ? t.load(!0) : $.when(t);
  34000. },
  34001. });
  34002. }).call(this, "/js/showcase.js");
  34003. },
  34004. {
  34005. "./cameras/DollhouseCamera": 5,
  34006. "./cameras/FloorplanCamera": 6,
  34007. "./cameras/PanoramaCamera": 7,
  34008. "./controls/DollhouseControls": 10,
  34009. "./controls/FloorplanControls": 11,
  34010. "./controls/PanoramaControls": 13,
  34011. "./model/Model": 139,
  34012. "./objects/Chunk": 144,
  34013. "./objects/Floor": 146,
  34014. "./objects/Panorama": 148,
  34015. "./objects/Reticule": 149,
  34016. "./objects/Skybox": 152,
  34017. "./settings": 166,
  34018. "./shaders": 167,
  34019. "./util/ajax": 181,
  34020. "./util/logger": 189,
  34021. "./util/math": 190,
  34022. "./util/showcase": 193,
  34023. "./util/transitions": 195,
  34024. three: 217,
  34025. url: 208,
  34026. },
  34027. ],
  34028. 169: [
  34029. function (e, t, i) {
  34030. "use strict";
  34031. function n() {
  34032. var e = {
  34033. renderTarget: null,
  34034. inUse: !1,
  34035. size: -1,
  34036. pano: null,
  34037. };
  34038. return e;
  34039. }
  34040. function r(e) {
  34041. M.push(e);
  34042. }
  34043. function o(e) {
  34044. var t = n();
  34045. return (t.inUse = !0), (t.size = e), r(t), t;
  34046. }
  34047. function a(e) {
  34048. for (var t = 0; t < M.length; t++) {
  34049. var i = M[t];
  34050. if (!i.inUse && i.size === e) return (i.inUse = !0), i;
  34051. }
  34052. return null;
  34053. }
  34054. function s(e) {
  34055. for (var t = 0; t < M.length; t++) {
  34056. var i = M[t];
  34057. if (i.renderTarget === e) return (i.inUse = !1), !0;
  34058. }
  34059. return !1;
  34060. }
  34061. function l() {
  34062. (this.tileDirectory = {}),
  34063. (this.activeRenderTargetDescriptors = {}),
  34064. (this.activePanos = []),
  34065. (this.panoLODDescriptors = {}),
  34066. (this.panoDescriptors = {}),
  34067. (this.tileTrees = {}),
  34068. (this.sceneRenderer = null),
  34069. (this.tileDownloader = null),
  34070. (this.forceQueue = []),
  34071. (this.uploadQueues = {}),
  34072. (this.uploadInterval = null),
  34073. (this.uploadIntervalCancelled = !1),
  34074. (this.usingTileOverlay = !1),
  34075. (this.overlayTilesLoaded = !1),
  34076. (this.overlayTileBase = null),
  34077. (this.overlayTilesBasic = {}),
  34078. (this.overlayTilesEnhanced = {}),
  34079. (this.zoomRenderTarget = null),
  34080. (this.zoomPano = null),
  34081. (this.zoomingActive = !1),
  34082. (this.zoomPanoId = null),
  34083. (this.zoomPanoRenderingDisabled = !1),
  34084. (this.direction = new h.Vector3()),
  34085. (this.initTime = -1),
  34086. (this.maxBaseUploadsPerFrame = x),
  34087. (this.maxNonBaseUploadsPerFrame = T);
  34088. }
  34089. function c() {
  34090. this.uploadIntervalCancelled ||
  34091. (this.overlayTilesLoaded || !this.usingTileOverlay
  34092. ? ((b = !0),
  34093. this.updateUploadQueue(
  34094. this.maxNonBaseUploadsPerFrame,
  34095. this.maxBaseUploadsPerFrame
  34096. ),
  34097. this.peekNextFromUploadQueue()
  34098. ? this.refreshUploadInterval(w)
  34099. : (this.uploadInterval = null))
  34100. : this.refreshUploadInterval(this.uploadIntervalDelay));
  34101. }
  34102. /* function c() {
  34103. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  34104. this.updateUploadQueue(1, 2),
  34105. w = 18,
  34106. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  34107. } */
  34108. var h = e("three"),
  34109. u = e("../exception/BasicException"),
  34110. d = e("../settings"),
  34111. p = e("../enum/PanoSizeClass"),
  34112. f = (e("../objects/Panorama"), e("../enum/PanoRendererEvents")),
  34113. g = e("../enum/SceneRendererEvents"),
  34114. m = e("../enum/TileDownloaderEvents"),
  34115. v = e("../enum/Vectors"),
  34116. A =
  34117. (e("../enum/GLCubeFaces"),
  34118. e("../objects/Panorama"),
  34119. e("./TileTree")),
  34120. y = (e("./TileDownloader"), e("./TilePrioritizer")),
  34121. C = e("./TileUtils"),
  34122. p = e("../enum/PanoSizeClass"),
  34123. I = (e("../util/browser"), e("../util/panorama")),
  34124. E = e("events").EventEmitter,
  34125. b = !1,
  34126. w = d.tiling.uploadIntervalDelay,
  34127. _ = d.tiling.initialIntervalDelay,
  34128. T = d.tiling.maxNonBaseUploadsPerFrame,
  34129. x = d.tiling.maxBaseUploadsPerFrame,
  34130. S = {
  34131. Base: 0,
  34132. Remaining: 1,
  34133. },
  34134. M = [];
  34135. window.targetList = M;
  34136. (l.prototype = Object.create(E.prototype)),
  34137. (l.prototype.init = function (e, t, i) {
  34138. (this.sceneRenderer = e),
  34139. (this.tileDownloader = t),
  34140. (this.qualityManager = i),
  34141. this.bindEvents(),
  34142. this.sceneRenderer.on(
  34143. g.ContextCreated,
  34144. this.loadOverlayTiles.bind(this)
  34145. ),
  34146. (this.initTime = performance.now());
  34147. }),
  34148. (l.prototype.getActivePanoTextures = function (e) {
  34149. e = e || [];
  34150. for (var t = 0; t < M.length; t++) {
  34151. var i = M[t];
  34152. i.renderTarget &&
  34153. i.renderTarget.texture &&
  34154. e.push(i.renderTarget.texture);
  34155. }
  34156. }),
  34157. (l.prototype.hasQueuedTiles = function () {
  34158. var e = this.peekNextFromUploadQueue();
  34159. return null !== e && void 0 !== e;
  34160. }),
  34161. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  34162. return this.activeRenderTargetDescriptors[e];
  34163. }),
  34164. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  34165. this.activeRenderTargetDescriptors[e] = t;
  34166. }),
  34167. (l.prototype.loadOverlayTiles = function () {
  34168. if (0 !== d.tiling.overlayStyle) {
  34169. var e = 0,
  34170. t = function (t, n, r) {
  34171. (t = n
  34172. ? (t[n] = this.sceneRenderer.initSizedTexture2D(
  34173. C.TILE_SIZE,
  34174. h.ClampToEdgeWrapping
  34175. ))
  34176. : (this.overlayTileBase =
  34177. this.sceneRenderer.initSizedTexture2D(
  34178. C.TILE_SIZE,
  34179. h.ClampToEdgeWrapping
  34180. ))),
  34181. this.sceneRenderer.uploadTexture2D(
  34182. r,
  34183. t,
  34184. 0,
  34185. 0,
  34186. C.TILE_SIZE,
  34187. C.TILE_SIZE
  34188. ),
  34189. e++,
  34190. e === i.length && (this.overlayTilesLoaded = !0);
  34191. }.bind(this),
  34192. i = [
  34193. [
  34194. "static/images/outlineBase.png",
  34195. t.bind(this, this.overlayTileBase, null),
  34196. ],
  34197. [
  34198. "static/images/outlineBasic512.png",
  34199. t.bind(this, this.overlayTilesBasic, 256),
  34200. ],
  34201. [
  34202. "static/images/outlineBasic512.png",
  34203. t.bind(this, this.overlayTilesBasic, 512),
  34204. ],
  34205. [
  34206. "static/images/outlineBasic1024.png",
  34207. t.bind(this, this.overlayTilesBasic, 1024),
  34208. ],
  34209. [
  34210. "static/images/outlineBasic2048.png",
  34211. t.bind(this, this.overlayTilesBasic, 2048),
  34212. ],
  34213. [
  34214. "static/images/outlineBasic4096.png",
  34215. t.bind(this, this.overlayTilesBasic, 4096),
  34216. ],
  34217. [
  34218. "static/images/outlineEnhanced512.png",
  34219. t.bind(this, this.overlayTilesEnhanced, 256),
  34220. ],
  34221. [
  34222. "static/images/outlineEnhanced512.png",
  34223. t.bind(this, this.overlayTilesEnhanced, 512),
  34224. ],
  34225. [
  34226. "static/images/outlineEnhanced1024.png",
  34227. t.bind(this, this.overlayTilesEnhanced, 1024),
  34228. ],
  34229. [
  34230. "static/images/outlineEnhanced2048.png",
  34231. t.bind(this, this.overlayTilesEnhanced, 2048),
  34232. ],
  34233. [
  34234. "static/images/outlineEnhanced4096.png",
  34235. t.bind(this, this.overlayTilesEnhanced, 4096),
  34236. ],
  34237. ];
  34238. i.forEach(
  34239. function (e) {
  34240. this.tileDownloader.loadImage(e[0], 0, e[1]);
  34241. }.bind(this)
  34242. ),
  34243. (this.usingTileOverlay = !0);
  34244. } else this.usingTileOverlay = !1;
  34245. }),
  34246. (l.prototype.bindEvents = function () {
  34247. this.tileDownloader.on(
  34248. m.TileDownloadSuccess,
  34249. this.onTileDownloaded.bind(this)
  34250. );
  34251. }),
  34252. (l.prototype.setupZoomRenderTarget = (function () {
  34253. var targets = {};
  34254. return function () {
  34255. if (
  34256. this.qualityManager.maxRenderTargetSize == "2k" &&
  34257. this.qualityManager.getMaxNavPanoSize() == "2k"
  34258. )
  34259. return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  34260. if (
  34261. this.qualityManager.getMaxZoomPanoSize() >=
  34262. this.qualityManager.getMaxNavPanoSize()
  34263. ) {
  34264. if (
  34265. this.zoomRenderTarget &&
  34266. this.zoomRenderTarget.width ===
  34267. this.qualityManager.getMaxZoomPanoSize()
  34268. )
  34269. return;
  34270. var e = this.zoomRenderTarget;
  34271. var size = this.qualityManager.getMaxZoomPanoSize();
  34272. if (size > this.qualityManager.maxRenderTargetSize) {
  34273. return;
  34274. }
  34275. if (targets[size]) {
  34276. this.zoomRenderTarget = targets[size];
  34277. } else {
  34278. this.zoomRenderTarget = this.initTiledPano(size, true); //放大后不使用抗锯齿,否则消耗更多内存
  34279. targets[size] = this.zoomRenderTarget;
  34280. }
  34281. if (e) {
  34282. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  34283. var t = e.width,
  34284. i = this.zoomRenderTarget.width;
  34285. this.sceneRenderer.copyCubeMap(
  34286. e.texture,
  34287. this.zoomRenderTarget,
  34288. t,
  34289. t,
  34290. i,
  34291. i
  34292. ),
  34293. e.texture.dispose(),
  34294. (e.texture.loaded = !1),
  34295. (e.texture.version = 0),
  34296. this.sceneRenderer.deallocateCubeTexture(e.texture),
  34297. (e.texture = null);
  34298. }
  34299. this.zoomPanoRenderingDisabled = !1;
  34300. } else this.zoomPanoRenderingDisabled = !0;
  34301. };
  34302. })()),
  34303. (l.prototype.enableHighQuality = function (e) {
  34304. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  34305. if (!this.qualityManager.highQualityModeStarted) {
  34306. this.setupZoomRenderTarget();
  34307. e();
  34308. this.qualityManager.highQualityModeStarted = true;
  34309. }
  34310. }),
  34311. (l.prototype.enableUltraHighQualityMode = function (e) {
  34312. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  34313. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  34314. this.tileDownloader.testDownload(
  34315. t,
  34316. C.TILE_SIZE,
  34317. function (t) {
  34318. t &&
  34319. (this.qualityManager.enableUltraHighQualityMode(),
  34320. this.setupZoomRenderTarget(),
  34321. e());
  34322. }.bind(this)
  34323. );
  34324. }
  34325. }),
  34326. (l.prototype.activateTiledPano = function (e, t, i) {
  34327. i && this.clearAllQueuedUploads();
  34328. for (var n = 0; n < C.FACES_PER_PANO; n++)
  34329. this.initTileTree(
  34330. e.id,
  34331. n,
  34332. this.qualityManager.getMaxPossiblePanoSize()
  34333. );
  34334. this.linkAllTilesAndNodes(e);
  34335. var r = this.getActiveRenderTargetDescriptor(e.id),
  34336. l = t;
  34337. if (
  34338. (l > this.qualityManager.getMaxNavPanoSize() &&
  34339. (l = this.qualityManager.getMaxNavPanoSize()),
  34340. !r || l !== r.size)
  34341. ) {
  34342. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  34343. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */);
  34344. (r = o(c.width)), (r.renderTarget = c);
  34345. }
  34346. (r.pano = e),
  34347. this.resetPanoDescriptor(e.id),
  34348. this.resetPanoLODDescriptors(e.id),
  34349. this.resetRenderStatus(e.id, !0, !0);
  34350. }
  34351. this.setActiveRenderTargetDescriptor(e.id, r);
  34352. var h = i ? 0 : 1;
  34353. return this.updateActivePanos(e, h), r.renderTarget;
  34354. }),
  34355. (l.prototype.deactivateTiledPano = function (e) {
  34356. var t = this.getActiveRenderTargetDescriptor(e.id);
  34357. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  34358. this.setActiveRenderTargetDescriptor(e.id, null);
  34359. var i = this.getUploadQueueForPano(e.id);
  34360. this.clearUploadQueue(i), this.updateActivePanos();
  34361. }),
  34362. (l.prototype.updateActivePanos = (function () {
  34363. var e = [];
  34364. return function (t, i) {
  34365. e.length = 0;
  34366. for (var n = 0; n < this.activePanos.length; n++) {
  34367. t && e.length === i && e.push(t);
  34368. var r = this.activePanos[n],
  34369. o = this.getActiveRenderTargetDescriptor(r.id);
  34370. (t && r.id === t.id) ||
  34371. !this.isRenderTargetDescriptorValid(o) ||
  34372. e.push(r);
  34373. }
  34374. t && i >= e.length && e.push(t),
  34375. (this.activePanos.length = 0),
  34376. this.activePanos.push.apply(this.activePanos, e);
  34377. };
  34378. })()),
  34379. (l.prototype.getActivePanoCount = function () {
  34380. return this.activePanos.length;
  34381. }),
  34382. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  34383. var r = null;
  34384. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  34385. for (
  34386. var o = function (e, n, r, o) {
  34387. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1);
  34388. },
  34389. a = 0;
  34390. a < C.FACES_PER_PANO;
  34391. a++
  34392. ) {
  34393. var s = this.getTileTree(e, a);
  34394. s.breadthFirst({
  34395. callback: o.bind(this, a),
  34396. minLevel: r,
  34397. });
  34398. }
  34399. }),
  34400. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  34401. for (
  34402. var t = A.getLevelCountForSize(
  34403. C.TILE_SIZE,
  34404. this.qualityManager.getMaxNavPanoSize()
  34405. ),
  34406. i = function (e, t, i, n) {
  34407. (t.tile.zoomUploaded = t.tile.uploaded),
  34408. (t.zoomCovered = t.covered);
  34409. },
  34410. n = 0;
  34411. n < C.FACES_PER_PANO;
  34412. n++
  34413. ) {
  34414. var r = this.getTileTree(e, n);
  34415. r.breadthFirst({
  34416. callback: i.bind(this, n),
  34417. maxLevel: t,
  34418. });
  34419. }
  34420. }),
  34421. (l.prototype.renderPanoTiles = (function () {
  34422. var e = [];
  34423. return function (t, i, n, r) {
  34424. (this.zoomRenderTarget &&
  34425. this.zoomRenderTarget.width ===
  34426. this.qualityManager.getMaxZoomPanoSize()) ||
  34427. this.zoomPanoRenderingDisabled ||
  34428. this.setupZoomRenderTarget(),
  34429. (i = i || this.direction || v.FORWARD);
  34430. var o = this.getActiveRenderTargetDescriptor(t);
  34431. if (!this.isRenderTargetDescriptorValid(o))
  34432. throw new u(
  34433. "PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated."
  34434. );
  34435. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  34436. var s = this.getTileTree(t, a);
  34437. (e.length = 0),
  34438. s.breadthFirst({
  34439. saveVisited: e,
  34440. });
  34441. for (var l = 0; l < e.length; l++) {
  34442. var c = e[l];
  34443. this.queueTileUpload(c.tile, !1, r || (0 === l && n));
  34444. }
  34445. }
  34446. this.updateDirection(i);
  34447. };
  34448. })()),
  34449. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  34450. return e && e.renderTarget;
  34451. }),
  34452. (l.prototype.isPanoActive = function (e) {
  34453. var t = this.getActiveRenderTargetDescriptor(e);
  34454. return this.isRenderTargetDescriptorValid(t);
  34455. }),
  34456. (l.prototype.isPanoZoomed = function (e) {
  34457. return this.zoomingActive && this.zoomPanoId === e;
  34458. }),
  34459. (l.prototype.initTileTree = function (e, t, i) {
  34460. var n = this.tileTrees[e];
  34461. n || ((n = []), (this.tileTrees[e] = n));
  34462. var r = n[t];
  34463. if (!r) {
  34464. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  34465. (r = new A(C.TILE_SIZE, o)), (n[t] = r);
  34466. }
  34467. }),
  34468. (l.prototype.getTileTree = function (e, t) {
  34469. var i = this.tileTrees[e];
  34470. if (!i)
  34471. throw new u(
  34472. "PanoRenderer.getTileTree() -> Tree array not yet initialized!"
  34473. );
  34474. var n = i[t];
  34475. if (!n)
  34476. throw new u(
  34477. "PanoRenderer.getTileTree() -> Tree not yet initialized!"
  34478. );
  34479. return n;
  34480. }),
  34481. (l.prototype.initTiledPano = function (e, antialias) {
  34482. var i = this.sceneRenderer.renderer,
  34483. n =
  34484. (i.context,
  34485. new h.WebGLRenderTargetCube(e, e, {
  34486. stencilBuffer: !1,
  34487. })),
  34488. r = new h.CubeTexture([]);
  34489. (n.texture = r),
  34490. (r.image = [null, null, null, null, null, null]),
  34491. (r.flipY = !0),
  34492. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  34493. antialias
  34494. ? ((r.generateMipmaps = !0),
  34495. (r.magFilter = h.LinearFilter),
  34496. (r.minFilter = h.LinearMipMapLinearFilter))
  34497. : ((r.generateMipmaps = !1),
  34498. (r.magFilter = h.LinearFilter),
  34499. (r.minFilter = h.LinearFilter)),
  34500. (r.format = h.RGBAFormat),
  34501. i.setRenderTarget(n),
  34502. i.setRenderTarget(null);
  34503. var o = i.properties.get(r);
  34504. return (o.__image__webglTextureCube = o.__webglTexture), n;
  34505. }),
  34506. (l.prototype.getUploadQueueForPano = function (e) {
  34507. var t = this.uploadQueues[e];
  34508. return t || ((t = []), (this.uploadQueues[e] = t)), t;
  34509. }),
  34510. (l.prototype.isTileUploaded = function (e) {
  34511. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded;
  34512. }),
  34513. (l.prototype.setUploaded = function (e, t) {
  34514. this.isPanoZoomed(e.panoId)
  34515. ? (e.zoomUploaded = t)
  34516. : (e.uploaded = t);
  34517. }),
  34518. (l.prototype.queueTileUpload = function (e, t, i) {
  34519. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  34520. if (
  34521. this.isRenderTargetDescriptorValid(n) &&
  34522. e.downloaded &&
  34523. !this.isTileUploaded(e) &&
  34524. (!e.uploadQueued || i) &&
  34525. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) ||
  34526. this.zoomingActive)
  34527. ) {
  34528. var r = this.getUploadQueueForPano(e.panoId);
  34529. i
  34530. ? this.uploadTile(e, !1)
  34531. : (this.shoulPushToFrontOfQueue(e)
  34532. ? this.forceQueue.push(e)
  34533. : t && this.direction
  34534. ? y.insertSortedPanoTile(r, e, n.pano, this.direction)
  34535. : r.push(e),
  34536. (e.uploadQueued = !0),
  34537. this.uploadInterval ||
  34538. this.uploadIntervalCancelled ||
  34539. this.refreshUploadInterval(0));
  34540. }
  34541. }),
  34542. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  34543. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize);
  34544. }),
  34545. (l.prototype.getTopUploadQueue = function () {
  34546. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  34547. for (var n = 0; n < this.activePanos.length; n++)
  34548. if (
  34549. ((e = this.activePanos[n]),
  34550. (t = this.getUploadQueueForPano(e.id)),
  34551. t.length > 0)
  34552. )
  34553. switch (i) {
  34554. case S.Base:
  34555. if (0 === t[0].level) return t;
  34556. break;
  34557. case S.Remaining:
  34558. return t;
  34559. }
  34560. return null;
  34561. }),
  34562. (l.prototype.getNextFromUploadQueue = (function () {
  34563. var e = function (e) {
  34564. var t = e.shift();
  34565. return (t.uploadQueued = !1), t;
  34566. };
  34567. return function () {
  34568. if (this.forceQueue.length > 0) return e(this.forceQueue);
  34569. var t = this.getTopUploadQueue();
  34570. return t && t.length > 0 ? e(t) : null;
  34571. };
  34572. })()),
  34573. (l.prototype.peekNextFromUploadQueue = function () {
  34574. if (this.forceQueue.length > 0) return this.forceQueue[0];
  34575. var e = this.getTopUploadQueue();
  34576. return e && e.length > 0 ? e[0] : null;
  34577. }),
  34578. (l.prototype.clearAllQueuedUploads = function () {
  34579. this.clearAllUploadQueues(null, 0);
  34580. }),
  34581. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  34582. this.clearAllUploadQueues(e, 0);
  34583. }),
  34584. (l.prototype.clearAllUploadQueues = function (e, t) {
  34585. if (e)
  34586. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  34587. this.clearUploadQueue(this.forceQueue, t, e);
  34588. else {
  34589. for (var i = 0; i < this.activePanos.length; i++) {
  34590. var n = this.activePanos[i];
  34591. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t);
  34592. }
  34593. this.clearUploadQueue(this.forceQueue, t);
  34594. }
  34595. }),
  34596. (l.prototype.clearUploadQueue = function (e, t, i) {
  34597. (void 0 !== t && null !== t) || (t = 0);
  34598. for (var n = 0; n < e.length; ) {
  34599. var r = e[n];
  34600. (!i || (i && i === r.tile.panoId)) && r.level >= t
  34601. ? ((r.uploadQueued = !1), e.splice(n, 1))
  34602. : n++;
  34603. }
  34604. }),
  34605. (l.prototype.refreshUploadInterval = (function () {
  34606. var e = null;
  34607. return function (t) {
  34608. this.uploadIntervalCancelled ||
  34609. (e || (e = c.bind(this)),
  34610. (null !== t && void 0 !== t) || (t = w),
  34611. b || (t = _),
  34612. (this.uploadInterval = window.setTimeout(e, t)),
  34613. (this.uploadIntervalDelay = t));
  34614. };
  34615. })()),
  34616. (l.prototype.update = (function () {
  34617. var e = performance.now(),
  34618. t = 0;
  34619. return function () {
  34620. (this.uploadIntervalCancelled = !0),
  34621. window.clearTimeout(this.uploadInterval),
  34622. (this.uploadInterval = null);
  34623. var i = performance.now() - e;
  34624. !(i > w || 0 === t) ||
  34625. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  34626. (this.updateUploadQueue(
  34627. this.maxNonBaseUploadsPerFrame,
  34628. this.maxBaseUploadsPerFrame
  34629. ),
  34630. (e = performance.now())),
  34631. t++;
  34632. };
  34633. })()),
  34634. (l.prototype.updateUploadQueue = function (e, t) {
  34635. e || (e = 1);
  34636. for (var i = 0, n = 0; ; ) {
  34637. if (n >= t || i >= e) break;
  34638. var r = this.getNextFromUploadQueue();
  34639. if (!r) break;
  34640. if (
  34641. (0 !== r.level ? i++ : n++,
  34642. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) ||
  34643. this.zoomingActive)
  34644. ) {
  34645. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  34646. this.isRenderTargetDescriptorValid(o) &&
  34647. this.uploadTile(r, r.forceUpload);
  34648. }
  34649. }
  34650. }),
  34651. (l.prototype.updateDirection = function (e) {
  34652. if ((e = e || this.direction)) {
  34653. this.direction = e;
  34654. for (var t = 0; t < this.activePanos.length; t++) {
  34655. var i = this.activePanos[t],
  34656. n = this.getUploadQueueForPano(i.id);
  34657. y.sortPanoTiles(n, i, this.direction);
  34658. }
  34659. }
  34660. }),
  34661. (l.prototype.uploadTile = (function () {
  34662. var e = {},
  34663. t = (new h.Vector4(), d.tiling.overlayStyle);
  34664. //var failHistory = {};
  34665. return function (i, n) {
  34666. var r = i.panoId,
  34667. o = i.image,
  34668. a = i.tileSize,
  34669. s = i.panoSize,
  34670. l = i.tileIndex,
  34671. c = (i.faceTileIndex, i.totalTiles),
  34672. u = (i.face, i.tileX),
  34673. d = i.tileY,
  34674. p = !0,
  34675. g = !1,
  34676. m =
  34677. (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  34678. v = this.getActiveRenderTargetDescriptor(r),
  34679. A = v.renderTarget,
  34680. y = v.size;
  34681. if (
  34682. (this.isPanoZoomed(r) &&
  34683. ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  34684. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  34685. n ||
  34686. (this.anyUploaded(i.node) && ((p = !1), (g = !0)),
  34687. this.isTileUploaded(i) && ((p = !1), (g = !1))),
  34688. p)
  34689. ) {
  34690. /* if(failHistory[''+r+s+l]){
  34691. console.log('uploadTile retry', r, s, l)
  34692. }
  34693. console.log('uploadTile 成功', r, s, l)
  34694. */
  34695. var C = u * a,
  34696. I = d * a,
  34697. E = (a / s) * y,
  34698. b = (C / s) * y,
  34699. w = (I / s) * y;
  34700. if (s > this.qualityManager.maxRenderTargetSize) {
  34701. player.model.getHighImage(o, i.cubeFace, u, d);
  34702. } else {
  34703. e[a] ||
  34704. (e[a] = this.sceneRenderer.initSizedTexture2D(
  34705. a,
  34706. h.ClampToEdgeWrapping
  34707. ));
  34708. var _ = e[a];
  34709. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a);
  34710. if (1 === t || 2 === t) {
  34711. var T =
  34712. 1 === t
  34713. ? this.overlayTilesBasic
  34714. : this.overlayTilesEnhanced;
  34715. this.sceneRenderer.renderToCubeMap(
  34716. _,
  34717. A,
  34718. a,
  34719. a,
  34720. 0,
  34721. 0,
  34722. a,
  34723. a,
  34724. b,
  34725. w,
  34726. E,
  34727. E,
  34728. i.cubeFace
  34729. ),
  34730. this.sceneRenderer.renderToCubeMap(
  34731. T[s],
  34732. A,
  34733. a,
  34734. a,
  34735. 0,
  34736. 0,
  34737. a,
  34738. a,
  34739. b,
  34740. w,
  34741. E,
  34742. E,
  34743. i.cubeFace,
  34744. h.NormalBlending,
  34745. !0,
  34746. 0.5
  34747. );
  34748. } else
  34749. this.sceneRenderer.renderToCubeMap(
  34750. _,
  34751. A,
  34752. a,
  34753. a,
  34754. 0,
  34755. 0,
  34756. a,
  34757. a,
  34758. b,
  34759. w,
  34760. E,
  34761. E,
  34762. i.cubeFace
  34763. );
  34764. }
  34765. m.uploadCount++,
  34766. this.emit(f.TileRenderSuccess, r, s, l, c),
  34767. m.uploadCount === c &&
  34768. this.emit(f.PanoRenderComplete, r, s, c),
  34769. this.setUploaded(i, !0),
  34770. this.addCoverageForNode(i.node);
  34771. } else {
  34772. this.setUploaded(i, !1);
  34773. //console.log('uploadTile 失败', r, s, l)
  34774. //failHistory[''+r+s+l] = true;
  34775. }
  34776. return (
  34777. i.uploadAttempted ||
  34778. (m.uploadAttempts++,
  34779. this.emit(f.TileUploadAttempted, r, s, l, c)),
  34780. (i.uploadAttempted = !0),
  34781. m.uploadAttempts === c &&
  34782. this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  34783. g
  34784. );
  34785. };
  34786. })()),
  34787. (l.prototype.linkTileAndNode = function (e, t) {
  34788. (t.tile = e), (e.node = t);
  34789. }),
  34790. (l.prototype.linkAllTilesAndNodes = function (e) {
  34791. for (
  34792. var t = function (t, i, n, r, o) {
  34793. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  34794. this.linkTileAndNode(a, n);
  34795. },
  34796. i = 0;
  34797. i < C.FACES_PER_PANO;
  34798. i++
  34799. ) {
  34800. var n = this.getTileTree(e.id, i);
  34801. n.breadthFirst({
  34802. callback: t.bind(this, n, i),
  34803. });
  34804. }
  34805. }),
  34806. (l.prototype.anyUploaded = function (e) {
  34807. if (!e) return !1;
  34808. if (e.tile && this.isTileUploaded(e.tile)) return !0;
  34809. if (e.children)
  34810. for (var t = 0; t < e.children.length; t++) {
  34811. var i = e.children[t];
  34812. if (this.anyUploaded(i)) return !0;
  34813. }
  34814. return !1;
  34815. }),
  34816. (l.prototype.setNodeCovered = function (e, t) {
  34817. this.isPanoZoomed(e.tile.panoId)
  34818. ? (e.zoomCovered = t)
  34819. : (e.covered = t);
  34820. }),
  34821. (l.prototype.isNodeCovered = function (e) {
  34822. return (
  34823. !!e &&
  34824. (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  34825. );
  34826. }),
  34827. (l.prototype.addCoverageForNode = function (e) {
  34828. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  34829. var t = e.parent;
  34830. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0);
  34831. }
  34832. }),
  34833. (l.prototype.calcFullCoverage = function (e) {
  34834. var t = !1;
  34835. if (e.children)
  34836. for (var i = 0; i < e.children.length; i++) {
  34837. var n = e.children[i];
  34838. t = t || this.calcFullCoverage(n);
  34839. }
  34840. e.covered = e.tile.uploaded || t;
  34841. }),
  34842. (l.prototype.nodeSubcovered = function (e) {
  34843. if (!e.children) return !1;
  34844. for (var t = 0; t < e.children.length; t++)
  34845. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  34846. return !1;
  34847. return !0;
  34848. }),
  34849. (l.prototype.resetPanoDescriptor = function (e) {
  34850. this.getPanoDescriptor(e);
  34851. }),
  34852. (l.prototype.getPanoDescriptor = function (e) {
  34853. var t = this.panoDescriptors[e];
  34854. return t || ((t = {}), (this.panoDescriptors[e] = t)), t;
  34855. }),
  34856. (l.prototype.resetPanoLODDescriptors = function (e) {
  34857. var t = this.getPanoLODDescriptors(e);
  34858. for (var i in t)
  34859. if (t.hasOwnProperty(i)) {
  34860. var n = t[i];
  34861. (n.uploadCount = 0), (n.uploadAttempts = 0);
  34862. }
  34863. }),
  34864. (l.prototype.getPanoLODDescriptor = function (e, t) {
  34865. var i = this.getPanoLODDescriptors(e),
  34866. n = i[t];
  34867. return (
  34868. n ||
  34869. ((n = {
  34870. uploadCount: 0,
  34871. uploadAttempts: 0,
  34872. }),
  34873. (i[t] = n)),
  34874. n
  34875. );
  34876. }),
  34877. (l.prototype.getPanoLODDescriptors = function (e) {
  34878. var t = this.panoLODDescriptors[e];
  34879. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t;
  34880. }),
  34881. (l.prototype.onTileDownloaded = function (e) {
  34882. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  34883. i = this.getTileDirectoryEntry(
  34884. e.panoId,
  34885. e.face,
  34886. t,
  34887. e.faceTileIndex
  34888. );
  34889. if (
  34890. ((i.downloaded = !0),
  34891. (i.image = e.image),
  34892. (i.panoSize = e.panoSize),
  34893. (i.tileX = e.tileX),
  34894. (i.tileY = e.tileY),
  34895. (i.totalTiles = e.totalTiles),
  34896. (i.tileIndex = e.tileIndex),
  34897. (i.faceTileIndex = e.faceTileIndex),
  34898. (i.face = e.face),
  34899. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  34900. (i.panoId = e.panoId),
  34901. (i.tileSize = e.tileSize),
  34902. (i.direction = new h.Vector3().copy(e.direction)),
  34903. (i.node = null),
  34904. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  34905. this.isPanoActive(i.panoId))
  34906. ) {
  34907. var n = this.getTileTree(i.panoId, i.face),
  34908. r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  34909. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0);
  34910. }
  34911. }),
  34912. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  34913. var r = this.tileDirectory[e];
  34914. r || ((r = {}), (this.tileDirectory[e] = r));
  34915. var o = 16384 * t + 1024 * i + n,
  34916. a = r[o];
  34917. return (
  34918. a ||
  34919. ((a = {
  34920. downloaded: !1,
  34921. uploaded: !1,
  34922. zoomUploaded: !1,
  34923. }),
  34924. (r[o] = a)),
  34925. (a._key = e + ":" + t + ":" + i + ":" + n),
  34926. (a._tileKey = o),
  34927. a
  34928. );
  34929. }),
  34930. (l.prototype.setZoomingActive = function (e, t, i) {
  34931. this.zoomPanoRenderingDisabled ||
  34932. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  34933. ((this.zoomingActive = e),
  34934. (this.zoomPanoId = t.id),
  34935. this.zoomingActive &&
  34936. (this.zoomPanoId !== t.id || i) &&
  34937. this.updateZoomedPanoFromBase(t));
  34938. }),
  34939. (l.prototype.updateZoomedPanoFromBase = function (e) {
  34940. if (!this.zoomPanoRenderingDisabled) {
  34941. var t = this.getActiveRenderTargetDescriptor(e.id);
  34942. if (t && t.renderTarget) {
  34943. var i = Math.min(
  34944. this.qualityManager.maxRenderTargetSize,
  34945. this.qualityManager.getMaxZoomPanoSize()
  34946. ), //this.qualityManager.getMaxZoomPanoSize()
  34947. n = t.renderTarget,
  34948. r = t.size;
  34949. this.sceneRenderer.copyCubeMap(
  34950. n.texture,
  34951. this.zoomRenderTarget,
  34952. r,
  34953. r,
  34954. i,
  34955. i
  34956. ),
  34957. this.copyBaseRenderStatusToZoomed(e.id);
  34958. }
  34959. }
  34960. }),
  34961. (t.exports = l);
  34962. },
  34963. {
  34964. "../enum/GLCubeFaces": 25,
  34965. "../enum/PanoRendererEvents": 35,
  34966. "../enum/PanoSizeClass": 36,
  34967. "../enum/SceneRendererEvents": 43,
  34968. "../enum/TileDownloaderEvents": 45,
  34969. "../enum/Vectors": 50,
  34970. "../exception/BasicException": 55,
  34971. "../objects/Panorama": 148,
  34972. "../settings": 166,
  34973. "../util/browser": 182,
  34974. "../util/panorama": 191,
  34975. "./TileDownloader": 171,
  34976. "./TilePrioritizer": 172,
  34977. "./TileTree": 173,
  34978. "./TileUtils": 174,
  34979. events: 202,
  34980. three: 217,
  34981. },
  34982. ],
  34983. 170: [
  34984. function (e, t, i) {
  34985. "use strict";
  34986. function n(e, t, i) {
  34987. (this.maxNavPanoSize = -1),
  34988. (this.maxZoomPanoSize = -1),
  34989. (this.devicePixelDensity = e),
  34990. (this.deviceScreenSize = t),
  34991. (this.clientBandwidth = i),
  34992. (this.panoSizeClassMap = {}),
  34993. (this.useHighResolutionPanos = !0),
  34994. (this.useUltraHighResolutionPanos = !1),
  34995. (this.modelHasUltraHighPanos = !1);
  34996. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096; //add
  34997. }
  34998. var r = e("../enum/PanoSizeClass"),
  34999. o = e("../settings"),
  35000. a = e("../util/browser"),
  35001. s = e("../constants"),
  35002. l = e("../util/showcase"),
  35003. c = e("../enum/ModelManagerEvents");
  35004. (n.prototype.init = function (e) {
  35005. this.buildPanoSizeClassMap(
  35006. this.devicePixelDensity,
  35007. this.deviceScreenSize,
  35008. this.clientBandwidth
  35009. ),
  35010. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  35011. (this.highSize = this.getPanoSize(r.HIGH)),
  35012. (this.standardSize = this.getPanoSize(r.STANDARD)),
  35013. (this.baseSize = this.getPanoSize(r.BASE)),
  35014. o.tiling.maxZoomPanoQuality &&
  35015. this.ultraHighSize <= o.tiling.maxZoomPanoQuality &&
  35016. (o.tiling.allowUltraHighResolution = !0),
  35017. (this.highQualityThreshold = a.valueFromHash(
  35018. "threshold2k",
  35019. s.windowHeightHighQualityThreshold
  35020. )),
  35021. this.updateMaximums(),
  35022. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this));
  35023. }),
  35024. (n.prototype.updateFromModel = function (e) {
  35025. this.updateHighResolutionSettings(e),
  35026. this.updateUltraHighResolutionSettings(e);
  35027. }),
  35028. (n.prototype.updateHighResolutionSettings = function (e) {
  35029. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  35030. l.modelDataPromisesTiles(e.data)
  35031. ? (this.useHighResolutionPanos = !0)
  35032. : (this.useHighResolutionPanos = !1),
  35033. //this.useHighResolutionPanos = !0;
  35034. //----------------------e n d -----------------------------------------------------------------
  35035. this.updateMaximums();
  35036. }),
  35037. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  35038. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos
  35039. ? (this.useUltraHighResolutionPanos = !0)
  35040. : (this.useUltraHighResolutionPanos = !1),
  35041. this.updateMaximums();
  35042. }),
  35043. (n.prototype.enableUltraHighQualityMode = function () {
  35044. (this.modelHasUltraHighPanos = !0),
  35045. this.updateUltraHighResolutionSettings(null);
  35046. }),
  35047. (n.prototype.ultraHighQualityModeEnabled = function () {
  35048. return this.modelHasUltraHighPanos;
  35049. }),
  35050. (n.prototype.onModelChanged = function (e) {
  35051. this.updateFromModel(e.model), this.updateMaximums();
  35052. }),
  35053. (n.prototype.updateMaximums = function () {
  35054. (this.maxNavPanoSize =
  35055. o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  35056. (this.maxZoomPanoSize =
  35057. o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  35058. this.maxZoomPanoSize < this.maxNavPanoSize &&
  35059. (this.maxNavPanoSize = this.maxZoomPanoSize);
  35060. }),
  35061. (n.prototype.buildPanoSizeClassMap = function () {
  35062. (this.panoSizeClassMap[r.BASE] = 512),
  35063. (this.panoSizeClassMap[r.STANDARD] = 1024),
  35064. (this.panoSizeClassMap[r.HIGH] = 2048),
  35065. (this.panoSizeClassMap[r.ULTRAHIGH] = 4096);
  35066. }),
  35067. (n.prototype.getPanoSize = function (e) {
  35068. return this.panoSizeClassMap[e];
  35069. }),
  35070. (n.prototype.getMaxPossiblePanoSize = function () {
  35071. return this.getPanoSize(r.ULTRAHIGH);
  35072. }),
  35073. (n.prototype.getMaxPanoSize = function () {
  35074. return this.maxZoomPanoSize;
  35075. }),
  35076. (n.prototype.getMaxNavPanoSize = function () {
  35077. return this.maxNavPanoSize;
  35078. }),
  35079. (n.prototype.getMaxZoomPanoSize = function () {
  35080. return this.maxZoomPanoSize;
  35081. }),
  35082. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  35083. if(settings.mobileNavHigh)return r.HIGH //改
  35084. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  35085. } */
  35086. (n.prototype.detectDevice = function () {
  35087. //add
  35088. if (a.isMobile()) {
  35089. let area = $("#player").width() * $("#player").height();
  35090. if (area < 768 * 1024) {
  35091. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  35092. return "mobile";
  35093. } else {
  35094. return "bigMobile";
  35095. }
  35096. } else {
  35097. return "pc";
  35098. }
  35099. });
  35100. (n.prototype.detectMaxNavPanoSizeClass = function () {
  35101. //xzw 改
  35102. switch (this.getNavZoomClass()) {
  35103. case "1k":
  35104. return r.STANDARD;
  35105. break;
  35106. case "2k":
  35107. default:
  35108. return r.HIGH;
  35109. case "4k":
  35110. return r.ULTRAHIGH;
  35111. }
  35112. }),
  35113. (n.prototype.detectMaxNavPanoSize = function () {
  35114. var e = this.detectMaxNavPanoSizeClass();
  35115. return this.getPanoSize(e);
  35116. }),
  35117. (n.prototype.getMaxZoomClass = function () {
  35118. //add
  35119. let type = this.detectDevice();
  35120. let setting = settings.tileClass[type]; //见manage.js的settings
  35121. return setting.max;
  35122. });
  35123. (n.prototype.getNavZoomClass = function () {
  35124. //add
  35125. let type = this.detectDevice();
  35126. let setting = settings.tileClass[type];
  35127. return setting.nav;
  35128. }),
  35129. (n.prototype.detectMaxZoomPanoSize = function () {
  35130. //获取当前zoomRenderTarget应下载的最高级别
  35131. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  35132. if (this.zoomLevelResolution) {
  35133. //有三个级别
  35134. if (
  35135. this.zoomLevelResolution == "4k" &&
  35136. this.useUltraHighResolutionPanos
  35137. ) {
  35138. return this.getPanoSize(r.ULTRAHIGH);
  35139. } else if (
  35140. this.zoomLevelResolution == "1k" ||
  35141. !this.useHighResolutionPanos
  35142. ) {
  35143. return this.getPanoSize(r.STANDARD);
  35144. } else {
  35145. return this.getPanoSize(r.HIGH);
  35146. }
  35147. } else {
  35148. let tileClass = this.getMaxZoomClass();
  35149. if (tileClass == "1k") return this.getPanoSize(r.STANDARD);
  35150. if (tileClass == "4k" && this.useUltraHighResolutionPanos) {
  35151. return this.getPanoSize(r.ULTRAHIGH);
  35152. } else {
  35153. //'2k'
  35154. return this.getPanoSize(r.HIGH);
  35155. }
  35156. }
  35157. }),
  35158. /* n.prototype.detectMaxZoomPanoSize = function() {
  35159. return this.useHighResolutionPanos ? a.isMobile() ? o.tiling.mobileHighQualityOverride ? this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD) : this.useUltraHighResolutionPanos ? this.getPanoSize(r.ULTRAHIGH) : this.getPanoSize(r.HIGH) : this.getPanoSize(r.STANDARD)
  35160. } */
  35161. (t.exports = n);
  35162. },
  35163. {
  35164. "../constants": 8,
  35165. "../enum/ModelManagerEvents": 33,
  35166. "../enum/PanoSizeClass": 36,
  35167. "../settings": 166,
  35168. "../util/browser": 182,
  35169. "../util/showcase": 193,
  35170. },
  35171. ],
  35172. 171: [
  35173. function (e, t, i) {
  35174. (function (i) {
  35175. "use strict";
  35176. function n(e) {
  35177. (this.panos = null),
  35178. (this.retryMinimumTime = 1e4),
  35179. (this.urls = null),
  35180. (this.panoLoadCallbacks = {}),
  35181. (this.downloadDescriptors = {}),
  35182. (this.priorityQueue = []),
  35183. (this.forceQueue = []),
  35184. (this.activeDownloads = []),
  35185. (this.qualityManager = null),
  35186. (this.tilePrioritizer = null),
  35187. (this.refreshInterval = null),
  35188. (this.processPriorityQueue = !1),
  35189. (this.concurrentDownloads = e.concurrentDownloads || 1),
  35190. (this.downloadTestResults = {});
  35191. }
  35192. var r = e("three"),
  35193. o = (e("../enum/Viewmode"), e("../settings")),
  35194. a = (e("../objects/Panorama"), e("../util/logger")),
  35195. s =
  35196. (e("../enum/Vectors"),
  35197. e("../enum/PanoSizeClass"),
  35198. e("../enum/TileDownloaderEvents")),
  35199. l = e("./TilePrioritizer"),
  35200. c = e("./TileUtils"),
  35201. h = (e("../enum/GLCubeFaces"), e("../enum/DownloadStatus")),
  35202. u = e("../util/panorama"),
  35203. d = e("../util/ajax"),
  35204. p = e("../ab"),
  35205. f = e("events").EventEmitter,
  35206. g =
  35207. (new a(i),
  35208. Object.freeze({
  35209. Testing: 1,
  35210. Success: 2,
  35211. Fail: 3,
  35212. }));
  35213. (n.prototype = Object.create(f.prototype)),
  35214. (n.IDLE_REFRESH_DELAY = 500),
  35215. (n.ACTIVE_REFRESH_DELAY = 16),
  35216. (n.DOWNLOAD_RETRIES = 4),
  35217. (n.prototype.init = function (e) {
  35218. this.qualityManager = e;
  35219. }),
  35220. (n.prototype.setUrls = function (e) {
  35221. this.urls = e;
  35222. }),
  35223. (n.prototype.setPanoData = function (e, t, i) {
  35224. (this.panos = e), (this.imagePanos = t), (this.panoGroupId = i);
  35225. }),
  35226. (n.prototype.start = function () {
  35227. this.refreshUpdateInterval(0);
  35228. }),
  35229. (n.prototype.stop = function () {
  35230. window.cancel(this.refreshInterval);
  35231. }),
  35232. (n.prototype.refreshUpdateInterval = function (e) {
  35233. e || (e = 0),
  35234. (this.refreshInterval = window.setTimeout(
  35235. function () {
  35236. var e = this.update();
  35237. e
  35238. ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY)
  35239. : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY);
  35240. }.bind(this),
  35241. e
  35242. ));
  35243. }),
  35244. (n.prototype.update = function () {
  35245. var e = this.forceQueue.length > 0;
  35246. return (
  35247. this.processQueueForDownloading(this.forceQueue),
  35248. this.processPriorityQueue &&
  35249. (this.queuePrioritizedTilesForPanos(this.panos),
  35250. this.priorityQueue.length > 0 && (e = !0),
  35251. this.processQueueForDownloading(this.priorityQueue)),
  35252. e
  35253. );
  35254. }),
  35255. (n.prototype.forceQueueTilesForPano = (function () {
  35256. var e = [],
  35257. t = [];
  35258. return function (i, n, r, o, a, s) {
  35259. e.length = 0;
  35260. for (
  35261. var u = this.getTileDownloadDescriptors(i, n), d = 0;
  35262. d < u.length;
  35263. d++
  35264. ) {
  35265. var p = u[d];
  35266. (p.status !== h.None && p.status !== h.Queued) || e.push(p);
  35267. }
  35268. if (r && e.length > 0) {
  35269. l.sortPanoTiles(e, i, r),
  35270. (t.length = 0),
  35271. c.matchingTilesInDirection(i, n, r, o, a, t);
  35272. for (
  35273. var f = 0,
  35274. g = function (e) {
  35275. return (
  35276. e.face === m.face &&
  35277. e.faceTileIndex === m.faceTileIndex
  35278. );
  35279. };
  35280. f < e.length;
  35281. ) {
  35282. var m = e[f],
  35283. v = t.findIndex(g);
  35284. v < 0 ? e.splice(f, 1) : f++;
  35285. }
  35286. }
  35287. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A]);
  35288. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  35289. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  35290. s && this.processQueueForDownloading(this.forceQueue, !0);
  35291. };
  35292. })()),
  35293. (n.prototype.clearForceQueue = function () {
  35294. this.clearQueue(this.forceQueue);
  35295. }),
  35296. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  35297. this.tilePrioritizer &&
  35298. (this.clearQueue(this.priorityQueue),
  35299. this.tilePrioritizer.filterAndPrioritize(
  35300. this.priorityQueue,
  35301. e,
  35302. this
  35303. ),
  35304. this.clearFromQueue(this.priorityQueue, h.None, !0),
  35305. this.setStatusOrRemoveForAllDescriptors(
  35306. this.priorityQueue,
  35307. h.Queued
  35308. ));
  35309. }),
  35310. (n.prototype.clearQueue = function (e) {
  35311. this.setStatusForAllDescriptors(e, h.None), (e.length = 0);
  35312. }),
  35313. (n.prototype.clearFromQueue = function (e, t, i) {
  35314. for (var n = 0; n < e.length; n++) {
  35315. var r = e[n];
  35316. r &&
  35317. ((t === r.status && !i) || (t !== r.status && i)) &&
  35318. (e[n] = null);
  35319. }
  35320. }),
  35321. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  35322. for (var i = 0; i < e.length; i++) {
  35323. var n = e[i];
  35324. n && (n.status = t);
  35325. }
  35326. }),
  35327. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  35328. for (var i = 0; i < e.length; i++) {
  35329. var n = e[i];
  35330. n && (n.status !== t ? (n.status = t) : (e[i] = null));
  35331. }
  35332. }),
  35333. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  35334. var i = this.getAllTileDownloadDescriptorsForPano(e),
  35335. n = i[t];
  35336. return (
  35337. n ||
  35338. ((n = this.buildDownloadDescriptorArray(t)),
  35339. (i[t] = n),
  35340. this.initTileDownloadDescriptors(n, e, t)),
  35341. n
  35342. );
  35343. }),
  35344. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  35345. var t = this.downloadDescriptors[e.id];
  35346. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t;
  35347. }),
  35348. (n.prototype.processQueueForDownloading = function (e, t) {
  35349. if (
  35350. (this.cleanupActiveDownloads(),
  35351. this.activeDownloads.length < this.concurrentDownloads || t)
  35352. )
  35353. for (
  35354. var i = t
  35355. ? e.length
  35356. : this.concurrentDownloads - this.activeDownloads.length,
  35357. n = 0,
  35358. r = 0;
  35359. n < i && e.length > 0;
  35360. r++
  35361. ) {
  35362. var o = e.shift();
  35363. o && (this.startDownload(o), n++);
  35364. }
  35365. }),
  35366. (n.prototype.testDownload = function (e, t, i) {
  35367. var n = this.downloadTestResults[e];
  35368. if (n)
  35369. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  35370. this.downloadTestResults[e] = g.Testing;
  35371. var r = this.panos.list[0],
  35372. o = this.getTileUrl(r.id, e, t, 0),
  35373. a = function (t) {
  35374. (this.downloadTestResults[e] = g.Success), i(!0);
  35375. }.bind(this),
  35376. s = function () {
  35377. (this.downloadTestResults[e] = g.Fail), i(!1);
  35378. }.bind(this);
  35379. this.loadImage(o, 0, a, s);
  35380. }),
  35381. (n.prototype.startDownload = function (e) {
  35382. e.status = h.Downloading;
  35383. var t = this.getTileUrl(
  35384. e.pano.id,
  35385. e.panoSize,
  35386. e.tileSize,
  35387. e.tileIndex
  35388. );
  35389. this.activeDownloads.push(e),
  35390. this.loadImage(
  35391. t,
  35392. n.DOWNLOAD_RETRIES,
  35393. this.downloadComplete.bind(this, e),
  35394. this.downloadFailed.bind(this, e)
  35395. );
  35396. }),
  35397. (n.prototype.downloadFailed = function (e, t) {}),
  35398. (n.prototype.downloadComplete = function (e, t) {
  35399. if (e.panoGroupId === this.panoGroupId) {
  35400. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  35401. (e.status = h.Downloaded),
  35402. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  35403. var n = {
  35404. panoId: e.pano.id,
  35405. image: t,
  35406. tileSize: e.tileSize,
  35407. panoSize: e.panoSize,
  35408. tileIndex: e.tileIndex,
  35409. faceTileIndex: e.faceTileIndex,
  35410. totalTiles: e.totalTiles,
  35411. face: e.face,
  35412. tileX: e.tileX,
  35413. tileY: e.tileY,
  35414. direction: e.direction,
  35415. };
  35416. (e.image = t),
  35417. this.emit(s.TileDownloadSuccess, n),
  35418. this.isPanoDownloaded(e.pano, e.panoSize) &&
  35419. ((n = {
  35420. panoId: e.pano.id,
  35421. tileSize: e.tileSize,
  35422. panoSize: e.panoSize,
  35423. }),
  35424. this.emit(s.PanoDownloadComplete, n),
  35425. i && i.onLoad && i.onLoad(e.pano, e.panoSize));
  35426. }
  35427. }),
  35428. (n.prototype.cleanupActiveDownloads = (function () {
  35429. var e = [];
  35430. return function () {
  35431. e.length = 0;
  35432. for (var t = 0; t < this.activeDownloads.length; t++) {
  35433. var i = this.activeDownloads[t];
  35434. i.status !== h.Downloaded &&
  35435. i.status !== h.Failed &&
  35436. e.push(i);
  35437. }
  35438. (this.activeDownloads.length = 0),
  35439. this.activeDownloads.push.apply(this.activeDownloads, e);
  35440. };
  35441. })()),
  35442. (n.prototype.isPanoDownloaded = function (e, t) {
  35443. var i = this.getTileDownloadDescriptors(e, t);
  35444. if (i.length <= 0) return !1;
  35445. for (var n = 0; n < i.length; n++) {
  35446. var r = i[n];
  35447. if (r.status !== h.Downloaded) return !1;
  35448. }
  35449. return !0;
  35450. }),
  35451. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  35452. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  35453. this.panoLoadCallbacks[o] = {
  35454. onLoad: i,
  35455. onFail: n,
  35456. onProgress: r,
  35457. };
  35458. }),
  35459. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  35460. var i = e.id + ":" + t;
  35461. return this.panoLoadCallbacks[i];
  35462. }),
  35463. (n.prototype.buildDownloadDescriptorArray = function (e) {
  35464. for (
  35465. var t = c.getTileCountForSize(e), i = [], n = 0;
  35466. n < t;
  35467. n++
  35468. ) {
  35469. var r = this.buildDownloadDescriptor();
  35470. i.push(r);
  35471. }
  35472. return i;
  35473. }),
  35474. (n.prototype.buildDownloadDescriptor = function () {
  35475. var e = {
  35476. panoGroupId: null,
  35477. pano: null,
  35478. panoSize: -1,
  35479. tileSize: -1,
  35480. tileIndex: -1,
  35481. totalTiles: -1,
  35482. faceTileIndex: -1,
  35483. status: h.None,
  35484. url: null,
  35485. image: null,
  35486. direction: new r.Vector3(),
  35487. face: -1,
  35488. cubeFace: -1,
  35489. tileX: -1,
  35490. tileY: -1,
  35491. };
  35492. return e;
  35493. }),
  35494. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  35495. for (var n = 0; n < e.length; n++) {
  35496. var r = e[n];
  35497. this.initTileDownloadDescriptor(r, t, i, n);
  35498. }
  35499. }),
  35500. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  35501. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  35502. (e.face = c.getFaceForTile(i, n)),
  35503. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  35504. (e.panoGroupId = this.panoGroupId),
  35505. (e.pano = t),
  35506. (e.panoSize = i),
  35507. (e.tileSize = r),
  35508. (e.tileIndex = n),
  35509. (e.totalTiles = c.getTileCountForSize(i)),
  35510. (e.status = h.None),
  35511. (e.image = null),
  35512. c.getTileLocation(e.panoSize, e.tileIndex, e),
  35513. c.getTileVector(
  35514. e.panoSize,
  35515. e.tileSize,
  35516. e.cubeFace,
  35517. e.tileX,
  35518. e.tileY,
  35519. c.LocationOnTile.Center,
  35520. 0,
  35521. e.direction
  35522. );
  35523. }),
  35524. (n.prototype.getTileUrl = (function () {
  35525. var e = {
  35526. 256: "256",
  35527. 512: "512",
  35528. 1024: "1k",
  35529. 2048: "2k",
  35530. 4096: "4k",
  35531. },
  35532. t = {
  35533. face: -1,
  35534. faceTileIndex: -1,
  35535. tileX: -1,
  35536. tileY: -1,
  35537. };
  35538. return function (i, n, r, a) {
  35539. c.getTileLocation(n, a, t);
  35540. var s = Math.floor(n / r),
  35541. l = s * s,
  35542. h = Math.floor(a / l),
  35543. u = "";
  35544. 1 === o.tiling.customCompression &&
  35545. (u = "_" + o.tiling["q" + e[n]]);
  35546. var d = this.urls.get(
  35547. "tiles/" +
  35548. i +
  35549. "/" +
  35550. e[n] +
  35551. u +
  35552. "_face" +
  35553. h +
  35554. "_" +
  35555. t.tileX +
  35556. "_" +
  35557. t.tileY +
  35558. ".jpg"
  35559. );
  35560. return (d = p.changeIfTileGenerating(d));
  35561. };
  35562. })()),
  35563. (n.prototype.loadImage = function (e, t, i, n) {
  35564. d.getImage(e, t)
  35565. .then(function (e) {
  35566. i(e);
  35567. })
  35568. .fail(n);
  35569. }),
  35570. (t.exports = n);
  35571. }).call(this, "/js/tile/TileDownloader.js");
  35572. },
  35573. {
  35574. "../ab": 3,
  35575. "../enum/DownloadStatus": 24,
  35576. "../enum/GLCubeFaces": 25,
  35577. "../enum/PanoSizeClass": 36,
  35578. "../enum/TileDownloaderEvents": 45,
  35579. "../enum/Vectors": 50,
  35580. "../enum/Viewmode": 51,
  35581. "../objects/Panorama": 148,
  35582. "../settings": 166,
  35583. "../util/ajax": 181,
  35584. "../util/logger": 189,
  35585. "../util/panorama": 191,
  35586. "./TilePrioritizer": 172,
  35587. "./TileUtils": 174,
  35588. events: 202,
  35589. three: 217,
  35590. },
  35591. ],
  35592. 172: [
  35593. function (e, t, i) {
  35594. (function (i) {
  35595. "use strict";
  35596. function n(e, t, i, o, a) {
  35597. (this.qualityManager = e),
  35598. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  35599. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  35600. (this.baseSize = t),
  35601. (this.standardSize = i),
  35602. (this.highSize = o),
  35603. (this.ultraHighSize = a),
  35604. (this.priorityCriteria = new n.PriorityCriteria(
  35605. null,
  35606. new r.Vector3(0, 0, 0),
  35607. new r.Vector3(0, 0, -1),
  35608. new r.Vector3(0, 0, -1)
  35609. ));
  35610. }
  35611. var r = e("three"),
  35612. o =
  35613. (e("../enum/Viewmode"),
  35614. e("../settings"),
  35615. e("../settings"),
  35616. e("../objects/Panorama")),
  35617. a = e("../util/logger"),
  35618. s =
  35619. (e("../enum/Vectors"),
  35620. e("../enum/PanoSizeClass"),
  35621. e("../enum/ModelManagerEvents"),
  35622. e("../enum/GLCubeFaces"),
  35623. e("../enum/DownloadStatus")),
  35624. l = (e("../util/browser"), e("./TileUtils")),
  35625. c = e("../util/math"),
  35626. h =
  35627. (e("events").EventEmitter,
  35628. new a(i),
  35629. Object.freeze({
  35630. None: 0,
  35631. DirectionalFOV: 1,
  35632. }));
  35633. (n.PriorityCriteria = function (e, t, i, n, o) {
  35634. (this.pano = e),
  35635. (this.cameraPosition = new r.Vector3().copy(t)),
  35636. (this.cameraDir = new r.Vector3().copy(i)),
  35637. (this.panoSpaceDir = new r.Vector3().copy(n)),
  35638. (this.upcomingPanos = o),
  35639. (this.copy = function (e) {
  35640. (this.pano = e.pano),
  35641. this.cameraPosition.copy(e.cameraPosition),
  35642. this.cameraDir.copy(e.cameraDir),
  35643. this.panoSpaceDir.copy(e.panoSpaceDir),
  35644. (this.upcomingPanos = o);
  35645. }),
  35646. (this.zoomingActive = !1);
  35647. }),
  35648. (n.DIRECTIONAL_FOV = 180),
  35649. (n.DIRECTIONAL_FOV_NARROW = 120),
  35650. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  35651. (n.MAX_SCORED_PANOS_TOADD = 2),
  35652. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  35653. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  35654. (n.appendQueue = function (e, t) {
  35655. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i]);
  35656. }),
  35657. (n.prototype.updateCriteria = function (e, t, i, n) {
  35658. (this.priorityCriteria.pano = e),
  35659. this.priorityCriteria.cameraPosition.copy(t),
  35660. this.priorityCriteria.cameraDir.copy(i),
  35661. (this.priorityCriteria.upcomingPanos = n),
  35662. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize());
  35663. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize();
  35664. if (!player.panoRenderer.isPanoZoomed(e.id)) {
  35665. //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  35666. this.maxNavQuality = Math.min(2048, this.maxNavQuality);
  35667. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality);
  35668. }
  35669. }),
  35670. (n.prototype.filterAndPrioritize = (function () {
  35671. var e = [],
  35672. t = [],
  35673. i = [];
  35674. return function (r, o, a) {
  35675. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  35676. this.populateScoredPanos(
  35677. this.priorityCriteria.pano,
  35678. o,
  35679. t,
  35680. this.priorityCriteria.cameraDir,
  35681. n.MAX_SCORED_PANOS_TOCONSIDER
  35682. );
  35683. var s = this.baseSize,
  35684. l = this.standardSize,
  35685. c = this.highSize,
  35686. h = this.ultraHighSize;
  35687. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  35688. this.priorityCriteria.upcomingPanos &&
  35689. this.queueTilesForPanos(
  35690. r,
  35691. this.priorityCriteria.upcomingPanos,
  35692. a,
  35693. s,
  35694. n.MAX_UPCOMING_PANOS_TOADD
  35695. ),
  35696. this.priorityCriteria.upcomingPanos &&
  35697. this.queueTilesForPanos(
  35698. r,
  35699. this.priorityCriteria.upcomingPanos,
  35700. a,
  35701. 1024,
  35702. n.MAX_UPCOMING_PANOS_TOADD
  35703. ), //更清晰些
  35704. (i.length = 0),
  35705. this.canDownloadSize(l) &&
  35706. this.queueTilesInDirectionForPano(
  35707. i,
  35708. a,
  35709. this.priorityCriteria.pano,
  35710. l,
  35711. this.priorityCriteria.cameraPosition,
  35712. this.priorityCriteria.cameraDir,
  35713. n.DIRECTIONAL_FOV_NARROW
  35714. ),
  35715. n.sortPanoTiles(
  35716. i,
  35717. this.priorityCriteria.pano,
  35718. this.priorityCriteria.cameraDir
  35719. ),
  35720. n.appendQueue(r, i),
  35721. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  35722. (i.length = 0),
  35723. this.canDownloadSize(c) &&
  35724. this.queueTilesInDirectionForPano(
  35725. i,
  35726. a,
  35727. this.priorityCriteria.pano,
  35728. c,
  35729. this.priorityCriteria.cameraPosition,
  35730. this.priorityCriteria.cameraDir,
  35731. n.DIRECTIONAL_FOV_NARROW
  35732. ),
  35733. this.canDownloadSize(h) &&
  35734. this.queueTilesInDirectionForPano(
  35735. i,
  35736. a,
  35737. this.priorityCriteria.pano,
  35738. h,
  35739. this.priorityCriteria.cameraPosition,
  35740. this.priorityCriteria.cameraDir,
  35741. n.DIRECTIONAL_FOV_NARROW
  35742. ),
  35743. n.sortPanoTiles(
  35744. i,
  35745. this.priorityCriteria.pano,
  35746. this.priorityCriteria.cameraDir
  35747. ),
  35748. n.appendQueue(r, i),
  35749. (i.length = 0),
  35750. this.canDownloadSize(l) &&
  35751. this.queueTilesInDirectionForPano(
  35752. i,
  35753. a,
  35754. this.priorityCriteria.pano,
  35755. l,
  35756. this.priorityCriteria.cameraPosition,
  35757. this.priorityCriteria.cameraDir,
  35758. n.DIRECTIONAL_FOV
  35759. ),
  35760. this.canDownloadSize(c) &&
  35761. this.queueTilesInDirectionForPano(
  35762. i,
  35763. a,
  35764. this.priorityCriteria.pano,
  35765. c,
  35766. this.priorityCriteria.cameraPosition,
  35767. this.priorityCriteria.cameraDir,
  35768. n.DIRECTIONAL_FOV
  35769. ),
  35770. this.canDownloadSize(h) &&
  35771. this.queueTilesInDirectionForPano(
  35772. i,
  35773. a,
  35774. this.priorityCriteria.pano,
  35775. h,
  35776. this.priorityCriteria.cameraPosition,
  35777. this.priorityCriteria.cameraDir,
  35778. n.DIRECTIONAL_FOV
  35779. ),
  35780. n.sortPanoTiles(
  35781. i,
  35782. this.priorityCriteria.pano,
  35783. this.priorityCriteria.cameraDir
  35784. ),
  35785. n.appendQueue(r, i),
  35786. this.queueTilesForPanos(r, e, a, s);
  35787. };
  35788. })()),
  35789. (n.prototype.canDownloadSize = function (e) {
  35790. return (
  35791. this.maxNavQuality >= e ||
  35792. (this.maxZoomQuality >= e && this.zoomingActive)
  35793. );
  35794. }),
  35795. (n.prototype.populateNeighborPanos = function (e, t, i) {
  35796. (i = i || []), (i.length = 0);
  35797. var n = t.getNeighbours(e);
  35798. for (var r in n)
  35799. if (n.hasOwnProperty(r)) {
  35800. var o = t.get(r);
  35801. i.push(o);
  35802. }
  35803. return i;
  35804. }),
  35805. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  35806. (i = i || []), (i.length = 0);
  35807. var s = [
  35808. o.filters.inPanoDirection(
  35809. e.position,
  35810. r,
  35811. n.DIRECTION_SCORE_STRICTNESS
  35812. ),
  35813. o.filters.not(e),
  35814. ],
  35815. l = [
  35816. o.scoreFunctions.distanceSquared(e),
  35817. o.scoreFunctions.direction(e.position, r),
  35818. ],
  35819. c = t.sortByScore(s, l);
  35820. if (c)
  35821. for (var h = 0; h < c.length && h < a; h++) {
  35822. var u = c[h].item;
  35823. i.push(u);
  35824. }
  35825. return i;
  35826. }),
  35827. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  35828. for (var o = 0, a = 0; a < t.length; a++) {
  35829. var s = t[a],
  35830. l = this.queueTilesForPano(e, i, s, n);
  35831. if (((o += l > 0 ? 1 : 0), r && o >= r)) break;
  35832. }
  35833. return o;
  35834. }),
  35835. (n.prototype.queueTilesForPano = (function () {
  35836. var e = {
  35837. filter: h.None,
  35838. };
  35839. return function (t, i, n, r) {
  35840. return this.filterAndQueueTileDownloadDescriptors(
  35841. t,
  35842. i,
  35843. n,
  35844. r,
  35845. e
  35846. );
  35847. };
  35848. })()),
  35849. (n.prototype.queueTilesForPanosInDirection = (function () {
  35850. var e = new r.Vector3();
  35851. return function (t, i, n, r, o, a, s, l) {
  35852. for (var h = 0, u = 0; u < n.length; u++) {
  35853. var d = n[u];
  35854. e.copy(d.position), e.sub(o), e.normalize();
  35855. var p = Math.max(Math.min(a.dot(e), 1), -1),
  35856. f = c.getFOVDotThreshold(s);
  35857. if (p >= f) {
  35858. var g = this.queueTilesInDirectionForPano(
  35859. t,
  35860. i,
  35861. d,
  35862. r,
  35863. o,
  35864. a,
  35865. s
  35866. );
  35867. if (((h += g > 0 ? 1 : 0), l && h >= l)) break;
  35868. }
  35869. }
  35870. return h;
  35871. };
  35872. })()),
  35873. (n.prototype.queueTilesInDirectionForPanos = function (
  35874. e,
  35875. t,
  35876. i,
  35877. n,
  35878. r,
  35879. o,
  35880. a,
  35881. s
  35882. ) {
  35883. for (var l = 0, c = 0; c < i.length; c++) {
  35884. var h = i[c],
  35885. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  35886. if (((l += u > 0 ? 1 : 0), s && l >= s)) break;
  35887. }
  35888. return l;
  35889. }),
  35890. (n.prototype.queueTilesInDirectionForPano = (function () {
  35891. var e = {
  35892. filter: h.DirectionalFOV,
  35893. direction: new r.Vector3(),
  35894. fov: 60,
  35895. },
  35896. t = new r.Vector3();
  35897. return function (i, n, r, o, a, s, c) {
  35898. return (
  35899. t.copy(s),
  35900. l.getRelativeDirection(r.quaternion, t),
  35901. e.direction.copy(t),
  35902. (e.fov = c),
  35903. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  35904. );
  35905. };
  35906. })()),
  35907. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  35908. var e = [];
  35909. return function (t, i, n, r, o) {
  35910. var a = i.getTileDownloadDescriptors(n, r);
  35911. (e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o);
  35912. for (var s = 0, l = 0; l < e.length; l++) {
  35913. var c = e[l];
  35914. c && (t.push(c), s++);
  35915. }
  35916. return s;
  35917. };
  35918. })()),
  35919. (n.prototype.filterTileDownloadDescriptors = (function () {
  35920. new r.Vector3();
  35921. return function (e, t, i, n) {
  35922. var r, o;
  35923. switch (n.filter) {
  35924. case h.DirectionalFOV:
  35925. for (r = 0; r < t.length; r++)
  35926. (o = t[r]),
  35927. l.isTileWithinFOV(
  35928. o.panoSize,
  35929. o.tileSize,
  35930. o.face,
  35931. o.tileX,
  35932. o.tileY,
  35933. n.direction,
  35934. n.fov
  35935. ) && i.push(o);
  35936. break;
  35937. default:
  35938. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o);
  35939. }
  35940. for (r = 0; r < i.length; r++)
  35941. (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null);
  35942. };
  35943. })()),
  35944. (n.prototype.canIncludeDescriptor = function (e) {
  35945. return e.status !== s.Downloading && e.status !== s.Downloaded;
  35946. }),
  35947. (n.prototype.canIncludePano = function (e, t) {
  35948. return !e.isLoaded(t);
  35949. }),
  35950. (n.getFOVDotThreshold = function (e) {
  35951. return Math.cos(r.Math.degToRad(e / 2));
  35952. });
  35953. var u = (function () {
  35954. var e = function e(t, i) {
  35955. var n = e._panoSpaceDir,
  35956. r = e._fovThreshold,
  35957. o = e._fovThresholdNarrow,
  35958. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  35959. s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  35960. return (
  35961. (t._dot = a),
  35962. (i._dot = s),
  35963. a >= r && s < r
  35964. ? -1
  35965. : a < r && s >= r
  35966. ? 1
  35967. : a >= o && s < o
  35968. ? -1
  35969. : a < o && s >= o
  35970. ? 1
  35971. : t.panoSize > i.panoSize
  35972. ? 1
  35973. : i.panoSize > t.panoSize
  35974. ? -1
  35975. : -(a - s)
  35976. );
  35977. };
  35978. return (
  35979. (e._panoSpaceDir = new r.Vector3()),
  35980. (e._fovThreshold = -1),
  35981. (e._fovThresholdNarrow = -1),
  35982. e
  35983. );
  35984. })();
  35985. (n.sortPanoTiles = function (e, t, i) {
  35986. u._panoSpaceDir.copy(i),
  35987. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  35988. (u._fovThresholdNarrow = c.getFOVDotThreshold(
  35989. n.DIRECTIONAL_FOV_NARROW
  35990. )),
  35991. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  35992. e.sort(u);
  35993. }),
  35994. (n.insertSortedPanoTile = function (e, t, i, r) {
  35995. u._panoSpaceDir.copy(r),
  35996. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  35997. (u._fovThresholdNarrow = c.getFOVDotThreshold(
  35998. n.DIRECTIONAL_FOV_NARROW
  35999. )),
  36000. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV));
  36001. for (var o = -1, a = 0; a < e.length; a++) {
  36002. var s = u(t, e[a]);
  36003. if (s <= 0) {
  36004. o = a;
  36005. break;
  36006. }
  36007. }
  36008. if (o === -1) e[e.length] = t;
  36009. else {
  36010. for (var h = e.length; h > o; h--) e[h] = e[h - 1];
  36011. e[o] = t;
  36012. }
  36013. }),
  36014. (n.prototype.setZoomingActive = function (e) {
  36015. e !== this.zoomingActive && (this.zoomingActive = e);
  36016. }),
  36017. (t.exports = n);
  36018. }).call(this, "/js/tile/TilePrioritizer.js");
  36019. },
  36020. {
  36021. "../enum/DownloadStatus": 24,
  36022. "../enum/GLCubeFaces": 25,
  36023. "../enum/ModelManagerEvents": 33,
  36024. "../enum/PanoSizeClass": 36,
  36025. "../enum/Vectors": 50,
  36026. "../enum/Viewmode": 51,
  36027. "../objects/Panorama": 148,
  36028. "../settings": 166,
  36029. "../util/browser": 182,
  36030. "../util/logger": 189,
  36031. "../util/math": 190,
  36032. "./TileUtils": 174,
  36033. events: 202,
  36034. three: 217,
  36035. },
  36036. ],
  36037. 173: [
  36038. function (e, t, i) {
  36039. "use strict";
  36040. function n(e, t) {
  36041. (this.levels = t),
  36042. (this.tileSize = e),
  36043. (this.root = null),
  36044. (this.allNodes = []),
  36045. a(this);
  36046. }
  36047. function r(e, t) {
  36048. (this.tree = e),
  36049. (this.parent = t),
  36050. (this.children = []),
  36051. (this.id = ++u);
  36052. }
  36053. function o(e, t, i, r, a, s, l, h) {
  36054. if (e) {
  36055. l = l || n.TraversalType.PreOrder;
  36056. var u = r * c + i;
  36057. if (
  36058. (l === n.TraversalType.PreOrder &&
  36059. (a && a(e, t, u, i, r), s && s.push(e)),
  36060. e.children && 0 !== e.children.length)
  36061. ) {
  36062. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  36063. for (var g = 0; g < c; g++)
  36064. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  36065. l === n.TraversalType.PostOrder &&
  36066. (a && a(e, t, u, i, r), s && s.push(e));
  36067. }
  36068. }
  36069. }
  36070. function a(e) {
  36071. e.root = s(e, null, 0);
  36072. }
  36073. function s(e, t, i) {
  36074. if (i > e.levels) return null;
  36075. var n = new r(e, t);
  36076. e.allNodes.push(n);
  36077. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1);
  36078. return n;
  36079. }
  36080. function l(e, t, i, n, r) {
  36081. if (!e) return null;
  36082. if (0 === i) return e;
  36083. if (!e.children || 0 === e.children.length) return null;
  36084. var o = Math.pow(c, i),
  36085. a = o / c,
  36086. s = n % a,
  36087. h = r % a,
  36088. u = Math.floor(r / a),
  36089. d = Math.floor(n / a),
  36090. p = u * c + d,
  36091. f = e.children[p];
  36092. return l(f, t + 1, i - 1, s, h);
  36093. }
  36094. var c =
  36095. (e("three"),
  36096. e("./TileUtils"),
  36097. e("../objects/Panorama"),
  36098. e("../util/panorama"),
  36099. e("events").EventEmitter,
  36100. 2),
  36101. h = c * c;
  36102. n.TraversalType = Object.freeze({
  36103. PreOrder: 0,
  36104. PostOrder: 1,
  36105. });
  36106. var u = 0;
  36107. (n.getLevelCountForSize = function (e, t) {
  36108. var i = 0;
  36109. for (t < e && (t = e); ; ) {
  36110. if (((t /= c), t < e)) break;
  36111. i++;
  36112. }
  36113. return i;
  36114. }),
  36115. (n.getSizeForLevel = function (e, t) {
  36116. return Math.pow(c, t) * e;
  36117. }),
  36118. (n.prototype.getSubNode = function (e, t, i) {
  36119. (!t || e < this.tileSize) && (t = 0),
  36120. (!i || e < this.tileSize) && (i = 0),
  36121. e < this.tileSize && (e = this.tileSize);
  36122. var r = n.getLevelCountForSize(this.tileSize, e),
  36123. o = l(this.root, 0, r, t, i);
  36124. return o;
  36125. }),
  36126. (n.prototype.breadthFirst = function (e) {
  36127. e = e || {};
  36128. var t = !!e.nullLevelEnd,
  36129. i = e.maxLevel,
  36130. n = e.minLevel,
  36131. r = e.callback,
  36132. o = e.saveVisited,
  36133. a = [],
  36134. s = {},
  36135. l = 0,
  36136. c = 0;
  36137. for (
  36138. a.push(this.root), a.push(s);
  36139. a.length > 0 && !(i && l > i);
  36140. ) {
  36141. var h = a.shift();
  36142. if (h === s)
  36143. (!n || l >= n) && (r && t && r(null), o && t && o.push(null)),
  36144. a.length > 0 && a.push(s),
  36145. l++,
  36146. (c = 0);
  36147. else {
  36148. if (h.children)
  36149. for (var u = 0; u < h.children.length; u++) {
  36150. var d = h.children[u];
  36151. d && a.push(h.children[u]);
  36152. }
  36153. var p = this.getFaceIndexFromNode(h);
  36154. (!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++;
  36155. }
  36156. }
  36157. }),
  36158. (n.prototype.getFaceIndexFromNode = function (e) {
  36159. if (!e) return -1;
  36160. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  36161. var o = i.parent;
  36162. if (!o) break;
  36163. for (var a = -1, s = 0; s < o.children.length; s++)
  36164. o.children[s] === i && (a = s);
  36165. var l = a % c,
  36166. h = Math.floor(a / c);
  36167. (n = l * t + n), (r = h * t + r), (t *= c), (i = o);
  36168. }
  36169. return r * t + n;
  36170. }),
  36171. (n.prototype.depthFirst = function (e, t, i) {
  36172. o(this.root, 0, 0, 0, e, t, i, this.tileSize);
  36173. }),
  36174. (t.exports = n);
  36175. },
  36176. {
  36177. "../objects/Panorama": 148,
  36178. "../util/panorama": 191,
  36179. "./TileUtils": 174,
  36180. events: 202,
  36181. three: 217,
  36182. },
  36183. ],
  36184. 174: [
  36185. function (e, t, i) {
  36186. "use strict";
  36187. var n = e("../enum/GLCubeFaces"),
  36188. r = e("../util/MathLight"),
  36189. o = {};
  36190. (o.TILE_SIZE = 512),
  36191. (o.FACES_PER_PANO = 6),
  36192. (o.LocationOnTile = {
  36193. Center: 0,
  36194. UpperLeft: 1,
  36195. UpperRight: 2,
  36196. LowerRight: 3,
  36197. LowerLeft: 4,
  36198. }),
  36199. (o.getTileVector = (function () {
  36200. return function (e, t, i, a, s, l, c, h) {
  36201. l = l || o.LocationOnTile.Center;
  36202. var u = e / t,
  36203. d = a / u;
  36204. s = -s + (u - 1);
  36205. var p = s / u,
  36206. f = t / e,
  36207. g = 2 * f,
  36208. m = g / 2,
  36209. v = 2 * d - 1 + m,
  36210. A = 2 * p - 1 + m;
  36211. switch (l) {
  36212. case o.LocationOnTile.UpperLeft:
  36213. (v -= m), (A += m), (v += c * g);
  36214. break;
  36215. case o.LocationOnTile.UpperRight:
  36216. (v += m), (A += m), (A -= c * g);
  36217. break;
  36218. case o.LocationOnTile.LowerRight:
  36219. (v += m), (A -= m), (v -= c * g);
  36220. break;
  36221. case o.LocationOnTile.LowerLeft:
  36222. (v -= m), (A -= m), (A += c * g);
  36223. break;
  36224. case o.LocationOnTile.Center:
  36225. }
  36226. switch (i) {
  36227. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  36228. r.setVector(h, -1, A, -v);
  36229. break;
  36230. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  36231. r.setVector(h, 1, A, v);
  36232. break;
  36233. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  36234. r.setVector(h, -v, 1, -A);
  36235. break;
  36236. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  36237. r.setVector(h, -v, -1, A);
  36238. break;
  36239. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  36240. r.setVector(h, -v, A, 1);
  36241. break;
  36242. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  36243. r.setVector(h, v, A, -1);
  36244. }
  36245. r.normalize(h);
  36246. };
  36247. })()),
  36248. (o.getFaceForTile = function (e, t) {
  36249. var i = o.TILE_SIZE;
  36250. e < o.TILE_SIZE && (i = e);
  36251. var n = Math.floor(e / i),
  36252. r = n * n;
  36253. return Math.floor(t / r);
  36254. }),
  36255. (o.getTileLocation = function (e, t, i) {
  36256. var n = o.TILE_SIZE;
  36257. e < o.TILE_SIZE && (n = e);
  36258. var r = o.getFaceForTile(e, t),
  36259. a = Math.floor(e / n),
  36260. s = a * a,
  36261. l = t - r * s;
  36262. (i.tileX = l % a),
  36263. (i.tileY = Math.floor(l / a)),
  36264. (i.face = r),
  36265. (i.faceTileIndex = l);
  36266. }),
  36267. (o.getTileCountForSize = function (e) {
  36268. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO;
  36269. var t = Math.floor(e / o.TILE_SIZE),
  36270. i = t * t,
  36271. n = i * o.FACES_PER_PANO;
  36272. return n;
  36273. }),
  36274. (o.getRelativeDirection = (function () {
  36275. var e = new r.Matrix4(),
  36276. t = new r.Quaternion();
  36277. return function (i, n) {
  36278. t.copy(i),
  36279. t.inverse(),
  36280. e.makeRotationFromQuaternion(t),
  36281. e.applyToVector3(n),
  36282. r.normalize(n);
  36283. };
  36284. })()),
  36285. (o.matchingTilesInDirection = (function () {
  36286. var e = new r.Vector3(),
  36287. t = new r.Vector3(0, 0, -1),
  36288. i = new r.Quaternion(),
  36289. n = function (e, t) {
  36290. e.push({
  36291. face: t.face,
  36292. faceTileIndex: t.faceTileIndex,
  36293. tileX: t.tileX,
  36294. tileY: t.tileY,
  36295. });
  36296. },
  36297. a = (function () {
  36298. var e = {
  36299. face: -1,
  36300. faceTileIndex: -1,
  36301. tileX: -1,
  36302. tileY: -1,
  36303. };
  36304. return function (t, i, r) {
  36305. for (
  36306. var a = o.getTileCountForSize(t), s = 0, l = 0;
  36307. l < a;
  36308. l++
  36309. )
  36310. o.getTileLocation(t, l, e),
  36311. (i && !i(e)) || (s++, r && n(r, e));
  36312. return s;
  36313. };
  36314. })();
  36315. return function (n, s, l, c, h, u) {
  36316. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  36317. o.getTileCountForSize(s);
  36318. if (!c && !h) return a(s, null, u);
  36319. var p = !!h;
  36320. if (
  36321. ((h = h || c),
  36322. (h = Math.max(0, Math.min(h, 360))),
  36323. (c = Math.max(0, Math.min(c, 360))),
  36324. r.copyVector(l, e),
  36325. o.getRelativeDirection(n.quaternion, e),
  36326. p)
  36327. ) {
  36328. i.setFromUnitVectors(e, t);
  36329. var f = function (e) {
  36330. return o.isTileWithinFrustum(
  36331. s,
  36332. d,
  36333. e.face,
  36334. e.tileX,
  36335. e.tileY,
  36336. i,
  36337. c,
  36338. h
  36339. );
  36340. };
  36341. return a(s, f, u);
  36342. }
  36343. var g = function (t) {
  36344. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c);
  36345. };
  36346. return a(s, g, u);
  36347. };
  36348. })()),
  36349. (o.isTileWithinFrustum = (function () {
  36350. var e = new r.Vector3(),
  36351. t = 1e-5;
  36352. return function (i, n, a, s, l, c, h, u) {
  36353. for (
  36354. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  36355. p = -d,
  36356. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  36357. g = -f,
  36358. m = o.mapFaceToCubemapFace(a),
  36359. v = 0,
  36360. A = 0,
  36361. y = 0,
  36362. C = 0,
  36363. I = 0,
  36364. E = 0,
  36365. b = o.LocationOnTile.Center;
  36366. b <= o.LocationOnTile.LowerLeft;
  36367. b++
  36368. )
  36369. if (
  36370. (o.getTileVector(i, n, m, s, l, b, 0, e),
  36371. r.applyQuaternionToVector(c, e),
  36372. e.z >= -t)
  36373. )
  36374. I++;
  36375. else {
  36376. var w = -1 / e.z,
  36377. _ = e.x * w,
  36378. T = e.y * w;
  36379. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++;
  36380. }
  36381. return A !== E && v !== E && y !== E && C !== E;
  36382. };
  36383. })()),
  36384. (o.isTileWithinFOV = (function () {
  36385. var e = new r.Vector3(),
  36386. t = new r.Vector3(0, 1, 0),
  36387. i = new r.Vector3(1, 0, 0);
  36388. return function (n, a, s, l, c, h, u) {
  36389. var d = o.mapFaceToCubemapFace(s);
  36390. if (
  36391. (r.cross(h, t, i),
  36392. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  36393. o.isWithinFOV(e, h, u, null))
  36394. )
  36395. return !0;
  36396. for (
  36397. var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0;
  36398. m < f;
  36399. m++
  36400. ) {
  36401. for (
  36402. var v = o.LocationOnTile.UpperLeft;
  36403. v <= o.LocationOnTile.LowerLeft;
  36404. v++
  36405. )
  36406. if (
  36407. (o.getTileVector(n, a, d, l, c, v, g, e),
  36408. o.isWithinFOV(e, h, u, null))
  36409. )
  36410. return !0;
  36411. g += p;
  36412. }
  36413. return !1;
  36414. };
  36415. })()),
  36416. (o.isWithinFOV = (function () {
  36417. var e = new r.Vector3(),
  36418. t = new r.Vector3();
  36419. return function (i, n, o, a) {
  36420. if ((r.copyVector(i, t), a)) {
  36421. r.copyVector(a, e), r.normalize(e);
  36422. var s = r.dot(e, i);
  36423. (e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e);
  36424. }
  36425. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  36426. c = Math.cos(l),
  36427. h = r.dot(t, n);
  36428. return h >= c;
  36429. };
  36430. })()),
  36431. (o.mapFaceToCubemapFace = (function () {
  36432. var e = {
  36433. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  36434. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  36435. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  36436. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  36437. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  36438. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  36439. };
  36440. return function (t) {
  36441. return e[t];
  36442. };
  36443. })()),
  36444. (t.exports = o);
  36445. },
  36446. {
  36447. "../enum/GLCubeFaces": 25,
  36448. "../util/MathLight": 176,
  36449. },
  36450. ],
  36451. 175: [
  36452. function (e, t, i) {
  36453. (function (i) {
  36454. "use strict";
  36455. function n() {
  36456. (this.list = []),
  36457. (this.index = {}),
  36458. Object.defineProperty(this, "length", {
  36459. get: function () {
  36460. return this.list.length;
  36461. },
  36462. });
  36463. }
  36464. var r = (e("./common"), e("./logger"));
  36465. new r(i);
  36466. (n.prototype.forEach = function (e) {
  36467. this.list.forEach(e);
  36468. }),
  36469. (n.prototype.add = function (e) {
  36470. this.list.push(e), (this.index[this.getIndex(e)] = e);
  36471. }),
  36472. (n.prototype.getIndex = function (e) {
  36473. throw new Error(
  36474. "IndexedCollection.getIndex not implemented in subclass."
  36475. );
  36476. }),
  36477. (n.prototype.extend = function (e) {
  36478. for (var t = 0; t < e.length; t++) this.add(e[t]);
  36479. }),
  36480. (n.prototype.get = function (e) {
  36481. return this.index[e];
  36482. }),
  36483. (n.prototype.first = function () {
  36484. return this.list[0];
  36485. }),
  36486. (n.prototype.last = function () {
  36487. return this.list[this.list.length - 1];
  36488. }),
  36489. (n.prototype.reIndex = function () {
  36490. this.index = {};
  36491. var e = this;
  36492. this.forEach(function (t) {
  36493. e.index[e.getIndex(t)] = t;
  36494. });
  36495. }),
  36496. (n.prototype.filter = function (e) {
  36497. var t = this.list.filter(e);
  36498. return this.reIndex(), t;
  36499. }),
  36500. (n.prototype.reduce = function (e, t) {
  36501. return this.list.reduce(e, t);
  36502. }),
  36503. (n.prototype.sort = function (e) {
  36504. return this.list.sort(e);
  36505. }),
  36506. (n.prototype.indexOf = function (e) {
  36507. for (var t = 0; t < this.list.length; ++t)
  36508. if (this.list[t] === e) return t;
  36509. return -1;
  36510. }),
  36511. (t.exports = n);
  36512. }).call(this, "/js/util/IndexedCollection.js");
  36513. },
  36514. {
  36515. "./common": 185,
  36516. "./logger": 189,
  36517. },
  36518. ],
  36519. 176: [
  36520. function (e, t, i) {
  36521. "use strict";
  36522. var n = e("../constants"),
  36523. r = {};
  36524. (r.RADIANS_PER_DEGREE = Math.PI / 180),
  36525. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  36526. (r.Vector3 = function (e, t, i) {
  36527. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  36528. }),
  36529. (r.Matrix4 = function () {
  36530. (this.elements = new Float32Array([
  36531. 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
  36532. ])),
  36533. arguments.length > 0 &&
  36534. console.error(
  36535. "MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead."
  36536. );
  36537. }),
  36538. (r.Matrix4.prototype = {
  36539. identity: function () {
  36540. return (
  36541. this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  36542. );
  36543. },
  36544. copy: function (e) {
  36545. return this.elements.set(e.elements), this;
  36546. },
  36547. applyToVector3: function (e) {
  36548. var t = e.x,
  36549. i = e.y,
  36550. n = e.z,
  36551. r = this.elements;
  36552. return (
  36553. (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  36554. (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  36555. (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  36556. this
  36557. );
  36558. },
  36559. getInverse: function (e, t) {
  36560. var i = this.elements,
  36561. n = e.elements,
  36562. r = n[0],
  36563. o = n[1],
  36564. a = n[2],
  36565. s = n[3],
  36566. l = n[4],
  36567. c = n[5],
  36568. h = n[6],
  36569. u = n[7],
  36570. d = n[8],
  36571. p = n[9],
  36572. f = n[10],
  36573. g = n[11],
  36574. m = n[12],
  36575. v = n[13],
  36576. A = n[14],
  36577. y = n[15],
  36578. C =
  36579. p * A * u -
  36580. v * f * u +
  36581. v * h * g -
  36582. c * A * g -
  36583. p * h * y +
  36584. c * f * y,
  36585. I =
  36586. m * f * u -
  36587. d * A * u -
  36588. m * h * g +
  36589. l * A * g +
  36590. d * h * y -
  36591. l * f * y,
  36592. E =
  36593. d * v * u -
  36594. m * p * u +
  36595. m * c * g -
  36596. l * v * g -
  36597. d * c * y +
  36598. l * p * y,
  36599. b =
  36600. m * p * h -
  36601. d * v * h -
  36602. m * c * f +
  36603. l * v * f +
  36604. d * c * A -
  36605. l * p * A,
  36606. w = r * C + o * I + a * E + s * b;
  36607. if (0 === w) {
  36608. var _ =
  36609. "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  36610. if (t) throw new Error(_);
  36611. return console.warn(_), this.identity();
  36612. }
  36613. var T = 1 / w;
  36614. return (
  36615. (i[0] = C * T),
  36616. (i[1] =
  36617. (v * f * s -
  36618. p * A * s -
  36619. v * a * g +
  36620. o * A * g +
  36621. p * a * y -
  36622. o * f * y) *
  36623. T),
  36624. (i[2] =
  36625. (c * A * s -
  36626. v * h * s +
  36627. v * a * u -
  36628. o * A * u -
  36629. c * a * y +
  36630. o * h * y) *
  36631. T),
  36632. (i[3] =
  36633. (p * h * s -
  36634. c * f * s -
  36635. p * a * u +
  36636. o * f * u +
  36637. c * a * g -
  36638. o * h * g) *
  36639. T),
  36640. (i[4] = I * T),
  36641. (i[5] =
  36642. (d * A * s -
  36643. m * f * s +
  36644. m * a * g -
  36645. r * A * g -
  36646. d * a * y +
  36647. r * f * y) *
  36648. T),
  36649. (i[6] =
  36650. (m * h * s -
  36651. l * A * s -
  36652. m * a * u +
  36653. r * A * u +
  36654. l * a * y -
  36655. r * h * y) *
  36656. T),
  36657. (i[7] =
  36658. (l * f * s -
  36659. d * h * s +
  36660. d * a * u -
  36661. r * f * u -
  36662. l * a * g +
  36663. r * h * g) *
  36664. T),
  36665. (i[8] = E * T),
  36666. (i[9] =
  36667. (m * p * s -
  36668. d * v * s -
  36669. m * o * g +
  36670. r * v * g +
  36671. d * o * y -
  36672. r * p * y) *
  36673. T),
  36674. (i[10] =
  36675. (l * v * s -
  36676. m * c * s +
  36677. m * o * u -
  36678. r * v * u -
  36679. l * o * y +
  36680. r * c * y) *
  36681. T),
  36682. (i[11] =
  36683. (d * c * s -
  36684. l * p * s -
  36685. d * o * u +
  36686. r * p * u +
  36687. l * o * g -
  36688. r * c * g) *
  36689. T),
  36690. (i[12] = b * T),
  36691. (i[13] =
  36692. (d * v * a -
  36693. m * p * a +
  36694. m * o * f -
  36695. r * v * f -
  36696. d * o * A +
  36697. r * p * A) *
  36698. T),
  36699. (i[14] =
  36700. (m * c * a -
  36701. l * v * a -
  36702. m * o * h +
  36703. r * v * h +
  36704. l * o * A -
  36705. r * c * A) *
  36706. T),
  36707. (i[15] =
  36708. (l * p * a -
  36709. d * c * a +
  36710. d * o * h -
  36711. r * p * h -
  36712. l * o * f +
  36713. r * c * f) *
  36714. T),
  36715. this
  36716. );
  36717. },
  36718. makeRotationFromQuaternion: function (e) {
  36719. var t = this.elements,
  36720. i = e.x,
  36721. n = e.y,
  36722. r = e.z,
  36723. o = e.w,
  36724. a = i + i,
  36725. s = n + n,
  36726. l = r + r,
  36727. c = i * a,
  36728. h = i * s,
  36729. u = i * l,
  36730. d = n * s,
  36731. p = n * l,
  36732. f = r * l,
  36733. g = o * a,
  36734. m = o * s,
  36735. v = o * l;
  36736. return (
  36737. (t[0] = 1 - (d + f)),
  36738. (t[4] = h - v),
  36739. (t[8] = u + m),
  36740. (t[1] = h + v),
  36741. (t[5] = 1 - (c + f)),
  36742. (t[9] = p - g),
  36743. (t[2] = u - m),
  36744. (t[6] = p + g),
  36745. (t[10] = 1 - (c + d)),
  36746. (t[3] = 0),
  36747. (t[7] = 0),
  36748. (t[11] = 0),
  36749. (t[12] = 0),
  36750. (t[13] = 0),
  36751. (t[14] = 0),
  36752. (t[15] = 1),
  36753. this
  36754. );
  36755. },
  36756. }),
  36757. (r.Quaternion = function (e, t, i, n) {
  36758. (this._x = e || 0),
  36759. (this._y = t || 0),
  36760. (this._z = i || 0),
  36761. (this._w = void 0 !== n ? n : 1);
  36762. }),
  36763. (r.Quaternion.prototype = {
  36764. get x() {
  36765. return this._x;
  36766. },
  36767. set x(e) {
  36768. this._x = e;
  36769. },
  36770. get y() {
  36771. return this._y;
  36772. },
  36773. set y(e) {
  36774. this._y = e;
  36775. },
  36776. get z() {
  36777. return this._z;
  36778. },
  36779. set z(e) {
  36780. this._z = e;
  36781. },
  36782. get w() {
  36783. return this._w;
  36784. },
  36785. set w(e) {
  36786. this._w = e;
  36787. },
  36788. copy: function (e) {
  36789. (this._x = e.x),
  36790. (this._y = e.y),
  36791. (this._z = e.z),
  36792. (this._w = e.w);
  36793. },
  36794. inverse: function () {
  36795. return this.conjugate().normalize();
  36796. },
  36797. conjugate: function () {
  36798. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this;
  36799. },
  36800. length: function () {
  36801. return Math.sqrt(
  36802. this._x * this._x +
  36803. this._y * this._y +
  36804. this._z * this._z +
  36805. this._w * this._w
  36806. );
  36807. },
  36808. normalize: function () {
  36809. var e = this.length();
  36810. return (
  36811. 0 === e
  36812. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  36813. : ((e = 1 / e),
  36814. (this._x = this._x * e),
  36815. (this._y = this._y * e),
  36816. (this._z = this._z * e),
  36817. (this._w = this._w * e)),
  36818. this
  36819. );
  36820. },
  36821. setFromAxisAngle: function (e, t) {
  36822. var i = t / 2,
  36823. n = Math.sin(i);
  36824. return (
  36825. (this._x = e.x * n),
  36826. (this._y = e.y * n),
  36827. (this._z = e.z * n),
  36828. (this._w = Math.cos(i)),
  36829. this
  36830. );
  36831. },
  36832. setFromUnitVectors: (function () {
  36833. var e,
  36834. t,
  36835. i = 1e-6;
  36836. return function (n, o) {
  36837. return (
  36838. void 0 === e && (e = new r.Vector3()),
  36839. (t = r.dot(n, o) + 1),
  36840. t < i
  36841. ? ((t = 0),
  36842. Math.abs(n.x) > Math.abs(n.z)
  36843. ? r.setVector(e, -n.y, n.x, 0)
  36844. : r.setVector(e, 0, -n.z, n.y))
  36845. : r.cross(n, o, e),
  36846. (this._x = e.x),
  36847. (this._y = e.y),
  36848. (this._z = e.z),
  36849. (this._w = t),
  36850. this.normalize()
  36851. );
  36852. };
  36853. })(),
  36854. multiply: function (e) {
  36855. return this.multiplyQuaternions(this, e);
  36856. },
  36857. premultiply: function (e) {
  36858. return this.multiplyQuaternions(e, this);
  36859. },
  36860. multiplyQuaternions: function (e, t) {
  36861. var i = e._x,
  36862. n = e._y,
  36863. r = e._z,
  36864. o = e._w,
  36865. a = t._x,
  36866. s = t._y,
  36867. l = t._z,
  36868. c = t._w;
  36869. return (
  36870. (this._x = i * c + o * a + n * l - r * s),
  36871. (this._y = n * c + o * s + r * a - i * l),
  36872. (this._z = r * c + o * l + i * s - n * a),
  36873. (this._w = o * c - i * a - n * s - r * l),
  36874. this
  36875. );
  36876. },
  36877. }),
  36878. (r.convertWorkshopVector = function (e) {
  36879. return new r.Vector3(-e.x, e.y, e.z);
  36880. }),
  36881. (r.convertWorkshopQuaternion = function (e) {
  36882. return new r.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  36883. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  36884. );
  36885. });
  36886. (r.convertWorkshopOrthoZoom = function (e) {
  36887. //xzw
  36888. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  36889. return e === -1
  36890. ? -1
  36891. : ((e * ($("#player").width() / $("#player").height())) /
  36892. g_snapShotWidth) *
  36893. g_snapShotHeight;
  36894. }),
  36895. (r.convertWorkshopPanoramaQuaternion = function (e) {
  36896. return new r.Quaternion(e.x, -e.y, -e.z, e.w)
  36897. .normalize()
  36898. .multiply(
  36899. new r.Quaternion().setFromAxisAngle(
  36900. new r.Vector3(0, 1, 0),
  36901. 270 * r.RADIANS_PER_DEGREE
  36902. )
  36903. );
  36904. }),
  36905. (r.normalize = function (e) {
  36906. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  36907. i = Math.sqrt(t);
  36908. (e.x /= i), (e.y /= i), (e.z /= i);
  36909. }),
  36910. (r.dot = function (e, t) {
  36911. return e.x * t.x + e.y * t.y + e.z * t.z;
  36912. }),
  36913. (r.cross = function (e, t, i) {
  36914. var n = e.x,
  36915. r = e.y,
  36916. o = e.z;
  36917. (i.x = r * t.z - o * t.y),
  36918. (i.y = o * t.x - n * t.z),
  36919. (i.z = n * t.y - r * t.x);
  36920. }),
  36921. (r.setVector = function (e, t, i, n) {
  36922. (e.x = t), (e.y = i), (e.z = n);
  36923. }),
  36924. (r.copyVector = function (e, t) {
  36925. (t.x = e.x), (t.y = e.y), (t.z = e.z);
  36926. }),
  36927. (r.addVector = function (e, t) {
  36928. (e.x += t.x), (e.y += t.y), (e.z += t.z);
  36929. }),
  36930. (r.subVector = function (e, t) {
  36931. (e.x -= t.x), (e.y -= t.y), (e.z -= t.z);
  36932. }),
  36933. (r.applyQuaternionToVector = function (e, t) {
  36934. var i = t.x,
  36935. n = t.y,
  36936. r = t.z,
  36937. o = e.x,
  36938. a = e.y,
  36939. s = e.z,
  36940. l = e.w,
  36941. c = l * i + a * r - s * n,
  36942. h = l * n + s * i - o * r,
  36943. u = l * r + o * n - a * i,
  36944. d = -o * i - a * n - s * r;
  36945. (t.x = c * l + d * -o + h * -s - u * -a),
  36946. (t.y = h * l + d * -a + u * -o - c * -s),
  36947. (t.z = u * l + d * -s + c * -a - h * -o);
  36948. }),
  36949. (r.angleBetweenVectors = function (e, t) {
  36950. return Math.acos(r.dot(e, t));
  36951. }),
  36952. (t.exports = r);
  36953. },
  36954. {
  36955. "../constants": 8,
  36956. },
  36957. ],
  36958. 177: [
  36959. function (e, t, i) {
  36960. (function (i) {
  36961. "use strict";
  36962. function n(e) {
  36963. (this.cache = null), (this.expires = 0);
  36964. }
  36965. function r() {
  36966. (this.baseUrl = null), (this.cache = null), (this.expires = 0);
  36967. }
  36968. function o() {
  36969. (this.baseUrl = null), (this.expires = 0);
  36970. }
  36971. function a(e) {
  36972. (this.initialLoadingPromise = null),
  36973. (this.endpoint = e + "?type=3"),
  36974. (this.urlContainer = null),
  36975. (this.authorizationHeader = h.getAuthorizationHeader()),
  36976. (this.containerClasses = [o, r, n]);
  36977. }
  36978. var s = e("./ajax"),
  36979. l = e("./logger"),
  36980. c = e("../constants"),
  36981. h = e("./showcase"),
  36982. u = (e("../ab"), new l(i));
  36983. (n.prototype = {
  36984. version: 1,
  36985. validate: function (e) {
  36986. return "catalog.json" in e && Object.keys(e).length > 0;
  36987. },
  36988. update: function (e) {
  36989. return (
  36990. (this.cache = e),
  36991. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  36992. $.when()
  36993. );
  36994. },
  36995. get: function (e) {
  36996. return this.cache[e];
  36997. },
  36998. }),
  36999. (r.prototype = {
  37000. version: 2,
  37001. validate: function (e) {
  37002. return (
  37003. "catalog.json" in e &&
  37004. "base.url" in e &&
  37005. Object.keys(e).length > 1
  37006. );
  37007. },
  37008. update: function (e) {
  37009. return (
  37010. (this.baseUrl = e["base.url"]),
  37011. (this.cache = e),
  37012. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  37013. $.when()
  37014. );
  37015. },
  37016. get: function (e) {
  37017. var t = this.cache[e];
  37018. return t ? this.baseUrl.replace("{{filename}}", e) + t : null;
  37019. },
  37020. }),
  37021. (o.prototype = {
  37022. version: 3,
  37023. validate: function (e) {
  37024. return (
  37025. e.templates &&
  37026. e.catalog_file &&
  37027. (!e.expires || 1e3 * e.expires > Date.now())
  37028. );
  37029. },
  37030. update: function (e) {
  37031. return (
  37032. (this.baseUrl = e.templates[0]),
  37033. e.expires
  37034. ? (this.expires = 1e3 * e.expires)
  37035. : (this.expires =
  37036. Date.now() + c.signedUrlDefaultExpireTime),
  37037. $.when()
  37038. );
  37039. },
  37040. get: function (e) {
  37041. return this.baseUrl.replace("{{filename}}", e);
  37042. },
  37043. }),
  37044. (a.prototype = {
  37045. init: function () {
  37046. return this.initialLoadingPromise
  37047. ? this.initialLoadingPromise
  37048. : (setInterval(
  37049. function () {
  37050. var e = this.urlContainer
  37051. ? this.urlContainer.expires
  37052. : Date.now();
  37053. Date.now() + c.signedUrlRefreshBuffer > e &&
  37054. (u.debug("Refreshing urls..."),
  37055. this.refresh()
  37056. .done(function () {
  37057. u.debug("Refreshed");
  37058. })
  37059. .fail(function () {
  37060. u.error(
  37061. "Failed url refresh, urls might go stale soon"
  37062. );
  37063. }));
  37064. }.bind(this),
  37065. c.signedUrlCheckInterval
  37066. ),
  37067. (this.initialLoadingPromise = this.refresh()),
  37068. this.initialLoadingPromise);
  37069. },
  37070. refresh: function (e) {
  37071. //已经在someData.js里加载过了 不用再加载file了吧
  37072. e = e || {};
  37073. /*var t = void 0 === e.cache || e.cache;
  37074. return s.get( this.endpoint , { //file
  37075. responseType: "json",
  37076. prefetchFrom: t ? "files" : null,
  37077. cache: t,
  37078. auth: this.authorizationHeader
  37079. }).then(function(e) {
  37080. if (this.urlContainer && this.urlContainer.validate(e))
  37081. return this.urlContainer.update(e);
  37082. for (var i = 0; i < this.containerClasses.length; i++) {
  37083. var n = this.containerClasses[i]
  37084. , r = new n;
  37085. if (r.validate(e))
  37086. return u.info("Using urls version " + r.version),
  37087. this.urlContainer = r,
  37088. this.urlContainer.update(e)
  37089. }
  37090. return t ? this.refresh({
  37091. cache: !1
  37092. }) : $.Deferred().reject("missing-urls")
  37093. }
  37094. .bind(this), function(e) {
  37095. return "loading-failed"
  37096. }) */
  37097. return $.Deferred().resolve();
  37098. },
  37099. get: function (e) {
  37100. //return this.urlContainer.get(e)
  37101. return window.DATA.files.templates[0].replace(
  37102. "{{filename}}",
  37103. e
  37104. );
  37105. },
  37106. }),
  37107. (t.exports = a);
  37108. }).call(this, "/js/util/ModelUrls.js");
  37109. },
  37110. {
  37111. "../ab": 3,
  37112. "../constants": 8,
  37113. "./ajax": 181,
  37114. "./logger": 189,
  37115. "./showcase": 193,
  37116. },
  37117. ],
  37118. 178: [
  37119. function (e, t, i) {
  37120. (function (i) {
  37121. "use strict";
  37122. function n() {
  37123. u.call(this), (this.neighbourMap = {}), (this.map = null);
  37124. }
  37125. var r = e("three"),
  37126. o = e("./common"),
  37127. a = e("../settings"),
  37128. s = e("../objects/Panorama"),
  37129. a = e("../settings"),
  37130. l = e("./aStar"),
  37131. c = e("./logger"),
  37132. h = new c(i),
  37133. u = e("./IndexedCollection"),
  37134. d = e("./transitions");
  37135. o.inherit(n, u),
  37136. (n.prototype.getIndex = function (e) {
  37137. return e.id;
  37138. }),
  37139. (n.prototype.find = function (e, t) {
  37140. var i = o.filterAll(this.list, e);
  37141. return 0 === i.length
  37142. ? null
  37143. : (t &&
  37144. t.forEach(function (e) {
  37145. i = o.stableSort(i, e);
  37146. }),
  37147. i[0]);
  37148. }),
  37149. /* n.prototype.sortByScore = function(e, t) {
  37150. var i = o.filterAll(this.list, e);
  37151. return 0 === i.length ? null : i = i.map(function(e) {
  37152. return {
  37153. pano: e,
  37154. score: t.reduce(function(t, i) {
  37155. return t + i(e)
  37156. }, 0)
  37157. }
  37158. }).sort(function(e, t) {
  37159. return t.score - e.score;
  37160. })
  37161. } */
  37162. (n.prototype.sortByScore = function (request, rank) {
  37163. return common.sortByScore(this.list, request, rank);
  37164. }),
  37165. (n.prototype.lowestByScore = function (e, t, i) {
  37166. return this.findRankedByScore(0, e, t, i);
  37167. }),
  37168. (n.prototype.findRankedByScore = function (e, t, i, n) {
  37169. n && ((n.candidates = null), (n.pano = null)), e || (e = 0);
  37170. var r = this.sortByScore(t, i);
  37171. return !r || 0 === r.length || e >= r.length
  37172. ? null
  37173. : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item);
  37174. }),
  37175. (n.prototype.showPanoScores = function (e) {
  37176. this.list.forEach(function (e) {
  37177. e.removeTextSprite();
  37178. });
  37179. var t = 6344768;
  37180. e.forEach(function (e) {
  37181. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055);
  37182. });
  37183. }),
  37184. (n.prototype.isNeighbour = function (e, t) {
  37185. return this.neighbourMap[e.id][t.id];
  37186. }),
  37187. (n.prototype.getNeighbours = function (e) {
  37188. return this.neighbourMap[e.id];
  37189. }),
  37190. (n.prototype.setNeighbour = function (e, t, i) {
  37191. return (
  37192. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  37193. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  37194. (this.neighbourMap[e.id][e.id] = !0),
  37195. (this.neighbourMap[t.id][t.id] = !0),
  37196. (this.neighbourMap[e.id][t.id] = i),
  37197. (this.neighbourMap[t.id][e.id] = i),
  37198. this.neighbourMap[e.id]
  37199. );
  37200. }),
  37201. (n.prototype.findClosest = function (e, t) {
  37202. var i = [s.filters.isPanoAligned()];
  37203. return (
  37204. t && i.push(s.filters.inDirection(e, t, 0.75)),
  37205. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  37206. );
  37207. }),
  37208. (n.prototype.dualNeighbors = function (e, t) {
  37209. var i,
  37210. n = [];
  37211. for (i in this.neighbourMap[e.id])
  37212. this.neighbourMap[t.id][i] && n.push(i);
  37213. return n;
  37214. }),
  37215. (n.prototype.populate_path_graph = function () {
  37216. var e,
  37217. t,
  37218. i,
  37219. n,
  37220. o,
  37221. a,
  37222. s,
  37223. l,
  37224. c = Date.now(),
  37225. u = {},
  37226. d = 0,
  37227. p = new r.Vector3(0, 0, 0),
  37228. f = 0,
  37229. g = 0;
  37230. for (e = 0; e < this.list.length; e += 1) {
  37231. (o = this.list[e]),
  37232. (s = {}),
  37233. (l = !1),
  37234. (i = o.neighbourPanos || o.findNeighourPanos());
  37235. for (t in i)
  37236. if (i[t]) {
  37237. (a = this.index[t]),
  37238. p.copy(o.floorPosition),
  37239. p.sub(a.floorPosition);
  37240. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  37241. v =
  37242. (Math.abs(p.y) / Math.max(m, 0.01),
  37243. Math.max(0, Math.abs(p.y) - 0.2));
  37244. v > 0
  37245. ? ((f += 1),
  37246. (v = Math.pow(4 * v, 2)),
  37247. (m = Math.pow(m, 2)),
  37248. (n = Math.sqrt(v * v + m * m)))
  37249. : ((g += 1), (n = p.length())),
  37250. (s[a.id] = n),
  37251. (l = !0);
  37252. }
  37253. l ? (u[o.id] = s) : (d += 1);
  37254. }
  37255. (this.map = u),
  37256. h.info(
  37257. "graph ready in " +
  37258. (Date.now() - c) +
  37259. "ms, " +
  37260. d +
  37261. " had no neighbors"
  37262. );
  37263. }),
  37264. (n.prototype.aStarSearch = function (e, t) {
  37265. var i = Date.now(),
  37266. n = new l({
  37267. start: e,
  37268. isEnd: function (e) {
  37269. return e === t;
  37270. },
  37271. neighbor: function (e) {
  37272. var t = e.neighbourPanos || e.findNeighourPanos(),
  37273. i = [];
  37274. for (var n in t) t[n] && i.push(this.index[n]); //add: t[n] &&
  37275. return i;
  37276. }.bind(this),
  37277. distance: function (e, t) {
  37278. var i = this.map[e.id],
  37279. n = i[t.id];
  37280. return n;
  37281. }.bind(this),
  37282. heuristic: function (e, t) {
  37283. return 1;
  37284. }.bind(this),
  37285. hash: function (e) {
  37286. return e.id;
  37287. },
  37288. timeout: 5e3,
  37289. });
  37290. if (
  37291. (h.debug("A* search in " + (Date.now() - i) + "ms"),
  37292. "success" !== n.status)
  37293. )
  37294. return (
  37295. h.debug("Did not find A* path from " + e + " to " + t), null
  37296. );
  37297. h.debug(
  37298. "Total cost " +
  37299. n.cost.toPrecision(3) +
  37300. ", " +
  37301. n.path.length +
  37302. " steps"
  37303. );
  37304. var r = [];
  37305. return (
  37306. n.path.forEach(function (e) {
  37307. r.push(e.id);
  37308. }),
  37309. r
  37310. );
  37311. }),
  37312. (n.prototype.includeNodesNearPath = (function () {
  37313. var e = new r.Vector3(),
  37314. t = new r.Vector3(),
  37315. i = new r.Vector3(),
  37316. n = new r.Vector3(),
  37317. o = new r.Vector3(),
  37318. a = new r.Vector3(),
  37319. s = new r.Vector3(),
  37320. l = new r.Vector3(),
  37321. c = [],
  37322. h = new r.Vector3(),
  37323. u = new r.Vector3();
  37324. return function (r, d) {
  37325. if (r)
  37326. for (
  37327. var p = function (e, t, i) {
  37328. return o.copy(t).sub(e), o.dot(i);
  37329. },
  37330. f = function (e, t) {
  37331. return p(h, e.position, i) - p(h, t.position, i);
  37332. },
  37333. g = 0;
  37334. g < r.length - 1;
  37335. ) {
  37336. var m = r[g],
  37337. v = r[g + 1],
  37338. A = this.index[m],
  37339. y = this.index[v];
  37340. h.copy(A.position),
  37341. u.copy(y.position),
  37342. (c.length = 0),
  37343. e.copy(u).sub(h),
  37344. i.copy(e).normalize();
  37345. for (var C = 0; C < this.list.length; C++) {
  37346. var I = this.list[C];
  37347. o.copy(I.position).sub(h);
  37348. var E = o.dot(i);
  37349. if (E > 0) {
  37350. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s);
  37351. var b = a.length();
  37352. if (b < d) {
  37353. t.copy(e).negate(),
  37354. n.copy(t).normalize(),
  37355. l.copy(I.position).sub(u);
  37356. var w = l.dot(n);
  37357. w > 0 && c.push(I);
  37358. }
  37359. }
  37360. }
  37361. if (c.length > 0) {
  37362. c.sort(f);
  37363. for (
  37364. var _ = r.length + c.length - 1;
  37365. _ >= g + c.length;
  37366. _--
  37367. )
  37368. r[_] = r[_ - c.length];
  37369. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id;
  37370. }
  37371. g += c.length + 1;
  37372. }
  37373. };
  37374. })()),
  37375. /* n.prototype. = function(e, t) {
  37376. var i = void 0 === e ? a.panorama.markerOpacity : e
  37377. , n = this.list.findIndex(function(e) {
  37378. return e.marker
  37379. });
  37380. if (!(n < 0)) {
  37381. var r = this.list[n].marker.material.opacity;
  37382. if (r !== e) {
  37383. var o = i - r;
  37384. d.trigger({
  37385. func: function(e, t) {
  37386. var i = r + e * o;
  37387. this.forEach(function(e) {
  37388. e.marker && (e.marker.material.opacity = i)
  37389. })
  37390. }
  37391. .bind(this),
  37392. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  37393. name: "_fpm"
  37394. })
  37395. }
  37396. }
  37397. } */
  37398. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  37399. d.cancelById("fadeMarkerOpacity");
  37400. var n = this.list.findIndex(function (e) {
  37401. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  37402. return e.marker;
  37403. });
  37404. if (n < 0) {
  37405. //logger.info('marker findIndex<0')
  37406. return;
  37407. }
  37408. var group;
  37409. var tran = function (list, index) {
  37410. list.member = list.member.filter(function (m) {
  37411. return m.marker && m.marker.material.opacity != list.toOp;
  37412. });
  37413. transitions.trigger({
  37414. func: function (e, t) {
  37415. //e:0-1
  37416. list.member.forEach(function (m) {
  37417. var o = m.marker.oldOpacity;
  37418. var i = o + e * (list.toOp - o);
  37419. m.marker && (m.marker.material.opacity = i);
  37420. });
  37421. }.bind(this),
  37422. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  37423. name: "_fpm_" + index,
  37424. id: "fadeMarkerOpacity",
  37425. });
  37426. };
  37427. this.forEach(function (e) {
  37428. //先记录旧的opacity
  37429. e.marker && (e.marker.oldOpacity = e.marker.material.opacity);
  37430. });
  37431. group = gr;
  37432. /* if (e > 0 && gr) {
  37433. group = gr
  37434. } else {
  37435. group = [
  37436. {
  37437. member: this.list,
  37438. toOp: 0,
  37439. },
  37440. ]
  37441. } */
  37442. for (var i = 0; i < group.length; i++) {
  37443. tran(group[i], i);
  37444. }
  37445. }),
  37446. (t.exports = n);
  37447. }).call(this, "/js/util/PanoramaCollection.js");
  37448. },
  37449. {
  37450. "../objects/Panorama": 148,
  37451. "../settings": 166,
  37452. "./IndexedCollection": 175,
  37453. "./aStar": 180,
  37454. "./common": 185,
  37455. "./logger": 189,
  37456. "./transitions": 195,
  37457. three: 217,
  37458. },
  37459. ],
  37460. 179: [
  37461. function (e, t, i) {
  37462. "use strict";
  37463. function n() {
  37464. (this.actionSequence = []), (this.actionSequenceInProgress = !1);
  37465. }
  37466. function r(e, t, i, n) {
  37467. s.trackAlways("zoom_" + e, {
  37468. from: t,
  37469. to: i,
  37470. pano: n,
  37471. });
  37472. }
  37473. function o(e, t) {
  37474. r("initial", 1, e, t);
  37475. }
  37476. function a(e, t, i) {
  37477. r("followup", e, t, i);
  37478. }
  37479. var s = e("../analytics");
  37480. (n.prototype.reset = function (e) {
  37481. (this.actionSequenceInProgress = !1),
  37482. (this.actionSequence.length = 0);
  37483. }),
  37484. (n.prototype.addZoomAction = (function () {
  37485. var e = null,
  37486. t = null,
  37487. i = !1,
  37488. n = function () {
  37489. if (((e = null), this.actionSequence.length > 0)) {
  37490. var i = this.actionSequence[0].start,
  37491. n = this.actionSequence[this.actionSequence.length - 1].end;
  37492. 1 === i ? o(n, t) : a(i, n, t);
  37493. }
  37494. this.reset();
  37495. };
  37496. return function (r, o, a) {
  37497. if (r !== o) {
  37498. i || ((n = n.bind(this)), (i = !0)),
  37499. e && (window.clearTimeout(e), (e = null)),
  37500. (a === t && this.actionSequenceInProgress) ||
  37501. (this.reset(), (t = a)),
  37502. (this.actionSequenceInProgress = !0);
  37503. var s = {
  37504. start: r,
  37505. end: o,
  37506. };
  37507. this.actionSequence.push(s), (e = window.setTimeout(n, 150));
  37508. }
  37509. };
  37510. })()),
  37511. (t.exports = n);
  37512. },
  37513. {
  37514. "../analytics": 4,
  37515. },
  37516. ],
  37517. 180: [
  37518. function (e, t, i) {
  37519. "use strict";
  37520. function n(e) {
  37521. void 0 === e.timeout && (e.timeout = 1 / 0);
  37522. var t = e.hash || o,
  37523. i = {
  37524. data: e.start,
  37525. g: 0,
  37526. h: e.heuristic(e.start),
  37527. },
  37528. n = i;
  37529. i.f = i.h;
  37530. var h = new s(),
  37531. u = new l(a),
  37532. d = c();
  37533. u.push(i), d.set(t(i.data), i);
  37534. for (var p = new Date(); u.size(); ) {
  37535. if (new Date() - p > e.timeout)
  37536. return {
  37537. status: "timeout",
  37538. cost: n.g,
  37539. path: r(n),
  37540. };
  37541. var f = u.pop();
  37542. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  37543. return {
  37544. status: "success",
  37545. cost: f.g,
  37546. path: r(f),
  37547. };
  37548. h.add(t(f.data));
  37549. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  37550. var v = g[m];
  37551. if (!h.contains(t(v))) {
  37552. var A = f.g + e.distance(f.data, v),
  37553. y = d.get(t(v)),
  37554. C = !1;
  37555. if (void 0 === y)
  37556. (y = {
  37557. data: v,
  37558. }),
  37559. d.set(t(v), y);
  37560. else {
  37561. if (y.g < A) continue;
  37562. C = !0;
  37563. }
  37564. (y.parent = f),
  37565. (y.g = A),
  37566. (y.h = e.heuristic(v)),
  37567. (y.f = A + y.h),
  37568. y.h < n.h && (n = y),
  37569. C ? u.heapify() : u.push(y);
  37570. }
  37571. }
  37572. }
  37573. return {
  37574. status: "noPath",
  37575. cost: n.g,
  37576. path: r(n),
  37577. };
  37578. }
  37579. function r(e) {
  37580. if (void 0 !== e.parent) {
  37581. var t = r(e.parent);
  37582. return t.push(e.data), t;
  37583. }
  37584. return [e.data];
  37585. }
  37586. function o(e) {
  37587. return e.toString();
  37588. }
  37589. function a(e, t) {
  37590. return e.f - t.f;
  37591. }
  37592. var s = e("Set"),
  37593. l = e("heap"),
  37594. c = e("dict");
  37595. t.exports = n;
  37596. },
  37597. {
  37598. Set: 196,
  37599. dict: 210,
  37600. heap: 211,
  37601. },
  37602. ],
  37603. 181: [
  37604. function (e, t, i) {
  37605. (function (i) {
  37606. "use strict";
  37607. function n(e, t, i) {
  37608. var n = new XMLHttpRequest();
  37609. if (i && "withCredentials" in n) n.open(e, t, i);
  37610. else if ("undefined" != typeof XDomainRequest)
  37611. (n = new XDomainRequest()), n.open(e, t);
  37612. else {
  37613. if (i) throw "Browser does not support CORS!";
  37614. n.open(e, t);
  37615. }
  37616. return n;
  37617. }
  37618. function r(e, t, i) {
  37619. function o() {
  37620. u.warn("Retrying ", t),
  37621. r(e, t, i)
  37622. .done(c.resolve.bind(c))
  37623. .progress(c.notify.bind(c))
  37624. .fail(c.reject.bind(c));
  37625. }
  37626. function a(e, t) {
  37627. var i = e.response;
  37628. if ("json" === t && "object" != typeof i)
  37629. try {
  37630. i = JSON.parse(e.responseText);
  37631. } catch (e) {
  37632. return void c.reject({
  37633. error: "Failed parsing JSON",
  37634. });
  37635. }
  37636. else if ("image/jpeg" === t) {
  37637. var n = new Uint8Array(e.response),
  37638. r = new Blob([n], {
  37639. type: "image/jpeg",
  37640. }),
  37641. o = URL.createObjectURL(r);
  37642. (i = new Image()),
  37643. (i.src = o),
  37644. (i.crossOrigin = "Anonymous"),
  37645. (i.onload = function () {
  37646. URL.revokeObjectURL(o);
  37647. });
  37648. }
  37649. return i;
  37650. }
  37651. var s = n(e, t, !1);
  37652. if (
  37653. ((i = i || {}),
  37654. (i.retries = void 0 !== i.retries ? i.retries : 0),
  37655. (i.retry =
  37656. void 0 !== i.retry ? i.retry : "get" === e.toLowerCase()),
  37657. i.responseType)
  37658. )
  37659. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  37660. s.responseType = i.responseType;
  37661. else {
  37662. if ("image/jpeg" !== i.responseType)
  37663. throw new Error(
  37664. 'reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"'
  37665. );
  37666. s.responseType = "arraybuffer";
  37667. }
  37668. if (
  37669. ("json" === i.responseType &&
  37670. s.setRequestHeader("Accept", "application/json"),
  37671. i.auth && s.setRequestHeader("Authorization", i.auth),
  37672. "object" == typeof i.data &&
  37673. ((i.data = JSON.stringify(i.data)),
  37674. s.setRequestHeader("Content-Type", "application/json")),
  37675. "object" == typeof i.headers)
  37676. )
  37677. for (var l in i.headers) s.setRequestHeader(l, i.headers[l]);
  37678. var c = $.Deferred();
  37679. return (
  37680. (s.onreadystatechange = function (e) {
  37681. if (4 === this.readyState)
  37682. if (
  37683. this.status >= 500 &&
  37684. this.status <= 600 &&
  37685. i.retry &&
  37686. i.retries < 3
  37687. )
  37688. i.retries++, setTimeout(o, 1e3);
  37689. else if (200 === this.status) {
  37690. var t = a(this, i.responseType);
  37691. c.resolve(t);
  37692. } else c.reject(this);
  37693. }),
  37694. (s.onprogress = function (e) {
  37695. c.notify(e);
  37696. }),
  37697. s.send(i.data),
  37698. c.promise()
  37699. );
  37700. }
  37701. function o(e) {
  37702. return Object.keys(e)
  37703. .sort()
  37704. .map(function (t) {
  37705. return {
  37706. key: t,
  37707. value: e[t],
  37708. };
  37709. });
  37710. }
  37711. function a(e, t) {
  37712. var i = t.responseType || null,
  37713. n = t.auth || null,
  37714. r = t.prefetchFrom || null,
  37715. a = e + "__" + i + "__" + n + "__" + r;
  37716. return (
  37717. t.headers &&
  37718. o(t.headers).forEach(function (e) {
  37719. a += "__" + e.key + ":" + e.value;
  37720. }),
  37721. a
  37722. );
  37723. }
  37724. function s(e, t) {
  37725. return window.MP_REQUEST_CACHE
  37726. ? window.MP_REQUEST_CACHE[a(e, t)]
  37727. : null;
  37728. }
  37729. function l(e, t, i) {
  37730. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i);
  37731. }
  37732. var c = e("./logger"),
  37733. h = e("../ab"),
  37734. u = new c(i);
  37735. (window.URL = window.URL || window.webkitURL),
  37736. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  37737. (window.DATA = window.DATA || {}),
  37738. /* setTimeout(function() {//MP-- xzw delete
  37739. window.MP_REQUEST_CACHE = null,
  37740. window.DATA = {}
  37741. }, 6e4),
  37742. window.onpageshow = function(e) {
  37743. e.persisted && (window.MP_REQUEST_CACHE = null,
  37744. window.DATA = {})
  37745. } */
  37746. (t.exports = {
  37747. get: function (e, t) {
  37748. t = t || {};
  37749. var i = void 0 === t.cache || t.cache;
  37750. if (i) {
  37751. var n = s(e, t);
  37752. if (n) return n;
  37753. }
  37754. var o;
  37755. return (
  37756. (o =
  37757. t.prefetchFrom && window.DATA[t.prefetchFrom]
  37758. ? $.when(window.DATA[t.prefetchFrom])
  37759. : r("GET", e, t)),
  37760. i && l(e, t, o),
  37761. o
  37762. );
  37763. },
  37764. post: function (e, t) {
  37765. return r("POST", e, t);
  37766. },
  37767. patch: function (e, t) {
  37768. return r("PATCH", e, t);
  37769. },
  37770. getImage: function (e, t) {
  37771. function i() {
  37772. u.warn("Retrying ", e),
  37773. o
  37774. .getImage(e, t - 1)
  37775. .done(n.resolve.bind(n))
  37776. .progress(n.notify.bind(n))
  37777. .fail(n.reject.bind(n));
  37778. }
  37779. var n = $.Deferred(),
  37780. r = new Image(),
  37781. o = this;
  37782. return (
  37783. (e = h.changeIfImageOptimzing(e)),
  37784. (null !== t && void 0 !== t) || (t = 3),
  37785. (r.onerror = function () {
  37786. t > 0 ? setTimeout(i, 1e3) : n.reject();
  37787. }),
  37788. (r.onload = function () {
  37789. n.resolve(r);
  37790. }),
  37791. (r.crossOrigin = "anonymous"),
  37792. (r.src = e),
  37793. n
  37794. );
  37795. },
  37796. });
  37797. }).call(this, "/js/util/ajax.js");
  37798. },
  37799. {
  37800. "../ab": 3,
  37801. "./logger": 189,
  37802. },
  37803. ],
  37804. 182: [
  37805. function (e, t, i) {
  37806. "use strict";
  37807. function n(e, t) {
  37808. var i = window.navigator.userAgent,
  37809. n = i.match(e);
  37810. return (
  37811. (n = n ? n[1].split(t) : []),
  37812. {
  37813. major: parseInt(n[0]) || 0,
  37814. minor: parseInt(n[1]) || 0,
  37815. patch: parseInt(n[2]) || 0,
  37816. }
  37817. );
  37818. }
  37819. var r = e("../exception/DeviceMismatchException");
  37820. t.exports = {
  37821. supportsFullscreen: function () {
  37822. return (
  37823. document.fullscreenEnabled ||
  37824. document.mozFullscreenEnabled ||
  37825. document.mozFullScreenEnabled ||
  37826. document.webkitFullscreenEnabled ||
  37827. document.msFullscreenEnabled
  37828. );
  37829. },
  37830. isPointerLocked: function () {
  37831. return (
  37832. document.pointerLockElement ||
  37833. document.mozPointerLockElement ||
  37834. document.webkitPointerLockElement
  37835. );
  37836. },
  37837. requestFullscreen: function (e, t) {
  37838. e.requestFullscreen
  37839. ? e.requestFullscreen()
  37840. : e.mozRequestFullScreen
  37841. ? e.mozRequestFullScreen()
  37842. : e.webkitRequestFullscreen
  37843. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  37844. : e.msRequestFullscreen && e.msRequestFullscreen(),
  37845. t &&
  37846. $(document).on(
  37847. "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",
  37848. browser.requestPointerLock
  37849. );
  37850. },
  37851. requestPointerLock: function () {
  37852. var e;
  37853. if (document.fullscreenElement) e = document.fullscreenElement();
  37854. else if (document.mozFullscreenElement)
  37855. e = document.mozFullscreenElement();
  37856. else if (document.mozFullScreenElement)
  37857. e = document.mozFullScreenElement();
  37858. else {
  37859. if (!document.webkitFullscreenElement) return;
  37860. e = document.webkitFullscreenElement();
  37861. }
  37862. (e.requestPointerLock =
  37863. e.requestPointerLock ||
  37864. e.mozRequestPointerLock ||
  37865. e.webkitRequestPointerLock),
  37866. e.requestPointerLock(),
  37867. $(document).off(
  37868. "fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",
  37869. this
  37870. );
  37871. },
  37872. exitPointerLock: function () {
  37873. (document.exitPointerLock =
  37874. document.exitPointerLock ||
  37875. document.mozExitPointerLock ||
  37876. document.webkitExitPointerLock),
  37877. document.exitPointerLock();
  37878. },
  37879. exitFullscreen: function () {
  37880. document.exitFullscreen
  37881. ? document.exitFullscreen()
  37882. : document.msExitFullscreen
  37883. ? document.msExitFullscreen()
  37884. : document.mozCancelFullScreen
  37885. ? document.mozCancelFullScreen()
  37886. : document.webkitExitFullscreen &&
  37887. document.webkitExitFullscreen();
  37888. },
  37889. details: function () {
  37890. var e = navigator.userAgent.match(
  37891. "(Firefox|Chrome|Safari)/([\\d]+)"
  37892. );
  37893. return e
  37894. ? {
  37895. name: e[1],
  37896. version: parseInt(e[2]),
  37897. platform: navigator.platform,
  37898. }
  37899. : {};
  37900. },
  37901. is: function (e) {
  37902. return this.details() && this.details().name === e;
  37903. },
  37904. inIframe: function () {
  37905. return window.parent !== window;
  37906. },
  37907. aspectRatio: function () {
  37908. var e = $("#player").width() / $("#player").height();
  37909. return isFinite(e) ? e : 0;
  37910. },
  37911. userAgent: function () {
  37912. return window.navigator.userAgent;
  37913. },
  37914. isLandscape: function () {
  37915. return this.isMobile && this.aspectRatio() > 1;
  37916. },
  37917. isSmallScreen: function () {
  37918. var e = screen.width / window.devicePixelRatio;
  37919. return e < 240;
  37920. },
  37921. detectIE: function () {
  37922. var e = window.navigator.userAgent,
  37923. t = e.indexOf("MSIE ");
  37924. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./);
  37925. },
  37926. detectSafari: function () {
  37927. var e = window.navigator.userAgent,
  37928. t = e.indexOf("Safari");
  37929. return t !== -1 && !this.detectChrome();
  37930. },
  37931. detectFirefox: function () {
  37932. var e = window.navigator.userAgent;
  37933. return e.indexOf("Firefox") !== -1;
  37934. },
  37935. detectChrome: function () {
  37936. var e = window.navigator.userAgent;
  37937. return e.indexOf("Chrome") !== -1 && !this.detectOpera();
  37938. },
  37939. detectOpera: function () {
  37940. var e = window.navigator.userAgent;
  37941. return e.indexOf("OPR") !== -1;
  37942. },
  37943. detectIOS: function () {
  37944. return (
  37945. this.detectIPhone() || this.detectIPad() || this.detectIPod()
  37946. );
  37947. },
  37948. detectIPad: function () {
  37949. var e = window.navigator.userAgent,
  37950. t = /iPad/;
  37951. return t.test(e);
  37952. },
  37953. detectIPod: function () {
  37954. var e = window.navigator.userAgent,
  37955. t = /iPod/;
  37956. return t.test(e);
  37957. },
  37958. detectIPhone: function () {
  37959. var e = window.navigator.userAgent,
  37960. t = /iPhone/;
  37961. return t.test(e);
  37962. },
  37963. detectAndroid: function () {
  37964. var e = window.navigator.userAgent;
  37965. return e.indexOf("Android") !== -1;
  37966. },
  37967. detectAndroidMobile: function () {
  37968. var e = window.navigator.userAgent;
  37969. return this.detectAndroid() && e.indexOf("Mobile") !== -1;
  37970. },
  37971. detectSamsungNative: function () {
  37972. var e = window.navigator.userAgent;
  37973. return (
  37974. e.indexOf("SM-G900H") !== -1 ||
  37975. e.indexOf("GT-I9500") !== -1 ||
  37976. e.indexOf("SM-N900") !== -1
  37977. );
  37978. },
  37979. detectSamsungS6: function () {
  37980. var e = window.navigator.userAgent;
  37981. return e.indexOf("SM-G92") !== -1;
  37982. },
  37983. /************************************************************fyz改from徐世廷*************************************************************/
  37984. detectHUAWEI5X: function () {
  37985. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  37986. },
  37987. /*******************************************************************************************************************************/
  37988. detectWebVR: function () {
  37989. return !(!window.navigator.getVRDisplays || !window.VRDisplay);
  37990. },
  37991. getVRDisplay: function () {
  37992. var e = $.Deferred();
  37993. return this.detectWebVR()
  37994. ? (navigator.getVRDisplays().then(function (t) {
  37995. t.length >= 1 && e.resolve(t[0]), e.reject(null);
  37996. }),
  37997. e)
  37998. : e.reject(null);
  37999. },
  38000. iosVersion: function () {
  38001. if (!this.detectIOS()) throw new r("Did not detect an iDevice");
  38002. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  38003. t = "_";
  38004. return n(e, t);
  38005. },
  38006. androidVersion: function () {
  38007. if (!this.detectAndroid())
  38008. throw new r("Did not detect an Android based device");
  38009. var e = /Android ((?:\d+\.?){1,3})/,
  38010. t = ".";
  38011. return n(e, t);
  38012. },
  38013. valueFromCookie: function (e, t) {
  38014. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  38015. if (!i) return t;
  38016. var n = i[1];
  38017. return "boolean" == typeof t
  38018. ? "true" === n || "1" === n
  38019. : "number" == typeof t
  38020. ? parseFloat(n)
  38021. : n;
  38022. },
  38023. valueFromHash: function (e, t) {
  38024. var i = new RegExp("[#&?]" + e + "=([^#&?]*)"),
  38025. n = i.exec(window.location.href);
  38026. if (!n) return t;
  38027. var r = n[1];
  38028. return "boolean" == typeof t
  38029. ? "true" === r || "1" === r
  38030. : "number" == typeof t
  38031. ? parseFloat(r)
  38032. : window.decodeURIComponent(r);
  38033. },
  38034. };
  38035. Object.assign(window.browser, t.exports);
  38036. t.exports = window.browser;
  38037. // changeLog();
  38038. },
  38039. {
  38040. "../exception/DeviceMismatchException": 56,
  38041. },
  38042. ],
  38043. 183: [
  38044. function (e, t, i) {
  38045. (function (i) {
  38046. "use strict";
  38047. function n(e, t) {
  38048. var i = r(t);
  38049. var replaceAll = function (str, f, e) {
  38050. //f全部替换成e
  38051. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  38052. return str.replace(reg, e);
  38053. };
  38054. var urlFirstView = c.valueFromHash("firstView");
  38055. if (urlFirstView) {
  38056. //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.015155019941222028,0.3253822291629593,0.005215708110435864,0.945446737862511&qs=1
  38057. try {
  38058. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"');
  38059. if (urlFirstView.includes("qua")) {
  38060. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[');
  38061. urlFirstView += "]";
  38062. } else {
  38063. urlFirstView += '"';
  38064. }
  38065. urlFirstView = "{" + urlFirstView + "}";
  38066. let info = JSON.parse(urlFirstView);
  38067. i.pano = t.index[info.pano]; //panos.get(info.pano)
  38068. if (!i.pano) {
  38069. urlFirstView = false;
  38070. console.error("检测到firstView但是 找不到该pano");
  38071. } else {
  38072. if (info.qua) {
  38073. i.quaternion = new THREE.Quaternion().fromArray(info.qua);
  38074. } else {
  38075. i.quaternion = new THREE.Quaternion();
  38076. }
  38077. i.zoom = -1;
  38078. i.mode = "panorama";
  38079. i.setByUrl = true;
  38080. }
  38081. } catch (e) {
  38082. urlFirstView = false;
  38083. console.error("检测到firstView但是解析出错" + e);
  38084. }
  38085. }
  38086. if (Object.keys(i).length > 0) return i;
  38087. if (e.heroImage) i = o(e, t);
  38088. else if (window.DATA.camera_start) {
  38089. var n = window.DATA.camera_start;
  38090. try {
  38091. Object.keys(n).length > 0 &&
  38092. !l.isEmptyQuaternion(n.camera.quaternion) &&
  38093. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  38094. (i.position = n.camera.position),
  38095. //i.quaternion = n.camera.quaternion,
  38096. (i.quaternion = new th.Quaternion().fromArray(
  38097. n.camera.quaternion
  38098. )), //xzw
  38099. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  38100. n.pano &&
  38101. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  38102. d.debug("Using camera_start"),
  38103. d.debug("Modeldata pano: ", i.pano.quaternion),
  38104. d.debug("Camera start pano: ", n.pano.quaternion)),
  38105. i.mode !== h.PANORAMA &&
  38106. (i.floorVisibility =
  38107. e.heroImage.metadata.floor_visibility));
  38108. } catch (e) {
  38109. d.warn(e.message);
  38110. if (i.mode == "panorama" && !i.pano) i.pano = t.list[0];
  38111. }
  38112. }
  38113. if (
  38114. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  38115. i.mode === h.MESH &&
  38116. i.position &&
  38117. ((i.mode = h.PANORAMA),
  38118. (i.pano = t.findClosest(i.position)),
  38119. (i.quaternion = i.pano.quaternion)),
  38120. 0 === Object.keys(i).length)
  38121. ) {
  38122. var a = t.list[0];
  38123. a &&
  38124. ((i.mode = h.PANORAMA),
  38125. (i.pano = a),
  38126. (i.position = a.position),
  38127. (i.quaternion = a.quaternion),
  38128. d.info("Starting at 1st pano " + a.id));
  38129. }
  38130. return (i.mode = i.mode || h.DOLLHOUSE), i;
  38131. }
  38132. function r(e) {
  38133. var t = c.valueFromHash("start", ""),
  38134. i = {};
  38135. if ("" !== t) {
  38136. d.debug("Start override found in parameters, trying to parse..."),
  38137. (i = a(t) || {});
  38138. var n = c.valueFromHash("tag", null);
  38139. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId));
  38140. }
  38141. return i;
  38142. }
  38143. function o(e, t) {
  38144. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  38145. return {};
  38146. var i = {},
  38147. n = e.heroImage.metadata;
  38148. d.debug("Using start position from thumbnail image"),
  38149. (i.position = n.camera_position),
  38150. (i.quaternion = n.camera_quaternion);
  38151. try {
  38152. (i.mode = h.convertWorkshopModeInt(n.camera_mode)),
  38153. i.mode === h.PANORAMA
  38154. ? (i.pano = t.get(n.scan_id))
  38155. : (i.floorVisibility = n.floor_visibility);
  38156. } catch (e) {
  38157. d.debug(e.message);
  38158. }
  38159. return i;
  38160. }
  38161. function a(e) {
  38162. return s.deserialize(e);
  38163. }
  38164. var s = e("../controls/serializer"),
  38165. l = e("../util/math"),
  38166. c = e("./browser"),
  38167. h = e("../enum/Viewmode"),
  38168. u = e("../util/logger"),
  38169. th = e("three"), //xzw
  38170. d = new u(i);
  38171. t.exports = {
  38172. getStartCameraOptions: n,
  38173. };
  38174. }).call(this, "/js/util/camera.js");
  38175. },
  38176. {
  38177. "../controls/serializer": 14,
  38178. "../enum/Viewmode": 51,
  38179. "../util/logger": 189,
  38180. "../util/math": 190,
  38181. "./browser": 182,
  38182. three: 217,
  38183. },
  38184. ],
  38185. 184: [
  38186. function (e, t, i) {
  38187. "use strict";
  38188. function n(e, t, i) {
  38189. return o(e.fov, t, i);
  38190. }
  38191. var r = e("./MathLight"),
  38192. o = function (e, t, i) {
  38193. var n = t,
  38194. o = i,
  38195. a =
  38196. 2 *
  38197. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) *
  38198. r.DEGREES_PER_RADIAN;
  38199. return a;
  38200. },
  38201. a = function (e, t, i) {
  38202. var n = t,
  38203. o = i,
  38204. a =
  38205. 2 *
  38206. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) *
  38207. r.DEGREES_PER_RADIAN;
  38208. return a;
  38209. },
  38210. s = function (e, t, i, n) {
  38211. var r = o(e, i, n);
  38212. return r > t ? a(t, i, n) : e;
  38213. };
  38214. t.exports = {
  38215. clampVFOV: s,
  38216. getHFOVForCamera: n,
  38217. getHFOVFromVFOV: o,
  38218. getVFOVFromHFOV: a,
  38219. };
  38220. window.MathLight = t.exports;
  38221. MathLight.closeTo = function (e1, e2, precision) {
  38222. //xzw add 判断e1,e2是否接近
  38223. var prec = Math.pow(10, -(precision || 4));
  38224. var s1 =
  38225. Math.abs(e1.x - e2.x) < prec &&
  38226. Math.abs(e1.y - e2.y) < prec &&
  38227. Math.abs(e1.z - e2.z) < prec;
  38228. if (e1.w) {
  38229. return s1 && Math.abs(e1.w - e2.w) < prec;
  38230. } else return s1;
  38231. };
  38232. },
  38233. {
  38234. "./MathLight": 176,
  38235. },
  38236. ],
  38237. 185: [
  38238. function (e, t, i) {
  38239. "use strict";
  38240. var n = e("three");
  38241. (t.exports = {
  38242. delayOneFrame: function (e) {
  38243. window.setTimeout(e, 1);
  38244. },
  38245. normalizeUrl: function (e) {
  38246. return e.replace("https://", "http://");
  38247. },
  38248. domainFromUrl: function (e) {
  38249. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  38250. return t ? t[3] : e;
  38251. },
  38252. average: function (e, t) {
  38253. if (0 === e.length) return null;
  38254. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  38255. var o = t ? e[r][t] : e[r];
  38256. (i += o), n++;
  38257. }
  38258. return i / n;
  38259. },
  38260. countUnique: function (e) {
  38261. for (var t = {}, i = 0; i < e.length; i++)
  38262. t[e[i]] = 1 + (t[e[i]] || 0);
  38263. return Object.keys(t).length;
  38264. },
  38265. averageVectors: function (e, t) {
  38266. var i = new n.Vector3();
  38267. if (0 === e.length) return i;
  38268. for (var r = 0, o = 0; o < e.length; o++) {
  38269. var a = t ? e[o][t] : e[o];
  38270. i.add(a), r++;
  38271. }
  38272. return i.divideScalar(r);
  38273. },
  38274. equalLists: function (e, t) {
  38275. if (e.length !== t.length) return !1;
  38276. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1;
  38277. return !0;
  38278. },
  38279. lowerMedian: function (e, t) {
  38280. if (0 === e.length) return null;
  38281. (t = t || 2),
  38282. e.sort(function (e, t) {
  38283. return e - t;
  38284. });
  38285. var i = Math.floor(e.length / t);
  38286. return e[i];
  38287. },
  38288. stableSort: function (e, t) {
  38289. return e
  38290. .map(function (e, t) {
  38291. return {
  38292. value: e,
  38293. index: t,
  38294. };
  38295. })
  38296. .sort(function (e, i) {
  38297. var n = t(e.value, i.value);
  38298. return 0 !== n ? n : e.index - i.index;
  38299. })
  38300. .map(function (e) {
  38301. return e.value;
  38302. });
  38303. },
  38304. filterAll: function (e, t) {
  38305. return e.filter(function (e) {
  38306. return t.every(function (t) {
  38307. return t(e);
  38308. });
  38309. });
  38310. },
  38311. formatDate: function (e) {
  38312. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-");
  38313. },
  38314. formatDatetime: function (e) {
  38315. return [
  38316. e.getFullYear(),
  38317. e.getMonth() + 1,
  38318. e.getDate(),
  38319. e.getHours(),
  38320. e.getMinutes(),
  38321. ].join("-");
  38322. },
  38323. randomString: function (e) {
  38324. for (
  38325. var t = "",
  38326. i =
  38327. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
  38328. n = 0;
  38329. n < e;
  38330. n++
  38331. )
  38332. t += i.charAt(Math.floor(Math.random() * i.length));
  38333. return t;
  38334. },
  38335. uint8ToBase64: function (e, t) {
  38336. (t && "number" == typeof t) || (t = 8192);
  38337. for (var i = [], n = 0; n < e.length; n += t)
  38338. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  38339. return btoa(i.join(""));
  38340. },
  38341. uuid4: function e(t) {
  38342. return t
  38343. ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16)
  38344. : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e);
  38345. },
  38346. nth: function (e) {
  38347. return (
  38348. (e %= 10),
  38349. 1 === e
  38350. ? e + "st"
  38351. : 2 === e
  38352. ? e + "nd"
  38353. : 3 === e
  38354. ? e + "rd"
  38355. : e + "th"
  38356. );
  38357. },
  38358. extendObject: function (e, t) {
  38359. return (
  38360. Object.keys(t).forEach(function (i) {
  38361. e[i] = t[i];
  38362. }),
  38363. e
  38364. );
  38365. },
  38366. deepExtend: function e(t) {
  38367. t = t || {};
  38368. for (var i = 1; i < arguments.length; i++) {
  38369. var n = arguments[i];
  38370. if (n)
  38371. for (var r in n)
  38372. n.hasOwnProperty(r) &&
  38373. ("object" == typeof n[r]
  38374. ? (t[r] = e(t[r], n[r]))
  38375. : (t[r] = n[r]));
  38376. }
  38377. return t;
  38378. },
  38379. inherit: function (e, t) {
  38380. (e.prototype = Object.create(t.prototype)),
  38381. (e.prototype.constructor = e);
  38382. },
  38383. extend: function (e, t) {
  38384. for (var i in t.prototype) e.prototype[i] = t.prototype[i];
  38385. },
  38386. getFileNameFromUrl: function (url) {
  38387. return url.split("/").pop();
  38388. },
  38389. }),
  38390. (Math.sign = function (e) {
  38391. return e < 0 ? -1 : 1;
  38392. });
  38393. window.common = t.exports;
  38394. expandCommon(common);
  38395. },
  38396. {
  38397. three: 217,
  38398. },
  38399. ],
  38400. 186: [
  38401. function (e, t, i) {
  38402. "use strict";
  38403. var n = {};
  38404. (n.linearTween = function (e, t, i, n) {
  38405. return (i * e) / n + t;
  38406. }),
  38407. (n.easeInQuad = function (e, t, i, n) {
  38408. return (e /= n), i * e * e + t;
  38409. }),
  38410. (n.easeOutQuad = function (e, t, i, n) {
  38411. return (e /= n), -i * e * (e - 2) + t;
  38412. }),
  38413. (n.easeInOutQuad = function (e, t, i, n) {
  38414. return (
  38415. (e /= n / 2),
  38416. e < 1
  38417. ? (i / 2) * e * e + t
  38418. : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  38419. );
  38420. }),
  38421. (n.easeInCubic = function (e, t, i, n) {
  38422. return (e /= n), i * e * e * e + t;
  38423. }),
  38424. (n.easeOutCubic = function (e, t, i, n) {
  38425. return (e /= n), e--, i * (e * e * e + 1) + t;
  38426. }),
  38427. (n.easeInOutCubic = function (e, t, i, n) {
  38428. return (
  38429. (e /= n / 2),
  38430. e < 1
  38431. ? (i / 2) * e * e * e + t
  38432. : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  38433. );
  38434. }),
  38435. (n.easeInQuart = function (e, t, i, n) {
  38436. return (e /= n), i * e * e * e * e + t;
  38437. }),
  38438. (n.easeOutQuart = function (e, t, i, n) {
  38439. return (e /= n), e--, -i * (e * e * e * e - 1) + t;
  38440. }),
  38441. (n.easeInOutQuart = function (e, t, i, n) {
  38442. return (
  38443. (e /= n / 2),
  38444. e < 1
  38445. ? (i / 2) * e * e * e * e + t
  38446. : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  38447. );
  38448. }),
  38449. (n.easeInQuint = function (e, t, i, n) {
  38450. return (e /= n), i * e * e * e * e * e + t;
  38451. }),
  38452. (n.easeOutQuint = function (e, t, i, n) {
  38453. return (e /= n), e--, i * (e * e * e * e * e + 1) + t;
  38454. }),
  38455. (n.easeInOutQuint = function (e, t, i, n) {
  38456. return (
  38457. (e /= n / 2),
  38458. e < 1
  38459. ? (i / 2) * e * e * e * e * e + t
  38460. : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  38461. );
  38462. }),
  38463. (n.easeInSine = function (e, t, i, n) {
  38464. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t;
  38465. }),
  38466. (n.easeOutSine = function (e, t, i, n) {
  38467. return i * Math.sin((e / n) * (Math.PI / 2)) + t;
  38468. }),
  38469. (n.easeInOutSine = function (e, t, i, n) {
  38470. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t;
  38471. }),
  38472. (n.easeInExpo = function (e, t, i, n) {
  38473. return i * Math.pow(2, 10 * (e / n - 1)) + t;
  38474. }),
  38475. (n.easeOutExpo = function (e, t, i, n) {
  38476. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t;
  38477. }),
  38478. (n.easeInOutExpo = function (e, t, i, n) {
  38479. return (
  38480. (e /= n / 2),
  38481. e < 1
  38482. ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t
  38483. : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  38484. );
  38485. }),
  38486. (n.easeInCirc = function (e, t, i, n) {
  38487. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t;
  38488. }),
  38489. (n.easeOutCirc = function (e, t, i, n) {
  38490. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t;
  38491. }),
  38492. (n.easeInOutCirc = function (e, t, i, n) {
  38493. return (
  38494. (e /= n / 2),
  38495. e < 1
  38496. ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t
  38497. : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  38498. );
  38499. }),
  38500. (n.easeInElastic = function (e, t, i, n) {
  38501. var r = 1.70158,
  38502. o = 0,
  38503. a = i;
  38504. return 0 === e
  38505. ? t
  38506. : 1 === (e /= n)
  38507. ? t + i
  38508. : (o || (o = 0.3 * n),
  38509. a < Math.abs(i)
  38510. ? ((a = i), (r = o / 4))
  38511. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  38512. -(
  38513. a *
  38514. Math.pow(2, 10 * (e -= 1)) *
  38515. Math.sin(((e * n - r) * (2 * Math.PI)) / o)
  38516. ) + t);
  38517. }),
  38518. (n.easeOutElastic = function (e, t, i, n) {
  38519. var r = 1.70158,
  38520. o = 0,
  38521. a = i;
  38522. return 0 === e
  38523. ? t
  38524. : 1 === (e /= n)
  38525. ? t + i
  38526. : (o || (o = 0.3 * n),
  38527. a < Math.abs(i)
  38528. ? ((a = i), (r = o / 4))
  38529. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  38530. a *
  38531. Math.pow(2, -10 * e) *
  38532. Math.sin(((e * n - r) * (2 * Math.PI)) / o) +
  38533. i +
  38534. t);
  38535. }),
  38536. (n.easeInOutElastic = function (e, t, i, n) {
  38537. var r = 1.70158,
  38538. o = 0,
  38539. a = i;
  38540. return 0 === e
  38541. ? t
  38542. : 2 === (e /= n / 2)
  38543. ? t + i
  38544. : (o || (o = n * (0.3 * 1.5)),
  38545. a < Math.abs(i)
  38546. ? ((a = i), (r = o / 4))
  38547. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  38548. e < 1
  38549. ? -0.5 *
  38550. (a *
  38551. Math.pow(2, 10 * (e -= 1)) *
  38552. Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  38553. t
  38554. : a *
  38555. Math.pow(2, -10 * (e -= 1)) *
  38556. Math.sin(((e * n - r) * (2 * Math.PI)) / o) *
  38557. 0.5 +
  38558. i +
  38559. t);
  38560. }),
  38561. (n.easeInBack = function (e, t, i, n, r) {
  38562. return (
  38563. void 0 === r && (r = 1.70158),
  38564. i * (e /= n) * e * ((r + 1) * e - r) + t
  38565. );
  38566. }),
  38567. (n.easeOutBack = function (e, t, i, n, r) {
  38568. return (
  38569. void 0 === r && (r = 1.70158),
  38570. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  38571. );
  38572. }),
  38573. (n.easeInOutBack = function (e, t, i, n, r) {
  38574. return (
  38575. void 0 === r && (r = 1.70158),
  38576. (e /= n / 2) < 1
  38577. ? (i / 2) * (e * e * (((r *= 1.525) + 1) * e - r)) + t
  38578. : (i / 2) * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) +
  38579. t
  38580. );
  38581. }),
  38582. (n.easeOutBounce = function (e, t, i, n) {
  38583. return (e /= n) < 1 / 2.75
  38584. ? i * (7.5625 * e * e) + t
  38585. : e < 2 / 2.75
  38586. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  38587. : e < 2.5 / 2.75
  38588. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  38589. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
  38590. }),
  38591. (n.easeInBounce = function (e, t, i, r) {
  38592. return i - n.easeOutBounce(r - e, 0, i, r) + t;
  38593. }),
  38594. (n.easeInOutBounce = function (e, t, i, r) {
  38595. return e < r / 2
  38596. ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t
  38597. : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t;
  38598. }),
  38599. (t.exports = n);
  38600. window.easing = n;
  38601. },
  38602. {},
  38603. ],
  38604. 187: [
  38605. function (e, t, i) {
  38606. "use strict";
  38607. function n() {
  38608. (this.events = []), (this.valid = !1);
  38609. }
  38610. var r = e("../enum/Joystick");
  38611. (n.prototype.push = function (e, t) {
  38612. this.events.push({
  38613. direction: e,
  38614. pano: t,
  38615. }),
  38616. (this.valid = !0);
  38617. }),
  38618. (n.prototype.pop = function (e) {
  38619. var t = this.events.pop();
  38620. return this.events.length < 1 && (this.valid = !1), t;
  38621. }),
  38622. (n.prototype.peek = function () {
  38623. return this.events.length
  38624. ? this.events[this.events.length - 1]
  38625. : {
  38626. direction: null,
  38627. pano: null,
  38628. };
  38629. }),
  38630. (n.prototype.invalidate = function () {
  38631. (this.events = []), (this.valid = !1);
  38632. }),
  38633. (n.prototype.reversePano = function (e) {
  38634. if (!this.valid) return null;
  38635. var t = this.peek();
  38636. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null;
  38637. }),
  38638. (t.exports = n);
  38639. },
  38640. {
  38641. "../enum/Joystick": 29,
  38642. },
  38643. ],
  38644. 188: [
  38645. function (e, t, i) {
  38646. "use strict";
  38647. window.lerp = t.exports = {
  38648. vector: function (e, t) {
  38649. var i = e.clone();
  38650. return (
  38651. (t = t.clone()),
  38652. function (n) {
  38653. e.set(
  38654. i.x * (1 - n) + t.x * n,
  38655. i.y * (1 - n) + t.y * n,
  38656. i.z * (1 - n) + t.z * n
  38657. );
  38658. }
  38659. );
  38660. },
  38661. quaternion: function (e, t) {
  38662. var i = e.clone();
  38663. return function (n) {
  38664. e.copy(i).slerp(t, n);
  38665. };
  38666. },
  38667. property: function (e, t, i, n) {
  38668. var r = e[t];
  38669. return function (o) {
  38670. (e[t] = r * (1 - o) + i * o), n && n(e[t]);
  38671. };
  38672. },
  38673. uniform: function (e, t, i) {
  38674. var n = e.material.uniforms[t].value;
  38675. return function (r) {
  38676. e.material.uniforms[t] &&
  38677. (e.material.uniforms[t].value = n * (1 - r) + i * r);
  38678. };
  38679. },
  38680. matrix4: function (e, t) {
  38681. var i = e.clone();
  38682. return function (n) {
  38683. for (
  38684. var r = e.elements, o = i.elements, a = t.elements, s = 0;
  38685. s < 16;
  38686. s++
  38687. )
  38688. r[s] = o[s] * (1 - n) + a[s] * n;
  38689. };
  38690. },
  38691. allUniforms: function (e, t, i) {
  38692. var n = e.map(
  38693. function (e) {
  38694. return this.uniform(e, t, i);
  38695. }.bind(this)
  38696. );
  38697. return function (e) {
  38698. n.forEach(function (t) {
  38699. t(e);
  38700. });
  38701. };
  38702. },
  38703. };
  38704. },
  38705. {},
  38706. ],
  38707. 189: [
  38708. function (e, t, i) {
  38709. "use strict";
  38710. function n(e) {
  38711. var t,
  38712. i,
  38713. o,
  38714. a,
  38715. s = e.split("/"),
  38716. l = "[" + s[s.length - 1].replace(".js", "") + "]",
  38717. c = {};
  38718. if (n.consoleEnabled) {
  38719. var h = function (e) {
  38720. $("#debug-console").append("<p>" + e + "</p>"),
  38721. ($("#debug-console")[0].scrollTop =
  38722. $("#debug-console")[0].scrollHeight);
  38723. };
  38724. (t = function (e) {
  38725. h(Array.prototype.slice.call(arguments).join(" "));
  38726. }),
  38727. (i = function (e) {
  38728. h(Array.prototype.slice.call(arguments).join(" "));
  38729. }),
  38730. (o = function (e) {
  38731. h("WARN: " + Array.prototype.slice.call(arguments).join(" "));
  38732. }),
  38733. (a = function (e) {
  38734. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "));
  38735. });
  38736. } else
  38737. console.log
  38738. ? ((t = console.log),
  38739. (i = console.info ? console.info : console.log),
  38740. (o = console.warn ? console.warn : console.log),
  38741. (a = console.error ? console.error : console.log))
  38742. : (t = i = o = a = function () {});
  38743. var u = function (e) {
  38744. return [l, n.timestamp()].concat(Array.prototype.slice.call(e));
  38745. },
  38746. d = function (t, i) {
  38747. if (r) {
  38748. var o = Array.prototype.slice.call(t).join(" ");
  38749. r.captureMessage(o, {
  38750. level: i,
  38751. path: e,
  38752. timestamp: n.timestamp(),
  38753. });
  38754. }
  38755. },
  38756. p = function (t, i) {
  38757. if (r) {
  38758. var o = Array.prototype.slice.call(t).join(" ");
  38759. r.captureException(new Error(o), {
  38760. level: i,
  38761. path: e,
  38762. timestamp: n.timestamp(),
  38763. });
  38764. }
  38765. };
  38766. return {
  38767. debug: function () {
  38768. n.level >= n.levels.debug && t.apply(console, u(arguments));
  38769. },
  38770. info: function () {
  38771. n.level >= n.levels.info && i.apply(console, u(arguments));
  38772. },
  38773. warn: function () {
  38774. d(arguments, "warn"),
  38775. n.level >= n.levels.warn && o.apply(console, u(arguments));
  38776. },
  38777. error: function () {
  38778. p(arguments, "error"),
  38779. n.level >= n.levels.error && a.apply(console, u(arguments));
  38780. },
  38781. v3str: function (e, t) {
  38782. var i = void 0 === t ? 2 : t;
  38783. return (
  38784. "(" +
  38785. e.x.toPrecision(i) +
  38786. ", " +
  38787. e.y.toPrecision(i) +
  38788. ", " +
  38789. e.z.toPrecision(i) +
  38790. ")"
  38791. );
  38792. },
  38793. eulstr: function (e, t) {
  38794. var i = void 0 === t ? 2 : t;
  38795. return (
  38796. "(" +
  38797. THREE.Math.radToDeg(e.x).toPrecision(i) +
  38798. ", " +
  38799. THREE.Math.radToDeg(e.y).toPrecision(i) +
  38800. ", " +
  38801. THREE.Math.radToDeg(e.z).toPrecision(i) +
  38802. ' "' +
  38803. e.order +
  38804. '")'
  38805. );
  38806. },
  38807. time: function (e) {
  38808. n.level >= n.levels.debug && (c[e] = Date.now());
  38809. },
  38810. timeEnd: function (e) {
  38811. if (n.level >= n.levels.debug) {
  38812. var t = c[e];
  38813. if (!t) return;
  38814. var i = (Date.now() - t) / 1e3;
  38815. this.debug(e, i + "s");
  38816. }
  38817. },
  38818. };
  38819. }
  38820. var r = window.Raven;
  38821. (n.timestamp = function () {
  38822. return (Date.now() - window.navigationStart) / 1e3 + "s";
  38823. }),
  38824. (n.levels = {
  38825. debug: 3,
  38826. info: 2,
  38827. warn: 1,
  38828. error: 0,
  38829. }),
  38830. (n.level = n.levels.info),
  38831. (t.exports = n);
  38832. },
  38833. {},
  38834. ],
  38835. 190: [
  38836. function (e, t, i) {
  38837. "use strict";
  38838. var n = e("three"),
  38839. r = e("../enum/GLCubeFaces"),
  38840. o = e("../constants");
  38841. t.exports = {
  38842. convertVisionVector: function (e) {
  38843. return new n.Vector3(e.x, e.z, -e.y);
  38844. },
  38845. convertVisionQuaternion: function (e) {
  38846. return new n.Quaternion(e.x, e.z, -e.y, e.w).multiply(
  38847. new n.Quaternion().setFromAxisAngle(
  38848. new n.Vector3(0, 1, 0),
  38849. n.Math.degToRad(90)
  38850. )
  38851. );
  38852. },
  38853. convertWorkshopVector: function (e) {
  38854. return new n.Vector3(-e.x, e.y, e.z);
  38855. },
  38856. convertWorkshopQuaternion: function (e) {
  38857. return new n.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  38858. new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  38859. );
  38860. },
  38861. convertWorkshopPanoramaQuaternion: function (e) {
  38862. return new n.Quaternion(e.x, -e.y, -e.z, e.w)
  38863. .normalize()
  38864. .multiply(
  38865. new n.Quaternion().setFromAxisAngle(
  38866. new n.Vector3(0, 1, 0),
  38867. n.Math.degToRad(270)
  38868. )
  38869. );
  38870. },
  38871. convertWorkshopOrthoZoom: function (e) {
  38872. // xzw
  38873. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  38874. //return e;
  38875. return e === -1
  38876. ? -1
  38877. : ((e * ($("#player").width() / $("#player").height())) /
  38878. g_snapShotWidth) *
  38879. g_snapShotHeight;
  38880. },
  38881. toPrecision: function (e, t) {
  38882. //xzw change
  38883. var f = function (e, t) {
  38884. var i = Math.pow(10, t);
  38885. return Math.round(e * i) / i;
  38886. };
  38887. if (e instanceof Array) {
  38888. for (var s = 0; s < e.length; s++) {
  38889. e[s] = f(e[s], t);
  38890. }
  38891. return e;
  38892. } else return f(e, t);
  38893. },
  38894. isEmptyQuaternion: function (e) {
  38895. return (
  38896. 0 === Math.abs(e.x) &&
  38897. 0 === Math.abs(e.y) &&
  38898. 0 === Math.abs(e.z) &&
  38899. 0 === Math.abs(e.w)
  38900. );
  38901. },
  38902. projectPositionToCanvas: function (e, t, i) {
  38903. (i = i || new n.Vector3()), i.copy(e);
  38904. var r = 0.5 * $("#player").width(),
  38905. o = 0.5 * $("#player").height();
  38906. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i;
  38907. },
  38908. convertScreenPositionToNDC: function (e, t, i) {
  38909. return (
  38910. (i = i || new n.Vector2()),
  38911. (i.x = (e / $("#player").width()) * 2 - 1),
  38912. (i.y = 2 * -(t / $("#player").height()) + 1),
  38913. i
  38914. );
  38915. },
  38916. constrainedTurn: function (e) {
  38917. var t = e % (2 * Math.PI);
  38918. return (t =
  38919. t > Math.PI
  38920. ? (t -= 2 * Math.PI)
  38921. : t < -Math.PI
  38922. ? (t += 2 * Math.PI)
  38923. : t);
  38924. },
  38925. getFOVDotThreshold: function (e) {
  38926. return Math.cos(n.Math.degToRad(e / 2));
  38927. },
  38928. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  38929. switch (e) {
  38930. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  38931. i.set(1, t.y, t.x);
  38932. break;
  38933. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  38934. i.set(-1, t.y, -t.x);
  38935. break;
  38936. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  38937. i.set(-t.x, 1, -t.y);
  38938. break;
  38939. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  38940. i.set(-t.x, -1, t.y);
  38941. break;
  38942. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  38943. i.set(-t.x, t.y, 1);
  38944. break;
  38945. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  38946. i.set(t.x, t.y, -1);
  38947. }
  38948. n && i.normalize();
  38949. },
  38950. //add:
  38951. getPos2d: function (point, camera, dom) {
  38952. var camera = camera;
  38953. var dom = dom;
  38954. var pos = point.clone().project(camera); //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  38955. var x, y;
  38956. x = ((pos.x + 1) / 2) * dom.clientWidth;
  38957. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  38958. var inSight =
  38959. x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0;
  38960. return {
  38961. pos: new THREE.Vector2(x, y),
  38962. vector: pos,
  38963. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  38964. inSight: inSight, //在屏幕范围内可见
  38965. };
  38966. },
  38967. getDirByLonLat: function (lon, lat) {
  38968. var dir = new THREE.Vector3();
  38969. var phi = THREE.Math.degToRad(90 - lat);
  38970. var theta = THREE.Math.degToRad(lon);
  38971. dir.x = Math.sin(phi) * Math.cos(theta);
  38972. dir.y = Math.cos(phi);
  38973. dir.z = Math.sin(phi) * Math.sin(theta);
  38974. return dir.negate();
  38975. },
  38976. };
  38977. window.math = t.exports;
  38978. },
  38979. {
  38980. "../constants": 8,
  38981. "../enum/GLCubeFaces": 25,
  38982. three: 217,
  38983. },
  38984. ],
  38985. 191: [
  38986. function (e, t, i) {
  38987. "use strict";
  38988. function n(e, t, i) {
  38989. return a.map(
  38990. function (n, o) {
  38991. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg");
  38992. }.bind(this)
  38993. );
  38994. }
  38995. function r(e) {
  38996. return s[e];
  38997. }
  38998. var o = e("../enum/GLCubeFaces"),
  38999. a = [0, 1, 2, 3, 4, 5],
  39000. s = {
  39001. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  39002. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  39003. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  39004. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  39005. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  39006. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  39007. };
  39008. t.exports = {
  39009. mapFaceToCubemapFace: r,
  39010. getCubemapUrls: n,
  39011. };
  39012. },
  39013. {
  39014. "../enum/GLCubeFaces": 25,
  39015. },
  39016. ],
  39017. 192: [
  39018. function (e, t, i) {
  39019. "use strict";
  39020. t.exports = {
  39021. captureErrors: function (e, t, i) {
  39022. if ("Raven" in window) {
  39023. Raven.config(e, t).install(), i && Raven.setTagsContext(i);
  39024. var n = console.warn,
  39025. r = console.error;
  39026. (console.warn = function () {
  39027. var e = Array.prototype.slice.call(arguments);
  39028. Raven.captureMessage(e.join(" "), {
  39029. level: "warning",
  39030. }),
  39031. n.apply(console, e);
  39032. }),
  39033. (console.error = function () {
  39034. var e = Array.prototype.slice.call(arguments);
  39035. Raven.captureException(new Error(e.join(" ")), {
  39036. level: "error",
  39037. }),
  39038. r.apply(console, e);
  39039. });
  39040. } else console.error("Raven not found, not capturing errors.");
  39041. },
  39042. };
  39043. },
  39044. {},
  39045. ],
  39046. 193: [
  39047. function (e, t, i) {
  39048. (function (i) {
  39049. "use strict";
  39050. var n = e("./browser"),
  39051. r = e("../constants"),
  39052. o = e("url"),
  39053. a = e("./logger"),
  39054. ss = e("three"),
  39055. s = new a(i),
  39056. l = {
  39057. getAuthorizationHeader: function () {
  39058. var e = n.valueFromHash("auth");
  39059. if (e) return e.replace(",", " ");
  39060. var t = n.valueFromCookie("token");
  39061. return t ? "Token " + t : null;
  39062. },
  39063. parseSidUrl: function (e) {
  39064. var t, i;
  39065. t = g_Prefix;
  39066. if (((e = e || ""), e.match(/^https?/))) {
  39067. var n = o.parse(e);
  39068. (t = g_Prefix), (i = e);
  39069. } else {
  39070. //xzw 原先的不能用
  39071. //t = window.location.protocol + "//" + window.location.host, //MP
  39072. t = g_Prefix;
  39073. //i = t + "/api/player/models/" + e; //MP
  39074. i = t + "data/" + e;
  39075. }
  39076. return {
  39077. urlBase: t,
  39078. urlModel: i,
  39079. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  39080. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb"),
  39081. };
  39082. },
  39083. getModelIDFromQueryString: function () {
  39084. return n.valueFromHash("model") || n.valueFromHash("m");
  39085. },
  39086. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  39087. e = JSON.parse(JSON.stringify(e));
  39088. var i = null;
  39089. if (e.images.forEach(function(n) {
  39090. if(!n.metadata) return;
  39091. if ("string" == typeof n.metadata)
  39092. try {
  39093. n.metadata = JSON.parse(n.metadata)
  39094. } catch (e) {
  39095. s.warn("Unable to parse image metadata"),
  39096. n.metadata = null
  39097. }
  39098. else{
  39099. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  39100. }
  39101. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  39102. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  39103. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  39104. }else{
  39105. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  39106. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  39107. n.metadata.zoom = n.metadata.zoom || 1;
  39108. }
  39109. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  39110. }),
  39111. //icon初始视角的:
  39112. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  39113. var n = {};
  39114. n.pano = {
  39115. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  39116. position: t.convertWorkshopVector(i.scan_position),
  39117. uuid: i.scan_id
  39118. },
  39119. n.camera = {
  39120. quaternion: i.camera_quaternion,
  39121. position: i.camera_position
  39122. },
  39123. e.startPano = n
  39124. }
  39125. return e
  39126. },
  39127. */
  39128. normalizeModeldata: function (e, t) {
  39129. //xzw 修改导览images数据
  39130. e = JSON.parse(JSON.stringify(e));
  39131. var i = null;
  39132. var deal = function (n) {
  39133. if (!n.metadata) return;
  39134. if ("string" == typeof n.metadata)
  39135. try {
  39136. n.metadata = JSON.parse(n.metadata);
  39137. } catch (e) {
  39138. s.warn("Unable to parse image metadata"),
  39139. (n.metadata = null);
  39140. }
  39141. else {
  39142. "object" == typeof n.metadata &&
  39143. s.debug("image.metadata already a JSON object");
  39144. }
  39145. if (n.metadata.camera_position instanceof Array) {
  39146. //xzw 改的格式
  39147. n.metadata.camera_position = new ss.Vector3().fromArray(
  39148. n.metadata.camera_position
  39149. );
  39150. n.metadata.camera_quaternion =
  39151. new ss.Quaternion().fromArray(
  39152. n.metadata.camera_quaternion
  39153. );
  39154. } else {
  39155. n.metadata.camera_position = new ss.Vector3().copy(
  39156. n.metadata.camera_position
  39157. );
  39158. n.metadata.camera_quaternion = new ss.Quaternion().copy(
  39159. n.metadata.camera_quaternion
  39160. );
  39161. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  39162. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  39163. }
  39164. !i && e.icon && e.icon === n.sid && (i = n.metadata);
  39165. };
  39166. //改
  39167. e.images.forEach((info) => {
  39168. if (info.locations) {
  39169. info.locations.forEach((a) => deal(a));
  39170. } else {
  39171. deal(info);
  39172. }
  39173. });
  39174. //icon初始视角的:
  39175. if (
  39176. i &&
  39177. i.camera_quaternion &&
  39178. i.camera_position &&
  39179. i.scan_position &&
  39180. i.scan_quaternion
  39181. ) {
  39182. var n = {};
  39183. (n.pano = {
  39184. quaternion: t.convertWorkshopPanoramaQuaternion(
  39185. i.scan_quaternion
  39186. ),
  39187. position: t.convertWorkshopVector(i.scan_position),
  39188. uuid: i.scan_id,
  39189. }),
  39190. (n.camera = {
  39191. quaternion: i.camera_quaternion,
  39192. position: i.camera_position,
  39193. }),
  39194. (e.startPano = n);
  39195. }
  39196. return e;
  39197. },
  39198. visionVersionToInt: (function () {
  39199. var e = new RegExp(
  39200. ["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")
  39201. );
  39202. return function (t) {
  39203. if (!t) throw new Error("Vision version is required");
  39204. var i = e.exec(t);
  39205. if (null === i)
  39206. throw new Error("String is not a vision version: " + t);
  39207. return parseInt(i[1]);
  39208. };
  39209. })(),
  39210. modelDataPromisesTiles: function (e) {
  39211. var vision_version =
  39212. e.vision_version || window.DATA.vision_version;
  39213. if (vision_version)
  39214. try {
  39215. return (
  39216. l.visionVersionToInt(vision_version) >=
  39217. l.visionVersionToInt(r.visionTilingStartVersion)
  39218. );
  39219. } catch (t) {
  39220. s.warn("Invalid vision version: " + vision_version);
  39221. }
  39222. // var t = e.created ? new Date(e.created) : null;
  39223. // return t && t >= r.visionTilingStartDate
  39224. return false;
  39225. },
  39226. };
  39227. t.exports = l;
  39228. }).call(this, "/js/util/showcase.js");
  39229. },
  39230. {
  39231. "../constants": 8,
  39232. "./browser": 182,
  39233. "./logger": 189,
  39234. three: 217,
  39235. url: 208,
  39236. },
  39237. ],
  39238. 194: [
  39239. function (e, t, i) {
  39240. "use strict";
  39241. var n = e("../util/ajax"),
  39242. r = e("three"),
  39243. o = e("../settings"),
  39244. a = {};
  39245. t.exports = {
  39246. load: function (e, t, i) {
  39247. var s = a[e];
  39248. return s
  39249. ? (t &&
  39250. setTimeout(function () {
  39251. t(s);
  39252. }, 1),
  39253. s)
  39254. : ((s = new r.Texture()),
  39255. o.minimalMemoryMode &&
  39256. ((s.minFilter = r.LinearFilter),
  39257. (s.magFilter = r.LinearFilter),
  39258. (s.generateMipmaps = !1)),
  39259. (s.sourceFile = e),
  39260. (a[e] = s),
  39261. n
  39262. .getImage(e)
  39263. .then(function (e) {
  39264. (s.image = e), (s.needsUpdate = !0), t && t(s);
  39265. })
  39266. .fail(i),
  39267. s);
  39268. },
  39269. loadBase64: function (e, t) {
  39270. t = t || "png";
  39271. var i = new r.Texture();
  39272. return (
  39273. (i.image = document.createElement("img")),
  39274. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  39275. o.minimalMemoryMode &&
  39276. ((i.minFilter = r.LinearFilter),
  39277. (i.magFilter = r.LinearFilter),
  39278. (i.generateMipmaps = !1)),
  39279. (i.needsUpdate = !0),
  39280. i
  39281. );
  39282. },
  39283. isLoaded: function (e) {
  39284. return !!a[e];
  39285. },
  39286. };
  39287. window.Texture = t.exports;
  39288. },
  39289. {
  39290. "../settings": 166,
  39291. "../util/ajax": 181,
  39292. three: 217,
  39293. },
  39294. ],
  39295. 195: [
  39296. function (e, t, i) {
  39297. "use strict";
  39298. var n = e("./easing");
  39299. window.transitions = t.exports = {
  39300. globalDone: null,
  39301. funcs: [],
  39302. counter: 0,
  39303. uniqueID: 0,
  39304. start: function (e, t, i, r, o, a, s) {
  39305. return (
  39306. (r = r || 0),
  39307. this.funcs.push({
  39308. func: e,
  39309. current: -r * Math.abs(t),
  39310. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  39311. done: i,
  39312. easing: o || n.linearTween,
  39313. cycling: t < 0,
  39314. running: !0,
  39315. debug: r < 0,
  39316. name: a || "T" + this.counter,
  39317. id: void 0 === s ? this.counter : s,
  39318. paused: !1,
  39319. }),
  39320. e(0, 16),
  39321. (this.counter += 1),
  39322. e
  39323. );
  39324. },
  39325. trigger: function (e) {
  39326. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  39327. i = e.func || function () {},
  39328. r = void 0 === e.duration ? 0 : e.duration;
  39329. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  39330. var o = e.done || null,
  39331. a = e.easing || n.linearTween,
  39332. s = e.name || "R" + this.counter,
  39333. l = void 0 === e.id ? this.counter : e.id;
  39334. return this.start(i, r, o, t, a, s, l);
  39335. },
  39336. setTimeout: function (e, t, i) {
  39337. var n = void 0 === i ? this.counter : i;
  39338. return this.trigger({
  39339. done: e,
  39340. duration: void 0 === t ? 0 : t,
  39341. name: "O" + this.counter,
  39342. id: n,
  39343. });
  39344. },
  39345. pause: function () {
  39346. this.paused = !0;
  39347. },
  39348. resume: function () {
  39349. this.paused = !1;
  39350. },
  39351. update: function (e) {
  39352. this.funcs.forEach(function (t) {
  39353. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  39354. if (t.current >= t.duration && !t.cycling) {
  39355. var i = t.easing(1, 0, 1, 1);
  39356. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1);
  39357. } else {
  39358. var n = t.easing(
  39359. (t.current % t.duration) / t.duration,
  39360. 0,
  39361. 1,
  39362. 1
  39363. ),
  39364. r = t.func(n, 1e3 * e) || !1;
  39365. r && (t.done && t.done(), (t.running = !1));
  39366. }
  39367. });
  39368. var t = this.funcs.length;
  39369. this.funcs = this.funcs.filter(function (e) {
  39370. return e.running;
  39371. });
  39372. var i = this.funcs.length;
  39373. if (t > 0 && 0 === i && this.globalDone) {
  39374. var n = this.globalDone;
  39375. (this.globalDone = null), n();
  39376. }
  39377. },
  39378. adjustSpeed: function (e, t) {
  39379. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  39380. var r = i[n];
  39381. (r.duration /= t), (r.current /= t);
  39382. }
  39383. },
  39384. getById: function (e) {
  39385. return this.funcs.filter(function (t) {
  39386. return e === t.id;
  39387. });
  39388. },
  39389. get: function (e) {
  39390. for (var t = 0; t < this.funcs.length; t += 1)
  39391. if (this.funcs[t].func === e) return this.funcs[t];
  39392. return null;
  39393. },
  39394. isRunning: function (e) {
  39395. var t = this.get(e);
  39396. return null !== t && t.running;
  39397. },
  39398. countActive: function () {
  39399. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  39400. e += this.funcs[t].running;
  39401. return e;
  39402. },
  39403. listActive: function () {
  39404. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  39405. this.funcs[t].running && e.push(this.funcs[t].name);
  39406. return e;
  39407. },
  39408. done: function (e) {
  39409. this.globalDone = e;
  39410. },
  39411. cancelById: function (e) {
  39412. var t = void 0 === e ? 0 : e;
  39413. this.funcs = this.funcs.filter(function (e) {
  39414. return e.id !== t;
  39415. });
  39416. },
  39417. cancel: function (e) {
  39418. this.funcs = this.funcs.filter(function (t) {
  39419. return t.func !== e;
  39420. });
  39421. },
  39422. getUniqueId: function () {
  39423. return (this.uniqueID -= 1), this.uniqueID;
  39424. },
  39425. };
  39426. },
  39427. {
  39428. "./easing": 186,
  39429. },
  39430. ],
  39431. 196: [
  39432. function (e, t, i) {
  39433. function n(e) {
  39434. if (
  39435. ((this.set = {}),
  39436. (this.infContains = function () {
  39437. return !0;
  39438. }),
  39439. "object" == typeof e)
  39440. )
  39441. if (e instanceof Array)
  39442. for (var t = 0; t < e.length; t++) this.set[e[t]] = !0;
  39443. else this.set = e;
  39444. else if ("function" == typeof e) this.infContains = e;
  39445. else if ("undefined" != typeof e)
  39446. throw new Error("set must be either an array or an object.");
  39447. }
  39448. (t.exports = n),
  39449. (n.prototype.contains = function (e) {
  39450. return !!this.set[e];
  39451. }),
  39452. (n.prototype.has = n.prototype.contains),
  39453. (n.prototype.add = function (e) {
  39454. if (1 == arguments.length) this.set[e] = !0;
  39455. else
  39456. for (var t = 0; t < arguments.length; t++)
  39457. this.set[arguments[t]] = !0;
  39458. }),
  39459. (n.prototype.addAll = function (e) {
  39460. if ("object" != typeof e && !(e instanceof Array))
  39461. throw new Error("arr must be an array.");
  39462. for (var t = 0; t < e.length; t++) this.add(e[t]);
  39463. }),
  39464. (n.prototype.remove = function (e) {
  39465. if (1 == arguments.length) delete this.set[e];
  39466. else
  39467. for (var t = 0; t < arguments.length; t++)
  39468. delete this.set[arguments[t]];
  39469. }),
  39470. (n.prototype.delete = n.prototype.remove),
  39471. (n.prototype.clear = function () {
  39472. this.set = {};
  39473. }),
  39474. (n.prototype.size = function () {
  39475. return Object.keys(this.set).length;
  39476. }),
  39477. (n.prototype.toString = function () {
  39478. return "{" + Object.keys(this.set).toString() + "}";
  39479. }),
  39480. (n.prototype.toArray = function () {
  39481. return "undefined" == typeof this.set ? [] : Object.keys(this.set);
  39482. }),
  39483. (n.prototype["*values"] = n.prototype.toArray);
  39484. },
  39485. {},
  39486. ],
  39487. 197: [function (e, t, i) {}, {}],
  39488. 198: [
  39489. function (e, t, i) {
  39490. (function (t) {
  39491. "use strict";
  39492. function n() {
  39493. try {
  39494. var e = new Uint8Array(1);
  39495. return (
  39496. (e.__proto__ = {
  39497. __proto__: Uint8Array.prototype,
  39498. foo: function () {
  39499. return 42;
  39500. },
  39501. }),
  39502. 42 === e.foo() &&
  39503. "function" == typeof e.subarray &&
  39504. 0 === e.subarray(1, 1).byteLength
  39505. );
  39506. } catch (e) {
  39507. return !1;
  39508. }
  39509. }
  39510. function r() {
  39511. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
  39512. }
  39513. function o(e, t) {
  39514. if (r() < t) throw new RangeError("Invalid typed array length");
  39515. return (
  39516. a.TYPED_ARRAY_SUPPORT
  39517. ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype))
  39518. : (null === e && (e = new a(t)), (e.length = t)),
  39519. e
  39520. );
  39521. }
  39522. function a(e, t, i) {
  39523. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  39524. return new a(e, t, i);
  39525. if ("number" == typeof e) {
  39526. if ("string" == typeof t)
  39527. throw new Error(
  39528. "If encoding is specified then the first argument must be a string"
  39529. );
  39530. return h(this, e);
  39531. }
  39532. return s(this, e, t, i);
  39533. }
  39534. function s(e, t, i, n) {
  39535. if ("number" == typeof t)
  39536. throw new TypeError('"value" argument must not be a number');
  39537. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer
  39538. ? p(e, t, i, n)
  39539. : "string" == typeof t
  39540. ? u(e, t, i)
  39541. : f(e, t);
  39542. }
  39543. function l(e) {
  39544. if ("number" != typeof e)
  39545. throw new TypeError('"size" argument must be a number');
  39546. if (e < 0)
  39547. throw new RangeError('"size" argument must not be negative');
  39548. }
  39549. function c(e, t, i, n) {
  39550. return (
  39551. l(t),
  39552. t <= 0
  39553. ? o(e, t)
  39554. : void 0 !== i
  39555. ? "string" == typeof n
  39556. ? o(e, t).fill(i, n)
  39557. : o(e, t).fill(i)
  39558. : o(e, t)
  39559. );
  39560. }
  39561. function h(e, t) {
  39562. if (
  39563. (l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT)
  39564. )
  39565. for (var i = 0; i < t; ++i) e[i] = 0;
  39566. return e;
  39567. }
  39568. function u(e, t, i) {
  39569. if (
  39570. (("string" == typeof i && "" !== i) || (i = "utf8"),
  39571. !a.isEncoding(i))
  39572. )
  39573. throw new TypeError('"encoding" must be a valid string encoding');
  39574. var n = 0 | v(t, i);
  39575. e = o(e, n);
  39576. var r = e.write(t, i);
  39577. return r !== n && (e = e.slice(0, r)), e;
  39578. }
  39579. function d(e, t) {
  39580. var i = t.length < 0 ? 0 : 0 | g(t.length);
  39581. e = o(e, i);
  39582. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n];
  39583. return e;
  39584. }
  39585. function p(e, t, i, n) {
  39586. if ((t.byteLength, i < 0 || t.byteLength < i))
  39587. throw new RangeError("'offset' is out of bounds");
  39588. if (t.byteLength < i + (n || 0))
  39589. throw new RangeError("'length' is out of bounds");
  39590. return (
  39591. (t =
  39592. void 0 === i && void 0 === n
  39593. ? new Uint8Array(t)
  39594. : void 0 === n
  39595. ? new Uint8Array(t, i)
  39596. : new Uint8Array(t, i, n)),
  39597. a.TYPED_ARRAY_SUPPORT
  39598. ? ((e = t), (e.__proto__ = a.prototype))
  39599. : (e = d(e, t)),
  39600. e
  39601. );
  39602. }
  39603. function f(e, t) {
  39604. if (a.isBuffer(t)) {
  39605. var i = 0 | g(t.length);
  39606. return (
  39607. (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e)
  39608. );
  39609. }
  39610. if (t) {
  39611. if (
  39612. ("undefined" != typeof ArrayBuffer &&
  39613. t.buffer instanceof ArrayBuffer) ||
  39614. "length" in t
  39615. )
  39616. return "number" != typeof t.length || K(t.length)
  39617. ? o(e, 0)
  39618. : d(e, t);
  39619. if ("Buffer" === t.type && $(t.data)) return d(e, t.data);
  39620. }
  39621. throw new TypeError(
  39622. "First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object."
  39623. );
  39624. }
  39625. function g(e) {
  39626. if (e >= r())
  39627. throw new RangeError(
  39628. "Attempt to allocate Buffer larger than maximum size: 0x" +
  39629. r().toString(16) +
  39630. " bytes"
  39631. );
  39632. return 0 | e;
  39633. }
  39634. function m(e) {
  39635. return +e != e && (e = 0), a.alloc(+e);
  39636. }
  39637. function v(e, t) {
  39638. if (a.isBuffer(e)) return e.length;
  39639. if (
  39640. "undefined" != typeof ArrayBuffer &&
  39641. "function" == typeof ArrayBuffer.isView &&
  39642. (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
  39643. )
  39644. return e.byteLength;
  39645. "string" != typeof e && (e = "" + e);
  39646. var i = e.length;
  39647. if (0 === i) return 0;
  39648. for (var n = !1; ; )
  39649. switch (t) {
  39650. case "ascii":
  39651. case "latin1":
  39652. case "binary":
  39653. return i;
  39654. case "utf8":
  39655. case "utf-8":
  39656. case void 0:
  39657. return j(e).length;
  39658. case "ucs2":
  39659. case "ucs-2":
  39660. case "utf16le":
  39661. case "utf-16le":
  39662. return 2 * i;
  39663. case "hex":
  39664. return i >>> 1;
  39665. case "base64":
  39666. return Z(e).length;
  39667. default:
  39668. if (n) return j(e).length;
  39669. (t = ("" + t).toLowerCase()), (n = !0);
  39670. }
  39671. }
  39672. function A(e, t, i) {
  39673. var n = !1;
  39674. if (((void 0 === t || t < 0) && (t = 0), t > this.length))
  39675. return "";
  39676. if (
  39677. ((void 0 === i || i > this.length) && (i = this.length), i <= 0)
  39678. )
  39679. return "";
  39680. if (((i >>>= 0), (t >>>= 0), i <= t)) return "";
  39681. for (e || (e = "utf8"); ; )
  39682. switch (e) {
  39683. case "hex":
  39684. return L(this, t, i);
  39685. case "utf8":
  39686. case "utf-8":
  39687. return M(this, t, i);
  39688. case "ascii":
  39689. return P(this, t, i);
  39690. case "latin1":
  39691. case "binary":
  39692. return O(this, t, i);
  39693. case "base64":
  39694. return S(this, t, i);
  39695. case "ucs2":
  39696. case "ucs-2":
  39697. case "utf16le":
  39698. case "utf-16le":
  39699. return D(this, t, i);
  39700. default:
  39701. if (n) throw new TypeError("Unknown encoding: " + e);
  39702. (e = (e + "").toLowerCase()), (n = !0);
  39703. }
  39704. }
  39705. function y(e, t, i) {
  39706. var n = e[t];
  39707. (e[t] = e[i]), (e[i] = n);
  39708. }
  39709. function C(e, t, i, n, r) {
  39710. if (0 === e.length) return -1;
  39711. if (
  39712. ("string" == typeof i
  39713. ? ((n = i), (i = 0))
  39714. : i > 2147483647
  39715. ? (i = 2147483647)
  39716. : i < -2147483648 && (i = -2147483648),
  39717. (i = +i),
  39718. isNaN(i) && (i = r ? 0 : e.length - 1),
  39719. i < 0 && (i = e.length + i),
  39720. i >= e.length)
  39721. ) {
  39722. if (r) return -1;
  39723. i = e.length - 1;
  39724. } else if (i < 0) {
  39725. if (!r) return -1;
  39726. i = 0;
  39727. }
  39728. if (("string" == typeof t && (t = a.from(t, n)), a.isBuffer(t)))
  39729. return 0 === t.length ? -1 : I(e, t, i, n, r);
  39730. if ("number" == typeof t)
  39731. return (
  39732. (t &= 255),
  39733. a.TYPED_ARRAY_SUPPORT &&
  39734. "function" == typeof Uint8Array.prototype.indexOf
  39735. ? r
  39736. ? Uint8Array.prototype.indexOf.call(e, t, i)
  39737. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  39738. : I(e, [t], i, n, r)
  39739. );
  39740. throw new TypeError("val must be string, number or Buffer");
  39741. }
  39742. function I(e, t, i, n, r) {
  39743. function o(e, t) {
  39744. return 1 === a ? e[t] : e.readUInt16BE(t * a);
  39745. }
  39746. var a = 1,
  39747. s = e.length,
  39748. l = t.length;
  39749. if (
  39750. void 0 !== n &&
  39751. ((n = String(n).toLowerCase()),
  39752. "ucs2" === n ||
  39753. "ucs-2" === n ||
  39754. "utf16le" === n ||
  39755. "utf-16le" === n)
  39756. ) {
  39757. if (e.length < 2 || t.length < 2) return -1;
  39758. (a = 2), (s /= 2), (l /= 2), (i /= 2);
  39759. }
  39760. var c;
  39761. if (r) {
  39762. var h = -1;
  39763. for (c = i; c < s; c++)
  39764. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  39765. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a;
  39766. } else h !== -1 && (c -= c - h), (h = -1);
  39767. } else
  39768. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  39769. for (var u = !0, d = 0; d < l; d++)
  39770. if (o(e, c + d) !== o(t, d)) {
  39771. u = !1;
  39772. break;
  39773. }
  39774. if (u) return c;
  39775. }
  39776. return -1;
  39777. }
  39778. function E(e, t, i, n) {
  39779. i = Number(i) || 0;
  39780. var r = e.length - i;
  39781. n ? ((n = Number(n)), n > r && (n = r)) : (n = r);
  39782. var o = t.length;
  39783. if (o % 2 !== 0) throw new TypeError("Invalid hex string");
  39784. n > o / 2 && (n = o / 2);
  39785. for (var a = 0; a < n; ++a) {
  39786. var s = parseInt(t.substr(2 * a, 2), 16);
  39787. if (isNaN(s)) return a;
  39788. e[i + a] = s;
  39789. }
  39790. return a;
  39791. }
  39792. function b(e, t, i, n) {
  39793. return q(j(t, e.length - i), e, i, n);
  39794. }
  39795. function w(e, t, i, n) {
  39796. return q(Y(t), e, i, n);
  39797. }
  39798. function _(e, t, i, n) {
  39799. return w(e, t, i, n);
  39800. }
  39801. function T(e, t, i, n) {
  39802. return q(Z(t), e, i, n);
  39803. }
  39804. function x(e, t, i, n) {
  39805. return q(X(t, e.length - i), e, i, n);
  39806. }
  39807. function S(e, t, i) {
  39808. return 0 === t && i === e.length
  39809. ? Q.fromByteArray(e)
  39810. : Q.fromByteArray(e.slice(t, i));
  39811. }
  39812. function M(e, t, i) {
  39813. i = Math.min(e.length, i);
  39814. for (var n = [], r = t; r < i; ) {
  39815. var o = e[r],
  39816. a = null,
  39817. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  39818. if (r + s <= i) {
  39819. var l, c, h, u;
  39820. switch (s) {
  39821. case 1:
  39822. o < 128 && (a = o);
  39823. break;
  39824. case 2:
  39825. (l = e[r + 1]),
  39826. 128 === (192 & l) &&
  39827. ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u));
  39828. break;
  39829. case 3:
  39830. (l = e[r + 1]),
  39831. (c = e[r + 2]),
  39832. 128 === (192 & l) &&
  39833. 128 === (192 & c) &&
  39834. ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)),
  39835. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  39836. break;
  39837. case 4:
  39838. (l = e[r + 1]),
  39839. (c = e[r + 2]),
  39840. (h = e[r + 3]),
  39841. 128 === (192 & l) &&
  39842. 128 === (192 & c) &&
  39843. 128 === (192 & h) &&
  39844. ((u =
  39845. ((15 & o) << 18) |
  39846. ((63 & l) << 12) |
  39847. ((63 & c) << 6) |
  39848. (63 & h)),
  39849. u > 65535 && u < 1114112 && (a = u));
  39850. }
  39851. }
  39852. null === a
  39853. ? ((a = 65533), (s = 1))
  39854. : a > 65535 &&
  39855. ((a -= 65536),
  39856. n.push(((a >>> 10) & 1023) | 55296),
  39857. (a = 56320 | (1023 & a))),
  39858. n.push(a),
  39859. (r += s);
  39860. }
  39861. return R(n);
  39862. }
  39863. function R(e) {
  39864. var t = e.length;
  39865. if (t <= ee) return String.fromCharCode.apply(String, e);
  39866. for (var i = "", n = 0; n < t; )
  39867. i += String.fromCharCode.apply(String, e.slice(n, (n += ee)));
  39868. return i;
  39869. }
  39870. function P(e, t, i) {
  39871. var n = "";
  39872. i = Math.min(e.length, i);
  39873. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r]);
  39874. return n;
  39875. }
  39876. function O(e, t, i) {
  39877. var n = "";
  39878. i = Math.min(e.length, i);
  39879. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r]);
  39880. return n;
  39881. }
  39882. function L(e, t, i) {
  39883. var n = e.length;
  39884. (!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n);
  39885. for (var r = "", o = t; o < i; ++o) r += W(e[o]);
  39886. return r;
  39887. }
  39888. function D(e, t, i) {
  39889. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  39890. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  39891. return r;
  39892. }
  39893. function N(e, t, i) {
  39894. if (e % 1 !== 0 || e < 0)
  39895. throw new RangeError("offset is not uint");
  39896. if (e + t > i)
  39897. throw new RangeError("Trying to access beyond buffer length");
  39898. }
  39899. function B(e, t, i, n, r, o) {
  39900. if (!a.isBuffer(e))
  39901. throw new TypeError(
  39902. '"buffer" argument must be a Buffer instance'
  39903. );
  39904. if (t > r || t < o)
  39905. throw new RangeError('"value" argument is out of bounds');
  39906. if (i + n > e.length) throw new RangeError("Index out of range");
  39907. }
  39908. function F(e, t, i, n) {
  39909. t < 0 && (t = 65535 + t + 1);
  39910. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  39911. e[i + r] =
  39912. (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r));
  39913. }
  39914. function V(e, t, i, n) {
  39915. t < 0 && (t = 4294967295 + t + 1);
  39916. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  39917. e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255;
  39918. }
  39919. function U(e, t, i, n, r, o) {
  39920. if (i + n > e.length) throw new RangeError("Index out of range");
  39921. if (i < 0) throw new RangeError("Index out of range");
  39922. }
  39923. function k(e, t, i, n, r) {
  39924. return (
  39925. r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  39926. J.write(e, t, i, n, 23, 4),
  39927. i + 4
  39928. );
  39929. }
  39930. function H(e, t, i, n, r) {
  39931. return (
  39932. r ||
  39933. U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  39934. J.write(e, t, i, n, 52, 8),
  39935. i + 8
  39936. );
  39937. }
  39938. function G(e) {
  39939. if (((e = z(e).replace(te, "")), e.length < 2)) return "";
  39940. for (; e.length % 4 !== 0; ) e += "=";
  39941. return e;
  39942. }
  39943. function z(e) {
  39944. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
  39945. }
  39946. function W(e) {
  39947. return e < 16 ? "0" + e.toString(16) : e.toString(16);
  39948. }
  39949. function j(e, t) {
  39950. t = t || 1 / 0;
  39951. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  39952. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  39953. if (!r) {
  39954. if (i > 56319) {
  39955. (t -= 3) > -1 && o.push(239, 191, 189);
  39956. continue;
  39957. }
  39958. if (a + 1 === n) {
  39959. (t -= 3) > -1 && o.push(239, 191, 189);
  39960. continue;
  39961. }
  39962. r = i;
  39963. continue;
  39964. }
  39965. if (i < 56320) {
  39966. (t -= 3) > -1 && o.push(239, 191, 189), (r = i);
  39967. continue;
  39968. }
  39969. i = (((r - 55296) << 10) | (i - 56320)) + 65536;
  39970. } else r && (t -= 3) > -1 && o.push(239, 191, 189);
  39971. if (((r = null), i < 128)) {
  39972. if ((t -= 1) < 0) break;
  39973. o.push(i);
  39974. } else if (i < 2048) {
  39975. if ((t -= 2) < 0) break;
  39976. o.push((i >> 6) | 192, (63 & i) | 128);
  39977. } else if (i < 65536) {
  39978. if ((t -= 3) < 0) break;
  39979. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128);
  39980. } else {
  39981. if (!(i < 1114112)) throw new Error("Invalid code point");
  39982. if ((t -= 4) < 0) break;
  39983. o.push(
  39984. (i >> 18) | 240,
  39985. ((i >> 12) & 63) | 128,
  39986. ((i >> 6) & 63) | 128,
  39987. (63 & i) | 128
  39988. );
  39989. }
  39990. }
  39991. return o;
  39992. }
  39993. function Y(e) {
  39994. for (var t = [], i = 0; i < e.length; ++i)
  39995. t.push(255 & e.charCodeAt(i));
  39996. return t;
  39997. }
  39998. function X(e, t) {
  39999. for (
  40000. var i, n, r, o = [], a = 0;
  40001. a < e.length && !((t -= 2) < 0);
  40002. ++a
  40003. )
  40004. (i = e.charCodeAt(a)),
  40005. (n = i >> 8),
  40006. (r = i % 256),
  40007. o.push(r),
  40008. o.push(n);
  40009. return o;
  40010. }
  40011. function Z(e) {
  40012. return Q.toByteArray(G(e));
  40013. }
  40014. function q(e, t, i, n) {
  40015. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  40016. t[r + i] = e[r];
  40017. return r;
  40018. }
  40019. function K(e) {
  40020. return e !== e;
  40021. }
  40022. var Q = e("base64-js"),
  40023. J = e("ieee754"),
  40024. $ = e("isarray");
  40025. (i.Buffer = a),
  40026. (i.SlowBuffer = m),
  40027. (i.INSPECT_MAX_BYTES = 50),
  40028. (a.TYPED_ARRAY_SUPPORT =
  40029. void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  40030. (i.kMaxLength = r()),
  40031. (a.poolSize = 8192),
  40032. (a._augment = function (e) {
  40033. return (e.__proto__ = a.prototype), e;
  40034. }),
  40035. (a.from = function (e, t, i) {
  40036. return s(null, e, t, i);
  40037. }),
  40038. a.TYPED_ARRAY_SUPPORT &&
  40039. ((a.prototype.__proto__ = Uint8Array.prototype),
  40040. (a.__proto__ = Uint8Array),
  40041. "undefined" != typeof Symbol &&
  40042. Symbol.species &&
  40043. a[Symbol.species] === a &&
  40044. Object.defineProperty(a, Symbol.species, {
  40045. value: null,
  40046. configurable: !0,
  40047. })),
  40048. (a.alloc = function (e, t, i) {
  40049. return c(null, e, t, i);
  40050. }),
  40051. (a.allocUnsafe = function (e) {
  40052. return h(null, e);
  40053. }),
  40054. (a.allocUnsafeSlow = function (e) {
  40055. return h(null, e);
  40056. }),
  40057. (a.isBuffer = function (e) {
  40058. return !(null == e || !e._isBuffer);
  40059. }),
  40060. (a.compare = function (e, t) {
  40061. if (!a.isBuffer(e) || !a.isBuffer(t))
  40062. throw new TypeError("Arguments must be Buffers");
  40063. if (e === t) return 0;
  40064. for (
  40065. var i = e.length, n = t.length, r = 0, o = Math.min(i, n);
  40066. r < o;
  40067. ++r
  40068. )
  40069. if (e[r] !== t[r]) {
  40070. (i = e[r]), (n = t[r]);
  40071. break;
  40072. }
  40073. return i < n ? -1 : n < i ? 1 : 0;
  40074. }),
  40075. (a.isEncoding = function (e) {
  40076. switch (String(e).toLowerCase()) {
  40077. case "hex":
  40078. case "utf8":
  40079. case "utf-8":
  40080. case "ascii":
  40081. case "latin1":
  40082. case "binary":
  40083. case "base64":
  40084. case "ucs2":
  40085. case "ucs-2":
  40086. case "utf16le":
  40087. case "utf-16le":
  40088. return !0;
  40089. default:
  40090. return !1;
  40091. }
  40092. }),
  40093. (a.concat = function (e, t) {
  40094. if (!$(e))
  40095. throw new TypeError(
  40096. '"list" argument must be an Array of Buffers'
  40097. );
  40098. if (0 === e.length) return a.alloc(0);
  40099. var i;
  40100. if (void 0 === t)
  40101. for (t = 0, i = 0; i < e.length; ++i) t += e[i].length;
  40102. var n = a.allocUnsafe(t),
  40103. r = 0;
  40104. for (i = 0; i < e.length; ++i) {
  40105. var o = e[i];
  40106. if (!a.isBuffer(o))
  40107. throw new TypeError(
  40108. '"list" argument must be an Array of Buffers'
  40109. );
  40110. o.copy(n, r), (r += o.length);
  40111. }
  40112. return n;
  40113. }),
  40114. (a.byteLength = v),
  40115. (a.prototype._isBuffer = !0),
  40116. (a.prototype.swap16 = function () {
  40117. var e = this.length;
  40118. if (e % 2 !== 0)
  40119. throw new RangeError(
  40120. "Buffer size must be a multiple of 16-bits"
  40121. );
  40122. for (var t = 0; t < e; t += 2) y(this, t, t + 1);
  40123. return this;
  40124. }),
  40125. (a.prototype.swap32 = function () {
  40126. var e = this.length;
  40127. if (e % 4 !== 0)
  40128. throw new RangeError(
  40129. "Buffer size must be a multiple of 32-bits"
  40130. );
  40131. for (var t = 0; t < e; t += 4)
  40132. y(this, t, t + 3), y(this, t + 1, t + 2);
  40133. return this;
  40134. }),
  40135. (a.prototype.swap64 = function () {
  40136. var e = this.length;
  40137. if (e % 8 !== 0)
  40138. throw new RangeError(
  40139. "Buffer size must be a multiple of 64-bits"
  40140. );
  40141. for (var t = 0; t < e; t += 8)
  40142. y(this, t, t + 7),
  40143. y(this, t + 1, t + 6),
  40144. y(this, t + 2, t + 5),
  40145. y(this, t + 3, t + 4);
  40146. return this;
  40147. }),
  40148. (a.prototype.toString = function () {
  40149. var e = 0 | this.length;
  40150. return 0 === e
  40151. ? ""
  40152. : 0 === arguments.length
  40153. ? M(this, 0, e)
  40154. : A.apply(this, arguments);
  40155. }),
  40156. (a.prototype.equals = function (e) {
  40157. if (!a.isBuffer(e))
  40158. throw new TypeError("Argument must be a Buffer");
  40159. return this === e || 0 === a.compare(this, e);
  40160. }),
  40161. (a.prototype.inspect = function () {
  40162. var e = "",
  40163. t = i.INSPECT_MAX_BYTES;
  40164. return (
  40165. this.length > 0 &&
  40166. ((e = this.toString("hex", 0, t).match(/.{2}/g).join(" ")),
  40167. this.length > t && (e += " ... ")),
  40168. "<Buffer " + e + ">"
  40169. );
  40170. }),
  40171. (a.prototype.compare = function (e, t, i, n, r) {
  40172. if (!a.isBuffer(e))
  40173. throw new TypeError("Argument must be a Buffer");
  40174. if (
  40175. (void 0 === t && (t = 0),
  40176. void 0 === i && (i = e ? e.length : 0),
  40177. void 0 === n && (n = 0),
  40178. void 0 === r && (r = this.length),
  40179. t < 0 || i > e.length || n < 0 || r > this.length)
  40180. )
  40181. throw new RangeError("out of range index");
  40182. if (n >= r && t >= i) return 0;
  40183. if (n >= r) return -1;
  40184. if (t >= i) return 1;
  40185. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e))
  40186. return 0;
  40187. for (
  40188. var o = r - n,
  40189. s = i - t,
  40190. l = Math.min(o, s),
  40191. c = this.slice(n, r),
  40192. h = e.slice(t, i),
  40193. u = 0;
  40194. u < l;
  40195. ++u
  40196. )
  40197. if (c[u] !== h[u]) {
  40198. (o = c[u]), (s = h[u]);
  40199. break;
  40200. }
  40201. return o < s ? -1 : s < o ? 1 : 0;
  40202. }),
  40203. (a.prototype.includes = function (e, t, i) {
  40204. return this.indexOf(e, t, i) !== -1;
  40205. }),
  40206. (a.prototype.indexOf = function (e, t, i) {
  40207. return C(this, e, t, i, !0);
  40208. }),
  40209. (a.prototype.lastIndexOf = function (e, t, i) {
  40210. return C(this, e, t, i, !1);
  40211. }),
  40212. (a.prototype.write = function (e, t, i, n) {
  40213. if (void 0 === t) (n = "utf8"), (i = this.length), (t = 0);
  40214. else if (void 0 === i && "string" == typeof t)
  40215. (n = t), (i = this.length), (t = 0);
  40216. else {
  40217. if (!isFinite(t))
  40218. throw new Error(
  40219. "Buffer.write(string, encoding, offset[, length]) is no longer supported"
  40220. );
  40221. (t |= 0),
  40222. isFinite(i)
  40223. ? ((i |= 0), void 0 === n && (n = "utf8"))
  40224. : ((n = i), (i = void 0));
  40225. }
  40226. var r = this.length - t;
  40227. if (
  40228. ((void 0 === i || i > r) && (i = r),
  40229. (e.length > 0 && (i < 0 || t < 0)) || t > this.length)
  40230. )
  40231. throw new RangeError("Attempt to write outside buffer bounds");
  40232. n || (n = "utf8");
  40233. for (var o = !1; ; )
  40234. switch (n) {
  40235. case "hex":
  40236. return E(this, e, t, i);
  40237. case "utf8":
  40238. case "utf-8":
  40239. return b(this, e, t, i);
  40240. case "ascii":
  40241. return w(this, e, t, i);
  40242. case "latin1":
  40243. case "binary":
  40244. return _(this, e, t, i);
  40245. case "base64":
  40246. return T(this, e, t, i);
  40247. case "ucs2":
  40248. case "ucs-2":
  40249. case "utf16le":
  40250. case "utf-16le":
  40251. return x(this, e, t, i);
  40252. default:
  40253. if (o) throw new TypeError("Unknown encoding: " + n);
  40254. (n = ("" + n).toLowerCase()), (o = !0);
  40255. }
  40256. }),
  40257. (a.prototype.toJSON = function () {
  40258. return {
  40259. type: "Buffer",
  40260. data: Array.prototype.slice.call(this._arr || this, 0),
  40261. };
  40262. });
  40263. var ee = 4096;
  40264. (a.prototype.slice = function (e, t) {
  40265. var i = this.length;
  40266. (e = ~~e),
  40267. (t = void 0 === t ? i : ~~t),
  40268. e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i),
  40269. t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i),
  40270. t < e && (t = e);
  40271. var n;
  40272. if (a.TYPED_ARRAY_SUPPORT)
  40273. (n = this.subarray(e, t)), (n.__proto__ = a.prototype);
  40274. else {
  40275. var r = t - e;
  40276. n = new a(r, void 0);
  40277. for (var o = 0; o < r; ++o) n[o] = this[o + e];
  40278. }
  40279. return n;
  40280. }),
  40281. (a.prototype.readUIntLE = function (e, t, i) {
  40282. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40283. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  40284. n += this[e + o] * r;
  40285. return n;
  40286. }),
  40287. (a.prototype.readUIntBE = function (e, t, i) {
  40288. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40289. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  40290. n += this[e + --t] * r;
  40291. return n;
  40292. }),
  40293. (a.prototype.readUInt8 = function (e, t) {
  40294. return t || N(e, 1, this.length), this[e];
  40295. }),
  40296. (a.prototype.readUInt16LE = function (e, t) {
  40297. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8);
  40298. }),
  40299. (a.prototype.readUInt16BE = function (e, t) {
  40300. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1];
  40301. }),
  40302. (a.prototype.readUInt32LE = function (e, t) {
  40303. return (
  40304. t || N(e, 4, this.length),
  40305. (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) +
  40306. 16777216 * this[e + 3]
  40307. );
  40308. }),
  40309. (a.prototype.readUInt32BE = function (e, t) {
  40310. return (
  40311. t || N(e, 4, this.length),
  40312. 16777216 * this[e] +
  40313. ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  40314. );
  40315. }),
  40316. (a.prototype.readIntLE = function (e, t, i) {
  40317. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40318. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  40319. n += this[e + o] * r;
  40320. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n;
  40321. }),
  40322. (a.prototype.readIntBE = function (e, t, i) {
  40323. (e |= 0), (t |= 0), i || N(e, t, this.length);
  40324. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  40325. o += this[e + --n] * r;
  40326. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o;
  40327. }),
  40328. (a.prototype.readInt8 = function (e, t) {
  40329. return (
  40330. t || N(e, 1, this.length),
  40331. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  40332. );
  40333. }),
  40334. (a.prototype.readInt16LE = function (e, t) {
  40335. t || N(e, 2, this.length);
  40336. var i = this[e] | (this[e + 1] << 8);
  40337. return 32768 & i ? 4294901760 | i : i;
  40338. }),
  40339. (a.prototype.readInt16BE = function (e, t) {
  40340. t || N(e, 2, this.length);
  40341. var i = this[e + 1] | (this[e] << 8);
  40342. return 32768 & i ? 4294901760 | i : i;
  40343. }),
  40344. (a.prototype.readInt32LE = function (e, t) {
  40345. return (
  40346. t || N(e, 4, this.length),
  40347. this[e] |
  40348. (this[e + 1] << 8) |
  40349. (this[e + 2] << 16) |
  40350. (this[e + 3] << 24)
  40351. );
  40352. }),
  40353. (a.prototype.readInt32BE = function (e, t) {
  40354. return (
  40355. t || N(e, 4, this.length),
  40356. (this[e] << 24) |
  40357. (this[e + 1] << 16) |
  40358. (this[e + 2] << 8) |
  40359. this[e + 3]
  40360. );
  40361. }),
  40362. (a.prototype.readFloatLE = function (e, t) {
  40363. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4);
  40364. }),
  40365. (a.prototype.readFloatBE = function (e, t) {
  40366. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4);
  40367. }),
  40368. (a.prototype.readDoubleLE = function (e, t) {
  40369. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8);
  40370. }),
  40371. (a.prototype.readDoubleBE = function (e, t) {
  40372. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8);
  40373. }),
  40374. (a.prototype.writeUIntLE = function (e, t, i, n) {
  40375. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  40376. var r = Math.pow(2, 8 * i) - 1;
  40377. B(this, e, t, i, r, 0);
  40378. }
  40379. var o = 1,
  40380. a = 0;
  40381. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  40382. this[t + a] = (e / o) & 255;
  40383. return t + i;
  40384. }),
  40385. (a.prototype.writeUIntBE = function (e, t, i, n) {
  40386. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  40387. var r = Math.pow(2, 8 * i) - 1;
  40388. B(this, e, t, i, r, 0);
  40389. }
  40390. var o = i - 1,
  40391. a = 1;
  40392. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  40393. this[t + o] = (e / a) & 255;
  40394. return t + i;
  40395. }),
  40396. (a.prototype.writeUInt8 = function (e, t, i) {
  40397. return (
  40398. (e = +e),
  40399. (t |= 0),
  40400. i || B(this, e, t, 1, 255, 0),
  40401. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  40402. (this[t] = 255 & e),
  40403. t + 1
  40404. );
  40405. }),
  40406. (a.prototype.writeUInt16LE = function (e, t, i) {
  40407. return (
  40408. (e = +e),
  40409. (t |= 0),
  40410. i || B(this, e, t, 2, 65535, 0),
  40411. a.TYPED_ARRAY_SUPPORT
  40412. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  40413. : F(this, e, t, !0),
  40414. t + 2
  40415. );
  40416. }),
  40417. (a.prototype.writeUInt16BE = function (e, t, i) {
  40418. return (
  40419. (e = +e),
  40420. (t |= 0),
  40421. i || B(this, e, t, 2, 65535, 0),
  40422. a.TYPED_ARRAY_SUPPORT
  40423. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  40424. : F(this, e, t, !1),
  40425. t + 2
  40426. );
  40427. }),
  40428. (a.prototype.writeUInt32LE = function (e, t, i) {
  40429. return (
  40430. (e = +e),
  40431. (t |= 0),
  40432. i || B(this, e, t, 4, 4294967295, 0),
  40433. a.TYPED_ARRAY_SUPPORT
  40434. ? ((this[t + 3] = e >>> 24),
  40435. (this[t + 2] = e >>> 16),
  40436. (this[t + 1] = e >>> 8),
  40437. (this[t] = 255 & e))
  40438. : V(this, e, t, !0),
  40439. t + 4
  40440. );
  40441. }),
  40442. (a.prototype.writeUInt32BE = function (e, t, i) {
  40443. return (
  40444. (e = +e),
  40445. (t |= 0),
  40446. i || B(this, e, t, 4, 4294967295, 0),
  40447. a.TYPED_ARRAY_SUPPORT
  40448. ? ((this[t] = e >>> 24),
  40449. (this[t + 1] = e >>> 16),
  40450. (this[t + 2] = e >>> 8),
  40451. (this[t + 3] = 255 & e))
  40452. : V(this, e, t, !1),
  40453. t + 4
  40454. );
  40455. }),
  40456. (a.prototype.writeIntLE = function (e, t, i, n) {
  40457. if (((e = +e), (t |= 0), !n)) {
  40458. var r = Math.pow(2, 8 * i - 1);
  40459. B(this, e, t, i, r - 1, -r);
  40460. }
  40461. var o = 0,
  40462. a = 1,
  40463. s = 0;
  40464. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  40465. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  40466. (this[t + o] = (((e / a) >> 0) - s) & 255);
  40467. return t + i;
  40468. }),
  40469. (a.prototype.writeIntBE = function (e, t, i, n) {
  40470. if (((e = +e), (t |= 0), !n)) {
  40471. var r = Math.pow(2, 8 * i - 1);
  40472. B(this, e, t, i, r - 1, -r);
  40473. }
  40474. var o = i - 1,
  40475. a = 1,
  40476. s = 0;
  40477. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  40478. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  40479. (this[t + o] = (((e / a) >> 0) - s) & 255);
  40480. return t + i;
  40481. }),
  40482. (a.prototype.writeInt8 = function (e, t, i) {
  40483. return (
  40484. (e = +e),
  40485. (t |= 0),
  40486. i || B(this, e, t, 1, 127, -128),
  40487. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  40488. e < 0 && (e = 255 + e + 1),
  40489. (this[t] = 255 & e),
  40490. t + 1
  40491. );
  40492. }),
  40493. (a.prototype.writeInt16LE = function (e, t, i) {
  40494. return (
  40495. (e = +e),
  40496. (t |= 0),
  40497. i || B(this, e, t, 2, 32767, -32768),
  40498. a.TYPED_ARRAY_SUPPORT
  40499. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  40500. : F(this, e, t, !0),
  40501. t + 2
  40502. );
  40503. }),
  40504. (a.prototype.writeInt16BE = function (e, t, i) {
  40505. return (
  40506. (e = +e),
  40507. (t |= 0),
  40508. i || B(this, e, t, 2, 32767, -32768),
  40509. a.TYPED_ARRAY_SUPPORT
  40510. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  40511. : F(this, e, t, !1),
  40512. t + 2
  40513. );
  40514. }),
  40515. (a.prototype.writeInt32LE = function (e, t, i) {
  40516. return (
  40517. (e = +e),
  40518. (t |= 0),
  40519. i || B(this, e, t, 4, 2147483647, -2147483648),
  40520. a.TYPED_ARRAY_SUPPORT
  40521. ? ((this[t] = 255 & e),
  40522. (this[t + 1] = e >>> 8),
  40523. (this[t + 2] = e >>> 16),
  40524. (this[t + 3] = e >>> 24))
  40525. : V(this, e, t, !0),
  40526. t + 4
  40527. );
  40528. }),
  40529. (a.prototype.writeInt32BE = function (e, t, i) {
  40530. return (
  40531. (e = +e),
  40532. (t |= 0),
  40533. i || B(this, e, t, 4, 2147483647, -2147483648),
  40534. e < 0 && (e = 4294967295 + e + 1),
  40535. a.TYPED_ARRAY_SUPPORT
  40536. ? ((this[t] = e >>> 24),
  40537. (this[t + 1] = e >>> 16),
  40538. (this[t + 2] = e >>> 8),
  40539. (this[t + 3] = 255 & e))
  40540. : V(this, e, t, !1),
  40541. t + 4
  40542. );
  40543. }),
  40544. (a.prototype.writeFloatLE = function (e, t, i) {
  40545. return k(this, e, t, !0, i);
  40546. }),
  40547. (a.prototype.writeFloatBE = function (e, t, i) {
  40548. return k(this, e, t, !1, i);
  40549. }),
  40550. (a.prototype.writeDoubleLE = function (e, t, i) {
  40551. return H(this, e, t, !0, i);
  40552. }),
  40553. (a.prototype.writeDoubleBE = function (e, t, i) {
  40554. return H(this, e, t, !1, i);
  40555. }),
  40556. (a.prototype.copy = function (e, t, i, n) {
  40557. if (
  40558. (i || (i = 0),
  40559. n || 0 === n || (n = this.length),
  40560. t >= e.length && (t = e.length),
  40561. t || (t = 0),
  40562. n > 0 && n < i && (n = i),
  40563. n === i)
  40564. )
  40565. return 0;
  40566. if (0 === e.length || 0 === this.length) return 0;
  40567. if (t < 0) throw new RangeError("targetStart out of bounds");
  40568. if (i < 0 || i >= this.length)
  40569. throw new RangeError("sourceStart out of bounds");
  40570. if (n < 0) throw new RangeError("sourceEnd out of bounds");
  40571. n > this.length && (n = this.length),
  40572. e.length - t < n - i && (n = e.length - t + i);
  40573. var r,
  40574. o = n - i;
  40575. if (this === e && i < t && t < n)
  40576. for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i];
  40577. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  40578. for (r = 0; r < o; ++r) e[r + t] = this[r + i];
  40579. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  40580. return o;
  40581. }),
  40582. (a.prototype.fill = function (e, t, i, n) {
  40583. if ("string" == typeof e) {
  40584. if (
  40585. ("string" == typeof t
  40586. ? ((n = t), (t = 0), (i = this.length))
  40587. : "string" == typeof i && ((n = i), (i = this.length)),
  40588. 1 === e.length)
  40589. ) {
  40590. var r = e.charCodeAt(0);
  40591. r < 256 && (e = r);
  40592. }
  40593. if (void 0 !== n && "string" != typeof n)
  40594. throw new TypeError("encoding must be a string");
  40595. if ("string" == typeof n && !a.isEncoding(n))
  40596. throw new TypeError("Unknown encoding: " + n);
  40597. } else "number" == typeof e && (e &= 255);
  40598. if (t < 0 || this.length < t || this.length < i)
  40599. throw new RangeError("Out of range index");
  40600. if (i <= t) return this;
  40601. (t >>>= 0),
  40602. (i = void 0 === i ? this.length : i >>> 0),
  40603. e || (e = 0);
  40604. var o;
  40605. if ("number" == typeof e) for (o = t; o < i; ++o) this[o] = e;
  40606. else {
  40607. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  40608. l = s.length;
  40609. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l];
  40610. }
  40611. return this;
  40612. });
  40613. var te = /[^+\/0-9A-Za-z-_]/g;
  40614. }).call(
  40615. this,
  40616. "undefined" != typeof global
  40617. ? global
  40618. : "undefined" != typeof self
  40619. ? self
  40620. : "undefined" != typeof window
  40621. ? window
  40622. : {}
  40623. );
  40624. },
  40625. {
  40626. "base64-js": 199,
  40627. ieee754: 200,
  40628. isarray: 201,
  40629. },
  40630. ],
  40631. 199: [
  40632. function (e, t, i) {
  40633. "use strict";
  40634. function n(e) {
  40635. var t = e.length;
  40636. if (t % 4 > 0)
  40637. throw new Error("Invalid string. Length must be a multiple of 4");
  40638. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0;
  40639. }
  40640. function r(e) {
  40641. return (3 * e.length) / 4 - n(e);
  40642. }
  40643. function o(e) {
  40644. var t,
  40645. i,
  40646. r,
  40647. o,
  40648. a,
  40649. s,
  40650. l = e.length;
  40651. (a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l);
  40652. var c = 0;
  40653. for (t = 0, i = 0; t < r; t += 4, i += 3)
  40654. (o =
  40655. (h[e.charCodeAt(t)] << 18) |
  40656. (h[e.charCodeAt(t + 1)] << 12) |
  40657. (h[e.charCodeAt(t + 2)] << 6) |
  40658. h[e.charCodeAt(t + 3)]),
  40659. (s[c++] = (o >> 16) & 255),
  40660. (s[c++] = (o >> 8) & 255),
  40661. (s[c++] = 255 & o);
  40662. return (
  40663. 2 === a
  40664. ? ((o =
  40665. (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)),
  40666. (s[c++] = 255 & o))
  40667. : 1 === a &&
  40668. ((o =
  40669. (h[e.charCodeAt(t)] << 10) |
  40670. (h[e.charCodeAt(t + 1)] << 4) |
  40671. (h[e.charCodeAt(t + 2)] >> 2)),
  40672. (s[c++] = (o >> 8) & 255),
  40673. (s[c++] = 255 & o)),
  40674. s
  40675. );
  40676. }
  40677. function a(e) {
  40678. return (
  40679. c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e]
  40680. );
  40681. }
  40682. function s(e, t, i) {
  40683. for (var n, r = [], o = t; o < i; o += 3)
  40684. (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n));
  40685. return r.join("");
  40686. }
  40687. function l(e) {
  40688. for (
  40689. var t,
  40690. i = e.length,
  40691. n = i % 3,
  40692. r = "",
  40693. o = [],
  40694. a = 16383,
  40695. l = 0,
  40696. h = i - n;
  40697. l < h;
  40698. l += a
  40699. )
  40700. o.push(s(e, l, l + a > h ? h : l + a));
  40701. return (
  40702. 1 === n
  40703. ? ((t = e[i - 1]),
  40704. (r += c[t >> 2]),
  40705. (r += c[(t << 4) & 63]),
  40706. (r += "=="))
  40707. : 2 === n &&
  40708. ((t = (e[i - 2] << 8) + e[i - 1]),
  40709. (r += c[t >> 10]),
  40710. (r += c[(t >> 4) & 63]),
  40711. (r += c[(t << 2) & 63]),
  40712. (r += "=")),
  40713. o.push(r),
  40714. o.join("")
  40715. );
  40716. }
  40717. (i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l);
  40718. for (
  40719. var c = [],
  40720. h = [],
  40721. u = "undefined" != typeof Uint8Array ? Uint8Array : Array,
  40722. d =
  40723. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  40724. p = 0,
  40725. f = d.length;
  40726. p < f;
  40727. ++p
  40728. )
  40729. (c[p] = d[p]), (h[d.charCodeAt(p)] = p);
  40730. (h["-".charCodeAt(0)] = 62), (h["_".charCodeAt(0)] = 63);
  40731. },
  40732. {},
  40733. ],
  40734. 200: [
  40735. function (e, t, i) {
  40736. (i.read = function (e, t, i, n, r) {
  40737. var o,
  40738. a,
  40739. s = 8 * r - n - 1,
  40740. l = (1 << s) - 1,
  40741. c = l >> 1,
  40742. h = -7,
  40743. u = i ? r - 1 : 0,
  40744. d = i ? -1 : 1,
  40745. p = e[t + u];
  40746. for (
  40747. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  40748. h > 0;
  40749. o = 256 * o + e[t + u], u += d, h -= 8
  40750. );
  40751. for (
  40752. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  40753. h > 0;
  40754. a = 256 * a + e[t + u], u += d, h -= 8
  40755. );
  40756. if (0 === o) o = 1 - c;
  40757. else {
  40758. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  40759. (a += Math.pow(2, n)), (o -= c);
  40760. }
  40761. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  40762. }),
  40763. (i.write = function (e, t, i, n, r, o) {
  40764. var a,
  40765. s,
  40766. l,
  40767. c = 8 * o - r - 1,
  40768. h = (1 << c) - 1,
  40769. u = h >> 1,
  40770. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  40771. p = n ? 0 : o - 1,
  40772. f = n ? 1 : -1,
  40773. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  40774. for (
  40775. t = Math.abs(t),
  40776. isNaN(t) || t === 1 / 0
  40777. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  40778. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  40779. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  40780. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  40781. t * l >= 2 && (a++, (l /= 2)),
  40782. a + u >= h
  40783. ? ((s = 0), (a = h))
  40784. : a + u >= 1
  40785. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  40786. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)),
  40787. (a = 0)));
  40788. r >= 8;
  40789. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  40790. );
  40791. for (
  40792. a = (a << r) | s, c += r;
  40793. c > 0;
  40794. e[i + p] = 255 & a, p += f, a /= 256, c -= 8
  40795. );
  40796. e[i + p - f] |= 128 * g;
  40797. });
  40798. },
  40799. {},
  40800. ],
  40801. 201: [
  40802. function (e, t, i) {
  40803. var n = {}.toString;
  40804. t.exports =
  40805. Array.isArray ||
  40806. function (e) {
  40807. return "[object Array]" == n.call(e);
  40808. };
  40809. },
  40810. {},
  40811. ],
  40812. 202: [
  40813. function (e, t, i) {
  40814. function n() {
  40815. (this._events = this._events || {}),
  40816. (this._maxListeners = this._maxListeners || void 0);
  40817. }
  40818. function r(e) {
  40819. return "function" == typeof e;
  40820. }
  40821. function o(e) {
  40822. return "number" == typeof e;
  40823. }
  40824. function a(e) {
  40825. return "object" == typeof e && null !== e;
  40826. }
  40827. function s(e) {
  40828. return void 0 === e;
  40829. }
  40830. (t.exports = n),
  40831. (n.EventEmitter = n),
  40832. (n.prototype._events = void 0),
  40833. (n.prototype._maxListeners = void 0),
  40834. (n.defaultMaxListeners = 10),
  40835. (n.prototype.setMaxListeners = function (e) {
  40836. if (!o(e) || e < 0 || isNaN(e))
  40837. throw TypeError("n must be a positive number");
  40838. return (this._maxListeners = e), this;
  40839. }),
  40840. (n.prototype.emit = function (e) {
  40841. var t, i, n, o, l, c;
  40842. if (
  40843. (this._events || (this._events = {}),
  40844. "error" === e &&
  40845. (!this._events.error ||
  40846. (a(this._events.error) && !this._events.error.length)))
  40847. ) {
  40848. if (((t = arguments[1]), t instanceof Error)) throw t;
  40849. var h = new Error(
  40850. 'Uncaught, unspecified "error" event. (' + t + ")"
  40851. );
  40852. throw ((h.context = t), h);
  40853. }
  40854. if (((i = this._events[e]), s(i))) return !1;
  40855. if (r(i))
  40856. switch (arguments.length) {
  40857. case 1:
  40858. i.call(this);
  40859. break;
  40860. case 2:
  40861. i.call(this, arguments[1]);
  40862. break;
  40863. case 3:
  40864. i.call(this, arguments[1], arguments[2]);
  40865. break;
  40866. default:
  40867. (o = Array.prototype.slice.call(arguments, 1)),
  40868. i.apply(this, o);
  40869. }
  40870. else if (a(i))
  40871. for (
  40872. o = Array.prototype.slice.call(arguments, 1),
  40873. c = i.slice(),
  40874. n = c.length,
  40875. l = 0;
  40876. l < n;
  40877. l++
  40878. )
  40879. c[l].apply(this, o);
  40880. return !0;
  40881. }),
  40882. (n.prototype.addListener = function (e, t) {
  40883. var i;
  40884. if (!r(t)) throw TypeError("listener must be a function");
  40885. return (
  40886. this._events || (this._events = {}),
  40887. this._events.newListener &&
  40888. this.emit("newListener", e, r(t.listener) ? t.listener : t),
  40889. this._events[e]
  40890. ? a(this._events[e])
  40891. ? this._events[e].push(t)
  40892. : (this._events[e] = [this._events[e], t])
  40893. : (this._events[e] = t),
  40894. a(this._events[e]) &&
  40895. !this._events[e].warned &&
  40896. ((i = s(this._maxListeners)
  40897. ? n.defaultMaxListeners
  40898. : this._maxListeners),
  40899. i &&
  40900. i > 0 &&
  40901. this._events[e].length > i &&
  40902. ((this._events[e].warned = !0),
  40903. console.error(
  40904. "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
  40905. this._events[e].length
  40906. ),
  40907. "function" == typeof console.trace && console.trace())),
  40908. this
  40909. );
  40910. }),
  40911. (n.prototype.on = n.prototype.addListener),
  40912. (n.prototype.once = function (e, t) {
  40913. function i() {
  40914. this.removeListener(e, i),
  40915. n || ((n = !0), t.apply(this, arguments));
  40916. }
  40917. if (!r(t)) throw TypeError("listener must be a function");
  40918. var n = !1;
  40919. return (i.listener = t), this.on(e, i), this;
  40920. }),
  40921. (n.prototype.removeListener = function (e, t) {
  40922. var i, n, o, s;
  40923. if (!r(t)) throw TypeError("listener must be a function");
  40924. if (!this._events || !this._events[e]) return this;
  40925. if (
  40926. ((i = this._events[e]),
  40927. (o = i.length),
  40928. (n = -1),
  40929. i === t || (r(i.listener) && i.listener === t))
  40930. )
  40931. delete this._events[e],
  40932. this._events.removeListener &&
  40933. this.emit("removeListener", e, t);
  40934. else if (a(i)) {
  40935. for (s = o; s-- > 0; )
  40936. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  40937. n = s;
  40938. break;
  40939. }
  40940. if (n < 0) return this;
  40941. 1 === i.length
  40942. ? ((i.length = 0), delete this._events[e])
  40943. : i.splice(n, 1),
  40944. this._events.removeListener &&
  40945. this.emit("removeListener", e, t);
  40946. }
  40947. return this;
  40948. }),
  40949. (n.prototype.removeAllListeners = function (e) {
  40950. var t, i;
  40951. if (!this._events) return this;
  40952. if (!this._events.removeListener)
  40953. return (
  40954. 0 === arguments.length
  40955. ? (this._events = {})
  40956. : this._events[e] && delete this._events[e],
  40957. this
  40958. );
  40959. if (0 === arguments.length) {
  40960. for (t in this._events)
  40961. "removeListener" !== t && this.removeAllListeners(t);
  40962. return (
  40963. this.removeAllListeners("removeListener"),
  40964. (this._events = {}),
  40965. this
  40966. );
  40967. }
  40968. if (((i = this._events[e]), r(i))) this.removeListener(e, i);
  40969. else if (i)
  40970. for (; i.length; ) this.removeListener(e, i[i.length - 1]);
  40971. return delete this._events[e], this;
  40972. }),
  40973. (n.prototype.listeners = function (e) {
  40974. var t;
  40975. return (t =
  40976. this._events && this._events[e]
  40977. ? r(this._events[e])
  40978. ? [this._events[e]]
  40979. : this._events[e].slice()
  40980. : []);
  40981. }),
  40982. (n.prototype.listenerCount = function (e) {
  40983. if (this._events) {
  40984. var t = this._events[e];
  40985. if (r(t)) return 1;
  40986. if (t) return t.length;
  40987. }
  40988. return 0;
  40989. }),
  40990. (n.listenerCount = function (e, t) {
  40991. return e.listenerCount(t);
  40992. });
  40993. },
  40994. {},
  40995. ],
  40996. 203: [
  40997. function (e, t, i) {
  40998. function n() {
  40999. throw new Error("setTimeout has not been defined");
  41000. }
  41001. function r() {
  41002. throw new Error("clearTimeout has not been defined");
  41003. }
  41004. function o(e) {
  41005. if (u === setTimeout) return setTimeout(e, 0);
  41006. if ((u === n || !u) && setTimeout)
  41007. return (u = setTimeout), setTimeout(e, 0);
  41008. try {
  41009. return u(e, 0);
  41010. } catch (t) {
  41011. try {
  41012. return u.call(null, e, 0);
  41013. } catch (t) {
  41014. return u.call(this, e, 0);
  41015. }
  41016. }
  41017. }
  41018. function a(e) {
  41019. if (d === clearTimeout) return clearTimeout(e);
  41020. if ((d === r || !d) && clearTimeout)
  41021. return (d = clearTimeout), clearTimeout(e);
  41022. try {
  41023. return d(e);
  41024. } catch (t) {
  41025. try {
  41026. return d.call(null, e);
  41027. } catch (t) {
  41028. return d.call(this, e);
  41029. }
  41030. }
  41031. }
  41032. function s() {
  41033. m &&
  41034. f &&
  41035. ((m = !1),
  41036. f.length ? (g = f.concat(g)) : (v = -1),
  41037. g.length && l());
  41038. }
  41039. function l() {
  41040. if (!m) {
  41041. var e = o(s);
  41042. m = !0;
  41043. for (var t = g.length; t; ) {
  41044. for (f = g, g = []; ++v < t; ) f && f[v].run();
  41045. (v = -1), (t = g.length);
  41046. }
  41047. (f = null), (m = !1), a(e);
  41048. }
  41049. }
  41050. function c(e, t) {
  41051. (this.fun = e), (this.array = t);
  41052. }
  41053. function h() {}
  41054. var u,
  41055. d,
  41056. p = (t.exports = {});
  41057. !(function () {
  41058. try {
  41059. u = "function" == typeof setTimeout ? setTimeout : n;
  41060. } catch (e) {
  41061. u = n;
  41062. }
  41063. try {
  41064. d = "function" == typeof clearTimeout ? clearTimeout : r;
  41065. } catch (e) {
  41066. d = r;
  41067. }
  41068. })();
  41069. var f,
  41070. g = [],
  41071. m = !1,
  41072. v = -1;
  41073. (p.nextTick = function (e) {
  41074. var t = new Array(arguments.length - 1);
  41075. if (arguments.length > 1)
  41076. for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
  41077. g.push(new c(e, t)), 1 !== g.length || m || o(l);
  41078. }),
  41079. (c.prototype.run = function () {
  41080. this.fun.apply(null, this.array);
  41081. }),
  41082. (p.title = "browser"),
  41083. (p.browser = !0),
  41084. (p.env = {}),
  41085. (p.argv = []),
  41086. (p.version = ""),
  41087. (p.versions = {}),
  41088. (p.on = h),
  41089. (p.addListener = h),
  41090. (p.once = h),
  41091. (p.off = h),
  41092. (p.removeListener = h),
  41093. (p.removeAllListeners = h),
  41094. (p.emit = h),
  41095. (p.binding = function (e) {
  41096. throw new Error("process.binding is not supported");
  41097. }),
  41098. (p.cwd = function () {
  41099. return "/";
  41100. }),
  41101. (p.chdir = function (e) {
  41102. throw new Error("process.chdir is not supported");
  41103. }),
  41104. (p.umask = function () {
  41105. return 0;
  41106. });
  41107. },
  41108. {},
  41109. ],
  41110. 204: [
  41111. function (e, t, i) {
  41112. (function (e) {
  41113. !(function (n) {
  41114. function r(e) {
  41115. throw new RangeError(L[e]);
  41116. }
  41117. function o(e, t) {
  41118. for (var i = e.length, n = []; i--; ) n[i] = t(e[i]);
  41119. return n;
  41120. }
  41121. function a(e, t) {
  41122. var i = e.split("@"),
  41123. n = "";
  41124. i.length > 1 && ((n = i[0] + "@"), (e = i[1])),
  41125. (e = e.replace(O, "."));
  41126. var r = e.split("."),
  41127. a = o(r, t).join(".");
  41128. return n + a;
  41129. }
  41130. function s(e) {
  41131. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  41132. (t = e.charCodeAt(r++)),
  41133. t >= 55296 && t <= 56319 && r < o
  41134. ? ((i = e.charCodeAt(r++)),
  41135. 56320 == (64512 & i)
  41136. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  41137. : (n.push(t), r--))
  41138. : n.push(t);
  41139. return n;
  41140. }
  41141. function l(e) {
  41142. return o(e, function (e) {
  41143. var t = "";
  41144. return (
  41145. e > 65535 &&
  41146. ((e -= 65536),
  41147. (t += B(((e >>> 10) & 1023) | 55296)),
  41148. (e = 56320 | (1023 & e))),
  41149. (t += B(e))
  41150. );
  41151. }).join("");
  41152. }
  41153. function c(e) {
  41154. return e - 48 < 10
  41155. ? e - 22
  41156. : e - 65 < 26
  41157. ? e - 65
  41158. : e - 97 < 26
  41159. ? e - 97
  41160. : E;
  41161. }
  41162. function h(e, t) {
  41163. return e + 22 + 75 * (e < 26) - ((0 != t) << 5);
  41164. }
  41165. function u(e, t, i) {
  41166. var n = 0;
  41167. for (
  41168. e = i ? N(e / T) : e >> 1, e += N(e / t);
  41169. e > (D * w) >> 1;
  41170. n += E
  41171. )
  41172. e = N(e / D);
  41173. return N(n + ((D + 1) * e) / (e + _));
  41174. }
  41175. function d(e) {
  41176. var t,
  41177. i,
  41178. n,
  41179. o,
  41180. a,
  41181. s,
  41182. h,
  41183. d,
  41184. p,
  41185. f,
  41186. g = [],
  41187. m = e.length,
  41188. v = 0,
  41189. A = S,
  41190. y = x;
  41191. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n)
  41192. e.charCodeAt(n) >= 128 && r("not-basic"),
  41193. g.push(e.charCodeAt(n));
  41194. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  41195. for (
  41196. a = v, s = 1, h = E;
  41197. o >= m && r("invalid-input"),
  41198. (d = c(e.charCodeAt(o++))),
  41199. (d >= E || d > N((I - v) / s)) && r("overflow"),
  41200. (v += d * s),
  41201. (p = h <= y ? b : h >= y + w ? w : h - y),
  41202. !(d < p);
  41203. h += E
  41204. )
  41205. (f = E - p), s > N(I / f) && r("overflow"), (s *= f);
  41206. (t = g.length + 1),
  41207. (y = u(v - a, t, 0 == a)),
  41208. N(v / t) > I - A && r("overflow"),
  41209. (A += N(v / t)),
  41210. (v %= t),
  41211. g.splice(v++, 0, A);
  41212. }
  41213. return l(g);
  41214. }
  41215. function p(e) {
  41216. var t,
  41217. i,
  41218. n,
  41219. o,
  41220. a,
  41221. l,
  41222. c,
  41223. d,
  41224. p,
  41225. f,
  41226. g,
  41227. m,
  41228. v,
  41229. A,
  41230. y,
  41231. C = [];
  41232. for (
  41233. e = s(e), m = e.length, t = S, i = 0, a = x, l = 0;
  41234. l < m;
  41235. ++l
  41236. )
  41237. (g = e[l]), g < 128 && C.push(B(g));
  41238. for (n = o = C.length, o && C.push(M); n < m; ) {
  41239. for (c = I, l = 0; l < m; ++l)
  41240. (g = e[l]), g >= t && g < c && (c = g);
  41241. for (
  41242. v = n + 1,
  41243. c - t > N((I - i) / v) && r("overflow"),
  41244. i += (c - t) * v,
  41245. t = c,
  41246. l = 0;
  41247. l < m;
  41248. ++l
  41249. )
  41250. if (((g = e[l]), g < t && ++i > I && r("overflow"), g == t)) {
  41251. for (
  41252. d = i, p = E;
  41253. (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f);
  41254. p += E
  41255. )
  41256. (y = d - f),
  41257. (A = E - f),
  41258. C.push(B(h(f + (y % A), 0))),
  41259. (d = N(y / A));
  41260. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n;
  41261. }
  41262. ++i, ++t;
  41263. }
  41264. return C.join("");
  41265. }
  41266. function f(e) {
  41267. return a(e, function (e) {
  41268. return R.test(e) ? d(e.slice(4).toLowerCase()) : e;
  41269. });
  41270. }
  41271. function g(e) {
  41272. return a(e, function (e) {
  41273. return P.test(e) ? "xn--" + p(e) : e;
  41274. });
  41275. }
  41276. var m = "object" == typeof i && i && !i.nodeType && i,
  41277. v = "object" == typeof t && t && !t.nodeType && t,
  41278. A = "object" == typeof e && e;
  41279. (A.global !== A && A.window !== A && A.self !== A) || (n = A);
  41280. var y,
  41281. C,
  41282. I = 2147483647,
  41283. E = 36,
  41284. b = 1,
  41285. w = 26,
  41286. _ = 38,
  41287. T = 700,
  41288. x = 72,
  41289. S = 128,
  41290. M = "-",
  41291. R = /^xn--/,
  41292. P = /[^\x20-\x7E]/,
  41293. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  41294. L = {
  41295. overflow: "Overflow: input needs wider integers to process",
  41296. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  41297. "invalid-input": "Invalid input",
  41298. },
  41299. D = E - b,
  41300. N = Math.floor,
  41301. B = String.fromCharCode;
  41302. if (
  41303. ((y = {
  41304. version: "1.4.1",
  41305. ucs2: {
  41306. decode: s,
  41307. encode: l,
  41308. },
  41309. decode: d,
  41310. encode: p,
  41311. toASCII: g,
  41312. toUnicode: f,
  41313. }),
  41314. "function" == typeof define &&
  41315. "object" == typeof define.amd &&
  41316. define.amd)
  41317. )
  41318. define("punycode", function () {
  41319. return y;
  41320. });
  41321. else if (m && v)
  41322. if (t.exports == m) v.exports = y;
  41323. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C]);
  41324. else n.punycode = y;
  41325. })(this);
  41326. }).call(
  41327. this,
  41328. "undefined" != typeof global
  41329. ? global
  41330. : "undefined" != typeof self
  41331. ? self
  41332. : "undefined" != typeof window
  41333. ? window
  41334. : {}
  41335. );
  41336. },
  41337. {},
  41338. ],
  41339. 205: [
  41340. function (e, t, i) {
  41341. "use strict";
  41342. function n(e, t) {
  41343. return Object.prototype.hasOwnProperty.call(e, t);
  41344. }
  41345. t.exports = function (e, t, i, o) {
  41346. (t = t || "&"), (i = i || "=");
  41347. var a = {};
  41348. if ("string" != typeof e || 0 === e.length) return a;
  41349. var s = /\+/g;
  41350. e = e.split(t);
  41351. var l = 1e3;
  41352. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  41353. var c = e.length;
  41354. l > 0 && c > l && (c = l);
  41355. for (var h = 0; h < c; ++h) {
  41356. var u,
  41357. d,
  41358. p,
  41359. f,
  41360. g = e[h].replace(s, "%20"),
  41361. m = g.indexOf(i);
  41362. m >= 0
  41363. ? ((u = g.substr(0, m)), (d = g.substr(m + 1)))
  41364. : ((u = g), (d = "")),
  41365. (p = decodeURIComponent(u)),
  41366. (f = decodeURIComponent(d)),
  41367. n(a, p)
  41368. ? r(a[p])
  41369. ? a[p].push(f)
  41370. : (a[p] = [a[p], f])
  41371. : (a[p] = f);
  41372. }
  41373. return a;
  41374. };
  41375. var r =
  41376. Array.isArray ||
  41377. function (e) {
  41378. return "[object Array]" === Object.prototype.toString.call(e);
  41379. };
  41380. },
  41381. {},
  41382. ],
  41383. 206: [
  41384. function (e, t, i) {
  41385. "use strict";
  41386. function n(e, t) {
  41387. if (e.map) return e.map(t);
  41388. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n));
  41389. return i;
  41390. }
  41391. var r = function (e) {
  41392. switch (typeof e) {
  41393. case "string":
  41394. return e;
  41395. case "boolean":
  41396. return e ? "true" : "false";
  41397. case "number":
  41398. return isFinite(e) ? e : "";
  41399. default:
  41400. return "";
  41401. }
  41402. };
  41403. t.exports = function (e, t, i, s) {
  41404. return (
  41405. (t = t || "&"),
  41406. (i = i || "="),
  41407. null === e && (e = void 0),
  41408. "object" == typeof e
  41409. ? n(a(e), function (a) {
  41410. var s = encodeURIComponent(r(a)) + i;
  41411. return o(e[a])
  41412. ? n(e[a], function (e) {
  41413. return s + encodeURIComponent(r(e));
  41414. }).join(t)
  41415. : s + encodeURIComponent(r(e[a]));
  41416. }).join(t)
  41417. : s
  41418. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  41419. : ""
  41420. );
  41421. };
  41422. var o =
  41423. Array.isArray ||
  41424. function (e) {
  41425. return "[object Array]" === Object.prototype.toString.call(e);
  41426. },
  41427. a =
  41428. Object.keys ||
  41429. function (e) {
  41430. var t = [];
  41431. for (var i in e)
  41432. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  41433. return t;
  41434. };
  41435. },
  41436. {},
  41437. ],
  41438. 207: [
  41439. function (e, t, i) {
  41440. "use strict";
  41441. (i.decode = i.parse = e("./decode")),
  41442. (i.encode = i.stringify = e("./encode"));
  41443. },
  41444. {
  41445. "./decode": 205,
  41446. "./encode": 206,
  41447. },
  41448. ],
  41449. 208: [
  41450. function (e, t, i) {
  41451. "use strict";
  41452. function n() {
  41453. (this.protocol = null),
  41454. (this.slashes = null),
  41455. (this.auth = null),
  41456. (this.host = null),
  41457. (this.port = null),
  41458. (this.hostname = null),
  41459. (this.hash = null),
  41460. (this.search = null),
  41461. (this.query = null),
  41462. (this.pathname = null),
  41463. (this.path = null),
  41464. (this.href = null);
  41465. }
  41466. function r(e, t, i) {
  41467. if (e && c.isObject(e) && e instanceof n) return e;
  41468. var r = new n();
  41469. return r.parse(e, t, i), r;
  41470. }
  41471. function o(e) {
  41472. return (
  41473. c.isString(e) && (e = r(e)),
  41474. e instanceof n ? e.format() : n.prototype.format.call(e)
  41475. );
  41476. }
  41477. function a(e, t) {
  41478. return r(e, !1, !0).resolve(t);
  41479. }
  41480. function s(e, t) {
  41481. return e ? r(e, !1, !0).resolveObject(t) : t;
  41482. }
  41483. var l = e("punycode"),
  41484. c = e("./util");
  41485. (i.parse = r),
  41486. (i.resolve = a),
  41487. (i.resolveObject = s),
  41488. (i.format = o),
  41489. (i.Url = n);
  41490. var h = /^([a-z0-9.+-]+:)/i,
  41491. u = /:[0-9]*$/,
  41492. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  41493. p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"],
  41494. f = ["{", "}", "|", "\\", "^", "`"].concat(p),
  41495. g = ["'"].concat(f),
  41496. m = ["%", "/", "?", ";", "#"].concat(g),
  41497. v = ["/", "?", "#"],
  41498. A = 255,
  41499. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  41500. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  41501. I = {
  41502. javascript: !0,
  41503. "javascript:": !0,
  41504. },
  41505. E = {
  41506. javascript: !0,
  41507. "javascript:": !0,
  41508. },
  41509. b = {
  41510. http: !0,
  41511. https: !0,
  41512. ftp: !0,
  41513. gopher: !0,
  41514. file: !0,
  41515. "http:": !0,
  41516. "https:": !0,
  41517. "ftp:": !0,
  41518. "gopher:": !0,
  41519. "file:": !0,
  41520. },
  41521. w = e("querystring");
  41522. (n.prototype.parse = function (e, t, i) {
  41523. if (!c.isString(e))
  41524. throw new TypeError(
  41525. "Parameter 'url' must be a string, not " + typeof e
  41526. );
  41527. var n = e.indexOf("?"),
  41528. r = n !== -1 && n < e.indexOf("#") ? "?" : "#",
  41529. o = e.split(r),
  41530. a = /\\/g;
  41531. (o[0] = o[0].replace(a, "/")), (e = o.join(r));
  41532. var s = e;
  41533. if (((s = s.trim()), !i && 1 === e.split("#").length)) {
  41534. var u = d.exec(s);
  41535. if (u)
  41536. return (
  41537. (this.path = s),
  41538. (this.href = s),
  41539. (this.pathname = u[1]),
  41540. u[2]
  41541. ? ((this.search = u[2]),
  41542. t
  41543. ? (this.query = w.parse(this.search.substr(1)))
  41544. : (this.query = this.search.substr(1)))
  41545. : t && ((this.search = ""), (this.query = {})),
  41546. this
  41547. );
  41548. }
  41549. var p = h.exec(s);
  41550. if (p) {
  41551. p = p[0];
  41552. var f = p.toLowerCase();
  41553. (this.protocol = f), (s = s.substr(p.length));
  41554. }
  41555. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  41556. var _ = "//" === s.substr(0, 2);
  41557. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0));
  41558. }
  41559. if (!E[p] && (_ || (p && !b[p]))) {
  41560. for (var T = -1, x = 0; x < v.length; x++) {
  41561. var S = s.indexOf(v[x]);
  41562. S !== -1 && (T === -1 || S < T) && (T = S);
  41563. }
  41564. var M, R;
  41565. (R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T)),
  41566. R !== -1 &&
  41567. ((M = s.slice(0, R)),
  41568. (s = s.slice(R + 1)),
  41569. (this.auth = decodeURIComponent(M))),
  41570. (T = -1);
  41571. for (var x = 0; x < m.length; x++) {
  41572. var S = s.indexOf(m[x]);
  41573. S !== -1 && (T === -1 || S < T) && (T = S);
  41574. }
  41575. T === -1 && (T = s.length),
  41576. (this.host = s.slice(0, T)),
  41577. (s = s.slice(T)),
  41578. this.parseHost(),
  41579. (this.hostname = this.hostname || "");
  41580. var P =
  41581. "[" === this.hostname[0] &&
  41582. "]" === this.hostname[this.hostname.length - 1];
  41583. if (!P)
  41584. for (
  41585. var O = this.hostname.split(/\./), x = 0, L = O.length;
  41586. x < L;
  41587. x++
  41588. ) {
  41589. var D = O[x];
  41590. if (D && !D.match(y)) {
  41591. for (var N = "", B = 0, F = D.length; B < F; B++)
  41592. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  41593. if (!N.match(y)) {
  41594. var V = O.slice(0, x),
  41595. U = O.slice(x + 1),
  41596. k = D.match(C);
  41597. k && (V.push(k[1]), U.unshift(k[2])),
  41598. U.length && (s = "/" + U.join(".") + s),
  41599. (this.hostname = V.join("."));
  41600. break;
  41601. }
  41602. }
  41603. }
  41604. this.hostname.length > A
  41605. ? (this.hostname = "")
  41606. : (this.hostname = this.hostname.toLowerCase()),
  41607. P || (this.hostname = l.toASCII(this.hostname));
  41608. var H = this.port ? ":" + this.port : "",
  41609. G = this.hostname || "";
  41610. (this.host = G + H),
  41611. (this.href += this.host),
  41612. P &&
  41613. ((this.hostname = this.hostname.substr(
  41614. 1,
  41615. this.hostname.length - 2
  41616. )),
  41617. "/" !== s[0] && (s = "/" + s));
  41618. }
  41619. if (!I[f])
  41620. for (var x = 0, L = g.length; x < L; x++) {
  41621. var z = g[x];
  41622. if (s.indexOf(z) !== -1) {
  41623. var W = encodeURIComponent(z);
  41624. W === z && (W = escape(z)), (s = s.split(z).join(W));
  41625. }
  41626. }
  41627. var j = s.indexOf("#");
  41628. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)));
  41629. var Y = s.indexOf("?");
  41630. if (
  41631. (Y !== -1
  41632. ? ((this.search = s.substr(Y)),
  41633. (this.query = s.substr(Y + 1)),
  41634. t && (this.query = w.parse(this.query)),
  41635. (s = s.slice(0, Y)))
  41636. : t && ((this.search = ""), (this.query = {})),
  41637. s && (this.pathname = s),
  41638. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  41639. this.pathname || this.search)
  41640. ) {
  41641. var H = this.pathname || "",
  41642. X = this.search || "";
  41643. this.path = H + X;
  41644. }
  41645. return (this.href = this.format()), this;
  41646. }),
  41647. (n.prototype.format = function () {
  41648. var e = this.auth || "";
  41649. e &&
  41650. ((e = encodeURIComponent(e)),
  41651. (e = e.replace(/%3A/i, ":")),
  41652. (e += "@"));
  41653. var t = this.protocol || "",
  41654. i = this.pathname || "",
  41655. n = this.hash || "",
  41656. r = !1,
  41657. o = "";
  41658. this.host
  41659. ? (r = e + this.host)
  41660. : this.hostname &&
  41661. ((r =
  41662. e +
  41663. (this.hostname.indexOf(":") === -1
  41664. ? this.hostname
  41665. : "[" + this.hostname + "]")),
  41666. this.port && (r += ":" + this.port)),
  41667. this.query &&
  41668. c.isObject(this.query) &&
  41669. Object.keys(this.query).length &&
  41670. (o = w.stringify(this.query));
  41671. var a = this.search || (o && "?" + o) || "";
  41672. return (
  41673. t && ":" !== t.substr(-1) && (t += ":"),
  41674. this.slashes || ((!t || b[t]) && r !== !1)
  41675. ? ((r = "//" + (r || "")),
  41676. i && "/" !== i.charAt(0) && (i = "/" + i))
  41677. : r || (r = ""),
  41678. n && "#" !== n.charAt(0) && (n = "#" + n),
  41679. a && "?" !== a.charAt(0) && (a = "?" + a),
  41680. (i = i.replace(/[?#]/g, function (e) {
  41681. return encodeURIComponent(e);
  41682. })),
  41683. (a = a.replace("#", "%23")),
  41684. t + r + i + a + n
  41685. );
  41686. }),
  41687. (n.prototype.resolve = function (e) {
  41688. return this.resolveObject(r(e, !1, !0)).format();
  41689. }),
  41690. (n.prototype.resolveObject = function (e) {
  41691. if (c.isString(e)) {
  41692. var t = new n();
  41693. t.parse(e, !1, !0), (e = t);
  41694. }
  41695. for (
  41696. var i = new n(), r = Object.keys(this), o = 0;
  41697. o < r.length;
  41698. o++
  41699. ) {
  41700. var a = r[o];
  41701. i[a] = this[a];
  41702. }
  41703. if (((i.hash = e.hash), "" === e.href))
  41704. return (i.href = i.format()), i;
  41705. if (e.slashes && !e.protocol) {
  41706. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  41707. var h = s[l];
  41708. "protocol" !== h && (i[h] = e[h]);
  41709. }
  41710. return (
  41711. b[i.protocol] &&
  41712. i.hostname &&
  41713. !i.pathname &&
  41714. (i.path = i.pathname = "/"),
  41715. (i.href = i.format()),
  41716. i
  41717. );
  41718. }
  41719. if (e.protocol && e.protocol !== i.protocol) {
  41720. if (!b[e.protocol]) {
  41721. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  41722. var p = u[d];
  41723. i[p] = e[p];
  41724. }
  41725. return (i.href = i.format()), i;
  41726. }
  41727. if (((i.protocol = e.protocol), e.host || E[e.protocol]))
  41728. i.pathname = e.pathname;
  41729. else {
  41730. for (
  41731. var f = (e.pathname || "").split("/");
  41732. f.length && !(e.host = f.shift());
  41733. );
  41734. e.host || (e.host = ""),
  41735. e.hostname || (e.hostname = ""),
  41736. "" !== f[0] && f.unshift(""),
  41737. f.length < 2 && f.unshift(""),
  41738. (i.pathname = f.join("/"));
  41739. }
  41740. if (
  41741. ((i.search = e.search),
  41742. (i.query = e.query),
  41743. (i.host = e.host || ""),
  41744. (i.auth = e.auth),
  41745. (i.hostname = e.hostname || e.host),
  41746. (i.port = e.port),
  41747. i.pathname || i.search)
  41748. ) {
  41749. var g = i.pathname || "",
  41750. m = i.search || "";
  41751. i.path = g + m;
  41752. }
  41753. return (
  41754. (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  41755. );
  41756. }
  41757. var v = i.pathname && "/" === i.pathname.charAt(0),
  41758. A = e.host || (e.pathname && "/" === e.pathname.charAt(0)),
  41759. y = A || v || (i.host && e.pathname),
  41760. C = y,
  41761. I = (i.pathname && i.pathname.split("/")) || [],
  41762. f = (e.pathname && e.pathname.split("/")) || [],
  41763. w = i.protocol && !b[i.protocol];
  41764. if (
  41765. (w &&
  41766. ((i.hostname = ""),
  41767. (i.port = null),
  41768. i.host && ("" === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  41769. (i.host = ""),
  41770. e.protocol &&
  41771. ((e.hostname = null),
  41772. (e.port = null),
  41773. e.host && ("" === f[0] ? (f[0] = e.host) : f.unshift(e.host)),
  41774. (e.host = null)),
  41775. (y = y && ("" === f[0] || "" === I[0]))),
  41776. A)
  41777. )
  41778. (i.host = e.host || "" === e.host ? e.host : i.host),
  41779. (i.hostname =
  41780. e.hostname || "" === e.hostname ? e.hostname : i.hostname),
  41781. (i.search = e.search),
  41782. (i.query = e.query),
  41783. (I = f);
  41784. else if (f.length)
  41785. I || (I = []),
  41786. I.pop(),
  41787. (I = I.concat(f)),
  41788. (i.search = e.search),
  41789. (i.query = e.query);
  41790. else if (!c.isNullOrUndefined(e.search)) {
  41791. if (w) {
  41792. i.hostname = i.host = I.shift();
  41793. var _ =
  41794. !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  41795. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  41796. }
  41797. return (
  41798. (i.search = e.search),
  41799. (i.query = e.query),
  41800. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  41801. (i.path =
  41802. (i.pathname ? i.pathname : "") +
  41803. (i.search ? i.search : "")),
  41804. (i.href = i.format()),
  41805. i
  41806. );
  41807. }
  41808. if (!I.length)
  41809. return (
  41810. (i.pathname = null),
  41811. i.search ? (i.path = "/" + i.search) : (i.path = null),
  41812. (i.href = i.format()),
  41813. i
  41814. );
  41815. for (
  41816. var T = I.slice(-1)[0],
  41817. x =
  41818. ((i.host || e.host || I.length > 1) &&
  41819. ("." === T || ".." === T)) ||
  41820. "" === T,
  41821. S = 0,
  41822. M = I.length;
  41823. M >= 0;
  41824. M--
  41825. )
  41826. (T = I[M]),
  41827. "." === T
  41828. ? I.splice(M, 1)
  41829. : ".." === T
  41830. ? (I.splice(M, 1), S++)
  41831. : S && (I.splice(M, 1), S--);
  41832. if (!y && !C) for (; S--; S) I.unshift("..");
  41833. !y ||
  41834. "" === I[0] ||
  41835. (I[0] && "/" === I[0].charAt(0)) ||
  41836. I.unshift(""),
  41837. x && "/" !== I.join("/").substr(-1) && I.push("");
  41838. var R = "" === I[0] || (I[0] && "/" === I[0].charAt(0));
  41839. if (w) {
  41840. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  41841. var _ =
  41842. !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  41843. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  41844. }
  41845. return (
  41846. (y = y || (i.host && I.length)),
  41847. y && !R && I.unshift(""),
  41848. I.length
  41849. ? (i.pathname = I.join("/"))
  41850. : ((i.pathname = null), (i.path = null)),
  41851. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  41852. (i.path =
  41853. (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  41854. (i.auth = e.auth || i.auth),
  41855. (i.slashes = i.slashes || e.slashes),
  41856. (i.href = i.format()),
  41857. i
  41858. );
  41859. }),
  41860. (n.prototype.parseHost = function () {
  41861. var e = this.host,
  41862. t = u.exec(e);
  41863. t &&
  41864. ((t = t[0]),
  41865. ":" !== t && (this.port = t.substr(1)),
  41866. (e = e.substr(0, e.length - t.length))),
  41867. e && (this.hostname = e);
  41868. });
  41869. },
  41870. {
  41871. "./util": 209,
  41872. punycode: 204,
  41873. querystring: 207,
  41874. },
  41875. ],
  41876. 209: [
  41877. function (e, t, i) {
  41878. "use strict";
  41879. t.exports = {
  41880. isString: function (e) {
  41881. return "string" == typeof e;
  41882. },
  41883. isObject: function (e) {
  41884. return "object" == typeof e && null !== e;
  41885. },
  41886. isNull: function (e) {
  41887. return null === e;
  41888. },
  41889. isNullOrUndefined: function (e) {
  41890. return null == e;
  41891. },
  41892. };
  41893. },
  41894. {},
  41895. ],
  41896. 210: [
  41897. function (e, t, i) {
  41898. "use strict";
  41899. function n(e) {
  41900. return l + e;
  41901. }
  41902. function r(e) {
  41903. return e.substring(l.length);
  41904. }
  41905. function o(e, t) {
  41906. for (var i in t)
  41907. Object.defineProperty(e, i, {
  41908. value: t[i],
  41909. configurable: !0,
  41910. writable: !0,
  41911. });
  41912. }
  41913. function a(e) {
  41914. if ("string" != typeof e)
  41915. throw new TypeError("key must be a string.");
  41916. }
  41917. var s = Object.prototype.hasOwnProperty,
  41918. l = "~";
  41919. t.exports = function (e) {
  41920. var t = Object.create(null),
  41921. i = 0,
  41922. l = {};
  41923. return (
  41924. o(l, {
  41925. get: function (e, i) {
  41926. a(e);
  41927. var r = n(e);
  41928. return r in t ? t[r] : i;
  41929. },
  41930. set: function (e, r) {
  41931. a(e);
  41932. var o = n(e);
  41933. return o in t || ++i, (t[o] = r);
  41934. },
  41935. has: function (e) {
  41936. return a(e), n(e) in t;
  41937. },
  41938. delete: function (e) {
  41939. a(e);
  41940. var r = n(e);
  41941. return r in t && (--i, delete t[r], !0);
  41942. },
  41943. clear: function () {
  41944. (t = Object.create(null)), (i = 0);
  41945. },
  41946. forEach: function (e, i) {
  41947. if ("function" != typeof e)
  41948. throw new TypeError("`callback` must be a function");
  41949. for (var n in t)
  41950. if (s.call(t, n)) {
  41951. var o = r(n),
  41952. a = t[n];
  41953. e.call(i, a, o, l);
  41954. }
  41955. },
  41956. }),
  41957. Object.defineProperty(l, "size", {
  41958. get: function () {
  41959. return i;
  41960. },
  41961. configurable: !0,
  41962. }),
  41963. "object" == typeof e &&
  41964. null !== e &&
  41965. Object.keys(e).forEach(function (t) {
  41966. l.set(t, e[t]);
  41967. }),
  41968. l
  41969. );
  41970. };
  41971. },
  41972. {},
  41973. ],
  41974. 211: [
  41975. function (e, t, i) {
  41976. t.exports = e("./lib/heap");
  41977. },
  41978. {
  41979. "./lib/heap": 212,
  41980. },
  41981. ],
  41982. 212: [
  41983. function (e, t, i) {
  41984. (function () {
  41985. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  41986. (r = Math.floor),
  41987. (u = Math.min),
  41988. (n = function (e, t) {
  41989. return e < t ? -1 : e > t ? 1 : 0;
  41990. }),
  41991. (h = function (e, t, i, o, a) {
  41992. var s;
  41993. if ((null == i && (i = 0), null == a && (a = n), i < 0))
  41994. throw new Error("lo must be non-negative");
  41995. for (null == o && (o = e.length); i < o; )
  41996. (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1);
  41997. return [].splice.apply(e, [i, i - i].concat(t)), t;
  41998. }),
  41999. (s = function (e, t, i) {
  42000. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i);
  42001. }),
  42002. (a = function (e, t) {
  42003. var i, r;
  42004. return (
  42005. null == t && (t = n),
  42006. (i = e.pop()),
  42007. e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i),
  42008. r
  42009. );
  42010. }),
  42011. (c = function (e, t, i) {
  42012. var r;
  42013. return (
  42014. null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r
  42015. );
  42016. }),
  42017. (l = function (e, t, i) {
  42018. var r;
  42019. return (
  42020. null == i && (i = n),
  42021. e.length &&
  42022. i(e[0], t) < 0 &&
  42023. ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)),
  42024. t
  42025. );
  42026. }),
  42027. (o = function (e, t) {
  42028. var i, o, a, s, l, c;
  42029. for (
  42030. null == t && (t = n),
  42031. s = function () {
  42032. c = [];
  42033. for (
  42034. var t = 0, i = r(e.length / 2);
  42035. 0 <= i ? t < i : t > i;
  42036. 0 <= i ? t++ : t--
  42037. )
  42038. c.push(t);
  42039. return c;
  42040. }
  42041. .apply(this)
  42042. .reverse(),
  42043. l = [],
  42044. o = 0,
  42045. a = s.length;
  42046. o < a;
  42047. o++
  42048. )
  42049. (i = s[o]), l.push(m(e, i, t));
  42050. return l;
  42051. }),
  42052. (f = function (e, t, i) {
  42053. var r;
  42054. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1))
  42055. return g(e, 0, r, i), m(e, r, i);
  42056. }),
  42057. (d = function (e, t, i) {
  42058. var r, a, s, c, h;
  42059. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length))
  42060. return a;
  42061. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++)
  42062. (r = h[s]), l(a, r, i);
  42063. return a.sort(i).reverse();
  42064. }),
  42065. (p = function (e, t, i) {
  42066. var r, s, l, c, d, p, f, g, m, v;
  42067. if ((null == i && (i = n), 10 * t <= e.length)) {
  42068. if (((c = e.slice(0, t).sort(i)), !c.length)) return c;
  42069. for (
  42070. l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length;
  42071. d < f;
  42072. d++
  42073. )
  42074. (r = g[d]),
  42075. i(r, l) < 0 &&
  42076. (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]));
  42077. return c;
  42078. }
  42079. for (
  42080. o(e, i), v = [], s = p = 0, m = u(t, e.length);
  42081. 0 <= m ? p < m : p > m;
  42082. s = 0 <= m ? ++p : --p
  42083. )
  42084. v.push(a(e, i));
  42085. return v;
  42086. }),
  42087. (g = function (e, t, i, r) {
  42088. var o, a, s;
  42089. for (
  42090. null == r && (r = n), o = e[i];
  42091. i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0);
  42092. )
  42093. (e[i] = a), (i = s);
  42094. return (e[i] = o);
  42095. }),
  42096. (m = function (e, t, i) {
  42097. var r, o, a, s, l;
  42098. for (
  42099. null == i && (i = n),
  42100. o = e.length,
  42101. l = t,
  42102. a = e[t],
  42103. r = 2 * t + 1;
  42104. r < o;
  42105. )
  42106. (s = r + 1),
  42107. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  42108. (e[t] = e[r]),
  42109. (t = r),
  42110. (r = 2 * t + 1);
  42111. return (e[t] = a), g(e, l, t, i);
  42112. }),
  42113. (e = (function () {
  42114. function e(e) {
  42115. (this.cmp = null != e ? e : n), (this.nodes = []);
  42116. }
  42117. return (
  42118. (e.push = s),
  42119. (e.pop = a),
  42120. (e.replace = c),
  42121. (e.pushpop = l),
  42122. (e.heapify = o),
  42123. (e.updateItem = f),
  42124. (e.nlargest = d),
  42125. (e.nsmallest = p),
  42126. (e.prototype.push = function (e) {
  42127. return s(this.nodes, e, this.cmp);
  42128. }),
  42129. (e.prototype.pop = function () {
  42130. return a(this.nodes, this.cmp);
  42131. }),
  42132. (e.prototype.peek = function () {
  42133. return this.nodes[0];
  42134. }),
  42135. (e.prototype.contains = function (e) {
  42136. return this.nodes.indexOf(e) !== -1;
  42137. }),
  42138. (e.prototype.replace = function (e) {
  42139. return c(this.nodes, e, this.cmp);
  42140. }),
  42141. (e.prototype.pushpop = function (e) {
  42142. return l(this.nodes, e, this.cmp);
  42143. }),
  42144. (e.prototype.heapify = function () {
  42145. return o(this.nodes, this.cmp);
  42146. }),
  42147. (e.prototype.updateItem = function (e) {
  42148. return f(this.nodes, e, this.cmp);
  42149. }),
  42150. (e.prototype.clear = function () {
  42151. return (this.nodes = []);
  42152. }),
  42153. (e.prototype.empty = function () {
  42154. return 0 === this.nodes.length;
  42155. }),
  42156. (e.prototype.size = function () {
  42157. return this.nodes.length;
  42158. }),
  42159. (e.prototype.clone = function () {
  42160. var t;
  42161. return (t = new e()), (t.nodes = this.nodes.slice(0)), t;
  42162. }),
  42163. (e.prototype.toArray = function () {
  42164. return this.nodes.slice(0);
  42165. }),
  42166. (e.prototype.insert = e.prototype.push),
  42167. (e.prototype.top = e.prototype.peek),
  42168. (e.prototype.front = e.prototype.peek),
  42169. (e.prototype.has = e.prototype.contains),
  42170. (e.prototype.copy = e.prototype.clone),
  42171. e
  42172. );
  42173. })()),
  42174. (function (e, n) {
  42175. return "function" == typeof define && define.amd
  42176. ? define([], n)
  42177. : "object" == typeof i
  42178. ? (t.exports = n())
  42179. : (e.Heap = n());
  42180. })(this, function () {
  42181. return e;
  42182. });
  42183. }).call(this);
  42184. },
  42185. {},
  42186. ],
  42187. 213: [
  42188. function (e, t, i) {
  42189. !(function (e) {
  42190. function i() {}
  42191. function n(e, t) {
  42192. return function () {
  42193. e.apply(t, arguments);
  42194. };
  42195. }
  42196. function r(e) {
  42197. if ("object" != typeof this)
  42198. throw new TypeError("Promises must be constructed via new");
  42199. if ("function" != typeof e) throw new TypeError("not a function");
  42200. (this._state = 0),
  42201. (this._handled = !1),
  42202. (this._value = void 0),
  42203. (this._deferreds = []),
  42204. h(e, this);
  42205. }
  42206. function o(e, t) {
  42207. for (; 3 === e._state; ) e = e._value;
  42208. return 0 === e._state
  42209. ? void e._deferreds.push(t)
  42210. : ((e._handled = !0),
  42211. void r._immediateFn(function () {
  42212. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  42213. if (null === i)
  42214. return void (1 === e._state ? a : s)(t.promise, e._value);
  42215. var n;
  42216. try {
  42217. n = i(e._value);
  42218. } catch (e) {
  42219. return void s(t.promise, e);
  42220. }
  42221. a(t.promise, n);
  42222. }));
  42223. }
  42224. function a(e, t) {
  42225. try {
  42226. if (t === e)
  42227. throw new TypeError(
  42228. "A promise cannot be resolved with itself."
  42229. );
  42230. if (t && ("object" == typeof t || "function" == typeof t)) {
  42231. var i = t.then;
  42232. if (t instanceof r)
  42233. return (e._state = 3), (e._value = t), void l(e);
  42234. if ("function" == typeof i) return void h(n(i, t), e);
  42235. }
  42236. (e._state = 1), (e._value = t), l(e);
  42237. } catch (t) {
  42238. s(e, t);
  42239. }
  42240. }
  42241. function s(e, t) {
  42242. (e._state = 2), (e._value = t), l(e);
  42243. }
  42244. function l(e) {
  42245. 2 === e._state &&
  42246. 0 === e._deferreds.length &&
  42247. r._immediateFn(function () {
  42248. e._handled || r._unhandledRejectionFn(e._value);
  42249. });
  42250. for (var t = 0, i = e._deferreds.length; t < i; t++)
  42251. o(e, e._deferreds[t]);
  42252. e._deferreds = null;
  42253. }
  42254. function c(e, t, i) {
  42255. (this.onFulfilled = "function" == typeof e ? e : null),
  42256. (this.onRejected = "function" == typeof t ? t : null),
  42257. (this.promise = i);
  42258. }
  42259. function h(e, t) {
  42260. var i = !1;
  42261. try {
  42262. e(
  42263. function (e) {
  42264. i || ((i = !0), a(t, e));
  42265. },
  42266. function (e) {
  42267. i || ((i = !0), s(t, e));
  42268. }
  42269. );
  42270. } catch (e) {
  42271. if (i) return;
  42272. (i = !0), s(t, e);
  42273. }
  42274. }
  42275. var u = setTimeout;
  42276. (r.prototype.catch = function (e) {
  42277. return this.then(null, e);
  42278. }),
  42279. (r.prototype.then = function (e, t) {
  42280. var n = new this.constructor(i);
  42281. return o(this, new c(e, t, n)), n;
  42282. }),
  42283. (r.all = function (e) {
  42284. var t = Array.prototype.slice.call(e);
  42285. return new r(function (e, i) {
  42286. function n(o, a) {
  42287. try {
  42288. if (a && ("object" == typeof a || "function" == typeof a)) {
  42289. var s = a.then;
  42290. if ("function" == typeof s)
  42291. return void s.call(
  42292. a,
  42293. function (e) {
  42294. n(o, e);
  42295. },
  42296. i
  42297. );
  42298. }
  42299. (t[o] = a), 0 === --r && e(t);
  42300. } catch (e) {
  42301. i(e);
  42302. }
  42303. }
  42304. if (0 === t.length) return e([]);
  42305. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o]);
  42306. });
  42307. }),
  42308. (r.resolve = function (e) {
  42309. return e && "object" == typeof e && e.constructor === r
  42310. ? e
  42311. : new r(function (t) {
  42312. t(e);
  42313. });
  42314. }),
  42315. (r.reject = function (e) {
  42316. return new r(function (t, i) {
  42317. i(e);
  42318. });
  42319. }),
  42320. (r.race = function (e) {
  42321. return new r(function (t, i) {
  42322. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i);
  42323. });
  42324. }),
  42325. (r._immediateFn =
  42326. ("function" == typeof setImmediate &&
  42327. function (e) {
  42328. setImmediate(e);
  42329. }) ||
  42330. function (e) {
  42331. u(e, 0);
  42332. }),
  42333. (r._unhandledRejectionFn = function (e) {
  42334. "undefined" != typeof console &&
  42335. console &&
  42336. console.warn("Possible Unhandled Promise Rejection:", e);
  42337. }),
  42338. (r._setImmediateFn = function (e) {
  42339. r._immediateFn = e;
  42340. }),
  42341. (r._setUnhandledRejectionFn = function (e) {
  42342. r._unhandledRejectionFn = e;
  42343. }),
  42344. "undefined" != typeof t && t.exports
  42345. ? (t.exports = r)
  42346. : e.Promise || (e.Promise = r);
  42347. })(this);
  42348. },
  42349. {},
  42350. ],
  42351. 214: [
  42352. function (e, t, i) {
  42353. (function (i) {
  42354. !(function (i, n) {
  42355. "function" == typeof define && define.amd
  42356. ? define(["bytebuffer"], n)
  42357. : "function" == typeof e && "object" == typeof t && t && t.exports
  42358. ? (t.exports = n(e("bytebuffer"), !0))
  42359. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(
  42360. i.dcodeIO.ByteBuffer
  42361. ));
  42362. })(this, function (t, n) {
  42363. "use strict";
  42364. var r = {};
  42365. return (
  42366. (r.ByteBuffer = t),
  42367. (r.Long = t.Long || null),
  42368. (r.VERSION = "5.0.1"),
  42369. (r.WIRE_TYPES = {}),
  42370. (r.WIRE_TYPES.VARINT = 0),
  42371. (r.WIRE_TYPES.BITS64 = 1),
  42372. (r.WIRE_TYPES.LDELIM = 2),
  42373. (r.WIRE_TYPES.STARTGROUP = 3),
  42374. (r.WIRE_TYPES.ENDGROUP = 4),
  42375. (r.WIRE_TYPES.BITS32 = 5),
  42376. (r.PACKABLE_WIRE_TYPES = [
  42377. r.WIRE_TYPES.VARINT,
  42378. r.WIRE_TYPES.BITS64,
  42379. r.WIRE_TYPES.BITS32,
  42380. ]),
  42381. (r.TYPES = {
  42382. int32: {
  42383. name: "int32",
  42384. wireType: r.WIRE_TYPES.VARINT,
  42385. defaultValue: 0,
  42386. },
  42387. uint32: {
  42388. name: "uint32",
  42389. wireType: r.WIRE_TYPES.VARINT,
  42390. defaultValue: 0,
  42391. },
  42392. sint32: {
  42393. name: "sint32",
  42394. wireType: r.WIRE_TYPES.VARINT,
  42395. defaultValue: 0,
  42396. },
  42397. int64: {
  42398. name: "int64",
  42399. wireType: r.WIRE_TYPES.VARINT,
  42400. defaultValue: r.Long ? r.Long.ZERO : void 0,
  42401. },
  42402. uint64: {
  42403. name: "uint64",
  42404. wireType: r.WIRE_TYPES.VARINT,
  42405. defaultValue: r.Long ? r.Long.UZERO : void 0,
  42406. },
  42407. sint64: {
  42408. name: "sint64",
  42409. wireType: r.WIRE_TYPES.VARINT,
  42410. defaultValue: r.Long ? r.Long.ZERO : void 0,
  42411. },
  42412. bool: {
  42413. name: "bool",
  42414. wireType: r.WIRE_TYPES.VARINT,
  42415. defaultValue: !1,
  42416. },
  42417. double: {
  42418. name: "double",
  42419. wireType: r.WIRE_TYPES.BITS64,
  42420. defaultValue: 0,
  42421. },
  42422. string: {
  42423. name: "string",
  42424. wireType: r.WIRE_TYPES.LDELIM,
  42425. defaultValue: "",
  42426. },
  42427. bytes: {
  42428. name: "bytes",
  42429. wireType: r.WIRE_TYPES.LDELIM,
  42430. defaultValue: null,
  42431. },
  42432. fixed32: {
  42433. name: "fixed32",
  42434. wireType: r.WIRE_TYPES.BITS32,
  42435. defaultValue: 0,
  42436. },
  42437. sfixed32: {
  42438. name: "sfixed32",
  42439. wireType: r.WIRE_TYPES.BITS32,
  42440. defaultValue: 0,
  42441. },
  42442. fixed64: {
  42443. name: "fixed64",
  42444. wireType: r.WIRE_TYPES.BITS64,
  42445. defaultValue: r.Long ? r.Long.UZERO : void 0,
  42446. },
  42447. sfixed64: {
  42448. name: "sfixed64",
  42449. wireType: r.WIRE_TYPES.BITS64,
  42450. defaultValue: r.Long ? r.Long.ZERO : void 0,
  42451. },
  42452. float: {
  42453. name: "float",
  42454. wireType: r.WIRE_TYPES.BITS32,
  42455. defaultValue: 0,
  42456. },
  42457. enum: {
  42458. name: "enum",
  42459. wireType: r.WIRE_TYPES.VARINT,
  42460. defaultValue: 0,
  42461. },
  42462. message: {
  42463. name: "message",
  42464. wireType: r.WIRE_TYPES.LDELIM,
  42465. defaultValue: null,
  42466. },
  42467. group: {
  42468. name: "group",
  42469. wireType: r.WIRE_TYPES.STARTGROUP,
  42470. defaultValue: null,
  42471. },
  42472. }),
  42473. (r.MAP_KEY_TYPES = [
  42474. r.TYPES.int32,
  42475. r.TYPES.sint32,
  42476. r.TYPES.sfixed32,
  42477. r.TYPES.uint32,
  42478. r.TYPES.fixed32,
  42479. r.TYPES.int64,
  42480. r.TYPES.sint64,
  42481. r.TYPES.sfixed64,
  42482. r.TYPES.uint64,
  42483. r.TYPES.fixed64,
  42484. r.TYPES.bool,
  42485. r.TYPES.string,
  42486. r.TYPES.bytes,
  42487. ]),
  42488. (r.ID_MIN = 1),
  42489. (r.ID_MAX = 536870911),
  42490. (r.convertFieldsToCamelCase = !1),
  42491. (r.populateAccessors = !0),
  42492. (r.populateDefaults = !0),
  42493. (r.Util = (function () {
  42494. var t = {};
  42495. return (
  42496. (t.IS_NODE = !(
  42497. "object" != typeof i ||
  42498. i + "" != "[object process]" ||
  42499. i.browser
  42500. )),
  42501. (t.XHR = function () {
  42502. for (
  42503. var e = [
  42504. function () {
  42505. return new XMLHttpRequest();
  42506. },
  42507. function () {
  42508. return new ActiveXObject("Msxml2.XMLHTTP");
  42509. },
  42510. function () {
  42511. return new ActiveXObject("Msxml3.XMLHTTP");
  42512. },
  42513. function () {
  42514. return new ActiveXObject("Microsoft.XMLHTTP");
  42515. },
  42516. ],
  42517. t = null,
  42518. i = 0;
  42519. i < e.length;
  42520. i++
  42521. ) {
  42522. try {
  42523. t = e[i]();
  42524. } catch (e) {
  42525. continue;
  42526. }
  42527. break;
  42528. }
  42529. if (!t) throw Error("XMLHttpRequest is not supported");
  42530. return t;
  42531. }),
  42532. (t.fetch = function (i, n) {
  42533. if (
  42534. (n && "function" != typeof n && (n = null), t.IS_NODE)
  42535. ) {
  42536. var r = e("fs");
  42537. if (n)
  42538. r.readFile(i, function (e, t) {
  42539. n(e ? null : "" + t);
  42540. });
  42541. else
  42542. try {
  42543. return r.readFileSync(i);
  42544. } catch (e) {
  42545. return null;
  42546. }
  42547. } else {
  42548. var o = t.XHR();
  42549. if (
  42550. (o.open("GET", i, !!n),
  42551. o.setRequestHeader("Accept", "text/plain"),
  42552. "function" == typeof o.overrideMimeType &&
  42553. o.overrideMimeType("text/plain"),
  42554. !n)
  42555. )
  42556. return (
  42557. o.send(null),
  42558. 200 == o.status ||
  42559. (0 == o.status && "string" == typeof o.responseText)
  42560. ? o.responseText
  42561. : null
  42562. );
  42563. if (
  42564. ((o.onreadystatechange = function () {
  42565. 4 == o.readyState &&
  42566. n(
  42567. 200 == o.status ||
  42568. (0 == o.status &&
  42569. "string" == typeof o.responseText)
  42570. ? o.responseText
  42571. : null
  42572. );
  42573. }),
  42574. 4 == o.readyState)
  42575. )
  42576. return;
  42577. o.send(null);
  42578. }
  42579. }),
  42580. (t.toCamelCase = function (e) {
  42581. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  42582. return t.toUpperCase();
  42583. });
  42584. }),
  42585. t
  42586. );
  42587. })()),
  42588. (r.Lang = {
  42589. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  42590. RULE: /^(?:required|optional|repeated|map)$/,
  42591. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  42592. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  42593. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  42594. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  42595. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  42596. NUMBER:
  42597. /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  42598. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  42599. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  42600. NUMBER_OCT: /^0[0-7]+$/,
  42601. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  42602. BOOL: /^(?:true|false)$/i,
  42603. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  42604. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  42605. WHITESPACE: /\s/,
  42606. STRING:
  42607. /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  42608. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  42609. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  42610. }),
  42611. (r.DotProto = (function (e, t) {
  42612. function i(e, i) {
  42613. var n = -1,
  42614. r = 1;
  42615. if (
  42616. ("-" == e.charAt(0) && ((r = -1), (e = e.substring(1))),
  42617. t.NUMBER_DEC.test(e))
  42618. )
  42619. n = parseInt(e);
  42620. else if (t.NUMBER_HEX.test(e))
  42621. n = parseInt(e.substring(2), 16);
  42622. else {
  42623. if (!t.NUMBER_OCT.test(e))
  42624. throw Error(
  42625. "illegal id value: " + (r < 0 ? "-" : "") + e
  42626. );
  42627. n = parseInt(e.substring(1), 8);
  42628. }
  42629. if (((n = (r * n) | 0), !i && n < 0))
  42630. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  42631. return n;
  42632. }
  42633. function n(e) {
  42634. var i = 1;
  42635. if (
  42636. ("-" == e.charAt(0) && ((i = -1), (e = e.substring(1))),
  42637. t.NUMBER_DEC.test(e))
  42638. )
  42639. return i * parseInt(e, 10);
  42640. if (t.NUMBER_HEX.test(e))
  42641. return i * parseInt(e.substring(2), 16);
  42642. if (t.NUMBER_OCT.test(e))
  42643. return i * parseInt(e.substring(1), 8);
  42644. if ("inf" === e) return i * (1 / 0);
  42645. if ("nan" === e) return NaN;
  42646. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e);
  42647. throw Error(
  42648. "illegal number value: " + (i < 0 ? "-" : "") + e
  42649. );
  42650. }
  42651. function r(e, t, i) {
  42652. "undefined" == typeof e[t]
  42653. ? (e[t] = i)
  42654. : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i));
  42655. }
  42656. var o = {},
  42657. a = function (e) {
  42658. (this.source = e + ""),
  42659. (this.index = 0),
  42660. (this.line = 1),
  42661. (this.stack = []),
  42662. (this._stringOpen = null);
  42663. },
  42664. s = a.prototype;
  42665. (s._readString = function () {
  42666. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  42667. e.lastIndex = this.index - 1;
  42668. var i = e.exec(this.source);
  42669. if (!i) throw Error("unterminated string");
  42670. return (
  42671. (this.index = e.lastIndex),
  42672. this.stack.push(this._stringOpen),
  42673. (this._stringOpen = null),
  42674. i[1]
  42675. );
  42676. }),
  42677. (s.next = function () {
  42678. if (this.stack.length > 0) return this.stack.shift();
  42679. if (this.index >= this.source.length) return null;
  42680. if (null !== this._stringOpen) return this._readString();
  42681. var e, i, n;
  42682. do {
  42683. for (
  42684. e = !1;
  42685. t.WHITESPACE.test((n = this.source.charAt(this.index)));
  42686. )
  42687. if (
  42688. ("\n" === n && ++this.line,
  42689. ++this.index === this.source.length)
  42690. )
  42691. return null;
  42692. if ("/" === this.source.charAt(this.index))
  42693. if (
  42694. (++this.index, "/" === this.source.charAt(this.index))
  42695. ) {
  42696. for (; "\n" !== this.source.charAt(++this.index); )
  42697. if (this.index == this.source.length) return null;
  42698. ++this.index, ++this.line, (e = !0);
  42699. } else {
  42700. if ("*" !== (n = this.source.charAt(this.index)))
  42701. return "/";
  42702. do {
  42703. if (
  42704. ("\n" === n && ++this.line,
  42705. ++this.index === this.source.length)
  42706. )
  42707. return null;
  42708. (i = n), (n = this.source.charAt(this.index));
  42709. } while ("*" !== i || "/" !== n);
  42710. ++this.index, (e = !0);
  42711. }
  42712. } while (e);
  42713. if (this.index === this.source.length) return null;
  42714. var r = this.index;
  42715. t.DELIM.lastIndex = 0;
  42716. var o = t.DELIM.test(this.source.charAt(r++));
  42717. if (!o)
  42718. for (
  42719. ;
  42720. r < this.source.length &&
  42721. !t.DELIM.test(this.source.charAt(r));
  42722. )
  42723. ++r;
  42724. var a = this.source.substring(this.index, (this.index = r));
  42725. return (
  42726. ('"' !== a && "'" !== a) || (this._stringOpen = a), a
  42727. );
  42728. }),
  42729. (s.peek = function () {
  42730. if (0 === this.stack.length) {
  42731. var e = this.next();
  42732. if (null === e) return null;
  42733. this.stack.push(e);
  42734. }
  42735. return this.stack[0];
  42736. }),
  42737. (s.skip = function (e) {
  42738. var t = this.next();
  42739. if (t !== e)
  42740. throw Error("illegal '" + t + "', '" + e + "' expected");
  42741. }),
  42742. (s.omit = function (e) {
  42743. return this.peek() === e && (this.next(), !0);
  42744. }),
  42745. (s.toString = function () {
  42746. return (
  42747. "Tokenizer (" +
  42748. this.index +
  42749. "/" +
  42750. this.source.length +
  42751. " at line " +
  42752. this.line +
  42753. ")"
  42754. );
  42755. }),
  42756. (o.Tokenizer = a);
  42757. var l = function (e) {
  42758. (this.tn = new a(e)), (this.proto3 = !1);
  42759. },
  42760. c = l.prototype;
  42761. return (
  42762. (c.parse = function () {
  42763. var e,
  42764. i,
  42765. n = {
  42766. name: "[ROOT]",
  42767. package: null,
  42768. messages: [],
  42769. enums: [],
  42770. imports: [],
  42771. options: {},
  42772. services: [],
  42773. },
  42774. r = !0;
  42775. try {
  42776. for (; (e = this.tn.next()); )
  42777. switch (e) {
  42778. case "package":
  42779. if (!r || null !== n.package)
  42780. throw Error("unexpected 'package'");
  42781. if (((e = this.tn.next()), !t.TYPEREF.test(e)))
  42782. throw Error("illegal package name: " + e);
  42783. this.tn.skip(";"), (n.package = e);
  42784. break;
  42785. case "import":
  42786. if (!r) throw Error("unexpected 'import'");
  42787. (e = this.tn.peek()),
  42788. ("public" === e || (i = "weak" === e)) &&
  42789. this.tn.next(),
  42790. (e = this._readString()),
  42791. this.tn.skip(";"),
  42792. i || n.imports.push(e);
  42793. break;
  42794. case "syntax":
  42795. if (!r) throw Error("unexpected 'syntax'");
  42796. this.tn.skip("="),
  42797. "proto3" === (n.syntax = this._readString()) &&
  42798. (this.proto3 = !0),
  42799. this.tn.skip(";");
  42800. break;
  42801. case "message":
  42802. this._parseMessage(n, null), (r = !1);
  42803. break;
  42804. case "enum":
  42805. this._parseEnum(n), (r = !1);
  42806. break;
  42807. case "option":
  42808. this._parseOption(n);
  42809. break;
  42810. case "service":
  42811. this._parseService(n);
  42812. break;
  42813. case "extend":
  42814. this._parseExtend(n);
  42815. break;
  42816. default:
  42817. throw Error("unexpected '" + e + "'");
  42818. }
  42819. } catch (e) {
  42820. throw (
  42821. ((e.message =
  42822. "Parse error at line " +
  42823. this.tn.line +
  42824. ": " +
  42825. e.message),
  42826. e)
  42827. );
  42828. }
  42829. return delete n.name, n;
  42830. }),
  42831. (l.parse = function (e) {
  42832. return new l(e).parse();
  42833. }),
  42834. (c._readString = function () {
  42835. var e,
  42836. t,
  42837. i = "";
  42838. do {
  42839. if (((t = this.tn.next()), "'" !== t && '"' !== t))
  42840. throw Error("illegal string delimiter: " + t);
  42841. (i += this.tn.next()),
  42842. this.tn.skip(t),
  42843. (e = this.tn.peek());
  42844. } while ('"' === e || '"' === e);
  42845. return i;
  42846. }),
  42847. (c._readValue = function (e) {
  42848. var i = this.tn.peek();
  42849. if ('"' === i || "'" === i) return this._readString();
  42850. if ((this.tn.next(), t.NUMBER.test(i))) return n(i);
  42851. if (t.BOOL.test(i)) return "true" === i.toLowerCase();
  42852. if (e && t.TYPEREF.test(i)) return i;
  42853. throw Error("illegal value: " + i);
  42854. }),
  42855. (c._parseOption = function (e, i) {
  42856. var n = this.tn.next(),
  42857. r = !1;
  42858. if (
  42859. ("(" === n && ((r = !0), (n = this.tn.next())),
  42860. !t.TYPEREF.test(n))
  42861. )
  42862. throw Error("illegal option name: " + n);
  42863. var o = n;
  42864. r &&
  42865. (this.tn.skip(")"),
  42866. (o = "(" + o + ")"),
  42867. (n = this.tn.peek()),
  42868. t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  42869. this.tn.skip("="),
  42870. this._parseOptionValue(e, o),
  42871. i || this.tn.skip(";");
  42872. }),
  42873. (c._parseOptionValue = function (e, i) {
  42874. var n = this.tn.peek();
  42875. if ("{" !== n) r(e.options, i, this._readValue(!0));
  42876. else
  42877. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  42878. if (!t.NAME.test(n))
  42879. throw Error("illegal option name: " + i + "." + n);
  42880. this.tn.omit(":")
  42881. ? r(e.options, i + "." + n, this._readValue(!0))
  42882. : this._parseOptionValue(e, i + "." + n);
  42883. }
  42884. }),
  42885. (c._parseService = function (e) {
  42886. var i = this.tn.next();
  42887. if (!t.NAME.test(i))
  42888. throw Error(
  42889. "illegal service name at line " +
  42890. this.tn.line +
  42891. ": " +
  42892. i
  42893. );
  42894. var n = i,
  42895. r = {
  42896. name: n,
  42897. rpc: {},
  42898. options: {},
  42899. };
  42900. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  42901. if ("option" === i) this._parseOption(r);
  42902. else {
  42903. if ("rpc" !== i)
  42904. throw Error("illegal service token: " + i);
  42905. this._parseServiceRPC(r);
  42906. }
  42907. this.tn.omit(";"), e.services.push(r);
  42908. }),
  42909. (c._parseServiceRPC = function (e) {
  42910. var i = "rpc",
  42911. n = this.tn.next();
  42912. if (!t.NAME.test(n))
  42913. throw Error("illegal rpc service method name: " + n);
  42914. var r = n,
  42915. o = {
  42916. request: null,
  42917. response: null,
  42918. request_stream: !1,
  42919. response_stream: !1,
  42920. options: {},
  42921. };
  42922. if (
  42923. (this.tn.skip("("),
  42924. (n = this.tn.next()),
  42925. "stream" === n.toLowerCase() &&
  42926. ((o.request_stream = !0), (n = this.tn.next())),
  42927. !t.TYPEREF.test(n))
  42928. )
  42929. throw Error("illegal rpc service request type: " + n);
  42930. if (
  42931. ((o.request = n),
  42932. this.tn.skip(")"),
  42933. (n = this.tn.next()),
  42934. "returns" !== n.toLowerCase())
  42935. )
  42936. throw Error(
  42937. "illegal rpc service request type delimiter: " + n
  42938. );
  42939. if (
  42940. (this.tn.skip("("),
  42941. (n = this.tn.next()),
  42942. "stream" === n.toLowerCase() &&
  42943. ((o.response_stream = !0), (n = this.tn.next())),
  42944. (o.response = n),
  42945. this.tn.skip(")"),
  42946. (n = this.tn.peek()),
  42947. "{" === n)
  42948. ) {
  42949. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  42950. if ("option" !== n)
  42951. throw Error("illegal rpc service token: " + n);
  42952. this._parseOption(o);
  42953. }
  42954. this.tn.omit(";");
  42955. } else this.tn.skip(";");
  42956. "undefined" == typeof e[i] && (e[i] = {}), (e[i][r] = o);
  42957. }),
  42958. (c._parseMessage = function (e, n) {
  42959. var r = !!n,
  42960. o = this.tn.next(),
  42961. a = {
  42962. name: "",
  42963. fields: [],
  42964. enums: [],
  42965. messages: [],
  42966. options: {},
  42967. services: [],
  42968. oneofs: {},
  42969. };
  42970. if (!t.NAME.test(o))
  42971. throw Error(
  42972. "illegal " + (r ? "group" : "message") + " name: " + o
  42973. );
  42974. for (
  42975. a.name = o,
  42976. r &&
  42977. (this.tn.skip("="),
  42978. (n.id = i(this.tn.next())),
  42979. (a.isGroup = !0)),
  42980. o = this.tn.peek(),
  42981. "[" === o && n && this._parseFieldOptions(n),
  42982. this.tn.skip("{");
  42983. "}" !== (o = this.tn.next());
  42984. )
  42985. if (t.RULE.test(o)) this._parseMessageField(a, o);
  42986. else if ("oneof" === o) this._parseMessageOneOf(a);
  42987. else if ("enum" === o) this._parseEnum(a);
  42988. else if ("message" === o) this._parseMessage(a);
  42989. else if ("option" === o) this._parseOption(a);
  42990. else if ("service" === o) this._parseService(a);
  42991. else if ("extensions" === o)
  42992. a.extensions = this._parseExtensionRanges();
  42993. else if ("reserved" === o) this._parseIgnored();
  42994. else if ("extend" === o) this._parseExtend(a);
  42995. else {
  42996. if (!t.TYPEREF.test(o))
  42997. throw Error("illegal message token: " + o);
  42998. if (!this.proto3)
  42999. throw Error("illegal field rule: " + o);
  43000. this._parseMessageField(a, "optional", o);
  43001. }
  43002. return this.tn.omit(";"), e.messages.push(a), a;
  43003. }),
  43004. (c._parseIgnored = function () {
  43005. for (; ";" !== this.tn.peek(); ) this.tn.next();
  43006. this.tn.skip(";");
  43007. }),
  43008. (c._parseMessageField = function (e, n, r) {
  43009. if (!t.RULE.test(n))
  43010. throw Error("illegal message field rule: " + n);
  43011. var o,
  43012. a = {
  43013. rule: n,
  43014. type: "",
  43015. name: "",
  43016. options: {},
  43017. id: 0,
  43018. };
  43019. if ("map" === n) {
  43020. if (r) throw Error("illegal type: " + r);
  43021. if (
  43022. (this.tn.skip("<"),
  43023. (o = this.tn.next()),
  43024. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  43025. )
  43026. throw Error("illegal message field type: " + o);
  43027. if (
  43028. ((a.keytype = o),
  43029. this.tn.skip(","),
  43030. (o = this.tn.next()),
  43031. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  43032. )
  43033. throw Error("illegal message field: " + o);
  43034. if (
  43035. ((a.type = o),
  43036. this.tn.skip(">"),
  43037. (o = this.tn.next()),
  43038. !t.NAME.test(o))
  43039. )
  43040. throw Error("illegal message field name: " + o);
  43041. (a.name = o),
  43042. this.tn.skip("="),
  43043. (a.id = i(this.tn.next())),
  43044. (o = this.tn.peek()),
  43045. "[" === o && this._parseFieldOptions(a),
  43046. this.tn.skip(";");
  43047. } else if (
  43048. ((r = "undefined" != typeof r ? r : this.tn.next()),
  43049. "group" === r)
  43050. ) {
  43051. var s = this._parseMessage(e, a);
  43052. if (!/^[A-Z]/.test(s.name))
  43053. throw Error("illegal group name: " + s.name);
  43054. (a.type = s.name),
  43055. (a.name = s.name.toLowerCase()),
  43056. this.tn.omit(";");
  43057. } else {
  43058. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  43059. throw Error("illegal message field type: " + r);
  43060. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o)))
  43061. throw Error("illegal message field name: " + o);
  43062. (a.name = o),
  43063. this.tn.skip("="),
  43064. (a.id = i(this.tn.next())),
  43065. (o = this.tn.peek()),
  43066. "[" === o && this._parseFieldOptions(a),
  43067. this.tn.skip(";");
  43068. }
  43069. return e.fields.push(a), a;
  43070. }),
  43071. (c._parseMessageOneOf = function (e) {
  43072. var i = this.tn.next();
  43073. if (!t.NAME.test(i))
  43074. throw Error("illegal oneof name: " + i);
  43075. var n,
  43076. r = i,
  43077. o = [];
  43078. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  43079. (n = this._parseMessageField(e, "optional", i)),
  43080. (n.oneof = r),
  43081. o.push(n.id);
  43082. this.tn.omit(";"), (e.oneofs[r] = o);
  43083. }),
  43084. (c._parseFieldOptions = function (e) {
  43085. this.tn.skip("[");
  43086. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  43087. i || this.tn.skip(","),
  43088. this._parseOption(e, !0),
  43089. (i = !1);
  43090. this.tn.next();
  43091. }),
  43092. (c._parseEnum = function (e) {
  43093. var n = {
  43094. name: "",
  43095. values: [],
  43096. options: {},
  43097. },
  43098. r = this.tn.next();
  43099. if (!t.NAME.test(r)) throw Error("illegal name: " + r);
  43100. for (
  43101. n.name = r, this.tn.skip("{");
  43102. "}" !== (r = this.tn.next());
  43103. )
  43104. if ("option" === r) this._parseOption(n);
  43105. else {
  43106. if (!t.NAME.test(r)) throw Error("illegal name: " + r);
  43107. this.tn.skip("=");
  43108. var o = {
  43109. name: r,
  43110. id: i(this.tn.next(), !0),
  43111. };
  43112. (r = this.tn.peek()),
  43113. "[" === r &&
  43114. this._parseFieldOptions({
  43115. options: {},
  43116. }),
  43117. this.tn.skip(";"),
  43118. n.values.push(o);
  43119. }
  43120. this.tn.omit(";"), e.enums.push(n);
  43121. }),
  43122. (c._parseExtensionRanges = function () {
  43123. var t,
  43124. i,
  43125. r,
  43126. o = [];
  43127. do {
  43128. for (i = []; ; ) {
  43129. switch ((t = this.tn.next())) {
  43130. case "min":
  43131. r = e.ID_MIN;
  43132. break;
  43133. case "max":
  43134. r = e.ID_MAX;
  43135. break;
  43136. default:
  43137. r = n(t);
  43138. }
  43139. if ((i.push(r), 2 === i.length)) break;
  43140. if ("to" !== this.tn.peek()) {
  43141. i.push(r);
  43142. break;
  43143. }
  43144. this.tn.next();
  43145. }
  43146. o.push(i);
  43147. } while (this.tn.omit(","));
  43148. return this.tn.skip(";"), o;
  43149. }),
  43150. (c._parseExtend = function (e) {
  43151. var i = this.tn.next();
  43152. if (!t.TYPEREF.test(i))
  43153. throw Error("illegal extend reference: " + i);
  43154. var n = {
  43155. ref: i,
  43156. fields: [],
  43157. };
  43158. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  43159. if (t.RULE.test(i)) this._parseMessageField(n, i);
  43160. else {
  43161. if (!t.TYPEREF.test(i))
  43162. throw Error("illegal extend token: " + i);
  43163. if (!this.proto3)
  43164. throw Error("illegal field rule: " + i);
  43165. this._parseMessageField(n, "optional", i);
  43166. }
  43167. return this.tn.omit(";"), e.messages.push(n), n;
  43168. }),
  43169. (c.toString = function () {
  43170. return "Parser at line " + this.tn.line;
  43171. }),
  43172. (o.Parser = l),
  43173. o
  43174. );
  43175. })(r, r.Lang)),
  43176. (r.Reflect = (function (e) {
  43177. function i(i) {
  43178. if (
  43179. ("string" == typeof i && (i = e.TYPES[i]),
  43180. "undefined" == typeof i.defaultValue)
  43181. )
  43182. throw Error(
  43183. "default value for type " + i.name + " is not supported"
  43184. );
  43185. return i == e.TYPES.bytes ? new t(0) : i.defaultValue;
  43186. }
  43187. function n(t, i) {
  43188. if (
  43189. t &&
  43190. "number" == typeof t.low &&
  43191. "number" == typeof t.high &&
  43192. "boolean" == typeof t.unsigned &&
  43193. t.low === t.low &&
  43194. t.high === t.high
  43195. )
  43196. return new e.Long(
  43197. t.low,
  43198. t.high,
  43199. "undefined" == typeof i ? t.unsigned : i
  43200. );
  43201. if ("string" == typeof t)
  43202. return e.Long.fromString(t, i || !1, 10);
  43203. if ("number" == typeof t)
  43204. return e.Long.fromNumber(t, i || !1);
  43205. throw Error("not convertible to Long");
  43206. }
  43207. function r(t, i) {
  43208. var n = i.readVarint32(),
  43209. o = 7 & n,
  43210. a = n >>> 3;
  43211. switch (o) {
  43212. case e.WIRE_TYPES.VARINT:
  43213. do n = i.readUint8();
  43214. while (128 === (128 & n));
  43215. break;
  43216. case e.WIRE_TYPES.BITS64:
  43217. i.offset += 8;
  43218. break;
  43219. case e.WIRE_TYPES.LDELIM:
  43220. (n = i.readVarint32()), (i.offset += n);
  43221. break;
  43222. case e.WIRE_TYPES.STARTGROUP:
  43223. r(a, i);
  43224. break;
  43225. case e.WIRE_TYPES.ENDGROUP:
  43226. if (a === t) return !1;
  43227. throw Error(
  43228. "Illegal GROUPEND after unknown group: " +
  43229. a +
  43230. " (" +
  43231. t +
  43232. " expected)"
  43233. );
  43234. case e.WIRE_TYPES.BITS32:
  43235. i.offset += 4;
  43236. break;
  43237. default:
  43238. throw Error(
  43239. "Illegal wire type in unknown group " + t + ": " + o
  43240. );
  43241. }
  43242. return !0;
  43243. }
  43244. var o = {},
  43245. a = function (e, t, i) {
  43246. (this.builder = e),
  43247. (this.parent = t),
  43248. (this.name = i),
  43249. this.className;
  43250. },
  43251. s = a.prototype;
  43252. (s.fqn = function () {
  43253. for (var e = this.name, t = this; ; ) {
  43254. if (((t = t.parent), null == t)) break;
  43255. e = t.name + "." + e;
  43256. }
  43257. return e;
  43258. }),
  43259. (s.toString = function (e) {
  43260. return (e ? this.className + " " : "") + this.fqn();
  43261. }),
  43262. (s.build = function () {
  43263. throw Error(
  43264. this.toString(!0) + " cannot be built directly"
  43265. );
  43266. }),
  43267. (o.T = a);
  43268. var l = function (e, t, i, n, r) {
  43269. a.call(this, e, t, i),
  43270. (this.className = "Namespace"),
  43271. (this.children = []),
  43272. (this.options = n || {}),
  43273. (this.syntax = r || "proto2");
  43274. },
  43275. c = (l.prototype = Object.create(a.prototype));
  43276. (c.getChildren = function (e) {
  43277. if (((e = e || null), null == e))
  43278. return this.children.slice();
  43279. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  43280. this.children[i] instanceof e && t.push(this.children[i]);
  43281. return t;
  43282. }),
  43283. (c.addChild = function (e) {
  43284. var t;
  43285. if ((t = this.getChild(e.name)))
  43286. if (
  43287. t instanceof d.Field &&
  43288. t.name !== t.originalName &&
  43289. null === this.getChild(t.originalName)
  43290. )
  43291. t.name = t.originalName;
  43292. else {
  43293. if (
  43294. !(
  43295. e instanceof d.Field &&
  43296. e.name !== e.originalName &&
  43297. null === this.getChild(e.originalName)
  43298. )
  43299. )
  43300. throw Error(
  43301. "Duplicate name in namespace " +
  43302. this.toString(!0) +
  43303. ": " +
  43304. e.name
  43305. );
  43306. e.name = e.originalName;
  43307. }
  43308. this.children.push(e);
  43309. }),
  43310. (c.getChild = function (e) {
  43311. for (
  43312. var t = "number" == typeof e ? "id" : "name",
  43313. i = 0,
  43314. n = this.children.length;
  43315. i < n;
  43316. ++i
  43317. )
  43318. if (this.children[i][t] === e) return this.children[i];
  43319. return null;
  43320. }),
  43321. (c.resolve = function (e, t) {
  43322. var i = "string" == typeof e ? e.split(".") : e,
  43323. n = this,
  43324. r = 0;
  43325. if ("" === i[r]) {
  43326. for (; null !== n.parent; ) n = n.parent;
  43327. r++;
  43328. }
  43329. var a;
  43330. do {
  43331. do {
  43332. if (!(n instanceof o.Namespace)) {
  43333. n = null;
  43334. break;
  43335. }
  43336. if (
  43337. ((a = n.getChild(i[r])),
  43338. !a ||
  43339. !(a instanceof o.T) ||
  43340. (t && !(a instanceof o.Namespace)))
  43341. ) {
  43342. n = null;
  43343. break;
  43344. }
  43345. (n = a), r++;
  43346. } while (r < i.length);
  43347. if (null != n) break;
  43348. if (null !== this.parent)
  43349. return this.parent.resolve(e, t);
  43350. } while (null != n);
  43351. return n;
  43352. }),
  43353. (c.qn = function (e) {
  43354. var t = [],
  43355. i = e;
  43356. do t.unshift(i.name), (i = i.parent);
  43357. while (null !== i);
  43358. for (var n = 1; n <= t.length; n++) {
  43359. var r = t.slice(t.length - n);
  43360. if (e === this.resolve(r, e instanceof o.Namespace))
  43361. return r.join(".");
  43362. }
  43363. return e.fqn();
  43364. }),
  43365. (c.build = function () {
  43366. for (
  43367. var e, t = {}, i = this.children, n = 0, r = i.length;
  43368. n < r;
  43369. ++n
  43370. )
  43371. (e = i[n]), e instanceof l && (t[e.name] = e.build());
  43372. return (
  43373. Object.defineProperty &&
  43374. Object.defineProperty(t, "$options", {
  43375. value: this.buildOpt(),
  43376. }),
  43377. t
  43378. );
  43379. }),
  43380. (c.buildOpt = function () {
  43381. for (
  43382. var e = {},
  43383. t = Object.keys(this.options),
  43384. i = 0,
  43385. n = t.length;
  43386. i < n;
  43387. ++i
  43388. ) {
  43389. var r = t[i],
  43390. o = this.options[t[i]];
  43391. e[r] = o;
  43392. }
  43393. return e;
  43394. }),
  43395. (c.getOption = function (e) {
  43396. return "undefined" == typeof e
  43397. ? this.options
  43398. : "undefined" != typeof this.options[e]
  43399. ? this.options[e]
  43400. : null;
  43401. }),
  43402. (o.Namespace = l);
  43403. var h = function (t, i, n, r) {
  43404. if (
  43405. ((this.type = t),
  43406. (this.resolvedType = i),
  43407. (this.isMapKey = n),
  43408. (this.syntax = r),
  43409. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  43410. )
  43411. throw Error("Invalid map key type: " + t.name);
  43412. },
  43413. u = h.prototype;
  43414. (h.defaultFieldValue = i),
  43415. (u.verifyValue = function (i) {
  43416. function r(e, t) {
  43417. throw Error(
  43418. "Illegal value for " +
  43419. o.toString(!0) +
  43420. " of type " +
  43421. o.type.name +
  43422. ": " +
  43423. e +
  43424. " (" +
  43425. t +
  43426. ")"
  43427. );
  43428. }
  43429. var o = this;
  43430. switch (this.type) {
  43431. case e.TYPES.int32:
  43432. case e.TYPES.sint32:
  43433. case e.TYPES.sfixed32:
  43434. return (
  43435. ("number" != typeof i || (i === i && i % 1 !== 0)) &&
  43436. r(typeof i, "not an integer"),
  43437. i > 4294967295 ? 0 | i : i
  43438. );
  43439. case e.TYPES.uint32:
  43440. case e.TYPES.fixed32:
  43441. return (
  43442. ("number" != typeof i || (i === i && i % 1 !== 0)) &&
  43443. r(typeof i, "not an integer"),
  43444. i < 0 ? i >>> 0 : i
  43445. );
  43446. case e.TYPES.int64:
  43447. case e.TYPES.sint64:
  43448. case e.TYPES.sfixed64:
  43449. if (e.Long)
  43450. try {
  43451. return n(i, !1);
  43452. } catch (e) {
  43453. r(typeof i, e.message);
  43454. }
  43455. else r(typeof i, "requires Long.js");
  43456. case e.TYPES.uint64:
  43457. case e.TYPES.fixed64:
  43458. if (e.Long)
  43459. try {
  43460. return n(i, !0);
  43461. } catch (e) {
  43462. r(typeof i, e.message);
  43463. }
  43464. else r(typeof i, "requires Long.js");
  43465. case e.TYPES.bool:
  43466. return (
  43467. "boolean" != typeof i && r(typeof i, "not a boolean"),
  43468. i
  43469. );
  43470. case e.TYPES.float:
  43471. case e.TYPES.double:
  43472. return (
  43473. "number" != typeof i && r(typeof i, "not a number"), i
  43474. );
  43475. case e.TYPES.string:
  43476. return (
  43477. "string" == typeof i ||
  43478. (i && i instanceof String) ||
  43479. r(typeof i, "not a string"),
  43480. "" + i
  43481. );
  43482. case e.TYPES.bytes:
  43483. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  43484. case e.TYPES.enum:
  43485. var a = this.resolvedType.getChildren(
  43486. e.Reflect.Enum.Value
  43487. );
  43488. for (l = 0; l < a.length; l++) {
  43489. if (a[l].name == i) return a[l].id;
  43490. if (a[l].id == i) return a[l].id;
  43491. }
  43492. if ("proto3" === this.syntax)
  43493. return (
  43494. ("number" != typeof i ||
  43495. (i === i && i % 1 !== 0)) &&
  43496. r(typeof i, "not an integer"),
  43497. (i > 4294967295 || i < 0) &&
  43498. r(typeof i, "not in range for uint32"),
  43499. i
  43500. );
  43501. r(i, "not a valid enum value");
  43502. case e.TYPES.group:
  43503. case e.TYPES.message:
  43504. if (
  43505. ((i && "object" == typeof i) ||
  43506. r(typeof i, "object expected"),
  43507. i instanceof this.resolvedType.clazz)
  43508. )
  43509. return i;
  43510. if (i instanceof e.Builder.Message) {
  43511. var s = {};
  43512. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l]);
  43513. i = s;
  43514. }
  43515. return new this.resolvedType.clazz(i);
  43516. }
  43517. throw Error(
  43518. "[INTERNAL] Illegal value for " +
  43519. this.toString(!0) +
  43520. ": " +
  43521. i +
  43522. " (undefined type " +
  43523. this.type +
  43524. ")"
  43525. );
  43526. }),
  43527. (u.calculateLength = function (i, n) {
  43528. if (null === n) return 0;
  43529. var r;
  43530. switch (this.type) {
  43531. case e.TYPES.int32:
  43532. return n < 0
  43533. ? t.calculateVarint64(n)
  43534. : t.calculateVarint32(n);
  43535. case e.TYPES.uint32:
  43536. return t.calculateVarint32(n);
  43537. case e.TYPES.sint32:
  43538. return t.calculateVarint32(t.zigZagEncode32(n));
  43539. case e.TYPES.fixed32:
  43540. case e.TYPES.sfixed32:
  43541. case e.TYPES.float:
  43542. return 4;
  43543. case e.TYPES.int64:
  43544. case e.TYPES.uint64:
  43545. return t.calculateVarint64(n);
  43546. case e.TYPES.sint64:
  43547. return t.calculateVarint64(t.zigZagEncode64(n));
  43548. case e.TYPES.fixed64:
  43549. case e.TYPES.sfixed64:
  43550. return 8;
  43551. case e.TYPES.bool:
  43552. return 1;
  43553. case e.TYPES.enum:
  43554. return t.calculateVarint32(n);
  43555. case e.TYPES.double:
  43556. return 8;
  43557. case e.TYPES.string:
  43558. return (
  43559. (r = t.calculateUTF8Bytes(n)),
  43560. t.calculateVarint32(r) + r
  43561. );
  43562. case e.TYPES.bytes:
  43563. if (n.remaining() < 0)
  43564. throw Error(
  43565. "Illegal value for " +
  43566. this.toString(!0) +
  43567. ": " +
  43568. n.remaining() +
  43569. " bytes remaining"
  43570. );
  43571. return (
  43572. t.calculateVarint32(n.remaining()) + n.remaining()
  43573. );
  43574. case e.TYPES.message:
  43575. return (
  43576. (r = this.resolvedType.calculate(n)),
  43577. t.calculateVarint32(r) + r
  43578. );
  43579. case e.TYPES.group:
  43580. return (
  43581. (r = this.resolvedType.calculate(n)),
  43582. r +
  43583. t.calculateVarint32(
  43584. (i << 3) | e.WIRE_TYPES.ENDGROUP
  43585. )
  43586. );
  43587. }
  43588. throw Error(
  43589. "[INTERNAL] Illegal value to encode in " +
  43590. this.toString(!0) +
  43591. ": " +
  43592. n +
  43593. " (unknown type)"
  43594. );
  43595. }),
  43596. (u.encodeValue = function (i, n, r) {
  43597. if (null === n) return r;
  43598. switch (this.type) {
  43599. case e.TYPES.int32:
  43600. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  43601. break;
  43602. case e.TYPES.uint32:
  43603. r.writeVarint32(n);
  43604. break;
  43605. case e.TYPES.sint32:
  43606. r.writeVarint32ZigZag(n);
  43607. break;
  43608. case e.TYPES.fixed32:
  43609. r.writeUint32(n);
  43610. break;
  43611. case e.TYPES.sfixed32:
  43612. r.writeInt32(n);
  43613. break;
  43614. case e.TYPES.int64:
  43615. case e.TYPES.uint64:
  43616. r.writeVarint64(n);
  43617. break;
  43618. case e.TYPES.sint64:
  43619. r.writeVarint64ZigZag(n);
  43620. break;
  43621. case e.TYPES.fixed64:
  43622. r.writeUint64(n);
  43623. break;
  43624. case e.TYPES.sfixed64:
  43625. r.writeInt64(n);
  43626. break;
  43627. case e.TYPES.bool:
  43628. "string" == typeof n
  43629. ? r.writeVarint32(
  43630. "false" === n.toLowerCase() ? 0 : !!n
  43631. )
  43632. : r.writeVarint32(n ? 1 : 0);
  43633. break;
  43634. case e.TYPES.enum:
  43635. r.writeVarint32(n);
  43636. break;
  43637. case e.TYPES.float:
  43638. r.writeFloat32(n);
  43639. break;
  43640. case e.TYPES.double:
  43641. r.writeFloat64(n);
  43642. break;
  43643. case e.TYPES.string:
  43644. r.writeVString(n);
  43645. break;
  43646. case e.TYPES.bytes:
  43647. if (n.remaining() < 0)
  43648. throw Error(
  43649. "Illegal value for " +
  43650. this.toString(!0) +
  43651. ": " +
  43652. n.remaining() +
  43653. " bytes remaining"
  43654. );
  43655. var o = n.offset;
  43656. r.writeVarint32(n.remaining()),
  43657. r.append(n),
  43658. (n.offset = o);
  43659. break;
  43660. case e.TYPES.message:
  43661. var a = new t().LE();
  43662. this.resolvedType.encode(n, a),
  43663. r.writeVarint32(a.offset),
  43664. r.append(a.flip());
  43665. break;
  43666. case e.TYPES.group:
  43667. this.resolvedType.encode(n, r),
  43668. r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP);
  43669. break;
  43670. default:
  43671. throw Error(
  43672. "[INTERNAL] Illegal value to encode in " +
  43673. this.toString(!0) +
  43674. ": " +
  43675. n +
  43676. " (unknown type)"
  43677. );
  43678. }
  43679. return r;
  43680. }),
  43681. (u.decode = function (t, i, n) {
  43682. if (i != this.type.wireType)
  43683. throw Error("Unexpected wire type for element");
  43684. var r, o;
  43685. switch (this.type) {
  43686. case e.TYPES.int32:
  43687. return 0 | t.readVarint32();
  43688. case e.TYPES.uint32:
  43689. return t.readVarint32() >>> 0;
  43690. case e.TYPES.sint32:
  43691. return 0 | t.readVarint32ZigZag();
  43692. case e.TYPES.fixed32:
  43693. return t.readUint32() >>> 0;
  43694. case e.TYPES.sfixed32:
  43695. return 0 | t.readInt32();
  43696. case e.TYPES.int64:
  43697. return t.readVarint64();
  43698. case e.TYPES.uint64:
  43699. return t.readVarint64().toUnsigned();
  43700. case e.TYPES.sint64:
  43701. return t.readVarint64ZigZag();
  43702. case e.TYPES.fixed64:
  43703. return t.readUint64();
  43704. case e.TYPES.sfixed64:
  43705. return t.readInt64();
  43706. case e.TYPES.bool:
  43707. return !!t.readVarint32();
  43708. case e.TYPES.enum:
  43709. return t.readVarint32();
  43710. case e.TYPES.float:
  43711. return t.readFloat();
  43712. case e.TYPES.double:
  43713. return t.readDouble();
  43714. case e.TYPES.string:
  43715. return t.readVString();
  43716. case e.TYPES.bytes:
  43717. if (((o = t.readVarint32()), t.remaining() < o))
  43718. throw Error(
  43719. "Illegal number of bytes for " +
  43720. this.toString(!0) +
  43721. ": " +
  43722. o +
  43723. " required but got only " +
  43724. t.remaining()
  43725. );
  43726. return (
  43727. (r = t.clone()),
  43728. (r.limit = r.offset + o),
  43729. (t.offset += o),
  43730. r
  43731. );
  43732. case e.TYPES.message:
  43733. return (
  43734. (o = t.readVarint32()), this.resolvedType.decode(t, o)
  43735. );
  43736. case e.TYPES.group:
  43737. return this.resolvedType.decode(t, -1, n);
  43738. }
  43739. throw Error("[INTERNAL] Illegal decode type");
  43740. }),
  43741. (u.valueFromString = function (i) {
  43742. if (!this.isMapKey)
  43743. throw Error(
  43744. "valueFromString() called on non-map-key element"
  43745. );
  43746. switch (this.type) {
  43747. case e.TYPES.int32:
  43748. case e.TYPES.sint32:
  43749. case e.TYPES.sfixed32:
  43750. case e.TYPES.uint32:
  43751. case e.TYPES.fixed32:
  43752. return this.verifyValue(parseInt(i));
  43753. case e.TYPES.int64:
  43754. case e.TYPES.sint64:
  43755. case e.TYPES.sfixed64:
  43756. case e.TYPES.uint64:
  43757. case e.TYPES.fixed64:
  43758. return this.verifyValue(i);
  43759. case e.TYPES.bool:
  43760. return "true" === i;
  43761. case e.TYPES.string:
  43762. return this.verifyValue(i);
  43763. case e.TYPES.bytes:
  43764. return t.fromBinary(i);
  43765. }
  43766. }),
  43767. (u.valueToString = function (t) {
  43768. if (!this.isMapKey)
  43769. throw Error(
  43770. "valueToString() called on non-map-key element"
  43771. );
  43772. return this.type === e.TYPES.bytes
  43773. ? t.toString("binary")
  43774. : t.toString();
  43775. }),
  43776. (o.Element = h);
  43777. var d = function (e, t, i, n, r, o) {
  43778. l.call(this, e, t, i, n, o),
  43779. (this.className = "Message"),
  43780. (this.extensions = void 0),
  43781. (this.clazz = null),
  43782. (this.isGroup = !!r),
  43783. (this._fields = null),
  43784. (this._fieldsById = null),
  43785. (this._fieldsByName = null);
  43786. },
  43787. p = (d.prototype = Object.create(l.prototype));
  43788. (p.build = function (i) {
  43789. if (this.clazz && !i) return this.clazz;
  43790. var n = (function (e, i) {
  43791. function n(i, r, o, a) {
  43792. if (null === i || "object" != typeof i) {
  43793. if (a && a instanceof e.Reflect.Enum) {
  43794. var s = e.Reflect.Enum.getName(a.object, i);
  43795. if (null !== s) return s;
  43796. }
  43797. return i;
  43798. }
  43799. if (t.isByteBuffer(i))
  43800. return r ? i.toBase64() : i.toBuffer();
  43801. if (e.Long.isLong(i))
  43802. return o ? i.toString() : e.Long.fromValue(i);
  43803. var l;
  43804. if (Array.isArray(i))
  43805. return (
  43806. (l = []),
  43807. i.forEach(function (e, t) {
  43808. l[t] = n(e, r, o, a);
  43809. }),
  43810. l
  43811. );
  43812. if (((l = {}), i instanceof e.Map)) {
  43813. for (
  43814. var c = i.entries(), h = c.next();
  43815. !h.done;
  43816. h = c.next()
  43817. )
  43818. l[i.keyElem.valueToString(h.value[0])] = n(
  43819. h.value[1],
  43820. r,
  43821. o,
  43822. i.valueElem.resolvedType
  43823. );
  43824. return l;
  43825. }
  43826. var u = i.$type,
  43827. d = void 0;
  43828. for (var p in i)
  43829. i.hasOwnProperty(p) &&
  43830. (u && (d = u.getChild(p))
  43831. ? (l[p] = n(i[p], r, o, d.resolvedType))
  43832. : (l[p] = n(i[p], r, o)));
  43833. return l;
  43834. }
  43835. var r = i.getChildren(e.Reflect.Message.Field),
  43836. o = i.getChildren(e.Reflect.Message.OneOf),
  43837. a = function (n, s) {
  43838. e.Builder.Message.call(this);
  43839. for (var l = 0, c = o.length; l < c; ++l)
  43840. this[o[l].name] = null;
  43841. for (l = 0, c = r.length; l < c; ++l) {
  43842. var h = r[l];
  43843. (this[h.name] = h.repeated
  43844. ? []
  43845. : h.map
  43846. ? new e.Map(h)
  43847. : null),
  43848. (!h.required && "proto3" !== i.syntax) ||
  43849. null === h.defaultValue ||
  43850. (this[h.name] = h.defaultValue);
  43851. }
  43852. if (arguments.length > 0) {
  43853. var u;
  43854. if (
  43855. 1 !== arguments.length ||
  43856. null === n ||
  43857. "object" != typeof n ||
  43858. !(
  43859. "function" != typeof n.encode || n instanceof a
  43860. ) ||
  43861. Array.isArray(n) ||
  43862. n instanceof e.Map ||
  43863. t.isByteBuffer(n) ||
  43864. n instanceof ArrayBuffer ||
  43865. (e.Long && n instanceof e.Long)
  43866. )
  43867. for (l = 0, c = arguments.length; l < c; ++l)
  43868. "undefined" != typeof (u = arguments[l]) &&
  43869. this.$set(r[l].name, u);
  43870. else this.$set(n);
  43871. }
  43872. },
  43873. s = (a.prototype = Object.create(
  43874. e.Builder.Message.prototype
  43875. ));
  43876. (s.add = function (t, n, r) {
  43877. var o = i._fieldsByName[t];
  43878. if (!r) {
  43879. if (!o) throw Error(this + "#" + t + " is undefined");
  43880. if (!(o instanceof e.Reflect.Message.Field))
  43881. throw Error(
  43882. this +
  43883. "#" +
  43884. t +
  43885. " is not a field: " +
  43886. o.toString(!0)
  43887. );
  43888. if (!o.repeated)
  43889. throw Error(
  43890. this + "#" + t + " is not a repeated field"
  43891. );
  43892. n = o.verifyValue(n, !0);
  43893. }
  43894. return (
  43895. null === this[t] && (this[t] = []),
  43896. this[t].push(n),
  43897. this
  43898. );
  43899. }),
  43900. (s.$add = s.add),
  43901. (s.set = function (t, n, r) {
  43902. if (t && "object" == typeof t) {
  43903. r = n;
  43904. for (var o in t)
  43905. t.hasOwnProperty(o) &&
  43906. "undefined" != typeof (n = t[o]) &&
  43907. this.$set(o, n, r);
  43908. return this;
  43909. }
  43910. var a = i._fieldsByName[t];
  43911. if (r) this[t] = n;
  43912. else {
  43913. if (!a)
  43914. throw Error(
  43915. this + "#" + t + " is not a field: undefined"
  43916. );
  43917. if (!(a instanceof e.Reflect.Message.Field))
  43918. throw Error(
  43919. this +
  43920. "#" +
  43921. t +
  43922. " is not a field: " +
  43923. a.toString(!0)
  43924. );
  43925. this[a.name] = n = a.verifyValue(n);
  43926. }
  43927. if (a && a.oneof) {
  43928. var s = this[a.oneof.name];
  43929. null !== n
  43930. ? (null !== s && s !== a.name && (this[s] = null),
  43931. (this[a.oneof.name] = a.name))
  43932. : s === t && (this[a.oneof.name] = null);
  43933. }
  43934. return this;
  43935. }),
  43936. (s.$set = s.set),
  43937. (s.get = function (t, n) {
  43938. if (n) return this[t];
  43939. var r = i._fieldsByName[t];
  43940. if (!(r && r instanceof e.Reflect.Message.Field))
  43941. throw Error(
  43942. this + "#" + t + " is not a field: undefined"
  43943. );
  43944. if (!(r instanceof e.Reflect.Message.Field))
  43945. throw Error(
  43946. this +
  43947. "#" +
  43948. t +
  43949. " is not a field: " +
  43950. r.toString(!0)
  43951. );
  43952. return this[r.name];
  43953. }),
  43954. (s.$get = s.get);
  43955. for (var l = 0; l < r.length; l++) {
  43956. var c = r[l];
  43957. c instanceof e.Reflect.Message.ExtensionField ||
  43958. (i.builder.options.populateAccessors &&
  43959. (function (e) {
  43960. var t = e.originalName.replace(
  43961. /(_[a-zA-Z])/g,
  43962. function (e) {
  43963. return e.toUpperCase().replace("_", "");
  43964. }
  43965. );
  43966. t =
  43967. t.substring(0, 1).toUpperCase() + t.substring(1);
  43968. var n = e.originalName.replace(
  43969. /([A-Z])/g,
  43970. function (e) {
  43971. return "_" + e;
  43972. }
  43973. ),
  43974. r = function (t, i) {
  43975. return (
  43976. (this[e.name] = i ? t : e.verifyValue(t)),
  43977. this
  43978. );
  43979. },
  43980. o = function () {
  43981. return this[e.name];
  43982. };
  43983. null === i.getChild("set" + t) &&
  43984. (s["set" + t] = r),
  43985. null === i.getChild("set_" + n) &&
  43986. (s["set_" + n] = r),
  43987. null === i.getChild("get" + t) &&
  43988. (s["get" + t] = o),
  43989. null === i.getChild("get_" + n) &&
  43990. (s["get_" + n] = o);
  43991. })(c));
  43992. }
  43993. (s.encode = function (e, n) {
  43994. "boolean" == typeof e && ((n = e), (e = void 0));
  43995. var r = !1;
  43996. e || ((e = new t()), (r = !0));
  43997. var o = e.littleEndian;
  43998. try {
  43999. return (
  44000. i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o)
  44001. );
  44002. } catch (t) {
  44003. throw (e.LE(o), t);
  44004. }
  44005. }),
  44006. (a.encode = function (e, t, i) {
  44007. return new a(e).encode(t, i);
  44008. }),
  44009. (s.calculate = function () {
  44010. return i.calculate(this);
  44011. }),
  44012. (s.encodeDelimited = function (e, n) {
  44013. var r = !1;
  44014. e || ((e = new t()), (r = !0));
  44015. var o = new t().LE();
  44016. return (
  44017. i.encode(this, o, n).flip(),
  44018. e.writeVarint32(o.remaining()),
  44019. e.append(o),
  44020. r ? e.flip() : e
  44021. );
  44022. }),
  44023. (s.encodeAB = function () {
  44024. try {
  44025. return this.encode().toArrayBuffer();
  44026. } catch (e) {
  44027. throw (
  44028. (e.encoded &&
  44029. (e.encoded = e.encoded.toArrayBuffer()),
  44030. e)
  44031. );
  44032. }
  44033. }),
  44034. (s.toArrayBuffer = s.encodeAB),
  44035. (s.encodeNB = function () {
  44036. try {
  44037. return this.encode().toBuffer();
  44038. } catch (e) {
  44039. throw (
  44040. (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  44041. );
  44042. }
  44043. }),
  44044. (s.toBuffer = s.encodeNB),
  44045. (s.encode64 = function () {
  44046. try {
  44047. return this.encode().toBase64();
  44048. } catch (e) {
  44049. throw (
  44050. (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  44051. );
  44052. }
  44053. }),
  44054. (s.toBase64 = s.encode64),
  44055. (s.encodeHex = function () {
  44056. try {
  44057. return this.encode().toHex();
  44058. } catch (e) {
  44059. throw (
  44060. (e.encoded && (e.encoded = e.encoded.toHex()), e)
  44061. );
  44062. }
  44063. }),
  44064. (s.toHex = s.encodeHex),
  44065. (s.toRaw = function (e, t) {
  44066. return n(this, !!e, !!t, this.$type);
  44067. }),
  44068. (s.encodeJSON = function () {
  44069. return JSON.stringify(n(this, !0, !0, this.$type));
  44070. }),
  44071. (a.decode = function (e, n, r) {
  44072. "string" == typeof n && ((r = n), (n = -1)),
  44073. "string" == typeof e &&
  44074. (e = t.wrap(e, r ? r : "base64")),
  44075. (e = t.isByteBuffer(e) ? e : t.wrap(e));
  44076. var o = e.littleEndian;
  44077. try {
  44078. var a = i.decode(e.LE());
  44079. return e.LE(o), a;
  44080. } catch (t) {
  44081. throw (e.LE(o), t);
  44082. }
  44083. }),
  44084. (a.decodeDelimited = function (e, n) {
  44085. if (
  44086. ("string" == typeof e &&
  44087. (e = t.wrap(e, n ? n : "base64")),
  44088. (e = t.isByteBuffer(e) ? e : t.wrap(e)),
  44089. e.remaining() < 1)
  44090. )
  44091. return null;
  44092. var r = e.offset,
  44093. o = e.readVarint32();
  44094. if (e.remaining() < o) return (e.offset = r), null;
  44095. try {
  44096. var a = i.decode(
  44097. e.slice(e.offset, e.offset + o).LE()
  44098. );
  44099. return (e.offset += o), a;
  44100. } catch (t) {
  44101. throw ((e.offset += o), t);
  44102. }
  44103. }),
  44104. (a.decode64 = function (e) {
  44105. return a.decode(e, "base64");
  44106. }),
  44107. (a.decodeHex = function (e) {
  44108. return a.decode(e, "hex");
  44109. }),
  44110. (a.decodeJSON = function (e) {
  44111. return new a(JSON.parse(e));
  44112. }),
  44113. (s.toString = function () {
  44114. return i.toString();
  44115. });
  44116. return (
  44117. Object.defineProperty &&
  44118. (Object.defineProperty(a, "$options", {
  44119. value: i.buildOpt(),
  44120. }),
  44121. Object.defineProperty(s, "$options", {
  44122. value: a.$options,
  44123. }),
  44124. Object.defineProperty(a, "$type", {
  44125. value: i,
  44126. }),
  44127. Object.defineProperty(s, "$type", {
  44128. value: i,
  44129. })),
  44130. a
  44131. );
  44132. })(e, this);
  44133. (this._fields = []),
  44134. (this._fieldsById = {}),
  44135. (this._fieldsByName = {});
  44136. for (var r, o = 0, a = this.children.length; o < a; o++)
  44137. if (
  44138. ((r = this.children[o]),
  44139. r instanceof A || r instanceof d || r instanceof E)
  44140. ) {
  44141. if (n.hasOwnProperty(r.name))
  44142. throw Error(
  44143. "Illegal reflect child of " +
  44144. this.toString(!0) +
  44145. ": " +
  44146. r.toString(!0) +
  44147. " cannot override static property '" +
  44148. r.name +
  44149. "'"
  44150. );
  44151. n[r.name] = r.build();
  44152. } else if (r instanceof d.Field)
  44153. r.build(),
  44154. this._fields.push(r),
  44155. (this._fieldsById[r.id] = r),
  44156. (this._fieldsByName[r.name] = r);
  44157. else if (!(r instanceof d.OneOf || r instanceof I))
  44158. throw Error(
  44159. "Illegal reflect child of " +
  44160. this.toString(!0) +
  44161. ": " +
  44162. this.children[o].toString(!0)
  44163. );
  44164. return (this.clazz = n);
  44165. }),
  44166. (p.encode = function (e, t, i) {
  44167. for (
  44168. var n, r, o = null, a = 0, s = this._fields.length;
  44169. a < s;
  44170. ++a
  44171. )
  44172. (n = this._fields[a]),
  44173. (r = e[n.name]),
  44174. n.required && null === r
  44175. ? null === o && (o = n)
  44176. : n.encode(i ? r : n.verifyValue(r), t, e);
  44177. if (null !== o) {
  44178. var l = Error(
  44179. "Missing at least one required field for " +
  44180. this.toString(!0) +
  44181. ": " +
  44182. o
  44183. );
  44184. throw ((l.encoded = t), l);
  44185. }
  44186. return t;
  44187. }),
  44188. (p.calculate = function (e) {
  44189. for (
  44190. var t, i, n = 0, r = 0, o = this._fields.length;
  44191. r < o;
  44192. ++r
  44193. ) {
  44194. if (
  44195. ((t = this._fields[r]),
  44196. (i = e[t.name]),
  44197. t.required && null === i)
  44198. )
  44199. throw Error(
  44200. "Missing at least one required field for " +
  44201. this.toString(!0) +
  44202. ": " +
  44203. t
  44204. );
  44205. n += t.calculate(i, e);
  44206. }
  44207. return n;
  44208. }),
  44209. (p.decode = function (t, i, n) {
  44210. i = "number" == typeof i ? i : -1;
  44211. for (
  44212. var o, a, s, l, c = t.offset, h = new this.clazz();
  44213. t.offset < c + i || (i === -1 && t.remaining() > 0);
  44214. ) {
  44215. if (
  44216. ((o = t.readVarint32()),
  44217. (a = 7 & o),
  44218. (s = o >>> 3),
  44219. a === e.WIRE_TYPES.ENDGROUP)
  44220. ) {
  44221. if (s !== n)
  44222. throw Error(
  44223. "Illegal group end indicator for " +
  44224. this.toString(!0) +
  44225. ": " +
  44226. s +
  44227. " (" +
  44228. (n ? n + " expected" : "not a group") +
  44229. ")"
  44230. );
  44231. break;
  44232. }
  44233. if ((l = this._fieldsById[s])) {
  44234. if (l.repeated && !l.options.packed)
  44235. h[l.name].push(l.decode(a, t));
  44236. else if (l.map) {
  44237. var u = l.decode(a, t);
  44238. h[l.name].set(u[0], u[1]);
  44239. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  44240. var d = h[l.oneof.name];
  44241. null !== d && d !== l.name && (h[d] = null),
  44242. (h[l.oneof.name] = l.name);
  44243. }
  44244. } else
  44245. switch (a) {
  44246. case e.WIRE_TYPES.VARINT:
  44247. t.readVarint32();
  44248. break;
  44249. case e.WIRE_TYPES.BITS32:
  44250. t.offset += 4;
  44251. break;
  44252. case e.WIRE_TYPES.BITS64:
  44253. t.offset += 8;
  44254. break;
  44255. case e.WIRE_TYPES.LDELIM:
  44256. var p = t.readVarint32();
  44257. t.offset += p;
  44258. break;
  44259. case e.WIRE_TYPES.STARTGROUP:
  44260. for (; r(s, t); );
  44261. break;
  44262. default:
  44263. throw Error(
  44264. "Illegal wire type for unknown field " +
  44265. s +
  44266. " in " +
  44267. this.toString(!0) +
  44268. "#decode: " +
  44269. a
  44270. );
  44271. }
  44272. }
  44273. for (var f = 0, g = this._fields.length; f < g; ++f)
  44274. if (((l = this._fields[f]), null === h[l.name]))
  44275. if ("proto3" === this.syntax)
  44276. h[l.name] = l.defaultValue;
  44277. else {
  44278. if (l.required) {
  44279. var m = Error(
  44280. "Missing at least one required field for " +
  44281. this.toString(!0) +
  44282. ": " +
  44283. l.name
  44284. );
  44285. throw ((m.decoded = h), m);
  44286. }
  44287. e.populateDefaults &&
  44288. null !== l.defaultValue &&
  44289. (h[l.name] = l.defaultValue);
  44290. }
  44291. return h;
  44292. }),
  44293. (o.Message = d);
  44294. var f = function (t, i, n, r, o, s, l, c, h, u) {
  44295. a.call(this, t, i, s),
  44296. (this.className = "Message.Field"),
  44297. (this.required = "required" === n),
  44298. (this.repeated = "repeated" === n),
  44299. (this.map = "map" === n),
  44300. (this.keyType = r || null),
  44301. (this.type = o),
  44302. (this.resolvedType = null),
  44303. (this.id = l),
  44304. (this.options = c || {}),
  44305. (this.defaultValue = null),
  44306. (this.oneof = h || null),
  44307. (this.syntax = u || "proto2"),
  44308. (this.originalName = this.name),
  44309. (this.element = null),
  44310. (this.keyElement = null),
  44311. !this.builder.options.convertFieldsToCamelCase ||
  44312. this instanceof d.ExtensionField ||
  44313. (this.name = e.Util.toCamelCase(this.name));
  44314. },
  44315. g = (f.prototype = Object.create(a.prototype));
  44316. (g.build = function () {
  44317. (this.element = new h(
  44318. this.type,
  44319. this.resolvedType,
  44320. !1,
  44321. this.syntax
  44322. )),
  44323. this.map &&
  44324. (this.keyElement = new h(
  44325. this.keyType,
  44326. void 0,
  44327. !0,
  44328. this.syntax
  44329. )),
  44330. "proto3" !== this.syntax || this.repeated || this.map
  44331. ? "undefined" != typeof this.options.default &&
  44332. (this.defaultValue = this.verifyValue(
  44333. this.options.default
  44334. ))
  44335. : (this.defaultValue = h.defaultFieldValue(this.type));
  44336. }),
  44337. (g.verifyValue = function (t, i) {
  44338. function n(e, t) {
  44339. throw Error(
  44340. "Illegal value for " +
  44341. r.toString(!0) +
  44342. " of type " +
  44343. r.type.name +
  44344. ": " +
  44345. e +
  44346. " (" +
  44347. t +
  44348. ")"
  44349. );
  44350. }
  44351. i = i || !1;
  44352. var r = this;
  44353. if (null === t)
  44354. return (
  44355. this.required && n(typeof t, "required"),
  44356. "proto3" === this.syntax &&
  44357. this.type !== e.TYPES.message &&
  44358. n(
  44359. typeof t,
  44360. "proto3 field without field presence cannot be null"
  44361. ),
  44362. null
  44363. );
  44364. var o;
  44365. if (this.repeated && !i) {
  44366. Array.isArray(t) || (t = [t]);
  44367. var a = [];
  44368. for (o = 0; o < t.length; o++)
  44369. a.push(this.element.verifyValue(t[o]));
  44370. return a;
  44371. }
  44372. return this.map && !i
  44373. ? t instanceof e.Map
  44374. ? t
  44375. : (t instanceof Object ||
  44376. n(
  44377. typeof t,
  44378. "expected ProtoBuf.Map or raw object for map field"
  44379. ),
  44380. new e.Map(this, t))
  44381. : (!this.repeated &&
  44382. Array.isArray(t) &&
  44383. n(typeof t, "no array expected"),
  44384. this.element.verifyValue(t));
  44385. }),
  44386. (g.hasWirePresence = function (t, i) {
  44387. if ("proto3" !== this.syntax) return null !== t;
  44388. if (this.oneof && i[this.oneof.name] === this.name)
  44389. return !0;
  44390. switch (this.type) {
  44391. case e.TYPES.int32:
  44392. case e.TYPES.sint32:
  44393. case e.TYPES.sfixed32:
  44394. case e.TYPES.uint32:
  44395. case e.TYPES.fixed32:
  44396. return 0 !== t;
  44397. case e.TYPES.int64:
  44398. case e.TYPES.sint64:
  44399. case e.TYPES.sfixed64:
  44400. case e.TYPES.uint64:
  44401. case e.TYPES.fixed64:
  44402. return 0 !== t.low || 0 !== t.high;
  44403. case e.TYPES.bool:
  44404. return t;
  44405. case e.TYPES.float:
  44406. case e.TYPES.double:
  44407. return 0 !== t;
  44408. case e.TYPES.string:
  44409. return t.length > 0;
  44410. case e.TYPES.bytes:
  44411. return t.remaining() > 0;
  44412. case e.TYPES.enum:
  44413. return 0 !== t;
  44414. case e.TYPES.message:
  44415. return null !== t;
  44416. default:
  44417. return !0;
  44418. }
  44419. }),
  44420. (g.encode = function (i, n, r) {
  44421. if (null === this.type || "object" != typeof this.type)
  44422. throw Error(
  44423. "[INTERNAL] Unresolved type in " +
  44424. this.toString(!0) +
  44425. ": " +
  44426. this.type
  44427. );
  44428. if (null === i || (this.repeated && 0 == i.length))
  44429. return n;
  44430. try {
  44431. if (this.repeated) {
  44432. var o;
  44433. if (
  44434. this.options.packed &&
  44435. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  44436. ) {
  44437. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  44438. n.ensureCapacity((n.offset += 1));
  44439. var a = n.offset;
  44440. for (o = 0; o < i.length; o++)
  44441. this.element.encodeValue(this.id, i[o], n);
  44442. var s = n.offset - a,
  44443. l = t.calculateVarint32(s);
  44444. if (l > 1) {
  44445. var c = n.slice(a, n.offset);
  44446. (a += l - 1), (n.offset = a), n.append(c);
  44447. }
  44448. n.writeVarint32(s, a - l);
  44449. } else
  44450. for (o = 0; o < i.length; o++)
  44451. n.writeVarint32(
  44452. (this.id << 3) | this.type.wireType
  44453. ),
  44454. this.element.encodeValue(this.id, i[o], n);
  44455. } else
  44456. this.map
  44457. ? i.forEach(function (i, r, o) {
  44458. var a =
  44459. t.calculateVarint32(8 | this.keyType.wireType) +
  44460. this.keyElement.calculateLength(1, r) +
  44461. t.calculateVarint32(16 | this.type.wireType) +
  44462. this.element.calculateLength(2, i);
  44463. n.writeVarint32(
  44464. (this.id << 3) | e.WIRE_TYPES.LDELIM
  44465. ),
  44466. n.writeVarint32(a),
  44467. n.writeVarint32(8 | this.keyType.wireType),
  44468. this.keyElement.encodeValue(1, r, n),
  44469. n.writeVarint32(16 | this.type.wireType),
  44470. this.element.encodeValue(2, i, n);
  44471. }, this)
  44472. : this.hasWirePresence(i, r) &&
  44473. (n.writeVarint32(
  44474. (this.id << 3) | this.type.wireType
  44475. ),
  44476. this.element.encodeValue(this.id, i, n));
  44477. } catch (e) {
  44478. throw Error(
  44479. "Illegal value for " +
  44480. this.toString(!0) +
  44481. ": " +
  44482. i +
  44483. " (" +
  44484. e +
  44485. ")"
  44486. );
  44487. }
  44488. return n;
  44489. }),
  44490. (g.calculate = function (i, n) {
  44491. if (
  44492. ((i = this.verifyValue(i)),
  44493. null === this.type || "object" != typeof this.type)
  44494. )
  44495. throw Error(
  44496. "[INTERNAL] Unresolved type in " +
  44497. this.toString(!0) +
  44498. ": " +
  44499. this.type
  44500. );
  44501. if (null === i || (this.repeated && 0 == i.length))
  44502. return 0;
  44503. var r = 0;
  44504. try {
  44505. if (this.repeated) {
  44506. var o, a;
  44507. if (
  44508. this.options.packed &&
  44509. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  44510. ) {
  44511. for (
  44512. r += t.calculateVarint32(
  44513. (this.id << 3) | e.WIRE_TYPES.LDELIM
  44514. ),
  44515. a = 0,
  44516. o = 0;
  44517. o < i.length;
  44518. o++
  44519. )
  44520. a += this.element.calculateLength(this.id, i[o]);
  44521. (r += t.calculateVarint32(a)), (r += a);
  44522. } else
  44523. for (o = 0; o < i.length; o++)
  44524. (r += t.calculateVarint32(
  44525. (this.id << 3) | this.type.wireType
  44526. )),
  44527. (r += this.element.calculateLength(
  44528. this.id,
  44529. i[o]
  44530. ));
  44531. } else
  44532. this.map
  44533. ? i.forEach(function (i, n, o) {
  44534. var a =
  44535. t.calculateVarint32(8 | this.keyType.wireType) +
  44536. this.keyElement.calculateLength(1, n) +
  44537. t.calculateVarint32(16 | this.type.wireType) +
  44538. this.element.calculateLength(2, i);
  44539. (r += t.calculateVarint32(
  44540. (this.id << 3) | e.WIRE_TYPES.LDELIM
  44541. )),
  44542. (r += t.calculateVarint32(a)),
  44543. (r += a);
  44544. }, this)
  44545. : this.hasWirePresence(i, n) &&
  44546. ((r += t.calculateVarint32(
  44547. (this.id << 3) | this.type.wireType
  44548. )),
  44549. (r += this.element.calculateLength(this.id, i)));
  44550. } catch (e) {
  44551. throw Error(
  44552. "Illegal value for " +
  44553. this.toString(!0) +
  44554. ": " +
  44555. i +
  44556. " (" +
  44557. e +
  44558. ")"
  44559. );
  44560. }
  44561. return r;
  44562. }),
  44563. (g.decode = function (t, i, n) {
  44564. var r,
  44565. o,
  44566. a =
  44567. (!this.map && t == this.type.wireType) ||
  44568. (!n &&
  44569. this.repeated &&
  44570. this.options.packed &&
  44571. t == e.WIRE_TYPES.LDELIM) ||
  44572. (this.map && t == e.WIRE_TYPES.LDELIM);
  44573. if (!a)
  44574. throw Error(
  44575. "Illegal wire type for field " +
  44576. this.toString(!0) +
  44577. ": " +
  44578. t +
  44579. " (" +
  44580. this.type.wireType +
  44581. " expected)"
  44582. );
  44583. if (
  44584. t == e.WIRE_TYPES.LDELIM &&
  44585. this.repeated &&
  44586. this.options.packed &&
  44587. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 &&
  44588. !n
  44589. ) {
  44590. (o = i.readVarint32()), (o = i.offset + o);
  44591. for (var s = []; i.offset < o; )
  44592. s.push(this.decode(this.type.wireType, i, !0));
  44593. return s;
  44594. }
  44595. if (this.map) {
  44596. var l = h.defaultFieldValue(this.keyType);
  44597. if (
  44598. ((r = h.defaultFieldValue(this.type)),
  44599. (o = i.readVarint32()),
  44600. i.remaining() < o)
  44601. )
  44602. throw Error(
  44603. "Illegal number of bytes for " +
  44604. this.toString(!0) +
  44605. ": " +
  44606. o +
  44607. " required but got only " +
  44608. i.remaining()
  44609. );
  44610. var c = i.clone();
  44611. for (
  44612. c.limit = c.offset + o, i.offset += o;
  44613. c.remaining() > 0;
  44614. ) {
  44615. var u = c.readVarint32();
  44616. t = 7 & u;
  44617. var d = u >>> 3;
  44618. if (1 === d) l = this.keyElement.decode(c, t, d);
  44619. else {
  44620. if (2 !== d)
  44621. throw Error(
  44622. "Unexpected tag in map field key/value submessage"
  44623. );
  44624. r = this.element.decode(c, t, d);
  44625. }
  44626. }
  44627. return [l, r];
  44628. }
  44629. return this.element.decode(i, t, this.id);
  44630. }),
  44631. (o.Message.Field = f);
  44632. var m = function (e, t, i, n, r, o, a) {
  44633. f.call(this, e, t, i, null, n, r, o, a), this.extension;
  44634. };
  44635. (m.prototype = Object.create(f.prototype)),
  44636. (o.Message.ExtensionField = m);
  44637. var v = function (e, t, i) {
  44638. a.call(this, e, t, i), (this.fields = []);
  44639. };
  44640. o.Message.OneOf = v;
  44641. var A = function (e, t, i, n, r) {
  44642. l.call(this, e, t, i, n, r),
  44643. (this.className = "Enum"),
  44644. (this.object = null);
  44645. };
  44646. A.getName = function (e, t) {
  44647. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  44648. if (e[(i = n[r])] === t) return i;
  44649. return null;
  44650. };
  44651. var y = (A.prototype = Object.create(l.prototype));
  44652. (y.build = function (t) {
  44653. if (this.object && !t) return this.object;
  44654. for (
  44655. var i = new e.Builder.Enum(),
  44656. n = this.getChildren(A.Value),
  44657. r = 0,
  44658. o = n.length;
  44659. r < o;
  44660. ++r
  44661. )
  44662. i[n[r].name] = n[r].id;
  44663. return (
  44664. Object.defineProperty &&
  44665. Object.defineProperty(i, "$options", {
  44666. value: this.buildOpt(),
  44667. enumerable: !1,
  44668. }),
  44669. (this.object = i)
  44670. );
  44671. }),
  44672. (o.Enum = A);
  44673. var C = function (e, t, i, n) {
  44674. a.call(this, e, t, i),
  44675. (this.className = "Enum.Value"),
  44676. (this.id = n);
  44677. };
  44678. (C.prototype = Object.create(a.prototype)), (o.Enum.Value = C);
  44679. var I = function (e, t, i, n) {
  44680. a.call(this, e, t, i), (this.field = n);
  44681. };
  44682. (I.prototype = Object.create(a.prototype)), (o.Extension = I);
  44683. var E = function (e, t, i, n) {
  44684. l.call(this, e, t, i, n),
  44685. (this.className = "Service"),
  44686. (this.clazz = null);
  44687. },
  44688. b = (E.prototype = Object.create(l.prototype));
  44689. (b.build = function (i) {
  44690. return this.clazz && !i
  44691. ? this.clazz
  44692. : (this.clazz = (function (e, i) {
  44693. for (
  44694. var n = function (t) {
  44695. e.Builder.Service.call(this),
  44696. (this.rpcImpl =
  44697. t ||
  44698. function (e, t, i) {
  44699. setTimeout(
  44700. i.bind(
  44701. this,
  44702. Error(
  44703. "Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services"
  44704. )
  44705. ),
  44706. 0
  44707. );
  44708. });
  44709. },
  44710. r = (n.prototype = Object.create(
  44711. e.Builder.Service.prototype
  44712. )),
  44713. o = i.getChildren(e.Reflect.Service.RPCMethod),
  44714. a = 0;
  44715. a < o.length;
  44716. a++
  44717. )
  44718. !(function (e) {
  44719. (r[e.name] = function (n, r) {
  44720. try {
  44721. try {
  44722. n = e.resolvedRequestType.clazz.decode(
  44723. t.wrap(n)
  44724. );
  44725. } catch (e) {
  44726. if (!(e instanceof TypeError)) throw e;
  44727. }
  44728. if (null === n || "object" != typeof n)
  44729. throw Error("Illegal arguments");
  44730. n instanceof e.resolvedRequestType.clazz ||
  44731. (n = new e.resolvedRequestType.clazz(n)),
  44732. this.rpcImpl(e.fqn(), n, function (t, n) {
  44733. if (t) return void r(t);
  44734. null === n && (n = "");
  44735. try {
  44736. n =
  44737. e.resolvedResponseType.clazz.decode(n);
  44738. } catch (e) {}
  44739. return n &&
  44740. n instanceof e.resolvedResponseType.clazz
  44741. ? void r(null, n)
  44742. : void r(
  44743. Error(
  44744. "Illegal response type received in service method " +
  44745. i.name +
  44746. "#" +
  44747. e.name
  44748. )
  44749. );
  44750. });
  44751. } catch (e) {
  44752. setTimeout(r.bind(this, e), 0);
  44753. }
  44754. }),
  44755. (n[e.name] = function (t, i, r) {
  44756. new n(t)[e.name](i, r);
  44757. }),
  44758. Object.defineProperty &&
  44759. (Object.defineProperty(n[e.name], "$options", {
  44760. value: e.buildOpt(),
  44761. }),
  44762. Object.defineProperty(r[e.name], "$options", {
  44763. value: n[e.name].$options,
  44764. }));
  44765. })(o[a]);
  44766. return (
  44767. Object.defineProperty &&
  44768. (Object.defineProperty(n, "$options", {
  44769. value: i.buildOpt(),
  44770. }),
  44771. Object.defineProperty(r, "$options", {
  44772. value: n.$options,
  44773. }),
  44774. Object.defineProperty(n, "$type", {
  44775. value: i,
  44776. }),
  44777. Object.defineProperty(r, "$type", {
  44778. value: i,
  44779. })),
  44780. n
  44781. );
  44782. })(e, this));
  44783. }),
  44784. (o.Service = E);
  44785. var w = function (e, t, i, n) {
  44786. a.call(this, e, t, i),
  44787. (this.className = "Service.Method"),
  44788. (this.options = n || {});
  44789. },
  44790. _ = (w.prototype = Object.create(a.prototype));
  44791. (_.buildOpt = c.buildOpt), (o.Service.Method = w);
  44792. var T = function (e, t, i, n, r, o, a, s) {
  44793. w.call(this, e, t, i, s),
  44794. (this.className = "Service.RPCMethod"),
  44795. (this.requestName = n),
  44796. (this.responseName = r),
  44797. (this.requestStream = o),
  44798. (this.responseStream = a),
  44799. (this.resolvedRequestType = null),
  44800. (this.resolvedResponseType = null);
  44801. };
  44802. return (
  44803. (T.prototype = Object.create(w.prototype)),
  44804. (o.Service.RPCMethod = T),
  44805. o
  44806. );
  44807. })(r)),
  44808. (r.Builder = (function (t, i, n) {
  44809. function r(e) {
  44810. e.messages &&
  44811. e.messages.forEach(function (t) {
  44812. (t.syntax = e.syntax), r(t);
  44813. }),
  44814. e.enums &&
  44815. e.enums.forEach(function (t) {
  44816. t.syntax = e.syntax;
  44817. });
  44818. }
  44819. var o = function (e) {
  44820. (this.ns = new n.Namespace(this, null, "")),
  44821. (this.ptr = this.ns),
  44822. (this.resolved = !1),
  44823. (this.result = null),
  44824. (this.files = {}),
  44825. (this.importRoot = null),
  44826. (this.options = e || {});
  44827. },
  44828. a = o.prototype;
  44829. return (
  44830. (o.isMessage = function (e) {
  44831. return (
  44832. "string" == typeof e.name &&
  44833. "undefined" == typeof e.values &&
  44834. "undefined" == typeof e.rpc
  44835. );
  44836. }),
  44837. (o.isMessageField = function (e) {
  44838. return (
  44839. "string" == typeof e.rule &&
  44840. "string" == typeof e.name &&
  44841. "string" == typeof e.type &&
  44842. "undefined" != typeof e.id
  44843. );
  44844. }),
  44845. (o.isEnum = function (e) {
  44846. return (
  44847. "string" == typeof e.name &&
  44848. !(
  44849. "undefined" == typeof e.values ||
  44850. !Array.isArray(e.values) ||
  44851. 0 === e.values.length
  44852. )
  44853. );
  44854. }),
  44855. (o.isService = function (e) {
  44856. return !(
  44857. "string" != typeof e.name ||
  44858. "object" != typeof e.rpc ||
  44859. !e.rpc
  44860. );
  44861. }),
  44862. (o.isExtend = function (e) {
  44863. return "string" == typeof e.ref;
  44864. }),
  44865. (a.reset = function () {
  44866. return (this.ptr = this.ns), this;
  44867. }),
  44868. (a.define = function (e) {
  44869. if ("string" != typeof e || !i.TYPEREF.test(e))
  44870. throw Error("illegal namespace: " + e);
  44871. return (
  44872. e.split(".").forEach(function (e) {
  44873. var t = this.ptr.getChild(e);
  44874. null === t &&
  44875. this.ptr.addChild(
  44876. (t = new n.Namespace(this, this.ptr, e))
  44877. ),
  44878. (this.ptr = t);
  44879. }, this),
  44880. this
  44881. );
  44882. }),
  44883. (a.create = function (e) {
  44884. if (!e) return this;
  44885. if (Array.isArray(e)) {
  44886. if (0 === e.length) return this;
  44887. e = e.slice();
  44888. } else e = [e];
  44889. for (var i = [e]; i.length > 0; ) {
  44890. if (((e = i.pop()), !Array.isArray(e)))
  44891. throw Error(
  44892. "not a valid namespace: " + JSON.stringify(e)
  44893. );
  44894. for (; e.length > 0; ) {
  44895. var r = e.shift();
  44896. if (o.isMessage(r)) {
  44897. var a = new n.Message(
  44898. this,
  44899. this.ptr,
  44900. r.name,
  44901. r.options,
  44902. r.isGroup,
  44903. r.syntax
  44904. ),
  44905. s = {};
  44906. r.oneofs &&
  44907. Object.keys(r.oneofs).forEach(function (e) {
  44908. a.addChild(
  44909. (s[e] = new n.Message.OneOf(this, a, e))
  44910. );
  44911. }, this),
  44912. r.fields &&
  44913. r.fields.forEach(function (e) {
  44914. if (null !== a.getChild(0 | e.id))
  44915. throw Error(
  44916. "duplicate or invalid field id in " +
  44917. a.name +
  44918. ": " +
  44919. e.id
  44920. );
  44921. if (e.options && "object" != typeof e.options)
  44922. throw Error(
  44923. "illegal field options in " +
  44924. a.name +
  44925. "#" +
  44926. e.name
  44927. );
  44928. var t = null;
  44929. if (
  44930. "string" == typeof e.oneof &&
  44931. !(t = s[e.oneof])
  44932. )
  44933. throw Error(
  44934. "illegal oneof in " +
  44935. a.name +
  44936. "#" +
  44937. e.name +
  44938. ": " +
  44939. e.oneof
  44940. );
  44941. (e = new n.Message.Field(
  44942. this,
  44943. a,
  44944. e.rule,
  44945. e.keytype,
  44946. e.type,
  44947. e.name,
  44948. e.id,
  44949. e.options,
  44950. t,
  44951. r.syntax
  44952. )),
  44953. t && t.fields.push(e),
  44954. a.addChild(e);
  44955. }, this);
  44956. var l = [];
  44957. if (
  44958. (r.enums &&
  44959. r.enums.forEach(function (e) {
  44960. l.push(e);
  44961. }),
  44962. r.messages &&
  44963. r.messages.forEach(function (e) {
  44964. l.push(e);
  44965. }),
  44966. r.services &&
  44967. r.services.forEach(function (e) {
  44968. l.push(e);
  44969. }),
  44970. r.extensions &&
  44971. ("number" == typeof r.extensions[0]
  44972. ? (a.extensions = [r.extensions])
  44973. : (a.extensions = r.extensions)),
  44974. this.ptr.addChild(a),
  44975. l.length > 0)
  44976. ) {
  44977. i.push(e),
  44978. (e = l),
  44979. (l = null),
  44980. (this.ptr = a),
  44981. (a = null);
  44982. continue;
  44983. }
  44984. l = null;
  44985. } else if (o.isEnum(r))
  44986. (a = new n.Enum(
  44987. this,
  44988. this.ptr,
  44989. r.name,
  44990. r.options,
  44991. r.syntax
  44992. )),
  44993. r.values.forEach(function (e) {
  44994. a.addChild(
  44995. new n.Enum.Value(this, a, e.name, e.id)
  44996. );
  44997. }, this),
  44998. this.ptr.addChild(a);
  44999. else if (o.isService(r))
  45000. (a = new n.Service(
  45001. this,
  45002. this.ptr,
  45003. r.name,
  45004. r.options
  45005. )),
  45006. Object.keys(r.rpc).forEach(function (e) {
  45007. var t = r.rpc[e];
  45008. a.addChild(
  45009. new n.Service.RPCMethod(
  45010. this,
  45011. a,
  45012. e,
  45013. t.request,
  45014. t.response,
  45015. !!t.request_stream,
  45016. !!t.response_stream,
  45017. t.options
  45018. )
  45019. );
  45020. }, this),
  45021. this.ptr.addChild(a);
  45022. else {
  45023. if (!o.isExtend(r))
  45024. throw Error(
  45025. "not a valid definition: " + JSON.stringify(r)
  45026. );
  45027. if ((a = this.ptr.resolve(r.ref, !0)))
  45028. r.fields.forEach(function (e) {
  45029. if (null !== a.getChild(0 | e.id))
  45030. throw Error(
  45031. "duplicate extended field id in " +
  45032. a.name +
  45033. ": " +
  45034. e.id
  45035. );
  45036. if (a.extensions) {
  45037. var i = !1;
  45038. if (
  45039. (a.extensions.forEach(function (t) {
  45040. e.id >= t[0] && e.id <= t[1] && (i = !0);
  45041. }),
  45042. !i)
  45043. )
  45044. throw Error(
  45045. "illegal extended field id in " +
  45046. a.name +
  45047. ": " +
  45048. e.id +
  45049. " (not within valid ranges)"
  45050. );
  45051. }
  45052. var r = e.name;
  45053. this.options.convertFieldsToCamelCase &&
  45054. (r = t.Util.toCamelCase(r));
  45055. var o = new n.Message.ExtensionField(
  45056. this,
  45057. a,
  45058. e.rule,
  45059. e.type,
  45060. this.ptr.fqn() + "." + r,
  45061. e.id,
  45062. e.options
  45063. ),
  45064. s = new n.Extension(this, this.ptr, e.name, o);
  45065. (o.extension = s),
  45066. this.ptr.addChild(s),
  45067. a.addChild(o);
  45068. }, this);
  45069. else if (!/\.?google\.protobuf\./.test(r.ref))
  45070. throw Error(
  45071. "extended message " + r.ref + " is not defined"
  45072. );
  45073. }
  45074. (r = null), (a = null);
  45075. }
  45076. (e = null), (this.ptr = this.ptr.parent);
  45077. }
  45078. return (this.resolved = !1), (this.result = null), this;
  45079. }),
  45080. (a.import = function (i, n) {
  45081. var o = "/";
  45082. if ("string" == typeof n) {
  45083. if (
  45084. (t.Util.IS_NODE && (n = e("path").resolve(n)),
  45085. this.files[n] === !0)
  45086. )
  45087. return this.reset();
  45088. this.files[n] = !0;
  45089. } else if ("object" == typeof n) {
  45090. var a = n.root;
  45091. t.Util.IS_NODE && (a = e("path").resolve(a)),
  45092. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) &&
  45093. (o = "\\");
  45094. var s = a + o + n.file;
  45095. if (this.files[s] === !0) return this.reset();
  45096. this.files[s] = !0;
  45097. }
  45098. if (i.imports && i.imports.length > 0) {
  45099. var l,
  45100. c = !1;
  45101. "object" == typeof n
  45102. ? ((this.importRoot = n.root),
  45103. (c = !0),
  45104. (l = this.importRoot),
  45105. (n = n.file),
  45106. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) &&
  45107. (o = "\\"))
  45108. : "string" == typeof n
  45109. ? this.importRoot
  45110. ? (l = this.importRoot)
  45111. : n.indexOf("/") >= 0
  45112. ? ((l = n.replace(/\/[^\/]*$/, "")),
  45113. "" === l && (l = "/"))
  45114. : n.indexOf("\\") >= 0
  45115. ? ((l = n.replace(/\\[^\\]*$/, "")), (o = "\\"))
  45116. : (l = ".")
  45117. : (l = null);
  45118. for (var h = 0; h < i.imports.length; h++)
  45119. if ("string" == typeof i.imports[h]) {
  45120. if (!l) throw Error("cannot determine import root");
  45121. var u = i.imports[h];
  45122. if ("google/protobuf/descriptor.proto" === u)
  45123. continue;
  45124. if (((u = l + o + u), this.files[u] === !0)) continue;
  45125. /\.proto$/i.test(u) &&
  45126. !t.DotProto &&
  45127. (u = u.replace(/\.proto$/, ".json"));
  45128. var d = t.Util.fetch(u);
  45129. if (null === d)
  45130. throw Error(
  45131. "failed to import '" +
  45132. u +
  45133. "' in '" +
  45134. n +
  45135. "': file not found"
  45136. );
  45137. /\.json$/i.test(u)
  45138. ? this.import(JSON.parse(d + ""), u)
  45139. : this.import(t.DotProto.Parser.parse(d), u);
  45140. } else
  45141. n
  45142. ? /\.(\w+)$/.test(n)
  45143. ? this.import(
  45144. i.imports[h],
  45145. n.replace(
  45146. /^(.+)\.(\w+)$/,
  45147. function (e, t, i) {
  45148. return t + "_import" + h + "." + i;
  45149. }
  45150. )
  45151. )
  45152. : this.import(i.imports[h], n + "_import" + h)
  45153. : this.import(i.imports[h]);
  45154. c && (this.importRoot = null);
  45155. }
  45156. i.package && this.define(i.package), i.syntax && r(i);
  45157. var p = this.ptr;
  45158. return (
  45159. i.options &&
  45160. Object.keys(i.options).forEach(function (e) {
  45161. p.options[e] = i.options[e];
  45162. }),
  45163. i.messages && (this.create(i.messages), (this.ptr = p)),
  45164. i.enums && (this.create(i.enums), (this.ptr = p)),
  45165. i.services && (this.create(i.services), (this.ptr = p)),
  45166. i.extends && this.create(i.extends),
  45167. this.reset()
  45168. );
  45169. }),
  45170. (a.resolveAll = function () {
  45171. var e;
  45172. if (null == this.ptr || "object" == typeof this.ptr.type)
  45173. return this;
  45174. if (this.ptr instanceof n.Namespace)
  45175. this.ptr.children.forEach(function (e) {
  45176. (this.ptr = e), this.resolveAll();
  45177. }, this);
  45178. else if (this.ptr instanceof n.Message.Field) {
  45179. if (i.TYPE.test(this.ptr.type))
  45180. this.ptr.type = t.TYPES[this.ptr.type];
  45181. else {
  45182. if (!i.TYPEREF.test(this.ptr.type))
  45183. throw Error(
  45184. "illegal type reference in " +
  45185. this.ptr.toString(!0) +
  45186. ": " +
  45187. this.ptr.type
  45188. );
  45189. if (
  45190. ((e = (
  45191. this.ptr instanceof n.Message.ExtensionField
  45192. ? this.ptr.extension.parent
  45193. : this.ptr.parent
  45194. ).resolve(this.ptr.type, !0)),
  45195. !e)
  45196. )
  45197. throw Error(
  45198. "unresolvable type reference in " +
  45199. this.ptr.toString(!0) +
  45200. ": " +
  45201. this.ptr.type
  45202. );
  45203. if (
  45204. ((this.ptr.resolvedType = e), e instanceof n.Enum)
  45205. ) {
  45206. if (
  45207. ((this.ptr.type = t.TYPES.enum),
  45208. "proto3" === this.ptr.syntax &&
  45209. "proto3" !== e.syntax)
  45210. )
  45211. throw Error(
  45212. "proto3 message cannot reference proto2 enum"
  45213. );
  45214. } else {
  45215. if (!(e instanceof n.Message))
  45216. throw Error(
  45217. "illegal type reference in " +
  45218. this.ptr.toString(!0) +
  45219. ": " +
  45220. this.ptr.type
  45221. );
  45222. this.ptr.type = e.isGroup
  45223. ? t.TYPES.group
  45224. : t.TYPES.message;
  45225. }
  45226. }
  45227. if (this.ptr.map) {
  45228. if (!i.TYPE.test(this.ptr.keyType))
  45229. throw Error(
  45230. "illegal key type for map field in " +
  45231. this.ptr.toString(!0) +
  45232. ": " +
  45233. this.ptr.keyType
  45234. );
  45235. this.ptr.keyType = t.TYPES[this.ptr.keyType];
  45236. }
  45237. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  45238. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  45239. throw Error(
  45240. "illegal service type in " + this.ptr.toString(!0)
  45241. );
  45242. if (
  45243. ((e = this.ptr.parent.resolve(
  45244. this.ptr.requestName,
  45245. !0
  45246. )),
  45247. !(e && e instanceof t.Reflect.Message))
  45248. )
  45249. throw Error(
  45250. "Illegal type reference in " +
  45251. this.ptr.toString(!0) +
  45252. ": " +
  45253. this.ptr.requestName
  45254. );
  45255. if (
  45256. ((this.ptr.resolvedRequestType = e),
  45257. (e = this.ptr.parent.resolve(
  45258. this.ptr.responseName,
  45259. !0
  45260. )),
  45261. !(e && e instanceof t.Reflect.Message))
  45262. )
  45263. throw Error(
  45264. "Illegal type reference in " +
  45265. this.ptr.toString(!0) +
  45266. ": " +
  45267. this.ptr.responseName
  45268. );
  45269. this.ptr.resolvedResponseType = e;
  45270. } else if (
  45271. !(
  45272. this.ptr instanceof t.Reflect.Message.OneOf ||
  45273. this.ptr instanceof t.Reflect.Extension ||
  45274. this.ptr instanceof t.Reflect.Enum.Value
  45275. )
  45276. )
  45277. throw Error(
  45278. "illegal object in namespace: " +
  45279. typeof this.ptr +
  45280. ": " +
  45281. this.ptr
  45282. );
  45283. return this.reset();
  45284. }),
  45285. (a.build = function (e) {
  45286. if (
  45287. (this.reset(),
  45288. this.resolved ||
  45289. (this.resolveAll(),
  45290. (this.resolved = !0),
  45291. (this.result = null)),
  45292. null === this.result && (this.result = this.ns.build()),
  45293. !e)
  45294. )
  45295. return this.result;
  45296. for (
  45297. var t = "string" == typeof e ? e.split(".") : e,
  45298. i = this.result,
  45299. n = 0;
  45300. n < t.length;
  45301. n++
  45302. ) {
  45303. if (!i[t[n]]) {
  45304. i = null;
  45305. break;
  45306. }
  45307. i = i[t[n]];
  45308. }
  45309. return i;
  45310. }),
  45311. (a.lookup = function (e, t) {
  45312. return e ? this.ns.resolve(e, t) : this.ns;
  45313. }),
  45314. (a.toString = function () {
  45315. return "Builder";
  45316. }),
  45317. (o.Message = function () {}),
  45318. (o.Enum = function () {}),
  45319. (o.Service = function () {}),
  45320. o
  45321. );
  45322. })(r, r.Lang, r.Reflect)),
  45323. (r.Map = (function (e, t) {
  45324. function i(e) {
  45325. var t = 0;
  45326. return {
  45327. next: function () {
  45328. return t < e.length
  45329. ? {
  45330. done: !1,
  45331. value: e[t++],
  45332. }
  45333. : {
  45334. done: !0,
  45335. };
  45336. },
  45337. };
  45338. }
  45339. var n = function (e, i) {
  45340. if (!e.map) throw Error("field is not a map");
  45341. if (
  45342. ((this.field = e),
  45343. (this.keyElem = new t.Element(
  45344. e.keyType,
  45345. null,
  45346. !0,
  45347. e.syntax
  45348. )),
  45349. (this.valueElem = new t.Element(
  45350. e.type,
  45351. e.resolvedType,
  45352. !1,
  45353. e.syntax
  45354. )),
  45355. (this.map = {}),
  45356. Object.defineProperty(this, "size", {
  45357. get: function () {
  45358. return Object.keys(this.map).length;
  45359. },
  45360. }),
  45361. i)
  45362. )
  45363. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  45364. var o = this.keyElem.valueFromString(n[r]),
  45365. a = this.valueElem.verifyValue(i[n[r]]);
  45366. this.map[this.keyElem.valueToString(o)] = {
  45367. key: o,
  45368. value: a,
  45369. };
  45370. }
  45371. },
  45372. r = n.prototype;
  45373. return (
  45374. (r.clear = function () {
  45375. this.map = {};
  45376. }),
  45377. (r.delete = function (e) {
  45378. var t = this.keyElem.valueToString(
  45379. this.keyElem.verifyValue(e)
  45380. ),
  45381. i = t in this.map;
  45382. return delete this.map[t], i;
  45383. }),
  45384. (r.entries = function () {
  45385. for (
  45386. var e, t = [], n = Object.keys(this.map), r = 0;
  45387. r < n.length;
  45388. r++
  45389. )
  45390. t.push([(e = this.map[n[r]]).key, e.value]);
  45391. return i(t);
  45392. }),
  45393. (r.keys = function () {
  45394. for (
  45395. var e = [], t = Object.keys(this.map), n = 0;
  45396. n < t.length;
  45397. n++
  45398. )
  45399. e.push(this.map[t[n]].key);
  45400. return i(e);
  45401. }),
  45402. (r.values = function () {
  45403. for (
  45404. var e = [], t = Object.keys(this.map), n = 0;
  45405. n < t.length;
  45406. n++
  45407. )
  45408. e.push(this.map[t[n]].value);
  45409. return i(e);
  45410. }),
  45411. (r.forEach = function (e, t) {
  45412. for (
  45413. var i, n = Object.keys(this.map), r = 0;
  45414. r < n.length;
  45415. r++
  45416. )
  45417. e.call(t, (i = this.map[n[r]]).value, i.key, this);
  45418. }),
  45419. (r.set = function (e, t) {
  45420. var i = this.keyElem.verifyValue(e),
  45421. n = this.valueElem.verifyValue(t);
  45422. return (
  45423. (this.map[this.keyElem.valueToString(i)] = {
  45424. key: i,
  45425. value: n,
  45426. }),
  45427. this
  45428. );
  45429. }),
  45430. (r.get = function (e) {
  45431. var t = this.keyElem.valueToString(
  45432. this.keyElem.verifyValue(e)
  45433. );
  45434. if (t in this.map) return this.map[t].value;
  45435. }),
  45436. (r.has = function (e) {
  45437. var t = this.keyElem.valueToString(
  45438. this.keyElem.verifyValue(e)
  45439. );
  45440. return t in this.map;
  45441. }),
  45442. n
  45443. );
  45444. })(r, r.Reflect)),
  45445. (r.loadProto = function (e, t, i) {
  45446. return (
  45447. ("string" == typeof t ||
  45448. (t &&
  45449. "string" == typeof t.file &&
  45450. "string" == typeof t.root)) &&
  45451. ((i = t), (t = void 0)),
  45452. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  45453. );
  45454. }),
  45455. (r.protoFromString = r.loadProto),
  45456. (r.loadProtoFile = function (e, t, i) {
  45457. if (
  45458. (t && "object" == typeof t
  45459. ? ((i = t), (t = null))
  45460. : (t && "function" == typeof t) || (t = null),
  45461. t)
  45462. )
  45463. return r.Util.fetch(
  45464. "string" == typeof e ? e : e.root + "/" + e.file,
  45465. function (n) {
  45466. if (null === n)
  45467. return void t(Error("Failed to fetch file"));
  45468. try {
  45469. t(null, r.loadProto(n, i, e));
  45470. } catch (e) {
  45471. t(e);
  45472. }
  45473. }
  45474. );
  45475. var n = r.Util.fetch(
  45476. "object" == typeof e ? e.root + "/" + e.file : e
  45477. );
  45478. return null === n ? null : r.loadProto(n, i, e);
  45479. }),
  45480. (r.protoFromFile = r.loadProtoFile),
  45481. (r.newBuilder = function (e) {
  45482. return (
  45483. (e = e || {}),
  45484. "undefined" == typeof e.convertFieldsToCamelCase &&
  45485. (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  45486. "undefined" == typeof e.populateAccessors &&
  45487. (e.populateAccessors = r.populateAccessors),
  45488. new r.Builder(e)
  45489. );
  45490. }),
  45491. (r.loadJson = function (e, t, i) {
  45492. return (
  45493. ("string" == typeof t ||
  45494. (t &&
  45495. "string" == typeof t.file &&
  45496. "string" == typeof t.root)) &&
  45497. ((i = t), (t = null)),
  45498. (t && "object" == typeof t) || (t = r.newBuilder()),
  45499. "string" == typeof e && (e = JSON.parse(e)),
  45500. t.import(e, i),
  45501. t.resolveAll(),
  45502. t
  45503. );
  45504. }),
  45505. (r.loadJsonFile = function (e, t, i) {
  45506. if (
  45507. (t && "object" == typeof t
  45508. ? ((i = t), (t = null))
  45509. : (t && "function" == typeof t) || (t = null),
  45510. t)
  45511. )
  45512. return r.Util.fetch(
  45513. "string" == typeof e ? e : e.root + "/" + e.file,
  45514. function (n) {
  45515. if (null === n)
  45516. return void t(Error("Failed to fetch file"));
  45517. try {
  45518. t(null, r.loadJson(JSON.parse(n), i, e));
  45519. } catch (e) {
  45520. t(e);
  45521. }
  45522. }
  45523. );
  45524. var n = r.Util.fetch(
  45525. "object" == typeof e ? e.root + "/" + e.file : e
  45526. );
  45527. return null === n ? null : r.loadJson(JSON.parse(n), i, e);
  45528. }),
  45529. r
  45530. );
  45531. });
  45532. }).call(this, e("_process"));
  45533. },
  45534. {
  45535. _process: 203,
  45536. bytebuffer: 215,
  45537. fs: 197,
  45538. path: 197,
  45539. },
  45540. ],
  45541. 215: [
  45542. function (e, t, i) {
  45543. !(function (i, n) {
  45544. "function" == typeof define && define.amd
  45545. ? define(["long"], n)
  45546. : "function" == typeof e && "object" == typeof t && t && t.exports
  45547. ? (t.exports = (function () {
  45548. var t;
  45549. try {
  45550. t = e("long");
  45551. } catch (e) {}
  45552. return n(t);
  45553. })())
  45554. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long));
  45555. })(this, function (e) {
  45556. "use strict";
  45557. function t(e) {
  45558. var t = 0;
  45559. return function () {
  45560. return t < e.length ? e.charCodeAt(t++) : null;
  45561. };
  45562. }
  45563. function i() {
  45564. var e = [],
  45565. t = [];
  45566. return function () {
  45567. return 0 === arguments.length
  45568. ? t.join("") + l.apply(String, e)
  45569. : (e.length + arguments.length > 1024 &&
  45570. (t.push(l.apply(String, e)), (e.length = 0)),
  45571. void Array.prototype.push.apply(e, arguments));
  45572. };
  45573. }
  45574. function n(e, t, i, n, r) {
  45575. var o,
  45576. a,
  45577. s = 8 * r - n - 1,
  45578. l = (1 << s) - 1,
  45579. c = l >> 1,
  45580. h = -7,
  45581. u = i ? r - 1 : 0,
  45582. d = i ? -1 : 1,
  45583. p = e[t + u];
  45584. for (
  45585. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  45586. h > 0;
  45587. o = 256 * o + e[t + u], u += d, h -= 8
  45588. );
  45589. for (
  45590. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  45591. h > 0;
  45592. a = 256 * a + e[t + u], u += d, h -= 8
  45593. );
  45594. if (0 === o) o = 1 - c;
  45595. else {
  45596. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  45597. (a += Math.pow(2, n)), (o -= c);
  45598. }
  45599. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  45600. }
  45601. function r(e, t, i, n, r, o) {
  45602. var a,
  45603. s,
  45604. l,
  45605. c = 8 * o - r - 1,
  45606. h = (1 << c) - 1,
  45607. u = h >> 1,
  45608. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  45609. p = n ? 0 : o - 1,
  45610. f = n ? 1 : -1,
  45611. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  45612. for (
  45613. t = Math.abs(t),
  45614. isNaN(t) || t === 1 / 0
  45615. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  45616. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  45617. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  45618. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  45619. t * l >= 2 && (a++, (l /= 2)),
  45620. a + u >= h
  45621. ? ((s = 0), (a = h))
  45622. : a + u >= 1
  45623. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  45624. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)),
  45625. (a = 0)));
  45626. r >= 8;
  45627. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  45628. );
  45629. for (
  45630. a = (a << r) | s, c += r;
  45631. c > 0;
  45632. e[i + p] = 255 & a, p += f, a /= 256, c -= 8
  45633. );
  45634. e[i + p - f] |= 128 * g;
  45635. }
  45636. var o = function (e, t, i) {
  45637. if (
  45638. ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  45639. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  45640. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  45641. !i)
  45642. ) {
  45643. if (((e |= 0), e < 0)) throw RangeError("Illegal capacity");
  45644. (t = !!t), (i = !!i);
  45645. }
  45646. (this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  45647. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  45648. (this.offset = 0),
  45649. (this.markedOffset = -1),
  45650. (this.limit = e),
  45651. (this.littleEndian = t),
  45652. (this.noAssert = i);
  45653. };
  45654. (o.VERSION = "5.0.1"),
  45655. (o.LITTLE_ENDIAN = !0),
  45656. (o.BIG_ENDIAN = !1),
  45657. (o.DEFAULT_CAPACITY = 16),
  45658. (o.DEFAULT_ENDIAN = o.BIG_ENDIAN),
  45659. (o.DEFAULT_NOASSERT = !1),
  45660. (o.Long = e || null);
  45661. var a = o.prototype;
  45662. a.__isByteBuffer__,
  45663. Object.defineProperty(a, "__isByteBuffer__", {
  45664. value: !0,
  45665. enumerable: !1,
  45666. configurable: !1,
  45667. });
  45668. var s = new ArrayBuffer(0),
  45669. l = String.fromCharCode;
  45670. (o.accessor = function () {
  45671. return Uint8Array;
  45672. }),
  45673. (o.allocate = function (e, t, i) {
  45674. return new o(e, t, i);
  45675. }),
  45676. (o.concat = function (e, t, i, n) {
  45677. ("boolean" != typeof t && "string" == typeof t) ||
  45678. ((n = i), (i = t), (t = void 0));
  45679. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  45680. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  45681. (r = e[s].limit - e[s].offset),
  45682. r > 0 && (a += r);
  45683. if (0 === a) return new o(0, i, n);
  45684. var c,
  45685. h = new o(a, i, n);
  45686. for (s = 0; s < l; )
  45687. (c = e[s++]),
  45688. (r = c.limit - c.offset),
  45689. r <= 0 ||
  45690. (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  45691. (h.offset += r));
  45692. return (h.limit = h.offset), (h.offset = 0), h;
  45693. }),
  45694. (o.isByteBuffer = function (e) {
  45695. return (e && e.__isByteBuffer__) === !0;
  45696. }),
  45697. (o.type = function () {
  45698. return ArrayBuffer;
  45699. }),
  45700. (o.wrap = function (e, t, i, n) {
  45701. if (
  45702. ("string" != typeof t && ((n = i), (i = t), (t = void 0)),
  45703. "string" == typeof e)
  45704. )
  45705. switch (("undefined" == typeof t && (t = "utf8"), t)) {
  45706. case "base64":
  45707. return o.fromBase64(e, i);
  45708. case "hex":
  45709. return o.fromHex(e, i);
  45710. case "binary":
  45711. return o.fromBinary(e, i);
  45712. case "utf8":
  45713. return o.fromUTF8(e, i);
  45714. case "debug":
  45715. return o.fromDebug(e, i);
  45716. default:
  45717. throw Error("Unsupported encoding: " + t);
  45718. }
  45719. if (null === e || "object" != typeof e)
  45720. throw TypeError("Illegal buffer");
  45721. var r;
  45722. if (o.isByteBuffer(e))
  45723. return (r = a.clone.call(e)), (r.markedOffset = -1), r;
  45724. if (e instanceof Uint8Array)
  45725. (r = new o(0, i, n)),
  45726. e.length > 0 &&
  45727. ((r.buffer = e.buffer),
  45728. (r.offset = e.byteOffset),
  45729. (r.limit = e.byteOffset + e.byteLength),
  45730. (r.view = new Uint8Array(e.buffer)));
  45731. else if (e instanceof ArrayBuffer)
  45732. (r = new o(0, i, n)),
  45733. e.byteLength > 0 &&
  45734. ((r.buffer = e),
  45735. (r.offset = 0),
  45736. (r.limit = e.byteLength),
  45737. (r.view = e.byteLength > 0 ? new Uint8Array(e) : null));
  45738. else {
  45739. if ("[object Array]" !== Object.prototype.toString.call(e))
  45740. throw TypeError("Illegal buffer");
  45741. (r = new o(e.length, i, n)), (r.limit = e.length);
  45742. for (var s = 0; s < e.length; ++s) r.view[s] = e[s];
  45743. }
  45744. return r;
  45745. }),
  45746. (a.writeBitSet = function (e, t) {
  45747. var i = "undefined" == typeof t;
  45748. if ((i && (t = this.offset), !this.noAssert)) {
  45749. if (!(e instanceof Array))
  45750. throw TypeError("Illegal BitSet: Not an array");
  45751. if ("number" != typeof t || t % 1 !== 0)
  45752. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45753. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45754. throw RangeError(
  45755. "Illegal offset: 0 <= " +
  45756. t +
  45757. " (+0) <= " +
  45758. this.buffer.byteLength
  45759. );
  45760. }
  45761. var n,
  45762. r = t,
  45763. o = e.length,
  45764. a = o >> 3,
  45765. s = 0;
  45766. for (t += this.writeVarint32(o, t); a--; )
  45767. (n =
  45768. (1 & !!e[s++]) |
  45769. ((1 & !!e[s++]) << 1) |
  45770. ((1 & !!e[s++]) << 2) |
  45771. ((1 & !!e[s++]) << 3) |
  45772. ((1 & !!e[s++]) << 4) |
  45773. ((1 & !!e[s++]) << 5) |
  45774. ((1 & !!e[s++]) << 6) |
  45775. ((1 & !!e[s++]) << 7)),
  45776. this.writeByte(n, t++);
  45777. if (s < o) {
  45778. var l = 0;
  45779. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++;
  45780. this.writeByte(n, t++);
  45781. }
  45782. return i ? ((this.offset = t), this) : t - r;
  45783. }),
  45784. (a.readBitSet = function (e) {
  45785. var t = "undefined" == typeof e;
  45786. t && (e = this.offset);
  45787. var i,
  45788. n = this.readVarint32(e),
  45789. r = n.value,
  45790. o = r >> 3,
  45791. a = 0,
  45792. s = [];
  45793. for (e += n.length; o--; )
  45794. (i = this.readByte(e++)),
  45795. (s[a++] = !!(1 & i)),
  45796. (s[a++] = !!(2 & i)),
  45797. (s[a++] = !!(4 & i)),
  45798. (s[a++] = !!(8 & i)),
  45799. (s[a++] = !!(16 & i)),
  45800. (s[a++] = !!(32 & i)),
  45801. (s[a++] = !!(64 & i)),
  45802. (s[a++] = !!(128 & i));
  45803. if (a < r) {
  45804. var l = 0;
  45805. for (i = this.readByte(e++); a < r; )
  45806. s[a++] = !!((i >> l++) & 1);
  45807. }
  45808. return t && (this.offset = e), s;
  45809. }),
  45810. (a.readBytes = function (e, t) {
  45811. var i = "undefined" == typeof t;
  45812. if ((i && (t = this.offset), !this.noAssert)) {
  45813. if ("number" != typeof t || t % 1 !== 0)
  45814. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45815. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength))
  45816. throw RangeError(
  45817. "Illegal offset: 0 <= " +
  45818. t +
  45819. " (+" +
  45820. e +
  45821. ") <= " +
  45822. this.buffer.byteLength
  45823. );
  45824. }
  45825. var n = this.slice(t, t + e);
  45826. return i && (this.offset += e), n;
  45827. }),
  45828. (a.writeBytes = a.append),
  45829. (a.writeInt8 = function (e, t) {
  45830. var i = "undefined" == typeof t;
  45831. if ((i && (t = this.offset), !this.noAssert)) {
  45832. if ("number" != typeof e || e % 1 !== 0)
  45833. throw TypeError("Illegal value: " + e + " (not an integer)");
  45834. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  45835. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45836. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45837. throw RangeError(
  45838. "Illegal offset: 0 <= " +
  45839. t +
  45840. " (+0) <= " +
  45841. this.buffer.byteLength
  45842. );
  45843. }
  45844. t += 1;
  45845. var n = this.buffer.byteLength;
  45846. return (
  45847. t > n && this.resize((n *= 2) > t ? n : t),
  45848. (t -= 1),
  45849. (this.view[t] = e),
  45850. i && (this.offset += 1),
  45851. this
  45852. );
  45853. }),
  45854. (a.writeByte = a.writeInt8),
  45855. (a.readInt8 = function (e) {
  45856. var t = "undefined" == typeof e;
  45857. if ((t && (e = this.offset), !this.noAssert)) {
  45858. if ("number" != typeof e || e % 1 !== 0)
  45859. throw TypeError("Illegal offset: " + e + " (not an integer)");
  45860. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  45861. throw RangeError(
  45862. "Illegal offset: 0 <= " +
  45863. e +
  45864. " (+1) <= " +
  45865. this.buffer.byteLength
  45866. );
  45867. }
  45868. var i = this.view[e];
  45869. return (
  45870. 128 === (128 & i) && (i = -(255 - i + 1)),
  45871. t && (this.offset += 1),
  45872. i
  45873. );
  45874. }),
  45875. (a.readByte = a.readInt8),
  45876. (a.writeUint8 = function (e, t) {
  45877. var i = "undefined" == typeof t;
  45878. if ((i && (t = this.offset), !this.noAssert)) {
  45879. if ("number" != typeof e || e % 1 !== 0)
  45880. throw TypeError("Illegal value: " + e + " (not an integer)");
  45881. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  45882. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45883. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45884. throw RangeError(
  45885. "Illegal offset: 0 <= " +
  45886. t +
  45887. " (+0) <= " +
  45888. this.buffer.byteLength
  45889. );
  45890. }
  45891. t += 1;
  45892. var n = this.buffer.byteLength;
  45893. return (
  45894. t > n && this.resize((n *= 2) > t ? n : t),
  45895. (t -= 1),
  45896. (this.view[t] = e),
  45897. i && (this.offset += 1),
  45898. this
  45899. );
  45900. }),
  45901. (a.writeUInt8 = a.writeUint8),
  45902. (a.readUint8 = function (e) {
  45903. var t = "undefined" == typeof e;
  45904. if ((t && (e = this.offset), !this.noAssert)) {
  45905. if ("number" != typeof e || e % 1 !== 0)
  45906. throw TypeError("Illegal offset: " + e + " (not an integer)");
  45907. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  45908. throw RangeError(
  45909. "Illegal offset: 0 <= " +
  45910. e +
  45911. " (+1) <= " +
  45912. this.buffer.byteLength
  45913. );
  45914. }
  45915. var i = this.view[e];
  45916. return t && (this.offset += 1), i;
  45917. }),
  45918. (a.readUInt8 = a.readUint8),
  45919. (a.writeInt16 = function (e, t) {
  45920. var i = "undefined" == typeof t;
  45921. if ((i && (t = this.offset), !this.noAssert)) {
  45922. if ("number" != typeof e || e % 1 !== 0)
  45923. throw TypeError("Illegal value: " + e + " (not an integer)");
  45924. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  45925. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45926. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45927. throw RangeError(
  45928. "Illegal offset: 0 <= " +
  45929. t +
  45930. " (+0) <= " +
  45931. this.buffer.byteLength
  45932. );
  45933. }
  45934. t += 2;
  45935. var n = this.buffer.byteLength;
  45936. return (
  45937. t > n && this.resize((n *= 2) > t ? n : t),
  45938. (t -= 2),
  45939. this.littleEndian
  45940. ? ((this.view[t + 1] = (65280 & e) >>> 8),
  45941. (this.view[t] = 255 & e))
  45942. : ((this.view[t] = (65280 & e) >>> 8),
  45943. (this.view[t + 1] = 255 & e)),
  45944. i && (this.offset += 2),
  45945. this
  45946. );
  45947. }),
  45948. (a.writeShort = a.writeInt16),
  45949. (a.readInt16 = function (e) {
  45950. var t = "undefined" == typeof e;
  45951. if ((t && (e = this.offset), !this.noAssert)) {
  45952. if ("number" != typeof e || e % 1 !== 0)
  45953. throw TypeError("Illegal offset: " + e + " (not an integer)");
  45954. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  45955. throw RangeError(
  45956. "Illegal offset: 0 <= " +
  45957. e +
  45958. " (+2) <= " +
  45959. this.buffer.byteLength
  45960. );
  45961. }
  45962. var i = 0;
  45963. return (
  45964. this.littleEndian
  45965. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  45966. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  45967. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  45968. t && (this.offset += 2),
  45969. i
  45970. );
  45971. }),
  45972. (a.readShort = a.readInt16),
  45973. (a.writeUint16 = function (e, t) {
  45974. var i = "undefined" == typeof t;
  45975. if ((i && (t = this.offset), !this.noAssert)) {
  45976. if ("number" != typeof e || e % 1 !== 0)
  45977. throw TypeError("Illegal value: " + e + " (not an integer)");
  45978. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  45979. throw TypeError("Illegal offset: " + t + " (not an integer)");
  45980. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  45981. throw RangeError(
  45982. "Illegal offset: 0 <= " +
  45983. t +
  45984. " (+0) <= " +
  45985. this.buffer.byteLength
  45986. );
  45987. }
  45988. t += 2;
  45989. var n = this.buffer.byteLength;
  45990. return (
  45991. t > n && this.resize((n *= 2) > t ? n : t),
  45992. (t -= 2),
  45993. this.littleEndian
  45994. ? ((this.view[t + 1] = (65280 & e) >>> 8),
  45995. (this.view[t] = 255 & e))
  45996. : ((this.view[t] = (65280 & e) >>> 8),
  45997. (this.view[t + 1] = 255 & e)),
  45998. i && (this.offset += 2),
  45999. this
  46000. );
  46001. }),
  46002. (a.writeUInt16 = a.writeUint16),
  46003. (a.readUint16 = function (e) {
  46004. var t = "undefined" == typeof e;
  46005. if ((t && (e = this.offset), !this.noAssert)) {
  46006. if ("number" != typeof e || e % 1 !== 0)
  46007. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46008. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  46009. throw RangeError(
  46010. "Illegal offset: 0 <= " +
  46011. e +
  46012. " (+2) <= " +
  46013. this.buffer.byteLength
  46014. );
  46015. }
  46016. var i = 0;
  46017. return (
  46018. this.littleEndian
  46019. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  46020. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  46021. t && (this.offset += 2),
  46022. i
  46023. );
  46024. }),
  46025. (a.readUInt16 = a.readUint16),
  46026. (a.writeInt32 = function (e, t) {
  46027. var i = "undefined" == typeof t;
  46028. if ((i && (t = this.offset), !this.noAssert)) {
  46029. if ("number" != typeof e || e % 1 !== 0)
  46030. throw TypeError("Illegal value: " + e + " (not an integer)");
  46031. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  46032. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46033. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46034. throw RangeError(
  46035. "Illegal offset: 0 <= " +
  46036. t +
  46037. " (+0) <= " +
  46038. this.buffer.byteLength
  46039. );
  46040. }
  46041. t += 4;
  46042. var n = this.buffer.byteLength;
  46043. return (
  46044. t > n && this.resize((n *= 2) > t ? n : t),
  46045. (t -= 4),
  46046. this.littleEndian
  46047. ? ((this.view[t + 3] = (e >>> 24) & 255),
  46048. (this.view[t + 2] = (e >>> 16) & 255),
  46049. (this.view[t + 1] = (e >>> 8) & 255),
  46050. (this.view[t] = 255 & e))
  46051. : ((this.view[t] = (e >>> 24) & 255),
  46052. (this.view[t + 1] = (e >>> 16) & 255),
  46053. (this.view[t + 2] = (e >>> 8) & 255),
  46054. (this.view[t + 3] = 255 & e)),
  46055. i && (this.offset += 4),
  46056. this
  46057. );
  46058. }),
  46059. (a.writeInt = a.writeInt32),
  46060. (a.readInt32 = function (e) {
  46061. var t = "undefined" == typeof e;
  46062. if ((t && (e = this.offset), !this.noAssert)) {
  46063. if ("number" != typeof e || e % 1 !== 0)
  46064. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46065. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46066. throw RangeError(
  46067. "Illegal offset: 0 <= " +
  46068. e +
  46069. " (+4) <= " +
  46070. this.buffer.byteLength
  46071. );
  46072. }
  46073. var i = 0;
  46074. return (
  46075. this.littleEndian
  46076. ? ((i = this.view[e + 2] << 16),
  46077. (i |= this.view[e + 1] << 8),
  46078. (i |= this.view[e]),
  46079. (i += (this.view[e + 3] << 24) >>> 0))
  46080. : ((i = this.view[e + 1] << 16),
  46081. (i |= this.view[e + 2] << 8),
  46082. (i |= this.view[e + 3]),
  46083. (i += (this.view[e] << 24) >>> 0)),
  46084. (i |= 0),
  46085. t && (this.offset += 4),
  46086. i
  46087. );
  46088. }),
  46089. (a.readInt = a.readInt32),
  46090. (a.writeUint32 = function (e, t) {
  46091. var i = "undefined" == typeof t;
  46092. if ((i && (t = this.offset), !this.noAssert)) {
  46093. if ("number" != typeof e || e % 1 !== 0)
  46094. throw TypeError("Illegal value: " + e + " (not an integer)");
  46095. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  46096. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46097. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46098. throw RangeError(
  46099. "Illegal offset: 0 <= " +
  46100. t +
  46101. " (+0) <= " +
  46102. this.buffer.byteLength
  46103. );
  46104. }
  46105. t += 4;
  46106. var n = this.buffer.byteLength;
  46107. return (
  46108. t > n && this.resize((n *= 2) > t ? n : t),
  46109. (t -= 4),
  46110. this.littleEndian
  46111. ? ((this.view[t + 3] = (e >>> 24) & 255),
  46112. (this.view[t + 2] = (e >>> 16) & 255),
  46113. (this.view[t + 1] = (e >>> 8) & 255),
  46114. (this.view[t] = 255 & e))
  46115. : ((this.view[t] = (e >>> 24) & 255),
  46116. (this.view[t + 1] = (e >>> 16) & 255),
  46117. (this.view[t + 2] = (e >>> 8) & 255),
  46118. (this.view[t + 3] = 255 & e)),
  46119. i && (this.offset += 4),
  46120. this
  46121. );
  46122. }),
  46123. (a.writeUInt32 = a.writeUint32),
  46124. (a.readUint32 = function (e) {
  46125. var t = "undefined" == typeof e;
  46126. if ((t && (e = this.offset), !this.noAssert)) {
  46127. if ("number" != typeof e || e % 1 !== 0)
  46128. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46129. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46130. throw RangeError(
  46131. "Illegal offset: 0 <= " +
  46132. e +
  46133. " (+4) <= " +
  46134. this.buffer.byteLength
  46135. );
  46136. }
  46137. var i = 0;
  46138. return (
  46139. this.littleEndian
  46140. ? ((i = this.view[e + 2] << 16),
  46141. (i |= this.view[e + 1] << 8),
  46142. (i |= this.view[e]),
  46143. (i += (this.view[e + 3] << 24) >>> 0))
  46144. : ((i = this.view[e + 1] << 16),
  46145. (i |= this.view[e + 2] << 8),
  46146. (i |= this.view[e + 3]),
  46147. (i += (this.view[e] << 24) >>> 0)),
  46148. t && (this.offset += 4),
  46149. i
  46150. );
  46151. }),
  46152. (a.readUInt32 = a.readUint32),
  46153. e &&
  46154. ((a.writeInt64 = function (t, i) {
  46155. var n = "undefined" == typeof i;
  46156. if ((n && (i = this.offset), !this.noAssert)) {
  46157. if ("number" == typeof t) t = e.fromNumber(t);
  46158. else if ("string" == typeof t) t = e.fromString(t);
  46159. else if (!(t && t instanceof e))
  46160. throw TypeError(
  46161. "Illegal value: " + t + " (not an integer or Long)"
  46162. );
  46163. if ("number" != typeof i || i % 1 !== 0)
  46164. throw TypeError(
  46165. "Illegal offset: " + i + " (not an integer)"
  46166. );
  46167. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46168. throw RangeError(
  46169. "Illegal offset: 0 <= " +
  46170. i +
  46171. " (+0) <= " +
  46172. this.buffer.byteLength
  46173. );
  46174. }
  46175. "number" == typeof t
  46176. ? (t = e.fromNumber(t))
  46177. : "string" == typeof t && (t = e.fromString(t)),
  46178. (i += 8);
  46179. var r = this.buffer.byteLength;
  46180. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  46181. var o = t.low,
  46182. a = t.high;
  46183. return (
  46184. this.littleEndian
  46185. ? ((this.view[i + 3] = (o >>> 24) & 255),
  46186. (this.view[i + 2] = (o >>> 16) & 255),
  46187. (this.view[i + 1] = (o >>> 8) & 255),
  46188. (this.view[i] = 255 & o),
  46189. (i += 4),
  46190. (this.view[i + 3] = (a >>> 24) & 255),
  46191. (this.view[i + 2] = (a >>> 16) & 255),
  46192. (this.view[i + 1] = (a >>> 8) & 255),
  46193. (this.view[i] = 255 & a))
  46194. : ((this.view[i] = (a >>> 24) & 255),
  46195. (this.view[i + 1] = (a >>> 16) & 255),
  46196. (this.view[i + 2] = (a >>> 8) & 255),
  46197. (this.view[i + 3] = 255 & a),
  46198. (i += 4),
  46199. (this.view[i] = (o >>> 24) & 255),
  46200. (this.view[i + 1] = (o >>> 16) & 255),
  46201. (this.view[i + 2] = (o >>> 8) & 255),
  46202. (this.view[i + 3] = 255 & o)),
  46203. n && (this.offset += 8),
  46204. this
  46205. );
  46206. }),
  46207. (a.writeLong = a.writeInt64),
  46208. (a.readInt64 = function (t) {
  46209. var i = "undefined" == typeof t;
  46210. if ((i && (t = this.offset), !this.noAssert)) {
  46211. if ("number" != typeof t || t % 1 !== 0)
  46212. throw TypeError(
  46213. "Illegal offset: " + t + " (not an integer)"
  46214. );
  46215. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  46216. throw RangeError(
  46217. "Illegal offset: 0 <= " +
  46218. t +
  46219. " (+8) <= " +
  46220. this.buffer.byteLength
  46221. );
  46222. }
  46223. var n = 0,
  46224. r = 0;
  46225. this.littleEndian
  46226. ? ((n = this.view[t + 2] << 16),
  46227. (n |= this.view[t + 1] << 8),
  46228. (n |= this.view[t]),
  46229. (n += (this.view[t + 3] << 24) >>> 0),
  46230. (t += 4),
  46231. (r = this.view[t + 2] << 16),
  46232. (r |= this.view[t + 1] << 8),
  46233. (r |= this.view[t]),
  46234. (r += (this.view[t + 3] << 24) >>> 0))
  46235. : ((r = this.view[t + 1] << 16),
  46236. (r |= this.view[t + 2] << 8),
  46237. (r |= this.view[t + 3]),
  46238. (r += (this.view[t] << 24) >>> 0),
  46239. (t += 4),
  46240. (n = this.view[t + 1] << 16),
  46241. (n |= this.view[t + 2] << 8),
  46242. (n |= this.view[t + 3]),
  46243. (n += (this.view[t] << 24) >>> 0));
  46244. var o = new e(n, r, !1);
  46245. return i && (this.offset += 8), o;
  46246. }),
  46247. (a.readLong = a.readInt64),
  46248. (a.writeUint64 = function (t, i) {
  46249. var n = "undefined" == typeof i;
  46250. if ((n && (i = this.offset), !this.noAssert)) {
  46251. if ("number" == typeof t) t = e.fromNumber(t);
  46252. else if ("string" == typeof t) t = e.fromString(t);
  46253. else if (!(t && t instanceof e))
  46254. throw TypeError(
  46255. "Illegal value: " + t + " (not an integer or Long)"
  46256. );
  46257. if ("number" != typeof i || i % 1 !== 0)
  46258. throw TypeError(
  46259. "Illegal offset: " + i + " (not an integer)"
  46260. );
  46261. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46262. throw RangeError(
  46263. "Illegal offset: 0 <= " +
  46264. i +
  46265. " (+0) <= " +
  46266. this.buffer.byteLength
  46267. );
  46268. }
  46269. "number" == typeof t
  46270. ? (t = e.fromNumber(t))
  46271. : "string" == typeof t && (t = e.fromString(t)),
  46272. (i += 8);
  46273. var r = this.buffer.byteLength;
  46274. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  46275. var o = t.low,
  46276. a = t.high;
  46277. return (
  46278. this.littleEndian
  46279. ? ((this.view[i + 3] = (o >>> 24) & 255),
  46280. (this.view[i + 2] = (o >>> 16) & 255),
  46281. (this.view[i + 1] = (o >>> 8) & 255),
  46282. (this.view[i] = 255 & o),
  46283. (i += 4),
  46284. (this.view[i + 3] = (a >>> 24) & 255),
  46285. (this.view[i + 2] = (a >>> 16) & 255),
  46286. (this.view[i + 1] = (a >>> 8) & 255),
  46287. (this.view[i] = 255 & a))
  46288. : ((this.view[i] = (a >>> 24) & 255),
  46289. (this.view[i + 1] = (a >>> 16) & 255),
  46290. (this.view[i + 2] = (a >>> 8) & 255),
  46291. (this.view[i + 3] = 255 & a),
  46292. (i += 4),
  46293. (this.view[i] = (o >>> 24) & 255),
  46294. (this.view[i + 1] = (o >>> 16) & 255),
  46295. (this.view[i + 2] = (o >>> 8) & 255),
  46296. (this.view[i + 3] = 255 & o)),
  46297. n && (this.offset += 8),
  46298. this
  46299. );
  46300. }),
  46301. (a.writeUInt64 = a.writeUint64),
  46302. (a.readUint64 = function (t) {
  46303. var i = "undefined" == typeof t;
  46304. if ((i && (t = this.offset), !this.noAssert)) {
  46305. if ("number" != typeof t || t % 1 !== 0)
  46306. throw TypeError(
  46307. "Illegal offset: " + t + " (not an integer)"
  46308. );
  46309. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  46310. throw RangeError(
  46311. "Illegal offset: 0 <= " +
  46312. t +
  46313. " (+8) <= " +
  46314. this.buffer.byteLength
  46315. );
  46316. }
  46317. var n = 0,
  46318. r = 0;
  46319. this.littleEndian
  46320. ? ((n = this.view[t + 2] << 16),
  46321. (n |= this.view[t + 1] << 8),
  46322. (n |= this.view[t]),
  46323. (n += (this.view[t + 3] << 24) >>> 0),
  46324. (t += 4),
  46325. (r = this.view[t + 2] << 16),
  46326. (r |= this.view[t + 1] << 8),
  46327. (r |= this.view[t]),
  46328. (r += (this.view[t + 3] << 24) >>> 0))
  46329. : ((r = this.view[t + 1] << 16),
  46330. (r |= this.view[t + 2] << 8),
  46331. (r |= this.view[t + 3]),
  46332. (r += (this.view[t] << 24) >>> 0),
  46333. (t += 4),
  46334. (n = this.view[t + 1] << 16),
  46335. (n |= this.view[t + 2] << 8),
  46336. (n |= this.view[t + 3]),
  46337. (n += (this.view[t] << 24) >>> 0));
  46338. var o = new e(n, r, !0);
  46339. return i && (this.offset += 8), o;
  46340. }),
  46341. (a.readUInt64 = a.readUint64)),
  46342. (a.writeFloat32 = function (e, t) {
  46343. var i = "undefined" == typeof t;
  46344. if ((i && (t = this.offset), !this.noAssert)) {
  46345. if ("number" != typeof e)
  46346. throw TypeError("Illegal value: " + e + " (not a number)");
  46347. if ("number" != typeof t || t % 1 !== 0)
  46348. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46349. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46350. throw RangeError(
  46351. "Illegal offset: 0 <= " +
  46352. t +
  46353. " (+0) <= " +
  46354. this.buffer.byteLength
  46355. );
  46356. }
  46357. t += 4;
  46358. var n = this.buffer.byteLength;
  46359. return (
  46360. t > n && this.resize((n *= 2) > t ? n : t),
  46361. (t -= 4),
  46362. r(this.view, e, t, this.littleEndian, 23, 4),
  46363. i && (this.offset += 4),
  46364. this
  46365. );
  46366. }),
  46367. (a.writeFloat = a.writeFloat32),
  46368. (a.readFloat32 = function (e) {
  46369. var t = "undefined" == typeof e;
  46370. if ((t && (e = this.offset), !this.noAssert)) {
  46371. if ("number" != typeof e || e % 1 !== 0)
  46372. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46373. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46374. throw RangeError(
  46375. "Illegal offset: 0 <= " +
  46376. e +
  46377. " (+4) <= " +
  46378. this.buffer.byteLength
  46379. );
  46380. }
  46381. var i = n(this.view, e, this.littleEndian, 23, 4);
  46382. return t && (this.offset += 4), i;
  46383. }),
  46384. (a.readFloat = a.readFloat32),
  46385. (a.writeFloat64 = function (e, t) {
  46386. var i = "undefined" == typeof t;
  46387. if ((i && (t = this.offset), !this.noAssert)) {
  46388. if ("number" != typeof e)
  46389. throw TypeError("Illegal value: " + e + " (not a number)");
  46390. if ("number" != typeof t || t % 1 !== 0)
  46391. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46392. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46393. throw RangeError(
  46394. "Illegal offset: 0 <= " +
  46395. t +
  46396. " (+0) <= " +
  46397. this.buffer.byteLength
  46398. );
  46399. }
  46400. t += 8;
  46401. var n = this.buffer.byteLength;
  46402. return (
  46403. t > n && this.resize((n *= 2) > t ? n : t),
  46404. (t -= 8),
  46405. r(this.view, e, t, this.littleEndian, 52, 8),
  46406. i && (this.offset += 8),
  46407. this
  46408. );
  46409. }),
  46410. (a.writeDouble = a.writeFloat64),
  46411. (a.readFloat64 = function (e) {
  46412. var t = "undefined" == typeof e;
  46413. if ((t && (e = this.offset), !this.noAssert)) {
  46414. if ("number" != typeof e || e % 1 !== 0)
  46415. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46416. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength))
  46417. throw RangeError(
  46418. "Illegal offset: 0 <= " +
  46419. e +
  46420. " (+8) <= " +
  46421. this.buffer.byteLength
  46422. );
  46423. }
  46424. var i = n(this.view, e, this.littleEndian, 52, 8);
  46425. return t && (this.offset += 8), i;
  46426. }),
  46427. (a.readDouble = a.readFloat64),
  46428. (o.MAX_VARINT32_BYTES = 5),
  46429. (o.calculateVarint32 = function (e) {
  46430. return (
  46431. (e >>>= 0),
  46432. e < 128
  46433. ? 1
  46434. : e < 16384
  46435. ? 2
  46436. : e < 1 << 21
  46437. ? 3
  46438. : e < 1 << 28
  46439. ? 4
  46440. : 5
  46441. );
  46442. }),
  46443. (o.zigZagEncode32 = function (e) {
  46444. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0;
  46445. }),
  46446. (o.zigZagDecode32 = function (e) {
  46447. return ((e >>> 1) ^ -(1 & e)) | 0;
  46448. }),
  46449. (a.writeVarint32 = function (e, t) {
  46450. var i = "undefined" == typeof t;
  46451. if ((i && (t = this.offset), !this.noAssert)) {
  46452. if ("number" != typeof e || e % 1 !== 0)
  46453. throw TypeError("Illegal value: " + e + " (not an integer)");
  46454. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  46455. throw TypeError("Illegal offset: " + t + " (not an integer)");
  46456. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  46457. throw RangeError(
  46458. "Illegal offset: 0 <= " +
  46459. t +
  46460. " (+0) <= " +
  46461. this.buffer.byteLength
  46462. );
  46463. }
  46464. var n,
  46465. r = o.calculateVarint32(e);
  46466. t += r;
  46467. var a = this.buffer.byteLength;
  46468. for (
  46469. t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0;
  46470. e >= 128;
  46471. )
  46472. (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7);
  46473. return (this.view[t++] = e), i ? ((this.offset = t), this) : r;
  46474. }),
  46475. (a.writeVarint32ZigZag = function (e, t) {
  46476. return this.writeVarint32(o.zigZagEncode32(e), t);
  46477. }),
  46478. (a.readVarint32 = function (e) {
  46479. var t = "undefined" == typeof e;
  46480. if ((t && (e = this.offset), !this.noAssert)) {
  46481. if ("number" != typeof e || e % 1 !== 0)
  46482. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46483. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  46484. throw RangeError(
  46485. "Illegal offset: 0 <= " +
  46486. e +
  46487. " (+1) <= " +
  46488. this.buffer.byteLength
  46489. );
  46490. }
  46491. var i,
  46492. n = 0,
  46493. r = 0;
  46494. do {
  46495. if (!this.noAssert && e > this.limit) {
  46496. var o = Error("Truncated");
  46497. throw ((o.truncated = !0), o);
  46498. }
  46499. (i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n;
  46500. } while (0 !== (128 & i));
  46501. return (
  46502. (r |= 0),
  46503. t
  46504. ? ((this.offset = e), r)
  46505. : {
  46506. value: r,
  46507. length: n,
  46508. }
  46509. );
  46510. }),
  46511. (a.readVarint32ZigZag = function (e) {
  46512. var t = this.readVarint32(e);
  46513. return (
  46514. "object" == typeof t
  46515. ? (t.value = o.zigZagDecode32(t.value))
  46516. : (t = o.zigZagDecode32(t)),
  46517. t
  46518. );
  46519. }),
  46520. e &&
  46521. ((o.MAX_VARINT64_BYTES = 10),
  46522. (o.calculateVarint64 = function (t) {
  46523. "number" == typeof t
  46524. ? (t = e.fromNumber(t))
  46525. : "string" == typeof t && (t = e.fromString(t));
  46526. var i = t.toInt() >>> 0,
  46527. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  46528. r = t.shiftRightUnsigned(56).toInt() >>> 0;
  46529. return 0 == r
  46530. ? 0 == n
  46531. ? i < 16384
  46532. ? i < 128
  46533. ? 1
  46534. : 2
  46535. : i < 1 << 21
  46536. ? 3
  46537. : 4
  46538. : n < 16384
  46539. ? n < 128
  46540. ? 5
  46541. : 6
  46542. : n < 1 << 21
  46543. ? 7
  46544. : 8
  46545. : r < 128
  46546. ? 9
  46547. : 10;
  46548. }),
  46549. (o.zigZagEncode64 = function (t) {
  46550. return (
  46551. "number" == typeof t
  46552. ? (t = e.fromNumber(t, !1))
  46553. : "string" == typeof t
  46554. ? (t = e.fromString(t, !1))
  46555. : t.unsigned !== !1 && (t = t.toSigned()),
  46556. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  46557. );
  46558. }),
  46559. (o.zigZagDecode64 = function (t) {
  46560. return (
  46561. "number" == typeof t
  46562. ? (t = e.fromNumber(t, !1))
  46563. : "string" == typeof t
  46564. ? (t = e.fromString(t, !1))
  46565. : t.unsigned !== !1 && (t = t.toSigned()),
  46566. t
  46567. .shiftRightUnsigned(1)
  46568. .xor(t.and(e.ONE).toSigned().negate())
  46569. .toSigned()
  46570. );
  46571. }),
  46572. (a.writeVarint64 = function (t, i) {
  46573. var n = "undefined" == typeof i;
  46574. if ((n && (i = this.offset), !this.noAssert)) {
  46575. if ("number" == typeof t) t = e.fromNumber(t);
  46576. else if ("string" == typeof t) t = e.fromString(t);
  46577. else if (!(t && t instanceof e))
  46578. throw TypeError(
  46579. "Illegal value: " + t + " (not an integer or Long)"
  46580. );
  46581. if ("number" != typeof i || i % 1 !== 0)
  46582. throw TypeError(
  46583. "Illegal offset: " + i + " (not an integer)"
  46584. );
  46585. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46586. throw RangeError(
  46587. "Illegal offset: 0 <= " +
  46588. i +
  46589. " (+0) <= " +
  46590. this.buffer.byteLength
  46591. );
  46592. }
  46593. "number" == typeof t
  46594. ? (t = e.fromNumber(t, !1))
  46595. : "string" == typeof t
  46596. ? (t = e.fromString(t, !1))
  46597. : t.unsigned !== !1 && (t = t.toSigned());
  46598. var r = o.calculateVarint64(t),
  46599. a = t.toInt() >>> 0,
  46600. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  46601. l = t.shiftRightUnsigned(56).toInt() >>> 0;
  46602. i += r;
  46603. var c = this.buffer.byteLength;
  46604. switch (
  46605. (i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)
  46606. ) {
  46607. case 10:
  46608. this.view[i + 9] = (l >>> 7) & 1;
  46609. case 9:
  46610. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  46611. case 8:
  46612. this.view[i + 7] =
  46613. 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127;
  46614. case 7:
  46615. this.view[i + 6] =
  46616. 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127;
  46617. case 6:
  46618. this.view[i + 5] =
  46619. 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127;
  46620. case 5:
  46621. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  46622. case 4:
  46623. this.view[i + 3] =
  46624. 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127;
  46625. case 3:
  46626. this.view[i + 2] =
  46627. 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127;
  46628. case 2:
  46629. this.view[i + 1] =
  46630. 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127;
  46631. case 1:
  46632. this.view[i] = 1 !== r ? 128 | a : 127 & a;
  46633. }
  46634. return n ? ((this.offset += r), this) : r;
  46635. }),
  46636. (a.writeVarint64ZigZag = function (e, t) {
  46637. return this.writeVarint64(o.zigZagEncode64(e), t);
  46638. }),
  46639. (a.readVarint64 = function (t) {
  46640. var i = "undefined" == typeof t;
  46641. if ((i && (t = this.offset), !this.noAssert)) {
  46642. if ("number" != typeof t || t % 1 !== 0)
  46643. throw TypeError(
  46644. "Illegal offset: " + t + " (not an integer)"
  46645. );
  46646. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength))
  46647. throw RangeError(
  46648. "Illegal offset: 0 <= " +
  46649. t +
  46650. " (+1) <= " +
  46651. this.buffer.byteLength
  46652. );
  46653. }
  46654. var n = t,
  46655. r = 0,
  46656. o = 0,
  46657. a = 0,
  46658. s = 0;
  46659. if (
  46660. ((s = this.view[t++]),
  46661. (r = 127 & s),
  46662. 128 & s &&
  46663. ((s = this.view[t++]),
  46664. (r |= (127 & s) << 7),
  46665. (128 & s || (this.noAssert && "undefined" == typeof s)) &&
  46666. ((s = this.view[t++]),
  46667. (r |= (127 & s) << 14),
  46668. (128 & s || (this.noAssert && "undefined" == typeof s)) &&
  46669. ((s = this.view[t++]),
  46670. (r |= (127 & s) << 21),
  46671. (128 & s ||
  46672. (this.noAssert && "undefined" == typeof s)) &&
  46673. ((s = this.view[t++]),
  46674. (o = 127 & s),
  46675. (128 & s ||
  46676. (this.noAssert && "undefined" == typeof s)) &&
  46677. ((s = this.view[t++]),
  46678. (o |= (127 & s) << 7),
  46679. (128 & s ||
  46680. (this.noAssert && "undefined" == typeof s)) &&
  46681. ((s = this.view[t++]),
  46682. (o |= (127 & s) << 14),
  46683. (128 & s ||
  46684. (this.noAssert && "undefined" == typeof s)) &&
  46685. ((s = this.view[t++]),
  46686. (o |= (127 & s) << 21),
  46687. (128 & s ||
  46688. (this.noAssert && "undefined" == typeof s)) &&
  46689. ((s = this.view[t++]),
  46690. (a = 127 & s),
  46691. (128 & s ||
  46692. (this.noAssert &&
  46693. "undefined" == typeof s)) &&
  46694. ((s = this.view[t++]),
  46695. (a |= (127 & s) << 7),
  46696. 128 & s ||
  46697. (this.noAssert &&
  46698. "undefined" == typeof s)))))))))))
  46699. )
  46700. throw Error("Buffer overrun");
  46701. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1);
  46702. return i
  46703. ? ((this.offset = t), l)
  46704. : {
  46705. value: l,
  46706. length: t - n,
  46707. };
  46708. }),
  46709. (a.readVarint64ZigZag = function (t) {
  46710. var i = this.readVarint64(t);
  46711. return (
  46712. i && i.value instanceof e
  46713. ? (i.value = o.zigZagDecode64(i.value))
  46714. : (i = o.zigZagDecode64(i)),
  46715. i
  46716. );
  46717. })),
  46718. (a.writeCString = function (e, i) {
  46719. var n = "undefined" == typeof i;
  46720. n && (i = this.offset);
  46721. var r,
  46722. o = e.length;
  46723. if (!this.noAssert) {
  46724. if ("string" != typeof e)
  46725. throw TypeError("Illegal str: Not a string");
  46726. for (r = 0; r < o; ++r)
  46727. if (0 === e.charCodeAt(r))
  46728. throw RangeError("Illegal str: Contains NULL-characters");
  46729. if ("number" != typeof i || i % 1 !== 0)
  46730. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46731. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46732. throw RangeError(
  46733. "Illegal offset: 0 <= " +
  46734. i +
  46735. " (+0) <= " +
  46736. this.buffer.byteLength
  46737. );
  46738. }
  46739. (o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1);
  46740. var a = this.buffer.byteLength;
  46741. return (
  46742. i > a && this.resize((a *= 2) > i ? a : i),
  46743. (i -= o + 1),
  46744. h.encodeUTF16toUTF8(
  46745. t(e),
  46746. function (e) {
  46747. this.view[i++] = e;
  46748. }.bind(this)
  46749. ),
  46750. (this.view[i++] = 0),
  46751. n ? ((this.offset = i), this) : o
  46752. );
  46753. }),
  46754. (a.readCString = function (e) {
  46755. var t = "undefined" == typeof e;
  46756. if ((t && (e = this.offset), !this.noAssert)) {
  46757. if ("number" != typeof e || e % 1 !== 0)
  46758. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46759. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  46760. throw RangeError(
  46761. "Illegal offset: 0 <= " +
  46762. e +
  46763. " (+1) <= " +
  46764. this.buffer.byteLength
  46765. );
  46766. }
  46767. var n,
  46768. r = e,
  46769. o = -1;
  46770. return (
  46771. h.decodeUTF8toUTF16(
  46772. function () {
  46773. if (0 === o) return null;
  46774. if (e >= this.limit)
  46775. throw RangeError(
  46776. "Illegal range: Truncated data, " +
  46777. e +
  46778. " < " +
  46779. this.limit
  46780. );
  46781. return (o = this.view[e++]), 0 === o ? null : o;
  46782. }.bind(this),
  46783. (n = i()),
  46784. !0
  46785. ),
  46786. t
  46787. ? ((this.offset = e), n())
  46788. : {
  46789. string: n(),
  46790. length: e - r,
  46791. }
  46792. );
  46793. }),
  46794. (a.writeIString = function (e, i) {
  46795. var n = "undefined" == typeof i;
  46796. if ((n && (i = this.offset), !this.noAssert)) {
  46797. if ("string" != typeof e)
  46798. throw TypeError("Illegal str: Not a string");
  46799. if ("number" != typeof i || i % 1 !== 0)
  46800. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46801. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46802. throw RangeError(
  46803. "Illegal offset: 0 <= " +
  46804. i +
  46805. " (+0) <= " +
  46806. this.buffer.byteLength
  46807. );
  46808. }
  46809. var r,
  46810. o = i;
  46811. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  46812. (i += 4 + r);
  46813. var a = this.buffer.byteLength;
  46814. if (
  46815. (i > a && this.resize((a *= 2) > i ? a : i),
  46816. (i -= 4 + r),
  46817. this.littleEndian
  46818. ? ((this.view[i + 3] = (r >>> 24) & 255),
  46819. (this.view[i + 2] = (r >>> 16) & 255),
  46820. (this.view[i + 1] = (r >>> 8) & 255),
  46821. (this.view[i] = 255 & r))
  46822. : ((this.view[i] = (r >>> 24) & 255),
  46823. (this.view[i + 1] = (r >>> 16) & 255),
  46824. (this.view[i + 2] = (r >>> 8) & 255),
  46825. (this.view[i + 3] = 255 & r)),
  46826. (i += 4),
  46827. h.encodeUTF16toUTF8(
  46828. t(e),
  46829. function (e) {
  46830. this.view[i++] = e;
  46831. }.bind(this)
  46832. ),
  46833. i !== o + 4 + r)
  46834. )
  46835. throw RangeError(
  46836. "Illegal range: Truncated data, " + i + " == " + (i + 4 + r)
  46837. );
  46838. return n ? ((this.offset = i), this) : i - o;
  46839. }),
  46840. (a.readIString = function (e) {
  46841. var t = "undefined" == typeof e;
  46842. if ((t && (e = this.offset), !this.noAssert)) {
  46843. if ("number" != typeof e || e % 1 !== 0)
  46844. throw TypeError("Illegal offset: " + e + " (not an integer)");
  46845. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  46846. throw RangeError(
  46847. "Illegal offset: 0 <= " +
  46848. e +
  46849. " (+4) <= " +
  46850. this.buffer.byteLength
  46851. );
  46852. }
  46853. var i = e,
  46854. n = this.readUint32(e),
  46855. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4));
  46856. return (
  46857. (e += r.length),
  46858. t
  46859. ? ((this.offset = e), r.string)
  46860. : {
  46861. string: r.string,
  46862. length: e - i,
  46863. }
  46864. );
  46865. }),
  46866. (o.METRICS_CHARS = "c"),
  46867. (o.METRICS_BYTES = "b"),
  46868. (a.writeUTF8String = function (e, i) {
  46869. var n = "undefined" == typeof i;
  46870. if ((n && (i = this.offset), !this.noAssert)) {
  46871. if ("number" != typeof i || i % 1 !== 0)
  46872. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46873. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46874. throw RangeError(
  46875. "Illegal offset: 0 <= " +
  46876. i +
  46877. " (+0) <= " +
  46878. this.buffer.byteLength
  46879. );
  46880. }
  46881. var r,
  46882. o = i;
  46883. (r = h.calculateUTF16asUTF8(t(e))[1]), (i += r);
  46884. var a = this.buffer.byteLength;
  46885. return (
  46886. i > a && this.resize((a *= 2) > i ? a : i),
  46887. (i -= r),
  46888. h.encodeUTF16toUTF8(
  46889. t(e),
  46890. function (e) {
  46891. this.view[i++] = e;
  46892. }.bind(this)
  46893. ),
  46894. n ? ((this.offset = i), this) : i - o
  46895. );
  46896. }),
  46897. (a.writeString = a.writeUTF8String),
  46898. (o.calculateUTF8Chars = function (e) {
  46899. return h.calculateUTF16asUTF8(t(e))[0];
  46900. }),
  46901. (o.calculateUTF8Bytes = function (e) {
  46902. return h.calculateUTF16asUTF8(t(e))[1];
  46903. }),
  46904. (o.calculateString = o.calculateUTF8Bytes),
  46905. (a.readUTF8String = function (e, t, n) {
  46906. "number" == typeof t && ((n = t), (t = void 0));
  46907. var r = "undefined" == typeof n;
  46908. if (
  46909. (r && (n = this.offset),
  46910. "undefined" == typeof t && (t = o.METRICS_CHARS),
  46911. !this.noAssert)
  46912. ) {
  46913. if ("number" != typeof e || e % 1 !== 0)
  46914. throw TypeError("Illegal length: " + e + " (not an integer)");
  46915. if (((e |= 0), "number" != typeof n || n % 1 !== 0))
  46916. throw TypeError("Illegal offset: " + n + " (not an integer)");
  46917. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength))
  46918. throw RangeError(
  46919. "Illegal offset: 0 <= " +
  46920. n +
  46921. " (+0) <= " +
  46922. this.buffer.byteLength
  46923. );
  46924. }
  46925. var a,
  46926. s = 0,
  46927. l = n;
  46928. if (t === o.METRICS_CHARS) {
  46929. if (
  46930. ((a = i()),
  46931. h.decodeUTF8(
  46932. function () {
  46933. return s < e && n < this.limit ? this.view[n++] : null;
  46934. }.bind(this),
  46935. function (e) {
  46936. ++s, h.UTF8toUTF16(e, a);
  46937. }
  46938. ),
  46939. s !== e)
  46940. )
  46941. throw RangeError(
  46942. "Illegal range: Truncated data, " + s + " == " + e
  46943. );
  46944. return r
  46945. ? ((this.offset = n), a())
  46946. : {
  46947. string: a(),
  46948. length: n - l,
  46949. };
  46950. }
  46951. if (t === o.METRICS_BYTES) {
  46952. if (!this.noAssert) {
  46953. if ("number" != typeof n || n % 1 !== 0)
  46954. throw TypeError(
  46955. "Illegal offset: " + n + " (not an integer)"
  46956. );
  46957. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength))
  46958. throw RangeError(
  46959. "Illegal offset: 0 <= " +
  46960. n +
  46961. " (+" +
  46962. e +
  46963. ") <= " +
  46964. this.buffer.byteLength
  46965. );
  46966. }
  46967. var c = n + e;
  46968. if (
  46969. (h.decodeUTF8toUTF16(
  46970. function () {
  46971. return n < c ? this.view[n++] : null;
  46972. }.bind(this),
  46973. (a = i()),
  46974. this.noAssert
  46975. ),
  46976. n !== c)
  46977. )
  46978. throw RangeError(
  46979. "Illegal range: Truncated data, " + n + " == " + c
  46980. );
  46981. return r
  46982. ? ((this.offset = n), a())
  46983. : {
  46984. string: a(),
  46985. length: n - l,
  46986. };
  46987. }
  46988. throw TypeError("Unsupported metrics: " + t);
  46989. }),
  46990. (a.readString = a.readUTF8String),
  46991. (a.writeVString = function (e, i) {
  46992. var n = "undefined" == typeof i;
  46993. if ((n && (i = this.offset), !this.noAssert)) {
  46994. if ("string" != typeof e)
  46995. throw TypeError("Illegal str: Not a string");
  46996. if ("number" != typeof i || i % 1 !== 0)
  46997. throw TypeError("Illegal offset: " + i + " (not an integer)");
  46998. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  46999. throw RangeError(
  47000. "Illegal offset: 0 <= " +
  47001. i +
  47002. " (+0) <= " +
  47003. this.buffer.byteLength
  47004. );
  47005. }
  47006. var r,
  47007. a,
  47008. s = i;
  47009. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  47010. (a = o.calculateVarint32(r)),
  47011. (i += a + r);
  47012. var l = this.buffer.byteLength;
  47013. if (
  47014. (i > l && this.resize((l *= 2) > i ? l : i),
  47015. (i -= a + r),
  47016. (i += this.writeVarint32(r, i)),
  47017. h.encodeUTF16toUTF8(
  47018. t(e),
  47019. function (e) {
  47020. this.view[i++] = e;
  47021. }.bind(this)
  47022. ),
  47023. i !== s + r + a)
  47024. )
  47025. throw RangeError(
  47026. "Illegal range: Truncated data, " + i + " == " + (i + r + a)
  47027. );
  47028. return n ? ((this.offset = i), this) : i - s;
  47029. }),
  47030. (a.readVString = function (e) {
  47031. var t = "undefined" == typeof e;
  47032. if ((t && (e = this.offset), !this.noAssert)) {
  47033. if ("number" != typeof e || e % 1 !== 0)
  47034. throw TypeError("Illegal offset: " + e + " (not an integer)");
  47035. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  47036. throw RangeError(
  47037. "Illegal offset: 0 <= " +
  47038. e +
  47039. " (+1) <= " +
  47040. this.buffer.byteLength
  47041. );
  47042. }
  47043. var i = e,
  47044. n = this.readVarint32(e),
  47045. r = this.readUTF8String(
  47046. n.value,
  47047. o.METRICS_BYTES,
  47048. (e += n.length)
  47049. );
  47050. return (
  47051. (e += r.length),
  47052. t
  47053. ? ((this.offset = e), r.string)
  47054. : {
  47055. string: r.string,
  47056. length: e - i,
  47057. }
  47058. );
  47059. }),
  47060. (a.append = function (e, t, i) {
  47061. ("number" != typeof t && "string" == typeof t) ||
  47062. ((i = t), (t = void 0));
  47063. var n = "undefined" == typeof i;
  47064. if ((n && (i = this.offset), !this.noAssert)) {
  47065. if ("number" != typeof i || i % 1 !== 0)
  47066. throw TypeError("Illegal offset: " + i + " (not an integer)");
  47067. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  47068. throw RangeError(
  47069. "Illegal offset: 0 <= " +
  47070. i +
  47071. " (+0) <= " +
  47072. this.buffer.byteLength
  47073. );
  47074. }
  47075. e instanceof o || (e = o.wrap(e, t));
  47076. var r = e.limit - e.offset;
  47077. if (r <= 0) return this;
  47078. i += r;
  47079. var a = this.buffer.byteLength;
  47080. return (
  47081. i > a && this.resize((a *= 2) > i ? a : i),
  47082. (i -= r),
  47083. this.view.set(e.view.subarray(e.offset, e.limit), i),
  47084. (e.offset += r),
  47085. n && (this.offset += r),
  47086. this
  47087. );
  47088. }),
  47089. (a.appendTo = function (e, t) {
  47090. return e.append(this, t), this;
  47091. }),
  47092. (a.assert = function (e) {
  47093. return (this.noAssert = !e), this;
  47094. }),
  47095. (a.capacity = function () {
  47096. return this.buffer.byteLength;
  47097. }),
  47098. (a.clear = function () {
  47099. return (
  47100. (this.offset = 0),
  47101. (this.limit = this.buffer.byteLength),
  47102. (this.markedOffset = -1),
  47103. this
  47104. );
  47105. }),
  47106. (a.clone = function (e) {
  47107. var t = new o(0, this.littleEndian, this.noAssert);
  47108. return (
  47109. e
  47110. ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)),
  47111. (t.view = new Uint8Array(t.buffer)))
  47112. : ((t.buffer = this.buffer), (t.view = this.view)),
  47113. (t.offset = this.offset),
  47114. (t.markedOffset = this.markedOffset),
  47115. (t.limit = this.limit),
  47116. t
  47117. );
  47118. }),
  47119. (a.compact = function (e, t) {
  47120. if (
  47121. ("undefined" == typeof e && (e = this.offset),
  47122. "undefined" == typeof t && (t = this.limit),
  47123. !this.noAssert)
  47124. ) {
  47125. if ("number" != typeof e || e % 1 !== 0)
  47126. throw TypeError("Illegal begin: Not an integer");
  47127. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47128. throw TypeError("Illegal end: Not an integer");
  47129. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47130. throw RangeError(
  47131. "Illegal range: 0 <= " +
  47132. e +
  47133. " <= " +
  47134. t +
  47135. " <= " +
  47136. this.buffer.byteLength
  47137. );
  47138. }
  47139. if (0 === e && t === this.buffer.byteLength) return this;
  47140. var i = t - e;
  47141. if (0 === i)
  47142. return (
  47143. (this.buffer = s),
  47144. (this.view = null),
  47145. this.markedOffset >= 0 && (this.markedOffset -= e),
  47146. (this.offset = 0),
  47147. (this.limit = 0),
  47148. this
  47149. );
  47150. var n = new ArrayBuffer(i),
  47151. r = new Uint8Array(n);
  47152. return (
  47153. r.set(this.view.subarray(e, t)),
  47154. (this.buffer = n),
  47155. (this.view = r),
  47156. this.markedOffset >= 0 && (this.markedOffset -= e),
  47157. (this.offset = 0),
  47158. (this.limit = i),
  47159. this
  47160. );
  47161. }),
  47162. (a.copy = function (e, t) {
  47163. if (
  47164. ("undefined" == typeof e && (e = this.offset),
  47165. "undefined" == typeof t && (t = this.limit),
  47166. !this.noAssert)
  47167. ) {
  47168. if ("number" != typeof e || e % 1 !== 0)
  47169. throw TypeError("Illegal begin: Not an integer");
  47170. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47171. throw TypeError("Illegal end: Not an integer");
  47172. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47173. throw RangeError(
  47174. "Illegal range: 0 <= " +
  47175. e +
  47176. " <= " +
  47177. t +
  47178. " <= " +
  47179. this.buffer.byteLength
  47180. );
  47181. }
  47182. if (e === t) return new o(0, this.littleEndian, this.noAssert);
  47183. var i = t - e,
  47184. n = new o(i, this.littleEndian, this.noAssert);
  47185. return (
  47186. (n.offset = 0),
  47187. (n.limit = i),
  47188. n.markedOffset >= 0 && (n.markedOffset -= e),
  47189. this.copyTo(n, 0, e, t),
  47190. n
  47191. );
  47192. }),
  47193. (a.copyTo = function (e, t, i, n) {
  47194. var r, a;
  47195. if (!this.noAssert && !o.isByteBuffer(e))
  47196. throw TypeError("Illegal target: Not a ByteBuffer");
  47197. if (
  47198. ((t = (a = "undefined" == typeof t) ? e.offset : 0 | t),
  47199. (i = (r = "undefined" == typeof i) ? this.offset : 0 | i),
  47200. (n = "undefined" == typeof n ? this.limit : 0 | n),
  47201. t < 0 || t > e.buffer.byteLength)
  47202. )
  47203. throw RangeError(
  47204. "Illegal target range: 0 <= " +
  47205. t +
  47206. " <= " +
  47207. e.buffer.byteLength
  47208. );
  47209. if (i < 0 || n > this.buffer.byteLength)
  47210. throw RangeError(
  47211. "Illegal source range: 0 <= " +
  47212. i +
  47213. " <= " +
  47214. this.buffer.byteLength
  47215. );
  47216. var s = n - i;
  47217. return 0 === s
  47218. ? e
  47219. : (e.ensureCapacity(t + s),
  47220. e.view.set(this.view.subarray(i, n), t),
  47221. r && (this.offset += s),
  47222. a && (e.offset += s),
  47223. this);
  47224. }),
  47225. (a.ensureCapacity = function (e) {
  47226. var t = this.buffer.byteLength;
  47227. return t < e ? this.resize((t *= 2) > e ? t : e) : this;
  47228. }),
  47229. (a.fill = function (e, t, i) {
  47230. var n = "undefined" == typeof t;
  47231. if (
  47232. (n && (t = this.offset),
  47233. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  47234. "undefined" == typeof t && (t = this.offset),
  47235. "undefined" == typeof i && (i = this.limit),
  47236. !this.noAssert)
  47237. ) {
  47238. if ("number" != typeof e || e % 1 !== 0)
  47239. throw TypeError("Illegal value: " + e + " (not an integer)");
  47240. if (((e |= 0), "number" != typeof t || t % 1 !== 0))
  47241. throw TypeError("Illegal begin: Not an integer");
  47242. if (((t >>>= 0), "number" != typeof i || i % 1 !== 0))
  47243. throw TypeError("Illegal end: Not an integer");
  47244. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  47245. throw RangeError(
  47246. "Illegal range: 0 <= " +
  47247. t +
  47248. " <= " +
  47249. i +
  47250. " <= " +
  47251. this.buffer.byteLength
  47252. );
  47253. }
  47254. if (t >= i) return this;
  47255. for (; t < i; ) this.view[t++] = e;
  47256. return n && (this.offset = t), this;
  47257. }),
  47258. (a.flip = function () {
  47259. return (this.limit = this.offset), (this.offset = 0), this;
  47260. }),
  47261. (a.mark = function (e) {
  47262. if (
  47263. ((e = "undefined" == typeof e ? this.offset : e),
  47264. !this.noAssert)
  47265. ) {
  47266. if ("number" != typeof e || e % 1 !== 0)
  47267. throw TypeError("Illegal offset: " + e + " (not an integer)");
  47268. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength))
  47269. throw RangeError(
  47270. "Illegal offset: 0 <= " +
  47271. e +
  47272. " (+0) <= " +
  47273. this.buffer.byteLength
  47274. );
  47275. }
  47276. return (this.markedOffset = e), this;
  47277. }),
  47278. (a.order = function (e) {
  47279. if (!this.noAssert && "boolean" != typeof e)
  47280. throw TypeError("Illegal littleEndian: Not a boolean");
  47281. return (this.littleEndian = !!e), this;
  47282. }),
  47283. (a.LE = function (e) {
  47284. return (this.littleEndian = "undefined" == typeof e || !!e), this;
  47285. }),
  47286. (a.BE = function (e) {
  47287. return (this.littleEndian = "undefined" != typeof e && !e), this;
  47288. }),
  47289. (a.prepend = function (e, t, i) {
  47290. ("number" != typeof t && "string" == typeof t) ||
  47291. ((i = t), (t = void 0));
  47292. var n = "undefined" == typeof i;
  47293. if ((n && (i = this.offset), !this.noAssert)) {
  47294. if ("number" != typeof i || i % 1 !== 0)
  47295. throw TypeError("Illegal offset: " + i + " (not an integer)");
  47296. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  47297. throw RangeError(
  47298. "Illegal offset: 0 <= " +
  47299. i +
  47300. " (+0) <= " +
  47301. this.buffer.byteLength
  47302. );
  47303. }
  47304. e instanceof o || (e = o.wrap(e, t));
  47305. var r = e.limit - e.offset;
  47306. if (r <= 0) return this;
  47307. var a = r - i;
  47308. if (a > 0) {
  47309. var s = new ArrayBuffer(this.buffer.byteLength + a),
  47310. l = new Uint8Array(s);
  47311. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  47312. (this.buffer = s),
  47313. (this.view = l),
  47314. (this.offset += a),
  47315. this.markedOffset >= 0 && (this.markedOffset += a),
  47316. (this.limit += a),
  47317. (i += a);
  47318. } else {
  47319. new Uint8Array(this.buffer);
  47320. }
  47321. return (
  47322. this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  47323. (e.offset = e.limit),
  47324. n && (this.offset -= r),
  47325. this
  47326. );
  47327. }),
  47328. (a.prependTo = function (e, t) {
  47329. return e.prepend(this, t), this;
  47330. }),
  47331. (a.printDebug = function (e) {
  47332. "function" != typeof e && (e = console.log.bind(console)),
  47333. e(
  47334. this.toString() +
  47335. "\n-------------------------------------------------------------------\n" +
  47336. this.toDebug(!0)
  47337. );
  47338. }),
  47339. (a.remaining = function () {
  47340. return this.limit - this.offset;
  47341. }),
  47342. (a.reset = function () {
  47343. return (
  47344. this.markedOffset >= 0
  47345. ? ((this.offset = this.markedOffset),
  47346. (this.markedOffset = -1))
  47347. : (this.offset = 0),
  47348. this
  47349. );
  47350. }),
  47351. (a.resize = function (e) {
  47352. if (!this.noAssert) {
  47353. if ("number" != typeof e || e % 1 !== 0)
  47354. throw TypeError(
  47355. "Illegal capacity: " + e + " (not an integer)"
  47356. );
  47357. if (((e |= 0), e < 0))
  47358. throw RangeError("Illegal capacity: 0 <= " + e);
  47359. }
  47360. if (this.buffer.byteLength < e) {
  47361. var t = new ArrayBuffer(e),
  47362. i = new Uint8Array(t);
  47363. i.set(this.view), (this.buffer = t), (this.view = i);
  47364. }
  47365. return this;
  47366. }),
  47367. (a.reverse = function (e, t) {
  47368. if (
  47369. ("undefined" == typeof e && (e = this.offset),
  47370. "undefined" == typeof t && (t = this.limit),
  47371. !this.noAssert)
  47372. ) {
  47373. if ("number" != typeof e || e % 1 !== 0)
  47374. throw TypeError("Illegal begin: Not an integer");
  47375. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47376. throw TypeError("Illegal end: Not an integer");
  47377. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47378. throw RangeError(
  47379. "Illegal range: 0 <= " +
  47380. e +
  47381. " <= " +
  47382. t +
  47383. " <= " +
  47384. this.buffer.byteLength
  47385. );
  47386. }
  47387. return e === t
  47388. ? this
  47389. : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  47390. this);
  47391. }),
  47392. (a.skip = function (e) {
  47393. if (!this.noAssert) {
  47394. if ("number" != typeof e || e % 1 !== 0)
  47395. throw TypeError("Illegal length: " + e + " (not an integer)");
  47396. e |= 0;
  47397. }
  47398. var t = this.offset + e;
  47399. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  47400. throw RangeError(
  47401. "Illegal length: 0 <= " +
  47402. this.offset +
  47403. " + " +
  47404. e +
  47405. " <= " +
  47406. this.buffer.byteLength
  47407. );
  47408. return (this.offset = t), this;
  47409. }),
  47410. (a.slice = function (e, t) {
  47411. if (
  47412. ("undefined" == typeof e && (e = this.offset),
  47413. "undefined" == typeof t && (t = this.limit),
  47414. !this.noAssert)
  47415. ) {
  47416. if ("number" != typeof e || e % 1 !== 0)
  47417. throw TypeError("Illegal begin: Not an integer");
  47418. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47419. throw TypeError("Illegal end: Not an integer");
  47420. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47421. throw RangeError(
  47422. "Illegal range: 0 <= " +
  47423. e +
  47424. " <= " +
  47425. t +
  47426. " <= " +
  47427. this.buffer.byteLength
  47428. );
  47429. }
  47430. var i = this.clone();
  47431. return (i.offset = e), (i.limit = t), i;
  47432. }),
  47433. (a.toBuffer = function (e) {
  47434. var t = this.offset,
  47435. i = this.limit;
  47436. if (!this.noAssert) {
  47437. if ("number" != typeof t || t % 1 !== 0)
  47438. throw TypeError("Illegal offset: Not an integer");
  47439. if (((t >>>= 0), "number" != typeof i || i % 1 !== 0))
  47440. throw TypeError("Illegal limit: Not an integer");
  47441. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  47442. throw RangeError(
  47443. "Illegal range: 0 <= " +
  47444. t +
  47445. " <= " +
  47446. i +
  47447. " <= " +
  47448. this.buffer.byteLength
  47449. );
  47450. }
  47451. if (!e && 0 === t && i === this.buffer.byteLength)
  47452. return this.buffer;
  47453. if (t === i) return s;
  47454. var n = new ArrayBuffer(i - t);
  47455. return (
  47456. new Uint8Array(n).set(
  47457. new Uint8Array(this.buffer).subarray(t, i),
  47458. 0
  47459. ),
  47460. n
  47461. );
  47462. }),
  47463. (a.toArrayBuffer = a.toBuffer),
  47464. (a.toString = function (e, t, i) {
  47465. if ("undefined" == typeof e)
  47466. return (
  47467. "ByteBufferAB(offset=" +
  47468. this.offset +
  47469. ",markedOffset=" +
  47470. this.markedOffset +
  47471. ",limit=" +
  47472. this.limit +
  47473. ",capacity=" +
  47474. this.capacity() +
  47475. ")"
  47476. );
  47477. switch (
  47478. ("number" == typeof e && ((e = "utf8"), (t = e), (i = t)), e)
  47479. ) {
  47480. case "utf8":
  47481. return this.toUTF8(t, i);
  47482. case "base64":
  47483. return this.toBase64(t, i);
  47484. case "hex":
  47485. return this.toHex(t, i);
  47486. case "binary":
  47487. return this.toBinary(t, i);
  47488. case "debug":
  47489. return this.toDebug();
  47490. case "columns":
  47491. return this.toColumns();
  47492. default:
  47493. throw Error("Unsupported encoding: " + e);
  47494. }
  47495. });
  47496. var c = (function () {
  47497. for (
  47498. var e = {},
  47499. t = [
  47500. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  47501. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100,
  47502. 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
  47503. 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50,
  47504. 51, 52, 53, 54, 55, 56, 57, 43, 47,
  47505. ],
  47506. i = [],
  47507. n = 0,
  47508. r = t.length;
  47509. n < r;
  47510. ++n
  47511. )
  47512. i[t[n]] = n;
  47513. return (
  47514. (e.encode = function (e, i) {
  47515. for (var n, r; null !== (n = e()); )
  47516. i(t[(n >> 2) & 63]),
  47517. (r = (3 & n) << 4),
  47518. null !== (n = e())
  47519. ? ((r |= (n >> 4) & 15),
  47520. i(t[63 & (r | ((n >> 4) & 15))]),
  47521. (r = (15 & n) << 2),
  47522. null !== (n = e())
  47523. ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n]))
  47524. : (i(t[63 & r]), i(61)))
  47525. : (i(t[63 & r]), i(61), i(61));
  47526. }),
  47527. (e.decode = function (e, t) {
  47528. function n(e) {
  47529. throw Error("Illegal character code: " + e);
  47530. }
  47531. for (var r, o, a; null !== (r = e()); )
  47532. if (
  47533. ((o = i[r]),
  47534. "undefined" == typeof o && n(r),
  47535. null !== (r = e()) &&
  47536. ((a = i[r]),
  47537. "undefined" == typeof a && n(r),
  47538. t(((o << 2) >>> 0) | ((48 & a) >> 4)),
  47539. null !== (r = e())))
  47540. ) {
  47541. if (((o = i[r]), "undefined" == typeof o)) {
  47542. if (61 === r) break;
  47543. n(r);
  47544. }
  47545. if (
  47546. (t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)),
  47547. null !== (r = e()))
  47548. ) {
  47549. if (((a = i[r]), "undefined" == typeof a)) {
  47550. if (61 === r) break;
  47551. n(r);
  47552. }
  47553. t((((3 & o) << 6) >>> 0) | a);
  47554. }
  47555. }
  47556. }),
  47557. (e.test = function (e) {
  47558. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(
  47559. e
  47560. );
  47561. }),
  47562. e
  47563. );
  47564. })();
  47565. (a.toBase64 = function (e, t) {
  47566. if (
  47567. ("undefined" == typeof e && (e = this.offset),
  47568. "undefined" == typeof t && (t = this.limit),
  47569. (e |= 0),
  47570. (t |= 0),
  47571. e < 0 || t > this.capacity || e > t)
  47572. )
  47573. throw RangeError("begin, end");
  47574. var n;
  47575. return (
  47576. c.encode(
  47577. function () {
  47578. return e < t ? this.view[e++] : null;
  47579. }.bind(this),
  47580. (n = i())
  47581. ),
  47582. n()
  47583. );
  47584. }),
  47585. (o.fromBase64 = function (e, i) {
  47586. if ("string" != typeof e) throw TypeError("str");
  47587. var n = new o((e.length / 4) * 3, i),
  47588. r = 0;
  47589. return (
  47590. c.decode(t(e), function (e) {
  47591. n.view[r++] = e;
  47592. }),
  47593. (n.limit = r),
  47594. n
  47595. );
  47596. }),
  47597. (o.btoa = function (e) {
  47598. return o.fromBinary(e).toBase64();
  47599. }),
  47600. (o.atob = function (e) {
  47601. return o.fromBase64(e).toBinary();
  47602. }),
  47603. (a.toBinary = function (e, t) {
  47604. if (
  47605. ("undefined" == typeof e && (e = this.offset),
  47606. "undefined" == typeof t && (t = this.limit),
  47607. (e |= 0),
  47608. (t |= 0),
  47609. e < 0 || t > this.capacity() || e > t)
  47610. )
  47611. throw RangeError("begin, end");
  47612. if (e === t) return "";
  47613. for (var i = [], n = []; e < t; )
  47614. i.push(this.view[e++]),
  47615. i.length >= 1024 &&
  47616. (n.push(String.fromCharCode.apply(String, i)), (i = []));
  47617. return n.join("") + String.fromCharCode.apply(String, i);
  47618. }),
  47619. (o.fromBinary = function (e, t) {
  47620. if ("string" != typeof e) throw TypeError("str");
  47621. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  47622. if (((i = e.charCodeAt(n)), i > 255))
  47623. throw RangeError("illegal char code: " + i);
  47624. a.view[n++] = i;
  47625. }
  47626. return (a.limit = r), a;
  47627. }),
  47628. (a.toDebug = function (e) {
  47629. for (
  47630. var t,
  47631. i = -1,
  47632. n = this.buffer.byteLength,
  47633. r = "",
  47634. o = "",
  47635. a = "";
  47636. i < n;
  47637. ) {
  47638. if (
  47639. (i !== -1 &&
  47640. ((t = this.view[i]),
  47641. (r +=
  47642. t < 16
  47643. ? "0" + t.toString(16).toUpperCase()
  47644. : t.toString(16).toUpperCase()),
  47645. e &&
  47646. (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  47647. ++i,
  47648. e && i > 0 && i % 16 === 0 && i !== n)
  47649. ) {
  47650. for (; r.length < 51; ) r += " ";
  47651. (a += r + o + "\n"), (r = o = "");
  47652. }
  47653. r +=
  47654. i === this.offset && i === this.limit
  47655. ? i === this.markedOffset
  47656. ? "!"
  47657. : "|"
  47658. : i === this.offset
  47659. ? i === this.markedOffset
  47660. ? "["
  47661. : "<"
  47662. : i === this.limit
  47663. ? i === this.markedOffset
  47664. ? "]"
  47665. : ">"
  47666. : i === this.markedOffset
  47667. ? "'"
  47668. : e || (0 !== i && i !== n)
  47669. ? " "
  47670. : "";
  47671. }
  47672. if (e && " " !== r) {
  47673. for (; r.length < 51; ) r += " ";
  47674. a += r + o + "\n";
  47675. }
  47676. return e ? a : r;
  47677. }),
  47678. (o.fromDebug = function (e, t, i) {
  47679. for (
  47680. var n,
  47681. r,
  47682. a = e.length,
  47683. s = new o(((a + 1) / 3) | 0, t, i),
  47684. l = 0,
  47685. c = 0,
  47686. h = !1,
  47687. u = !1,
  47688. d = !1,
  47689. p = !1,
  47690. f = !1;
  47691. l < a;
  47692. ) {
  47693. switch ((n = e.charAt(l++))) {
  47694. case "!":
  47695. if (!i) {
  47696. if (u || d || p) {
  47697. f = !0;
  47698. break;
  47699. }
  47700. u = d = p = !0;
  47701. }
  47702. (s.offset = s.markedOffset = s.limit = c), (h = !1);
  47703. break;
  47704. case "|":
  47705. if (!i) {
  47706. if (u || p) {
  47707. f = !0;
  47708. break;
  47709. }
  47710. u = p = !0;
  47711. }
  47712. (s.offset = s.limit = c), (h = !1);
  47713. break;
  47714. case "[":
  47715. if (!i) {
  47716. if (u || d) {
  47717. f = !0;
  47718. break;
  47719. }
  47720. u = d = !0;
  47721. }
  47722. (s.offset = s.markedOffset = c), (h = !1);
  47723. break;
  47724. case "<":
  47725. if (!i) {
  47726. if (u) {
  47727. f = !0;
  47728. break;
  47729. }
  47730. u = !0;
  47731. }
  47732. (s.offset = c), (h = !1);
  47733. break;
  47734. case "]":
  47735. if (!i) {
  47736. if (p || d) {
  47737. f = !0;
  47738. break;
  47739. }
  47740. p = d = !0;
  47741. }
  47742. (s.limit = s.markedOffset = c), (h = !1);
  47743. break;
  47744. case ">":
  47745. if (!i) {
  47746. if (p) {
  47747. f = !0;
  47748. break;
  47749. }
  47750. p = !0;
  47751. }
  47752. (s.limit = c), (h = !1);
  47753. break;
  47754. case "'":
  47755. if (!i) {
  47756. if (d) {
  47757. f = !0;
  47758. break;
  47759. }
  47760. d = !0;
  47761. }
  47762. (s.markedOffset = c), (h = !1);
  47763. break;
  47764. case " ":
  47765. h = !1;
  47766. break;
  47767. default:
  47768. if (!i && h) {
  47769. f = !0;
  47770. break;
  47771. }
  47772. if (
  47773. ((r = parseInt(n + e.charAt(l++), 16)),
  47774. !i && (isNaN(r) || r < 0 || r > 255))
  47775. )
  47776. throw TypeError(
  47777. "Illegal str: Not a debug encoded string"
  47778. );
  47779. (s.view[c++] = r), (h = !0);
  47780. }
  47781. if (f) throw TypeError("Illegal str: Invalid symbol at " + l);
  47782. }
  47783. if (!i) {
  47784. if (!u || !p)
  47785. throw TypeError("Illegal str: Missing offset or limit");
  47786. if (c < s.buffer.byteLength)
  47787. throw TypeError(
  47788. "Illegal str: Not a debug encoded string (is it hex?) " +
  47789. c +
  47790. " < " +
  47791. a
  47792. );
  47793. }
  47794. return s;
  47795. }),
  47796. (a.toHex = function (e, t) {
  47797. if (
  47798. ((e = "undefined" == typeof e ? this.offset : e),
  47799. (t = "undefined" == typeof t ? this.limit : t),
  47800. !this.noAssert)
  47801. ) {
  47802. if ("number" != typeof e || e % 1 !== 0)
  47803. throw TypeError("Illegal begin: Not an integer");
  47804. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47805. throw TypeError("Illegal end: Not an integer");
  47806. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47807. throw RangeError(
  47808. "Illegal range: 0 <= " +
  47809. e +
  47810. " <= " +
  47811. t +
  47812. " <= " +
  47813. this.buffer.byteLength
  47814. );
  47815. }
  47816. for (var i, n = new Array(t - e); e < t; )
  47817. (i = this.view[e++]),
  47818. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  47819. return n.join("");
  47820. }),
  47821. (o.fromHex = function (e, t, i) {
  47822. if (!i) {
  47823. if ("string" != typeof e)
  47824. throw TypeError("Illegal str: Not a string");
  47825. if (e.length % 2 !== 0)
  47826. throw TypeError("Illegal str: Length not a multiple of 2");
  47827. }
  47828. for (
  47829. var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0;
  47830. s < r;
  47831. s += 2
  47832. ) {
  47833. if (
  47834. ((n = parseInt(e.substring(s, s + 2), 16)),
  47835. !i && (!isFinite(n) || n < 0 || n > 255))
  47836. )
  47837. throw TypeError("Illegal str: Contains non-hex characters");
  47838. a.view[l++] = n;
  47839. }
  47840. return (a.limit = l), a;
  47841. });
  47842. var h = (function () {
  47843. var e = {};
  47844. return (
  47845. (e.MAX_CODEPOINT = 1114111),
  47846. (e.encodeUTF8 = function (e, t) {
  47847. var i = null;
  47848. for (
  47849. "number" == typeof e &&
  47850. ((i = e),
  47851. (e = function () {
  47852. return null;
  47853. }));
  47854. null !== i || null !== (i = e());
  47855. )
  47856. i < 128
  47857. ? t(127 & i)
  47858. : i < 2048
  47859. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  47860. : i < 65536
  47861. ? (t(((i >> 12) & 15) | 224),
  47862. t(((i >> 6) & 63) | 128),
  47863. t((63 & i) | 128))
  47864. : (t(((i >> 18) & 7) | 240),
  47865. t(((i >> 12) & 63) | 128),
  47866. t(((i >> 6) & 63) | 128),
  47867. t((63 & i) | 128)),
  47868. (i = null);
  47869. }),
  47870. (e.decodeUTF8 = function (e, t) {
  47871. for (
  47872. var i,
  47873. n,
  47874. r,
  47875. o,
  47876. a = function (e) {
  47877. e = e.slice(0, e.indexOf(null));
  47878. var t = Error(e.toString());
  47879. throw ((t.name = "TruncatedError"), (t.bytes = e), t);
  47880. };
  47881. null !== (i = e());
  47882. )
  47883. if (0 === (128 & i)) t(i);
  47884. else if (192 === (224 & i))
  47885. null === (n = e()) && a([i, n]),
  47886. t(((31 & i) << 6) | (63 & n));
  47887. else if (224 === (240 & i))
  47888. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  47889. t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r));
  47890. else {
  47891. if (240 !== (248 & i))
  47892. throw RangeError("Illegal starting byte: " + i);
  47893. (null === (n = e()) ||
  47894. null === (r = e()) ||
  47895. null === (o = e())) &&
  47896. a([i, n, r, o]),
  47897. t(
  47898. ((7 & i) << 18) |
  47899. ((63 & n) << 12) |
  47900. ((63 & r) << 6) |
  47901. (63 & o)
  47902. );
  47903. }
  47904. }),
  47905. (e.UTF16toUTF8 = function (e, t) {
  47906. for (var i, n = null; ; ) {
  47907. if (null === (i = null !== n ? n : e())) break;
  47908. i >= 55296 &&
  47909. i <= 57343 &&
  47910. null !== (n = e()) &&
  47911. n >= 56320 &&
  47912. n <= 57343
  47913. ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null))
  47914. : t(i);
  47915. }
  47916. null !== n && t(n);
  47917. }),
  47918. (e.UTF8toUTF16 = function (e, t) {
  47919. var i = null;
  47920. for (
  47921. "number" == typeof e &&
  47922. ((i = e),
  47923. (e = function () {
  47924. return null;
  47925. }));
  47926. null !== i || null !== (i = e());
  47927. )
  47928. i <= 65535
  47929. ? t(i)
  47930. : ((i -= 65536),
  47931. t((i >> 10) + 55296),
  47932. t((i % 1024) + 56320)),
  47933. (i = null);
  47934. }),
  47935. (e.encodeUTF16toUTF8 = function (t, i) {
  47936. e.UTF16toUTF8(t, function (t) {
  47937. e.encodeUTF8(t, i);
  47938. });
  47939. }),
  47940. (e.decodeUTF8toUTF16 = function (t, i) {
  47941. e.decodeUTF8(t, function (t) {
  47942. e.UTF8toUTF16(t, i);
  47943. });
  47944. }),
  47945. (e.calculateCodePoint = function (e) {
  47946. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
  47947. }),
  47948. (e.calculateUTF8 = function (e) {
  47949. for (var t, i = 0; null !== (t = e()); )
  47950. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  47951. return i;
  47952. }),
  47953. (e.calculateUTF16asUTF8 = function (t) {
  47954. var i = 0,
  47955. n = 0;
  47956. return (
  47957. e.UTF16toUTF8(t, function (e) {
  47958. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4);
  47959. }),
  47960. [i, n]
  47961. );
  47962. }),
  47963. e
  47964. );
  47965. })();
  47966. return (
  47967. (a.toUTF8 = function (e, t) {
  47968. if (
  47969. ("undefined" == typeof e && (e = this.offset),
  47970. "undefined" == typeof t && (t = this.limit),
  47971. !this.noAssert)
  47972. ) {
  47973. if ("number" != typeof e || e % 1 !== 0)
  47974. throw TypeError("Illegal begin: Not an integer");
  47975. if (((e >>>= 0), "number" != typeof t || t % 1 !== 0))
  47976. throw TypeError("Illegal end: Not an integer");
  47977. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  47978. throw RangeError(
  47979. "Illegal range: 0 <= " +
  47980. e +
  47981. " <= " +
  47982. t +
  47983. " <= " +
  47984. this.buffer.byteLength
  47985. );
  47986. }
  47987. var n;
  47988. try {
  47989. h.decodeUTF8toUTF16(
  47990. function () {
  47991. return e < t ? this.view[e++] : null;
  47992. }.bind(this),
  47993. (n = i())
  47994. );
  47995. } catch (i) {
  47996. if (e !== t)
  47997. throw RangeError(
  47998. "Illegal range: Truncated data, " + e + " != " + t
  47999. );
  48000. }
  48001. return n();
  48002. }),
  48003. (o.fromUTF8 = function (e, i, n) {
  48004. if (!n && "string" != typeof e)
  48005. throw TypeError("Illegal str: Not a string");
  48006. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  48007. a = 0;
  48008. return (
  48009. h.encodeUTF16toUTF8(t(e), function (e) {
  48010. r.view[a++] = e;
  48011. }),
  48012. (r.limit = a),
  48013. r
  48014. );
  48015. }),
  48016. o
  48017. );
  48018. });
  48019. },
  48020. {
  48021. long: 216,
  48022. },
  48023. ],
  48024. 216: [
  48025. function (e, t, i) {
  48026. !(function (i, n) {
  48027. "function" == typeof define && define.amd
  48028. ? define([], n)
  48029. : "function" == typeof e && "object" == typeof t && t && t.exports
  48030. ? (t.exports = n())
  48031. : ((i.dcodeIO = i.dcodeIO || {}).Long = n());
  48032. })(this, function () {
  48033. "use strict";
  48034. function e(e, t, i) {
  48035. (this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i);
  48036. }
  48037. function t(e) {
  48038. return (e && e.__isLong__) === !0;
  48039. }
  48040. function i(e, t) {
  48041. var i, n, o;
  48042. return t
  48043. ? ((e >>>= 0),
  48044. (o = 0 <= e && e < 256) && (n = l[e])
  48045. ? n
  48046. : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  48047. : ((e |= 0),
  48048. (o = -128 <= e && e < 128) && (n = s[e])
  48049. ? n
  48050. : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i));
  48051. }
  48052. function n(e, t) {
  48053. if (isNaN(e) || !isFinite(e)) return t ? m : g;
  48054. if (t) {
  48055. if (e < 0) return m;
  48056. if (e >= d) return I;
  48057. } else {
  48058. if (e <= -p) return E;
  48059. if (e + 1 >= p) return C;
  48060. }
  48061. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t);
  48062. }
  48063. function r(t, i, n) {
  48064. return new e(t, i, n);
  48065. }
  48066. function o(e, t, i) {
  48067. if (0 === e.length) throw Error("empty string");
  48068. if (
  48069. "NaN" === e ||
  48070. "Infinity" === e ||
  48071. "+Infinity" === e ||
  48072. "-Infinity" === e
  48073. )
  48074. return g;
  48075. if (
  48076. ("number" == typeof t ? ((i = t), (t = !1)) : (t = !!t),
  48077. (i = i || 10),
  48078. i < 2 || 36 < i)
  48079. )
  48080. throw RangeError("radix");
  48081. var r;
  48082. if ((r = e.indexOf("-")) > 0) throw Error("interior hyphen");
  48083. if (0 === r) return o(e.substring(1), t, i).neg();
  48084. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  48085. var h = Math.min(8, e.length - l),
  48086. u = parseInt(e.substring(l, l + h), i);
  48087. if (h < 8) {
  48088. var d = n(c(i, h));
  48089. s = s.mul(d).add(n(u));
  48090. } else (s = s.mul(a)), (s = s.add(n(u)));
  48091. }
  48092. return (s.unsigned = t), s;
  48093. }
  48094. function a(t) {
  48095. return t instanceof e
  48096. ? t
  48097. : "number" == typeof t
  48098. ? n(t)
  48099. : "string" == typeof t
  48100. ? o(t)
  48101. : r(t.low, t.high, t.unsigned);
  48102. }
  48103. e.prototype.__isLong__,
  48104. Object.defineProperty(e.prototype, "__isLong__", {
  48105. value: !0,
  48106. enumerable: !1,
  48107. configurable: !1,
  48108. }),
  48109. (e.isLong = t);
  48110. var s = {},
  48111. l = {};
  48112. (e.fromInt = i), (e.fromNumber = n), (e.fromBits = r);
  48113. var c = Math.pow;
  48114. (e.fromString = o), (e.fromValue = a);
  48115. var h = 1 << 24,
  48116. u = 4294967296,
  48117. d = 0x10000000000000000,
  48118. p = d / 2,
  48119. f = i(h),
  48120. g = i(0);
  48121. e.ZERO = g;
  48122. var m = i(0, !0);
  48123. e.UZERO = m;
  48124. var v = i(1);
  48125. e.ONE = v;
  48126. var A = i(1, !0);
  48127. e.UONE = A;
  48128. var y = i(-1);
  48129. e.NEG_ONE = y;
  48130. var C = r(-1, 2147483647, !1);
  48131. e.MAX_VALUE = C;
  48132. var I = r(-1, -1, !0);
  48133. e.MAX_UNSIGNED_VALUE = I;
  48134. var E = r(0, -2147483648, !1);
  48135. e.MIN_VALUE = E;
  48136. var b = e.prototype;
  48137. return (
  48138. (b.toInt = function () {
  48139. return this.unsigned ? this.low >>> 0 : this.low;
  48140. }),
  48141. (b.toNumber = function () {
  48142. return this.unsigned
  48143. ? (this.high >>> 0) * u + (this.low >>> 0)
  48144. : this.high * u + (this.low >>> 0);
  48145. }),
  48146. (b.toString = function (e) {
  48147. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError("radix");
  48148. if (this.isZero()) return "0";
  48149. if (this.isNegative()) {
  48150. if (this.eq(E)) {
  48151. var t = n(e),
  48152. i = this.div(t),
  48153. r = i.mul(t).sub(this);
  48154. return i.toString(e) + r.toInt().toString(e);
  48155. }
  48156. return "-" + this.neg().toString(e);
  48157. }
  48158. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  48159. var l = a.div(o),
  48160. h = a.sub(l.mul(o)).toInt() >>> 0,
  48161. u = h.toString(e);
  48162. if (((a = l), a.isZero())) return u + s;
  48163. for (; u.length < 6; ) u = "0" + u;
  48164. s = "" + u + s;
  48165. }
  48166. }),
  48167. (b.getHighBits = function () {
  48168. return this.high;
  48169. }),
  48170. (b.getHighBitsUnsigned = function () {
  48171. return this.high >>> 0;
  48172. }),
  48173. (b.getLowBits = function () {
  48174. return this.low;
  48175. }),
  48176. (b.getLowBitsUnsigned = function () {
  48177. return this.low >>> 0;
  48178. }),
  48179. (b.getNumBitsAbs = function () {
  48180. if (this.isNegative())
  48181. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  48182. for (
  48183. var e = 0 != this.high ? this.high : this.low, t = 31;
  48184. t > 0 && 0 == (e & (1 << t));
  48185. t--
  48186. );
  48187. return 0 != this.high ? t + 33 : t + 1;
  48188. }),
  48189. (b.isZero = function () {
  48190. return 0 === this.high && 0 === this.low;
  48191. }),
  48192. (b.isNegative = function () {
  48193. return !this.unsigned && this.high < 0;
  48194. }),
  48195. (b.isPositive = function () {
  48196. return this.unsigned || this.high >= 0;
  48197. }),
  48198. (b.isOdd = function () {
  48199. return 1 === (1 & this.low);
  48200. }),
  48201. (b.isEven = function () {
  48202. return 0 === (1 & this.low);
  48203. }),
  48204. (b.equals = function (e) {
  48205. return (
  48206. t(e) || (e = a(e)),
  48207. (this.unsigned === e.unsigned ||
  48208. this.high >>> 31 !== 1 ||
  48209. e.high >>> 31 !== 1) &&
  48210. this.high === e.high &&
  48211. this.low === e.low
  48212. );
  48213. }),
  48214. (b.eq = b.equals),
  48215. (b.notEquals = function (e) {
  48216. return !this.eq(e);
  48217. }),
  48218. (b.neq = b.notEquals),
  48219. (b.lessThan = function (e) {
  48220. return this.comp(e) < 0;
  48221. }),
  48222. (b.lt = b.lessThan),
  48223. (b.lessThanOrEqual = function (e) {
  48224. return this.comp(e) <= 0;
  48225. }),
  48226. (b.lte = b.lessThanOrEqual),
  48227. (b.greaterThan = function (e) {
  48228. return this.comp(e) > 0;
  48229. }),
  48230. (b.gt = b.greaterThan),
  48231. (b.greaterThanOrEqual = function (e) {
  48232. return this.comp(e) >= 0;
  48233. }),
  48234. (b.gte = b.greaterThanOrEqual),
  48235. (b.compare = function (e) {
  48236. if ((t(e) || (e = a(e)), this.eq(e))) return 0;
  48237. var i = this.isNegative(),
  48238. n = e.isNegative();
  48239. return i && !n
  48240. ? -1
  48241. : !i && n
  48242. ? 1
  48243. : this.unsigned
  48244. ? e.high >>> 0 > this.high >>> 0 ||
  48245. (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  48246. ? -1
  48247. : 1
  48248. : this.sub(e).isNegative()
  48249. ? -1
  48250. : 1;
  48251. }),
  48252. (b.comp = b.compare),
  48253. (b.negate = function () {
  48254. return !this.unsigned && this.eq(E) ? E : this.not().add(v);
  48255. }),
  48256. (b.neg = b.negate),
  48257. (b.add = function (e) {
  48258. t(e) || (e = a(e));
  48259. var i = this.high >>> 16,
  48260. n = 65535 & this.high,
  48261. o = this.low >>> 16,
  48262. s = 65535 & this.low,
  48263. l = e.high >>> 16,
  48264. c = 65535 & e.high,
  48265. h = e.low >>> 16,
  48266. u = 65535 & e.low,
  48267. d = 0,
  48268. p = 0,
  48269. f = 0,
  48270. g = 0;
  48271. return (
  48272. (g += s + u),
  48273. (f += g >>> 16),
  48274. (g &= 65535),
  48275. (f += o + h),
  48276. (p += f >>> 16),
  48277. (f &= 65535),
  48278. (p += n + c),
  48279. (d += p >>> 16),
  48280. (p &= 65535),
  48281. (d += i + l),
  48282. (d &= 65535),
  48283. r((f << 16) | g, (d << 16) | p, this.unsigned)
  48284. );
  48285. }),
  48286. (b.subtract = function (e) {
  48287. return t(e) || (e = a(e)), this.add(e.neg());
  48288. }),
  48289. (b.sub = b.subtract),
  48290. (b.multiply = function (e) {
  48291. if (this.isZero()) return g;
  48292. if ((t(e) || (e = a(e)), e.isZero())) return g;
  48293. if (this.eq(E)) return e.isOdd() ? E : g;
  48294. if (e.eq(E)) return this.isOdd() ? E : g;
  48295. if (this.isNegative())
  48296. return e.isNegative()
  48297. ? this.neg().mul(e.neg())
  48298. : this.neg().mul(e).neg();
  48299. if (e.isNegative()) return this.mul(e.neg()).neg();
  48300. if (this.lt(f) && e.lt(f))
  48301. return n(this.toNumber() * e.toNumber(), this.unsigned);
  48302. var i = this.high >>> 16,
  48303. o = 65535 & this.high,
  48304. s = this.low >>> 16,
  48305. l = 65535 & this.low,
  48306. c = e.high >>> 16,
  48307. h = 65535 & e.high,
  48308. u = e.low >>> 16,
  48309. d = 65535 & e.low,
  48310. p = 0,
  48311. m = 0,
  48312. v = 0,
  48313. A = 0;
  48314. return (
  48315. (A += l * d),
  48316. (v += A >>> 16),
  48317. (A &= 65535),
  48318. (v += s * d),
  48319. (m += v >>> 16),
  48320. (v &= 65535),
  48321. (v += l * u),
  48322. (m += v >>> 16),
  48323. (v &= 65535),
  48324. (m += o * d),
  48325. (p += m >>> 16),
  48326. (m &= 65535),
  48327. (m += s * u),
  48328. (p += m >>> 16),
  48329. (m &= 65535),
  48330. (m += l * h),
  48331. (p += m >>> 16),
  48332. (m &= 65535),
  48333. (p += i * d + o * u + s * h + l * c),
  48334. (p &= 65535),
  48335. r((v << 16) | A, (p << 16) | m, this.unsigned)
  48336. );
  48337. }),
  48338. (b.mul = b.multiply),
  48339. (b.divide = function (e) {
  48340. if ((t(e) || (e = a(e)), e.isZero()))
  48341. throw Error("division by zero");
  48342. if (this.isZero()) return this.unsigned ? m : g;
  48343. var i, r, o;
  48344. if (this.unsigned) {
  48345. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m;
  48346. if (e.gt(this.shru(1))) return A;
  48347. o = m;
  48348. } else {
  48349. if (this.eq(E)) {
  48350. if (e.eq(v) || e.eq(y)) return E;
  48351. if (e.eq(E)) return v;
  48352. var s = this.shr(1);
  48353. return (
  48354. (i = s.div(e).shl(1)),
  48355. i.eq(g)
  48356. ? e.isNegative()
  48357. ? v
  48358. : y
  48359. : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  48360. );
  48361. }
  48362. if (e.eq(E)) return this.unsigned ? m : g;
  48363. if (this.isNegative())
  48364. return e.isNegative()
  48365. ? this.neg().div(e.neg())
  48366. : this.neg().div(e).neg();
  48367. if (e.isNegative()) return this.div(e.neg()).neg();
  48368. o = g;
  48369. }
  48370. for (r = this; r.gte(e); ) {
  48371. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  48372. for (
  48373. var l = Math.ceil(Math.log(i) / Math.LN2),
  48374. h = l <= 48 ? 1 : c(2, l - 48),
  48375. u = n(i),
  48376. d = u.mul(e);
  48377. d.isNegative() || d.gt(r);
  48378. )
  48379. (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e));
  48380. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d));
  48381. }
  48382. return o;
  48383. }),
  48384. (b.div = b.divide),
  48385. (b.modulo = function (e) {
  48386. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e));
  48387. }),
  48388. (b.mod = b.modulo),
  48389. (b.not = function () {
  48390. return r(~this.low, ~this.high, this.unsigned);
  48391. }),
  48392. (b.and = function (e) {
  48393. return (
  48394. t(e) || (e = a(e)),
  48395. r(this.low & e.low, this.high & e.high, this.unsigned)
  48396. );
  48397. }),
  48398. (b.or = function (e) {
  48399. return (
  48400. t(e) || (e = a(e)),
  48401. r(this.low | e.low, this.high | e.high, this.unsigned)
  48402. );
  48403. }),
  48404. (b.xor = function (e) {
  48405. return (
  48406. t(e) || (e = a(e)),
  48407. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  48408. );
  48409. }),
  48410. (b.shiftLeft = function (e) {
  48411. return (
  48412. t(e) && (e = e.toInt()),
  48413. 0 === (e &= 63)
  48414. ? this
  48415. : e < 32
  48416. ? r(
  48417. this.low << e,
  48418. (this.high << e) | (this.low >>> (32 - e)),
  48419. this.unsigned
  48420. )
  48421. : r(0, this.low << (e - 32), this.unsigned)
  48422. );
  48423. }),
  48424. (b.shl = b.shiftLeft),
  48425. (b.shiftRight = function (e) {
  48426. return (
  48427. t(e) && (e = e.toInt()),
  48428. 0 === (e &= 63)
  48429. ? this
  48430. : e < 32
  48431. ? r(
  48432. (this.low >>> e) | (this.high << (32 - e)),
  48433. this.high >> e,
  48434. this.unsigned
  48435. )
  48436. : r(
  48437. this.high >> (e - 32),
  48438. this.high >= 0 ? 0 : -1,
  48439. this.unsigned
  48440. )
  48441. );
  48442. }),
  48443. (b.shr = b.shiftRight),
  48444. (b.shiftRightUnsigned = function (e) {
  48445. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this;
  48446. var i = this.high;
  48447. if (e < 32) {
  48448. var n = this.low;
  48449. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned);
  48450. }
  48451. return 32 === e
  48452. ? r(i, 0, this.unsigned)
  48453. : r(i >>> (e - 32), 0, this.unsigned);
  48454. }),
  48455. (b.shru = b.shiftRightUnsigned),
  48456. (b.toSigned = function () {
  48457. return this.unsigned ? r(this.low, this.high, !1) : this;
  48458. }),
  48459. (b.toUnsigned = function () {
  48460. return this.unsigned ? this : r(this.low, this.high, !0);
  48461. }),
  48462. (b.toBytes = function (e) {
  48463. return e ? this.toBytesLE() : this.toBytesBE();
  48464. }),
  48465. (b.toBytesLE = function () {
  48466. var e = this.high,
  48467. t = this.low;
  48468. return [
  48469. 255 & t,
  48470. (t >>> 8) & 255,
  48471. (t >>> 16) & 255,
  48472. (t >>> 24) & 255,
  48473. 255 & e,
  48474. (e >>> 8) & 255,
  48475. (e >>> 16) & 255,
  48476. (e >>> 24) & 255,
  48477. ];
  48478. }),
  48479. (b.toBytesBE = function () {
  48480. var e = this.high,
  48481. t = this.low;
  48482. return [
  48483. (e >>> 24) & 255,
  48484. (e >>> 16) & 255,
  48485. (e >>> 8) & 255,
  48486. 255 & e,
  48487. (t >>> 24) & 255,
  48488. (t >>> 16) & 255,
  48489. (t >>> 8) & 255,
  48490. 255 & t,
  48491. ];
  48492. }),
  48493. e
  48494. );
  48495. });
  48496. },
  48497. {},
  48498. ],
  48499. 217: [
  48500. function (e, t, i) {
  48501. var n = {
  48502. REVISION: "75",
  48503. };
  48504. "function" == typeof define && define.amd
  48505. ? define("three", n)
  48506. : "undefined" != typeof i &&
  48507. "undefined" != typeof t &&
  48508. (t.exports = n),
  48509. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  48510. void 0 === Math.sign &&
  48511. (Math.sign = function (e) {
  48512. return e < 0 ? -1 : e > 0 ? 1 : +e;
  48513. }),
  48514. void 0 === Function.prototype.name &&
  48515. void 0 !== Object.defineProperty &&
  48516. Object.defineProperty(Function.prototype, "name", {
  48517. get: function () {
  48518. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
  48519. },
  48520. }),
  48521. void 0 === Object.assign &&
  48522. Object.defineProperty(Object, "assign", {
  48523. writable: !0,
  48524. configurable: !0,
  48525. value: function (e) {
  48526. "use strict";
  48527. if (void 0 === e || null === e)
  48528. throw new TypeError(
  48529. "Cannot convert first argument to object"
  48530. );
  48531. for (
  48532. var t = Object(e), i = 1, n = arguments.length;
  48533. i !== n;
  48534. ++i
  48535. ) {
  48536. var r = arguments[i];
  48537. if (void 0 !== r && null !== r) {
  48538. r = Object(r);
  48539. for (
  48540. var o = Object.keys(r), a = 0, s = o.length;
  48541. a !== s;
  48542. ++a
  48543. ) {
  48544. var l = o[a],
  48545. c = Object.getOwnPropertyDescriptor(r, l);
  48546. void 0 !== c && c.enumerable && (t[l] = r[l]);
  48547. }
  48548. }
  48549. }
  48550. return t;
  48551. },
  48552. }),
  48553. (n.MOUSE = {
  48554. LEFT: 0,
  48555. MIDDLE: 1,
  48556. RIGHT: 2,
  48557. }),
  48558. (n.CullFaceNone = 0),
  48559. (n.CullFaceBack = 1),
  48560. (n.CullFaceFront = 2),
  48561. (n.CullFaceFrontBack = 3),
  48562. (n.FrontFaceDirectionCW = 0),
  48563. (n.FrontFaceDirectionCCW = 1),
  48564. (n.BasicShadowMap = 0),
  48565. (n.PCFShadowMap = 1),
  48566. (n.PCFSoftShadowMap = 2),
  48567. (n.FrontSide = 0),
  48568. (n.BackSide = 1),
  48569. (n.DoubleSide = 2),
  48570. (n.FlatShading = 1),
  48571. (n.SmoothShading = 2),
  48572. (n.NoColors = 0),
  48573. (n.FaceColors = 1),
  48574. (n.VertexColors = 2),
  48575. (n.NoBlending = 0),
  48576. (n.NormalBlending = 1),
  48577. (n.AdditiveBlending = 2),
  48578. (n.SubtractiveBlending = 3),
  48579. (n.MultiplyBlending = 4),
  48580. (n.CustomBlending = 5),
  48581. (n.AddEquation = 100),
  48582. (n.SubtractEquation = 101),
  48583. (n.ReverseSubtractEquation = 102),
  48584. (n.MinEquation = 103),
  48585. (n.MaxEquation = 104),
  48586. (n.ZeroFactor = 200),
  48587. (n.OneFactor = 201),
  48588. (n.SrcColorFactor = 202),
  48589. (n.OneMinusSrcColorFactor = 203),
  48590. (n.SrcAlphaFactor = 204),
  48591. (n.OneMinusSrcAlphaFactor = 205),
  48592. (n.DstAlphaFactor = 206),
  48593. (n.OneMinusDstAlphaFactor = 207),
  48594. (n.DstColorFactor = 208),
  48595. (n.OneMinusDstColorFactor = 209),
  48596. (n.SrcAlphaSaturateFactor = 210),
  48597. (n.NeverDepth = 0),
  48598. (n.AlwaysDepth = 1),
  48599. (n.LessDepth = 2),
  48600. (n.LessEqualDepth = 3),
  48601. (n.EqualDepth = 4),
  48602. (n.GreaterEqualDepth = 5),
  48603. (n.GreaterDepth = 6),
  48604. (n.NotEqualDepth = 7),
  48605. (n.MultiplyOperation = 0),
  48606. (n.MixOperation = 1),
  48607. (n.AddOperation = 2),
  48608. (n.NoToneMapping = 0),
  48609. (n.LinearToneMapping = 1),
  48610. (n.ReinhardToneMapping = 2),
  48611. (n.Uncharted2ToneMapping = 3),
  48612. (n.CineonToneMapping = 4),
  48613. (n.UVMapping = 300),
  48614. (n.CubeReflectionMapping = 301),
  48615. (n.CubeRefractionMapping = 302),
  48616. (n.EquirectangularReflectionMapping = 303),
  48617. (n.EquirectangularRefractionMapping = 304),
  48618. (n.SphericalReflectionMapping = 305),
  48619. (n.CubeUVReflectionMapping = 306),
  48620. (n.CubeUVRefractionMapping = 307),
  48621. (n.RepeatWrapping = 1e3),
  48622. (n.ClampToEdgeWrapping = 1001),
  48623. (n.MirroredRepeatWrapping = 1002),
  48624. (n.NearestFilter = 1003),
  48625. (n.NearestMipMapNearestFilter = 1004),
  48626. (n.NearestMipMapLinearFilter = 1005),
  48627. (n.LinearFilter = 1006),
  48628. (n.LinearMipMapNearestFilter = 1007),
  48629. (n.LinearMipMapLinearFilter = 1008),
  48630. (n.UnsignedByteType = 1009),
  48631. (n.ByteType = 1010),
  48632. (n.ShortType = 1011),
  48633. (n.UnsignedShortType = 1012),
  48634. (n.IntType = 1013),
  48635. (n.UnsignedIntType = 1014),
  48636. (n.FloatType = 1015),
  48637. (n.HalfFloatType = 1025),
  48638. (n.UnsignedShort4444Type = 1016),
  48639. (n.UnsignedShort5551Type = 1017),
  48640. (n.UnsignedShort565Type = 1018),
  48641. (n.AlphaFormat = 1019),
  48642. (n.RGBFormat = 1020),
  48643. (n.RGBAFormat = 1021),
  48644. (n.LuminanceFormat = 1022),
  48645. (n.LuminanceAlphaFormat = 1023),
  48646. (n.RGBEFormat = n.RGBAFormat),
  48647. (n.RGB_S3TC_DXT1_Format = 2001),
  48648. (n.RGBA_S3TC_DXT1_Format = 2002),
  48649. (n.RGBA_S3TC_DXT3_Format = 2003),
  48650. (n.RGBA_S3TC_DXT5_Format = 2004),
  48651. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  48652. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  48653. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  48654. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  48655. (n.RGB_ETC1_Format = 2151),
  48656. (n.LoopOnce = 2200),
  48657. (n.LoopRepeat = 2201),
  48658. (n.LoopPingPong = 2202),
  48659. (n.InterpolateDiscrete = 2300),
  48660. (n.InterpolateLinear = 2301),
  48661. (n.InterpolateSmooth = 2302),
  48662. (n.ZeroCurvatureEnding = 2400),
  48663. (n.ZeroSlopeEnding = 2401),
  48664. (n.WrapAroundEnding = 2402),
  48665. (n.TrianglesDrawMode = 0),
  48666. (n.TriangleStripDrawMode = 1),
  48667. (n.TriangleFanDrawMode = 2),
  48668. (n.LinearEncoding = 3e3),
  48669. (n.sRGBEncoding = 3001),
  48670. (n.GammaEncoding = 3007),
  48671. (n.RGBEEncoding = 3002),
  48672. (n.LogLuvEncoding = 3003),
  48673. (n.RGBM7Encoding = 3004),
  48674. (n.RGBM16Encoding = 3005),
  48675. (n.RGBDEncoding = 3006),
  48676. (n.Color = function (e) {
  48677. return 3 === arguments.length
  48678. ? this.fromArray(arguments)
  48679. : this.set(e);
  48680. }),
  48681. (n.Color.prototype = {
  48682. constructor: n.Color,
  48683. r: 1,
  48684. g: 1,
  48685. b: 1,
  48686. set: function (e) {
  48687. return (
  48688. e instanceof n.Color
  48689. ? this.copy(e)
  48690. : "number" == typeof e
  48691. ? this.setHex(e)
  48692. : "string" == typeof e && this.setStyle(e),
  48693. this
  48694. );
  48695. },
  48696. setScalar: function (e) {
  48697. (this.r = e), (this.g = e), (this.b = e);
  48698. },
  48699. setHex: function (e) {
  48700. return (
  48701. (e = Math.floor(e)),
  48702. (this.r = ((e >> 16) & 255) / 255),
  48703. (this.g = ((e >> 8) & 255) / 255),
  48704. (this.b = (255 & e) / 255),
  48705. this
  48706. );
  48707. },
  48708. setRGB: function (e, t, i) {
  48709. return (this.r = e), (this.g = t), (this.b = i), this;
  48710. },
  48711. setHSL: (function () {
  48712. function e(e, t, i) {
  48713. return (
  48714. i < 0 && (i += 1),
  48715. i > 1 && (i -= 1),
  48716. i < 1 / 6
  48717. ? e + 6 * (t - e) * i
  48718. : i < 0.5
  48719. ? t
  48720. : i < 2 / 3
  48721. ? e + 6 * (t - e) * (2 / 3 - i)
  48722. : e
  48723. );
  48724. }
  48725. return function (t, i, r) {
  48726. if (
  48727. ((t = n.Math.euclideanModulo(t, 1)),
  48728. (i = n.Math.clamp(i, 0, 1)),
  48729. (r = n.Math.clamp(r, 0, 1)),
  48730. 0 === i)
  48731. )
  48732. this.r = this.g = this.b = r;
  48733. else {
  48734. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  48735. a = 2 * r - o;
  48736. (this.r = e(a, o, t + 1 / 3)),
  48737. (this.g = e(a, o, t)),
  48738. (this.b = e(a, o, t - 1 / 3));
  48739. }
  48740. return this;
  48741. };
  48742. })(),
  48743. setStyle: function (e) {
  48744. function t(t) {
  48745. void 0 !== t &&
  48746. parseFloat(t) < 1 &&
  48747. console.warn(
  48748. "THREE.Color: Alpha component of " + e + " will be ignored."
  48749. );
  48750. }
  48751. var i;
  48752. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  48753. var r,
  48754. o = i[1],
  48755. a = i[2];
  48756. switch (o) {
  48757. case "rgb":
  48758. case "rgba":
  48759. if (
  48760. (r =
  48761. /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  48762. a
  48763. ))
  48764. )
  48765. return (
  48766. (this.r = Math.min(255, parseInt(r[1], 10)) / 255),
  48767. (this.g = Math.min(255, parseInt(r[2], 10)) / 255),
  48768. (this.b = Math.min(255, parseInt(r[3], 10)) / 255),
  48769. t(r[5]),
  48770. this
  48771. );
  48772. if (
  48773. (r =
  48774. /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  48775. a
  48776. ))
  48777. )
  48778. return (
  48779. (this.r = Math.min(100, parseInt(r[1], 10)) / 100),
  48780. (this.g = Math.min(100, parseInt(r[2], 10)) / 100),
  48781. (this.b = Math.min(100, parseInt(r[3], 10)) / 100),
  48782. t(r[5]),
  48783. this
  48784. );
  48785. break;
  48786. case "hsl":
  48787. case "hsla":
  48788. if (
  48789. (r =
  48790. /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  48791. a
  48792. ))
  48793. ) {
  48794. var s = parseFloat(r[1]) / 360,
  48795. l = parseInt(r[2], 10) / 100,
  48796. c = parseInt(r[3], 10) / 100;
  48797. return t(r[5]), this.setHSL(s, l, c);
  48798. }
  48799. }
  48800. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  48801. var h = i[1],
  48802. u = h.length;
  48803. if (3 === u)
  48804. return (
  48805. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255),
  48806. (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255),
  48807. (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255),
  48808. this
  48809. );
  48810. if (6 === u)
  48811. return (
  48812. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255),
  48813. (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255),
  48814. (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255),
  48815. this
  48816. );
  48817. }
  48818. if (e && e.length > 0) {
  48819. var h = n.ColorKeywords[e];
  48820. void 0 !== h
  48821. ? this.setHex(h)
  48822. : console.warn("THREE.Color: Unknown color " + e);
  48823. }
  48824. return this;
  48825. },
  48826. clone: function () {
  48827. return new this.constructor(this.r, this.g, this.b);
  48828. },
  48829. copy: function (e) {
  48830. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this;
  48831. },
  48832. copyGammaToLinear: function (e, t) {
  48833. return (
  48834. void 0 === t && (t = 2),
  48835. (this.r = Math.pow(e.r, t)),
  48836. (this.g = Math.pow(e.g, t)),
  48837. (this.b = Math.pow(e.b, t)),
  48838. this
  48839. );
  48840. },
  48841. copyLinearToGamma: function (e, t) {
  48842. void 0 === t && (t = 2);
  48843. var i = t > 0 ? 1 / t : 1;
  48844. return (
  48845. (this.r = Math.pow(e.r, i)),
  48846. (this.g = Math.pow(e.g, i)),
  48847. (this.b = Math.pow(e.b, i)),
  48848. this
  48849. );
  48850. },
  48851. convertGammaToLinear: function () {
  48852. var e = this.r,
  48853. t = this.g,
  48854. i = this.b;
  48855. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this;
  48856. },
  48857. convertLinearToGamma: function () {
  48858. return (
  48859. (this.r = Math.sqrt(this.r)),
  48860. (this.g = Math.sqrt(this.g)),
  48861. (this.b = Math.sqrt(this.b)),
  48862. this
  48863. );
  48864. },
  48865. getHex: function () {
  48866. return (
  48867. ((255 * this.r) << 16) ^
  48868. ((255 * this.g) << 8) ^
  48869. ((255 * this.b) << 0)
  48870. );
  48871. },
  48872. getHexString: function () {
  48873. return ("000000" + this.getHex().toString(16)).slice(-6);
  48874. },
  48875. getHSL: function (e) {
  48876. var t,
  48877. i,
  48878. n = e || {
  48879. h: 0,
  48880. s: 0,
  48881. l: 0,
  48882. },
  48883. r = this.r,
  48884. o = this.g,
  48885. a = this.b,
  48886. s = Math.max(r, o, a),
  48887. l = Math.min(r, o, a),
  48888. c = (l + s) / 2;
  48889. if (l === s) (t = 0), (i = 0);
  48890. else {
  48891. var h = s - l;
  48892. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  48893. case r:
  48894. t = (o - a) / h + (o < a ? 6 : 0);
  48895. break;
  48896. case o:
  48897. t = (a - r) / h + 2;
  48898. break;
  48899. case a:
  48900. t = (r - o) / h + 4;
  48901. }
  48902. t /= 6;
  48903. }
  48904. return (n.h = t), (n.s = i), (n.l = c), n;
  48905. },
  48906. getStyle: function () {
  48907. return (
  48908. "rgb(" +
  48909. ((255 * this.r) | 0) +
  48910. "," +
  48911. ((255 * this.g) | 0) +
  48912. "," +
  48913. ((255 * this.b) | 0) +
  48914. ")"
  48915. );
  48916. },
  48917. offsetHSL: function (e, t, i) {
  48918. var n = this.getHSL();
  48919. return (
  48920. (n.h += e),
  48921. (n.s += t),
  48922. (n.l += i),
  48923. this.setHSL(n.h, n.s, n.l),
  48924. this
  48925. );
  48926. },
  48927. add: function (e) {
  48928. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this;
  48929. },
  48930. addColors: function (e, t) {
  48931. return (
  48932. (this.r = e.r + t.r),
  48933. (this.g = e.g + t.g),
  48934. (this.b = e.b + t.b),
  48935. this
  48936. );
  48937. },
  48938. addScalar: function (e) {
  48939. return (this.r += e), (this.g += e), (this.b += e), this;
  48940. },
  48941. multiply: function (e) {
  48942. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this;
  48943. },
  48944. multiplyScalar: function (e) {
  48945. return (this.r *= e), (this.g *= e), (this.b *= e), this;
  48946. },
  48947. lerp: function (e, t) {
  48948. return (
  48949. (this.r += (e.r - this.r) * t),
  48950. (this.g += (e.g - this.g) * t),
  48951. (this.b += (e.b - this.b) * t),
  48952. this
  48953. );
  48954. },
  48955. equals: function (e) {
  48956. return e.r === this.r && e.g === this.g && e.b === this.b;
  48957. },
  48958. fromArray: function (e, t) {
  48959. return (
  48960. void 0 === t && (t = 0),
  48961. (this.r = e[t]),
  48962. (this.g = e[t + 1]),
  48963. (this.b = e[t + 2]),
  48964. this
  48965. );
  48966. },
  48967. toArray: function (e, t) {
  48968. return (
  48969. void 0 === e && (e = []),
  48970. void 0 === t && (t = 0),
  48971. (e[t] = this.r),
  48972. (e[t + 1] = this.g),
  48973. (e[t + 2] = this.b),
  48974. e
  48975. );
  48976. },
  48977. }),
  48978. (n.ColorKeywords = {
  48979. aliceblue: 15792383,
  48980. antiquewhite: 16444375,
  48981. aqua: 65535,
  48982. aquamarine: 8388564,
  48983. azure: 15794175,
  48984. beige: 16119260,
  48985. bisque: 16770244,
  48986. black: 0,
  48987. blanchedalmond: 16772045,
  48988. blue: 255,
  48989. blueviolet: 9055202,
  48990. brown: 10824234,
  48991. burlywood: 14596231,
  48992. cadetblue: 6266528,
  48993. chartreuse: 8388352,
  48994. chocolate: 13789470,
  48995. coral: 16744272,
  48996. cornflowerblue: 6591981,
  48997. cornsilk: 16775388,
  48998. crimson: 14423100,
  48999. cyan: 65535,
  49000. darkblue: 139,
  49001. darkcyan: 35723,
  49002. darkgoldenrod: 12092939,
  49003. darkgray: 11119017,
  49004. darkgreen: 25600,
  49005. darkgrey: 11119017,
  49006. darkkhaki: 12433259,
  49007. darkmagenta: 9109643,
  49008. darkolivegreen: 5597999,
  49009. darkorange: 16747520,
  49010. darkorchid: 10040012,
  49011. darkred: 9109504,
  49012. darksalmon: 15308410,
  49013. darkseagreen: 9419919,
  49014. darkslateblue: 4734347,
  49015. darkslategray: 3100495,
  49016. darkslategrey: 3100495,
  49017. darkturquoise: 52945,
  49018. darkviolet: 9699539,
  49019. deeppink: 16716947,
  49020. deepskyblue: 49151,
  49021. dimgray: 6908265,
  49022. dimgrey: 6908265,
  49023. dodgerblue: 2003199,
  49024. firebrick: 11674146,
  49025. floralwhite: 16775920,
  49026. forestgreen: 2263842,
  49027. fuchsia: 16711935,
  49028. gainsboro: 14474460,
  49029. ghostwhite: 16316671,
  49030. gold: 16766720,
  49031. goldenrod: 14329120,
  49032. gray: 8421504,
  49033. green: 32768,
  49034. greenyellow: 11403055,
  49035. grey: 8421504,
  49036. honeydew: 15794160,
  49037. hotpink: 16738740,
  49038. indianred: 13458524,
  49039. indigo: 4915330,
  49040. ivory: 16777200,
  49041. khaki: 15787660,
  49042. lavender: 15132410,
  49043. lavenderblush: 16773365,
  49044. lawngreen: 8190976,
  49045. lemonchiffon: 16775885,
  49046. lightblue: 11393254,
  49047. lightcoral: 15761536,
  49048. lightcyan: 14745599,
  49049. lightgoldenrodyellow: 16448210,
  49050. lightgray: 13882323,
  49051. lightgreen: 9498256,
  49052. lightgrey: 13882323,
  49053. lightpink: 16758465,
  49054. lightsalmon: 16752762,
  49055. lightseagreen: 2142890,
  49056. lightskyblue: 8900346,
  49057. lightslategray: 7833753,
  49058. lightslategrey: 7833753,
  49059. lightsteelblue: 11584734,
  49060. lightyellow: 16777184,
  49061. lime: 65280,
  49062. limegreen: 3329330,
  49063. linen: 16445670,
  49064. magenta: 16711935,
  49065. maroon: 8388608,
  49066. mediumaquamarine: 6737322,
  49067. mediumblue: 205,
  49068. mediumorchid: 12211667,
  49069. mediumpurple: 9662683,
  49070. mediumseagreen: 3978097,
  49071. mediumslateblue: 8087790,
  49072. mediumspringgreen: 64154,
  49073. mediumturquoise: 4772300,
  49074. mediumvioletred: 13047173,
  49075. midnightblue: 1644912,
  49076. mintcream: 16121850,
  49077. mistyrose: 16770273,
  49078. moccasin: 16770229,
  49079. navajowhite: 16768685,
  49080. navy: 128,
  49081. oldlace: 16643558,
  49082. olive: 8421376,
  49083. olivedrab: 7048739,
  49084. orange: 16753920,
  49085. orangered: 16729344,
  49086. orchid: 14315734,
  49087. palegoldenrod: 15657130,
  49088. palegreen: 10025880,
  49089. paleturquoise: 11529966,
  49090. palevioletred: 14381203,
  49091. papayawhip: 16773077,
  49092. peachpuff: 16767673,
  49093. peru: 13468991,
  49094. pink: 16761035,
  49095. plum: 14524637,
  49096. powderblue: 11591910,
  49097. purple: 8388736,
  49098. red: 16711680,
  49099. rosybrown: 12357519,
  49100. royalblue: 4286945,
  49101. saddlebrown: 9127187,
  49102. salmon: 16416882,
  49103. sandybrown: 16032864,
  49104. seagreen: 3050327,
  49105. seashell: 16774638,
  49106. sienna: 10506797,
  49107. silver: 12632256,
  49108. skyblue: 8900331,
  49109. slateblue: 6970061,
  49110. slategray: 7372944,
  49111. slategrey: 7372944,
  49112. snow: 16775930,
  49113. springgreen: 65407,
  49114. steelblue: 4620980,
  49115. tan: 13808780,
  49116. teal: 32896,
  49117. thistle: 14204888,
  49118. tomato: 16737095,
  49119. turquoise: 4251856,
  49120. violet: 15631086,
  49121. wheat: 16113331,
  49122. white: 16777215,
  49123. whitesmoke: 16119285,
  49124. yellow: 16776960,
  49125. yellowgreen: 10145074,
  49126. }),
  49127. (n.Quaternion = function (e, t, i, n) {
  49128. (this._x = e || 0),
  49129. (this._y = t || 0),
  49130. (this._z = i || 0),
  49131. (this._w = void 0 !== n ? n : 1);
  49132. }),
  49133. (n.Quaternion.prototype = {
  49134. constructor: n.Quaternion,
  49135. get x() {
  49136. return this._x;
  49137. },
  49138. set x(e) {
  49139. (this._x = e), this.onChangeCallback();
  49140. },
  49141. get y() {
  49142. return this._y;
  49143. },
  49144. set y(e) {
  49145. (this._y = e), this.onChangeCallback();
  49146. },
  49147. get z() {
  49148. return this._z;
  49149. },
  49150. set z(e) {
  49151. (this._z = e), this.onChangeCallback();
  49152. },
  49153. get w() {
  49154. return this._w;
  49155. },
  49156. set w(e) {
  49157. (this._w = e), this.onChangeCallback();
  49158. },
  49159. set: function (e, t, i, n) {
  49160. return (
  49161. (this._x = e),
  49162. (this._y = t),
  49163. (this._z = i),
  49164. (this._w = n),
  49165. this.onChangeCallback(),
  49166. this
  49167. );
  49168. },
  49169. clone: function () {
  49170. return new this.constructor(this._x, this._y, this._z, this._w);
  49171. },
  49172. copy: function (e) {
  49173. return (
  49174. (this._x = e.x),
  49175. (this._y = e.y),
  49176. (this._z = e.z),
  49177. (this._w = e.w),
  49178. this.onChangeCallback(),
  49179. this
  49180. );
  49181. },
  49182. setFromEuler: function (e, t) {
  49183. if (e instanceof n.Euler == !1)
  49184. throw new Error(
  49185. "THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order."
  49186. );
  49187. var i = Math.cos(e._x / 2),
  49188. r = Math.cos(e._y / 2),
  49189. o = Math.cos(e._z / 2),
  49190. a = Math.sin(e._x / 2),
  49191. s = Math.sin(e._y / 2),
  49192. l = Math.sin(e._z / 2),
  49193. c = e.order;
  49194. return (
  49195. "XYZ" === c
  49196. ? ((this._x = a * r * o + i * s * l),
  49197. (this._y = i * s * o - a * r * l),
  49198. (this._z = i * r * l + a * s * o),
  49199. (this._w = i * r * o - a * s * l))
  49200. : "YXZ" === c
  49201. ? ((this._x = a * r * o + i * s * l),
  49202. (this._y = i * s * o - a * r * l),
  49203. (this._z = i * r * l - a * s * o),
  49204. (this._w = i * r * o + a * s * l))
  49205. : "ZXY" === c
  49206. ? ((this._x = a * r * o - i * s * l),
  49207. (this._y = i * s * o + a * r * l),
  49208. (this._z = i * r * l + a * s * o),
  49209. (this._w = i * r * o - a * s * l))
  49210. : "ZYX" === c
  49211. ? ((this._x = a * r * o - i * s * l),
  49212. (this._y = i * s * o + a * r * l),
  49213. (this._z = i * r * l - a * s * o),
  49214. (this._w = i * r * o + a * s * l))
  49215. : "YZX" === c
  49216. ? ((this._x = a * r * o + i * s * l),
  49217. (this._y = i * s * o + a * r * l),
  49218. (this._z = i * r * l - a * s * o),
  49219. (this._w = i * r * o - a * s * l))
  49220. : "XZY" === c &&
  49221. ((this._x = a * r * o - i * s * l),
  49222. (this._y = i * s * o - a * r * l),
  49223. (this._z = i * r * l + a * s * o),
  49224. (this._w = i * r * o + a * s * l)),
  49225. t !== !1 && this.onChangeCallback(),
  49226. this
  49227. );
  49228. },
  49229. setFromAxisAngle: function (e, t) {
  49230. var i = t / 2,
  49231. n = Math.sin(i);
  49232. return (
  49233. (this._x = e.x * n),
  49234. (this._y = e.y * n),
  49235. (this._z = e.z * n),
  49236. (this._w = Math.cos(i)),
  49237. this.onChangeCallback(),
  49238. this
  49239. );
  49240. },
  49241. setFromRotationMatrix: function (e) {
  49242. var t,
  49243. i = e.elements,
  49244. n = i[0],
  49245. r = i[4],
  49246. o = i[8],
  49247. a = i[1],
  49248. s = i[5],
  49249. l = i[9],
  49250. c = i[2],
  49251. h = i[6],
  49252. u = i[10],
  49253. d = n + s + u;
  49254. return (
  49255. d > 0
  49256. ? ((t = 0.5 / Math.sqrt(d + 1)),
  49257. (this._w = 0.25 / t),
  49258. (this._x = (h - l) * t),
  49259. (this._y = (o - c) * t),
  49260. (this._z = (a - r) * t))
  49261. : n > s && n > u
  49262. ? ((t = 2 * Math.sqrt(1 + n - s - u)),
  49263. (this._w = (h - l) / t),
  49264. (this._x = 0.25 * t),
  49265. (this._y = (r + a) / t),
  49266. (this._z = (o + c) / t))
  49267. : s > u
  49268. ? ((t = 2 * Math.sqrt(1 + s - n - u)),
  49269. (this._w = (o - c) / t),
  49270. (this._x = (r + a) / t),
  49271. (this._y = 0.25 * t),
  49272. (this._z = (l + h) / t))
  49273. : ((t = 2 * Math.sqrt(1 + u - n - s)),
  49274. (this._w = (a - r) / t),
  49275. (this._x = (o + c) / t),
  49276. (this._y = (l + h) / t),
  49277. (this._z = 0.25 * t)),
  49278. this.onChangeCallback(),
  49279. this
  49280. );
  49281. },
  49282. setFromUnitVectors: (function () {
  49283. var e,
  49284. t,
  49285. i = 1e-6;
  49286. return function (r, o) {
  49287. return (
  49288. void 0 === e && (e = new n.Vector3()),
  49289. (t = r.dot(o) + 1),
  49290. t < i
  49291. ? ((t = 0),
  49292. Math.abs(r.x) > Math.abs(r.z)
  49293. ? e.set(-r.y, r.x, 0)
  49294. : e.set(0, -r.z, r.y))
  49295. : e.crossVectors(r, o),
  49296. (this._x = e.x),
  49297. (this._y = e.y),
  49298. (this._z = e.z),
  49299. (this._w = t),
  49300. this.normalize(),
  49301. this
  49302. );
  49303. };
  49304. })(),
  49305. inverse: function () {
  49306. return this.conjugate().normalize(), this;
  49307. },
  49308. conjugate: function () {
  49309. return (
  49310. (this._x *= -1),
  49311. (this._y *= -1),
  49312. (this._z *= -1),
  49313. this.onChangeCallback(),
  49314. this
  49315. );
  49316. },
  49317. dot: function (e) {
  49318. return (
  49319. this._x * e._x +
  49320. this._y * e._y +
  49321. this._z * e._z +
  49322. this._w * e._w
  49323. );
  49324. },
  49325. lengthSq: function () {
  49326. return (
  49327. this._x * this._x +
  49328. this._y * this._y +
  49329. this._z * this._z +
  49330. this._w * this._w
  49331. );
  49332. },
  49333. length: function () {
  49334. return Math.sqrt(
  49335. this._x * this._x +
  49336. this._y * this._y +
  49337. this._z * this._z +
  49338. this._w * this._w
  49339. );
  49340. },
  49341. normalize: function () {
  49342. var e = this.length();
  49343. return (
  49344. 0 === e
  49345. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  49346. : ((e = 1 / e),
  49347. (this._x = this._x * e),
  49348. (this._y = this._y * e),
  49349. (this._z = this._z * e),
  49350. (this._w = this._w * e)),
  49351. this.onChangeCallback(),
  49352. this
  49353. );
  49354. },
  49355. multiply: function (e, t) {
  49356. return void 0 !== t
  49357. ? (console.warn(
  49358. "THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."
  49359. ),
  49360. this.multiplyQuaternions(e, t))
  49361. : this.multiplyQuaternions(this, e);
  49362. },
  49363. multiplyQuaternions: function (e, t) {
  49364. var i = e._x,
  49365. n = e._y,
  49366. r = e._z,
  49367. o = e._w,
  49368. a = t._x,
  49369. s = t._y,
  49370. l = t._z,
  49371. c = t._w;
  49372. return (
  49373. (this._x = i * c + o * a + n * l - r * s),
  49374. (this._y = n * c + o * s + r * a - i * l),
  49375. (this._z = r * c + o * l + i * s - n * a),
  49376. (this._w = o * c - i * a - n * s - r * l),
  49377. this.onChangeCallback(),
  49378. this
  49379. );
  49380. },
  49381. slerp: function (e, t) {
  49382. if (0 === t) return this;
  49383. if (1 === t) return this.copy(e);
  49384. var i = this._x,
  49385. n = this._y,
  49386. r = this._z,
  49387. o = this._w,
  49388. a = o * e._w + i * e._x + n * e._y + r * e._z;
  49389. if (
  49390. (a < 0
  49391. ? ((this._w = -e._w),
  49392. (this._x = -e._x),
  49393. (this._y = -e._y),
  49394. (this._z = -e._z),
  49395. (a = -a))
  49396. : this.copy(e),
  49397. a >= 1)
  49398. )
  49399. return (
  49400. (this._w = o),
  49401. (this._x = i),
  49402. (this._y = n),
  49403. (this._z = r),
  49404. this
  49405. );
  49406. var s = Math.sqrt(1 - a * a);
  49407. if (Math.abs(s) < 0.001)
  49408. return (
  49409. (this._w = 0.5 * (o + this._w)),
  49410. (this._x = 0.5 * (i + this._x)),
  49411. (this._y = 0.5 * (n + this._y)),
  49412. (this._z = 0.5 * (r + this._z)),
  49413. this
  49414. );
  49415. var l = Math.atan2(s, a),
  49416. c = Math.sin((1 - t) * l) / s,
  49417. h = Math.sin(t * l) / s;
  49418. return (
  49419. (this._w = o * c + this._w * h),
  49420. (this._x = i * c + this._x * h),
  49421. (this._y = n * c + this._y * h),
  49422. (this._z = r * c + this._z * h),
  49423. this.onChangeCallback(),
  49424. this
  49425. );
  49426. },
  49427. equals: function (e) {
  49428. return (
  49429. e._x === this._x &&
  49430. e._y === this._y &&
  49431. e._z === this._z &&
  49432. e._w === this._w
  49433. );
  49434. },
  49435. fromArray: function (e, t) {
  49436. return (
  49437. void 0 === t && (t = 0),
  49438. (this._x = e[t]),
  49439. (this._y = e[t + 1]),
  49440. (this._z = e[t + 2]),
  49441. (this._w = e[t + 3]),
  49442. this.onChangeCallback(),
  49443. this
  49444. );
  49445. },
  49446. toArray: function (e, t) {
  49447. return (
  49448. void 0 === e && (e = []),
  49449. void 0 === t && (t = 0),
  49450. (e[t] = this._x),
  49451. (e[t + 1] = this._y),
  49452. (e[t + 2] = this._z),
  49453. (e[t + 3] = this._w),
  49454. e
  49455. );
  49456. },
  49457. onChange: function (e) {
  49458. return (this.onChangeCallback = e), this;
  49459. },
  49460. onChangeCallback: function () {},
  49461. }),
  49462. Object.assign(n.Quaternion, {
  49463. slerp: function (e, t, i, n) {
  49464. return i.copy(e).slerp(t, n);
  49465. },
  49466. slerpFlat: function (e, t, i, n, r, o, a) {
  49467. var s = i[n + 0],
  49468. l = i[n + 1],
  49469. c = i[n + 2],
  49470. h = i[n + 3],
  49471. u = r[o + 0],
  49472. d = r[o + 1],
  49473. p = r[o + 2],
  49474. f = r[o + 3];
  49475. if (h !== f || s !== u || l !== d || c !== p) {
  49476. var g = 1 - a,
  49477. m = s * u + l * d + c * p + h * f,
  49478. v = m >= 0 ? 1 : -1,
  49479. A = 1 - m * m;
  49480. if (A > Number.EPSILON) {
  49481. var y = Math.sqrt(A),
  49482. C = Math.atan2(y, m * v);
  49483. (g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y);
  49484. }
  49485. var I = a * v;
  49486. if (
  49487. ((s = s * g + u * I),
  49488. (l = l * g + d * I),
  49489. (c = c * g + p * I),
  49490. (h = h * g + f * I),
  49491. g === 1 - a)
  49492. ) {
  49493. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  49494. (s *= E), (l *= E), (c *= E), (h *= E);
  49495. }
  49496. }
  49497. (e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h);
  49498. },
  49499. }),
  49500. (n.Vector2 = function (e, t) {
  49501. (this.x = e || 0), (this.y = t || 0);
  49502. }),
  49503. (n.Vector2.prototype = {
  49504. constructor: n.Vector2,
  49505. get width() {
  49506. return this.x;
  49507. },
  49508. set width(e) {
  49509. this.x = e;
  49510. },
  49511. get height() {
  49512. return this.y;
  49513. },
  49514. set height(e) {
  49515. this.y = e;
  49516. },
  49517. set: function (e, t) {
  49518. return (this.x = e), (this.y = t), this;
  49519. },
  49520. setScalar: function (e) {
  49521. return (this.x = e), (this.y = e), this;
  49522. },
  49523. setX: function (e) {
  49524. return (this.x = e), this;
  49525. },
  49526. setY: function (e) {
  49527. return (this.y = e), this;
  49528. },
  49529. setComponent: function (e, t) {
  49530. switch (e) {
  49531. case 0:
  49532. this.x = t;
  49533. break;
  49534. case 1:
  49535. this.y = t;
  49536. break;
  49537. default:
  49538. throw new Error("index is out of range: " + e);
  49539. }
  49540. },
  49541. getComponent: function (e) {
  49542. switch (e) {
  49543. case 0:
  49544. return this.x;
  49545. case 1:
  49546. return this.y;
  49547. default:
  49548. throw new Error("index is out of range: " + e);
  49549. }
  49550. },
  49551. clone: function () {
  49552. return new this.constructor(this.x, this.y);
  49553. },
  49554. copy: function (e) {
  49555. return (this.x = e.x), (this.y = e.y), this;
  49556. },
  49557. add: function (e, t) {
  49558. return void 0 !== t
  49559. ? (console.warn(
  49560. "THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
  49561. ),
  49562. this.addVectors(e, t))
  49563. : ((this.x += e.x), (this.y += e.y), this);
  49564. },
  49565. addScalar: function (e) {
  49566. return (this.x += e), (this.y += e), this;
  49567. },
  49568. addVectors: function (e, t) {
  49569. return (this.x = e.x + t.x), (this.y = e.y + t.y), this;
  49570. },
  49571. addScaledVector: function (e, t) {
  49572. return (this.x += e.x * t), (this.y += e.y * t), this;
  49573. },
  49574. sub: function (e, t) {
  49575. return void 0 !== t
  49576. ? (console.warn(
  49577. "THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
  49578. ),
  49579. this.subVectors(e, t))
  49580. : ((this.x -= e.x), (this.y -= e.y), this);
  49581. },
  49582. subScalar: function (e) {
  49583. return (this.x -= e), (this.y -= e), this;
  49584. },
  49585. subVectors: function (e, t) {
  49586. return (this.x = e.x - t.x), (this.y = e.y - t.y), this;
  49587. },
  49588. multiply: function (e) {
  49589. return (this.x *= e.x), (this.y *= e.y), this;
  49590. },
  49591. multiplyScalar: function (e) {
  49592. return (
  49593. isFinite(e)
  49594. ? ((this.x *= e), (this.y *= e))
  49595. : ((this.x = 0), (this.y = 0)),
  49596. this
  49597. );
  49598. },
  49599. divide: function (e) {
  49600. return (this.x /= e.x), (this.y /= e.y), this;
  49601. },
  49602. divideScalar: function (e) {
  49603. return this.multiplyScalar(1 / e);
  49604. },
  49605. min: function (e) {
  49606. return (
  49607. (this.x = Math.min(this.x, e.x)),
  49608. (this.y = Math.min(this.y, e.y)),
  49609. this
  49610. );
  49611. },
  49612. max: function (e) {
  49613. return (
  49614. (this.x = Math.max(this.x, e.x)),
  49615. (this.y = Math.max(this.y, e.y)),
  49616. this
  49617. );
  49618. },
  49619. clamp: function (e, t) {
  49620. return (
  49621. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  49622. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  49623. this
  49624. );
  49625. },
  49626. clampScalar: (function () {
  49627. var e, t;
  49628. return function (i, r) {
  49629. return (
  49630. void 0 === e &&
  49631. ((e = new n.Vector2()), (t = new n.Vector2())),
  49632. e.set(i, i),
  49633. t.set(r, r),
  49634. this.clamp(e, t)
  49635. );
  49636. };
  49637. })(),
  49638. clampLength: function (e, t) {
  49639. var i = this.length();
  49640. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  49641. },
  49642. floor: function () {
  49643. return (
  49644. (this.x = Math.floor(this.x)),
  49645. (this.y = Math.floor(this.y)),
  49646. this
  49647. );
  49648. },
  49649. ceil: function () {
  49650. return (
  49651. (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  49652. );
  49653. },
  49654. round: function () {
  49655. return (
  49656. (this.x = Math.round(this.x)),
  49657. (this.y = Math.round(this.y)),
  49658. this
  49659. );
  49660. },
  49661. roundToZero: function () {
  49662. return (
  49663. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  49664. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  49665. this
  49666. );
  49667. },
  49668. negate: function () {
  49669. return (this.x = -this.x), (this.y = -this.y), this;
  49670. },
  49671. dot: function (e) {
  49672. return this.x * e.x + this.y * e.y;
  49673. },
  49674. lengthSq: function () {
  49675. return this.x * this.x + this.y * this.y;
  49676. },
  49677. length: function () {
  49678. return Math.sqrt(this.x * this.x + this.y * this.y);
  49679. },
  49680. lengthManhattan: function () {
  49681. return Math.abs(this.x) + Math.abs(this.y);
  49682. },
  49683. normalize: function () {
  49684. return this.divideScalar(this.length());
  49685. },
  49686. angle: function () {
  49687. var e = Math.atan2(this.y, this.x);
  49688. return e < 0 && (e += 2 * Math.PI), e;
  49689. },
  49690. distanceTo: function (e) {
  49691. return Math.sqrt(this.distanceToSquared(e));
  49692. },
  49693. distanceToSquared: function (e) {
  49694. var t = this.x - e.x,
  49695. i = this.y - e.y;
  49696. return t * t + i * i;
  49697. },
  49698. setLength: function (e) {
  49699. return this.multiplyScalar(e / this.length());
  49700. },
  49701. lerp: function (e, t) {
  49702. return (
  49703. (this.x += (e.x - this.x) * t),
  49704. (this.y += (e.y - this.y) * t),
  49705. this
  49706. );
  49707. },
  49708. lerpVectors: function (e, t, i) {
  49709. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  49710. },
  49711. equals: function (e) {
  49712. return e.x === this.x && e.y === this.y;
  49713. },
  49714. fromArray: function (e, t) {
  49715. return (
  49716. void 0 === t && (t = 0),
  49717. (this.x = e[t]),
  49718. (this.y = e[t + 1]),
  49719. this
  49720. );
  49721. },
  49722. toArray: function (e, t) {
  49723. return (
  49724. void 0 === e && (e = []),
  49725. void 0 === t && (t = 0),
  49726. (e[t] = this.x),
  49727. (e[t + 1] = this.y),
  49728. e
  49729. );
  49730. },
  49731. fromAttribute: function (e, t, i) {
  49732. return (
  49733. void 0 === i && (i = 0),
  49734. (t = t * e.itemSize + i),
  49735. (this.x = e.array[t]),
  49736. (this.y = e.array[t + 1]),
  49737. this
  49738. );
  49739. },
  49740. rotateAround: function (e, t) {
  49741. var i = Math.cos(t),
  49742. n = Math.sin(t),
  49743. r = this.x - e.x,
  49744. o = this.y - e.y;
  49745. return (
  49746. (this.x = r * i - o * n + e.x),
  49747. (this.y = r * n + o * i + e.y),
  49748. this
  49749. );
  49750. },
  49751. }),
  49752. (n.Vector3 = function (e, t, i) {
  49753. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  49754. }),
  49755. (n.Vector3.prototype = {
  49756. constructor: n.Vector3,
  49757. set: function (e, t, i) {
  49758. return (this.x = e), (this.y = t), (this.z = i), this;
  49759. },
  49760. setScalar: function (e) {
  49761. return (this.x = e), (this.y = e), (this.z = e), this;
  49762. },
  49763. setX: function (e) {
  49764. return (this.x = e), this;
  49765. },
  49766. setY: function (e) {
  49767. return (this.y = e), this;
  49768. },
  49769. setZ: function (e) {
  49770. return (this.z = e), this;
  49771. },
  49772. setComponent: function (e, t) {
  49773. switch (e) {
  49774. case 0:
  49775. this.x = t;
  49776. break;
  49777. case 1:
  49778. this.y = t;
  49779. break;
  49780. case 2:
  49781. this.z = t;
  49782. break;
  49783. default:
  49784. throw new Error("index is out of range: " + e);
  49785. }
  49786. },
  49787. getComponent: function (e) {
  49788. switch (e) {
  49789. case 0:
  49790. return this.x;
  49791. case 1:
  49792. return this.y;
  49793. case 2:
  49794. return this.z;
  49795. default:
  49796. throw new Error("index is out of range: " + e);
  49797. }
  49798. },
  49799. clone: function () {
  49800. return new this.constructor(this.x, this.y, this.z);
  49801. },
  49802. copy: function (e) {
  49803. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this;
  49804. },
  49805. add: function (e, t) {
  49806. return void 0 !== t
  49807. ? (console.warn(
  49808. "THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
  49809. ),
  49810. this.addVectors(e, t))
  49811. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this);
  49812. },
  49813. addScalar: function (e) {
  49814. return (this.x += e), (this.y += e), (this.z += e), this;
  49815. },
  49816. addVectors: function (e, t) {
  49817. return (
  49818. (this.x = e.x + t.x),
  49819. (this.y = e.y + t.y),
  49820. (this.z = e.z + t.z),
  49821. this
  49822. );
  49823. },
  49824. addScaledVector: function (e, t) {
  49825. return (
  49826. (this.x += e.x * t),
  49827. (this.y += e.y * t),
  49828. (this.z += e.z * t),
  49829. this
  49830. );
  49831. },
  49832. sub: function (e, t) {
  49833. return void 0 !== t
  49834. ? (console.warn(
  49835. "THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
  49836. ),
  49837. this.subVectors(e, t))
  49838. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this);
  49839. },
  49840. subScalar: function (e) {
  49841. return (this.x -= e), (this.y -= e), (this.z -= e), this;
  49842. },
  49843. subVectors: function (e, t) {
  49844. return (
  49845. (this.x = e.x - t.x),
  49846. (this.y = e.y - t.y),
  49847. (this.z = e.z - t.z),
  49848. this
  49849. );
  49850. },
  49851. multiply: function (e, t) {
  49852. return void 0 !== t
  49853. ? (console.warn(
  49854. "THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."
  49855. ),
  49856. this.multiplyVectors(e, t))
  49857. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this);
  49858. },
  49859. multiplyScalar: function (e) {
  49860. return (
  49861. isFinite(e)
  49862. ? ((this.x *= e), (this.y *= e), (this.z *= e))
  49863. : ((this.x = 0), (this.y = 0), (this.z = 0)),
  49864. this
  49865. );
  49866. },
  49867. multiplyVectors: function (e, t) {
  49868. return (
  49869. (this.x = e.x * t.x),
  49870. (this.y = e.y * t.y),
  49871. (this.z = e.z * t.z),
  49872. this
  49873. );
  49874. },
  49875. applyEuler: (function () {
  49876. var e;
  49877. return function (t) {
  49878. return (
  49879. t instanceof n.Euler == !1 &&
  49880. console.error(
  49881. "THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."
  49882. ),
  49883. void 0 === e && (e = new n.Quaternion()),
  49884. this.applyQuaternion(e.setFromEuler(t)),
  49885. this
  49886. );
  49887. };
  49888. })(),
  49889. applyAxisAngle: (function () {
  49890. var e;
  49891. return function (t, i) {
  49892. return (
  49893. void 0 === e && (e = new n.Quaternion()),
  49894. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  49895. this
  49896. );
  49897. };
  49898. })(),
  49899. applyMatrix3: function (e) {
  49900. var t = this.x,
  49901. i = this.y,
  49902. n = this.z,
  49903. r = e.elements;
  49904. return (
  49905. (this.x = r[0] * t + r[3] * i + r[6] * n),
  49906. (this.y = r[1] * t + r[4] * i + r[7] * n),
  49907. (this.z = r[2] * t + r[5] * i + r[8] * n),
  49908. this
  49909. );
  49910. },
  49911. applyMatrix4: function (e) {
  49912. var t = this.x,
  49913. i = this.y,
  49914. n = this.z,
  49915. r = e.elements;
  49916. return (
  49917. (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  49918. (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  49919. (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  49920. this
  49921. );
  49922. },
  49923. applyProjection: function (e) {
  49924. var t = this.x,
  49925. i = this.y,
  49926. n = this.z,
  49927. r = e.elements,
  49928. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  49929. return (
  49930. (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o),
  49931. (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o),
  49932. (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o),
  49933. this
  49934. );
  49935. },
  49936. applyQuaternion: function (e) {
  49937. var t = this.x,
  49938. i = this.y,
  49939. n = this.z,
  49940. r = e.x,
  49941. o = e.y,
  49942. a = e.z,
  49943. s = e.w,
  49944. l = s * t + o * n - a * i,
  49945. c = s * i + a * t - r * n,
  49946. h = s * n + r * i - o * t,
  49947. u = -r * t - o * i - a * n;
  49948. return (
  49949. (this.x = l * s + u * -r + c * -a - h * -o),
  49950. (this.y = c * s + u * -o + h * -r - l * -a),
  49951. (this.z = h * s + u * -a + l * -o - c * -r),
  49952. this
  49953. );
  49954. },
  49955. project: (function () {
  49956. var e;
  49957. return function (t) {
  49958. return (
  49959. void 0 === e && (e = new n.Matrix4()),
  49960. e.multiplyMatrices(
  49961. t.projectionMatrix,
  49962. e.getInverse(t.matrixWorld)
  49963. ),
  49964. this.applyProjection(e)
  49965. );
  49966. };
  49967. })(),
  49968. unproject: (function () {
  49969. var e;
  49970. return function (t) {
  49971. return (
  49972. void 0 === e && (e = new n.Matrix4()),
  49973. e.multiplyMatrices(
  49974. t.matrixWorld,
  49975. e.getInverse(t.projectionMatrix)
  49976. ),
  49977. this.applyProjection(e)
  49978. );
  49979. };
  49980. })(),
  49981. transformDirection: function (e) {
  49982. var t = this.x,
  49983. i = this.y,
  49984. n = this.z,
  49985. r = e.elements;
  49986. return (
  49987. (this.x = r[0] * t + r[4] * i + r[8] * n),
  49988. (this.y = r[1] * t + r[5] * i + r[9] * n),
  49989. (this.z = r[2] * t + r[6] * i + r[10] * n),
  49990. this.normalize(),
  49991. this
  49992. );
  49993. },
  49994. divide: function (e) {
  49995. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this;
  49996. },
  49997. divideScalar: function (e) {
  49998. return this.multiplyScalar(1 / e);
  49999. },
  50000. min: function (e) {
  50001. return (
  50002. (this.x = Math.min(this.x, e.x)),
  50003. (this.y = Math.min(this.y, e.y)),
  50004. (this.z = Math.min(this.z, e.z)),
  50005. this
  50006. );
  50007. },
  50008. max: function (e) {
  50009. return (
  50010. (this.x = Math.max(this.x, e.x)),
  50011. (this.y = Math.max(this.y, e.y)),
  50012. (this.z = Math.max(this.z, e.z)),
  50013. this
  50014. );
  50015. },
  50016. clamp: function (e, t) {
  50017. return (
  50018. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  50019. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  50020. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  50021. this
  50022. );
  50023. },
  50024. clampScalar: (function () {
  50025. var e, t;
  50026. return function (i, r) {
  50027. return (
  50028. void 0 === e &&
  50029. ((e = new n.Vector3()), (t = new n.Vector3())),
  50030. e.set(i, i, i),
  50031. t.set(r, r, r),
  50032. this.clamp(e, t)
  50033. );
  50034. };
  50035. })(),
  50036. clampLength: function (e, t) {
  50037. var i = this.length();
  50038. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  50039. },
  50040. floor: function () {
  50041. return (
  50042. (this.x = Math.floor(this.x)),
  50043. (this.y = Math.floor(this.y)),
  50044. (this.z = Math.floor(this.z)),
  50045. this
  50046. );
  50047. },
  50048. ceil: function () {
  50049. return (
  50050. (this.x = Math.ceil(this.x)),
  50051. (this.y = Math.ceil(this.y)),
  50052. (this.z = Math.ceil(this.z)),
  50053. this
  50054. );
  50055. },
  50056. round: function () {
  50057. return (
  50058. (this.x = Math.round(this.x)),
  50059. (this.y = Math.round(this.y)),
  50060. (this.z = Math.round(this.z)),
  50061. this
  50062. );
  50063. },
  50064. roundToZero: function () {
  50065. return (
  50066. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  50067. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  50068. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  50069. this
  50070. );
  50071. },
  50072. negate: function () {
  50073. return (
  50074. (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  50075. );
  50076. },
  50077. dot: function (e) {
  50078. return this.x * e.x + this.y * e.y + this.z * e.z;
  50079. },
  50080. lengthSq: function () {
  50081. return this.x * this.x + this.y * this.y + this.z * this.z;
  50082. },
  50083. length: function () {
  50084. return Math.sqrt(
  50085. this.x * this.x + this.y * this.y + this.z * this.z
  50086. );
  50087. },
  50088. lengthManhattan: function () {
  50089. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
  50090. },
  50091. normalize: function () {
  50092. return this.divideScalar(this.length());
  50093. },
  50094. setLength: function (e) {
  50095. return this.multiplyScalar(e / this.length());
  50096. },
  50097. lerp: function (e, t) {
  50098. return (
  50099. (this.x += (e.x - this.x) * t),
  50100. (this.y += (e.y - this.y) * t),
  50101. (this.z += (e.z - this.z) * t),
  50102. this
  50103. );
  50104. },
  50105. lerpVectors: function (e, t, i) {
  50106. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  50107. },
  50108. cross: function (e, t) {
  50109. if (void 0 !== t)
  50110. return (
  50111. console.warn(
  50112. "THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."
  50113. ),
  50114. this.crossVectors(e, t)
  50115. );
  50116. var i = this.x,
  50117. n = this.y,
  50118. r = this.z;
  50119. return (
  50120. (this.x = n * e.z - r * e.y),
  50121. (this.y = r * e.x - i * e.z),
  50122. (this.z = i * e.y - n * e.x),
  50123. this
  50124. );
  50125. },
  50126. crossVectors: function (e, t) {
  50127. var i = e.x,
  50128. n = e.y,
  50129. r = e.z,
  50130. o = t.x,
  50131. a = t.y,
  50132. s = t.z;
  50133. return (
  50134. (this.x = n * s - r * a),
  50135. (this.y = r * o - i * s),
  50136. (this.z = i * a - n * o),
  50137. this
  50138. );
  50139. },
  50140. projectOnVector: (function () {
  50141. var e, t;
  50142. return function (i) {
  50143. return (
  50144. void 0 === e && (e = new n.Vector3()),
  50145. e.copy(i).normalize(),
  50146. (t = this.dot(e)),
  50147. this.copy(e).multiplyScalar(t)
  50148. );
  50149. };
  50150. })(),
  50151. projectOnPlane: (function () {
  50152. var e;
  50153. return function (t) {
  50154. return (
  50155. void 0 === e && (e = new n.Vector3()),
  50156. e.copy(this).projectOnVector(t),
  50157. this.sub(e)
  50158. );
  50159. };
  50160. })(),
  50161. reflect: (function () {
  50162. var e;
  50163. return function (t) {
  50164. return (
  50165. void 0 === e && (e = new n.Vector3()),
  50166. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  50167. );
  50168. };
  50169. })(),
  50170. angleTo: function (e) {
  50171. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  50172. return Math.acos(n.Math.clamp(t, -1, 1));
  50173. },
  50174. distanceTo: function (e) {
  50175. return Math.sqrt(this.distanceToSquared(e));
  50176. },
  50177. distanceToSquared: function (e) {
  50178. var t = this.x - e.x,
  50179. i = this.y - e.y,
  50180. n = this.z - e.z;
  50181. return t * t + i * i + n * n;
  50182. },
  50183. setFromSpherical: function (e) {
  50184. var t = Math.sin(e.phi) * e.radius;
  50185. return (
  50186. (this.x = t * Math.sin(e.theta)),
  50187. (this.y = Math.cos(e.phi) * e.radius),
  50188. (this.z = t * Math.cos(e.theta)),
  50189. this
  50190. );
  50191. },
  50192. setFromMatrixPosition: function (e) {
  50193. return this.setFromMatrixColumn(e, 3);
  50194. },
  50195. setFromMatrixScale: function (e) {
  50196. var t = this.setFromMatrixColumn(e, 0).length(),
  50197. i = this.setFromMatrixColumn(e, 1).length(),
  50198. n = this.setFromMatrixColumn(e, 2).length();
  50199. return (this.x = t), (this.y = i), (this.z = n), this;
  50200. },
  50201. setFromMatrixColumn: function (e, t) {
  50202. return (
  50203. "number" == typeof e &&
  50204. (console.warn(
  50205. "THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."
  50206. ),
  50207. (e = arguments[1]),
  50208. (t = arguments[0])),
  50209. this.fromArray(e.elements, 4 * t)
  50210. );
  50211. },
  50212. equals: function (e) {
  50213. return e.x === this.x && e.y === this.y && e.z === this.z;
  50214. },
  50215. fromArray: function (e, t) {
  50216. return (
  50217. void 0 === t && (t = 0),
  50218. (this.x = e[t]),
  50219. (this.y = e[t + 1]),
  50220. (this.z = e[t + 2]),
  50221. this
  50222. );
  50223. },
  50224. toArray: function (e, t) {
  50225. return (
  50226. void 0 === e && (e = []),
  50227. void 0 === t && (t = 0),
  50228. (e[t] = this.x),
  50229. (e[t + 1] = this.y),
  50230. (e[t + 2] = this.z),
  50231. e
  50232. );
  50233. },
  50234. fromAttribute: function (e, t, i) {
  50235. return (
  50236. void 0 === i && (i = 0),
  50237. (t = t * e.itemSize + i),
  50238. (this.x = e.array[t]),
  50239. (this.y = e.array[t + 1]),
  50240. (this.z = e.array[t + 2]),
  50241. this
  50242. );
  50243. },
  50244. }),
  50245. (n.Vector4 = function (e, t, i, n) {
  50246. (this.x = e || 0),
  50247. (this.y = t || 0),
  50248. (this.z = i || 0),
  50249. (this.w = void 0 !== n ? n : 1);
  50250. }),
  50251. (n.Vector4.prototype = {
  50252. constructor: n.Vector4,
  50253. set: function (e, t, i, n) {
  50254. return (
  50255. (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  50256. );
  50257. },
  50258. setScalar: function (e) {
  50259. return (
  50260. (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  50261. );
  50262. },
  50263. setX: function (e) {
  50264. return (this.x = e), this;
  50265. },
  50266. setY: function (e) {
  50267. return (this.y = e), this;
  50268. },
  50269. setZ: function (e) {
  50270. return (this.z = e), this;
  50271. },
  50272. setW: function (e) {
  50273. return (this.w = e), this;
  50274. },
  50275. setComponent: function (e, t) {
  50276. switch (e) {
  50277. case 0:
  50278. this.x = t;
  50279. break;
  50280. case 1:
  50281. this.y = t;
  50282. break;
  50283. case 2:
  50284. this.z = t;
  50285. break;
  50286. case 3:
  50287. this.w = t;
  50288. break;
  50289. default:
  50290. throw new Error("index is out of range: " + e);
  50291. }
  50292. },
  50293. getComponent: function (e) {
  50294. switch (e) {
  50295. case 0:
  50296. return this.x;
  50297. case 1:
  50298. return this.y;
  50299. case 2:
  50300. return this.z;
  50301. case 3:
  50302. return this.w;
  50303. default:
  50304. throw new Error("index is out of range: " + e);
  50305. }
  50306. },
  50307. clone: function () {
  50308. return new this.constructor(this.x, this.y, this.z, this.w);
  50309. },
  50310. copy: function (e) {
  50311. return (
  50312. (this.x = e.x),
  50313. (this.y = e.y),
  50314. (this.z = e.z),
  50315. (this.w = void 0 !== e.w ? e.w : 1),
  50316. this
  50317. );
  50318. },
  50319. add: function (e, t) {
  50320. return void 0 !== t
  50321. ? (console.warn(
  50322. "THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."
  50323. ),
  50324. this.addVectors(e, t))
  50325. : ((this.x += e.x),
  50326. (this.y += e.y),
  50327. (this.z += e.z),
  50328. (this.w += e.w),
  50329. this);
  50330. },
  50331. addScalar: function (e) {
  50332. return (
  50333. (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  50334. );
  50335. },
  50336. addVectors: function (e, t) {
  50337. return (
  50338. (this.x = e.x + t.x),
  50339. (this.y = e.y + t.y),
  50340. (this.z = e.z + t.z),
  50341. (this.w = e.w + t.w),
  50342. this
  50343. );
  50344. },
  50345. addScaledVector: function (e, t) {
  50346. return (
  50347. (this.x += e.x * t),
  50348. (this.y += e.y * t),
  50349. (this.z += e.z * t),
  50350. (this.w += e.w * t),
  50351. this
  50352. );
  50353. },
  50354. sub: function (e, t) {
  50355. return void 0 !== t
  50356. ? (console.warn(
  50357. "THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."
  50358. ),
  50359. this.subVectors(e, t))
  50360. : ((this.x -= e.x),
  50361. (this.y -= e.y),
  50362. (this.z -= e.z),
  50363. (this.w -= e.w),
  50364. this);
  50365. },
  50366. subScalar: function (e) {
  50367. return (
  50368. (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  50369. );
  50370. },
  50371. subVectors: function (e, t) {
  50372. return (
  50373. (this.x = e.x - t.x),
  50374. (this.y = e.y - t.y),
  50375. (this.z = e.z - t.z),
  50376. (this.w = e.w - t.w),
  50377. this
  50378. );
  50379. },
  50380. multiplyScalar: function (e) {
  50381. return (
  50382. isFinite(e)
  50383. ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e))
  50384. : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)),
  50385. this
  50386. );
  50387. },
  50388. applyMatrix4: function (e) {
  50389. var t = this.x,
  50390. i = this.y,
  50391. n = this.z,
  50392. r = this.w,
  50393. o = e.elements;
  50394. return (
  50395. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  50396. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  50397. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  50398. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  50399. this
  50400. );
  50401. },
  50402. divideScalar: function (e) {
  50403. return this.multiplyScalar(1 / e);
  50404. },
  50405. setAxisAngleFromQuaternion: function (e) {
  50406. this.w = 2 * Math.acos(e.w);
  50407. var t = Math.sqrt(1 - e.w * e.w);
  50408. return (
  50409. t < 1e-4
  50410. ? ((this.x = 1), (this.y = 0), (this.z = 0))
  50411. : ((this.x = e.x / t),
  50412. (this.y = e.y / t),
  50413. (this.z = e.z / t)),
  50414. this
  50415. );
  50416. },
  50417. setAxisAngleFromRotationMatrix: function (e) {
  50418. var t,
  50419. i,
  50420. n,
  50421. r,
  50422. o = 0.01,
  50423. a = 0.1,
  50424. s = e.elements,
  50425. l = s[0],
  50426. c = s[4],
  50427. h = s[8],
  50428. u = s[1],
  50429. d = s[5],
  50430. p = s[9],
  50431. f = s[2],
  50432. g = s[6],
  50433. m = s[10];
  50434. if (
  50435. Math.abs(c - u) < o &&
  50436. Math.abs(h - f) < o &&
  50437. Math.abs(p - g) < o
  50438. ) {
  50439. if (
  50440. Math.abs(c + u) < a &&
  50441. Math.abs(h + f) < a &&
  50442. Math.abs(p + g) < a &&
  50443. Math.abs(l + d + m - 3) < a
  50444. )
  50445. return this.set(1, 0, 0, 0), this;
  50446. t = Math.PI;
  50447. var v = (l + 1) / 2,
  50448. A = (d + 1) / 2,
  50449. y = (m + 1) / 2,
  50450. C = (c + u) / 4,
  50451. I = (h + f) / 4,
  50452. E = (p + g) / 4;
  50453. return (
  50454. v > A && v > y
  50455. ? v < o
  50456. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  50457. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  50458. : A > y
  50459. ? A < o
  50460. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  50461. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  50462. : y < o
  50463. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  50464. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  50465. this.set(i, n, r, t),
  50466. this
  50467. );
  50468. }
  50469. var b = Math.sqrt(
  50470. (g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c)
  50471. );
  50472. return (
  50473. Math.abs(b) < 0.001 && (b = 1),
  50474. (this.x = (g - p) / b),
  50475. (this.y = (h - f) / b),
  50476. (this.z = (u - c) / b),
  50477. (this.w = Math.acos((l + d + m - 1) / 2)),
  50478. this
  50479. );
  50480. },
  50481. min: function (e) {
  50482. return (
  50483. (this.x = Math.min(this.x, e.x)),
  50484. (this.y = Math.min(this.y, e.y)),
  50485. (this.z = Math.min(this.z, e.z)),
  50486. (this.w = Math.min(this.w, e.w)),
  50487. this
  50488. );
  50489. },
  50490. max: function (e) {
  50491. return (
  50492. (this.x = Math.max(this.x, e.x)),
  50493. (this.y = Math.max(this.y, e.y)),
  50494. (this.z = Math.max(this.z, e.z)),
  50495. (this.w = Math.max(this.w, e.w)),
  50496. this
  50497. );
  50498. },
  50499. clamp: function (e, t) {
  50500. return (
  50501. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  50502. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  50503. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  50504. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  50505. this
  50506. );
  50507. },
  50508. clampScalar: (function () {
  50509. var e, t;
  50510. return function (i, r) {
  50511. return (
  50512. void 0 === e &&
  50513. ((e = new n.Vector4()), (t = new n.Vector4())),
  50514. e.set(i, i, i, i),
  50515. t.set(r, r, r, r),
  50516. this.clamp(e, t)
  50517. );
  50518. };
  50519. })(),
  50520. floor: function () {
  50521. return (
  50522. (this.x = Math.floor(this.x)),
  50523. (this.y = Math.floor(this.y)),
  50524. (this.z = Math.floor(this.z)),
  50525. (this.w = Math.floor(this.w)),
  50526. this
  50527. );
  50528. },
  50529. ceil: function () {
  50530. return (
  50531. (this.x = Math.ceil(this.x)),
  50532. (this.y = Math.ceil(this.y)),
  50533. (this.z = Math.ceil(this.z)),
  50534. (this.w = Math.ceil(this.w)),
  50535. this
  50536. );
  50537. },
  50538. round: function () {
  50539. return (
  50540. (this.x = Math.round(this.x)),
  50541. (this.y = Math.round(this.y)),
  50542. (this.z = Math.round(this.z)),
  50543. (this.w = Math.round(this.w)),
  50544. this
  50545. );
  50546. },
  50547. roundToZero: function () {
  50548. return (
  50549. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  50550. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  50551. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  50552. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  50553. this
  50554. );
  50555. },
  50556. negate: function () {
  50557. return (
  50558. (this.x = -this.x),
  50559. (this.y = -this.y),
  50560. (this.z = -this.z),
  50561. (this.w = -this.w),
  50562. this
  50563. );
  50564. },
  50565. dot: function (e) {
  50566. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
  50567. },
  50568. lengthSq: function () {
  50569. return (
  50570. this.x * this.x +
  50571. this.y * this.y +
  50572. this.z * this.z +
  50573. this.w * this.w
  50574. );
  50575. },
  50576. length: function () {
  50577. return Math.sqrt(
  50578. this.x * this.x +
  50579. this.y * this.y +
  50580. this.z * this.z +
  50581. this.w * this.w
  50582. );
  50583. },
  50584. lengthManhattan: function () {
  50585. return (
  50586. Math.abs(this.x) +
  50587. Math.abs(this.y) +
  50588. Math.abs(this.z) +
  50589. Math.abs(this.w)
  50590. );
  50591. },
  50592. normalize: function () {
  50593. return this.divideScalar(this.length());
  50594. },
  50595. setLength: function (e) {
  50596. return this.multiplyScalar(e / this.length());
  50597. },
  50598. lerp: function (e, t) {
  50599. return (
  50600. (this.x += (e.x - this.x) * t),
  50601. (this.y += (e.y - this.y) * t),
  50602. (this.z += (e.z - this.z) * t),
  50603. (this.w += (e.w - this.w) * t),
  50604. this
  50605. );
  50606. },
  50607. lerpVectors: function (e, t, i) {
  50608. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  50609. },
  50610. equals: function (e) {
  50611. return (
  50612. e.x === this.x &&
  50613. e.y === this.y &&
  50614. e.z === this.z &&
  50615. e.w === this.w
  50616. );
  50617. },
  50618. fromArray: function (e, t) {
  50619. return (
  50620. void 0 === t && (t = 0),
  50621. (this.x = e[t]),
  50622. (this.y = e[t + 1]),
  50623. (this.z = e[t + 2]),
  50624. (this.w = e[t + 3]),
  50625. this
  50626. );
  50627. },
  50628. toArray: function (e, t) {
  50629. return (
  50630. void 0 === e && (e = []),
  50631. void 0 === t && (t = 0),
  50632. (e[t] = this.x),
  50633. (e[t + 1] = this.y),
  50634. (e[t + 2] = this.z),
  50635. (e[t + 3] = this.w),
  50636. e
  50637. );
  50638. },
  50639. fromAttribute: function (e, t, i) {
  50640. return (
  50641. void 0 === i && (i = 0),
  50642. (t = t * e.itemSize + i),
  50643. (this.x = e.array[t]),
  50644. (this.y = e.array[t + 1]),
  50645. (this.z = e.array[t + 2]),
  50646. (this.w = e.array[t + 3]),
  50647. this
  50648. );
  50649. },
  50650. }),
  50651. (n.Euler = function (e, t, i, r) {
  50652. (this._x = e || 0),
  50653. (this._y = t || 0),
  50654. (this._z = i || 0),
  50655. (this._order = r || n.Euler.DefaultOrder);
  50656. }),
  50657. (n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"]),
  50658. (n.Euler.DefaultOrder = "XYZ"),
  50659. (n.Euler.prototype = {
  50660. constructor: n.Euler,
  50661. get x() {
  50662. return this._x;
  50663. },
  50664. set x(e) {
  50665. (this._x = e), this.onChangeCallback();
  50666. },
  50667. get y() {
  50668. return this._y;
  50669. },
  50670. set y(e) {
  50671. (this._y = e), this.onChangeCallback();
  50672. },
  50673. get z() {
  50674. return this._z;
  50675. },
  50676. set z(e) {
  50677. (this._z = e), this.onChangeCallback();
  50678. },
  50679. get order() {
  50680. return this._order;
  50681. },
  50682. set order(e) {
  50683. (this._order = e), this.onChangeCallback();
  50684. },
  50685. set: function (e, t, i, n) {
  50686. return (
  50687. (this._x = e),
  50688. (this._y = t),
  50689. (this._z = i),
  50690. (this._order = n || this._order),
  50691. this.onChangeCallback(),
  50692. this
  50693. );
  50694. },
  50695. clone: function () {
  50696. return new this.constructor(
  50697. this._x,
  50698. this._y,
  50699. this._z,
  50700. this._order
  50701. );
  50702. },
  50703. copy: function (e) {
  50704. return (
  50705. (this._x = e._x),
  50706. (this._y = e._y),
  50707. (this._z = e._z),
  50708. (this._order = e._order),
  50709. this.onChangeCallback(),
  50710. this
  50711. );
  50712. },
  50713. setFromRotationMatrix: function (e, t, i) {
  50714. var r = n.Math.clamp,
  50715. o = e.elements,
  50716. a = o[0],
  50717. s = o[4],
  50718. l = o[8],
  50719. c = o[1],
  50720. h = o[5],
  50721. u = o[9],
  50722. d = o[2],
  50723. p = o[6],
  50724. f = o[10];
  50725. return (
  50726. (t = t || this._order),
  50727. "XYZ" === t
  50728. ? ((this._y = Math.asin(r(l, -1, 1))),
  50729. Math.abs(l) < 0.99999
  50730. ? ((this._x = Math.atan2(-u, f)),
  50731. (this._z = Math.atan2(-s, a)))
  50732. : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  50733. : "YXZ" === t
  50734. ? ((this._x = Math.asin(-r(u, -1, 1))),
  50735. Math.abs(u) < 0.99999
  50736. ? ((this._y = Math.atan2(l, f)),
  50737. (this._z = Math.atan2(c, h)))
  50738. : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  50739. : "ZXY" === t
  50740. ? ((this._x = Math.asin(r(p, -1, 1))),
  50741. Math.abs(p) < 0.99999
  50742. ? ((this._y = Math.atan2(-d, f)),
  50743. (this._z = Math.atan2(-s, h)))
  50744. : ((this._y = 0), (this._z = Math.atan2(c, a))))
  50745. : "ZYX" === t
  50746. ? ((this._y = Math.asin(-r(d, -1, 1))),
  50747. Math.abs(d) < 0.99999
  50748. ? ((this._x = Math.atan2(p, f)),
  50749. (this._z = Math.atan2(c, a)))
  50750. : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  50751. : "YZX" === t
  50752. ? ((this._z = Math.asin(r(c, -1, 1))),
  50753. Math.abs(c) < 0.99999
  50754. ? ((this._x = Math.atan2(-u, h)),
  50755. (this._y = Math.atan2(-d, a)))
  50756. : ((this._x = 0), (this._y = Math.atan2(l, f))))
  50757. : "XZY" === t
  50758. ? ((this._z = Math.asin(-r(s, -1, 1))),
  50759. Math.abs(s) < 0.99999
  50760. ? ((this._x = Math.atan2(p, h)),
  50761. (this._y = Math.atan2(l, a)))
  50762. : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  50763. : console.warn(
  50764. "THREE.Euler: .setFromRotationMatrix() given unsupported order: " +
  50765. t
  50766. ),
  50767. (this._order = t),
  50768. i !== !1 && this.onChangeCallback(),
  50769. this
  50770. );
  50771. },
  50772. setFromQuaternion: (function () {
  50773. var e;
  50774. return function (t, i, r) {
  50775. return (
  50776. void 0 === e && (e = new n.Matrix4()),
  50777. e.makeRotationFromQuaternion(t),
  50778. this.setFromRotationMatrix(e, i, r),
  50779. this
  50780. );
  50781. };
  50782. })(),
  50783. setFromVector3: function (e, t) {
  50784. return this.set(e.x, e.y, e.z, t || this._order);
  50785. },
  50786. reorder: (function () {
  50787. var e = new n.Quaternion();
  50788. return function (t) {
  50789. e.setFromEuler(this), this.setFromQuaternion(e, t);
  50790. };
  50791. })(),
  50792. equals: function (e) {
  50793. return (
  50794. e._x === this._x &&
  50795. e._y === this._y &&
  50796. e._z === this._z &&
  50797. e._order === this._order
  50798. );
  50799. },
  50800. fromArray: function (e) {
  50801. return (
  50802. (this._x = e[0]),
  50803. (this._y = e[1]),
  50804. (this._z = e[2]),
  50805. void 0 !== e[3] && (this._order = e[3]),
  50806. this.onChangeCallback(),
  50807. this
  50808. );
  50809. },
  50810. toArray: function (e, t) {
  50811. return (
  50812. void 0 === e && (e = []),
  50813. void 0 === t && (t = 0),
  50814. (e[t] = this._x),
  50815. (e[t + 1] = this._y),
  50816. (e[t + 2] = this._z),
  50817. (e[t + 3] = this._order),
  50818. e
  50819. );
  50820. },
  50821. toVector3: function (e) {
  50822. return e
  50823. ? e.set(this._x, this._y, this._z)
  50824. : new n.Vector3(this._x, this._y, this._z);
  50825. },
  50826. onChange: function (e) {
  50827. return (this.onChangeCallback = e), this;
  50828. },
  50829. onChangeCallback: function () {},
  50830. }),
  50831. (n.Line3 = function (e, t) {
  50832. (this.start = void 0 !== e ? e : new n.Vector3()),
  50833. (this.end = void 0 !== t ? t : new n.Vector3());
  50834. }),
  50835. (n.Line3.prototype = {
  50836. constructor: n.Line3,
  50837. set: function (e, t) {
  50838. return this.start.copy(e), this.end.copy(t), this;
  50839. },
  50840. clone: function () {
  50841. return new this.constructor().copy(this);
  50842. },
  50843. copy: function (e) {
  50844. return this.start.copy(e.start), this.end.copy(e.end), this;
  50845. },
  50846. center: function (e) {
  50847. var t = e || new n.Vector3();
  50848. return t.addVectors(this.start, this.end).multiplyScalar(0.5);
  50849. },
  50850. delta: function (e) {
  50851. var t = e || new n.Vector3();
  50852. return t.subVectors(this.end, this.start);
  50853. },
  50854. distanceSq: function () {
  50855. return this.start.distanceToSquared(this.end);
  50856. },
  50857. distance: function () {
  50858. return this.start.distanceTo(this.end);
  50859. },
  50860. at: function (e, t) {
  50861. var i = t || new n.Vector3();
  50862. return this.delta(i).multiplyScalar(e).add(this.start);
  50863. },
  50864. closestPointToPointParameter: (function () {
  50865. var e = new n.Vector3(),
  50866. t = new n.Vector3();
  50867. return function (i, r) {
  50868. e.subVectors(i, this.start), t.subVectors(this.end, this.start);
  50869. var o = t.dot(t),
  50870. a = t.dot(e),
  50871. s = a / o;
  50872. return r && (s = n.Math.clamp(s, 0, 1)), s;
  50873. };
  50874. })(),
  50875. closestPointToPoint: function (e, t, i) {
  50876. var r = this.closestPointToPointParameter(e, t),
  50877. o = i || new n.Vector3();
  50878. return this.delta(o).multiplyScalar(r).add(this.start);
  50879. },
  50880. applyMatrix4: function (e) {
  50881. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this;
  50882. },
  50883. equals: function (e) {
  50884. return e.start.equals(this.start) && e.end.equals(this.end);
  50885. },
  50886. }),
  50887. (n.Box2 = function (e, t) {
  50888. (this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))),
  50889. (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)));
  50890. }),
  50891. (n.Box2.prototype = {
  50892. constructor: n.Box2,
  50893. set: function (e, t) {
  50894. return this.min.copy(e), this.max.copy(t), this;
  50895. },
  50896. setFromPoints: function (e) {
  50897. this.makeEmpty();
  50898. for (var t = 0, i = e.length; t < i; t++)
  50899. this.expandByPoint(e[t]);
  50900. return this;
  50901. },
  50902. setFromCenterAndSize: (function () {
  50903. var e = new n.Vector2();
  50904. return function (t, i) {
  50905. var n = e.copy(i).multiplyScalar(0.5);
  50906. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  50907. };
  50908. })(),
  50909. clone: function () {
  50910. return new this.constructor().copy(this);
  50911. },
  50912. copy: function (e) {
  50913. return this.min.copy(e.min), this.max.copy(e.max), this;
  50914. },
  50915. makeEmpty: function () {
  50916. return (
  50917. (this.min.x = this.min.y = +(1 / 0)),
  50918. (this.max.x = this.max.y = -(1 / 0)),
  50919. this
  50920. );
  50921. },
  50922. isEmpty: function () {
  50923. return this.max.x < this.min.x || this.max.y < this.min.y;
  50924. },
  50925. center: function (e) {
  50926. var t = e || new n.Vector2();
  50927. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  50928. },
  50929. size: function (e) {
  50930. var t = e || new n.Vector2();
  50931. return t.subVectors(this.max, this.min);
  50932. },
  50933. expandByPoint: function (e) {
  50934. return this.min.min(e), this.max.max(e), this;
  50935. },
  50936. expandByVector: function (e) {
  50937. return this.min.sub(e), this.max.add(e), this;
  50938. },
  50939. expandByScalar: function (e) {
  50940. return this.min.addScalar(-e), this.max.addScalar(e), this;
  50941. },
  50942. containsPoint: function (e) {
  50943. return !(
  50944. e.x < this.min.x ||
  50945. e.x > this.max.x ||
  50946. e.y < this.min.y ||
  50947. e.y > this.max.y
  50948. );
  50949. },
  50950. containsBox: function (e) {
  50951. return (
  50952. this.min.x <= e.min.x &&
  50953. e.max.x <= this.max.x &&
  50954. this.min.y <= e.min.y &&
  50955. e.max.y <= this.max.y
  50956. );
  50957. },
  50958. getParameter: function (e, t) {
  50959. var i = t || new n.Vector2();
  50960. return i.set(
  50961. (e.x - this.min.x) / (this.max.x - this.min.x),
  50962. (e.y - this.min.y) / (this.max.y - this.min.y)
  50963. );
  50964. },
  50965. intersectsBox: function (e) {
  50966. return !(
  50967. e.max.x < this.min.x ||
  50968. e.min.x > this.max.x ||
  50969. e.max.y < this.min.y ||
  50970. e.min.y > this.max.y
  50971. );
  50972. },
  50973. clampPoint: function (e, t) {
  50974. var i = t || new n.Vector2();
  50975. return i.copy(e).clamp(this.min, this.max);
  50976. },
  50977. distanceToPoint: (function () {
  50978. var e = new n.Vector2();
  50979. return function (t) {
  50980. var i = e.copy(t).clamp(this.min, this.max);
  50981. return i.sub(t).length();
  50982. };
  50983. })(),
  50984. intersect: function (e) {
  50985. return this.min.max(e.min), this.max.min(e.max), this;
  50986. },
  50987. union: function (e) {
  50988. return this.min.min(e.min), this.max.max(e.max), this;
  50989. },
  50990. translate: function (e) {
  50991. return this.min.add(e), this.max.add(e), this;
  50992. },
  50993. equals: function (e) {
  50994. return e.min.equals(this.min) && e.max.equals(this.max);
  50995. },
  50996. }),
  50997. (n.Box3 = function (e, t) {
  50998. (this.min =
  50999. void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))),
  51000. (this.max =
  51001. void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)));
  51002. }),
  51003. (n.Box3.prototype = {
  51004. constructor: n.Box3,
  51005. set: function (e, t) {
  51006. return this.min.copy(e), this.max.copy(t), this;
  51007. },
  51008. setFromArray: function (e) {
  51009. this.makeEmpty();
  51010. for (
  51011. var t = +(1 / 0),
  51012. i = +(1 / 0),
  51013. n = +(1 / 0),
  51014. r = -(1 / 0),
  51015. o = -(1 / 0),
  51016. a = -(1 / 0),
  51017. s = 0,
  51018. l = e.length;
  51019. s < l;
  51020. s += 3
  51021. ) {
  51022. var c = e[s],
  51023. h = e[s + 1],
  51024. u = e[s + 2];
  51025. c < t && (t = c),
  51026. h < i && (i = h),
  51027. u < n && (n = u),
  51028. c > r && (r = c),
  51029. h > o && (o = h),
  51030. u > a && (a = u);
  51031. }
  51032. this.min.set(t, i, n), this.max.set(r, o, a);
  51033. },
  51034. setFromPoints: function (e) {
  51035. this.makeEmpty();
  51036. for (var t = 0, i = e.length; t < i; t++)
  51037. this.expandByPoint(e[t]);
  51038. return this;
  51039. },
  51040. setFromCenterAndSize: (function () {
  51041. var e = new n.Vector3();
  51042. return function (t, i) {
  51043. var n = e.copy(i).multiplyScalar(0.5);
  51044. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  51045. };
  51046. })(),
  51047. setFromObject: (function () {
  51048. var e;
  51049. return function (t) {
  51050. void 0 === e && (e = new n.Box3());
  51051. var i = this;
  51052. return (
  51053. this.makeEmpty(),
  51054. t.updateMatrixWorld(!0),
  51055. t.traverse(function (t) {
  51056. var n = t.geometry;
  51057. void 0 !== n &&
  51058. (null === n.boundingBox && n.computeBoundingBox(),
  51059. n.boundingBox.isEmpty() === !1 &&
  51060. (e.copy(n.boundingBox),
  51061. e.applyMatrix4(t.matrixWorld),
  51062. i.union(e)));
  51063. }),
  51064. this
  51065. );
  51066. };
  51067. })(),
  51068. clone: function () {
  51069. return new this.constructor().copy(this);
  51070. },
  51071. copy: function (e) {
  51072. return this.min.copy(e.min), this.max.copy(e.max), this;
  51073. },
  51074. makeEmpty: function () {
  51075. return (
  51076. (this.min.x = this.min.y = this.min.z = +(1 / 0)),
  51077. (this.max.x = this.max.y = this.max.z = -(1 / 0)),
  51078. this
  51079. );
  51080. },
  51081. isEmpty: function () {
  51082. return (
  51083. this.max.x < this.min.x ||
  51084. this.max.y < this.min.y ||
  51085. this.max.z < this.min.z
  51086. );
  51087. },
  51088. center: function (e) {
  51089. var t = e || new n.Vector3();
  51090. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  51091. },
  51092. size: function (e) {
  51093. var t = e || new n.Vector3();
  51094. return t.subVectors(this.max, this.min);
  51095. },
  51096. expandByPoint: function (e) {
  51097. return this.min.min(e), this.max.max(e), this;
  51098. },
  51099. expandByVector: function (e) {
  51100. return this.min.sub(e), this.max.add(e), this;
  51101. },
  51102. expandByScalar: function (e) {
  51103. return this.min.addScalar(-e), this.max.addScalar(e), this;
  51104. },
  51105. containsPoint: function (e) {
  51106. return !(
  51107. e.x < this.min.x ||
  51108. e.x > this.max.x ||
  51109. e.y < this.min.y ||
  51110. e.y > this.max.y ||
  51111. e.z < this.min.z ||
  51112. e.z > this.max.z
  51113. );
  51114. },
  51115. containsBox: function (e) {
  51116. return (
  51117. this.min.x <= e.min.x &&
  51118. e.max.x <= this.max.x &&
  51119. this.min.y <= e.min.y &&
  51120. e.max.y <= this.max.y &&
  51121. this.min.z <= e.min.z &&
  51122. e.max.z <= this.max.z
  51123. );
  51124. },
  51125. getParameter: function (e, t) {
  51126. var i = t || new n.Vector3();
  51127. return i.set(
  51128. (e.x - this.min.x) / (this.max.x - this.min.x),
  51129. (e.y - this.min.y) / (this.max.y - this.min.y),
  51130. (e.z - this.min.z) / (this.max.z - this.min.z)
  51131. );
  51132. },
  51133. intersectsBox: function (e) {
  51134. return !(
  51135. e.max.x < this.min.x ||
  51136. e.min.x > this.max.x ||
  51137. e.max.y < this.min.y ||
  51138. e.min.y > this.max.y ||
  51139. e.max.z < this.min.z ||
  51140. e.min.z > this.max.z
  51141. );
  51142. },
  51143. intersectsSphere: (function () {
  51144. var e;
  51145. return function (t) {
  51146. return (
  51147. void 0 === e && (e = new n.Vector3()),
  51148. this.clampPoint(t.center, e),
  51149. e.distanceToSquared(t.center) <= t.radius * t.radius
  51150. );
  51151. };
  51152. })(),
  51153. intersectsPlane: function (e) {
  51154. var t, i;
  51155. return (
  51156. e.normal.x > 0
  51157. ? ((t = e.normal.x * this.min.x),
  51158. (i = e.normal.x * this.max.x))
  51159. : ((t = e.normal.x * this.max.x),
  51160. (i = e.normal.x * this.min.x)),
  51161. e.normal.y > 0
  51162. ? ((t += e.normal.y * this.min.y),
  51163. (i += e.normal.y * this.max.y))
  51164. : ((t += e.normal.y * this.max.y),
  51165. (i += e.normal.y * this.min.y)),
  51166. e.normal.z > 0
  51167. ? ((t += e.normal.z * this.min.z),
  51168. (i += e.normal.z * this.max.z))
  51169. : ((t += e.normal.z * this.max.z),
  51170. (i += e.normal.z * this.min.z)),
  51171. t <= e.constant && i >= e.constant
  51172. );
  51173. },
  51174. clampPoint: function (e, t) {
  51175. var i = t || new n.Vector3();
  51176. return i.copy(e).clamp(this.min, this.max);
  51177. },
  51178. distanceToPoint: (function () {
  51179. var e = new n.Vector3();
  51180. return function (t) {
  51181. var i = e.copy(t).clamp(this.min, this.max);
  51182. return i.sub(t).length();
  51183. };
  51184. })(),
  51185. getBoundingSphere: (function () {
  51186. var e = new n.Vector3();
  51187. return function (t) {
  51188. var i = t || new n.Sphere();
  51189. return (
  51190. (i.center = this.center()),
  51191. (i.radius = 0.5 * this.size(e).length()),
  51192. i
  51193. );
  51194. };
  51195. })(),
  51196. intersect: function (e) {
  51197. return this.min.max(e.min), this.max.min(e.max), this;
  51198. },
  51199. union: function (e) {
  51200. return this.min.min(e.min), this.max.max(e.max), this;
  51201. },
  51202. applyMatrix4: (function () {
  51203. var e = [
  51204. new n.Vector3(),
  51205. new n.Vector3(),
  51206. new n.Vector3(),
  51207. new n.Vector3(),
  51208. new n.Vector3(),
  51209. new n.Vector3(),
  51210. new n.Vector3(),
  51211. new n.Vector3(),
  51212. ];
  51213. return function (t) {
  51214. return (
  51215. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  51216. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  51217. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  51218. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  51219. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  51220. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  51221. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  51222. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  51223. this.makeEmpty(),
  51224. this.setFromPoints(e),
  51225. this
  51226. );
  51227. };
  51228. })(),
  51229. translate: function (e) {
  51230. return this.min.add(e), this.max.add(e), this;
  51231. },
  51232. equals: function (e) {
  51233. return e.min.equals(this.min) && e.max.equals(this.max);
  51234. },
  51235. }),
  51236. (n.Matrix3 = function () {
  51237. (this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])),
  51238. arguments.length > 0 &&
  51239. console.error(
  51240. "THREE.Matrix3: the constructor no longer reads arguments. use .set() instead."
  51241. );
  51242. }),
  51243. (n.Matrix3.prototype = {
  51244. constructor: n.Matrix3,
  51245. set: function (e, t, i, n, r, o, a, s, l) {
  51246. var c = this.elements;
  51247. return (
  51248. (c[0] = e),
  51249. (c[1] = n),
  51250. (c[2] = a),
  51251. (c[3] = t),
  51252. (c[4] = r),
  51253. (c[5] = s),
  51254. (c[6] = i),
  51255. (c[7] = o),
  51256. (c[8] = l),
  51257. this
  51258. );
  51259. },
  51260. identity: function () {
  51261. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
  51262. },
  51263. clone: function () {
  51264. return new this.constructor().fromArray(this.elements);
  51265. },
  51266. copy: function (e) {
  51267. var t = e.elements;
  51268. return (
  51269. this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  51270. this
  51271. );
  51272. },
  51273. setFromMatrix4: function (e) {
  51274. var t = e.elements;
  51275. return (
  51276. this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  51277. this
  51278. );
  51279. },
  51280. applyToVector3Array: (function () {
  51281. var e;
  51282. return function (t, i, r) {
  51283. void 0 === e && (e = new n.Vector3()),
  51284. void 0 === i && (i = 0),
  51285. void 0 === r && (r = t.length);
  51286. for (var o = 0, a = i; o < r; o += 3, a += 3)
  51287. e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a);
  51288. return t;
  51289. };
  51290. })(),
  51291. applyToBuffer: (function () {
  51292. var e;
  51293. return function (t, i, r) {
  51294. void 0 === e && (e = new n.Vector3()),
  51295. void 0 === i && (i = 0),
  51296. void 0 === r && (r = t.length / t.itemSize);
  51297. for (var o = 0, a = i; o < r; o++, a++)
  51298. (e.x = t.getX(a)),
  51299. (e.y = t.getY(a)),
  51300. (e.z = t.getZ(a)),
  51301. e.applyMatrix3(this),
  51302. t.setXYZ(e.x, e.y, e.z);
  51303. return t;
  51304. };
  51305. })(),
  51306. multiplyScalar: function (e) {
  51307. var t = this.elements;
  51308. return (
  51309. (t[0] *= e),
  51310. (t[3] *= e),
  51311. (t[6] *= e),
  51312. (t[1] *= e),
  51313. (t[4] *= e),
  51314. (t[7] *= e),
  51315. (t[2] *= e),
  51316. (t[5] *= e),
  51317. (t[8] *= e),
  51318. this
  51319. );
  51320. },
  51321. determinant: function () {
  51322. var e = this.elements,
  51323. t = e[0],
  51324. i = e[1],
  51325. n = e[2],
  51326. r = e[3],
  51327. o = e[4],
  51328. a = e[5],
  51329. s = e[6],
  51330. l = e[7],
  51331. c = e[8];
  51332. return (
  51333. t * o * c -
  51334. t * a * l -
  51335. i * r * c +
  51336. i * a * s +
  51337. n * r * l -
  51338. n * o * s
  51339. );
  51340. },
  51341. getInverse: function (e, t) {
  51342. e instanceof n.Matrix4 &&
  51343. console.warn(
  51344. "THREE.Matrix3.getInverse no longer takes a Matrix4 argument."
  51345. );
  51346. var i = e.elements,
  51347. r = this.elements,
  51348. o = i[0],
  51349. a = i[1],
  51350. s = i[2],
  51351. l = i[3],
  51352. c = i[4],
  51353. h = i[5],
  51354. u = i[6],
  51355. d = i[7],
  51356. p = i[8],
  51357. f = p * c - h * d,
  51358. g = h * u - p * l,
  51359. m = d * l - c * u,
  51360. v = o * f + a * g + s * m;
  51361. if (0 === v) {
  51362. var A =
  51363. "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  51364. if (t) throw new Error(A);
  51365. return console.warn(A), this.identity();
  51366. }
  51367. return (
  51368. (r[0] = f),
  51369. (r[1] = s * d - p * a),
  51370. (r[2] = h * a - s * c),
  51371. (r[3] = g),
  51372. (r[4] = p * o - s * u),
  51373. (r[5] = s * l - h * o),
  51374. (r[6] = m),
  51375. (r[7] = a * u - d * o),
  51376. (r[8] = c * o - a * l),
  51377. this.multiplyScalar(1 / v)
  51378. );
  51379. },
  51380. transpose: function () {
  51381. var e,
  51382. t = this.elements;
  51383. return (
  51384. (e = t[1]),
  51385. (t[1] = t[3]),
  51386. (t[3] = e),
  51387. (e = t[2]),
  51388. (t[2] = t[6]),
  51389. (t[6] = e),
  51390. (e = t[5]),
  51391. (t[5] = t[7]),
  51392. (t[7] = e),
  51393. this
  51394. );
  51395. },
  51396. flattenToArrayOffset: function (e, t) {
  51397. var i = this.elements;
  51398. return (
  51399. (e[t] = i[0]),
  51400. (e[t + 1] = i[1]),
  51401. (e[t + 2] = i[2]),
  51402. (e[t + 3] = i[3]),
  51403. (e[t + 4] = i[4]),
  51404. (e[t + 5] = i[5]),
  51405. (e[t + 6] = i[6]),
  51406. (e[t + 7] = i[7]),
  51407. (e[t + 8] = i[8]),
  51408. e
  51409. );
  51410. },
  51411. getNormalMatrix: function (e) {
  51412. return this.setFromMatrix4(e).getInverse(this).transpose();
  51413. },
  51414. transposeIntoArray: function (e) {
  51415. var t = this.elements;
  51416. return (
  51417. (e[0] = t[0]),
  51418. (e[1] = t[3]),
  51419. (e[2] = t[6]),
  51420. (e[3] = t[1]),
  51421. (e[4] = t[4]),
  51422. (e[5] = t[7]),
  51423. (e[6] = t[2]),
  51424. (e[7] = t[5]),
  51425. (e[8] = t[8]),
  51426. this
  51427. );
  51428. },
  51429. fromArray: function (e) {
  51430. return this.elements.set(e), this;
  51431. },
  51432. toArray: function () {
  51433. var e = this.elements;
  51434. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]];
  51435. },
  51436. }),
  51437. (n.Matrix4 = function () {
  51438. (this.elements = new Float32Array([
  51439. 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
  51440. ])),
  51441. arguments.length > 0 &&
  51442. console.error(
  51443. "THREE.Matrix4: the constructor no longer reads arguments. use .set() instead."
  51444. );
  51445. }),
  51446. (n.Matrix4.prototype = {
  51447. constructor: n.Matrix4,
  51448. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  51449. var m = this.elements;
  51450. return (
  51451. (m[0] = e),
  51452. (m[4] = t),
  51453. (m[8] = i),
  51454. (m[12] = n),
  51455. (m[1] = r),
  51456. (m[5] = o),
  51457. (m[9] = a),
  51458. (m[13] = s),
  51459. (m[2] = l),
  51460. (m[6] = c),
  51461. (m[10] = h),
  51462. (m[14] = u),
  51463. (m[3] = d),
  51464. (m[7] = p),
  51465. (m[11] = f),
  51466. (m[15] = g),
  51467. this
  51468. );
  51469. },
  51470. identity: function () {
  51471. return (
  51472. this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  51473. );
  51474. },
  51475. clone: function () {
  51476. return new n.Matrix4().fromArray(this.elements);
  51477. },
  51478. copy: function (e) {
  51479. return this.elements.set(e.elements), this;
  51480. },
  51481. copyPosition: function (e) {
  51482. var t = this.elements,
  51483. i = e.elements;
  51484. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this;
  51485. },
  51486. extractBasis: function (e, t, i) {
  51487. return (
  51488. e.setFromMatrixColumn(this, 0),
  51489. t.setFromMatrixColumn(this, 1),
  51490. i.setFromMatrixColumn(this, 2),
  51491. this
  51492. );
  51493. },
  51494. makeBasis: function (e, t, i) {
  51495. return (
  51496. this.set(
  51497. e.x,
  51498. t.x,
  51499. i.x,
  51500. 0,
  51501. e.y,
  51502. t.y,
  51503. i.y,
  51504. 0,
  51505. e.z,
  51506. t.z,
  51507. i.z,
  51508. 0,
  51509. 0,
  51510. 0,
  51511. 0,
  51512. 1
  51513. ),
  51514. this
  51515. );
  51516. },
  51517. extractRotation: (function () {
  51518. var e;
  51519. return function (t) {
  51520. void 0 === e && (e = new n.Vector3());
  51521. var i = this.elements,
  51522. r = t.elements,
  51523. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  51524. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  51525. s = 1 / e.setFromMatrixColumn(t, 2).length();
  51526. return (
  51527. (i[0] = r[0] * o),
  51528. (i[1] = r[1] * o),
  51529. (i[2] = r[2] * o),
  51530. (i[4] = r[4] * a),
  51531. (i[5] = r[5] * a),
  51532. (i[6] = r[6] * a),
  51533. (i[8] = r[8] * s),
  51534. (i[9] = r[9] * s),
  51535. (i[10] = r[10] * s),
  51536. this
  51537. );
  51538. };
  51539. })(),
  51540. makeRotationFromEuler: function (e) {
  51541. e instanceof n.Euler == !1 &&
  51542. console.error(
  51543. "THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order."
  51544. );
  51545. var t = this.elements,
  51546. i = e.x,
  51547. r = e.y,
  51548. o = e.z,
  51549. a = Math.cos(i),
  51550. s = Math.sin(i),
  51551. l = Math.cos(r),
  51552. c = Math.sin(r),
  51553. h = Math.cos(o),
  51554. u = Math.sin(o);
  51555. if ("XYZ" === e.order) {
  51556. var d = a * h,
  51557. p = a * u,
  51558. f = s * h,
  51559. g = s * u;
  51560. (t[0] = l * h),
  51561. (t[4] = -l * u),
  51562. (t[8] = c),
  51563. (t[1] = p + f * c),
  51564. (t[5] = d - g * c),
  51565. (t[9] = -s * l),
  51566. (t[2] = g - d * c),
  51567. (t[6] = f + p * c),
  51568. (t[10] = a * l);
  51569. } else if ("YXZ" === e.order) {
  51570. var m = l * h,
  51571. v = l * u,
  51572. A = c * h,
  51573. y = c * u;
  51574. (t[0] = m + y * s),
  51575. (t[4] = A * s - v),
  51576. (t[8] = a * c),
  51577. (t[1] = a * u),
  51578. (t[5] = a * h),
  51579. (t[9] = -s),
  51580. (t[2] = v * s - A),
  51581. (t[6] = y + m * s),
  51582. (t[10] = a * l);
  51583. } else if ("ZXY" === e.order) {
  51584. var m = l * h,
  51585. v = l * u,
  51586. A = c * h,
  51587. y = c * u;
  51588. (t[0] = m - y * s),
  51589. (t[4] = -a * u),
  51590. (t[8] = A + v * s),
  51591. (t[1] = v + A * s),
  51592. (t[5] = a * h),
  51593. (t[9] = y - m * s),
  51594. (t[2] = -a * c),
  51595. (t[6] = s),
  51596. (t[10] = a * l);
  51597. } else if ("ZYX" === e.order) {
  51598. var d = a * h,
  51599. p = a * u,
  51600. f = s * h,
  51601. g = s * u;
  51602. (t[0] = l * h),
  51603. (t[4] = f * c - p),
  51604. (t[8] = d * c + g),
  51605. (t[1] = l * u),
  51606. (t[5] = g * c + d),
  51607. (t[9] = p * c - f),
  51608. (t[2] = -c),
  51609. (t[6] = s * l),
  51610. (t[10] = a * l);
  51611. } else if ("YZX" === e.order) {
  51612. var C = a * l,
  51613. I = a * c,
  51614. E = s * l,
  51615. b = s * c;
  51616. (t[0] = l * h),
  51617. (t[4] = b - C * u),
  51618. (t[8] = E * u + I),
  51619. (t[1] = u),
  51620. (t[5] = a * h),
  51621. (t[9] = -s * h),
  51622. (t[2] = -c * h),
  51623. (t[6] = I * u + E),
  51624. (t[10] = C - b * u);
  51625. } else if ("XZY" === e.order) {
  51626. var C = a * l,
  51627. I = a * c,
  51628. E = s * l,
  51629. b = s * c;
  51630. (t[0] = l * h),
  51631. (t[4] = -u),
  51632. (t[8] = c * h),
  51633. (t[1] = C * u + b),
  51634. (t[5] = a * h),
  51635. (t[9] = I * u - E),
  51636. (t[2] = E * u - I),
  51637. (t[6] = s * h),
  51638. (t[10] = b * u + C);
  51639. }
  51640. return (
  51641. (t[3] = 0),
  51642. (t[7] = 0),
  51643. (t[11] = 0),
  51644. (t[12] = 0),
  51645. (t[13] = 0),
  51646. (t[14] = 0),
  51647. (t[15] = 1),
  51648. this
  51649. );
  51650. },
  51651. makeRotationFromQuaternion: function (e) {
  51652. var t = this.elements,
  51653. i = e.x,
  51654. n = e.y,
  51655. r = e.z,
  51656. o = e.w,
  51657. a = i + i,
  51658. s = n + n,
  51659. l = r + r,
  51660. c = i * a,
  51661. h = i * s,
  51662. u = i * l,
  51663. d = n * s,
  51664. p = n * l,
  51665. f = r * l,
  51666. g = o * a,
  51667. m = o * s,
  51668. v = o * l;
  51669. return (
  51670. (t[0] = 1 - (d + f)),
  51671. (t[4] = h - v),
  51672. (t[8] = u + m),
  51673. (t[1] = h + v),
  51674. (t[5] = 1 - (c + f)),
  51675. (t[9] = p - g),
  51676. (t[2] = u - m),
  51677. (t[6] = p + g),
  51678. (t[10] = 1 - (c + d)),
  51679. (t[3] = 0),
  51680. (t[7] = 0),
  51681. (t[11] = 0),
  51682. (t[12] = 0),
  51683. (t[13] = 0),
  51684. (t[14] = 0),
  51685. (t[15] = 1),
  51686. this
  51687. );
  51688. },
  51689. lookAt: (function () {
  51690. var e, t, i;
  51691. return function (r, o, a) {
  51692. void 0 === e && (e = new n.Vector3()),
  51693. void 0 === t && (t = new n.Vector3()),
  51694. void 0 === i && (i = new n.Vector3());
  51695. var s = this.elements;
  51696. return (
  51697. i.subVectors(r, o).normalize(),
  51698. 0 === i.lengthSq() && (i.z = 1),
  51699. e.crossVectors(a, i).normalize(),
  51700. 0 === e.lengthSq() &&
  51701. ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  51702. t.crossVectors(i, e),
  51703. (s[0] = e.x),
  51704. (s[4] = t.x),
  51705. (s[8] = i.x),
  51706. (s[1] = e.y),
  51707. (s[5] = t.y),
  51708. (s[9] = i.y),
  51709. (s[2] = e.z),
  51710. (s[6] = t.z),
  51711. (s[10] = i.z),
  51712. this
  51713. );
  51714. };
  51715. })(),
  51716. multiply: function (e, t) {
  51717. return void 0 !== t
  51718. ? (console.warn(
  51719. "THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."
  51720. ),
  51721. this.multiplyMatrices(e, t))
  51722. : this.multiplyMatrices(this, e);
  51723. },
  51724. multiplyMatrices: function (e, t) {
  51725. var i = e.elements,
  51726. n = t.elements,
  51727. r = this.elements,
  51728. o = i[0],
  51729. a = i[4],
  51730. s = i[8],
  51731. l = i[12],
  51732. c = i[1],
  51733. h = i[5],
  51734. u = i[9],
  51735. d = i[13],
  51736. p = i[2],
  51737. f = i[6],
  51738. g = i[10],
  51739. m = i[14],
  51740. v = i[3],
  51741. A = i[7],
  51742. y = i[11],
  51743. C = i[15],
  51744. I = n[0],
  51745. E = n[4],
  51746. b = n[8],
  51747. w = n[12],
  51748. _ = n[1],
  51749. T = n[5],
  51750. x = n[9],
  51751. S = n[13],
  51752. M = n[2],
  51753. R = n[6],
  51754. P = n[10],
  51755. O = n[14],
  51756. L = n[3],
  51757. D = n[7],
  51758. N = n[11],
  51759. B = n[15];
  51760. return (
  51761. (r[0] = o * I + a * _ + s * M + l * L),
  51762. (r[4] = o * E + a * T + s * R + l * D),
  51763. (r[8] = o * b + a * x + s * P + l * N),
  51764. (r[12] = o * w + a * S + s * O + l * B),
  51765. (r[1] = c * I + h * _ + u * M + d * L),
  51766. (r[5] = c * E + h * T + u * R + d * D),
  51767. (r[9] = c * b + h * x + u * P + d * N),
  51768. (r[13] = c * w + h * S + u * O + d * B),
  51769. (r[2] = p * I + f * _ + g * M + m * L),
  51770. (r[6] = p * E + f * T + g * R + m * D),
  51771. (r[10] = p * b + f * x + g * P + m * N),
  51772. (r[14] = p * w + f * S + g * O + m * B),
  51773. (r[3] = v * I + A * _ + y * M + C * L),
  51774. (r[7] = v * E + A * T + y * R + C * D),
  51775. (r[11] = v * b + A * x + y * P + C * N),
  51776. (r[15] = v * w + A * S + y * O + C * B),
  51777. this
  51778. );
  51779. },
  51780. multiplyToArray: function (e, t, i) {
  51781. var n = this.elements;
  51782. return (
  51783. this.multiplyMatrices(e, t),
  51784. (i[0] = n[0]),
  51785. (i[1] = n[1]),
  51786. (i[2] = n[2]),
  51787. (i[3] = n[3]),
  51788. (i[4] = n[4]),
  51789. (i[5] = n[5]),
  51790. (i[6] = n[6]),
  51791. (i[7] = n[7]),
  51792. (i[8] = n[8]),
  51793. (i[9] = n[9]),
  51794. (i[10] = n[10]),
  51795. (i[11] = n[11]),
  51796. (i[12] = n[12]),
  51797. (i[13] = n[13]),
  51798. (i[14] = n[14]),
  51799. (i[15] = n[15]),
  51800. this
  51801. );
  51802. },
  51803. multiplyScalar: function (e) {
  51804. var t = this.elements;
  51805. return (
  51806. (t[0] *= e),
  51807. (t[4] *= e),
  51808. (t[8] *= e),
  51809. (t[12] *= e),
  51810. (t[1] *= e),
  51811. (t[5] *= e),
  51812. (t[9] *= e),
  51813. (t[13] *= e),
  51814. (t[2] *= e),
  51815. (t[6] *= e),
  51816. (t[10] *= e),
  51817. (t[14] *= e),
  51818. (t[3] *= e),
  51819. (t[7] *= e),
  51820. (t[11] *= e),
  51821. (t[15] *= e),
  51822. this
  51823. );
  51824. },
  51825. applyToVector3Array: (function () {
  51826. var e;
  51827. return function (t, i, r) {
  51828. void 0 === e && (e = new n.Vector3()),
  51829. void 0 === i && (i = 0),
  51830. void 0 === r && (r = t.length);
  51831. for (var o = 0, a = i; o < r; o += 3, a += 3)
  51832. e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a);
  51833. return t;
  51834. };
  51835. })(),
  51836. applyToBuffer: (function () {
  51837. var e;
  51838. return function (t, i, r) {
  51839. void 0 === e && (e = new n.Vector3()),
  51840. void 0 === i && (i = 0),
  51841. void 0 === r && (r = t.length / t.itemSize);
  51842. for (var o = 0, a = i; o < r; o++, a++)
  51843. (e.x = t.getX(a)),
  51844. (e.y = t.getY(a)),
  51845. (e.z = t.getZ(a)),
  51846. e.applyMatrix4(this),
  51847. t.setXYZ(e.x, e.y, e.z);
  51848. return t;
  51849. };
  51850. })(),
  51851. determinant: function () {
  51852. var e = this.elements,
  51853. t = e[0],
  51854. i = e[4],
  51855. n = e[8],
  51856. r = e[12],
  51857. o = e[1],
  51858. a = e[5],
  51859. s = e[9],
  51860. l = e[13],
  51861. c = e[2],
  51862. h = e[6],
  51863. u = e[10],
  51864. d = e[14],
  51865. p = e[3],
  51866. f = e[7],
  51867. g = e[11],
  51868. m = e[15];
  51869. return (
  51870. p *
  51871. (+r * s * h -
  51872. n * l * h -
  51873. r * a * u +
  51874. i * l * u +
  51875. n * a * d -
  51876. i * s * d) +
  51877. f *
  51878. (+t * s * d -
  51879. t * l * u +
  51880. r * o * u -
  51881. n * o * d +
  51882. n * l * c -
  51883. r * s * c) +
  51884. g *
  51885. (+t * l * h -
  51886. t * a * d -
  51887. r * o * h +
  51888. i * o * d +
  51889. r * a * c -
  51890. i * l * c) +
  51891. m *
  51892. (-n * a * c -
  51893. t * s * h +
  51894. t * a * u +
  51895. n * o * h -
  51896. i * o * u +
  51897. i * s * c)
  51898. );
  51899. },
  51900. transpose: function () {
  51901. var e,
  51902. t = this.elements;
  51903. return (
  51904. (e = t[1]),
  51905. (t[1] = t[4]),
  51906. (t[4] = e),
  51907. (e = t[2]),
  51908. (t[2] = t[8]),
  51909. (t[8] = e),
  51910. (e = t[6]),
  51911. (t[6] = t[9]),
  51912. (t[9] = e),
  51913. (e = t[3]),
  51914. (t[3] = t[12]),
  51915. (t[12] = e),
  51916. (e = t[7]),
  51917. (t[7] = t[13]),
  51918. (t[13] = e),
  51919. (e = t[11]),
  51920. (t[11] = t[14]),
  51921. (t[14] = e),
  51922. this
  51923. );
  51924. },
  51925. flattenToArrayOffset: function (e, t) {
  51926. var i = this.elements;
  51927. return (
  51928. (e[t] = i[0]),
  51929. (e[t + 1] = i[1]),
  51930. (e[t + 2] = i[2]),
  51931. (e[t + 3] = i[3]),
  51932. (e[t + 4] = i[4]),
  51933. (e[t + 5] = i[5]),
  51934. (e[t + 6] = i[6]),
  51935. (e[t + 7] = i[7]),
  51936. (e[t + 8] = i[8]),
  51937. (e[t + 9] = i[9]),
  51938. (e[t + 10] = i[10]),
  51939. (e[t + 11] = i[11]),
  51940. (e[t + 12] = i[12]),
  51941. (e[t + 13] = i[13]),
  51942. (e[t + 14] = i[14]),
  51943. (e[t + 15] = i[15]),
  51944. e
  51945. );
  51946. },
  51947. getPosition: (function () {
  51948. var e;
  51949. return function () {
  51950. return (
  51951. void 0 === e && (e = new n.Vector3()),
  51952. console.warn(
  51953. "THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."
  51954. ),
  51955. e.setFromMatrixColumn(this, 3)
  51956. );
  51957. };
  51958. })(),
  51959. setPosition: function (e) {
  51960. var t = this.elements;
  51961. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this;
  51962. },
  51963. getInverse: function (e, t) {
  51964. var i = this.elements,
  51965. n = e.elements,
  51966. r = n[0],
  51967. o = n[1],
  51968. a = n[2],
  51969. s = n[3],
  51970. l = n[4],
  51971. c = n[5],
  51972. h = n[6],
  51973. u = n[7],
  51974. d = n[8],
  51975. p = n[9],
  51976. f = n[10],
  51977. g = n[11],
  51978. m = n[12],
  51979. v = n[13],
  51980. A = n[14],
  51981. y = n[15],
  51982. C =
  51983. p * A * u -
  51984. v * f * u +
  51985. v * h * g -
  51986. c * A * g -
  51987. p * h * y +
  51988. c * f * y,
  51989. I =
  51990. m * f * u -
  51991. d * A * u -
  51992. m * h * g +
  51993. l * A * g +
  51994. d * h * y -
  51995. l * f * y,
  51996. E =
  51997. d * v * u -
  51998. m * p * u +
  51999. m * c * g -
  52000. l * v * g -
  52001. d * c * y +
  52002. l * p * y,
  52003. b =
  52004. m * p * h -
  52005. d * v * h -
  52006. m * c * f +
  52007. l * v * f +
  52008. d * c * A -
  52009. l * p * A,
  52010. w = r * C + o * I + a * E + s * b;
  52011. if (0 === w) {
  52012. var _ =
  52013. "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  52014. if (t) throw new Error(_);
  52015. return console.warn(_), this.identity();
  52016. }
  52017. return (
  52018. (i[0] = C),
  52019. (i[1] =
  52020. v * f * s -
  52021. p * A * s -
  52022. v * a * g +
  52023. o * A * g +
  52024. p * a * y -
  52025. o * f * y),
  52026. (i[2] =
  52027. c * A * s -
  52028. v * h * s +
  52029. v * a * u -
  52030. o * A * u -
  52031. c * a * y +
  52032. o * h * y),
  52033. (i[3] =
  52034. p * h * s -
  52035. c * f * s -
  52036. p * a * u +
  52037. o * f * u +
  52038. c * a * g -
  52039. o * h * g),
  52040. (i[4] = I),
  52041. (i[5] =
  52042. d * A * s -
  52043. m * f * s +
  52044. m * a * g -
  52045. r * A * g -
  52046. d * a * y +
  52047. r * f * y),
  52048. (i[6] =
  52049. m * h * s -
  52050. l * A * s -
  52051. m * a * u +
  52052. r * A * u +
  52053. l * a * y -
  52054. r * h * y),
  52055. (i[7] =
  52056. l * f * s -
  52057. d * h * s +
  52058. d * a * u -
  52059. r * f * u -
  52060. l * a * g +
  52061. r * h * g),
  52062. (i[8] = E),
  52063. (i[9] =
  52064. m * p * s -
  52065. d * v * s -
  52066. m * o * g +
  52067. r * v * g +
  52068. d * o * y -
  52069. r * p * y),
  52070. (i[10] =
  52071. l * v * s -
  52072. m * c * s +
  52073. m * o * u -
  52074. r * v * u -
  52075. l * o * y +
  52076. r * c * y),
  52077. (i[11] =
  52078. d * c * s -
  52079. l * p * s -
  52080. d * o * u +
  52081. r * p * u +
  52082. l * o * g -
  52083. r * c * g),
  52084. (i[12] = b),
  52085. (i[13] =
  52086. d * v * a -
  52087. m * p * a +
  52088. m * o * f -
  52089. r * v * f -
  52090. d * o * A +
  52091. r * p * A),
  52092. (i[14] =
  52093. m * c * a -
  52094. l * v * a -
  52095. m * o * h +
  52096. r * v * h +
  52097. l * o * A -
  52098. r * c * A),
  52099. (i[15] =
  52100. l * p * a -
  52101. d * c * a +
  52102. d * o * h -
  52103. r * p * h -
  52104. l * o * f +
  52105. r * c * f),
  52106. this.multiplyScalar(1 / w)
  52107. );
  52108. },
  52109. scale: function (e) {
  52110. var t = this.elements,
  52111. i = e.x,
  52112. n = e.y,
  52113. r = e.z;
  52114. return (
  52115. (t[0] *= i),
  52116. (t[4] *= n),
  52117. (t[8] *= r),
  52118. (t[1] *= i),
  52119. (t[5] *= n),
  52120. (t[9] *= r),
  52121. (t[2] *= i),
  52122. (t[6] *= n),
  52123. (t[10] *= r),
  52124. (t[3] *= i),
  52125. (t[7] *= n),
  52126. (t[11] *= r),
  52127. this
  52128. );
  52129. },
  52130. getMaxScaleOnAxis: function () {
  52131. var e = this.elements,
  52132. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  52133. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  52134. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  52135. return Math.sqrt(Math.max(t, i, n));
  52136. },
  52137. makeTranslation: function (e, t, i) {
  52138. return (
  52139. this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  52140. );
  52141. },
  52142. makeRotationX: function (e) {
  52143. var t = Math.cos(e),
  52144. i = Math.sin(e);
  52145. return (
  52146. this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  52147. );
  52148. },
  52149. makeRotationY: function (e) {
  52150. var t = Math.cos(e),
  52151. i = Math.sin(e);
  52152. return (
  52153. this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  52154. );
  52155. },
  52156. makeRotationZ: function (e) {
  52157. var t = Math.cos(e),
  52158. i = Math.sin(e);
  52159. return (
  52160. this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  52161. );
  52162. },
  52163. makeRotationAxis: function (e, t) {
  52164. var i = Math.cos(t),
  52165. n = Math.sin(t),
  52166. r = 1 - i,
  52167. o = e.x,
  52168. a = e.y,
  52169. s = e.z,
  52170. l = r * o,
  52171. c = r * a;
  52172. return (
  52173. this.set(
  52174. l * o + i,
  52175. l * a - n * s,
  52176. l * s + n * a,
  52177. 0,
  52178. l * a + n * s,
  52179. c * a + i,
  52180. c * s - n * o,
  52181. 0,
  52182. l * s - n * a,
  52183. c * s + n * o,
  52184. r * s * s + i,
  52185. 0,
  52186. 0,
  52187. 0,
  52188. 0,
  52189. 1
  52190. ),
  52191. this
  52192. );
  52193. },
  52194. makeScale: function (e, t, i) {
  52195. return (
  52196. this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  52197. );
  52198. },
  52199. compose: function (e, t, i) {
  52200. return (
  52201. this.makeRotationFromQuaternion(t),
  52202. this.scale(i),
  52203. this.setPosition(e),
  52204. this
  52205. );
  52206. },
  52207. decompose: (function () {
  52208. var e, t;
  52209. return function (i, r, o) {
  52210. void 0 === e && (e = new n.Vector3()),
  52211. void 0 === t && (t = new n.Matrix4());
  52212. var a = this.elements,
  52213. s = e.set(a[0], a[1], a[2]).length(),
  52214. l = e.set(a[4], a[5], a[6]).length(),
  52215. c = e.set(a[8], a[9], a[10]).length(),
  52216. h = this.determinant();
  52217. h < 0 && (s = -s),
  52218. (i.x = a[12]),
  52219. (i.y = a[13]),
  52220. (i.z = a[14]),
  52221. t.elements.set(this.elements);
  52222. var u = 1 / s,
  52223. d = 1 / l,
  52224. p = 1 / c;
  52225. return (
  52226. (t.elements[0] *= u),
  52227. (t.elements[1] *= u),
  52228. (t.elements[2] *= u),
  52229. (t.elements[4] *= d),
  52230. (t.elements[5] *= d),
  52231. (t.elements[6] *= d),
  52232. (t.elements[8] *= p),
  52233. (t.elements[9] *= p),
  52234. (t.elements[10] *= p),
  52235. r.setFromRotationMatrix(t),
  52236. (o.x = s),
  52237. (o.y = l),
  52238. (o.z = c),
  52239. this
  52240. );
  52241. };
  52242. })(),
  52243. makeFrustum: function (e, t, i, n, r, o) {
  52244. var a = this.elements,
  52245. s = (2 * r) / (t - e),
  52246. l = (2 * r) / (n - i),
  52247. c = (t + e) / (t - e),
  52248. h = (n + i) / (n - i),
  52249. u = -(o + r) / (o - r),
  52250. d = (-2 * o * r) / (o - r);
  52251. return (
  52252. (a[0] = s),
  52253. (a[4] = 0),
  52254. (a[8] = c),
  52255. (a[12] = 0),
  52256. (a[1] = 0),
  52257. (a[5] = l),
  52258. (a[9] = h),
  52259. (a[13] = 0),
  52260. (a[2] = 0),
  52261. (a[6] = 0),
  52262. (a[10] = u),
  52263. (a[14] = d),
  52264. (a[3] = 0),
  52265. (a[7] = 0),
  52266. (a[11] = -1),
  52267. (a[15] = 0),
  52268. this
  52269. );
  52270. },
  52271. makePerspective: function (e, t, i, r) {
  52272. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  52273. a = -o,
  52274. s = a * t,
  52275. l = o * t;
  52276. return this.makeFrustum(s, l, a, o, i, r);
  52277. },
  52278. makeOrthographic: function (e, t, i, n, r, o) {
  52279. var a = this.elements,
  52280. s = 1 / (t - e),
  52281. l = 1 / (i - n),
  52282. c = 1 / (o - r),
  52283. h = (t + e) * s,
  52284. u = (i + n) * l,
  52285. d = (o + r) * c;
  52286. return (
  52287. (a[0] = 2 * s),
  52288. (a[4] = 0),
  52289. (a[8] = 0),
  52290. (a[12] = -h),
  52291. (a[1] = 0),
  52292. (a[5] = 2 * l),
  52293. (a[9] = 0),
  52294. (a[13] = -u),
  52295. (a[2] = 0),
  52296. (a[6] = 0),
  52297. (a[10] = -2 * c),
  52298. (a[14] = -d),
  52299. (a[3] = 0),
  52300. (a[7] = 0),
  52301. (a[11] = 0),
  52302. (a[15] = 1),
  52303. this
  52304. );
  52305. },
  52306. equals: function (e) {
  52307. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  52308. if (t[n] !== i[n]) return !1;
  52309. return !0;
  52310. },
  52311. fromArray: function (e) {
  52312. return this.elements.set(e), this;
  52313. },
  52314. toArray: function () {
  52315. var e = this.elements;
  52316. return [
  52317. e[0],
  52318. e[1],
  52319. e[2],
  52320. e[3],
  52321. e[4],
  52322. e[5],
  52323. e[6],
  52324. e[7],
  52325. e[8],
  52326. e[9],
  52327. e[10],
  52328. e[11],
  52329. e[12],
  52330. e[13],
  52331. e[14],
  52332. e[15],
  52333. ];
  52334. },
  52335. }),
  52336. (n.Ray = function (e, t) {
  52337. (this.origin = void 0 !== e ? e : new n.Vector3()),
  52338. (this.direction = void 0 !== t ? t : new n.Vector3());
  52339. }),
  52340. (n.Ray.prototype = {
  52341. constructor: n.Ray,
  52342. set: function (e, t) {
  52343. return this.origin.copy(e), this.direction.copy(t), this;
  52344. },
  52345. clone: function () {
  52346. return new this.constructor().copy(this);
  52347. },
  52348. copy: function (e) {
  52349. return (
  52350. this.origin.copy(e.origin),
  52351. this.direction.copy(e.direction),
  52352. this
  52353. );
  52354. },
  52355. at: function (e, t) {
  52356. var i = t || new n.Vector3();
  52357. return i.copy(this.direction).multiplyScalar(e).add(this.origin);
  52358. },
  52359. lookAt: function (e) {
  52360. this.direction.copy(e).sub(this.origin).normalize();
  52361. },
  52362. recast: (function () {
  52363. var e = new n.Vector3();
  52364. return function (t) {
  52365. return this.origin.copy(this.at(t, e)), this;
  52366. };
  52367. })(),
  52368. closestPointToPoint: function (e, t) {
  52369. var i = t || new n.Vector3();
  52370. i.subVectors(e, this.origin);
  52371. var r = i.dot(this.direction);
  52372. return r < 0
  52373. ? i.copy(this.origin)
  52374. : i.copy(this.direction).multiplyScalar(r).add(this.origin);
  52375. },
  52376. distanceToPoint: function (e) {
  52377. return Math.sqrt(this.distanceSqToPoint(e));
  52378. },
  52379. distanceSqToPoint: (function () {
  52380. var e = new n.Vector3();
  52381. return function (t) {
  52382. var i = e.subVectors(t, this.origin).dot(this.direction);
  52383. return i < 0
  52384. ? this.origin.distanceToSquared(t)
  52385. : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  52386. e.distanceToSquared(t));
  52387. };
  52388. })(),
  52389. distanceSqToSegment: (function () {
  52390. var e = new n.Vector3(),
  52391. t = new n.Vector3(),
  52392. i = new n.Vector3();
  52393. return function (n, r, o, a) {
  52394. e.copy(n).add(r).multiplyScalar(0.5),
  52395. t.copy(r).sub(n).normalize(),
  52396. i.copy(this.origin).sub(e);
  52397. var s,
  52398. l,
  52399. c,
  52400. h,
  52401. u = 0.5 * n.distanceTo(r),
  52402. d = -this.direction.dot(t),
  52403. p = i.dot(this.direction),
  52404. f = -i.dot(t),
  52405. g = i.lengthSq(),
  52406. m = Math.abs(1 - d * d);
  52407. if (m > 0)
  52408. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  52409. if (l >= -h)
  52410. if (l <= h) {
  52411. var v = 1 / m;
  52412. (s *= v),
  52413. (l *= v),
  52414. (c =
  52415. s * (s + d * l + 2 * p) +
  52416. l * (d * s + l + 2 * f) +
  52417. g);
  52418. } else
  52419. (l = u),
  52420. (s = Math.max(0, -(d * l + p))),
  52421. (c = -s * s + l * (l + 2 * f) + g);
  52422. else
  52423. (l = -u),
  52424. (s = Math.max(0, -(d * l + p))),
  52425. (c = -s * s + l * (l + 2 * f) + g);
  52426. else
  52427. l <= -h
  52428. ? ((s = Math.max(0, -(-d * u + p))),
  52429. (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)),
  52430. (c = -s * s + l * (l + 2 * f) + g))
  52431. : l <= h
  52432. ? ((s = 0),
  52433. (l = Math.min(Math.max(-u, -f), u)),
  52434. (c = l * (l + 2 * f) + g))
  52435. : ((s = Math.max(0, -(d * u + p))),
  52436. (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)),
  52437. (c = -s * s + l * (l + 2 * f) + g));
  52438. else
  52439. (l = d > 0 ? -u : u),
  52440. (s = Math.max(0, -(d * l + p))),
  52441. (c = -s * s + l * (l + 2 * f) + g);
  52442. return (
  52443. o &&
  52444. o.copy(this.direction).multiplyScalar(s).add(this.origin),
  52445. a && a.copy(t).multiplyScalar(l).add(e),
  52446. c
  52447. );
  52448. };
  52449. })(),
  52450. intersectSphere: (function () {
  52451. var e = new n.Vector3();
  52452. return function (t, i) {
  52453. e.subVectors(t.center, this.origin);
  52454. var n = e.dot(this.direction),
  52455. r = e.dot(e) - n * n,
  52456. o = t.radius * t.radius;
  52457. if (r > o) return null;
  52458. var a = Math.sqrt(o - r),
  52459. s = n - a,
  52460. l = n + a;
  52461. return s < 0 && l < 0
  52462. ? null
  52463. : s < 0
  52464. ? this.at(l, i)
  52465. : this.at(s, i);
  52466. };
  52467. })(),
  52468. intersectsSphere: function (e) {
  52469. return this.distanceToPoint(e.center) <= e.radius;
  52470. },
  52471. distanceToPlane: function (e) {
  52472. var t = e.normal.dot(this.direction);
  52473. if (0 === t)
  52474. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  52475. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  52476. return i >= 0 ? i : null;
  52477. },
  52478. intersectPlane: function (e, t) {
  52479. var i = this.distanceToPlane(e);
  52480. return null === i ? null : this.at(i, t);
  52481. },
  52482. intersectsPlane: function (e) {
  52483. var t = e.distanceToPoint(this.origin);
  52484. if (0 === t) return !0;
  52485. var i = e.normal.dot(this.direction);
  52486. return i * t < 0;
  52487. },
  52488. intersectBox: function (e, t) {
  52489. var i,
  52490. n,
  52491. r,
  52492. o,
  52493. a,
  52494. s,
  52495. l = 1 / this.direction.x,
  52496. c = 1 / this.direction.y,
  52497. h = 1 / this.direction.z,
  52498. u = this.origin;
  52499. return (
  52500. l >= 0
  52501. ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l))
  52502. : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  52503. c >= 0
  52504. ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c))
  52505. : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  52506. i > o || r > n
  52507. ? null
  52508. : ((r > i || i !== i) && (i = r),
  52509. (o < n || n !== n) && (n = o),
  52510. h >= 0
  52511. ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h))
  52512. : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  52513. i > s || a > n
  52514. ? null
  52515. : ((a > i || i !== i) && (i = a),
  52516. (s < n || n !== n) && (n = s),
  52517. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  52518. );
  52519. },
  52520. intersectsBox: (function () {
  52521. var e = new n.Vector3();
  52522. return function (t) {
  52523. return null !== this.intersectBox(t, e);
  52524. };
  52525. })(),
  52526. intersectTriangle: (function () {
  52527. var e = new n.Vector3(),
  52528. t = new n.Vector3(),
  52529. i = new n.Vector3(),
  52530. r = new n.Vector3();
  52531. return function (n, o, a, s, l) {
  52532. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i);
  52533. var c,
  52534. h = this.direction.dot(r);
  52535. if (h > 0) {
  52536. if (s) return null;
  52537. c = 1;
  52538. } else {
  52539. if (!(h < 0)) return null;
  52540. (c = -1), (h = -h);
  52541. }
  52542. e.subVectors(this.origin, n);
  52543. var u = c * this.direction.dot(i.crossVectors(e, i));
  52544. if (u < 0) return null;
  52545. var d = c * this.direction.dot(t.cross(e));
  52546. if (d < 0) return null;
  52547. if (u + d > h) return null;
  52548. var p = -c * e.dot(r);
  52549. return p < 0 ? null : this.at(p / h, l);
  52550. };
  52551. })(),
  52552. applyMatrix4: function (e) {
  52553. return (
  52554. this.direction.add(this.origin).applyMatrix4(e),
  52555. this.origin.applyMatrix4(e),
  52556. this.direction.sub(this.origin),
  52557. this.direction.normalize(),
  52558. this
  52559. );
  52560. },
  52561. equals: function (e) {
  52562. return (
  52563. e.origin.equals(this.origin) &&
  52564. e.direction.equals(this.direction)
  52565. );
  52566. },
  52567. }),
  52568. (n.Sphere = function (e, t) {
  52569. (this.center = void 0 !== e ? e : new n.Vector3()),
  52570. (this.radius = void 0 !== t ? t : 0);
  52571. }),
  52572. (n.Sphere.prototype = {
  52573. constructor: n.Sphere,
  52574. set: function (e, t) {
  52575. return this.center.copy(e), (this.radius = t), this;
  52576. },
  52577. setFromPoints: (function () {
  52578. var e = new n.Box3();
  52579. return function (t, i) {
  52580. var n = this.center;
  52581. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  52582. for (var r = 0, o = 0, a = t.length; o < a; o++)
  52583. r = Math.max(r, n.distanceToSquared(t[o]));
  52584. return (this.radius = Math.sqrt(r)), this;
  52585. };
  52586. })(),
  52587. clone: function () {
  52588. return new this.constructor().copy(this);
  52589. },
  52590. copy: function (e) {
  52591. return this.center.copy(e.center), (this.radius = e.radius), this;
  52592. },
  52593. empty: function () {
  52594. return this.radius <= 0;
  52595. },
  52596. containsPoint: function (e) {
  52597. return (
  52598. e.distanceToSquared(this.center) <= this.radius * this.radius
  52599. );
  52600. },
  52601. distanceToPoint: function (e) {
  52602. return e.distanceTo(this.center) - this.radius;
  52603. },
  52604. intersectsSphere: function (e) {
  52605. var t = this.radius + e.radius;
  52606. return e.center.distanceToSquared(this.center) <= t * t;
  52607. },
  52608. intersectsBox: function (e) {
  52609. return e.intersectsSphere(this);
  52610. },
  52611. intersectsPlane: function (e) {
  52612. return (
  52613. Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  52614. );
  52615. },
  52616. clampPoint: function (e, t) {
  52617. var i = this.center.distanceToSquared(e),
  52618. r = t || new n.Vector3();
  52619. return (
  52620. r.copy(e),
  52621. i > this.radius * this.radius &&
  52622. (r.sub(this.center).normalize(),
  52623. r.multiplyScalar(this.radius).add(this.center)),
  52624. r
  52625. );
  52626. },
  52627. getBoundingBox: function (e) {
  52628. var t = e || new n.Box3();
  52629. return (
  52630. t.set(this.center, this.center),
  52631. t.expandByScalar(this.radius),
  52632. t
  52633. );
  52634. },
  52635. applyMatrix4: function (e) {
  52636. return (
  52637. this.center.applyMatrix4(e),
  52638. (this.radius = this.radius * e.getMaxScaleOnAxis()),
  52639. this
  52640. );
  52641. },
  52642. translate: function (e) {
  52643. return this.center.add(e), this;
  52644. },
  52645. equals: function (e) {
  52646. return e.center.equals(this.center) && e.radius === this.radius;
  52647. },
  52648. }),
  52649. (n.Frustum = function (e, t, i, r, o, a) {
  52650. this.planes = [
  52651. void 0 !== e ? e : new n.Plane(),
  52652. void 0 !== t ? t : new n.Plane(),
  52653. void 0 !== i ? i : new n.Plane(),
  52654. void 0 !== r ? r : new n.Plane(),
  52655. void 0 !== o ? o : new n.Plane(),
  52656. void 0 !== a ? a : new n.Plane(),
  52657. ];
  52658. }),
  52659. (n.Frustum.prototype = {
  52660. constructor: n.Frustum,
  52661. set: function (e, t, i, n, r, o) {
  52662. var a = this.planes;
  52663. return (
  52664. a[0].copy(e),
  52665. a[1].copy(t),
  52666. a[2].copy(i),
  52667. a[3].copy(n),
  52668. a[4].copy(r),
  52669. a[5].copy(o),
  52670. this
  52671. );
  52672. },
  52673. clone: function () {
  52674. return new this.constructor().copy(this);
  52675. },
  52676. copy: function (e) {
  52677. for (var t = this.planes, i = 0; i < 6; i++)
  52678. t[i].copy(e.planes[i]);
  52679. return this;
  52680. },
  52681. setFromMatrix: function (e) {
  52682. var t = this.planes,
  52683. i = e.elements,
  52684. n = i[0],
  52685. r = i[1],
  52686. o = i[2],
  52687. a = i[3],
  52688. s = i[4],
  52689. l = i[5],
  52690. c = i[6],
  52691. h = i[7],
  52692. u = i[8],
  52693. d = i[9],
  52694. p = i[10],
  52695. f = i[11],
  52696. g = i[12],
  52697. m = i[13],
  52698. v = i[14],
  52699. A = i[15];
  52700. return (
  52701. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  52702. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  52703. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  52704. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  52705. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  52706. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  52707. this
  52708. );
  52709. },
  52710. intersectsObject: (function () {
  52711. var e = new n.Sphere();
  52712. return function (t) {
  52713. var i = t.geometry;
  52714. return (
  52715. null === i.boundingSphere && i.computeBoundingSphere(),
  52716. e.copy(i.boundingSphere),
  52717. e.applyMatrix4(t.matrixWorld),
  52718. this.intersectsSphere(e)
  52719. );
  52720. };
  52721. })(),
  52722. intersectsSphere: function (e) {
  52723. for (
  52724. var t = this.planes, i = e.center, n = -e.radius, r = 0;
  52725. r < 6;
  52726. r++
  52727. ) {
  52728. var o = t[r].distanceToPoint(i);
  52729. if (o < n) return !1;
  52730. }
  52731. return !0;
  52732. },
  52733. intersectsBox: (function () {
  52734. var e = new n.Vector3(),
  52735. t = new n.Vector3();
  52736. return function (i) {
  52737. for (var n = this.planes, r = 0; r < 6; r++) {
  52738. var o = n[r];
  52739. (e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  52740. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  52741. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  52742. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  52743. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  52744. (t.z = o.normal.z > 0 ? i.max.z : i.min.z);
  52745. var a = o.distanceToPoint(e),
  52746. s = o.distanceToPoint(t);
  52747. if (a < 0 && s < 0) return !1;
  52748. }
  52749. return !0;
  52750. };
  52751. })(),
  52752. containsPoint: function (e) {
  52753. for (var t = this.planes, i = 0; i < 6; i++)
  52754. if (t[i].distanceToPoint(e) < 0) return !1;
  52755. return !0;
  52756. },
  52757. }),
  52758. (n.Plane = function (e, t) {
  52759. (this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)),
  52760. (this.constant = void 0 !== t ? t : 0);
  52761. }),
  52762. (n.Plane.prototype = {
  52763. constructor: n.Plane,
  52764. set: function (e, t) {
  52765. return this.normal.copy(e), (this.constant = t), this;
  52766. },
  52767. setComponents: function (e, t, i, n) {
  52768. return this.normal.set(e, t, i), (this.constant = n), this;
  52769. },
  52770. setFromNormalAndCoplanarPoint: function (e, t) {
  52771. return (
  52772. this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  52773. );
  52774. },
  52775. setFromCoplanarPoints: (function () {
  52776. var e = new n.Vector3(),
  52777. t = new n.Vector3();
  52778. return function (i, n, r) {
  52779. var o = e
  52780. .subVectors(r, n)
  52781. .cross(t.subVectors(i, n))
  52782. .normalize();
  52783. return this.setFromNormalAndCoplanarPoint(o, i), this;
  52784. };
  52785. })(),
  52786. clone: function () {
  52787. return new this.constructor().copy(this);
  52788. },
  52789. copy: function (e) {
  52790. return (
  52791. this.normal.copy(e.normal), (this.constant = e.constant), this
  52792. );
  52793. },
  52794. normalize: function () {
  52795. var e = 1 / this.normal.length();
  52796. return this.normal.multiplyScalar(e), (this.constant *= e), this;
  52797. },
  52798. negate: function () {
  52799. return (this.constant *= -1), this.normal.negate(), this;
  52800. },
  52801. distanceToPoint: function (e) {
  52802. return this.normal.dot(e) + this.constant;
  52803. },
  52804. distanceToSphere: function (e) {
  52805. return this.distanceToPoint(e.center) - e.radius;
  52806. },
  52807. projectPoint: function (e, t) {
  52808. return this.orthoPoint(e, t).sub(e).negate();
  52809. },
  52810. orthoPoint: function (e, t) {
  52811. var i = this.distanceToPoint(e),
  52812. r = t || new n.Vector3();
  52813. return r.copy(this.normal).multiplyScalar(i);
  52814. },
  52815. intersectLine: (function () {
  52816. var e = new n.Vector3();
  52817. return function (t, i) {
  52818. var r = i || new n.Vector3(),
  52819. o = t.delta(e),
  52820. a = this.normal.dot(o);
  52821. if (0 !== a) {
  52822. var s = -(t.start.dot(this.normal) + this.constant) / a;
  52823. if (!(s < 0 || s > 1))
  52824. return r.copy(o).multiplyScalar(s).add(t.start);
  52825. } else if (0 === this.distanceToPoint(t.start))
  52826. return r.copy(t.start);
  52827. };
  52828. })(),
  52829. intersectsLine: function (e) {
  52830. var t = this.distanceToPoint(e.start),
  52831. i = this.distanceToPoint(e.end);
  52832. return (t < 0 && i > 0) || (i < 0 && t > 0);
  52833. },
  52834. intersectsBox: function (e) {
  52835. return e.intersectsPlane(this);
  52836. },
  52837. intersectsSphere: function (e) {
  52838. return e.intersectsPlane(this);
  52839. },
  52840. coplanarPoint: function (e) {
  52841. var t = e || new n.Vector3();
  52842. return t.copy(this.normal).multiplyScalar(-this.constant);
  52843. },
  52844. applyMatrix4: (function () {
  52845. var e = new n.Vector3(),
  52846. t = new n.Vector3(),
  52847. i = new n.Matrix3();
  52848. return function (n, r) {
  52849. var o = r || i.getNormalMatrix(n),
  52850. a = e.copy(this.normal).applyMatrix3(o),
  52851. s = this.coplanarPoint(t);
  52852. return (
  52853. s.applyMatrix4(n),
  52854. this.setFromNormalAndCoplanarPoint(a, s),
  52855. this
  52856. );
  52857. };
  52858. })(),
  52859. translate: function (e) {
  52860. return (this.constant = this.constant - e.dot(this.normal)), this;
  52861. },
  52862. equals: function (e) {
  52863. return (
  52864. e.normal.equals(this.normal) && e.constant === this.constant
  52865. );
  52866. },
  52867. }),
  52868. (n.Spherical = function (e, t, i) {
  52869. return (
  52870. (this.radius = void 0 !== e ? e : 1),
  52871. (this.phi = void 0 !== t ? t : 0),
  52872. (this.theta = void 0 !== i ? i : 0),
  52873. this
  52874. );
  52875. }),
  52876. (n.Spherical.prototype = {
  52877. constructor: n.Spherical,
  52878. set: function (e, t, i) {
  52879. (this.radius = e), (this.phi = t), (this.theta = i);
  52880. },
  52881. clone: function () {
  52882. return new this.constructor().copy(this);
  52883. },
  52884. copy: function (e) {
  52885. return (
  52886. this.radius.copy(e.radius),
  52887. this.phi.copy(e.phi),
  52888. this.theta.copy(e.theta),
  52889. this
  52890. );
  52891. },
  52892. makeSafe: function () {
  52893. var e = 1e-6;
  52894. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi));
  52895. },
  52896. setFromVector3: function (e) {
  52897. return (
  52898. (this.radius = e.length()),
  52899. 0 === this.radius
  52900. ? ((this.theta = 0), (this.phi = 0))
  52901. : ((this.theta = Math.atan2(e.x, e.z)),
  52902. (this.phi = Math.acos(
  52903. n.Math.clamp(e.y / this.radius, -1, 1)
  52904. ))),
  52905. this
  52906. );
  52907. },
  52908. }),
  52909. (n.Math = {
  52910. generateUUID: (function () {
  52911. var e,
  52912. t =
  52913. "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(
  52914. ""
  52915. ),
  52916. i = new Array(36),
  52917. n = 0;
  52918. return function () {
  52919. for (var r = 0; r < 36; r++)
  52920. 8 === r || 13 === r || 18 === r || 23 === r
  52921. ? (i[r] = "-")
  52922. : 14 === r
  52923. ? (i[r] = "4")
  52924. : (n <= 2 &&
  52925. (n = (33554432 + 16777216 * Math.random()) | 0),
  52926. (e = 15 & n),
  52927. (n >>= 4),
  52928. (i[r] = t[19 === r ? (3 & e) | 8 : e]));
  52929. return i.join("");
  52930. };
  52931. })(),
  52932. clamp: function (e, t, i) {
  52933. return Math.max(t, Math.min(i, e));
  52934. },
  52935. euclideanModulo: function (e, t) {
  52936. return ((e % t) + t) % t;
  52937. },
  52938. mapLinear: function (e, t, i, n, r) {
  52939. return n + ((e - t) * (r - n)) / (i - t);
  52940. },
  52941. smoothstep: function (e, t, i) {
  52942. return e <= t
  52943. ? 0
  52944. : e >= i
  52945. ? 1
  52946. : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e));
  52947. },
  52948. smootherstep: function (e, t, i) {
  52949. return e <= t
  52950. ? 0
  52951. : e >= i
  52952. ? 1
  52953. : ((e = (e - t) / (i - t)),
  52954. e * e * e * (e * (6 * e - 15) + 10));
  52955. },
  52956. random16: function () {
  52957. return (
  52958. console.warn(
  52959. "THREE.Math.random16() has been deprecated. Use Math.random() instead."
  52960. ),
  52961. Math.random()
  52962. );
  52963. },
  52964. randInt: function (e, t) {
  52965. return e + Math.floor(Math.random() * (t - e + 1));
  52966. },
  52967. randFloat: function (e, t) {
  52968. return e + Math.random() * (t - e);
  52969. },
  52970. randFloatSpread: function (e) {
  52971. return e * (0.5 - Math.random());
  52972. },
  52973. degToRad: (function () {
  52974. var e = Math.PI / 180;
  52975. return function (t) {
  52976. return t * e;
  52977. };
  52978. })(),
  52979. radToDeg: (function () {
  52980. var e = 180 / Math.PI;
  52981. return function (t) {
  52982. return t * e;
  52983. };
  52984. })(),
  52985. isPowerOfTwo: function (e) {
  52986. return 0 === (e & (e - 1)) && 0 !== e;
  52987. },
  52988. nearestPowerOfTwo: function (e) {
  52989. return Math.pow(2, Math.round(Math.log(e) / Math.LN2));
  52990. },
  52991. nextPowerOfTwo: function (e) {
  52992. return (
  52993. e--,
  52994. (e |= e >> 1),
  52995. (e |= e >> 2),
  52996. (e |= e >> 4),
  52997. (e |= e >> 8),
  52998. (e |= e >> 16),
  52999. e++,
  53000. e
  53001. );
  53002. },
  53003. }),
  53004. (n.Spline = function (e) {
  53005. function t(e, t, i, n, r, o, a) {
  53006. var s = 0.5 * (i - e),
  53007. l = 0.5 * (n - t);
  53008. return (
  53009. (2 * (t - i) + s + l) * a +
  53010. (-3 * (t - i) - 2 * s - l) * o +
  53011. s * r +
  53012. t
  53013. );
  53014. }
  53015. this.points = e;
  53016. var i,
  53017. r,
  53018. o,
  53019. a,
  53020. s,
  53021. l,
  53022. c,
  53023. h,
  53024. u,
  53025. d = [],
  53026. p = {
  53027. x: 0,
  53028. y: 0,
  53029. z: 0,
  53030. };
  53031. (this.initFromArray = function (e) {
  53032. this.points = [];
  53033. for (var t = 0; t < e.length; t++)
  53034. this.points[t] = {
  53035. x: e[t][0],
  53036. y: e[t][1],
  53037. z: e[t][2],
  53038. };
  53039. }),
  53040. (this.getPoint = function (e) {
  53041. return (
  53042. (i = (this.points.length - 1) * e),
  53043. (r = Math.floor(i)),
  53044. (o = i - r),
  53045. (d[0] = 0 === r ? r : r - 1),
  53046. (d[1] = r),
  53047. (d[2] =
  53048. r > this.points.length - 2
  53049. ? this.points.length - 1
  53050. : r + 1),
  53051. (d[3] =
  53052. r > this.points.length - 3
  53053. ? this.points.length - 1
  53054. : r + 2),
  53055. (l = this.points[d[0]]),
  53056. (c = this.points[d[1]]),
  53057. (h = this.points[d[2]]),
  53058. (u = this.points[d[3]]),
  53059. (a = o * o),
  53060. (s = o * a),
  53061. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  53062. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  53063. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  53064. p
  53065. );
  53066. }),
  53067. (this.getControlPointsArray = function () {
  53068. var e,
  53069. t,
  53070. i = this.points.length,
  53071. n = [];
  53072. for (e = 0; e < i; e++)
  53073. (t = this.points[e]), (n[e] = [t.x, t.y, t.z]);
  53074. return n;
  53075. }),
  53076. (this.getLength = function (e) {
  53077. var t,
  53078. i,
  53079. r,
  53080. o,
  53081. a = 0,
  53082. s = 0,
  53083. l = 0,
  53084. c = new n.Vector3(),
  53085. h = new n.Vector3(),
  53086. u = [],
  53087. d = 0;
  53088. for (
  53089. u[0] = 0,
  53090. e || (e = 100),
  53091. r = this.points.length * e,
  53092. c.copy(this.points[0]),
  53093. t = 1;
  53094. t < r;
  53095. t++
  53096. )
  53097. (i = t / r),
  53098. (o = this.getPoint(i)),
  53099. h.copy(o),
  53100. (d += h.distanceTo(c)),
  53101. c.copy(o),
  53102. (a = (this.points.length - 1) * i),
  53103. (s = Math.floor(a)),
  53104. s !== l && ((u[s] = d), (l = s));
  53105. return (
  53106. (u[u.length] = d),
  53107. {
  53108. chunks: u,
  53109. total: d,
  53110. }
  53111. );
  53112. }),
  53113. (this.reparametrizeByArcLength = function (e) {
  53114. var t,
  53115. i,
  53116. r,
  53117. o,
  53118. a,
  53119. s,
  53120. l,
  53121. c,
  53122. h = [],
  53123. u = new n.Vector3(),
  53124. d = this.getLength();
  53125. for (
  53126. h.push(u.copy(this.points[0]).clone()), t = 1;
  53127. t < this.points.length;
  53128. t++
  53129. ) {
  53130. for (
  53131. s = d.chunks[t] - d.chunks[t - 1],
  53132. l = Math.ceil((e * s) / d.total),
  53133. o = (t - 1) / (this.points.length - 1),
  53134. a = t / (this.points.length - 1),
  53135. i = 1;
  53136. i < l - 1;
  53137. i++
  53138. )
  53139. (r = o + i * (1 / l) * (a - o)),
  53140. (c = this.getPoint(r)),
  53141. h.push(u.copy(c).clone());
  53142. h.push(u.copy(this.points[t]).clone());
  53143. }
  53144. this.points = h;
  53145. });
  53146. }),
  53147. (n.Triangle = function (e, t, i) {
  53148. (this.a = void 0 !== e ? e : new n.Vector3()),
  53149. (this.b = void 0 !== t ? t : new n.Vector3()),
  53150. (this.c = void 0 !== i ? i : new n.Vector3());
  53151. }),
  53152. (n.Triangle.normal = (function () {
  53153. var e = new n.Vector3();
  53154. return function (t, i, r, o) {
  53155. var a = o || new n.Vector3();
  53156. a.subVectors(r, i), e.subVectors(t, i), a.cross(e);
  53157. var s = a.lengthSq();
  53158. return s > 0
  53159. ? a.multiplyScalar(1 / Math.sqrt(s))
  53160. : a.set(0, 0, 0);
  53161. };
  53162. })()),
  53163. (n.Triangle.barycoordFromPoint = (function () {
  53164. var e = new n.Vector3(),
  53165. t = new n.Vector3(),
  53166. i = new n.Vector3();
  53167. return function (r, o, a, s, l) {
  53168. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o);
  53169. var c = e.dot(e),
  53170. h = e.dot(t),
  53171. u = e.dot(i),
  53172. d = t.dot(t),
  53173. p = t.dot(i),
  53174. f = c * d - h * h,
  53175. g = l || new n.Vector3();
  53176. if (0 === f) return g.set(-2, -1, -1);
  53177. var m = 1 / f,
  53178. v = (d * u - h * p) * m,
  53179. A = (c * p - h * u) * m;
  53180. return g.set(1 - v - A, A, v);
  53181. };
  53182. })()),
  53183. (n.Triangle.containsPoint = (function () {
  53184. var e = new n.Vector3();
  53185. return function (t, i, r, o) {
  53186. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  53187. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1;
  53188. };
  53189. })()),
  53190. (n.Triangle.prototype = {
  53191. constructor: n.Triangle,
  53192. set: function (e, t, i) {
  53193. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this;
  53194. },
  53195. setFromPointsAndIndices: function (e, t, i, n) {
  53196. return (
  53197. this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  53198. );
  53199. },
  53200. clone: function () {
  53201. return new this.constructor().copy(this);
  53202. },
  53203. copy: function (e) {
  53204. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;
  53205. },
  53206. area: (function () {
  53207. var e = new n.Vector3(),
  53208. t = new n.Vector3();
  53209. return function () {
  53210. return (
  53211. e.subVectors(this.c, this.b),
  53212. t.subVectors(this.a, this.b),
  53213. 0.5 * e.cross(t).length()
  53214. );
  53215. };
  53216. })(),
  53217. midpoint: function (e) {
  53218. var t = e || new n.Vector3();
  53219. return t
  53220. .addVectors(this.a, this.b)
  53221. .add(this.c)
  53222. .multiplyScalar(1 / 3);
  53223. },
  53224. normal: function (e) {
  53225. return n.Triangle.normal(this.a, this.b, this.c, e);
  53226. },
  53227. plane: function (e) {
  53228. var t = e || new n.Plane();
  53229. return t.setFromCoplanarPoints(this.a, this.b, this.c);
  53230. },
  53231. barycoordFromPoint: function (e, t) {
  53232. return n.Triangle.barycoordFromPoint(
  53233. e,
  53234. this.a,
  53235. this.b,
  53236. this.c,
  53237. t
  53238. );
  53239. },
  53240. containsPoint: function (e) {
  53241. return n.Triangle.containsPoint(e, this.a, this.b, this.c);
  53242. },
  53243. equals: function (e) {
  53244. return (
  53245. e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  53246. );
  53247. },
  53248. }),
  53249. (n.Interpolant = function (e, t, i, n) {
  53250. (this.parameterPositions = e),
  53251. (this._cachedIndex = 0),
  53252. (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)),
  53253. (this.sampleValues = t),
  53254. (this.valueSize = i);
  53255. }),
  53256. (n.Interpolant.prototype = {
  53257. constructor: n.Interpolant,
  53258. evaluate: function (e) {
  53259. var t = this.parameterPositions,
  53260. i = this._cachedIndex,
  53261. n = t[i],
  53262. r = t[i - 1];
  53263. e: {
  53264. t: {
  53265. var o;
  53266. i: {
  53267. n: if (!(e < n)) {
  53268. for (var a = i + 2; ; ) {
  53269. if (void 0 === n) {
  53270. if (e < r) break n;
  53271. return (
  53272. (i = t.length),
  53273. (this._cachedIndex = i),
  53274. this.afterEnd_(i - 1, e, r)
  53275. );
  53276. }
  53277. if (i === a) break;
  53278. if (((r = n), (n = t[++i]), e < n)) break t;
  53279. }
  53280. o = t.length;
  53281. break i;
  53282. }
  53283. {
  53284. if (e >= r) break e;
  53285. var s = t[1];
  53286. e < s && ((i = 2), (r = s));
  53287. for (var a = i - 2; ; ) {
  53288. if (void 0 === r)
  53289. return (
  53290. (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  53291. );
  53292. if (i === a) break;
  53293. if (((n = r), (r = t[--i - 1]), e >= r)) break t;
  53294. }
  53295. (o = i), (i = 0);
  53296. }
  53297. }
  53298. for (; i < o; ) {
  53299. var l = (i + o) >>> 1;
  53300. e < t[l] ? (o = l) : (i = l + 1);
  53301. }
  53302. if (((n = t[i]), (r = t[i - 1]), void 0 === r))
  53303. return (this._cachedIndex = 0), this.beforeStart_(0, e, n);
  53304. if (void 0 === n)
  53305. return (
  53306. (i = t.length),
  53307. (this._cachedIndex = i),
  53308. this.afterEnd_(i - 1, r, e)
  53309. );
  53310. }
  53311. (this._cachedIndex = i), this.intervalChanged_(i, r, n);
  53312. }
  53313. return this.interpolate_(i, r, e, n);
  53314. },
  53315. settings: null,
  53316. DefaultSettings_: {},
  53317. getSettings_: function () {
  53318. return this.settings || this.DefaultSettings_;
  53319. },
  53320. copySampleValue_: function (e) {
  53321. for (
  53322. var t = this.resultBuffer,
  53323. i = this.sampleValues,
  53324. n = this.valueSize,
  53325. r = e * n,
  53326. o = 0;
  53327. o !== n;
  53328. ++o
  53329. )
  53330. t[o] = i[r + o];
  53331. return t;
  53332. },
  53333. interpolate_: function (e, t, i, n) {
  53334. throw new Error("call to abstract method");
  53335. },
  53336. intervalChanged_: function (e, t, i) {},
  53337. }),
  53338. Object.assign(n.Interpolant.prototype, {
  53339. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  53340. afterEnd_: n.Interpolant.prototype.copySampleValue_,
  53341. }),
  53342. (n.CubicInterpolant = function (e, t, i, r) {
  53343. n.Interpolant.call(this, e, t, i, r),
  53344. (this._weightPrev = -0),
  53345. (this._offsetPrev = -0),
  53346. (this._weightNext = -0),
  53347. (this._offsetNext = -0);
  53348. }),
  53349. (n.CubicInterpolant.prototype = Object.assign(
  53350. Object.create(n.Interpolant.prototype),
  53351. {
  53352. constructor: n.CubicInterpolant,
  53353. DefaultSettings_: {
  53354. endingStart: n.ZeroCurvatureEnding,
  53355. endingEnd: n.ZeroCurvatureEnding,
  53356. },
  53357. intervalChanged_: function (e, t, i) {
  53358. var r = this.parameterPositions,
  53359. o = e - 2,
  53360. a = e + 1,
  53361. s = r[o],
  53362. l = r[a];
  53363. if (void 0 === s)
  53364. switch (this.getSettings_().endingStart) {
  53365. case n.ZeroSlopeEnding:
  53366. (o = e), (s = 2 * t - i);
  53367. break;
  53368. case n.WrapAroundEnding:
  53369. (o = r.length - 2), (s = t + r[o] - r[o + 1]);
  53370. break;
  53371. default:
  53372. (o = e), (s = i);
  53373. }
  53374. if (void 0 === l)
  53375. switch (this.getSettings_().endingEnd) {
  53376. case n.ZeroSlopeEnding:
  53377. (a = e), (l = 2 * i - t);
  53378. break;
  53379. case n.WrapAroundEnding:
  53380. (a = 1), (l = i + r[1] - r[0]);
  53381. break;
  53382. default:
  53383. (a = e - 1), (l = t);
  53384. }
  53385. var c = 0.5 * (i - t),
  53386. h = this.valueSize;
  53387. (this._weightPrev = c / (t - s)),
  53388. (this._weightNext = c / (l - i)),
  53389. (this._offsetPrev = o * h),
  53390. (this._offsetNext = a * h);
  53391. },
  53392. interpolate_: function (e, t, i, n) {
  53393. for (
  53394. var r = this.resultBuffer,
  53395. o = this.sampleValues,
  53396. a = this.valueSize,
  53397. s = e * a,
  53398. l = s - a,
  53399. c = this._offsetPrev,
  53400. h = this._offsetNext,
  53401. u = this._weightPrev,
  53402. d = this._weightNext,
  53403. p = (i - t) / (n - t),
  53404. f = p * p,
  53405. g = f * p,
  53406. m = -u * g + 2 * u * f - u * p,
  53407. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  53408. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  53409. y = d * g - d * f,
  53410. C = 0;
  53411. C !== a;
  53412. ++C
  53413. )
  53414. r[C] =
  53415. m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  53416. return r;
  53417. },
  53418. }
  53419. )),
  53420. (n.DiscreteInterpolant = function (e, t, i, r) {
  53421. n.Interpolant.call(this, e, t, i, r);
  53422. }),
  53423. (n.DiscreteInterpolant.prototype = Object.assign(
  53424. Object.create(n.Interpolant.prototype),
  53425. {
  53426. constructor: n.DiscreteInterpolant,
  53427. interpolate_: function (e, t, i, n) {
  53428. return this.copySampleValue_(e - 1);
  53429. },
  53430. }
  53431. )),
  53432. (n.LinearInterpolant = function (e, t, i, r) {
  53433. n.Interpolant.call(this, e, t, i, r);
  53434. }),
  53435. (n.LinearInterpolant.prototype = Object.assign(
  53436. Object.create(n.Interpolant.prototype),
  53437. {
  53438. constructor: n.LinearInterpolant,
  53439. interpolate_: function (e, t, i, n) {
  53440. for (
  53441. var r = this.resultBuffer,
  53442. o = this.sampleValues,
  53443. a = this.valueSize,
  53444. s = e * a,
  53445. l = s - a,
  53446. c = (i - t) / (n - t),
  53447. h = 1 - c,
  53448. u = 0;
  53449. u !== a;
  53450. ++u
  53451. )
  53452. r[u] = o[l + u] * h + o[s + u] * c;
  53453. return r;
  53454. },
  53455. }
  53456. )),
  53457. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  53458. n.Interpolant.call(this, e, t, i, r);
  53459. }),
  53460. (n.QuaternionLinearInterpolant.prototype = Object.assign(
  53461. Object.create(n.Interpolant.prototype),
  53462. {
  53463. constructor: n.QuaternionLinearInterpolant,
  53464. interpolate_: function (e, t, i, r) {
  53465. for (
  53466. var o = this.resultBuffer,
  53467. a = this.sampleValues,
  53468. s = this.valueSize,
  53469. l = e * s,
  53470. c = (i - t) / (r - t),
  53471. h = l + s;
  53472. l !== h;
  53473. l += 4
  53474. )
  53475. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  53476. return o;
  53477. },
  53478. }
  53479. )),
  53480. (n.Clock = function (e) {
  53481. (this.autoStart = void 0 === e || e),
  53482. (this.startTime = 0),
  53483. (this.oldTime = 0),
  53484. (this.elapsedTime = 0),
  53485. (this.running = !1);
  53486. }),
  53487. (n.Clock.prototype = {
  53488. constructor: n.Clock,
  53489. start: function () {
  53490. (this.startTime = performance.now()),
  53491. (this.oldTime = this.startTime),
  53492. (this.running = !0);
  53493. },
  53494. stop: function () {
  53495. this.getElapsedTime(), (this.running = !1);
  53496. },
  53497. getElapsedTime: function () {
  53498. return this.getDelta(), this.elapsedTime;
  53499. },
  53500. getDelta: function () {
  53501. var e = 0;
  53502. if (
  53503. (this.autoStart && !this.running && this.start(), this.running)
  53504. ) {
  53505. var t = performance.now();
  53506. (e = 0.001 * (t - this.oldTime)),
  53507. (this.oldTime = t),
  53508. (this.elapsedTime += e);
  53509. }
  53510. return e;
  53511. },
  53512. }),
  53513. (n.EventDispatcher = function () {}),
  53514. (n.EventDispatcher.prototype = {
  53515. constructor: n.EventDispatcher,
  53516. apply: function (e) {
  53517. (e.addEventListener =
  53518. n.EventDispatcher.prototype.addEventListener),
  53519. (e.hasEventListener =
  53520. n.EventDispatcher.prototype.hasEventListener),
  53521. (e.removeEventListener =
  53522. n.EventDispatcher.prototype.removeEventListener),
  53523. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent);
  53524. },
  53525. addEventListener: function (e, t) {
  53526. void 0 === this._listeners && (this._listeners = {});
  53527. var i = this._listeners;
  53528. void 0 === i[e] && (i[e] = []),
  53529. i[e].indexOf(t) === -1 && i[e].push(t);
  53530. },
  53531. hasEventListener: function (e, t) {
  53532. if (void 0 === this._listeners) return !1;
  53533. var i = this._listeners;
  53534. return void 0 !== i[e] && i[e].indexOf(t) !== -1;
  53535. },
  53536. removeEventListener: function (e, t) {
  53537. if (void 0 !== this._listeners) {
  53538. var i = this._listeners,
  53539. n = i[e];
  53540. if (void 0 !== n) {
  53541. var r = n.indexOf(t);
  53542. r !== -1 && n.splice(r, 1);
  53543. }
  53544. }
  53545. },
  53546. dispatchEvent: function (e) {
  53547. if (void 0 !== this._listeners) {
  53548. var t = this._listeners,
  53549. i = t[e.type];
  53550. if (void 0 !== i) {
  53551. e.target = this;
  53552. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o];
  53553. for (var o = 0; o < r; o++) n[o].call(this, e);
  53554. }
  53555. }
  53556. },
  53557. }),
  53558. (n.Layers = function () {
  53559. this.mask = 1;
  53560. }),
  53561. (n.Layers.prototype = {
  53562. constructor: n.Layers,
  53563. set: function (e) {
  53564. this.mask = 1 << e;
  53565. },
  53566. enable: function (e) {
  53567. this.mask |= 1 << e;
  53568. },
  53569. toggle: function (e) {
  53570. this.mask ^= 1 << e;
  53571. },
  53572. disable: function (e) {
  53573. this.mask &= ~(1 << e);
  53574. },
  53575. test: function (e) {
  53576. return 0 !== (this.mask & e.mask);
  53577. },
  53578. }),
  53579. (function (e) {
  53580. function t(e, t) {
  53581. return e.distance - t.distance;
  53582. }
  53583. function i(e, t, n, r) {
  53584. if (e.visible !== !1 && (e.raycast(t, n), r === !0))
  53585. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  53586. i(o[a], t, n, !0);
  53587. }
  53588. (e.Raycaster = function (t, i, n, r) {
  53589. (this.ray = new e.Ray(t, i)),
  53590. (this.near = n || 0),
  53591. (this.far = r || 1 / 0),
  53592. (this.params = {
  53593. Mesh: {},
  53594. Line: {},
  53595. LOD: {},
  53596. Points: {
  53597. threshold: 1,
  53598. },
  53599. Sprite: {},
  53600. }),
  53601. Object.defineProperties(this.params, {
  53602. PointCloud: {
  53603. get: function () {
  53604. return (
  53605. console.warn(
  53606. "THREE.Raycaster: params.PointCloud has been renamed to params.Points."
  53607. ),
  53608. this.Points
  53609. );
  53610. },
  53611. },
  53612. });
  53613. }),
  53614. (e.Raycaster.prototype = {
  53615. constructor: e.Raycaster,
  53616. linePrecision: 1,
  53617. set: function (e, t) {
  53618. this.ray.set(e, t);
  53619. },
  53620. setFromCamera: function (t, i) {
  53621. i instanceof e.PerspectiveCamera
  53622. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  53623. this.ray.direction
  53624. .set(t.x, t.y, 0.5)
  53625. .unproject(i)
  53626. .sub(this.ray.origin)
  53627. .normalize())
  53628. : i instanceof e.OrthographicCamera
  53629. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  53630. this.ray.direction
  53631. .set(0, 0, -1)
  53632. .transformDirection(i.matrixWorld))
  53633. : console.error(
  53634. "THREE.Raycaster: Unsupported camera type."
  53635. );
  53636. },
  53637. intersectObject: function (e, n) {
  53638. var r = [];
  53639. return i(e, this, r, n), r.sort(t), r;
  53640. },
  53641. intersectObjects: function (e, n) {
  53642. var r = [];
  53643. if (Array.isArray(e) === !1)
  53644. return (
  53645. console.warn(
  53646. "THREE.Raycaster.intersectObjects: objects is not an Array."
  53647. ),
  53648. r
  53649. );
  53650. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n);
  53651. return r.sort(t), r;
  53652. },
  53653. });
  53654. })(n),
  53655. (n.Object3D = function () {
  53656. function e() {
  53657. o.setFromEuler(r, !1);
  53658. }
  53659. function t() {
  53660. r.setFromQuaternion(o, void 0, !1);
  53661. }
  53662. Object.defineProperty(this, "id", {
  53663. value: n.Object3DIdCount++,
  53664. }),
  53665. (this.uuid = n.Math.generateUUID()),
  53666. (this.name = ""),
  53667. (this.type = "Object3D"),
  53668. (this.parent = null),
  53669. (this.children = []),
  53670. (this.up = n.Object3D.DefaultUp.clone());
  53671. var i = new n.Vector3(),
  53672. r = new n.Euler(),
  53673. o = new n.Quaternion(),
  53674. a = new n.Vector3(1, 1, 1);
  53675. r.onChange(e),
  53676. o.onChange(t),
  53677. Object.defineProperties(this, {
  53678. position: {
  53679. enumerable: !0,
  53680. value: i,
  53681. },
  53682. rotation: {
  53683. enumerable: !0,
  53684. value: r,
  53685. },
  53686. quaternion: {
  53687. enumerable: !0,
  53688. value: o,
  53689. },
  53690. scale: {
  53691. enumerable: !0,
  53692. value: a,
  53693. },
  53694. modelViewMatrix: {
  53695. value: new n.Matrix4(),
  53696. },
  53697. normalMatrix: {
  53698. value: new n.Matrix3(),
  53699. },
  53700. }),
  53701. (this.rotationAutoUpdate = !0),
  53702. (this.matrix = new n.Matrix4()),
  53703. (this.matrixWorld = new n.Matrix4()),
  53704. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  53705. (this.matrixWorldNeedsUpdate = !1),
  53706. (this.layers = new n.Layers()),
  53707. (this.visible = !0),
  53708. (this.castShadow = !1),
  53709. (this.receiveShadow = !1),
  53710. (this.frustumCulled = !0),
  53711. (this.renderOrder = 0),
  53712. (this.userData = {});
  53713. }),
  53714. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  53715. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  53716. (n.Object3D.prototype = {
  53717. constructor: n.Object3D,
  53718. applyMatrix: function (e) {
  53719. this.matrix.multiplyMatrices(e, this.matrix),
  53720. this.matrix.decompose(
  53721. this.position,
  53722. this.quaternion,
  53723. this.scale
  53724. );
  53725. },
  53726. setRotationFromAxisAngle: function (e, t) {
  53727. this.quaternion.setFromAxisAngle(e, t);
  53728. },
  53729. setRotationFromEuler: function (e) {
  53730. this.quaternion.setFromEuler(e, !0);
  53731. },
  53732. setRotationFromMatrix: function (e) {
  53733. this.quaternion.setFromRotationMatrix(e);
  53734. },
  53735. setRotationFromQuaternion: function (e) {
  53736. this.quaternion.copy(e);
  53737. },
  53738. rotateOnAxis: (function () {
  53739. var e = new n.Quaternion();
  53740. return function (t, i) {
  53741. return (
  53742. e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this
  53743. );
  53744. };
  53745. })(),
  53746. rotateX: (function () {
  53747. var e = new n.Vector3(1, 0, 0);
  53748. return function (t) {
  53749. return this.rotateOnAxis(e, t);
  53750. };
  53751. })(),
  53752. rotateY: (function () {
  53753. var e = new n.Vector3(0, 1, 0);
  53754. return function (t) {
  53755. return this.rotateOnAxis(e, t);
  53756. };
  53757. })(),
  53758. rotateZ: (function () {
  53759. var e = new n.Vector3(0, 0, 1);
  53760. return function (t) {
  53761. return this.rotateOnAxis(e, t);
  53762. };
  53763. })(),
  53764. translateOnAxis: (function () {
  53765. var e = new n.Vector3();
  53766. return function (t, i) {
  53767. return (
  53768. e.copy(t).applyQuaternion(this.quaternion),
  53769. this.position.add(e.multiplyScalar(i)),
  53770. this
  53771. );
  53772. };
  53773. })(),
  53774. translateX: (function () {
  53775. var e = new n.Vector3(1, 0, 0);
  53776. return function (t) {
  53777. return this.translateOnAxis(e, t);
  53778. };
  53779. })(),
  53780. translateY: (function () {
  53781. var e = new n.Vector3(0, 1, 0);
  53782. return function (t) {
  53783. return this.translateOnAxis(e, t);
  53784. };
  53785. })(),
  53786. translateZ: (function () {
  53787. var e = new n.Vector3(0, 0, 1);
  53788. return function (t) {
  53789. return this.translateOnAxis(e, t);
  53790. };
  53791. })(),
  53792. localToWorld: function (e) {
  53793. return e.applyMatrix4(this.matrixWorld);
  53794. },
  53795. worldToLocal: (function () {
  53796. var e = new n.Matrix4();
  53797. return function (t) {
  53798. return t.applyMatrix4(e.getInverse(this.matrixWorld));
  53799. };
  53800. })(),
  53801. lookAt: (function () {
  53802. var e = new n.Matrix4();
  53803. return function (t) {
  53804. e.lookAt(t, this.position, this.up),
  53805. this.quaternion.setFromRotationMatrix(e);
  53806. };
  53807. })(),
  53808. add: function (e) {
  53809. if (arguments.length > 1) {
  53810. for (var t = 0; t < arguments.length; t++)
  53811. this.add(arguments[t]);
  53812. return this;
  53813. }
  53814. return e === this
  53815. ? (console.error(
  53816. "THREE.Object3D.add: object can't be added as a child of itself.",
  53817. e
  53818. ),
  53819. this)
  53820. : (e instanceof n.Object3D
  53821. ? (null !== e.parent && e.parent.remove(e),
  53822. (e.parent = this),
  53823. e.dispatchEvent({
  53824. type: "added",
  53825. }),
  53826. this.children.push(e))
  53827. : console.error(
  53828. "THREE.Object3D.add: object not an instance of THREE.Object3D.",
  53829. e
  53830. ),
  53831. this);
  53832. },
  53833. remove: function (e) {
  53834. if (arguments.length > 1)
  53835. for (var t = 0; t < arguments.length; t++)
  53836. this.remove(arguments[t]);
  53837. var i = this.children.indexOf(e);
  53838. i !== -1 &&
  53839. ((e.parent = null),
  53840. e.dispatchEvent({
  53841. type: "removed",
  53842. }),
  53843. this.children.splice(i, 1));
  53844. },
  53845. getObjectById: function (e) {
  53846. return this.getObjectByProperty("id", e);
  53847. },
  53848. getObjectByName: function (e) {
  53849. return this.getObjectByProperty("name", e);
  53850. },
  53851. getObjectByProperty: function (e, t) {
  53852. if (this[e] === t) return this;
  53853. for (var i = 0, n = this.children.length; i < n; i++) {
  53854. var r = this.children[i],
  53855. o = r.getObjectByProperty(e, t);
  53856. if (void 0 !== o) return o;
  53857. }
  53858. },
  53859. getWorldPosition: function (e) {
  53860. var t = e || new n.Vector3();
  53861. return (
  53862. this.updateMatrixWorld(!0),
  53863. t.setFromMatrixPosition(this.matrixWorld)
  53864. );
  53865. },
  53866. getWorldQuaternion: (function () {
  53867. var e = new n.Vector3(),
  53868. t = new n.Vector3();
  53869. return function (i) {
  53870. var r = i || new n.Quaternion();
  53871. return (
  53872. this.updateMatrixWorld(!0),
  53873. this.matrixWorld.decompose(e, r, t),
  53874. r
  53875. );
  53876. };
  53877. })(),
  53878. getWorldRotation: (function () {
  53879. var e = new n.Quaternion();
  53880. return function (t) {
  53881. var i = t || new n.Euler();
  53882. return (
  53883. this.getWorldQuaternion(e),
  53884. i.setFromQuaternion(e, this.rotation.order, !1)
  53885. );
  53886. };
  53887. })(),
  53888. getWorldScale: (function () {
  53889. var e = new n.Vector3(),
  53890. t = new n.Quaternion();
  53891. return function (i) {
  53892. var r = i || new n.Vector3();
  53893. return (
  53894. this.updateMatrixWorld(!0),
  53895. this.matrixWorld.decompose(e, t, r),
  53896. r
  53897. );
  53898. };
  53899. })(),
  53900. getWorldDirection: (function () {
  53901. var e = new n.Quaternion();
  53902. return function (t) {
  53903. var i = t || new n.Vector3();
  53904. return (
  53905. this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e)
  53906. );
  53907. };
  53908. })(),
  53909. raycast: function () {},
  53910. traverse: function (e) {
  53911. e(this);
  53912. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  53913. t[i].traverse(e);
  53914. },
  53915. traverseVisible: function (e) {
  53916. if (this.visible !== !1) {
  53917. e(this);
  53918. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  53919. t[i].traverseVisible(e);
  53920. }
  53921. },
  53922. traverseAncestors: function (e) {
  53923. var t = this.parent;
  53924. null !== t && (e(t), t.traverseAncestors(e));
  53925. },
  53926. updateMatrix: function () {
  53927. this.matrix.compose(this.position, this.quaternion, this.scale),
  53928. (this.matrixWorldNeedsUpdate = !0);
  53929. },
  53930. updateMatrixWorld: function (e) {
  53931. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  53932. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  53933. (null === this.parent
  53934. ? this.matrixWorld.copy(this.matrix)
  53935. : this.matrixWorld.multiplyMatrices(
  53936. this.parent.matrixWorld,
  53937. this.matrix
  53938. ),
  53939. (this.matrixWorldNeedsUpdate = !1),
  53940. (e = !0));
  53941. for (var t = 0, i = this.children.length; t < i; t++)
  53942. this.children[t].updateMatrixWorld(e);
  53943. },
  53944. toJSON: function (e) {
  53945. function t(e) {
  53946. var t = [];
  53947. for (var i in e) {
  53948. var n = e[i];
  53949. delete n.metadata, t.push(n);
  53950. }
  53951. return t;
  53952. }
  53953. var i = void 0 === e,
  53954. n = {};
  53955. i &&
  53956. ((e = {
  53957. geometries: {},
  53958. materials: {},
  53959. textures: {},
  53960. images: {},
  53961. }),
  53962. (n.metadata = {
  53963. version: 4.4,
  53964. type: "Object",
  53965. generator: "Object3D.toJSON",
  53966. }));
  53967. var r = {};
  53968. if (
  53969. ((r.uuid = this.uuid),
  53970. (r.type = this.type),
  53971. "" !== this.name && (r.name = this.name),
  53972. "{}" !== JSON.stringify(this.userData) &&
  53973. (r.userData = this.userData),
  53974. this.castShadow === !0 && (r.castShadow = !0),
  53975. this.receiveShadow === !0 && (r.receiveShadow = !0),
  53976. this.visible === !1 && (r.visible = !1),
  53977. (r.matrix = this.matrix.toArray()),
  53978. void 0 !== this.geometry &&
  53979. (void 0 === e.geometries[this.geometry.uuid] &&
  53980. (e.geometries[this.geometry.uuid] =
  53981. this.geometry.toJSON(e)),
  53982. (r.geometry = this.geometry.uuid)),
  53983. void 0 !== this.material &&
  53984. (void 0 === e.materials[this.material.uuid] &&
  53985. (e.materials[this.material.uuid] = this.material.toJSON(e)),
  53986. (r.material = this.material.uuid)),
  53987. this.children.length > 0)
  53988. ) {
  53989. r.children = [];
  53990. for (var o = 0; o < this.children.length; o++)
  53991. r.children.push(this.children[o].toJSON(e).object);
  53992. }
  53993. if (i) {
  53994. var a = t(e.geometries),
  53995. s = t(e.materials),
  53996. l = t(e.textures),
  53997. c = t(e.images);
  53998. a.length > 0 && (n.geometries = a),
  53999. s.length > 0 && (n.materials = s),
  54000. l.length > 0 && (n.textures = l),
  54001. c.length > 0 && (n.images = c);
  54002. }
  54003. return (n.object = r), n;
  54004. },
  54005. clone: function (e) {
  54006. return new this.constructor().copy(this, e);
  54007. },
  54008. copy: function (e, t) {
  54009. if (
  54010. (void 0 === t && (t = !0),
  54011. (this.name = e.name),
  54012. this.up.copy(e.up),
  54013. this.position.copy(e.position),
  54014. this.quaternion.copy(e.quaternion),
  54015. this.scale.copy(e.scale),
  54016. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  54017. this.matrix.copy(e.matrix),
  54018. this.matrixWorld.copy(e.matrixWorld),
  54019. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  54020. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  54021. (this.visible = e.visible),
  54022. (this.castShadow = e.castShadow),
  54023. (this.receiveShadow = e.receiveShadow),
  54024. (this.frustumCulled = e.frustumCulled),
  54025. (this.renderOrder = e.renderOrder),
  54026. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  54027. t === !0)
  54028. )
  54029. for (var i = 0; i < e.children.length; i++) {
  54030. var n = e.children[i];
  54031. this.add(n.clone());
  54032. }
  54033. return this;
  54034. },
  54035. }),
  54036. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  54037. (n.Object3DIdCount = 0),
  54038. (n.Face3 = function (e, t, i, r, o, a) {
  54039. (this.a = e),
  54040. (this.b = t),
  54041. (this.c = i),
  54042. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  54043. (this.vertexNormals = Array.isArray(r) ? r : []),
  54044. (this.color = o instanceof n.Color ? o : new n.Color()),
  54045. (this.vertexColors = Array.isArray(o) ? o : []),
  54046. (this.materialIndex = void 0 !== a ? a : 0);
  54047. }),
  54048. (n.Face3.prototype = {
  54049. constructor: n.Face3,
  54050. clone: function () {
  54051. return new this.constructor().copy(this);
  54052. },
  54053. copy: function (e) {
  54054. (this.a = e.a),
  54055. (this.b = e.b),
  54056. (this.c = e.c),
  54057. this.normal.copy(e.normal),
  54058. this.color.copy(e.color),
  54059. (this.materialIndex = e.materialIndex);
  54060. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  54061. this.vertexNormals[t] = e.vertexNormals[t].clone();
  54062. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  54063. this.vertexColors[t] = e.vertexColors[t].clone();
  54064. return this;
  54065. },
  54066. }),
  54067. (n.BufferAttribute = function (e, t) {
  54068. (this.uuid = n.Math.generateUUID()),
  54069. (this.array = e),
  54070. (this.itemSize = t),
  54071. (this.dynamic = !1),
  54072. (this.updateRange = {
  54073. offset: 0,
  54074. count: -1,
  54075. }),
  54076. (this.version = 0);
  54077. }),
  54078. (n.BufferAttribute.prototype = {
  54079. constructor: n.BufferAttribute,
  54080. get count() {
  54081. return this.array.length / this.itemSize;
  54082. },
  54083. set needsUpdate(e) {
  54084. e === !0 && this.version++;
  54085. },
  54086. setDynamic: function (e) {
  54087. return (this.dynamic = e), this;
  54088. },
  54089. copy: function (e) {
  54090. return (
  54091. (this.array = new e.array.constructor(e.array)),
  54092. (this.itemSize = e.itemSize),
  54093. (this.dynamic = e.dynamic),
  54094. this
  54095. );
  54096. },
  54097. copyAt: function (e, t, i) {
  54098. (e *= this.itemSize), (i *= t.itemSize);
  54099. for (var n = 0, r = this.itemSize; n < r; n++)
  54100. this.array[e + n] = t.array[i + n];
  54101. return this;
  54102. },
  54103. copyArray: function (e) {
  54104. return this.array.set(e), this;
  54105. },
  54106. copyColorsArray: function (e) {
  54107. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54108. var a = e[r];
  54109. void 0 === a &&
  54110. (console.warn(
  54111. "THREE.BufferAttribute.copyColorsArray(): color is undefined",
  54112. r
  54113. ),
  54114. (a = new n.Color())),
  54115. (t[i++] = a.r),
  54116. (t[i++] = a.g),
  54117. (t[i++] = a.b);
  54118. }
  54119. return this;
  54120. },
  54121. copyIndicesArray: function (e) {
  54122. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  54123. var o = e[n];
  54124. (t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c);
  54125. }
  54126. return this;
  54127. },
  54128. copyVector2sArray: function (e) {
  54129. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54130. var a = e[r];
  54131. void 0 === a &&
  54132. (console.warn(
  54133. "THREE.BufferAttribute.copyVector2sArray(): vector is undefined",
  54134. r
  54135. ),
  54136. (a = new n.Vector2())),
  54137. (t[i++] = a.x),
  54138. (t[i++] = a.y);
  54139. }
  54140. return this;
  54141. },
  54142. copyVector3sArray: function (e) {
  54143. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54144. var a = e[r];
  54145. void 0 === a &&
  54146. (console.warn(
  54147. "THREE.BufferAttribute.copyVector3sArray(): vector is undefined",
  54148. r
  54149. ),
  54150. (a = new n.Vector3())),
  54151. (t[i++] = a.x),
  54152. (t[i++] = a.y),
  54153. (t[i++] = a.z);
  54154. }
  54155. return this;
  54156. },
  54157. copyVector4sArray: function (e) {
  54158. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  54159. var a = e[r];
  54160. void 0 === a &&
  54161. (console.warn(
  54162. "THREE.BufferAttribute.copyVector4sArray(): vector is undefined",
  54163. r
  54164. ),
  54165. (a = new n.Vector4())),
  54166. (t[i++] = a.x),
  54167. (t[i++] = a.y),
  54168. (t[i++] = a.z),
  54169. (t[i++] = a.w);
  54170. }
  54171. return this;
  54172. },
  54173. set: function (e, t) {
  54174. return void 0 === t && (t = 0), this.array.set(e, t), this;
  54175. },
  54176. getX: function (e) {
  54177. return this.array[e * this.itemSize];
  54178. },
  54179. setX: function (e, t) {
  54180. return (this.array[e * this.itemSize] = t), this;
  54181. },
  54182. getY: function (e) {
  54183. return this.array[e * this.itemSize + 1];
  54184. },
  54185. setY: function (e, t) {
  54186. return (this.array[e * this.itemSize + 1] = t), this;
  54187. },
  54188. getZ: function (e) {
  54189. return this.array[e * this.itemSize + 2];
  54190. },
  54191. setZ: function (e, t) {
  54192. return (this.array[e * this.itemSize + 2] = t), this;
  54193. },
  54194. getW: function (e) {
  54195. return this.array[e * this.itemSize + 3];
  54196. },
  54197. setW: function (e, t) {
  54198. return (this.array[e * this.itemSize + 3] = t), this;
  54199. },
  54200. setXY: function (e, t, i) {
  54201. return (
  54202. (e *= this.itemSize),
  54203. (this.array[e + 0] = t),
  54204. (this.array[e + 1] = i),
  54205. this
  54206. );
  54207. },
  54208. setXYZ: function (e, t, i, n) {
  54209. return (
  54210. (e *= this.itemSize),
  54211. (this.array[e + 0] = t),
  54212. (this.array[e + 1] = i),
  54213. (this.array[e + 2] = n),
  54214. this
  54215. );
  54216. },
  54217. setXYZW: function (e, t, i, n, r) {
  54218. return (
  54219. (e *= this.itemSize),
  54220. (this.array[e + 0] = t),
  54221. (this.array[e + 1] = i),
  54222. (this.array[e + 2] = n),
  54223. (this.array[e + 3] = r),
  54224. this
  54225. );
  54226. },
  54227. clone: function () {
  54228. return new this.constructor().copy(this);
  54229. },
  54230. }),
  54231. (n.Int8Attribute = function (e, t) {
  54232. return new n.BufferAttribute(new Int8Array(e), t);
  54233. }),
  54234. (n.Uint8Attribute = function (e, t) {
  54235. return new n.BufferAttribute(new Uint8Array(e), t);
  54236. }),
  54237. (n.Uint8ClampedAttribute = function (e, t) {
  54238. return new n.BufferAttribute(new Uint8ClampedArray(e), t);
  54239. }),
  54240. (n.Int16Attribute = function (e, t) {
  54241. return new n.BufferAttribute(new Int16Array(e), t);
  54242. }),
  54243. (n.Uint16Attribute = function (e, t) {
  54244. return new n.BufferAttribute(new Uint16Array(e), t);
  54245. });
  54246. n.Int32Attribute = function (e, t) {
  54247. return new n.BufferAttribute(new Int32Array(e), t);
  54248. };
  54249. (n.Uint32Attribute = function (e, t) {
  54250. return new n.BufferAttribute(new Uint32Array(e), t);
  54251. }),
  54252. (n.Float32Attribute = function (e, t) {
  54253. return new n.BufferAttribute(new Float32Array(e), t);
  54254. }),
  54255. (n.Float64Attribute = function (e, t) {
  54256. return new n.BufferAttribute(new Float64Array(e), t);
  54257. }),
  54258. (n.DynamicBufferAttribute = function (e, t) {
  54259. return (
  54260. console.warn(
  54261. "THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."
  54262. ),
  54263. new n.BufferAttribute(e, t).setDynamic(!0)
  54264. );
  54265. }),
  54266. (n.InstancedBufferAttribute = function (e, t, i) {
  54267. n.BufferAttribute.call(this, e, t),
  54268. (this.meshPerAttribute = i || 1);
  54269. }),
  54270. (n.InstancedBufferAttribute.prototype = Object.create(
  54271. n.BufferAttribute.prototype
  54272. )),
  54273. (n.InstancedBufferAttribute.prototype.constructor =
  54274. n.InstancedBufferAttribute),
  54275. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  54276. return (
  54277. n.BufferAttribute.prototype.copy.call(this, e),
  54278. (this.meshPerAttribute = e.meshPerAttribute),
  54279. this
  54280. );
  54281. }),
  54282. (n.InterleavedBuffer = function (e, t) {
  54283. (this.uuid = n.Math.generateUUID()),
  54284. (this.array = e),
  54285. (this.stride = t),
  54286. (this.dynamic = !1),
  54287. (this.updateRange = {
  54288. offset: 0,
  54289. count: -1,
  54290. }),
  54291. (this.version = 0);
  54292. }),
  54293. (n.InterleavedBuffer.prototype = {
  54294. constructor: n.InterleavedBuffer,
  54295. get length() {
  54296. return this.array.length;
  54297. },
  54298. get count() {
  54299. return this.array.length / this.stride;
  54300. },
  54301. set needsUpdate(e) {
  54302. e === !0 && this.version++;
  54303. },
  54304. setDynamic: function (e) {
  54305. return (this.dynamic = e), this;
  54306. },
  54307. copy: function (e) {
  54308. return (
  54309. (this.array = new e.array.constructor(e.array)),
  54310. (this.stride = e.stride),
  54311. (this.dynamic = e.dynamic),
  54312. this
  54313. );
  54314. },
  54315. copyAt: function (e, t, i) {
  54316. (e *= this.stride), (i *= t.stride);
  54317. for (var n = 0, r = this.stride; n < r; n++)
  54318. this.array[e + n] = t.array[i + n];
  54319. return this;
  54320. },
  54321. set: function (e, t) {
  54322. return void 0 === t && (t = 0), this.array.set(e, t), this;
  54323. },
  54324. clone: function () {
  54325. return new this.constructor().copy(this);
  54326. },
  54327. }),
  54328. (n.InstancedInterleavedBuffer = function (e, t, i) {
  54329. n.InterleavedBuffer.call(this, e, t),
  54330. (this.meshPerAttribute = i || 1);
  54331. }),
  54332. (n.InstancedInterleavedBuffer.prototype = Object.create(
  54333. n.InterleavedBuffer.prototype
  54334. )),
  54335. (n.InstancedInterleavedBuffer.prototype.constructor =
  54336. n.InstancedInterleavedBuffer),
  54337. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  54338. return (
  54339. n.InterleavedBuffer.prototype.copy.call(this, e),
  54340. (this.meshPerAttribute = e.meshPerAttribute),
  54341. this
  54342. );
  54343. }),
  54344. (n.InterleavedBufferAttribute = function (e, t, i) {
  54345. (this.uuid = n.Math.generateUUID()),
  54346. (this.data = e),
  54347. (this.itemSize = t),
  54348. (this.offset = i);
  54349. }),
  54350. (n.InterleavedBufferAttribute.prototype = {
  54351. constructor: n.InterleavedBufferAttribute,
  54352. get length() {
  54353. return (
  54354. console.warn(
  54355. "THREE.BufferAttribute: .length has been deprecated. Please use .count."
  54356. ),
  54357. this.array.length
  54358. );
  54359. },
  54360. get count() {
  54361. return this.data.count;
  54362. },
  54363. setX: function (e, t) {
  54364. return (
  54365. (this.data.array[e * this.data.stride + this.offset] = t), this
  54366. );
  54367. },
  54368. setY: function (e, t) {
  54369. return (
  54370. (this.data.array[e * this.data.stride + this.offset + 1] = t),
  54371. this
  54372. );
  54373. },
  54374. setZ: function (e, t) {
  54375. return (
  54376. (this.data.array[e * this.data.stride + this.offset + 2] = t),
  54377. this
  54378. );
  54379. },
  54380. setW: function (e, t) {
  54381. return (
  54382. (this.data.array[e * this.data.stride + this.offset + 3] = t),
  54383. this
  54384. );
  54385. },
  54386. getX: function (e) {
  54387. return this.data.array[e * this.data.stride + this.offset];
  54388. },
  54389. getY: function (e) {
  54390. return this.data.array[e * this.data.stride + this.offset + 1];
  54391. },
  54392. getZ: function (e) {
  54393. return this.data.array[e * this.data.stride + this.offset + 2];
  54394. },
  54395. getW: function (e) {
  54396. return this.data.array[e * this.data.stride + this.offset + 3];
  54397. },
  54398. setXY: function (e, t, i) {
  54399. return (
  54400. (e = e * this.data.stride + this.offset),
  54401. (this.data.array[e + 0] = t),
  54402. (this.data.array[e + 1] = i),
  54403. this
  54404. );
  54405. },
  54406. setXYZ: function (e, t, i, n) {
  54407. return (
  54408. (e = e * this.data.stride + this.offset),
  54409. (this.data.array[e + 0] = t),
  54410. (this.data.array[e + 1] = i),
  54411. (this.data.array[e + 2] = n),
  54412. this
  54413. );
  54414. },
  54415. setXYZW: function (e, t, i, n, r) {
  54416. return (
  54417. (e = e * this.data.stride + this.offset),
  54418. (this.data.array[e + 0] = t),
  54419. (this.data.array[e + 1] = i),
  54420. (this.data.array[e + 2] = n),
  54421. (this.data.array[e + 3] = r),
  54422. this
  54423. );
  54424. },
  54425. }),
  54426. (n.Geometry = function () {
  54427. Object.defineProperty(this, "id", {
  54428. value: n.GeometryIdCount++,
  54429. }),
  54430. (this.uuid = n.Math.generateUUID()),
  54431. (this.name = ""),
  54432. (this.type = "Geometry"),
  54433. (this.vertices = []),
  54434. (this.colors = []),
  54435. (this.faces = []),
  54436. (this.faceVertexUvs = [[]]),
  54437. (this.morphTargets = []),
  54438. (this.morphNormals = []),
  54439. (this.skinWeights = []),
  54440. (this.skinIndices = []),
  54441. (this.lineDistances = []),
  54442. (this.boundingBox = null),
  54443. (this.boundingSphere = null),
  54444. (this.verticesNeedUpdate = !1),
  54445. (this.elementsNeedUpdate = !1),
  54446. (this.uvsNeedUpdate = !1),
  54447. (this.normalsNeedUpdate = !1),
  54448. (this.colorsNeedUpdate = !1),
  54449. (this.lineDistancesNeedUpdate = !1),
  54450. (this.groupsNeedUpdate = !1);
  54451. }),
  54452. (n.Geometry.prototype = {
  54453. constructor: n.Geometry,
  54454. applyMatrix: function (e) {
  54455. for (
  54456. var t = new n.Matrix3().getNormalMatrix(e),
  54457. i = 0,
  54458. r = this.vertices.length;
  54459. i < r;
  54460. i++
  54461. ) {
  54462. var o = this.vertices[i];
  54463. o.applyMatrix4(e);
  54464. }
  54465. for (var i = 0, r = this.faces.length; i < r; i++) {
  54466. var a = this.faces[i];
  54467. a.normal.applyMatrix3(t).normalize();
  54468. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  54469. a.vertexNormals[s].applyMatrix3(t).normalize();
  54470. }
  54471. return (
  54472. null !== this.boundingBox && this.computeBoundingBox(),
  54473. null !== this.boundingSphere && this.computeBoundingSphere(),
  54474. (this.verticesNeedUpdate = !0),
  54475. (this.normalsNeedUpdate = !0),
  54476. this
  54477. );
  54478. },
  54479. rotateX: (function () {
  54480. var e;
  54481. return function (t) {
  54482. return (
  54483. void 0 === e && (e = new n.Matrix4()),
  54484. e.makeRotationX(t),
  54485. this.applyMatrix(e),
  54486. this
  54487. );
  54488. };
  54489. })(),
  54490. rotateY: (function () {
  54491. var e;
  54492. return function (t) {
  54493. return (
  54494. void 0 === e && (e = new n.Matrix4()),
  54495. e.makeRotationY(t),
  54496. this.applyMatrix(e),
  54497. this
  54498. );
  54499. };
  54500. })(),
  54501. rotateZ: (function () {
  54502. var e;
  54503. return function (t) {
  54504. return (
  54505. void 0 === e && (e = new n.Matrix4()),
  54506. e.makeRotationZ(t),
  54507. this.applyMatrix(e),
  54508. this
  54509. );
  54510. };
  54511. })(),
  54512. translate: (function () {
  54513. var e;
  54514. return function (t, i, r) {
  54515. return (
  54516. void 0 === e && (e = new n.Matrix4()),
  54517. e.makeTranslation(t, i, r),
  54518. this.applyMatrix(e),
  54519. this
  54520. );
  54521. };
  54522. })(),
  54523. scale: (function () {
  54524. var e;
  54525. return function (t, i, r) {
  54526. return (
  54527. void 0 === e && (e = new n.Matrix4()),
  54528. e.makeScale(t, i, r),
  54529. this.applyMatrix(e),
  54530. this
  54531. );
  54532. };
  54533. })(),
  54534. lookAt: (function () {
  54535. var e;
  54536. return function (t) {
  54537. void 0 === e && (e = new n.Object3D()),
  54538. e.lookAt(t),
  54539. e.updateMatrix(),
  54540. this.applyMatrix(e.matrix);
  54541. };
  54542. })(),
  54543. fromBufferGeometry: function (e) {
  54544. function t(e, t, r, o) {
  54545. var a =
  54546. void 0 !== s
  54547. ? [u[e].clone(), u[t].clone(), u[r].clone()]
  54548. : [],
  54549. f =
  54550. void 0 !== l
  54551. ? [
  54552. i.colors[e].clone(),
  54553. i.colors[t].clone(),
  54554. i.colors[r].clone(),
  54555. ]
  54556. : [],
  54557. g = new n.Face3(e, t, r, a, f, o);
  54558. i.faces.push(g),
  54559. void 0 !== c &&
  54560. i.faceVertexUvs[0].push([
  54561. d[e].clone(),
  54562. d[t].clone(),
  54563. d[r].clone(),
  54564. ]),
  54565. void 0 !== h &&
  54566. i.faceVertexUvs[1].push([
  54567. p[e].clone(),
  54568. p[t].clone(),
  54569. p[r].clone(),
  54570. ]);
  54571. }
  54572. var i = this,
  54573. r = null !== e.index ? e.index.array : void 0,
  54574. o = e.attributes,
  54575. a = o.position.array,
  54576. s = void 0 !== o.normal ? o.normal.array : void 0,
  54577. l = void 0 !== o.color ? o.color.array : void 0,
  54578. c = void 0 !== o.uv ? o.uv.array : void 0,
  54579. h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  54580. void 0 !== h && (this.faceVertexUvs[1] = []);
  54581. for (
  54582. var u = [], d = [], p = [], f = 0, g = 0;
  54583. f < a.length;
  54584. f += 3, g += 2
  54585. )
  54586. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  54587. void 0 !== s &&
  54588. u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  54589. void 0 !== l &&
  54590. i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  54591. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  54592. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]));
  54593. if (void 0 !== r) {
  54594. var m = e.groups;
  54595. if (m.length > 0)
  54596. for (var f = 0; f < m.length; f++)
  54597. for (
  54598. var v = m[f], A = v.start, y = v.count, g = A, C = A + y;
  54599. g < C;
  54600. g += 3
  54601. )
  54602. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  54603. else
  54604. for (var f = 0; f < r.length; f += 3)
  54605. t(r[f], r[f + 1], r[f + 2]);
  54606. } else
  54607. for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2);
  54608. return (
  54609. this.computeFaceNormals(),
  54610. null !== e.boundingBox &&
  54611. (this.boundingBox = e.boundingBox.clone()),
  54612. null !== e.boundingSphere &&
  54613. (this.boundingSphere = e.boundingSphere.clone()),
  54614. this
  54615. );
  54616. },
  54617. center: function () {
  54618. this.computeBoundingBox();
  54619. var e = this.boundingBox.center().negate();
  54620. return this.translate(e.x, e.y, e.z), e;
  54621. },
  54622. normalize: function () {
  54623. this.computeBoundingSphere();
  54624. var e = this.boundingSphere.center,
  54625. t = this.boundingSphere.radius,
  54626. i = 0 === t ? 1 : 1 / t,
  54627. r = new n.Matrix4();
  54628. return (
  54629. r.set(
  54630. i,
  54631. 0,
  54632. 0,
  54633. -i * e.x,
  54634. 0,
  54635. i,
  54636. 0,
  54637. -i * e.y,
  54638. 0,
  54639. 0,
  54640. i,
  54641. -i * e.z,
  54642. 0,
  54643. 0,
  54644. 0,
  54645. 1
  54646. ),
  54647. this.applyMatrix(r),
  54648. this
  54649. );
  54650. },
  54651. computeFaceNormals: function () {
  54652. for (
  54653. var e = new n.Vector3(),
  54654. t = new n.Vector3(),
  54655. i = 0,
  54656. r = this.faces.length;
  54657. i < r;
  54658. i++
  54659. ) {
  54660. var o = this.faces[i],
  54661. a = this.vertices[o.a],
  54662. s = this.vertices[o.b],
  54663. l = this.vertices[o.c];
  54664. e.subVectors(l, s),
  54665. t.subVectors(a, s),
  54666. e.cross(t),
  54667. e.normalize(),
  54668. o.normal.copy(e);
  54669. }
  54670. },
  54671. computeVertexNormals: function (e) {
  54672. void 0 === e && (e = !0);
  54673. var t, i, r, o, a, s;
  54674. for (
  54675. s = new Array(this.vertices.length),
  54676. t = 0,
  54677. i = this.vertices.length;
  54678. t < i;
  54679. t++
  54680. )
  54681. s[t] = new n.Vector3();
  54682. if (e) {
  54683. var l,
  54684. c,
  54685. h,
  54686. u = new n.Vector3(),
  54687. d = new n.Vector3();
  54688. for (r = 0, o = this.faces.length; r < o; r++)
  54689. (a = this.faces[r]),
  54690. (l = this.vertices[a.a]),
  54691. (c = this.vertices[a.b]),
  54692. (h = this.vertices[a.c]),
  54693. u.subVectors(h, c),
  54694. d.subVectors(l, c),
  54695. u.cross(d),
  54696. s[a.a].add(u),
  54697. s[a.b].add(u),
  54698. s[a.c].add(u);
  54699. } else
  54700. for (r = 0, o = this.faces.length; r < o; r++)
  54701. (a = this.faces[r]),
  54702. s[a.a].add(a.normal),
  54703. s[a.b].add(a.normal),
  54704. s[a.c].add(a.normal);
  54705. for (t = 0, i = this.vertices.length; t < i; t++)
  54706. s[t].normalize();
  54707. for (r = 0, o = this.faces.length; r < o; r++) {
  54708. a = this.faces[r];
  54709. var p = a.vertexNormals;
  54710. 3 === p.length
  54711. ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c]))
  54712. : ((p[0] = s[a.a].clone()),
  54713. (p[1] = s[a.b].clone()),
  54714. (p[2] = s[a.c].clone()));
  54715. }
  54716. this.faces.length > 0 && (this.normalsNeedUpdate = !0);
  54717. },
  54718. computeMorphNormals: function () {
  54719. var e, t, i, r, o;
  54720. for (i = 0, r = this.faces.length; i < r; i++)
  54721. for (
  54722. o = this.faces[i],
  54723. o.__originalFaceNormal
  54724. ? o.__originalFaceNormal.copy(o.normal)
  54725. : (o.__originalFaceNormal = o.normal.clone()),
  54726. o.__originalVertexNormals ||
  54727. (o.__originalVertexNormals = []),
  54728. e = 0,
  54729. t = o.vertexNormals.length;
  54730. e < t;
  54731. e++
  54732. )
  54733. o.__originalVertexNormals[e]
  54734. ? o.__originalVertexNormals[e].copy(o.vertexNormals[e])
  54735. : (o.__originalVertexNormals[e] =
  54736. o.vertexNormals[e].clone());
  54737. var a = new n.Geometry();
  54738. for (
  54739. a.faces = this.faces, e = 0, t = this.morphTargets.length;
  54740. e < t;
  54741. e++
  54742. ) {
  54743. if (!this.morphNormals[e]) {
  54744. (this.morphNormals[e] = {}),
  54745. (this.morphNormals[e].faceNormals = []),
  54746. (this.morphNormals[e].vertexNormals = []);
  54747. var s,
  54748. l,
  54749. c = this.morphNormals[e].faceNormals,
  54750. h = this.morphNormals[e].vertexNormals;
  54751. for (i = 0, r = this.faces.length; i < r; i++)
  54752. (s = new n.Vector3()),
  54753. (l = {
  54754. a: new n.Vector3(),
  54755. b: new n.Vector3(),
  54756. c: new n.Vector3(),
  54757. }),
  54758. c.push(s),
  54759. h.push(l);
  54760. }
  54761. var u = this.morphNormals[e];
  54762. (a.vertices = this.morphTargets[e].vertices),
  54763. a.computeFaceNormals(),
  54764. a.computeVertexNormals();
  54765. var s, l;
  54766. for (i = 0, r = this.faces.length; i < r; i++)
  54767. (o = this.faces[i]),
  54768. (s = u.faceNormals[i]),
  54769. (l = u.vertexNormals[i]),
  54770. s.copy(o.normal),
  54771. l.a.copy(o.vertexNormals[0]),
  54772. l.b.copy(o.vertexNormals[1]),
  54773. l.c.copy(o.vertexNormals[2]);
  54774. }
  54775. for (i = 0, r = this.faces.length; i < r; i++)
  54776. (o = this.faces[i]),
  54777. (o.normal = o.__originalFaceNormal),
  54778. (o.vertexNormals = o.__originalVertexNormals);
  54779. },
  54780. computeTangents: function () {
  54781. console.warn(
  54782. "THREE.Geometry: .computeTangents() has been removed."
  54783. );
  54784. },
  54785. computeLineDistances: function () {
  54786. for (
  54787. var e = 0, t = this.vertices, i = 0, n = t.length;
  54788. i < n;
  54789. i++
  54790. )
  54791. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  54792. (this.lineDistances[i] = e);
  54793. },
  54794. computeBoundingBox: function () {
  54795. null === this.boundingBox && (this.boundingBox = new n.Box3()),
  54796. this.boundingBox.setFromPoints(this.vertices);
  54797. },
  54798. computeBoundingSphere: function () {
  54799. null === this.boundingSphere &&
  54800. (this.boundingSphere = new n.Sphere()),
  54801. this.boundingSphere.setFromPoints(this.vertices);
  54802. },
  54803. merge: function (e, t, i) {
  54804. if (e instanceof n.Geometry == !1)
  54805. return void console.error(
  54806. "THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",
  54807. e
  54808. );
  54809. var r,
  54810. o = this.vertices.length,
  54811. a = this.vertices,
  54812. s = e.vertices,
  54813. l = this.faces,
  54814. c = e.faces,
  54815. h = this.faceVertexUvs[0],
  54816. u = e.faceVertexUvs[0];
  54817. void 0 === i && (i = 0),
  54818. void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t));
  54819. for (var d = 0, p = s.length; d < p; d++) {
  54820. var f = s[d],
  54821. g = f.clone();
  54822. void 0 !== t && g.applyMatrix4(t), a.push(g);
  54823. }
  54824. for (d = 0, p = c.length; d < p; d++) {
  54825. var m,
  54826. v,
  54827. A,
  54828. y = c[d],
  54829. C = y.vertexNormals,
  54830. I = y.vertexColors;
  54831. (m = new n.Face3(y.a + o, y.b + o, y.c + o)),
  54832. m.normal.copy(y.normal),
  54833. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  54834. for (var E = 0, b = C.length; E < b; E++)
  54835. (v = C[E].clone()),
  54836. void 0 !== r && v.applyMatrix3(r).normalize(),
  54837. m.vertexNormals.push(v);
  54838. m.color.copy(y.color);
  54839. for (var E = 0, b = I.length; E < b; E++)
  54840. (A = I[E]), m.vertexColors.push(A.clone());
  54841. (m.materialIndex = y.materialIndex + i), l.push(m);
  54842. }
  54843. for (d = 0, p = u.length; d < p; d++) {
  54844. var w = u[d],
  54845. _ = [];
  54846. if (void 0 !== w) {
  54847. for (var E = 0, b = w.length; E < b; E++)
  54848. _.push(w[E].clone());
  54849. h.push(_);
  54850. }
  54851. }
  54852. },
  54853. mergeMesh: function (e) {
  54854. return e instanceof n.Mesh == !1
  54855. ? void console.error(
  54856. "THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",
  54857. e
  54858. )
  54859. : (e.matrixAutoUpdate && e.updateMatrix(),
  54860. void this.merge(e.geometry, e.matrix));
  54861. },
  54862. mergeVertices: function () {
  54863. var e,
  54864. t,
  54865. i,
  54866. n,
  54867. r,
  54868. o,
  54869. a,
  54870. s,
  54871. l = {},
  54872. c = [],
  54873. h = [],
  54874. u = 4,
  54875. d = Math.pow(10, u);
  54876. for (i = 0, n = this.vertices.length; i < n; i++)
  54877. (e = this.vertices[i]),
  54878. (t =
  54879. Math.round(e.x * d) +
  54880. "_" +
  54881. Math.round(e.y * d) +
  54882. "_" +
  54883. Math.round(e.z * d)),
  54884. void 0 === l[t]
  54885. ? ((l[t] = i),
  54886. c.push(this.vertices[i]),
  54887. (h[i] = c.length - 1))
  54888. : (h[i] = h[l[t]]);
  54889. var p = [];
  54890. for (i = 0, n = this.faces.length; i < n; i++) {
  54891. (r = this.faces[i]),
  54892. (r.a = h[r.a]),
  54893. (r.b = h[r.b]),
  54894. (r.c = h[r.c]),
  54895. (o = [r.a, r.b, r.c]);
  54896. for (var f = -1, g = 0; g < 3; g++)
  54897. if (o[g] === o[(g + 1) % 3]) {
  54898. (f = g), p.push(i);
  54899. break;
  54900. }
  54901. }
  54902. for (i = p.length - 1; i >= 0; i--) {
  54903. var m = p[i];
  54904. for (
  54905. this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length;
  54906. a < s;
  54907. a++
  54908. )
  54909. this.faceVertexUvs[a].splice(m, 1);
  54910. }
  54911. var v = this.vertices.length - c.length;
  54912. return (this.vertices = c), v;
  54913. },
  54914. sortFacesByMaterialIndex: function () {
  54915. function e(e, t) {
  54916. return e.materialIndex - t.materialIndex;
  54917. }
  54918. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  54919. t[n]._id = n;
  54920. t.sort(e);
  54921. var r,
  54922. o,
  54923. a = this.faceVertexUvs[0],
  54924. s = this.faceVertexUvs[1];
  54925. a && a.length === i && (r = []), s && s.length === i && (o = []);
  54926. for (var n = 0; n < i; n++) {
  54927. var l = t[n]._id;
  54928. r && r.push(a[l]), o && o.push(s[l]);
  54929. }
  54930. r && (this.faceVertexUvs[0] = r),
  54931. o && (this.faceVertexUvs[1] = o);
  54932. },
  54933. toJSON: function () {
  54934. function e(e, t, i) {
  54935. return i ? e | (1 << t) : e & ~(1 << t);
  54936. }
  54937. function t(e) {
  54938. var t = e.x.toString() + e.y.toString() + e.z.toString();
  54939. return void 0 !== d[t]
  54940. ? d[t]
  54941. : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t]);
  54942. }
  54943. function i(e) {
  54944. var t = e.r.toString() + e.g.toString() + e.b.toString();
  54945. return void 0 !== f[t]
  54946. ? f[t]
  54947. : ((f[t] = p.length), p.push(e.getHex()), f[t]);
  54948. }
  54949. function n(e) {
  54950. var t = e.x.toString() + e.y.toString();
  54951. return void 0 !== m[t]
  54952. ? m[t]
  54953. : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t]);
  54954. }
  54955. var r = {
  54956. metadata: {
  54957. version: 4.4,
  54958. type: "Geometry",
  54959. generator: "Geometry.toJSON",
  54960. },
  54961. };
  54962. if (
  54963. ((r.uuid = this.uuid),
  54964. (r.type = this.type),
  54965. "" !== this.name && (r.name = this.name),
  54966. void 0 !== this.parameters)
  54967. ) {
  54968. var o = this.parameters;
  54969. for (var a in o) void 0 !== o[a] && (r[a] = o[a]);
  54970. return r;
  54971. }
  54972. for (var s = [], l = 0; l < this.vertices.length; l++) {
  54973. var c = this.vertices[l];
  54974. s.push(c.x, c.y, c.z);
  54975. }
  54976. for (
  54977. var h = [],
  54978. u = [],
  54979. d = {},
  54980. p = [],
  54981. f = {},
  54982. g = [],
  54983. m = {},
  54984. l = 0;
  54985. l < this.faces.length;
  54986. l++
  54987. ) {
  54988. var v = this.faces[l],
  54989. A = !0,
  54990. y = !1,
  54991. C = void 0 !== this.faceVertexUvs[0][l],
  54992. I = v.normal.length() > 0,
  54993. E = v.vertexNormals.length > 0,
  54994. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  54995. w = v.vertexColors.length > 0,
  54996. _ = 0;
  54997. if (
  54998. ((_ = e(_, 0, 0)),
  54999. (_ = e(_, 1, A)),
  55000. (_ = e(_, 2, y)),
  55001. (_ = e(_, 3, C)),
  55002. (_ = e(_, 4, I)),
  55003. (_ = e(_, 5, E)),
  55004. (_ = e(_, 6, b)),
  55005. (_ = e(_, 7, w)),
  55006. h.push(_),
  55007. h.push(v.a, v.b, v.c),
  55008. h.push(v.materialIndex),
  55009. C)
  55010. ) {
  55011. var T = this.faceVertexUvs[0][l];
  55012. h.push(n(T[0]), n(T[1]), n(T[2]));
  55013. }
  55014. if ((I && h.push(t(v.normal)), E)) {
  55015. var x = v.vertexNormals;
  55016. h.push(t(x[0]), t(x[1]), t(x[2]));
  55017. }
  55018. if ((b && h.push(i(v.color)), w)) {
  55019. var S = v.vertexColors;
  55020. h.push(i(S[0]), i(S[1]), i(S[2]));
  55021. }
  55022. }
  55023. return (
  55024. (r.data = {}),
  55025. (r.data.vertices = s),
  55026. (r.data.normals = u),
  55027. p.length > 0 && (r.data.colors = p),
  55028. g.length > 0 && (r.data.uvs = [g]),
  55029. (r.data.faces = h),
  55030. r
  55031. );
  55032. },
  55033. clone: function () {
  55034. return new n.Geometry().copy(this);
  55035. },
  55036. copy: function (e) {
  55037. (this.vertices = []),
  55038. (this.faces = []),
  55039. (this.faceVertexUvs = [[]]);
  55040. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  55041. this.vertices.push(t[i].clone());
  55042. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  55043. this.faces.push(r[i].clone());
  55044. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  55045. var o = e.faceVertexUvs[i];
  55046. void 0 === this.faceVertexUvs[i] &&
  55047. (this.faceVertexUvs[i] = []);
  55048. for (var a = 0, s = o.length; a < s; a++) {
  55049. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  55050. var d = l[h];
  55051. c.push(d.clone());
  55052. }
  55053. this.faceVertexUvs[i].push(c);
  55054. }
  55055. }
  55056. return this;
  55057. },
  55058. dispose: function () {
  55059. this.dispatchEvent({
  55060. type: "dispose",
  55061. });
  55062. },
  55063. }),
  55064. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  55065. (n.GeometryIdCount = 0),
  55066. (n.DirectGeometry = function () {
  55067. Object.defineProperty(this, "id", {
  55068. value: n.GeometryIdCount++,
  55069. }),
  55070. (this.uuid = n.Math.generateUUID()),
  55071. (this.name = ""),
  55072. (this.type = "DirectGeometry"),
  55073. (this.indices = []),
  55074. (this.vertices = []),
  55075. (this.normals = []),
  55076. (this.colors = []),
  55077. (this.uvs = []),
  55078. (this.uvs2 = []),
  55079. (this.groups = []),
  55080. (this.morphTargets = {}),
  55081. (this.skinWeights = []),
  55082. (this.skinIndices = []),
  55083. (this.boundingBox = null),
  55084. (this.boundingSphere = null),
  55085. (this.verticesNeedUpdate = !1),
  55086. (this.normalsNeedUpdate = !1),
  55087. (this.colorsNeedUpdate = !1),
  55088. (this.uvsNeedUpdate = !1),
  55089. (this.groupsNeedUpdate = !1);
  55090. }),
  55091. (n.DirectGeometry.prototype = {
  55092. constructor: n.DirectGeometry,
  55093. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  55094. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  55095. computeFaceNormals: function () {
  55096. console.warn(
  55097. "THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry."
  55098. );
  55099. },
  55100. computeVertexNormals: function () {
  55101. console.warn(
  55102. "THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry."
  55103. );
  55104. },
  55105. computeGroups: function (e) {
  55106. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  55107. var a = r[o];
  55108. a.materialIndex !== i &&
  55109. ((i = a.materialIndex),
  55110. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  55111. (t = {
  55112. start: 3 * o,
  55113. materialIndex: i,
  55114. }));
  55115. }
  55116. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  55117. (this.groups = n);
  55118. },
  55119. fromGeometry: function (e) {
  55120. var t,
  55121. i = e.faces,
  55122. r = e.vertices,
  55123. o = e.faceVertexUvs,
  55124. a = o[0] && o[0].length > 0,
  55125. s = o[1] && o[1].length > 0,
  55126. l = e.morphTargets,
  55127. c = l.length;
  55128. if (c > 0) {
  55129. t = [];
  55130. for (var h = 0; h < c; h++) t[h] = [];
  55131. this.morphTargets.position = t;
  55132. }
  55133. var u,
  55134. d = e.morphNormals,
  55135. p = d.length;
  55136. if (p > 0) {
  55137. u = [];
  55138. for (var h = 0; h < p; h++) u[h] = [];
  55139. this.morphTargets.normal = u;
  55140. }
  55141. for (
  55142. var f = e.skinIndices,
  55143. g = e.skinWeights,
  55144. m = f.length === r.length,
  55145. v = g.length === r.length,
  55146. h = 0;
  55147. h < i.length;
  55148. h++
  55149. ) {
  55150. var A = i[h];
  55151. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  55152. var y = A.vertexNormals;
  55153. if (3 === y.length) this.normals.push(y[0], y[1], y[2]);
  55154. else {
  55155. var C = A.normal;
  55156. this.normals.push(C, C, C);
  55157. }
  55158. var I = A.vertexColors;
  55159. if (3 === I.length) this.colors.push(I[0], I[1], I[2]);
  55160. else {
  55161. var E = A.color;
  55162. this.colors.push(E, E, E);
  55163. }
  55164. if (a === !0) {
  55165. var b = o[0][h];
  55166. void 0 !== b
  55167. ? this.uvs.push(b[0], b[1], b[2])
  55168. : (console.warn(
  55169. "THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
  55170. h
  55171. ),
  55172. this.uvs.push(
  55173. new n.Vector2(),
  55174. new n.Vector2(),
  55175. new n.Vector2()
  55176. ));
  55177. }
  55178. if (s === !0) {
  55179. var b = o[1][h];
  55180. void 0 !== b
  55181. ? this.uvs2.push(b[0], b[1], b[2])
  55182. : (console.warn(
  55183. "THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
  55184. h
  55185. ),
  55186. this.uvs2.push(
  55187. new n.Vector2(),
  55188. new n.Vector2(),
  55189. new n.Vector2()
  55190. ));
  55191. }
  55192. for (var w = 0; w < c; w++) {
  55193. var _ = l[w].vertices;
  55194. t[w].push(_[A.a], _[A.b], _[A.c]);
  55195. }
  55196. for (var w = 0; w < p; w++) {
  55197. var T = d[w].vertexNormals[h];
  55198. u[w].push(T.a, T.b, T.c);
  55199. }
  55200. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  55201. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c]);
  55202. }
  55203. return (
  55204. this.computeGroups(e),
  55205. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  55206. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  55207. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  55208. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  55209. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  55210. this
  55211. );
  55212. },
  55213. dispose: function () {
  55214. this.dispatchEvent({
  55215. type: "dispose",
  55216. });
  55217. },
  55218. }),
  55219. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  55220. (n.BufferGeometry = function () {
  55221. Object.defineProperty(this, "id", {
  55222. value: n.GeometryIdCount++,
  55223. }),
  55224. (this.uuid = n.Math.generateUUID()),
  55225. (this.name = ""),
  55226. (this.type = "BufferGeometry"),
  55227. (this.index = null),
  55228. (this.attributes = {}),
  55229. (this.morphAttributes = {}),
  55230. (this.groups = []),
  55231. (this.boundingBox = null),
  55232. (this.boundingSphere = null),
  55233. (this.drawRange = {
  55234. start: 0,
  55235. count: 1 / 0,
  55236. });
  55237. }),
  55238. (n.BufferGeometry.prototype = {
  55239. constructor: n.BufferGeometry,
  55240. getIndex: function () {
  55241. return this.index;
  55242. },
  55243. setIndex: function (e) {
  55244. this.index = e;
  55245. },
  55246. addAttribute: function (e, t) {
  55247. return t instanceof n.BufferAttribute == !1 &&
  55248. t instanceof n.InterleavedBufferAttribute == !1
  55249. ? (console.warn(
  55250. "THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."
  55251. ),
  55252. void this.addAttribute(
  55253. e,
  55254. new n.BufferAttribute(arguments[1], arguments[2])
  55255. ))
  55256. : "index" === e
  55257. ? (console.warn(
  55258. "THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."
  55259. ),
  55260. void this.setIndex(t))
  55261. : ((this.attributes[e] = t), this);
  55262. },
  55263. getAttribute: function (e) {
  55264. return this.attributes[e];
  55265. },
  55266. removeAttribute: function (e) {
  55267. return delete this.attributes[e], this;
  55268. },
  55269. addGroup: function (e, t, i) {
  55270. this.groups.push({
  55271. start: e,
  55272. count: t,
  55273. materialIndex: void 0 !== i ? i : 0,
  55274. });
  55275. },
  55276. clearGroups: function () {
  55277. this.groups = [];
  55278. },
  55279. setDrawRange: function (e, t) {
  55280. (this.drawRange.start = e), (this.drawRange.count = t);
  55281. },
  55282. applyMatrix: function (e) {
  55283. var t = this.attributes.position;
  55284. void 0 !== t &&
  55285. (e.applyToVector3Array(t.array), (t.needsUpdate = !0));
  55286. var i = this.attributes.normal;
  55287. if (void 0 !== i) {
  55288. var r = new n.Matrix3().getNormalMatrix(e);
  55289. r.applyToVector3Array(i.array), (i.needsUpdate = !0);
  55290. }
  55291. return (
  55292. null !== this.boundingBox && this.computeBoundingBox(),
  55293. null !== this.boundingSphere && this.computeBoundingSphere(),
  55294. this
  55295. );
  55296. },
  55297. rotateX: (function () {
  55298. var e;
  55299. return function (t) {
  55300. return (
  55301. void 0 === e && (e = new n.Matrix4()),
  55302. e.makeRotationX(t),
  55303. this.applyMatrix(e),
  55304. this
  55305. );
  55306. };
  55307. })(),
  55308. rotateY: (function () {
  55309. var e;
  55310. return function (t) {
  55311. return (
  55312. void 0 === e && (e = new n.Matrix4()),
  55313. e.makeRotationY(t),
  55314. this.applyMatrix(e),
  55315. this
  55316. );
  55317. };
  55318. })(),
  55319. rotateZ: (function () {
  55320. var e;
  55321. return function (t) {
  55322. return (
  55323. void 0 === e && (e = new n.Matrix4()),
  55324. e.makeRotationZ(t),
  55325. this.applyMatrix(e),
  55326. this
  55327. );
  55328. };
  55329. })(),
  55330. translate: (function () {
  55331. var e;
  55332. return function (t, i, r) {
  55333. return (
  55334. void 0 === e && (e = new n.Matrix4()),
  55335. e.makeTranslation(t, i, r),
  55336. this.applyMatrix(e),
  55337. this
  55338. );
  55339. };
  55340. })(),
  55341. scale: (function () {
  55342. var e;
  55343. return function (t, i, r) {
  55344. return (
  55345. void 0 === e && (e = new n.Matrix4()),
  55346. e.makeScale(t, i, r),
  55347. this.applyMatrix(e),
  55348. this
  55349. );
  55350. };
  55351. })(),
  55352. lookAt: (function () {
  55353. var e;
  55354. return function (t) {
  55355. void 0 === e && (e = new n.Object3D()),
  55356. e.lookAt(t),
  55357. e.updateMatrix(),
  55358. this.applyMatrix(e.matrix);
  55359. };
  55360. })(),
  55361. center: function () {
  55362. this.computeBoundingBox();
  55363. var e = this.boundingBox.center().negate();
  55364. return this.translate(e.x, e.y, e.z), e;
  55365. },
  55366. setFromObject: function (e) {
  55367. var t = e.geometry;
  55368. if (e instanceof n.Points || e instanceof n.Line) {
  55369. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  55370. r = new n.Float32Attribute(3 * t.colors.length, 3);
  55371. if (
  55372. (this.addAttribute(
  55373. "position",
  55374. i.copyVector3sArray(t.vertices)
  55375. ),
  55376. this.addAttribute("color", r.copyColorsArray(t.colors)),
  55377. t.lineDistances &&
  55378. t.lineDistances.length === t.vertices.length)
  55379. ) {
  55380. var o = new n.Float32Attribute(t.lineDistances.length, 1);
  55381. this.addAttribute(
  55382. "lineDistance",
  55383. o.copyArray(t.lineDistances)
  55384. );
  55385. }
  55386. null !== t.boundingSphere &&
  55387. (this.boundingSphere = t.boundingSphere.clone()),
  55388. null !== t.boundingBox &&
  55389. (this.boundingBox = t.boundingBox.clone());
  55390. } else
  55391. e instanceof n.Mesh &&
  55392. t instanceof n.Geometry &&
  55393. this.fromGeometry(t);
  55394. return this;
  55395. },
  55396. updateFromObject: function (e) {
  55397. var t = e.geometry;
  55398. if (e instanceof n.Mesh) {
  55399. var i = t.__directGeometry;
  55400. if (void 0 === i) return this.fromGeometry(t);
  55401. (i.verticesNeedUpdate = t.verticesNeedUpdate),
  55402. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  55403. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  55404. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  55405. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  55406. (t.verticesNeedUpdate = !1),
  55407. (t.normalsNeedUpdate = !1),
  55408. (t.colorsNeedUpdate = !1),
  55409. (t.uvsNeedUpdate = !1),
  55410. (t.groupsNeedUpdate = !1),
  55411. (t = i);
  55412. }
  55413. if (t.verticesNeedUpdate === !0) {
  55414. var r = this.attributes.position;
  55415. void 0 !== r &&
  55416. (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)),
  55417. (t.verticesNeedUpdate = !1);
  55418. }
  55419. if (t.normalsNeedUpdate === !0) {
  55420. var r = this.attributes.normal;
  55421. void 0 !== r &&
  55422. (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)),
  55423. (t.normalsNeedUpdate = !1);
  55424. }
  55425. if (t.colorsNeedUpdate === !0) {
  55426. var r = this.attributes.color;
  55427. void 0 !== r &&
  55428. (r.copyColorsArray(t.colors), (r.needsUpdate = !0)),
  55429. (t.colorsNeedUpdate = !1);
  55430. }
  55431. if (t.uvsNeedUpdate) {
  55432. var r = this.attributes.uv;
  55433. void 0 !== r &&
  55434. (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)),
  55435. (t.uvsNeedUpdate = !1);
  55436. }
  55437. if (t.lineDistancesNeedUpdate) {
  55438. var r = this.attributes.lineDistance;
  55439. void 0 !== r &&
  55440. (r.copyArray(t.lineDistances), (r.needsUpdate = !0)),
  55441. (t.lineDistancesNeedUpdate = !1);
  55442. }
  55443. return (
  55444. t.groupsNeedUpdate &&
  55445. (t.computeGroups(e.geometry),
  55446. (this.groups = t.groups),
  55447. (t.groupsNeedUpdate = !1)),
  55448. this
  55449. );
  55450. },
  55451. fromGeometry: function (e) {
  55452. return (
  55453. (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)),
  55454. this.fromDirectGeometry(e.__directGeometry)
  55455. );
  55456. },
  55457. fromDirectGeometry: function (e) {
  55458. var t = new Float32Array(3 * e.vertices.length);
  55459. if (
  55460. (this.addAttribute(
  55461. "position",
  55462. new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)
  55463. ),
  55464. e.normals.length > 0)
  55465. ) {
  55466. var i = new Float32Array(3 * e.normals.length);
  55467. this.addAttribute(
  55468. "normal",
  55469. new n.BufferAttribute(i, 3).copyVector3sArray(e.normals)
  55470. );
  55471. }
  55472. if (e.colors.length > 0) {
  55473. var r = new Float32Array(3 * e.colors.length);
  55474. this.addAttribute(
  55475. "color",
  55476. new n.BufferAttribute(r, 3).copyColorsArray(e.colors)
  55477. );
  55478. }
  55479. if (e.uvs.length > 0) {
  55480. var o = new Float32Array(2 * e.uvs.length);
  55481. this.addAttribute(
  55482. "uv",
  55483. new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs)
  55484. );
  55485. }
  55486. if (e.uvs2.length > 0) {
  55487. var a = new Float32Array(2 * e.uvs2.length);
  55488. this.addAttribute(
  55489. "uv2",
  55490. new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2)
  55491. );
  55492. }
  55493. if (e.indices.length > 0) {
  55494. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  55495. l = new s(3 * e.indices.length);
  55496. this.setIndex(
  55497. new n.BufferAttribute(l, 1).copyIndicesArray(e.indices)
  55498. );
  55499. }
  55500. this.groups = e.groups;
  55501. for (var c in e.morphTargets) {
  55502. for (
  55503. var h = [], u = e.morphTargets[c], d = 0, p = u.length;
  55504. d < p;
  55505. d++
  55506. ) {
  55507. var f = u[d],
  55508. g = new n.Float32Attribute(3 * f.length, 3);
  55509. h.push(g.copyVector3sArray(f));
  55510. }
  55511. this.morphAttributes[c] = h;
  55512. }
  55513. if (e.skinIndices.length > 0) {
  55514. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4);
  55515. this.addAttribute(
  55516. "skinIndex",
  55517. m.copyVector4sArray(e.skinIndices)
  55518. );
  55519. }
  55520. if (e.skinWeights.length > 0) {
  55521. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4);
  55522. this.addAttribute(
  55523. "skinWeight",
  55524. v.copyVector4sArray(e.skinWeights)
  55525. );
  55526. }
  55527. return (
  55528. null !== e.boundingSphere &&
  55529. (this.boundingSphere = e.boundingSphere.clone()),
  55530. null !== e.boundingBox &&
  55531. (this.boundingBox = e.boundingBox.clone()),
  55532. this
  55533. );
  55534. },
  55535. computeBoundingBox: (function () {
  55536. new n.Vector3();
  55537. return function () {
  55538. null === this.boundingBox && (this.boundingBox = new n.Box3());
  55539. var e = this.attributes.position.array;
  55540. e && this.boundingBox.setFromArray(e),
  55541. (void 0 !== e && 0 !== e.length) ||
  55542. (this.boundingBox.min.set(0, 0, 0),
  55543. this.boundingBox.max.set(0, 0, 0)),
  55544. (isNaN(this.boundingBox.min.x) ||
  55545. isNaN(this.boundingBox.min.y) ||
  55546. isNaN(this.boundingBox.min.z)) &&
  55547. console.error(
  55548. 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
  55549. this
  55550. );
  55551. };
  55552. })(),
  55553. computeBoundingSphere: (function () {
  55554. var e = new n.Box3(),
  55555. t = new n.Vector3();
  55556. return function () {
  55557. null === this.boundingSphere &&
  55558. (this.boundingSphere = new n.Sphere());
  55559. var i = this.attributes.position.array;
  55560. if (i) {
  55561. var r = this.boundingSphere.center;
  55562. e.setFromArray(i), e.center(r);
  55563. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  55564. t.fromArray(i, a),
  55565. (o = Math.max(o, r.distanceToSquared(t)));
  55566. (this.boundingSphere.radius = Math.sqrt(o)),
  55567. isNaN(this.boundingSphere.radius) &&
  55568. console.error(
  55569. 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
  55570. this
  55571. );
  55572. }
  55573. };
  55574. })(),
  55575. computeFaceNormals: function () {},
  55576. computeVertexNormals: function () {
  55577. var e = this.index,
  55578. t = this.attributes,
  55579. i = this.groups;
  55580. if (t.position) {
  55581. var r = t.position.array;
  55582. if (void 0 === t.normal)
  55583. this.addAttribute(
  55584. "normal",
  55585. new n.BufferAttribute(new Float32Array(r.length), 3)
  55586. );
  55587. else
  55588. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  55589. o[a] = 0;
  55590. var l,
  55591. c,
  55592. h,
  55593. u = t.normal.array,
  55594. d = new n.Vector3(),
  55595. p = new n.Vector3(),
  55596. f = new n.Vector3(),
  55597. g = new n.Vector3(),
  55598. m = new n.Vector3();
  55599. if (e) {
  55600. var v = e.array;
  55601. 0 === i.length && this.addGroup(0, v.length);
  55602. for (var A = 0, y = i.length; A < y; ++A)
  55603. for (
  55604. var C = i[A], I = C.start, E = C.count, a = I, s = I + E;
  55605. a < s;
  55606. a += 3
  55607. )
  55608. (l = 3 * v[a + 0]),
  55609. (c = 3 * v[a + 1]),
  55610. (h = 3 * v[a + 2]),
  55611. d.fromArray(r, l),
  55612. p.fromArray(r, c),
  55613. f.fromArray(r, h),
  55614. g.subVectors(f, p),
  55615. m.subVectors(d, p),
  55616. g.cross(m),
  55617. (u[l] += g.x),
  55618. (u[l + 1] += g.y),
  55619. (u[l + 2] += g.z),
  55620. (u[c] += g.x),
  55621. (u[c + 1] += g.y),
  55622. (u[c + 2] += g.z),
  55623. (u[h] += g.x),
  55624. (u[h + 1] += g.y),
  55625. (u[h + 2] += g.z);
  55626. } else
  55627. for (var a = 0, s = r.length; a < s; a += 9)
  55628. d.fromArray(r, a),
  55629. p.fromArray(r, a + 3),
  55630. f.fromArray(r, a + 6),
  55631. g.subVectors(f, p),
  55632. m.subVectors(d, p),
  55633. g.cross(m),
  55634. (u[a] = g.x),
  55635. (u[a + 1] = g.y),
  55636. (u[a + 2] = g.z),
  55637. (u[a + 3] = g.x),
  55638. (u[a + 4] = g.y),
  55639. (u[a + 5] = g.z),
  55640. (u[a + 6] = g.x),
  55641. (u[a + 7] = g.y),
  55642. (u[a + 8] = g.z);
  55643. this.normalizeNormals(), (t.normal.needsUpdate = !0);
  55644. }
  55645. },
  55646. merge: function (e, t) {
  55647. if (e instanceof n.BufferGeometry == !1)
  55648. return void console.error(
  55649. "THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
  55650. e
  55651. );
  55652. void 0 === t && (t = 0);
  55653. var i = this.attributes;
  55654. for (var r in i)
  55655. if (void 0 !== e.attributes[r])
  55656. for (
  55657. var o = i[r],
  55658. a = o.array,
  55659. s = e.attributes[r],
  55660. l = s.array,
  55661. c = s.itemSize,
  55662. h = 0,
  55663. u = c * t;
  55664. h < l.length;
  55665. h++, u++
  55666. )
  55667. a[u] = l[h];
  55668. return this;
  55669. },
  55670. normalizeNormals: function () {
  55671. for (
  55672. var e,
  55673. t,
  55674. i,
  55675. n,
  55676. r = this.attributes.normal.array,
  55677. o = 0,
  55678. a = r.length;
  55679. o < a;
  55680. o += 3
  55681. )
  55682. (e = r[o]),
  55683. (t = r[o + 1]),
  55684. (i = r[o + 2]),
  55685. (n = 1 / Math.sqrt(e * e + t * t + i * i)),
  55686. (r[o] *= n),
  55687. (r[o + 1] *= n),
  55688. (r[o + 2] *= n);
  55689. },
  55690. toNonIndexed: function () {
  55691. if (null === this.index)
  55692. return (
  55693. console.warn(
  55694. "THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."
  55695. ),
  55696. this
  55697. );
  55698. var e = new n.BufferGeometry(),
  55699. t = this.index.array,
  55700. i = this.attributes;
  55701. for (var r in i) {
  55702. for (
  55703. var o = i[r],
  55704. a = o.array,
  55705. s = o.itemSize,
  55706. l = new a.constructor(t.length * s),
  55707. c = 0,
  55708. h = 0,
  55709. u = 0,
  55710. d = t.length;
  55711. u < d;
  55712. u++
  55713. ) {
  55714. c = t[u] * s;
  55715. for (var p = 0; p < s; p++) l[h++] = a[c++];
  55716. }
  55717. e.addAttribute(r, new n.BufferAttribute(l, s));
  55718. }
  55719. return e;
  55720. },
  55721. toJSON: function () {
  55722. var e = {
  55723. metadata: {
  55724. version: 4.4,
  55725. type: "BufferGeometry",
  55726. generator: "BufferGeometry.toJSON",
  55727. },
  55728. };
  55729. if (
  55730. ((e.uuid = this.uuid),
  55731. (e.type = this.type),
  55732. "" !== this.name && (e.name = this.name),
  55733. void 0 !== this.parameters)
  55734. ) {
  55735. var t = this.parameters;
  55736. for (var i in t) void 0 !== t[i] && (e[i] = t[i]);
  55737. return e;
  55738. }
  55739. e.data = {
  55740. attributes: {},
  55741. };
  55742. var n = this.index;
  55743. if (null !== n) {
  55744. var r = Array.prototype.slice.call(n.array);
  55745. e.data.index = {
  55746. type: n.array.constructor.name,
  55747. array: r,
  55748. };
  55749. }
  55750. var o = this.attributes;
  55751. for (var i in o) {
  55752. var a = o[i],
  55753. r = Array.prototype.slice.call(a.array);
  55754. e.data.attributes[i] = {
  55755. itemSize: a.itemSize,
  55756. type: a.array.constructor.name,
  55757. array: r,
  55758. };
  55759. }
  55760. var s = this.groups;
  55761. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  55762. var l = this.boundingSphere;
  55763. return (
  55764. null !== l &&
  55765. (e.data.boundingSphere = {
  55766. center: l.center.toArray(),
  55767. radius: l.radius,
  55768. }),
  55769. e
  55770. );
  55771. },
  55772. clone: function () {
  55773. return new n.BufferGeometry().copy(this);
  55774. },
  55775. copy: function (e) {
  55776. var t = e.index;
  55777. null !== t && this.setIndex(t.clone());
  55778. var i = e.attributes;
  55779. for (var n in i) {
  55780. var r = i[n];
  55781. this.addAttribute(n, r.clone());
  55782. }
  55783. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  55784. var l = o[a];
  55785. this.addGroup(l.start, l.count);
  55786. }
  55787. return this;
  55788. },
  55789. dispose: function () {
  55790. this.dispatchEvent({
  55791. type: "dispose",
  55792. });
  55793. },
  55794. }),
  55795. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  55796. (n.BufferGeometry.MaxIndex = 65535),
  55797. (n.InstancedBufferGeometry = function () {
  55798. n.BufferGeometry.call(this),
  55799. (this.type = "InstancedBufferGeometry"),
  55800. (this.maxInstancedCount = void 0);
  55801. }),
  55802. (n.InstancedBufferGeometry.prototype = Object.create(
  55803. n.BufferGeometry.prototype
  55804. )),
  55805. (n.InstancedBufferGeometry.prototype.constructor =
  55806. n.InstancedBufferGeometry),
  55807. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  55808. this.groups.push({
  55809. start: e,
  55810. count: t,
  55811. instances: i,
  55812. });
  55813. }),
  55814. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  55815. var t = e.index;
  55816. null !== t && this.setIndex(t.clone());
  55817. var i = e.attributes;
  55818. for (var n in i) {
  55819. var r = i[n];
  55820. this.addAttribute(n, r.clone());
  55821. }
  55822. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  55823. var l = o[a];
  55824. this.addGroup(l.start, l.count, l.instances);
  55825. }
  55826. return this;
  55827. }),
  55828. n.EventDispatcher.prototype.apply(
  55829. n.InstancedBufferGeometry.prototype
  55830. ),
  55831. (n.Uniform = function (e, t) {
  55832. (this.type = e), (this.value = t), (this.dynamic = !1);
  55833. }),
  55834. (n.Uniform.prototype = {
  55835. constructor: n.Uniform,
  55836. onUpdate: function (e) {
  55837. return (this.dynamic = !0), (this.onUpdateCallback = e), this;
  55838. },
  55839. }),
  55840. (n.AnimationClip = function (e, t, i) {
  55841. (this.name = e || n.Math.generateUUID()),
  55842. (this.tracks = i),
  55843. (this.duration = void 0 !== t ? t : -1),
  55844. this.duration < 0 && this.resetDuration(),
  55845. this.trim(),
  55846. this.optimize();
  55847. }),
  55848. (n.AnimationClip.prototype = {
  55849. constructor: n.AnimationClip,
  55850. resetDuration: function () {
  55851. for (
  55852. var e = this.tracks, t = 0, i = 0, n = e.length;
  55853. i !== n;
  55854. ++i
  55855. ) {
  55856. var r = this.tracks[i];
  55857. t = Math.max(t, r.times[r.times.length - 1]);
  55858. }
  55859. this.duration = t;
  55860. },
  55861. trim: function () {
  55862. for (var e = 0; e < this.tracks.length; e++)
  55863. this.tracks[e].trim(0, this.duration);
  55864. return this;
  55865. },
  55866. optimize: function () {
  55867. for (var e = 0; e < this.tracks.length; e++)
  55868. this.tracks[e].optimize();
  55869. return this;
  55870. },
  55871. }),
  55872. Object.assign(n.AnimationClip, {
  55873. parse: function (e) {
  55874. for (
  55875. var t = [],
  55876. i = e.tracks,
  55877. r = 1 / (e.fps || 1),
  55878. o = 0,
  55879. a = i.length;
  55880. o !== a;
  55881. ++o
  55882. )
  55883. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  55884. return new n.AnimationClip(e.name, e.duration, t);
  55885. },
  55886. toJSON: function (e) {
  55887. for (
  55888. var t = [],
  55889. i = e.tracks,
  55890. r = {
  55891. name: e.name,
  55892. duration: e.duration,
  55893. tracks: t,
  55894. },
  55895. o = 0,
  55896. a = i.length;
  55897. o !== a;
  55898. ++o
  55899. )
  55900. t.push(n.KeyframeTrack.toJSON(i[o]));
  55901. return r;
  55902. },
  55903. CreateFromMorphTargetSequence: function (e, t, i) {
  55904. for (var r = t.length, o = [], a = 0; a < r; a++) {
  55905. var s = [],
  55906. l = [];
  55907. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0);
  55908. var c = n.AnimationUtils.getKeyframeOrder(s);
  55909. (s = n.AnimationUtils.sortedArray(s, 1, c)),
  55910. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  55911. 0 === s[0] && (s.push(r), l.push(l[0])),
  55912. o.push(
  55913. new n.NumberKeyframeTrack(
  55914. ".morphTargetInfluences[" + t[a].name + "]",
  55915. s,
  55916. l
  55917. ).scale(1 / i)
  55918. );
  55919. }
  55920. return new n.AnimationClip(e, -1, o);
  55921. },
  55922. findByName: function (e, t) {
  55923. for (var i = 0; i < e.length; i++)
  55924. if (e[i].name === t) return e[i];
  55925. return null;
  55926. },
  55927. CreateClipsFromMorphTargetSequences: function (e, t) {
  55928. for (
  55929. var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length;
  55930. o < a;
  55931. o++
  55932. ) {
  55933. var s = e[o],
  55934. l = s.name.match(r);
  55935. if (l && l.length > 1) {
  55936. var c = l[1],
  55937. h = i[c];
  55938. h || (i[c] = h = []), h.push(s);
  55939. }
  55940. }
  55941. var u = [];
  55942. for (var c in i)
  55943. u.push(
  55944. n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t)
  55945. );
  55946. return u;
  55947. },
  55948. parseAnimation: function (e, t, i) {
  55949. if (!e)
  55950. return console.error(" no animation in JSONLoader data"), null;
  55951. for (
  55952. var r = function (e, t, i, r, o) {
  55953. if (0 !== i.length) {
  55954. var a = [],
  55955. s = [];
  55956. n.AnimationUtils.flattenJSON(i, a, s, r),
  55957. 0 !== a.length && o.push(new e(t, a, s));
  55958. }
  55959. },
  55960. o = [],
  55961. a = e.name || "default",
  55962. s = e.length || -1,
  55963. l = e.fps || 30,
  55964. c = e.hierarchy || [],
  55965. h = 0;
  55966. h < c.length;
  55967. h++
  55968. ) {
  55969. var u = c[h].keys;
  55970. if (u && 0 != u.length)
  55971. if (u[0].morphTargets) {
  55972. for (var d = {}, p = 0; p < u.length; p++)
  55973. if (u[p].morphTargets)
  55974. for (var f = 0; f < u[p].morphTargets.length; f++)
  55975. d[u[p].morphTargets[f]] = -1;
  55976. for (var g in d) {
  55977. for (
  55978. var m = [], v = [], f = 0;
  55979. f !== u[p].morphTargets.length;
  55980. ++f
  55981. ) {
  55982. var A = u[p];
  55983. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0);
  55984. }
  55985. o.push(
  55986. new n.NumberKeyframeTrack(
  55987. ".morphTargetInfluence[" + g + "]",
  55988. m,
  55989. v
  55990. )
  55991. );
  55992. }
  55993. s = d.length * (l || 1);
  55994. } else {
  55995. var y = ".bones[" + t[h].name + "]";
  55996. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  55997. r(
  55998. n.QuaternionKeyframeTrack,
  55999. y + ".quaternion",
  56000. u,
  56001. "rot",
  56002. o
  56003. ),
  56004. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o);
  56005. }
  56006. }
  56007. if (0 === o.length) return null;
  56008. var C = new n.AnimationClip(a, s, o);
  56009. return C;
  56010. },
  56011. }),
  56012. (n.AnimationMixer = function (e) {
  56013. (this._root = e),
  56014. this._initMemoryManager(),
  56015. (this._accuIndex = 0),
  56016. (this.time = 0),
  56017. (this.timeScale = 1);
  56018. }),
  56019. (n.AnimationMixer.prototype = {
  56020. constructor: n.AnimationMixer,
  56021. clipAction: function (e, t) {
  56022. var i,
  56023. r = t || this._root,
  56024. o = r.uuid,
  56025. a = "string" == typeof e ? e : e.name,
  56026. s = e !== a ? e : null,
  56027. l = this._actionsByClip[a];
  56028. if (void 0 !== l) {
  56029. var c = l.actionByRoot[o];
  56030. if (void 0 !== c) return c;
  56031. if (
  56032. ((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s)
  56033. )
  56034. throw new Error(
  56035. "Different clips with the same name detected!"
  56036. );
  56037. }
  56038. if (null === s) return null;
  56039. var h = new n.AnimationMixer._Action(this, s, t);
  56040. return (
  56041. this._bindAction(h, i), this._addInactiveAction(h, a, o), h
  56042. );
  56043. },
  56044. existingAction: function (e, t) {
  56045. var i = t || this._root,
  56046. n = i.uuid,
  56047. r = "string" == typeof e ? e : e.name,
  56048. o = this._actionsByClip[r];
  56049. return void 0 !== o ? o.actionByRoot[n] || null : null;
  56050. },
  56051. stopAllAction: function () {
  56052. var e = this._actions,
  56053. t = this._nActiveActions,
  56054. i = this._bindings,
  56055. n = this._nActiveBindings;
  56056. (this._nActiveActions = 0), (this._nActiveBindings = 0);
  56057. for (var r = 0; r !== t; ++r) e[r].reset();
  56058. for (var r = 0; r !== n; ++r) i[r].useCount = 0;
  56059. return this;
  56060. },
  56061. update: function (e) {
  56062. e *= this.timeScale;
  56063. for (
  56064. var t = this._actions,
  56065. i = this._nActiveActions,
  56066. n = (this.time += e),
  56067. r = Math.sign(e),
  56068. o = (this._accuIndex ^= 1),
  56069. a = 0;
  56070. a !== i;
  56071. ++a
  56072. ) {
  56073. var s = t[a];
  56074. s.enabled && s._update(n, e, r, o);
  56075. }
  56076. for (
  56077. var l = this._bindings, c = this._nActiveBindings, a = 0;
  56078. a !== c;
  56079. ++a
  56080. )
  56081. l[a].apply(o);
  56082. return this;
  56083. },
  56084. getRoot: function () {
  56085. return this._root;
  56086. },
  56087. uncacheClip: function (e) {
  56088. var t = this._actions,
  56089. i = e.name,
  56090. n = this._actionsByClip,
  56091. r = n[i];
  56092. if (void 0 !== r) {
  56093. for (
  56094. var o = r.knownActions, a = 0, s = o.length;
  56095. a !== s;
  56096. ++a
  56097. ) {
  56098. var l = o[a];
  56099. this._deactivateAction(l);
  56100. var c = l._cacheIndex,
  56101. h = t[t.length - 1];
  56102. (l._cacheIndex = null),
  56103. (l._byClipCacheIndex = null),
  56104. (h._cacheIndex = c),
  56105. (t[c] = h),
  56106. t.pop(),
  56107. this._removeInactiveBindingsForAction(l);
  56108. }
  56109. delete n[i];
  56110. }
  56111. },
  56112. uncacheRoot: function (e) {
  56113. var t = e.uuid,
  56114. i = this._actionsByClip;
  56115. for (var n in i) {
  56116. var r = i[n].actionByRoot,
  56117. o = r[t];
  56118. void 0 !== o &&
  56119. (this._deactivateAction(o), this._removeInactiveAction(o));
  56120. }
  56121. var a = this._bindingsByRootAndName,
  56122. s = a[t];
  56123. if (void 0 !== s)
  56124. for (var l in s) {
  56125. var c = s[l];
  56126. c.restoreOriginalState(), this._removeInactiveBinding(c);
  56127. }
  56128. },
  56129. uncacheAction: function (e, t) {
  56130. var i = this.existingAction(e, t);
  56131. null !== i &&
  56132. (this._deactivateAction(i), this._removeInactiveAction(i));
  56133. },
  56134. }),
  56135. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  56136. (n.AnimationMixer._Action = function (e, t, i) {
  56137. (this._mixer = e), (this._clip = t), (this._localRoot = i || null);
  56138. for (
  56139. var r = t.tracks,
  56140. o = r.length,
  56141. a = new Array(o),
  56142. s = {
  56143. endingStart: n.ZeroCurvatureEnding,
  56144. endingEnd: n.ZeroCurvatureEnding,
  56145. },
  56146. l = 0;
  56147. l !== o;
  56148. ++l
  56149. ) {
  56150. var c = r[l].createInterpolant(null);
  56151. (a[l] = c), (c.settings = s);
  56152. }
  56153. (this._interpolantSettings = s),
  56154. (this._interpolants = a),
  56155. (this._propertyBindings = new Array(o)),
  56156. (this._cacheIndex = null),
  56157. (this._byClipCacheIndex = null),
  56158. (this._timeScaleInterpolant = null),
  56159. (this._weightInterpolant = null),
  56160. (this.loop = n.LoopRepeat),
  56161. (this._loopCount = -1),
  56162. (this._startTime = null),
  56163. (this.time = 0),
  56164. (this.timeScale = 1),
  56165. (this._effectiveTimeScale = 1),
  56166. (this.weight = 1),
  56167. (this._effectiveWeight = 1),
  56168. (this.repetitions = 1 / 0),
  56169. (this.paused = !1),
  56170. (this.enabled = !0),
  56171. (this.clampWhenFinished = !1),
  56172. (this.zeroSlopeAtStart = !0),
  56173. (this.zeroSlopeAtEnd = !0);
  56174. }),
  56175. (n.AnimationMixer._Action.prototype = {
  56176. constructor: n.AnimationMixer._Action,
  56177. play: function () {
  56178. return this._mixer._activateAction(this), this;
  56179. },
  56180. stop: function () {
  56181. return this._mixer._deactivateAction(this), this.reset();
  56182. },
  56183. reset: function () {
  56184. return (
  56185. (this.paused = !1),
  56186. (this.enabled = !0),
  56187. (this.time = 0),
  56188. (this._loopCount = -1),
  56189. (this._startTime = null),
  56190. this.stopFading().stopWarping()
  56191. );
  56192. },
  56193. isRunning: function () {
  56194. this._startTime;
  56195. return (
  56196. this.enabled &&
  56197. !this.paused &&
  56198. 0 !== this.timeScale &&
  56199. null === this._startTime &&
  56200. this._mixer._isActiveAction(this)
  56201. );
  56202. },
  56203. isScheduled: function () {
  56204. return this._mixer._isActiveAction(this);
  56205. },
  56206. startAt: function (e) {
  56207. return (this._startTime = e), this;
  56208. },
  56209. setLoop: function (e, t) {
  56210. return (this.loop = e), (this.repetitions = t), this;
  56211. },
  56212. setEffectiveWeight: function (e) {
  56213. return (
  56214. (this.weight = e),
  56215. (this._effectiveWeight = this.enabled ? e : 0),
  56216. this.stopFading()
  56217. );
  56218. },
  56219. getEffectiveWeight: function () {
  56220. return this._effectiveWeight;
  56221. },
  56222. fadeIn: function (e) {
  56223. return this._scheduleFading(e, 0, 1);
  56224. },
  56225. fadeOut: function (e) {
  56226. return this._scheduleFading(e, 1, 0);
  56227. },
  56228. crossFadeFrom: function (e, t, i) {
  56229. this._mixer;
  56230. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  56231. var n = this._clip.duration,
  56232. r = e._clip.duration,
  56233. o = r / n,
  56234. a = n / r;
  56235. e.warp(1, o, t), this.warp(a, 1, t);
  56236. }
  56237. return this;
  56238. },
  56239. crossFadeTo: function (e, t, i) {
  56240. return e.crossFadeFrom(this, t, i);
  56241. },
  56242. stopFading: function () {
  56243. var e = this._weightInterpolant;
  56244. return (
  56245. null !== e &&
  56246. ((this._weightInterpolant = null),
  56247. this._mixer._takeBackControlInterpolant(e)),
  56248. this
  56249. );
  56250. },
  56251. setEffectiveTimeScale: function (e) {
  56252. return (
  56253. (this.timeScale = e),
  56254. (this._effectiveTimeScale = this.paused ? 0 : e),
  56255. this.stopWarping()
  56256. );
  56257. },
  56258. getEffectiveTimeScale: function () {
  56259. return this._effectiveTimeScale;
  56260. },
  56261. setDuration: function (e) {
  56262. return (
  56263. (this.timeScale = this._clip.duration / e), this.stopWarping()
  56264. );
  56265. },
  56266. syncWith: function (e) {
  56267. return (
  56268. (this.time = e.time),
  56269. (this.timeScale = e.timeScale),
  56270. this.stopWarping()
  56271. );
  56272. },
  56273. halt: function (e) {
  56274. return this.warp(this._currentTimeScale, 0, e);
  56275. },
  56276. warp: function (e, t, i) {
  56277. var n = this._mixer,
  56278. r = n.time,
  56279. o = this._timeScaleInterpolant,
  56280. a = this.timeScale;
  56281. null === o &&
  56282. ((o = n._lendControlInterpolant()),
  56283. (this._timeScaleInterpolant = o));
  56284. var s = o.parameterPositions,
  56285. l = o.sampleValues;
  56286. return (
  56287. (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  56288. );
  56289. },
  56290. stopWarping: function () {
  56291. var e = this._timeScaleInterpolant;
  56292. return (
  56293. null !== e &&
  56294. ((this._timeScaleInterpolant = null),
  56295. this._mixer._takeBackControlInterpolant(e)),
  56296. this
  56297. );
  56298. },
  56299. getMixer: function () {
  56300. return this._mixer;
  56301. },
  56302. getClip: function () {
  56303. return this._clip;
  56304. },
  56305. getRoot: function () {
  56306. return this._localRoot || this._mixer._root;
  56307. },
  56308. _update: function (e, t, i, n) {
  56309. var r = this._startTime;
  56310. if (null !== r) {
  56311. var o = (e - r) * i;
  56312. if (o < 0 || 0 === i) return;
  56313. (this._startTime = null), (t = i * o);
  56314. }
  56315. t *= this._updateTimeScale(e);
  56316. var a = this._updateTime(t),
  56317. s = this._updateWeight(e);
  56318. if (s > 0)
  56319. for (
  56320. var l = this._interpolants,
  56321. c = this._propertyBindings,
  56322. h = 0,
  56323. u = l.length;
  56324. h !== u;
  56325. ++h
  56326. )
  56327. l[h].evaluate(a), c[h].accumulate(n, s);
  56328. },
  56329. _updateWeight: function (e) {
  56330. var t = 0;
  56331. if (this.enabled) {
  56332. t = this.weight;
  56333. var i = this._weightInterpolant;
  56334. if (null !== i) {
  56335. var n = i.evaluate(e)[0];
  56336. (t *= n),
  56337. e > i.parameterPositions[1] &&
  56338. (this.stopFading(), 0 === n && (this.enabled = !1));
  56339. }
  56340. }
  56341. return (this._effectiveWeight = t), t;
  56342. },
  56343. _updateTimeScale: function (e) {
  56344. var t = 0;
  56345. if (!this.paused) {
  56346. t = this.timeScale;
  56347. var i = this._timeScaleInterpolant;
  56348. if (null !== i) {
  56349. var n = i.evaluate(e)[0];
  56350. (t *= n),
  56351. e > i.parameterPositions[1] &&
  56352. (this.stopWarping(),
  56353. 0 === t ? (this.pause = !0) : (this.timeScale = t));
  56354. }
  56355. }
  56356. return (this._effectiveTimeScale = t), t;
  56357. },
  56358. _updateTime: function (e) {
  56359. var t = this.time + e;
  56360. if (0 === e) return t;
  56361. var i = this._clip.duration,
  56362. r = this.loop,
  56363. o = this._loopCount,
  56364. a = !1;
  56365. switch (r) {
  56366. case n.LoopOnce:
  56367. if (
  56368. (o === -1 &&
  56369. ((this.loopCount = 0), this._setEndings(!0, !0, !1)),
  56370. t >= i)
  56371. )
  56372. t = i;
  56373. else {
  56374. if (!(t < 0)) break;
  56375. t = 0;
  56376. }
  56377. this.clampWhenFinished
  56378. ? (this.pause = !0)
  56379. : (this.enabled = !1),
  56380. this._mixer.dispatchEvent({
  56381. type: "finished",
  56382. action: this,
  56383. direction: e < 0 ? -1 : 1,
  56384. });
  56385. break;
  56386. case n.LoopPingPong:
  56387. a = !0;
  56388. case n.LoopRepeat:
  56389. if (
  56390. (o === -1 &&
  56391. (e > 0
  56392. ? ((o = 0),
  56393. this._setEndings(!0, 0 === this.repetitions, a))
  56394. : this._setEndings(0 === this.repetitions, !0, a)),
  56395. t >= i || t < 0)
  56396. ) {
  56397. var s = Math.floor(t / i);
  56398. (t -= i * s), (o += Math.abs(s));
  56399. var l = this.repetitions - o;
  56400. if (l < 0) {
  56401. this.clampWhenFinished
  56402. ? (this.paused = !0)
  56403. : (this.enabled = !1),
  56404. (t = e > 0 ? i : 0),
  56405. this._mixer.dispatchEvent({
  56406. type: "finished",
  56407. action: this,
  56408. direction: e > 0 ? 1 : -1,
  56409. });
  56410. break;
  56411. }
  56412. if (0 === l) {
  56413. var c = e < 0;
  56414. this._setEndings(c, !c, a);
  56415. } else this._setEndings(!1, !1, a);
  56416. (this._loopCount = o),
  56417. this._mixer.dispatchEvent({
  56418. type: "loop",
  56419. action: this,
  56420. loopDelta: s,
  56421. });
  56422. }
  56423. if (r === n.LoopPingPong && 1 === (1 & o))
  56424. return (this.time = t), i - t;
  56425. }
  56426. return (this.time = t), t;
  56427. },
  56428. _setEndings: function (e, t, i) {
  56429. var r = this._interpolantSettings;
  56430. i
  56431. ? ((r.endingStart = n.ZeroSlopeEnding),
  56432. (r.endingEnd = n.ZeroSlopeEnding))
  56433. : (e
  56434. ? (r.endingStart = this.zeroSlopeAtStart
  56435. ? n.ZeroSlopeEnding
  56436. : n.ZeroCurvatureEnding)
  56437. : (r.endingStart = n.WrapAroundEnding),
  56438. t
  56439. ? (r.endingEnd = this.zeroSlopeAtEnd
  56440. ? n.ZeroSlopeEnding
  56441. : n.ZeroCurvatureEnding)
  56442. : (r.endingEnd = n.WrapAroundEnding));
  56443. },
  56444. _scheduleFading: function (e, t, i) {
  56445. var n = this._mixer,
  56446. r = n.time,
  56447. o = this._weightInterpolant;
  56448. null === o &&
  56449. ((o = n._lendControlInterpolant()),
  56450. (this._weightInterpolant = o));
  56451. var a = o.parameterPositions,
  56452. s = o.sampleValues;
  56453. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this;
  56454. },
  56455. }),
  56456. Object.assign(n.AnimationMixer.prototype, {
  56457. _bindAction: function (e, t) {
  56458. var i = e._localRoot || this._root,
  56459. r = e._clip.tracks,
  56460. o = r.length,
  56461. a = e._propertyBindings,
  56462. s = e._interpolants,
  56463. l = i.uuid,
  56464. c = this._bindingsByRootAndName,
  56465. h = c[l];
  56466. void 0 === h && ((h = {}), (c[l] = h));
  56467. for (var u = 0; u !== o; ++u) {
  56468. var d = r[u],
  56469. p = d.name,
  56470. f = h[p];
  56471. if (void 0 !== f) a[u] = f;
  56472. else {
  56473. if (((f = a[u]), void 0 !== f)) {
  56474. null === f._cacheIndex &&
  56475. (++f.referenceCount, this._addInactiveBinding(f, l, p));
  56476. continue;
  56477. }
  56478. var g = t && t._propertyBindings[u].binding.parsedPath;
  56479. (f = new n.PropertyMixer(
  56480. n.PropertyBinding.create(i, p, g),
  56481. d.ValueTypeName,
  56482. d.getValueSize()
  56483. )),
  56484. ++f.referenceCount,
  56485. this._addInactiveBinding(f, l, p),
  56486. (a[u] = f);
  56487. }
  56488. s[u].resultBuffer = f.buffer;
  56489. }
  56490. },
  56491. _activateAction: function (e) {
  56492. if (!this._isActiveAction(e)) {
  56493. if (null === e._cacheIndex) {
  56494. var t = (e._localRoot || this._root).uuid,
  56495. i = e._clip.name,
  56496. n = this._actionsByClip[i];
  56497. this._bindAction(e, n && n.knownActions[0]),
  56498. this._addInactiveAction(e, i, t);
  56499. }
  56500. for (
  56501. var r = e._propertyBindings, o = 0, a = r.length;
  56502. o !== a;
  56503. ++o
  56504. ) {
  56505. var s = r[o];
  56506. 0 === s.useCount++ &&
  56507. (this._lendBinding(s), s.saveOriginalState());
  56508. }
  56509. this._lendAction(e);
  56510. }
  56511. },
  56512. _deactivateAction: function (e) {
  56513. if (this._isActiveAction(e)) {
  56514. for (
  56515. var t = e._propertyBindings, i = 0, n = t.length;
  56516. i !== n;
  56517. ++i
  56518. ) {
  56519. var r = t[i];
  56520. 0 === --r.useCount &&
  56521. (r.restoreOriginalState(), this._takeBackBinding(r));
  56522. }
  56523. this._takeBackAction(e);
  56524. }
  56525. },
  56526. _initMemoryManager: function () {
  56527. (this._actions = []),
  56528. (this._nActiveActions = 0),
  56529. (this._actionsByClip = {}),
  56530. (this._bindings = []),
  56531. (this._nActiveBindings = 0),
  56532. (this._bindingsByRootAndName = {}),
  56533. (this._controlInterpolants = []),
  56534. (this._nActiveControlInterpolants = 0);
  56535. var e = this;
  56536. this.stats = {
  56537. actions: {
  56538. get total() {
  56539. return e._actions.length;
  56540. },
  56541. get inUse() {
  56542. return e._nActiveActions;
  56543. },
  56544. },
  56545. bindings: {
  56546. get total() {
  56547. return e._bindings.length;
  56548. },
  56549. get inUse() {
  56550. return e._nActiveBindings;
  56551. },
  56552. },
  56553. controlInterpolants: {
  56554. get total() {
  56555. return e._controlInterpolants.length;
  56556. },
  56557. get inUse() {
  56558. return e._nActiveControlInterpolants;
  56559. },
  56560. },
  56561. };
  56562. },
  56563. _isActiveAction: function (e) {
  56564. var t = e._cacheIndex;
  56565. return null !== t && t < this._nActiveActions;
  56566. },
  56567. _addInactiveAction: function (e, t, i) {
  56568. var n = this._actions,
  56569. r = this._actionsByClip,
  56570. o = r[t];
  56571. if (void 0 === o)
  56572. (o = {
  56573. knownActions: [e],
  56574. actionByRoot: {},
  56575. }),
  56576. (e._byClipCacheIndex = 0),
  56577. (r[t] = o);
  56578. else {
  56579. var a = o.knownActions;
  56580. (e._byClipCacheIndex = a.length), a.push(e);
  56581. }
  56582. (e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e);
  56583. },
  56584. _removeInactiveAction: function (e) {
  56585. var t = this._actions,
  56586. i = t[t.length - 1],
  56587. n = e._cacheIndex;
  56588. (i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null);
  56589. var r = e._clip.name,
  56590. o = this._actionsByClip,
  56591. a = o[r],
  56592. s = a.knownActions,
  56593. l = s[s.length - 1],
  56594. c = e._byClipCacheIndex;
  56595. (l._byClipCacheIndex = c),
  56596. (s[c] = l),
  56597. s.pop(),
  56598. (e._byClipCacheIndex = null);
  56599. var h = a.actionByRoot,
  56600. u = (t._localRoot || this._root).uuid;
  56601. delete h[u],
  56602. 0 === s.length && delete o[r],
  56603. this._removeInactiveBindingsForAction(e);
  56604. },
  56605. _removeInactiveBindingsForAction: function (e) {
  56606. for (
  56607. var t = e._propertyBindings, i = 0, n = t.length;
  56608. i !== n;
  56609. ++i
  56610. ) {
  56611. var r = t[i];
  56612. 0 === --r.referenceCount && this._removeInactiveBinding(r);
  56613. }
  56614. },
  56615. _lendAction: function (e) {
  56616. var t = this._actions,
  56617. i = e._cacheIndex,
  56618. n = this._nActiveActions++,
  56619. r = t[n];
  56620. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56621. },
  56622. _takeBackAction: function (e) {
  56623. var t = this._actions,
  56624. i = e._cacheIndex,
  56625. n = --this._nActiveActions,
  56626. r = t[n];
  56627. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56628. },
  56629. _addInactiveBinding: function (e, t, i) {
  56630. var n = this._bindingsByRootAndName,
  56631. r = n[t],
  56632. o = this._bindings;
  56633. void 0 === r && ((r = {}), (n[t] = r)),
  56634. (r[i] = e),
  56635. (e._cacheIndex = o.length),
  56636. o.push(e);
  56637. },
  56638. _removeInactiveBinding: function (e) {
  56639. var t = this._bindings,
  56640. i = e.binding,
  56641. n = i.rootNode.uuid,
  56642. r = i.path,
  56643. o = this._bindingsByRootAndName,
  56644. a = o[n],
  56645. s = t[t.length - 1],
  56646. l = e._cacheIndex;
  56647. (s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r];
  56648. e: {
  56649. for (var c in a) break e;
  56650. delete o[n];
  56651. }
  56652. },
  56653. _lendBinding: function (e) {
  56654. var t = this._bindings,
  56655. i = e._cacheIndex,
  56656. n = this._nActiveBindings++,
  56657. r = t[n];
  56658. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56659. },
  56660. _takeBackBinding: function (e) {
  56661. var t = this._bindings,
  56662. i = e._cacheIndex,
  56663. n = --this._nActiveBindings,
  56664. r = t[n];
  56665. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  56666. },
  56667. _lendControlInterpolant: function () {
  56668. var e = this._controlInterpolants,
  56669. t = this._nActiveControlInterpolants++,
  56670. i = e[t];
  56671. return (
  56672. void 0 === i &&
  56673. ((i = new n.LinearInterpolant(
  56674. new Float32Array(2),
  56675. new Float32Array(2),
  56676. 1,
  56677. this._controlInterpolantsResultBuffer
  56678. )),
  56679. (i.__cacheIndex = t),
  56680. (e[t] = i)),
  56681. i
  56682. );
  56683. },
  56684. _takeBackControlInterpolant: function (e) {
  56685. var t = this._controlInterpolants,
  56686. i = e.__cacheIndex,
  56687. n = --this._nActiveControlInterpolants,
  56688. r = t[n];
  56689. (e.__cacheIndex = n),
  56690. (t[n] = e),
  56691. (r.__cacheIndex = i),
  56692. (t[i] = r);
  56693. },
  56694. _controlInterpolantsResultBuffer: new Float32Array(1),
  56695. }),
  56696. (n.AnimationObjectGroup = function (e) {
  56697. (this.uuid = n.Math.generateUUID()),
  56698. (this._objects = Array.prototype.slice.call(arguments)),
  56699. (this.nCachedObjects_ = 0);
  56700. var t = {};
  56701. this._indicesByUUID = t;
  56702. for (var i = 0, r = arguments.length; i !== r; ++i)
  56703. t[arguments[i].uuid] = i;
  56704. (this._paths = []),
  56705. (this._parsedPaths = []),
  56706. (this._bindings = []),
  56707. (this._bindingsIndicesByPath = {});
  56708. var o = this;
  56709. this.stats = {
  56710. objects: {
  56711. get total() {
  56712. return o._objects.length;
  56713. },
  56714. get inUse() {
  56715. return this.total - o.nCachedObjects_;
  56716. },
  56717. },
  56718. get bindingsPerObject() {
  56719. return o._bindings.length;
  56720. },
  56721. };
  56722. }),
  56723. (n.AnimationObjectGroup.prototype = {
  56724. constructor: n.AnimationObjectGroup,
  56725. add: function (e) {
  56726. for (
  56727. var t = this._objects,
  56728. i = t.length,
  56729. r = this.nCachedObjects_,
  56730. o = this._indicesByUUID,
  56731. a = this._paths,
  56732. s = this._parsedPaths,
  56733. l = this._bindings,
  56734. c = l.length,
  56735. h = 0,
  56736. u = arguments.length;
  56737. h !== u;
  56738. ++h
  56739. ) {
  56740. var d = arguments[h],
  56741. p = d.uuid,
  56742. f = o[p];
  56743. if (void 0 === f) {
  56744. (f = i++), (o[p] = f), t.push(d);
  56745. for (var g = 0, m = c; g !== m; ++g)
  56746. l[g].push(new n.PropertyBinding(d, a[g], s[g]));
  56747. } else if (f < r) {
  56748. var v = t[f],
  56749. A = --r,
  56750. y = t[A];
  56751. (o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d);
  56752. for (var g = 0, m = c; g !== m; ++g) {
  56753. var C = l[g],
  56754. I = C[A],
  56755. E = C[f];
  56756. (C[f] = I),
  56757. void 0 === E &&
  56758. (E = new n.PropertyBinding(d, a[g], s[g])),
  56759. (C[A] = E);
  56760. }
  56761. } else
  56762. t[f] !== v &&
  56763. console.error(
  56764. "Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes..."
  56765. );
  56766. }
  56767. this.nCachedObjects_ = r;
  56768. },
  56769. remove: function (e) {
  56770. for (
  56771. var t = this._objects,
  56772. i = (t.length, this.nCachedObjects_),
  56773. n = this._indicesByUUID,
  56774. r = this._bindings,
  56775. o = r.length,
  56776. a = 0,
  56777. s = arguments.length;
  56778. a !== s;
  56779. ++a
  56780. ) {
  56781. var l = arguments[a],
  56782. c = l.uuid,
  56783. h = n[c];
  56784. if (void 0 !== h && h >= i) {
  56785. var u = i++,
  56786. d = t[u];
  56787. (n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l);
  56788. for (var p = 0, f = o; p !== f; ++p) {
  56789. var g = r[p],
  56790. m = g[u],
  56791. v = g[h];
  56792. (g[h] = m), (g[u] = v);
  56793. }
  56794. }
  56795. }
  56796. this.nCachedObjects_ = i;
  56797. },
  56798. uncache: function (e) {
  56799. for (
  56800. var t = this._objects,
  56801. i = t.length,
  56802. n = this.nCachedObjects_,
  56803. r = this._indicesByUUID,
  56804. o = this._bindings,
  56805. a = o.length,
  56806. s = 0,
  56807. l = arguments.length;
  56808. s !== l;
  56809. ++s
  56810. ) {
  56811. var c = arguments[s],
  56812. h = c.uuid,
  56813. u = r[h];
  56814. if (void 0 !== u)
  56815. if ((delete r[h], u < n)) {
  56816. var d = --n,
  56817. p = t[d],
  56818. f = --i,
  56819. g = t[f];
  56820. (r[p.uuid] = u),
  56821. (t[u] = p),
  56822. (r[g.uuid] = d),
  56823. (t[d] = g),
  56824. t.pop();
  56825. for (var m = 0, v = a; m !== v; ++m) {
  56826. var A = o[m],
  56827. y = A[d],
  56828. C = A[f];
  56829. (A[u] = y), (A[d] = C), A.pop();
  56830. }
  56831. } else {
  56832. var f = --i,
  56833. g = t[f];
  56834. (r[g.uuid] = u), (t[u] = g), t.pop();
  56835. for (var m = 0, v = a; m !== v; ++m) {
  56836. var A = o[m];
  56837. (A[u] = A[f]), A.pop();
  56838. }
  56839. }
  56840. }
  56841. this.nCachedObjects_ = n;
  56842. },
  56843. subscribe_: function (e, t) {
  56844. var i = this._bindingsIndicesByPath,
  56845. r = i[e],
  56846. o = this._bindings;
  56847. if (void 0 !== r) return o[r];
  56848. var a = this._paths,
  56849. s = this._parsedPaths,
  56850. l = this._objects,
  56851. c = l.length,
  56852. h = this.nCachedObjects_,
  56853. u = new Array(c);
  56854. (r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u);
  56855. for (var d = h, p = l.length; d !== p; ++d) {
  56856. var f = l[d];
  56857. u[d] = new n.PropertyBinding(f, e, t);
  56858. }
  56859. return u;
  56860. },
  56861. unsubscribe_: function (e) {
  56862. var t = this._bindingsIndicesByPath,
  56863. i = t[e];
  56864. if (void 0 !== i) {
  56865. var n = this._paths,
  56866. r = this._parsedPaths,
  56867. o = this._bindings,
  56868. a = o.length - 1,
  56869. s = o[a],
  56870. l = e[a];
  56871. (t[l] = i),
  56872. (o[i] = s),
  56873. o.pop(),
  56874. (r[i] = r[a]),
  56875. r.pop(),
  56876. (n[i] = n[a]),
  56877. n.pop();
  56878. }
  56879. },
  56880. }),
  56881. (n.AnimationUtils = {
  56882. arraySlice: function (e, t, i) {
  56883. return n.AnimationUtils.isTypedArray(e)
  56884. ? new e.constructor(e.subarray(t, i))
  56885. : e.slice(t, i);
  56886. },
  56887. convertArray: function (e, t, i) {
  56888. return !e || (!i && e.constructor === t)
  56889. ? e
  56890. : "number" == typeof t.BYTES_PER_ELEMENT
  56891. ? new t(e)
  56892. : Array.prototype.slice.call(e);
  56893. },
  56894. isTypedArray: function (e) {
  56895. return ArrayBuffer.isView(e) && !(e instanceof DataView);
  56896. },
  56897. getKeyframeOrder: function (e) {
  56898. function t(t, i) {
  56899. return e[t] - e[i];
  56900. }
  56901. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  56902. n[r] = r;
  56903. return n.sort(t), n;
  56904. },
  56905. sortedArray: function (e, t, i) {
  56906. for (
  56907. var n = e.length, r = new e.constructor(n), o = 0, a = 0;
  56908. a !== n;
  56909. ++o
  56910. )
  56911. for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l];
  56912. return r;
  56913. },
  56914. flattenJSON: function (e, t, i, n) {
  56915. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  56916. o = e[r++];
  56917. if (void 0 !== o) {
  56918. var a = o[n];
  56919. if (void 0 !== a)
  56920. if (Array.isArray(a)) {
  56921. do
  56922. (a = o[n]),
  56923. void 0 !== a && (t.push(o.time), i.push.apply(i, a)),
  56924. (o = e[r++]);
  56925. while (void 0 !== o);
  56926. } else if (void 0 !== a.toArray) {
  56927. do
  56928. (a = o[n]),
  56929. void 0 !== a &&
  56930. (t.push(o.time), a.toArray(i, i.length)),
  56931. (o = e[r++]);
  56932. while (void 0 !== o);
  56933. } else
  56934. do
  56935. (a = o[n]),
  56936. void 0 !== a && (t.push(o.time), i.push(a)),
  56937. (o = e[r++]);
  56938. while (void 0 !== o);
  56939. }
  56940. },
  56941. }),
  56942. (n.KeyframeTrack = function (e, t, i, r) {
  56943. if (void 0 === e) throw new Error("track name is undefined");
  56944. if (void 0 === t || 0 === t.length)
  56945. throw new Error("no keyframes in track named " + e);
  56946. (this.name = e),
  56947. (this.times = n.AnimationUtils.convertArray(
  56948. t,
  56949. this.TimeBufferType
  56950. )),
  56951. (this.values = n.AnimationUtils.convertArray(
  56952. i,
  56953. this.ValueBufferType
  56954. )),
  56955. this.setInterpolation(r || this.DefaultInterpolation),
  56956. this.validate(),
  56957. this.optimize();
  56958. }),
  56959. (n.KeyframeTrack.prototype = {
  56960. constructor: n.KeyframeTrack,
  56961. TimeBufferType: Float32Array,
  56962. ValueBufferType: Float32Array,
  56963. DefaultInterpolation: n.InterpolateLinear,
  56964. InterpolantFactoryMethodDiscrete: function (e) {
  56965. return new n.DiscreteInterpolant(
  56966. this.times,
  56967. this.values,
  56968. this.getValueSize(),
  56969. e
  56970. );
  56971. },
  56972. InterpolantFactoryMethodLinear: function (e) {
  56973. return new n.LinearInterpolant(
  56974. this.times,
  56975. this.values,
  56976. this.getValueSize(),
  56977. e
  56978. );
  56979. },
  56980. InterpolantFactoryMethodSmooth: function (e) {
  56981. return new n.CubicInterpolant(
  56982. this.times,
  56983. this.values,
  56984. this.getValueSize(),
  56985. e
  56986. );
  56987. },
  56988. setInterpolation: function (e) {
  56989. var t = void 0;
  56990. switch (e) {
  56991. case n.InterpolateDiscrete:
  56992. t = this.InterpolantFactoryMethodDiscrete;
  56993. break;
  56994. case n.InterpolateLinear:
  56995. t = this.InterpolantFactoryMethodLinear;
  56996. break;
  56997. case n.InterpolateSmooth:
  56998. t = this.InterpolantFactoryMethodSmooth;
  56999. }
  57000. if (void 0 === t) {
  57001. var i =
  57002. "unsupported interpolation for " +
  57003. this.ValueTypeName +
  57004. " keyframe track named " +
  57005. this.name;
  57006. if (void 0 === this.createInterpolant) {
  57007. if (e === this.DefaultInterpolation) throw new Error(i);
  57008. this.setInterpolation(this.DefaultInterpolation);
  57009. }
  57010. return void console.warn(i);
  57011. }
  57012. this.createInterpolant = t;
  57013. },
  57014. getInterpolation: function () {
  57015. switch (this.createInterpolant) {
  57016. case this.InterpolantFactoryMethodDiscrete:
  57017. return n.InterpolateDiscrete;
  57018. case this.InterpolantFactoryMethodLinear:
  57019. return n.InterpolateLinear;
  57020. case this.InterpolantFactoryMethodSmooth:
  57021. return n.InterpolateSmooth;
  57022. }
  57023. },
  57024. getValueSize: function () {
  57025. return this.values.length / this.times.length;
  57026. },
  57027. shift: function (e) {
  57028. if (0 !== e)
  57029. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  57030. t[i] += e;
  57031. return this;
  57032. },
  57033. scale: function (e) {
  57034. if (1 !== e)
  57035. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  57036. t[i] *= e;
  57037. return this;
  57038. },
  57039. trim: function (e, t) {
  57040. for (
  57041. var i = this.times, r = i.length, o = 0, a = r - 1;
  57042. o !== r && i[o] < e;
  57043. )
  57044. ++o;
  57045. for (; a !== -1 && i[a] > t; ) --a;
  57046. if ((++a, 0 !== o || a !== r)) {
  57047. o >= a && ((a = Math.max(a, 1)), (o = a - 1));
  57048. var s = this.getValueSize();
  57049. (this.times = n.AnimationUtils.arraySlice(i, o, a)),
  57050. (this.values = n.AnimationUtils.arraySlice(
  57051. this.values,
  57052. o * s,
  57053. a * s
  57054. ));
  57055. }
  57056. return this;
  57057. },
  57058. validate: function () {
  57059. var e = !0,
  57060. t = this.getValueSize();
  57061. t - Math.floor(t) !== 0 &&
  57062. (console.error("invalid value size in track", this), (e = !1));
  57063. var i = this.times,
  57064. r = this.values,
  57065. o = i.length;
  57066. 0 === o && (console.error("track is empty", this), (e = !1));
  57067. for (var a = null, s = 0; s !== o; s++) {
  57068. var l = i[s];
  57069. if ("number" == typeof l && isNaN(l)) {
  57070. console.error("time is not a valid number", this, s, l),
  57071. (e = !1);
  57072. break;
  57073. }
  57074. if (null !== a && a > l) {
  57075. console.error("out of order keys", this, s, l, a), (e = !1);
  57076. break;
  57077. }
  57078. a = l;
  57079. }
  57080. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  57081. for (var s = 0, c = r.length; s !== c; ++s) {
  57082. var h = r[s];
  57083. if (isNaN(h)) {
  57084. console.error("value is not a valid number", this, s, h),
  57085. (e = !1);
  57086. break;
  57087. }
  57088. }
  57089. return e;
  57090. },
  57091. optimize: function () {
  57092. for (
  57093. var e = this.times,
  57094. t = this.values,
  57095. i = this.getValueSize(),
  57096. r = 1,
  57097. o = 1,
  57098. a = e.length - 1;
  57099. o <= a;
  57100. ++o
  57101. ) {
  57102. var s = !1,
  57103. l = e[o],
  57104. c = e[o + 1];
  57105. if (l !== c && (1 !== o || l !== l[0]))
  57106. for (
  57107. var h = o * i, u = h - i, d = h + i, p = 0;
  57108. p !== i;
  57109. ++p
  57110. ) {
  57111. var f = t[h + p];
  57112. if (f !== t[u + p] || f !== t[d + p]) {
  57113. s = !0;
  57114. break;
  57115. }
  57116. }
  57117. if (s) {
  57118. if (o !== r) {
  57119. e[r] = e[o];
  57120. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  57121. t[m + p] = t[g + p];
  57122. }
  57123. ++r;
  57124. }
  57125. }
  57126. return (
  57127. r !== e.length &&
  57128. ((this.times = n.AnimationUtils.arraySlice(e, 0, r)),
  57129. (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))),
  57130. this
  57131. );
  57132. },
  57133. }),
  57134. Object.assign(n.KeyframeTrack, {
  57135. parse: function (e) {
  57136. if (void 0 === e.type)
  57137. throw new Error("track type undefined, can not parse");
  57138. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  57139. if (void 0 === e.times) {
  57140. console.warn("legacy JSON format detected, converting");
  57141. var i = [],
  57142. r = [];
  57143. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  57144. (e.times = i),
  57145. (e.values = r);
  57146. }
  57147. return void 0 !== t.parse
  57148. ? t.parse(e)
  57149. : new t(e.name, e.times, e.values, e.interpolation);
  57150. },
  57151. toJSON: function (e) {
  57152. var t,
  57153. i = e.constructor;
  57154. if (void 0 !== i.toJSON) t = i.toJSON(e);
  57155. else {
  57156. t = {
  57157. name: e.name,
  57158. times: n.AnimationUtils.convertArray(e.times, Array),
  57159. values: n.AnimationUtils.convertArray(e.values, Array),
  57160. };
  57161. var r = e.getInterpolation();
  57162. r !== e.DefaultInterpolation && (t.interpolation = r);
  57163. }
  57164. return (t.type = e.ValueTypeName), t;
  57165. },
  57166. _getTrackTypeForValueTypeName: function (e) {
  57167. switch (e.toLowerCase()) {
  57168. case "scalar":
  57169. case "double":
  57170. case "float":
  57171. case "number":
  57172. case "integer":
  57173. return n.NumberKeyframeTrack;
  57174. case "vector":
  57175. case "vector2":
  57176. case "vector3":
  57177. case "vector4":
  57178. return n.VectorKeyframeTrack;
  57179. case "color":
  57180. return n.ColorKeyframeTrack;
  57181. case "quaternion":
  57182. return n.QuaternionKeyframeTrack;
  57183. case "bool":
  57184. case "boolean":
  57185. return n.BooleanKeyframeTrack;
  57186. case "string":
  57187. return n.StringKeyframeTrack;
  57188. }
  57189. throw new Error("Unsupported typeName: " + e);
  57190. },
  57191. }),
  57192. (n.PropertyBinding = function (e, t, i) {
  57193. (this.path = t),
  57194. (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)),
  57195. (this.node =
  57196. n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e),
  57197. (this.rootNode = e);
  57198. }),
  57199. (n.PropertyBinding.prototype = {
  57200. constructor: n.PropertyBinding,
  57201. getValue: function (e, t) {
  57202. this.bind(), this.getValue(e, t);
  57203. },
  57204. setValue: function (e, t) {
  57205. this.bind(), this.setValue(e, t);
  57206. },
  57207. bind: function () {
  57208. var e = this.node,
  57209. t = this.parsedPath,
  57210. i = t.objectName,
  57211. r = t.propertyName,
  57212. o = t.propertyIndex;
  57213. if (
  57214. (e ||
  57215. ((e =
  57216. n.PropertyBinding.findNode(this.rootNode, t.nodeName) ||
  57217. this.rootNode),
  57218. (this.node = e)),
  57219. (this.getValue = this._getValue_unavailable),
  57220. (this.setValue = this._setValue_unavailable),
  57221. !e)
  57222. )
  57223. return void console.error(
  57224. " trying to update node for track: " +
  57225. this.path +
  57226. " but it wasn't found."
  57227. );
  57228. if (i) {
  57229. var a = t.objectIndex;
  57230. switch (i) {
  57231. case "materials":
  57232. if (!e.material)
  57233. return void console.error(
  57234. " can not bind to material as node does not have a material",
  57235. this
  57236. );
  57237. if (!e.material.materials)
  57238. return void console.error(
  57239. " can not bind to material.materials as node.material does not have a materials array",
  57240. this
  57241. );
  57242. e = e.material.materials;
  57243. break;
  57244. case "bones":
  57245. if (!e.skeleton)
  57246. return void console.error(
  57247. " can not bind to bones as node does not have a skeleton",
  57248. this
  57249. );
  57250. e = e.skeleton.bones;
  57251. for (var s = 0; s < e.length; s++)
  57252. if (e[s].name === a) {
  57253. a = s;
  57254. break;
  57255. }
  57256. break;
  57257. default:
  57258. if (void 0 === e[i])
  57259. return void console.error(
  57260. " can not bind to objectName of node, undefined",
  57261. this
  57262. );
  57263. e = e[i];
  57264. }
  57265. if (void 0 !== a) {
  57266. if (void 0 === e[a])
  57267. return void console.error(
  57268. " trying to bind to objectIndex of objectName, but is undefined:",
  57269. this,
  57270. e
  57271. );
  57272. e = e[a];
  57273. }
  57274. }
  57275. var l = e[r];
  57276. if (!l) {
  57277. var c = t.nodeName;
  57278. return void console.error(
  57279. " trying to update property for track: " +
  57280. c +
  57281. "." +
  57282. r +
  57283. " but it wasn't found.",
  57284. e
  57285. );
  57286. }
  57287. var h = this.Versioning.None;
  57288. void 0 !== e.needsUpdate
  57289. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  57290. : void 0 !== e.matrixWorldNeedsUpdate &&
  57291. ((h = this.Versioning.MatrixWorldNeedsUpdate),
  57292. (this.targetObject = e));
  57293. var u = this.BindingType.Direct;
  57294. if (void 0 !== o) {
  57295. if ("morphTargetInfluences" === r) {
  57296. if (!e.geometry)
  57297. return void console.error(
  57298. " can not bind to morphTargetInfluences becasuse node does not have a geometry",
  57299. this
  57300. );
  57301. if (!e.geometry.morphTargets)
  57302. return void console.error(
  57303. " can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",
  57304. this
  57305. );
  57306. for (
  57307. var s = 0;
  57308. s < this.node.geometry.morphTargets.length;
  57309. s++
  57310. )
  57311. if (e.geometry.morphTargets[s].name === o) {
  57312. o = s;
  57313. break;
  57314. }
  57315. }
  57316. (u = this.BindingType.ArrayElement),
  57317. (this.resolvedProperty = l),
  57318. (this.propertyIndex = o);
  57319. } else
  57320. void 0 !== l.fromArray && void 0 !== l.toArray
  57321. ? ((u = this.BindingType.HasFromToArray),
  57322. (this.resolvedProperty = l))
  57323. : void 0 !== l.length
  57324. ? ((u = this.BindingType.EntireArray),
  57325. (this.resolvedProperty = l))
  57326. : (this.propertyName = r);
  57327. (this.getValue = this.GetterByBindingType[u]),
  57328. (this.setValue = this.SetterByBindingTypeAndVersioning[u][h]);
  57329. },
  57330. unbind: function () {
  57331. (this.node = null),
  57332. (this.getValue = this._getValue_unbound),
  57333. (this.setValue = this._setValue_unbound);
  57334. },
  57335. }),
  57336. Object.assign(n.PropertyBinding.prototype, {
  57337. _getValue_unavailable: function () {},
  57338. _setValue_unavailable: function () {},
  57339. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  57340. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  57341. BindingType: {
  57342. Direct: 0,
  57343. EntireArray: 1,
  57344. ArrayElement: 2,
  57345. HasFromToArray: 3,
  57346. },
  57347. Versioning: {
  57348. None: 0,
  57349. NeedsUpdate: 1,
  57350. MatrixWorldNeedsUpdate: 2,
  57351. },
  57352. GetterByBindingType: [
  57353. function (e, t) {
  57354. e[t] = this.node[this.propertyName];
  57355. },
  57356. function (e, t) {
  57357. for (
  57358. var i = this.resolvedProperty, n = 0, r = i.length;
  57359. n !== r;
  57360. ++n
  57361. )
  57362. e[t++] = i[n];
  57363. },
  57364. function (e, t) {
  57365. e[t] = this.resolvedProperty[this.propertyIndex];
  57366. },
  57367. function (e, t) {
  57368. this.resolvedProperty.toArray(e, t);
  57369. },
  57370. ],
  57371. SetterByBindingTypeAndVersioning: [
  57372. [
  57373. function (e, t) {
  57374. this.node[this.propertyName] = e[t];
  57375. },
  57376. function (e, t) {
  57377. (this.node[this.propertyName] = e[t]),
  57378. (this.targetObject.needsUpdate = !0);
  57379. },
  57380. function (e, t) {
  57381. (this.node[this.propertyName] = e[t]),
  57382. (this.targetObject.matrixWorldNeedsUpdate = !0);
  57383. },
  57384. ],
  57385. [
  57386. function (e, t) {
  57387. for (
  57388. var i = this.resolvedProperty, n = 0, r = i.length;
  57389. n !== r;
  57390. ++n
  57391. )
  57392. i[n] = e[t++];
  57393. },
  57394. function (e, t) {
  57395. for (
  57396. var i = this.resolvedProperty, n = 0, r = i.length;
  57397. n !== r;
  57398. ++n
  57399. )
  57400. i[n] = e[t++];
  57401. this.targetObject.needsUpdate = !0;
  57402. },
  57403. function (e, t) {
  57404. for (
  57405. var i = this.resolvedProperty, n = 0, r = i.length;
  57406. n !== r;
  57407. ++n
  57408. )
  57409. i[n] = e[t++];
  57410. this.targetObject.matrixWorldNeedsUpdate = !0;
  57411. },
  57412. ],
  57413. [
  57414. function (e, t) {
  57415. this.resolvedProperty[this.propertyIndex] = e[t];
  57416. },
  57417. function (e, t) {
  57418. (this.resolvedProperty[this.propertyIndex] = e[t]),
  57419. (this.targetObject.needsUpdate = !0);
  57420. },
  57421. function (e, t) {
  57422. (this.resolvedProperty[this.propertyIndex] = e[t]),
  57423. (this.targetObject.matrixWorldNeedsUpdate = !0);
  57424. },
  57425. ],
  57426. [
  57427. function (e, t) {
  57428. this.resolvedProperty.fromArray(e, t);
  57429. },
  57430. function (e, t) {
  57431. this.resolvedProperty.fromArray(e, t),
  57432. (this.targetObject.needsUpdate = !0);
  57433. },
  57434. function (e, t) {
  57435. this.resolvedProperty.fromArray(e, t),
  57436. (this.targetObject.matrixWorldNeedsUpdate = !0);
  57437. },
  57438. ],
  57439. ],
  57440. }),
  57441. (n.PropertyBinding.Composite = function (e, t, i) {
  57442. var r = i || n.PropertyBinding.parseTrackName(t);
  57443. (this._targetGroup = e), (this._bindings = e.subscribe_(t, r));
  57444. }),
  57445. (n.PropertyBinding.Composite.prototype = {
  57446. constructor: n.PropertyBinding.Composite,
  57447. getValue: function (e, t) {
  57448. this.bind();
  57449. var i = this._targetGroup.nCachedObjects_,
  57450. n = this._bindings[i];
  57451. void 0 !== n && n.getValue(e, t);
  57452. },
  57453. setValue: function (e, t) {
  57454. for (
  57455. var i = this._bindings,
  57456. n = this._targetGroup.nCachedObjects_,
  57457. r = i.length;
  57458. n !== r;
  57459. ++n
  57460. )
  57461. i[n].setValue(e, t);
  57462. },
  57463. bind: function () {
  57464. for (
  57465. var e = this._bindings,
  57466. t = this._targetGroup.nCachedObjects_,
  57467. i = e.length;
  57468. t !== i;
  57469. ++t
  57470. )
  57471. e[t].bind();
  57472. },
  57473. unbind: function () {
  57474. for (
  57475. var e = this._bindings,
  57476. t = this._targetGroup.nCachedObjects_,
  57477. i = e.length;
  57478. t !== i;
  57479. ++t
  57480. )
  57481. e[t].unbind();
  57482. },
  57483. }),
  57484. (n.PropertyBinding.create = function (e, t, i) {
  57485. return e instanceof n.AnimationObjectGroup
  57486. ? new n.PropertyBinding.Composite(e, t, i)
  57487. : new n.PropertyBinding(e, t, i);
  57488. }),
  57489. (n.PropertyBinding.parseTrackName = function (e) {
  57490. var t =
  57491. /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  57492. i = t.exec(e);
  57493. if (!i) throw new Error("cannot parse trackName at all: " + e);
  57494. i.index === t.lastIndex && t.lastIndex++;
  57495. var n = {
  57496. nodeName: i[3],
  57497. objectName: i[5],
  57498. objectIndex: i[7],
  57499. propertyName: i[9],
  57500. propertyIndex: i[11],
  57501. };
  57502. if (null === n.propertyName || 0 === n.propertyName.length)
  57503. throw new Error(
  57504. "can not parse propertyName from trackName: " + e
  57505. );
  57506. return n;
  57507. }),
  57508. (n.PropertyBinding.findNode = function (e, t) {
  57509. if (
  57510. !t ||
  57511. "" === t ||
  57512. "root" === t ||
  57513. "." === t ||
  57514. t === -1 ||
  57515. t === e.name ||
  57516. t === e.uuid
  57517. )
  57518. return e;
  57519. if (e.skeleton) {
  57520. var i = function (e) {
  57521. for (var i = 0; i < e.bones.length; i++) {
  57522. var n = e.bones[i];
  57523. if (n.name === t) return n;
  57524. }
  57525. return null;
  57526. },
  57527. n = i(e.skeleton);
  57528. if (n) return n;
  57529. }
  57530. if (e.children) {
  57531. var r = function (e) {
  57532. for (var i = 0; i < e.length; i++) {
  57533. var n = e[i];
  57534. if (n.name === t || n.uuid === t) return n;
  57535. var o = r(n.children);
  57536. if (o) return o;
  57537. }
  57538. return null;
  57539. },
  57540. o = r(e.children);
  57541. if (o) return o;
  57542. }
  57543. return null;
  57544. }),
  57545. (n.PropertyMixer = function (e, t, i) {
  57546. (this.binding = e), (this.valueSize = i);
  57547. var n,
  57548. r = Float64Array;
  57549. switch (t) {
  57550. case "quaternion":
  57551. n = this._slerp;
  57552. break;
  57553. case "string":
  57554. case "bool":
  57555. (r = Array), (n = this._select);
  57556. break;
  57557. default:
  57558. n = this._lerp;
  57559. }
  57560. (this.buffer = new r(4 * i)),
  57561. (this._mixBufferRegion = n),
  57562. (this.cumulativeWeight = 0),
  57563. (this.useCount = 0),
  57564. (this.referenceCount = 0);
  57565. }),
  57566. (n.PropertyMixer.prototype = {
  57567. constructor: n.PropertyMixer,
  57568. accumulate: function (e, t) {
  57569. var i = this.buffer,
  57570. n = this.valueSize,
  57571. r = e * n + n,
  57572. o = this.cumulativeWeight;
  57573. if (0 === o) {
  57574. for (var a = 0; a !== n; ++a) i[r + a] = i[a];
  57575. o = t;
  57576. } else {
  57577. o += t;
  57578. var s = t / o;
  57579. this._mixBufferRegion(i, r, 0, s, n);
  57580. }
  57581. this.cumulativeWeight = o;
  57582. },
  57583. apply: function (e) {
  57584. var t = this.valueSize,
  57585. i = this.buffer,
  57586. n = e * t + t,
  57587. r = this.cumulativeWeight,
  57588. o = this.binding;
  57589. if (((this.cumulativeWeight = 0), r < 1)) {
  57590. var a = 3 * t;
  57591. this._mixBufferRegion(i, n, a, 1 - r, t);
  57592. }
  57593. for (var s = t, l = t + t; s !== l; ++s)
  57594. if (i[s] !== i[s + t]) {
  57595. o.setValue(i, n);
  57596. break;
  57597. }
  57598. },
  57599. saveOriginalState: function () {
  57600. var e = this.binding,
  57601. t = this.buffer,
  57602. i = this.valueSize,
  57603. n = 3 * i;
  57604. e.getValue(t, n);
  57605. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)];
  57606. this.cumulativeWeight = 0;
  57607. },
  57608. restoreOriginalState: function () {
  57609. var e = 3 * this.valueSize;
  57610. this.binding.setValue(this.buffer, e);
  57611. },
  57612. _select: function (e, t, i, n, r) {
  57613. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o];
  57614. },
  57615. _slerp: function (e, t, i, r, o) {
  57616. n.Quaternion.slerpFlat(e, t, e, t, e, i, r);
  57617. },
  57618. _lerp: function (e, t, i, n, r) {
  57619. for (var o = 1 - n, a = 0; a !== r; ++a) {
  57620. var s = t + a;
  57621. e[s] = e[s] * o + e[i + a] * n;
  57622. }
  57623. },
  57624. }),
  57625. (n.BooleanKeyframeTrack = function (e, t, i) {
  57626. n.KeyframeTrack.call(this, e, t, i);
  57627. }),
  57628. (n.BooleanKeyframeTrack.prototype = Object.assign(
  57629. Object.create(n.KeyframeTrack.prototype),
  57630. {
  57631. constructor: n.BooleanKeyframeTrack,
  57632. ValueTypeName: "bool",
  57633. ValueBufferType: Array,
  57634. DefaultInterpolation: n.IntepolateDiscrete,
  57635. InterpolantFactoryMethodLinear: void 0,
  57636. InterpolantFactoryMethodSmooth: void 0,
  57637. }
  57638. )),
  57639. (n.NumberKeyframeTrack = function (e, t, i, r) {
  57640. n.KeyframeTrack.call(this, e, t, i, r);
  57641. }),
  57642. (n.NumberKeyframeTrack.prototype = Object.assign(
  57643. Object.create(n.KeyframeTrack.prototype),
  57644. {
  57645. constructor: n.NumberKeyframeTrack,
  57646. ValueTypeName: "number",
  57647. }
  57648. )),
  57649. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  57650. n.KeyframeTrack.call(this, e, t, i, r);
  57651. }),
  57652. (n.QuaternionKeyframeTrack.prototype = Object.assign(
  57653. Object.create(n.KeyframeTrack.prototype),
  57654. {
  57655. constructor: n.QuaternionKeyframeTrack,
  57656. ValueTypeName: "quaternion",
  57657. DefaultInterpolation: n.InterpolateLinear,
  57658. InterpolantFactoryMethodLinear: function (e) {
  57659. return new n.QuaternionLinearInterpolant(
  57660. this.times,
  57661. this.values,
  57662. this.getValueSize(),
  57663. e
  57664. );
  57665. },
  57666. InterpolantFactoryMethodSmooth: void 0,
  57667. }
  57668. )),
  57669. (n.StringKeyframeTrack = function (e, t, i, r) {
  57670. n.KeyframeTrack.call(this, e, t, i, r);
  57671. }),
  57672. (n.StringKeyframeTrack.prototype = Object.assign(
  57673. Object.create(n.KeyframeTrack.prototype),
  57674. {
  57675. constructor: n.StringKeyframeTrack,
  57676. ValueTypeName: "string",
  57677. ValueBufferType: Array,
  57678. DefaultInterpolation: n.IntepolateDiscrete,
  57679. InterpolantFactoryMethodLinear: void 0,
  57680. InterpolantFactoryMethodSmooth: void 0,
  57681. }
  57682. )),
  57683. (n.VectorKeyframeTrack = function (e, t, i, r) {
  57684. n.KeyframeTrack.call(this, e, t, i, r);
  57685. }),
  57686. (n.VectorKeyframeTrack.prototype = Object.assign(
  57687. Object.create(n.KeyframeTrack.prototype),
  57688. {
  57689. constructor: n.VectorKeyframeTrack,
  57690. ValueTypeName: "vector",
  57691. }
  57692. )),
  57693. (n.Audio = function (e) {
  57694. n.Object3D.call(this),
  57695. (this.type = "Audio"),
  57696. (this.context = e.context),
  57697. (this.source = this.context.createBufferSource()),
  57698. (this.source.onended = this.onEnded.bind(this)),
  57699. (this.gain = this.context.createGain()),
  57700. this.gain.connect(e.getInput()),
  57701. (this.autoplay = !1),
  57702. (this.startTime = 0),
  57703. (this.playbackRate = 1),
  57704. (this.isPlaying = !1),
  57705. (this.hasPlaybackControl = !0),
  57706. (this.sourceType = "empty"),
  57707. (this.filter = null);
  57708. }),
  57709. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  57710. (n.Audio.prototype.constructor = n.Audio),
  57711. (n.Audio.prototype.getOutput = function () {
  57712. return this.gain;
  57713. }),
  57714. (n.Audio.prototype.load = function (e) {
  57715. var t = new n.AudioBuffer(this.context);
  57716. return t.load(e), this.setBuffer(t), this;
  57717. }),
  57718. (n.Audio.prototype.setNodeSource = function (e) {
  57719. return (
  57720. (this.hasPlaybackControl = !1),
  57721. (this.sourceType = "audioNode"),
  57722. (this.source = e),
  57723. this.connect(),
  57724. this
  57725. );
  57726. }),
  57727. (n.Audio.prototype.setBuffer = function (e) {
  57728. var t = this;
  57729. return (
  57730. e.onReady(function (e) {
  57731. (t.source.buffer = e),
  57732. (t.sourceType = "buffer"),
  57733. t.autoplay && t.play();
  57734. }),
  57735. this
  57736. );
  57737. }),
  57738. (n.Audio.prototype.play = function () {
  57739. if (this.isPlaying === !0)
  57740. return void console.warn(
  57741. "THREE.Audio: Audio is already playing."
  57742. );
  57743. if (this.hasPlaybackControl === !1)
  57744. return void console.warn(
  57745. "THREE.Audio: this Audio has no playback control."
  57746. );
  57747. var e = this.context.createBufferSource();
  57748. (e.buffer = this.source.buffer),
  57749. (e.loop = this.source.loop),
  57750. (e.onended = this.source.onended),
  57751. e.start(0, this.startTime),
  57752. (e.playbackRate.value = this.playbackRate),
  57753. (this.isPlaying = !0),
  57754. (this.source = e),
  57755. this.connect();
  57756. }),
  57757. (n.Audio.prototype.pause = function () {
  57758. return this.hasPlaybackControl === !1
  57759. ? void console.warn(
  57760. "THREE.Audio: this Audio has no playback control."
  57761. )
  57762. : (this.source.stop(),
  57763. void (this.startTime = this.context.currentTime));
  57764. }),
  57765. (n.Audio.prototype.stop = function () {
  57766. return this.hasPlaybackControl === !1
  57767. ? void console.warn(
  57768. "THREE.Audio: this Audio has no playback control."
  57769. )
  57770. : (this.source.stop(), void (this.startTime = 0));
  57771. }),
  57772. (n.Audio.prototype.connect = function () {
  57773. null !== this.filter
  57774. ? (this.source.connect(this.filter),
  57775. this.filter.connect(this.getOutput()))
  57776. : this.source.connect(this.getOutput());
  57777. }),
  57778. (n.Audio.prototype.disconnect = function () {
  57779. null !== this.filter
  57780. ? (this.source.disconnect(this.filter),
  57781. this.filter.disconnect(this.getOutput()))
  57782. : this.source.disconnect(this.getOutput());
  57783. }),
  57784. (n.Audio.prototype.getFilter = function () {
  57785. return this.filter;
  57786. }),
  57787. (n.Audio.prototype.setFilter = function (e) {
  57788. void 0 === e && (e = null),
  57789. this.isPlaying === !0
  57790. ? (this.disconnect(), (this.filter = e), this.connect())
  57791. : (this.filter = e);
  57792. }),
  57793. (n.Audio.prototype.setPlaybackRate = function (e) {
  57794. return this.hasPlaybackControl === !1
  57795. ? void console.warn(
  57796. "THREE.Audio: this Audio has no playback control."
  57797. )
  57798. : ((this.playbackRate = e),
  57799. void (
  57800. this.isPlaying === !0 &&
  57801. (this.source.playbackRate.value = this.playbackRate)
  57802. ));
  57803. }),
  57804. (n.Audio.prototype.getPlaybackRate = function () {
  57805. return this.playbackRate;
  57806. }),
  57807. (n.Audio.prototype.onEnded = function () {
  57808. this.isPlaying = !1;
  57809. }),
  57810. (n.Audio.prototype.setLoop = function (e) {
  57811. return this.hasPlaybackControl === !1
  57812. ? void console.warn(
  57813. "THREE.Audio: this Audio has no playback control."
  57814. )
  57815. : void (this.source.loop = e);
  57816. }),
  57817. (n.Audio.prototype.getLoop = function () {
  57818. return this.hasPlaybackControl === !1
  57819. ? (console.warn(
  57820. "THREE.Audio: this Audio has no playback control."
  57821. ),
  57822. !1)
  57823. : this.source.loop;
  57824. }),
  57825. (n.Audio.prototype.setVolume = function (e) {
  57826. this.gain.gain.value = e;
  57827. }),
  57828. (n.Audio.prototype.getVolume = function () {
  57829. return this.gain.gain.value;
  57830. }),
  57831. (n.AudioAnalyser = function (e, t) {
  57832. (this.analyser = e.context.createAnalyser()),
  57833. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  57834. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  57835. e.getOutput().connect(this.analyser);
  57836. }),
  57837. (n.AudioAnalyser.prototype = {
  57838. constructor: n.AudioAnalyser,
  57839. getData: function () {
  57840. return this.analyser.getByteFrequencyData(this.data), this.data;
  57841. },
  57842. }),
  57843. (n.AudioBuffer = function (e) {
  57844. (this.context = e), (this.ready = !1), (this.readyCallbacks = []);
  57845. }),
  57846. (n.AudioBuffer.prototype.load = function (e) {
  57847. var t = this,
  57848. i = new XMLHttpRequest();
  57849. return (
  57850. i.open("GET", e, !0),
  57851. (i.responseType = "arraybuffer"),
  57852. (i.onload = function (e) {
  57853. t.context.decodeAudioData(this.response, function (e) {
  57854. (t.buffer = e), (t.ready = !0);
  57855. for (var i = 0; i < t.readyCallbacks.length; i++)
  57856. t.readyCallbacks[i](t.buffer);
  57857. t.readyCallbacks = [];
  57858. });
  57859. }),
  57860. i.send(),
  57861. this
  57862. );
  57863. }),
  57864. (n.AudioBuffer.prototype.onReady = function (e) {
  57865. this.ready ? e(this.buffer) : this.readyCallbacks.push(e);
  57866. }),
  57867. (n.PositionalAudio = function (e) {
  57868. n.Audio.call(this, e),
  57869. (this.panner = this.context.createPanner()),
  57870. this.panner.connect(this.gain);
  57871. }),
  57872. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  57873. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  57874. (n.PositionalAudio.prototype.getOutput = function () {
  57875. return this.panner;
  57876. }),
  57877. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  57878. this.panner.refDistance = e;
  57879. }),
  57880. (n.PositionalAudio.prototype.getRefDistance = function () {
  57881. return this.panner.refDistance;
  57882. }),
  57883. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  57884. this.panner.rolloffFactor = e;
  57885. }),
  57886. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  57887. return this.panner.rolloffFactor;
  57888. }),
  57889. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  57890. this.panner.distanceModel = e;
  57891. }),
  57892. (n.PositionalAudio.prototype.getDistanceModel = function () {
  57893. return this.panner.distanceModel;
  57894. }),
  57895. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  57896. this.panner.maxDistance = e;
  57897. }),
  57898. (n.PositionalAudio.prototype.getMaxDistance = function () {
  57899. return this.panner.maxDistance;
  57900. }),
  57901. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  57902. var e = new n.Vector3();
  57903. return function (t) {
  57904. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  57905. e.setFromMatrixPosition(this.matrixWorld),
  57906. this.panner.setPosition(e.x, e.y, e.z);
  57907. };
  57908. })()),
  57909. (n.AudioListener = function () {
  57910. n.Object3D.call(this),
  57911. (this.type = "AudioListener"),
  57912. (this.context = new (window.AudioContext ||
  57913. window.webkitAudioContext)()),
  57914. (this.gain = this.context.createGain()),
  57915. this.gain.connect(this.context.destination),
  57916. (this.filter = null);
  57917. }),
  57918. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  57919. (n.AudioListener.prototype.constructor = n.AudioListener),
  57920. (n.AudioListener.prototype.getInput = function () {
  57921. return this.gain;
  57922. }),
  57923. (n.AudioListener.prototype.removeFilter = function () {
  57924. null !== this.filter &&
  57925. (this.gain.disconnect(this.filter),
  57926. this.filter.disconnect(this.context.destination),
  57927. this.gain.connect(this.context.destination),
  57928. (this.filter = null));
  57929. }),
  57930. (n.AudioListener.prototype.setFilter = function (e) {
  57931. null !== this.filter
  57932. ? (this.gain.disconnect(this.filter),
  57933. this.filter.disconnect(this.context.destination))
  57934. : this.gain.disconnect(this.context.destination),
  57935. (this.filter = e),
  57936. this.gain.connect(this.filter),
  57937. this.filter.connect(this.context.destination);
  57938. }),
  57939. (n.AudioListener.prototype.getFilter = function () {
  57940. return this.filter;
  57941. }),
  57942. (n.AudioListener.prototype.setMasterVolume = function (e) {
  57943. this.gain.gain.value = e;
  57944. }),
  57945. (n.AudioListener.prototype.getMasterVolume = function () {
  57946. return this.gain.gain.value;
  57947. }),
  57948. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  57949. var e = new n.Vector3(),
  57950. t = new n.Quaternion(),
  57951. i = new n.Vector3(),
  57952. r = new n.Vector3();
  57953. return function (o) {
  57954. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  57955. var a = this.context.listener,
  57956. s = this.up;
  57957. this.matrixWorld.decompose(e, t, i),
  57958. r.set(0, 0, -1).applyQuaternion(t),
  57959. a.setPosition(e.x, e.y, e.z),
  57960. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z);
  57961. };
  57962. })()),
  57963. (n.Camera = function () {
  57964. n.Object3D.call(this),
  57965. (this.type = "Camera"),
  57966. (this.matrixWorldInverse = new n.Matrix4()),
  57967. (this.projectionMatrix = new n.Matrix4());
  57968. }),
  57969. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  57970. (n.Camera.prototype.constructor = n.Camera),
  57971. (n.Camera.prototype.getWorldDirection = (function () {
  57972. var e = new n.Quaternion();
  57973. return function (t) {
  57974. var i = t || new n.Vector3();
  57975. return (
  57976. this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e)
  57977. );
  57978. };
  57979. })()),
  57980. (n.Camera.prototype.lookAt = (function () {
  57981. var e = new n.Matrix4();
  57982. return function (t) {
  57983. e.lookAt(this.position, t, this.up),
  57984. this.quaternion.setFromRotationMatrix(e);
  57985. };
  57986. })()),
  57987. (n.Camera.prototype.clone = function () {
  57988. return new this.constructor().copy(this);
  57989. }),
  57990. (n.Camera.prototype.copy = function (e) {
  57991. return (
  57992. n.Object3D.prototype.copy.call(this, e),
  57993. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  57994. this.projectionMatrix.copy(e.projectionMatrix),
  57995. this
  57996. );
  57997. }),
  57998. (n.CubeCamera = function (e, t, i) {
  57999. n.Object3D.call(this), (this.type = "CubeCamera");
  58000. var r = 90,
  58001. o = 1,
  58002. a = new n.PerspectiveCamera(r, o, e, t);
  58003. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a);
  58004. var s = new n.PerspectiveCamera(r, o, e, t);
  58005. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s);
  58006. var l = new n.PerspectiveCamera(r, o, e, t);
  58007. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l);
  58008. var c = new n.PerspectiveCamera(r, o, e, t);
  58009. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c);
  58010. var h = new n.PerspectiveCamera(r, o, e, t);
  58011. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h);
  58012. var u = new n.PerspectiveCamera(r, o, e, t);
  58013. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u);
  58014. var d = {
  58015. format: n.RGBFormat,
  58016. magFilter: n.LinearFilter,
  58017. minFilter: n.LinearFilter,
  58018. };
  58019. (this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  58020. (this.updateCubeMap = function (e, t) {
  58021. null === this.parent && this.updateMatrixWorld();
  58022. var i = this.renderTarget,
  58023. n = i.texture.generateMipmaps;
  58024. (i.texture.generateMipmaps = !1),
  58025. (i.activeCubeFace = 0),
  58026. e.render(t, a, i),
  58027. (i.activeCubeFace = 1),
  58028. e.render(t, s, i),
  58029. (i.activeCubeFace = 2),
  58030. e.render(t, l, i),
  58031. (i.activeCubeFace = 3),
  58032. e.render(t, c, i),
  58033. (i.activeCubeFace = 4),
  58034. e.render(t, h, i),
  58035. (i.texture.generateMipmaps = n),
  58036. (i.activeCubeFace = 5),
  58037. e.render(t, u, i),
  58038. e.setRenderTarget(null);
  58039. });
  58040. }),
  58041. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  58042. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  58043. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  58044. n.Camera.call(this),
  58045. (this.type = "OrthographicCamera"),
  58046. (this.zoom = 1),
  58047. (this.left = e),
  58048. (this.right = t),
  58049. (this.top = i),
  58050. (this.bottom = r),
  58051. (this.near = void 0 !== o ? o : 0.1),
  58052. (this.far = void 0 !== a ? a : 2e3),
  58053. this.updateProjectionMatrix();
  58054. }),
  58055. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  58056. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  58057. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  58058. var e = (this.right - this.left) / (2 * this.zoom),
  58059. t = (this.top - this.bottom) / (2 * this.zoom),
  58060. i = (this.right + this.left) / 2,
  58061. n = (this.top + this.bottom) / 2;
  58062. this.projectionMatrix.makeOrthographic(
  58063. i - e,
  58064. i + e,
  58065. n + t,
  58066. n - t,
  58067. this.near,
  58068. this.far
  58069. );
  58070. }),
  58071. (n.OrthographicCamera.prototype.copy = function (e) {
  58072. return (
  58073. n.Camera.prototype.copy.call(this, e),
  58074. (this.left = e.left),
  58075. (this.right = e.right),
  58076. (this.top = e.top),
  58077. (this.bottom = e.bottom),
  58078. (this.near = e.near),
  58079. (this.far = e.far),
  58080. (this.zoom = e.zoom),
  58081. this
  58082. );
  58083. }),
  58084. (n.OrthographicCamera.prototype.toJSON = function (e) {
  58085. var t = n.Object3D.prototype.toJSON.call(this, e);
  58086. return (
  58087. (t.object.zoom = this.zoom),
  58088. (t.object.left = this.left),
  58089. (t.object.right = this.right),
  58090. (t.object.top = this.top),
  58091. (t.object.bottom = this.bottom),
  58092. (t.object.near = this.near),
  58093. (t.object.far = this.far),
  58094. t
  58095. );
  58096. }),
  58097. (n.PerspectiveCamera = function (e, t, i, r) {
  58098. n.Camera.call(this),
  58099. (this.type = "PerspectiveCamera"),
  58100. (this.focalLength = 10),
  58101. (this.zoom = 1),
  58102. (this.fov = void 0 !== e ? e : 50),
  58103. (this.aspect = void 0 !== t ? t : 1),
  58104. (this.near = void 0 !== i ? i : 0.1),
  58105. (this.far = void 0 !== r ? r : 2e3),
  58106. this.updateProjectionMatrix();
  58107. }),
  58108. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  58109. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  58110. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  58111. void 0 === t && (t = 24),
  58112. (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))),
  58113. this.updateProjectionMatrix();
  58114. }),
  58115. (n.PerspectiveCamera.prototype.setViewOffset = function (
  58116. e,
  58117. t,
  58118. i,
  58119. n,
  58120. r,
  58121. o
  58122. ) {
  58123. (this.fullWidth = e),
  58124. (this.fullHeight = t),
  58125. (this.x = i),
  58126. (this.y = n),
  58127. (this.width = r),
  58128. (this.height = o),
  58129. this.updateProjectionMatrix();
  58130. }),
  58131. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  58132. var e = n.Math.radToDeg(
  58133. 2 *
  58134. Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom)
  58135. );
  58136. if (this.fullWidth) {
  58137. var t = this.fullWidth / this.fullHeight,
  58138. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  58139. r = -i,
  58140. o = t * r,
  58141. a = t * i,
  58142. s = Math.abs(a - o),
  58143. l = Math.abs(i - r);
  58144. this.projectionMatrix.makeFrustum(
  58145. o + (this.x * s) / this.fullWidth,
  58146. o + ((this.x + this.width) * s) / this.fullWidth,
  58147. i - ((this.y + this.height) * l) / this.fullHeight,
  58148. i - (this.y * l) / this.fullHeight,
  58149. this.near,
  58150. this.far
  58151. );
  58152. } else
  58153. this.projectionMatrix.makePerspective(
  58154. e,
  58155. this.aspect,
  58156. this.near,
  58157. this.far
  58158. );
  58159. }),
  58160. (n.PerspectiveCamera.prototype.copy = function (e) {
  58161. return (
  58162. n.Camera.prototype.copy.call(this, e),
  58163. (this.focalLength = e.focalLength),
  58164. (this.zoom = e.zoom),
  58165. (this.fov = e.fov),
  58166. (this.aspect = e.aspect),
  58167. (this.near = e.near),
  58168. (this.far = e.far),
  58169. this
  58170. );
  58171. }),
  58172. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  58173. var t = n.Object3D.prototype.toJSON.call(this, e);
  58174. return (
  58175. (t.object.focalLength = this.focalLength),
  58176. (t.object.zoom = this.zoom),
  58177. (t.object.fov = this.fov),
  58178. (t.object.aspect = this.aspect),
  58179. (t.object.near = this.near),
  58180. (t.object.far = this.far),
  58181. t
  58182. );
  58183. }),
  58184. (n.StereoCamera = function () {
  58185. (this.type = "StereoCamera"),
  58186. (this.aspect = 1),
  58187. (this.cameraL = new n.PerspectiveCamera()),
  58188. this.cameraL.layers.enable(1),
  58189. (this.cameraL.matrixAutoUpdate = !1),
  58190. (this.cameraR = new n.PerspectiveCamera()),
  58191. this.cameraR.layers.enable(2),
  58192. (this.cameraR.matrixAutoUpdate = !1);
  58193. }),
  58194. (n.StereoCamera.prototype = {
  58195. constructor: n.StereoCamera,
  58196. update: (function () {
  58197. var e,
  58198. t,
  58199. i,
  58200. r,
  58201. o,
  58202. a = new n.Matrix4(),
  58203. s = new n.Matrix4();
  58204. return function (l) {
  58205. var c =
  58206. e !== l.focalLength ||
  58207. t !== l.fov ||
  58208. i !== l.aspect * this.aspect ||
  58209. r !== l.near ||
  58210. o !== l.far;
  58211. if (c) {
  58212. (e = l.focalLength),
  58213. (t = l.fov),
  58214. (i = l.aspect * this.aspect),
  58215. (r = l.near),
  58216. (o = l.far);
  58217. var h,
  58218. u,
  58219. d = l.projectionMatrix.clone(),
  58220. p = 0.032,
  58221. f = (p * r) / e,
  58222. g = r * Math.tan(n.Math.degToRad(0.5 * t));
  58223. (s.elements[12] = -p),
  58224. (a.elements[12] = p),
  58225. (h = -g * i + f),
  58226. (u = g * i + f),
  58227. (d.elements[0] = (2 * r) / (u - h)),
  58228. (d.elements[8] = (u + h) / (u - h)),
  58229. this.cameraL.projectionMatrix.copy(d),
  58230. (h = -g * i - f),
  58231. (u = g * i - f),
  58232. (d.elements[0] = (2 * r) / (u - h)),
  58233. (d.elements[8] = (u + h) / (u - h)),
  58234. this.cameraR.projectionMatrix.copy(d);
  58235. }
  58236. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  58237. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a);
  58238. };
  58239. })(),
  58240. }),
  58241. (n.Light = function (e, t) {
  58242. n.Object3D.call(this),
  58243. (this.type = "Light"),
  58244. (this.color = new n.Color(e)),
  58245. (this.intensity = void 0 !== t ? t : 1),
  58246. (this.receiveShadow = void 0);
  58247. }),
  58248. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  58249. (n.Light.prototype.constructor = n.Light),
  58250. (n.Light.prototype.copy = function (e) {
  58251. return (
  58252. n.Object3D.prototype.copy.call(this, e),
  58253. this.color.copy(e.color),
  58254. (this.intensity = e.intensity),
  58255. this
  58256. );
  58257. }),
  58258. (n.Light.prototype.toJSON = function (e) {
  58259. var t = n.Object3D.prototype.toJSON.call(this, e);
  58260. return (
  58261. (t.object.color = this.color.getHex()),
  58262. (t.object.intensity = this.intensity),
  58263. void 0 !== this.groundColor &&
  58264. (t.object.groundColor = this.groundColor.getHex()),
  58265. void 0 !== this.distance && (t.object.distance = this.distance),
  58266. void 0 !== this.angle && (t.object.angle = this.angle),
  58267. void 0 !== this.decay && (t.object.decay = this.decay),
  58268. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  58269. t
  58270. );
  58271. }),
  58272. (n.LightShadow = function (e) {
  58273. (this.camera = e),
  58274. (this.bias = 0),
  58275. (this.radius = 1),
  58276. (this.mapSize = new n.Vector2(512, 512)),
  58277. (this.map = null),
  58278. (this.matrix = new n.Matrix4());
  58279. }),
  58280. (n.LightShadow.prototype = {
  58281. constructor: n.LightShadow,
  58282. copy: function (e) {
  58283. return (
  58284. (this.camera = e.camera.clone()),
  58285. (this.bias = e.bias),
  58286. (this.radius = e.radius),
  58287. this.mapSize.copy(e.mapSize),
  58288. this
  58289. );
  58290. },
  58291. clone: function () {
  58292. return new this.constructor().copy(this);
  58293. },
  58294. }),
  58295. (n.AmbientLight = function (e, t) {
  58296. n.Light.call(this, e, t),
  58297. (this.type = "AmbientLight"),
  58298. (this.castShadow = void 0);
  58299. }),
  58300. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  58301. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  58302. (n.DirectionalLight = function (e, t) {
  58303. n.Light.call(this, e, t),
  58304. (this.type = "DirectionalLight"),
  58305. this.position.set(0, 1, 0),
  58306. this.updateMatrix(),
  58307. (this.target = new n.Object3D()),
  58308. (this.shadow = new n.LightShadow(
  58309. new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)
  58310. ));
  58311. }),
  58312. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  58313. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  58314. (n.DirectionalLight.prototype.copy = function (e) {
  58315. return (
  58316. n.Light.prototype.copy.call(this, e),
  58317. (this.target = e.target.clone()),
  58318. (this.shadow = e.shadow.clone()),
  58319. this
  58320. );
  58321. }),
  58322. (n.HemisphereLight = function (e, t, i) {
  58323. n.Light.call(this, e, i),
  58324. (this.type = "HemisphereLight"),
  58325. (this.castShadow = void 0),
  58326. this.position.set(0, 1, 0),
  58327. this.updateMatrix(),
  58328. (this.groundColor = new n.Color(t));
  58329. }),
  58330. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  58331. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  58332. (n.HemisphereLight.prototype.copy = function (e) {
  58333. return (
  58334. n.Light.prototype.copy.call(this, e),
  58335. this.groundColor.copy(e.groundColor),
  58336. this
  58337. );
  58338. }),
  58339. (n.PointLight = function (e, t, i, r) {
  58340. n.Light.call(this, e, t),
  58341. (this.type = "PointLight"),
  58342. (this.distance = void 0 !== i ? i : 0),
  58343. (this.decay = void 0 !== r ? r : 1),
  58344. (this.shadow = new n.LightShadow(
  58345. new n.PerspectiveCamera(90, 1, 0.5, 500)
  58346. ));
  58347. }),
  58348. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  58349. (n.PointLight.prototype.constructor = n.PointLight),
  58350. Object.defineProperty(n.PointLight.prototype, "power", {
  58351. get: function () {
  58352. return 4 * this.intensity * Math.PI;
  58353. },
  58354. set: function (e) {
  58355. this.intensity = e / (4 * Math.PI);
  58356. },
  58357. }),
  58358. (n.PointLight.prototype.copy = function (e) {
  58359. return (
  58360. n.Light.prototype.copy.call(this, e),
  58361. (this.distance = e.distance),
  58362. (this.decay = e.decay),
  58363. (this.shadow = e.shadow.clone()),
  58364. this
  58365. );
  58366. }),
  58367. (n.SpotLight = function (e, t, i, r, o, a) {
  58368. n.Light.call(this, e, t),
  58369. (this.type = "SpotLight"),
  58370. this.position.set(0, 1, 0),
  58371. this.updateMatrix(),
  58372. (this.target = new n.Object3D()),
  58373. (this.distance = void 0 !== i ? i : 0),
  58374. (this.angle = void 0 !== r ? r : Math.PI / 3),
  58375. (this.penumbra = void 0 !== o ? o : 0),
  58376. (this.decay = void 0 !== a ? a : 1),
  58377. (this.shadow = new n.LightShadow(
  58378. new n.PerspectiveCamera(50, 1, 0.5, 500)
  58379. ));
  58380. }),
  58381. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  58382. (n.SpotLight.prototype.constructor = n.SpotLight),
  58383. Object.defineProperty(n.SpotLight.prototype, "power", {
  58384. get: function () {
  58385. return this.intensity * Math.PI;
  58386. },
  58387. set: function (e) {
  58388. this.intensity = e / Math.PI;
  58389. },
  58390. }),
  58391. (n.SpotLight.prototype.copy = function (e) {
  58392. return (
  58393. n.Light.prototype.copy.call(this, e),
  58394. (this.distance = e.distance),
  58395. (this.angle = e.angle),
  58396. (this.penumbra = e.penumbra),
  58397. (this.decay = e.decay),
  58398. (this.target = e.target.clone()),
  58399. (this.shadow = e.shadow.clone()),
  58400. this
  58401. );
  58402. }),
  58403. (n.Cache = {
  58404. enabled: !1,
  58405. files: {},
  58406. add: function (e, t) {
  58407. this.enabled !== !1 && (this.files[e] = t);
  58408. },
  58409. get: function (e) {
  58410. if (this.enabled !== !1) return this.files[e];
  58411. },
  58412. remove: function (e) {
  58413. delete this.files[e];
  58414. },
  58415. clear: function () {
  58416. this.files = {};
  58417. },
  58418. }),
  58419. (n.Loader = function () {
  58420. (this.onLoadStart = function () {}),
  58421. (this.onLoadProgress = function () {}),
  58422. (this.onLoadComplete = function () {});
  58423. }),
  58424. (n.Loader.prototype = {
  58425. constructor: n.Loader,
  58426. crossOrigin: void 0,
  58427. extractUrlBase: function (e) {
  58428. var t = e.split("/");
  58429. return 1 === t.length ? "./" : (t.pop(), t.join("/") + "/");
  58430. },
  58431. initMaterials: function (e, t, i) {
  58432. for (var n = [], r = 0; r < e.length; ++r)
  58433. n[r] = this.createMaterial(e[r], t, i);
  58434. return n;
  58435. },
  58436. createMaterial: (function () {
  58437. var e, t, i;
  58438. return function (r, o, a) {
  58439. function s(e, i, r, s, c) {
  58440. var h,
  58441. u = o + e,
  58442. d = n.Loader.Handlers.get(u);
  58443. null !== d
  58444. ? (h = d.load(u))
  58445. : (t.setCrossOrigin(a), (h = t.load(u))),
  58446. void 0 !== i &&
  58447. (h.repeat.fromArray(i),
  58448. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  58449. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  58450. void 0 !== r && h.offset.fromArray(r),
  58451. void 0 !== s &&
  58452. ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  58453. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  58454. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  58455. "mirror" === s[1] &&
  58456. (h.wrapT = n.MirroredRepeatWrapping)),
  58457. void 0 !== c && (h.anisotropy = c);
  58458. var p = n.Math.generateUUID();
  58459. return (l[p] = h), p;
  58460. }
  58461. void 0 === e && (e = new n.Color()),
  58462. void 0 === t && (t = new n.TextureLoader()),
  58463. void 0 === i && (i = new n.MaterialLoader());
  58464. var l = {},
  58465. c = {
  58466. uuid: n.Math.generateUUID(),
  58467. type: "MeshLambertMaterial",
  58468. };
  58469. for (var h in r) {
  58470. var u = r[h];
  58471. switch (h) {
  58472. case "DbgColor":
  58473. case "DbgIndex":
  58474. case "opticalDensity":
  58475. case "illumination":
  58476. break;
  58477. case "DbgName":
  58478. c.name = u;
  58479. break;
  58480. case "blending":
  58481. c.blending = n[u];
  58482. break;
  58483. case "colorAmbient":
  58484. case "mapAmbient":
  58485. console.warn(
  58486. "THREE.Loader.createMaterial:",
  58487. h,
  58488. "is no longer supported."
  58489. );
  58490. break;
  58491. case "colorDiffuse":
  58492. c.color = e.fromArray(u).getHex();
  58493. break;
  58494. case "colorSpecular":
  58495. c.specular = e.fromArray(u).getHex();
  58496. break;
  58497. case "colorEmissive":
  58498. c.emissive = e.fromArray(u).getHex();
  58499. break;
  58500. case "specularCoef":
  58501. c.shininess = u;
  58502. break;
  58503. case "shading":
  58504. "basic" === u.toLowerCase() &&
  58505. (c.type = "MeshBasicMaterial"),
  58506. "phong" === u.toLowerCase() &&
  58507. (c.type = "MeshPhongMaterial");
  58508. break;
  58509. case "mapDiffuse":
  58510. c.map = s(
  58511. u,
  58512. r.mapDiffuseRepeat,
  58513. r.mapDiffuseOffset,
  58514. r.mapDiffuseWrap,
  58515. r.mapDiffuseAnisotropy
  58516. );
  58517. break;
  58518. case "mapDiffuseRepeat":
  58519. case "mapDiffuseOffset":
  58520. case "mapDiffuseWrap":
  58521. case "mapDiffuseAnisotropy":
  58522. break;
  58523. case "mapLight":
  58524. c.lightMap = s(
  58525. u,
  58526. r.mapLightRepeat,
  58527. r.mapLightOffset,
  58528. r.mapLightWrap,
  58529. r.mapLightAnisotropy
  58530. );
  58531. break;
  58532. case "mapLightRepeat":
  58533. case "mapLightOffset":
  58534. case "mapLightWrap":
  58535. case "mapLightAnisotropy":
  58536. break;
  58537. case "mapAO":
  58538. c.aoMap = s(
  58539. u,
  58540. r.mapAORepeat,
  58541. r.mapAOOffset,
  58542. r.mapAOWrap,
  58543. r.mapAOAnisotropy
  58544. );
  58545. break;
  58546. case "mapAORepeat":
  58547. case "mapAOOffset":
  58548. case "mapAOWrap":
  58549. case "mapAOAnisotropy":
  58550. break;
  58551. case "mapBump":
  58552. c.bumpMap = s(
  58553. u,
  58554. r.mapBumpRepeat,
  58555. r.mapBumpOffset,
  58556. r.mapBumpWrap,
  58557. r.mapBumpAnisotropy
  58558. );
  58559. break;
  58560. case "mapBumpScale":
  58561. c.bumpScale = u;
  58562. break;
  58563. case "mapBumpRepeat":
  58564. case "mapBumpOffset":
  58565. case "mapBumpWrap":
  58566. case "mapBumpAnisotropy":
  58567. break;
  58568. case "mapNormal":
  58569. c.normalMap = s(
  58570. u,
  58571. r.mapNormalRepeat,
  58572. r.mapNormalOffset,
  58573. r.mapNormalWrap,
  58574. r.mapNormalAnisotropy
  58575. );
  58576. break;
  58577. case "mapNormalFactor":
  58578. c.normalScale = [u, u];
  58579. break;
  58580. case "mapNormalRepeat":
  58581. case "mapNormalOffset":
  58582. case "mapNormalWrap":
  58583. case "mapNormalAnisotropy":
  58584. break;
  58585. case "mapSpecular":
  58586. c.specularMap = s(
  58587. u,
  58588. r.mapSpecularRepeat,
  58589. r.mapSpecularOffset,
  58590. r.mapSpecularWrap,
  58591. r.mapSpecularAnisotropy
  58592. );
  58593. break;
  58594. case "mapSpecularRepeat":
  58595. case "mapSpecularOffset":
  58596. case "mapSpecularWrap":
  58597. case "mapSpecularAnisotropy":
  58598. break;
  58599. case "mapAlpha":
  58600. c.alphaMap = s(
  58601. u,
  58602. r.mapAlphaRepeat,
  58603. r.mapAlphaOffset,
  58604. r.mapAlphaWrap,
  58605. r.mapAlphaAnisotropy
  58606. );
  58607. break;
  58608. case "mapAlphaRepeat":
  58609. case "mapAlphaOffset":
  58610. case "mapAlphaWrap":
  58611. case "mapAlphaAnisotropy":
  58612. break;
  58613. case "flipSided":
  58614. c.side = n.BackSide;
  58615. break;
  58616. case "doubleSided":
  58617. c.side = n.DoubleSide;
  58618. break;
  58619. case "transparency":
  58620. console.warn(
  58621. "THREE.Loader.createMaterial: transparency has been renamed to opacity"
  58622. ),
  58623. (c.opacity = u);
  58624. break;
  58625. case "depthTest":
  58626. case "depthWrite":
  58627. case "colorWrite":
  58628. case "opacity":
  58629. case "reflectivity":
  58630. case "transparent":
  58631. case "visible":
  58632. case "wireframe":
  58633. c[h] = u;
  58634. break;
  58635. case "vertexColors":
  58636. u === !0 && (c.vertexColors = n.VertexColors),
  58637. "face" === u && (c.vertexColors = n.FaceColors);
  58638. break;
  58639. default:
  58640. console.error(
  58641. "THREE.Loader.createMaterial: Unsupported",
  58642. h,
  58643. u
  58644. );
  58645. }
  58646. }
  58647. return (
  58648. "MeshBasicMaterial" === c.type && delete c.emissive,
  58649. "MeshPhongMaterial" !== c.type && delete c.specular,
  58650. c.opacity < 1 && (c.transparent = !0),
  58651. i.setTextures(l),
  58652. i.parse(c)
  58653. );
  58654. };
  58655. })(),
  58656. }),
  58657. (n.Loader.Handlers = {
  58658. handlers: [],
  58659. add: function (e, t) {
  58660. this.handlers.push(e, t);
  58661. },
  58662. get: function (e) {
  58663. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  58664. var r = t[i],
  58665. o = t[i + 1];
  58666. if (r.test(e)) return o;
  58667. }
  58668. return null;
  58669. },
  58670. }),
  58671. (n.XHRLoader = function (e) {
  58672. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  58673. }),
  58674. (n.XHRLoader.prototype = {
  58675. constructor: n.XHRLoader,
  58676. load: function (e, t, i, r) {
  58677. void 0 !== this.path && (e = this.path + e);
  58678. var o = this,
  58679. a = n.Cache.get(e);
  58680. if (void 0 !== a)
  58681. return (
  58682. t &&
  58683. setTimeout(function () {
  58684. t(a);
  58685. }, 0),
  58686. a
  58687. );
  58688. var s = new XMLHttpRequest();
  58689. return (
  58690. s.overrideMimeType("text/plain"),
  58691. s.open("GET", e, !0),
  58692. s.addEventListener(
  58693. "load",
  58694. function (i) {
  58695. var a = i.target.response;
  58696. n.Cache.add(e, a),
  58697. 200 === this.status
  58698. ? (t && t(a), o.manager.itemEnd(e))
  58699. : 0 === this.status
  58700. ? (console.warn(
  58701. "THREE.XHRLoader: HTTP Status 0 received."
  58702. ),
  58703. t && t(a),
  58704. o.manager.itemEnd(e))
  58705. : (r && r(i), o.manager.itemError(e));
  58706. },
  58707. !1
  58708. ),
  58709. void 0 !== i &&
  58710. s.addEventListener(
  58711. "progress",
  58712. function (e) {
  58713. i(e);
  58714. },
  58715. !1
  58716. ),
  58717. s.addEventListener(
  58718. "error",
  58719. function (t) {
  58720. r && r(t), o.manager.itemError(e);
  58721. },
  58722. !1
  58723. ),
  58724. void 0 !== this.responseType &&
  58725. (s.responseType = this.responseType),
  58726. void 0 !== this.withCredentials &&
  58727. (s.withCredentials = this.withCredentials),
  58728. s.send(null),
  58729. o.manager.itemStart(e),
  58730. s
  58731. );
  58732. },
  58733. setPath: function (e) {
  58734. this.path = e;
  58735. },
  58736. setResponseType: function (e) {
  58737. this.responseType = e;
  58738. },
  58739. setWithCredentials: function (e) {
  58740. this.withCredentials = e;
  58741. },
  58742. }),
  58743. (n.FontLoader = function (e) {
  58744. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  58745. }),
  58746. (n.FontLoader.prototype = {
  58747. constructor: n.FontLoader,
  58748. load: function (e, t, i, r) {
  58749. var o = new n.XHRLoader(this.manager);
  58750. o.load(
  58751. e,
  58752. function (e) {
  58753. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))));
  58754. },
  58755. i,
  58756. r
  58757. );
  58758. },
  58759. }),
  58760. (n.ImageLoader = function (e) {
  58761. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  58762. }),
  58763. (n.ImageLoader.prototype = {
  58764. constructor: n.ImageLoader,
  58765. load: function (e, t, i, r) {
  58766. void 0 !== this.path && (e = this.path + e);
  58767. var o = this,
  58768. a = n.Cache.get(e);
  58769. if (void 0 !== a)
  58770. return (
  58771. o.manager.itemStart(e),
  58772. t
  58773. ? setTimeout(function () {
  58774. t(a), o.manager.itemEnd(e);
  58775. }, 0)
  58776. : o.manager.itemEnd(e),
  58777. a
  58778. );
  58779. var s = document.createElement("img");
  58780. return (
  58781. s.addEventListener(
  58782. "load",
  58783. function (i) {
  58784. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e);
  58785. },
  58786. !1
  58787. ),
  58788. void 0 !== i &&
  58789. s.addEventListener(
  58790. "progress",
  58791. function (e) {
  58792. i(e);
  58793. },
  58794. !1
  58795. ),
  58796. s.addEventListener(
  58797. "error",
  58798. function (t) {
  58799. r && r(t), o.manager.itemError(e);
  58800. },
  58801. !1
  58802. ),
  58803. void 0 !== this.crossOrigin &&
  58804. (s.crossOrigin = this.crossOrigin),
  58805. o.manager.itemStart(e),
  58806. (s.src = e),
  58807. s
  58808. );
  58809. },
  58810. setCrossOrigin: function (e) {
  58811. this.crossOrigin = e;
  58812. },
  58813. setPath: function (e) {
  58814. this.path = e;
  58815. },
  58816. }),
  58817. (n.JSONLoader = function (e) {
  58818. "boolean" == typeof e &&
  58819. (console.warn(
  58820. "THREE.JSONLoader: showStatus parameter has been removed from constructor."
  58821. ),
  58822. (e = void 0)),
  58823. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  58824. (this.withCredentials = !1);
  58825. }),
  58826. (n.JSONLoader.prototype = {
  58827. constructor: n.JSONLoader,
  58828. get statusDomElement() {
  58829. return (
  58830. void 0 === this._statusDomElement &&
  58831. (this._statusDomElement = document.createElement("div")),
  58832. console.warn(
  58833. "THREE.JSONLoader: .statusDomElement has been removed."
  58834. ),
  58835. this._statusDomElement
  58836. );
  58837. },
  58838. load: function (e, t, i, r) {
  58839. var o = this,
  58840. a =
  58841. this.texturePath && "string" == typeof this.texturePath
  58842. ? this.texturePath
  58843. : n.Loader.prototype.extractUrlBase(e),
  58844. s = new n.XHRLoader(this.manager);
  58845. s.setWithCredentials(this.withCredentials),
  58846. s.load(
  58847. e,
  58848. function (i) {
  58849. var n = JSON.parse(i),
  58850. r = n.metadata;
  58851. if (void 0 !== r) {
  58852. var s = r.type;
  58853. if (void 0 !== s) {
  58854. if ("object" === s.toLowerCase())
  58855. return void console.error(
  58856. "THREE.JSONLoader: " +
  58857. e +
  58858. " should be loaded with THREE.ObjectLoader instead."
  58859. );
  58860. if ("scene" === s.toLowerCase())
  58861. return void console.error(
  58862. "THREE.JSONLoader: " +
  58863. e +
  58864. " should be loaded with THREE.SceneLoader instead."
  58865. );
  58866. }
  58867. }
  58868. var l = o.parse(n, a);
  58869. t(l.geometry, l.materials);
  58870. },
  58871. i,
  58872. r
  58873. );
  58874. },
  58875. setTexturePath: function (e) {
  58876. this.texturePath = e;
  58877. },
  58878. parse: function (e, t) {
  58879. function i(t) {
  58880. function i(e, t) {
  58881. return e & (1 << t);
  58882. }
  58883. var r,
  58884. o,
  58885. a,
  58886. l,
  58887. c,
  58888. h,
  58889. u,
  58890. d,
  58891. p,
  58892. f,
  58893. g,
  58894. m,
  58895. v,
  58896. A,
  58897. y,
  58898. C,
  58899. I,
  58900. E,
  58901. b,
  58902. w,
  58903. _,
  58904. T,
  58905. x,
  58906. S,
  58907. M,
  58908. R,
  58909. P,
  58910. O = e.faces,
  58911. L = e.vertices,
  58912. D = e.normals,
  58913. N = e.colors,
  58914. B = 0;
  58915. if (void 0 !== e.uvs) {
  58916. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++;
  58917. for (r = 0; r < B; r++) s.faceVertexUvs[r] = [];
  58918. }
  58919. for (l = 0, c = L.length; l < c; )
  58920. (E = new n.Vector3()),
  58921. (E.x = L[l++] * t),
  58922. (E.y = L[l++] * t),
  58923. (E.z = L[l++] * t),
  58924. s.vertices.push(E);
  58925. for (l = 0, c = O.length; l < c; )
  58926. if (
  58927. ((f = O[l++]),
  58928. (g = i(f, 0)),
  58929. (m = i(f, 1)),
  58930. (v = i(f, 3)),
  58931. (A = i(f, 4)),
  58932. (y = i(f, 5)),
  58933. (C = i(f, 6)),
  58934. (I = i(f, 7)),
  58935. g)
  58936. ) {
  58937. if (
  58938. ((w = new n.Face3()),
  58939. (w.a = O[l]),
  58940. (w.b = O[l + 1]),
  58941. (w.c = O[l + 3]),
  58942. (_ = new n.Face3()),
  58943. (_.a = O[l + 1]),
  58944. (_.b = O[l + 2]),
  58945. (_.c = O[l + 3]),
  58946. (l += 4),
  58947. m &&
  58948. ((p = O[l++]),
  58949. (w.materialIndex = p),
  58950. (_.materialIndex = p)),
  58951. (a = s.faces.length),
  58952. v)
  58953. )
  58954. for (r = 0; r < B; r++)
  58955. for (
  58956. S = e.uvs[r],
  58957. s.faceVertexUvs[r][a] = [],
  58958. s.faceVertexUvs[r][a + 1] = [],
  58959. o = 0;
  58960. o < 4;
  58961. o++
  58962. )
  58963. (d = O[l++]),
  58964. (R = S[2 * d]),
  58965. (P = S[2 * d + 1]),
  58966. (M = new n.Vector2(R, P)),
  58967. 2 !== o && s.faceVertexUvs[r][a].push(M),
  58968. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  58969. if (
  58970. (A &&
  58971. ((u = 3 * O[l++]),
  58972. w.normal.set(D[u++], D[u++], D[u]),
  58973. _.normal.copy(w.normal)),
  58974. y)
  58975. )
  58976. for (r = 0; r < 4; r++)
  58977. (u = 3 * O[l++]),
  58978. (x = new n.Vector3(D[u++], D[u++], D[u])),
  58979. 2 !== r && w.vertexNormals.push(x),
  58980. 0 !== r && _.vertexNormals.push(x);
  58981. if (
  58982. (C &&
  58983. ((h = O[l++]),
  58984. (T = N[h]),
  58985. w.color.setHex(T),
  58986. _.color.setHex(T)),
  58987. I)
  58988. )
  58989. for (r = 0; r < 4; r++)
  58990. (h = O[l++]),
  58991. (T = N[h]),
  58992. 2 !== r && w.vertexColors.push(new n.Color(T)),
  58993. 0 !== r && _.vertexColors.push(new n.Color(T));
  58994. s.faces.push(w), s.faces.push(_);
  58995. } else {
  58996. if (
  58997. ((b = new n.Face3()),
  58998. (b.a = O[l++]),
  58999. (b.b = O[l++]),
  59000. (b.c = O[l++]),
  59001. m && ((p = O[l++]), (b.materialIndex = p)),
  59002. (a = s.faces.length),
  59003. v)
  59004. )
  59005. for (r = 0; r < B; r++)
  59006. for (
  59007. S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0;
  59008. o < 3;
  59009. o++
  59010. )
  59011. (d = O[l++]),
  59012. (R = S[2 * d]),
  59013. (P = S[2 * d + 1]),
  59014. (M = new n.Vector2(R, P)),
  59015. s.faceVertexUvs[r][a].push(M);
  59016. if (
  59017. (A &&
  59018. ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])),
  59019. y)
  59020. )
  59021. for (r = 0; r < 3; r++)
  59022. (u = 3 * O[l++]),
  59023. (x = new n.Vector3(D[u++], D[u++], D[u])),
  59024. b.vertexNormals.push(x);
  59025. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I))
  59026. for (r = 0; r < 3; r++)
  59027. (h = O[l++]), b.vertexColors.push(new n.Color(N[h]));
  59028. s.faces.push(b);
  59029. }
  59030. }
  59031. function r() {
  59032. var t =
  59033. void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  59034. if (e.skinWeights)
  59035. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  59036. var o = e.skinWeights[i],
  59037. a = t > 1 ? e.skinWeights[i + 1] : 0,
  59038. l = t > 2 ? e.skinWeights[i + 2] : 0,
  59039. c = t > 3 ? e.skinWeights[i + 3] : 0;
  59040. s.skinWeights.push(new n.Vector4(o, a, l, c));
  59041. }
  59042. if (e.skinIndices)
  59043. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  59044. var h = e.skinIndices[i],
  59045. u = t > 1 ? e.skinIndices[i + 1] : 0,
  59046. d = t > 2 ? e.skinIndices[i + 2] : 0,
  59047. p = t > 3 ? e.skinIndices[i + 3] : 0;
  59048. s.skinIndices.push(new n.Vector4(h, u, d, p));
  59049. }
  59050. (s.bones = e.bones),
  59051. s.bones &&
  59052. s.bones.length > 0 &&
  59053. (s.skinWeights.length !== s.skinIndices.length ||
  59054. s.skinIndices.length !== s.vertices.length) &&
  59055. console.warn(
  59056. "When skinning, number of vertices (" +
  59057. s.vertices.length +
  59058. "), skinIndices (" +
  59059. s.skinIndices.length +
  59060. "), and skinWeights (" +
  59061. s.skinWeights.length +
  59062. ") should match."
  59063. );
  59064. }
  59065. function o(t) {
  59066. if (void 0 !== e.morphTargets)
  59067. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  59068. (s.morphTargets[i] = {}),
  59069. (s.morphTargets[i].name = e.morphTargets[i].name),
  59070. (s.morphTargets[i].vertices = []);
  59071. for (
  59072. var o = s.morphTargets[i].vertices,
  59073. a = e.morphTargets[i].vertices,
  59074. l = 0,
  59075. c = a.length;
  59076. l < c;
  59077. l += 3
  59078. ) {
  59079. var h = new n.Vector3();
  59080. (h.x = a[l] * t),
  59081. (h.y = a[l + 1] * t),
  59082. (h.z = a[l + 2] * t),
  59083. o.push(h);
  59084. }
  59085. }
  59086. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  59087. console.warn(
  59088. 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'
  59089. );
  59090. for (
  59091. var u = s.faces,
  59092. d = e.morphColors[0].colors,
  59093. i = 0,
  59094. r = u.length;
  59095. i < r;
  59096. i++
  59097. )
  59098. u[i].color.fromArray(d, 3 * i);
  59099. }
  59100. }
  59101. function a() {
  59102. var t = [],
  59103. i = [];
  59104. void 0 !== e.animation && i.push(e.animation),
  59105. void 0 !== e.animations &&
  59106. (e.animations.length
  59107. ? (i = i.concat(e.animations))
  59108. : i.push(e.animations));
  59109. for (var r = 0; r < i.length; r++) {
  59110. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  59111. o && t.push(o);
  59112. }
  59113. if (s.morphTargets) {
  59114. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(
  59115. s.morphTargets,
  59116. 10
  59117. );
  59118. t = t.concat(a);
  59119. }
  59120. t.length > 0 && (s.animations = t);
  59121. }
  59122. var s = new n.Geometry(),
  59123. l = void 0 !== e.scale ? 1 / e.scale : 1;
  59124. if (
  59125. (i(l),
  59126. r(),
  59127. o(l),
  59128. a(),
  59129. s.computeFaceNormals(),
  59130. s.computeBoundingSphere(),
  59131. void 0 === e.materials || 0 === e.materials.length)
  59132. )
  59133. return {
  59134. geometry: s,
  59135. };
  59136. var c = n.Loader.prototype.initMaterials(
  59137. e.materials,
  59138. t,
  59139. this.crossOrigin
  59140. );
  59141. return {
  59142. geometry: s,
  59143. materials: c,
  59144. };
  59145. },
  59146. }),
  59147. (n.LoadingManager = function (e, t, i) {
  59148. var n = this,
  59149. r = !1,
  59150. o = 0,
  59151. a = 0;
  59152. (this.onStart = void 0),
  59153. (this.onLoad = e),
  59154. (this.onProgress = t),
  59155. (this.onError = i),
  59156. (this.itemStart = function (e) {
  59157. a++,
  59158. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  59159. (r = !0);
  59160. }),
  59161. (this.itemEnd = function (e) {
  59162. o++,
  59163. void 0 !== n.onProgress && n.onProgress(e, o, a),
  59164. o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad());
  59165. }),
  59166. (this.itemError = function (e) {
  59167. void 0 !== n.onError && n.onError(e);
  59168. });
  59169. }),
  59170. (n.DefaultLoadingManager = new n.LoadingManager()),
  59171. (n.BufferGeometryLoader = function (e) {
  59172. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  59173. }),
  59174. (n.BufferGeometryLoader.prototype = {
  59175. constructor: n.BufferGeometryLoader,
  59176. load: function (e, t, i, r) {
  59177. var o = this,
  59178. a = new n.XHRLoader(o.manager);
  59179. a.load(
  59180. e,
  59181. function (e) {
  59182. t(o.parse(JSON.parse(e)));
  59183. },
  59184. i,
  59185. r
  59186. );
  59187. },
  59188. parse: function (e) {
  59189. var t = new n.BufferGeometry(),
  59190. i = e.data.index,
  59191. r = {
  59192. Int8Array: Int8Array,
  59193. Uint8Array: Uint8Array,
  59194. Uint8ClampedArray: Uint8ClampedArray,
  59195. Int16Array: Int16Array,
  59196. Uint16Array: Uint16Array,
  59197. Int32Array: Int32Array,
  59198. Uint32Array: Uint32Array,
  59199. Float32Array: Float32Array,
  59200. Float64Array: Float64Array,
  59201. };
  59202. if (void 0 !== i) {
  59203. var o = new r[i.type](i.array);
  59204. t.setIndex(new n.BufferAttribute(o, 1));
  59205. }
  59206. var a = e.data.attributes;
  59207. for (var s in a) {
  59208. var l = a[s],
  59209. o = new r[l.type](l.array);
  59210. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize));
  59211. }
  59212. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  59213. if (void 0 !== c)
  59214. for (var h = 0, u = c.length; h !== u; ++h) {
  59215. var d = c[h];
  59216. t.addGroup(d.start, d.count, d.materialIndex);
  59217. }
  59218. var p = e.data.boundingSphere;
  59219. if (void 0 !== p) {
  59220. var f = new n.Vector3();
  59221. void 0 !== p.center && f.fromArray(p.center),
  59222. (t.boundingSphere = new n.Sphere(f, p.radius));
  59223. }
  59224. return t;
  59225. },
  59226. }),
  59227. (n.MaterialLoader = function (e) {
  59228. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59229. (this.textures = {});
  59230. }),
  59231. (n.MaterialLoader.prototype = {
  59232. constructor: n.MaterialLoader,
  59233. load: function (e, t, i, r) {
  59234. var o = this,
  59235. a = new n.XHRLoader(o.manager);
  59236. a.load(
  59237. e,
  59238. function (e) {
  59239. t(o.parse(JSON.parse(e)));
  59240. },
  59241. i,
  59242. r
  59243. );
  59244. },
  59245. setTextures: function (e) {
  59246. this.textures = e;
  59247. },
  59248. getTexture: function (e) {
  59249. var t = this.textures;
  59250. return (
  59251. void 0 === t[e] &&
  59252. console.warn("THREE.MaterialLoader: Undefined texture", e),
  59253. t[e]
  59254. );
  59255. },
  59256. parse: function (e) {
  59257. var t = new n[e.type]();
  59258. if (
  59259. (void 0 !== e.uuid && (t.uuid = e.uuid),
  59260. void 0 !== e.name && (t.name = e.name),
  59261. void 0 !== e.color && t.color.setHex(e.color),
  59262. void 0 !== e.roughness && (t.roughness = e.roughness),
  59263. void 0 !== e.metalness && (t.metalness = e.metalness),
  59264. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  59265. void 0 !== e.specular && t.specular.setHex(e.specular),
  59266. void 0 !== e.shininess && (t.shininess = e.shininess),
  59267. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  59268. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  59269. void 0 !== e.fragmentShader &&
  59270. (t.fragmentShader = e.fragmentShader),
  59271. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  59272. void 0 !== e.shading && (t.shading = e.shading),
  59273. void 0 !== e.blending && (t.blending = e.blending),
  59274. void 0 !== e.side && (t.side = e.side),
  59275. void 0 !== e.opacity && (t.opacity = e.opacity),
  59276. void 0 !== e.transparent && (t.transparent = e.transparent),
  59277. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  59278. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  59279. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  59280. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  59281. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  59282. void 0 !== e.wireframeLinewidth &&
  59283. (t.wireframeLinewidth = e.wireframeLinewidth),
  59284. void 0 !== e.size && (t.size = e.size),
  59285. void 0 !== e.sizeAttenuation &&
  59286. (t.sizeAttenuation = e.sizeAttenuation),
  59287. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  59288. void 0 !== e.alphaMap &&
  59289. ((t.alphaMap = this.getTexture(e.alphaMap)),
  59290. (t.transparent = !0)),
  59291. void 0 !== e.bumpMap &&
  59292. (t.bumpMap = this.getTexture(e.bumpMap)),
  59293. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  59294. void 0 !== e.normalMap &&
  59295. (t.normalMap = this.getTexture(e.normalMap)),
  59296. void 0 !== e.normalScale)
  59297. ) {
  59298. var i = e.normalScale;
  59299. Array.isArray(i) === !1 && (i = [i, i]),
  59300. (t.normalScale = new n.Vector2().fromArray(i));
  59301. }
  59302. if (
  59303. (void 0 !== e.displacementMap &&
  59304. (t.displacementMap = this.getTexture(e.displacementMap)),
  59305. void 0 !== e.displacementScale &&
  59306. (t.displacementScale = e.displacementScale),
  59307. void 0 !== e.displacementBias &&
  59308. (t.displacementBias = e.displacementBias),
  59309. void 0 !== e.roughnessMap &&
  59310. (t.roughnessMap = this.getTexture(e.roughnessMap)),
  59311. void 0 !== e.metalnessMap &&
  59312. (t.metalnessMap = this.getTexture(e.metalnessMap)),
  59313. void 0 !== e.emissiveMap &&
  59314. (t.emissiveMap = this.getTexture(e.emissiveMap)),
  59315. void 0 !== e.emissiveIntensity &&
  59316. (t.emissiveIntensity = e.emissiveIntensity),
  59317. void 0 !== e.specularMap &&
  59318. (t.specularMap = this.getTexture(e.specularMap)),
  59319. void 0 !== e.envMap &&
  59320. ((t.envMap = this.getTexture(e.envMap)),
  59321. (t.combine = n.MultiplyOperation)),
  59322. e.reflectivity && (t.reflectivity = e.reflectivity),
  59323. void 0 !== e.lightMap &&
  59324. (t.lightMap = this.getTexture(e.lightMap)),
  59325. void 0 !== e.lightMapIntensity &&
  59326. (t.lightMapIntensity = e.lightMapIntensity),
  59327. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  59328. void 0 !== e.aoMapIntensity &&
  59329. (t.aoMapIntensity = e.aoMapIntensity),
  59330. void 0 !== e.materials)
  59331. )
  59332. for (var r = 0, o = e.materials.length; r < o; r++)
  59333. t.materials.push(this.parse(e.materials[r]));
  59334. return t;
  59335. },
  59336. }),
  59337. (n.ObjectLoader = function (e) {
  59338. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59339. (this.texturePath = "");
  59340. }),
  59341. (n.ObjectLoader.prototype = {
  59342. constructor: n.ObjectLoader,
  59343. load: function (e, t, i, r) {
  59344. "" === this.texturePath &&
  59345. (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  59346. var o = this,
  59347. a = new n.XHRLoader(o.manager);
  59348. a.load(
  59349. e,
  59350. function (e) {
  59351. o.parse(JSON.parse(e), t);
  59352. },
  59353. i,
  59354. r
  59355. );
  59356. },
  59357. setTexturePath: function (e) {
  59358. this.texturePath = e;
  59359. },
  59360. setCrossOrigin: function (e) {
  59361. this.crossOrigin = e;
  59362. },
  59363. parse: function (e, t) {
  59364. var i = this.parseGeometries(e.geometries),
  59365. n = this.parseImages(e.images, function () {
  59366. void 0 !== t && t(a);
  59367. }),
  59368. r = this.parseTextures(e.textures, n),
  59369. o = this.parseMaterials(e.materials, r),
  59370. a = this.parseObject(e.object, i, o);
  59371. return (
  59372. e.animations &&
  59373. (a.animations = this.parseAnimations(e.animations)),
  59374. (void 0 !== e.images && 0 !== e.images.length) ||
  59375. (void 0 !== t && t(a)),
  59376. a
  59377. );
  59378. },
  59379. parseGeometries: function (e) {
  59380. var t = {};
  59381. if (void 0 !== e)
  59382. for (
  59383. var i = new n.JSONLoader(),
  59384. r = new n.BufferGeometryLoader(),
  59385. o = 0,
  59386. a = e.length;
  59387. o < a;
  59388. o++
  59389. ) {
  59390. var s,
  59391. l = e[o];
  59392. switch (l.type) {
  59393. case "PlaneGeometry":
  59394. case "PlaneBufferGeometry":
  59395. s = new n[l.type](
  59396. l.width,
  59397. l.height,
  59398. l.widthSegments,
  59399. l.heightSegments
  59400. );
  59401. break;
  59402. case "BoxGeometry":
  59403. case "BoxBufferGeometry":
  59404. case "CubeGeometry":
  59405. s = new n[l.type](
  59406. l.width,
  59407. l.height,
  59408. l.depth,
  59409. l.widthSegments,
  59410. l.heightSegments,
  59411. l.depthSegments
  59412. );
  59413. break;
  59414. case "CircleGeometry":
  59415. case "CircleBufferGeometry":
  59416. s = new n[l.type](
  59417. l.radius,
  59418. l.segments,
  59419. l.thetaStart,
  59420. l.thetaLength
  59421. );
  59422. break;
  59423. case "CylinderGeometry":
  59424. case "CylinderBufferGeometry":
  59425. s = new n[l.type](
  59426. l.radiusTop,
  59427. l.radiusBottom,
  59428. l.height,
  59429. l.radialSegments,
  59430. l.heightSegments,
  59431. l.openEnded,
  59432. l.thetaStart,
  59433. l.thetaLength
  59434. );
  59435. break;
  59436. case "SphereGeometry":
  59437. case "SphereBufferGeometry":
  59438. s = new n[l.type](
  59439. l.radius,
  59440. l.widthSegments,
  59441. l.heightSegments,
  59442. l.phiStart,
  59443. l.phiLength,
  59444. l.thetaStart,
  59445. l.thetaLength
  59446. );
  59447. break;
  59448. case "DodecahedronGeometry":
  59449. s = new n.DodecahedronGeometry(l.radius, l.detail);
  59450. break;
  59451. case "IcosahedronGeometry":
  59452. s = new n.IcosahedronGeometry(l.radius, l.detail);
  59453. break;
  59454. case "OctahedronGeometry":
  59455. s = new n.OctahedronGeometry(l.radius, l.detail);
  59456. break;
  59457. case "TetrahedronGeometry":
  59458. s = new n.TetrahedronGeometry(l.radius, l.detail);
  59459. break;
  59460. case "RingGeometry":
  59461. case "RingBufferGeometry":
  59462. s = new n[l.type](
  59463. l.innerRadius,
  59464. l.outerRadius,
  59465. l.thetaSegments,
  59466. l.phiSegments,
  59467. l.thetaStart,
  59468. l.thetaLength
  59469. );
  59470. break;
  59471. case "TorusGeometry":
  59472. case "TorusBufferGeometry":
  59473. s = new n[l.type](
  59474. l.radius,
  59475. l.tube,
  59476. l.radialSegments,
  59477. l.tubularSegments,
  59478. l.arc
  59479. );
  59480. break;
  59481. case "TorusKnotGeometry":
  59482. case "TorusKnotBufferGeometry":
  59483. s = new n[l.type](
  59484. l.radius,
  59485. l.tube,
  59486. l.tubularSegments,
  59487. l.radialSegments,
  59488. l.p,
  59489. l.q
  59490. );
  59491. break;
  59492. case "LatheGeometry":
  59493. s = new n.LatheGeometry(
  59494. l.points,
  59495. l.segments,
  59496. l.phiStart,
  59497. l.phiLength
  59498. );
  59499. break;
  59500. case "BufferGeometry":
  59501. s = r.parse(l);
  59502. break;
  59503. case "Geometry":
  59504. s = i.parse(l.data, this.texturePath).geometry;
  59505. break;
  59506. default:
  59507. console.warn(
  59508. 'THREE.ObjectLoader: Unsupported geometry type "' +
  59509. l.type +
  59510. '"'
  59511. );
  59512. continue;
  59513. }
  59514. (s.uuid = l.uuid),
  59515. void 0 !== l.name && (s.name = l.name),
  59516. (t[l.uuid] = s);
  59517. }
  59518. return t;
  59519. },
  59520. parseMaterials: function (e, t) {
  59521. var i = {};
  59522. if (void 0 !== e) {
  59523. var r = new n.MaterialLoader();
  59524. r.setTextures(t);
  59525. for (var o = 0, a = e.length; o < a; o++) {
  59526. var s = r.parse(e[o]);
  59527. i[s.uuid] = s;
  59528. }
  59529. }
  59530. return i;
  59531. },
  59532. parseAnimations: function (e) {
  59533. for (var t = [], i = 0; i < e.length; i++) {
  59534. var r = n.AnimationClip.parse(e[i]);
  59535. t.push(r);
  59536. }
  59537. return t;
  59538. },
  59539. parseImages: function (e, t) {
  59540. function i(e) {
  59541. return (
  59542. r.manager.itemStart(e),
  59543. s.load(e, function () {
  59544. r.manager.itemEnd(e);
  59545. })
  59546. );
  59547. }
  59548. var r = this,
  59549. o = {};
  59550. if (void 0 !== e && e.length > 0) {
  59551. var a = new n.LoadingManager(t),
  59552. s = new n.ImageLoader(a);
  59553. s.setCrossOrigin(this.crossOrigin);
  59554. for (var l = 0, c = e.length; l < c; l++) {
  59555. var h = e[l],
  59556. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)
  59557. ? h.url
  59558. : r.texturePath + h.url;
  59559. o[h.uuid] = i(u);
  59560. }
  59561. }
  59562. return o;
  59563. },
  59564. parseTextures: function (e, t) {
  59565. function i(e) {
  59566. return "number" == typeof e
  59567. ? e
  59568. : (console.warn(
  59569. "THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",
  59570. e
  59571. ),
  59572. n[e]);
  59573. }
  59574. var r = {};
  59575. if (void 0 !== e)
  59576. for (var o = 0, a = e.length; o < a; o++) {
  59577. var s = e[o];
  59578. void 0 === s.image &&
  59579. console.warn(
  59580. 'THREE.ObjectLoader: No "image" specified for',
  59581. s.uuid
  59582. ),
  59583. void 0 === t[s.image] &&
  59584. console.warn(
  59585. "THREE.ObjectLoader: Undefined image",
  59586. s.image
  59587. );
  59588. var l = new n.Texture(t[s.image]);
  59589. (l.needsUpdate = !0),
  59590. (l.uuid = s.uuid),
  59591. void 0 !== s.name && (l.name = s.name),
  59592. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  59593. void 0 !== s.offset &&
  59594. (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  59595. void 0 !== s.repeat &&
  59596. (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  59597. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  59598. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  59599. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  59600. Array.isArray(s.wrap) &&
  59601. ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  59602. (r[s.uuid] = l);
  59603. }
  59604. return r;
  59605. },
  59606. parseObject: (function () {
  59607. var e = new n.Matrix4();
  59608. return function (t, i, r) {
  59609. function o(e) {
  59610. return (
  59611. void 0 === i[e] &&
  59612. console.warn("THREE.ObjectLoader: Undefined geometry", e),
  59613. i[e]
  59614. );
  59615. }
  59616. function a(e) {
  59617. if (void 0 !== e)
  59618. return (
  59619. void 0 === r[e] &&
  59620. console.warn(
  59621. "THREE.ObjectLoader: Undefined material",
  59622. e
  59623. ),
  59624. r[e]
  59625. );
  59626. }
  59627. var s;
  59628. switch (t.type) {
  59629. case "Scene":
  59630. s = new n.Scene();
  59631. break;
  59632. case "PerspectiveCamera":
  59633. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far);
  59634. break;
  59635. case "OrthographicCamera":
  59636. s = new n.OrthographicCamera(
  59637. t.left,
  59638. t.right,
  59639. t.top,
  59640. t.bottom,
  59641. t.near,
  59642. t.far
  59643. );
  59644. break;
  59645. case "AmbientLight":
  59646. s = new n.AmbientLight(t.color, t.intensity);
  59647. break;
  59648. case "DirectionalLight":
  59649. s = new n.DirectionalLight(t.color, t.intensity);
  59650. break;
  59651. case "PointLight":
  59652. s = new n.PointLight(
  59653. t.color,
  59654. t.intensity,
  59655. t.distance,
  59656. t.decay
  59657. );
  59658. break;
  59659. case "SpotLight":
  59660. s = new n.SpotLight(
  59661. t.color,
  59662. t.intensity,
  59663. t.distance,
  59664. t.angle,
  59665. t.penumbra,
  59666. t.decay
  59667. );
  59668. break;
  59669. case "HemisphereLight":
  59670. s = new n.HemisphereLight(
  59671. t.color,
  59672. t.groundColor,
  59673. t.intensity
  59674. );
  59675. break;
  59676. case "Mesh":
  59677. var l = o(t.geometry),
  59678. c = a(t.material);
  59679. s =
  59680. l.bones && l.bones.length > 0
  59681. ? new n.SkinnedMesh(l, c)
  59682. : new n.Mesh(l, c);
  59683. break;
  59684. case "LOD":
  59685. s = new n.LOD();
  59686. break;
  59687. case "Line":
  59688. s = new n.Line(o(t.geometry), a(t.material), t.mode);
  59689. break;
  59690. case "PointCloud":
  59691. case "Points":
  59692. s = new n.Points(o(t.geometry), a(t.material));
  59693. break;
  59694. case "Sprite":
  59695. s = new n.Sprite(a(t.material));
  59696. break;
  59697. case "Group":
  59698. s = new n.Group();
  59699. break;
  59700. default:
  59701. s = new n.Object3D();
  59702. }
  59703. if (
  59704. ((s.uuid = t.uuid),
  59705. void 0 !== t.name && (s.name = t.name),
  59706. void 0 !== t.matrix
  59707. ? (e.fromArray(t.matrix),
  59708. e.decompose(s.position, s.quaternion, s.scale))
  59709. : (void 0 !== t.position &&
  59710. s.position.fromArray(t.position),
  59711. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  59712. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  59713. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  59714. void 0 !== t.receiveShadow &&
  59715. (s.receiveShadow = t.receiveShadow),
  59716. void 0 !== t.visible && (s.visible = t.visible),
  59717. void 0 !== t.userData && (s.userData = t.userData),
  59718. void 0 !== t.children)
  59719. )
  59720. for (var h in t.children)
  59721. s.add(this.parseObject(t.children[h], i, r));
  59722. if ("LOD" === t.type)
  59723. for (var u = t.levels, d = 0; d < u.length; d++) {
  59724. var p = u[d],
  59725. h = s.getObjectByProperty("uuid", p.object);
  59726. void 0 !== h && s.addLevel(h, p.distance);
  59727. }
  59728. return s;
  59729. };
  59730. })(),
  59731. }),
  59732. (n.TextureLoader = function (e) {
  59733. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  59734. }),
  59735. (n.TextureLoader.prototype = {
  59736. constructor: n.TextureLoader,
  59737. load: function (e, t, i, r) {
  59738. var o = new n.Texture(),
  59739. a = new n.ImageLoader(this.manager);
  59740. return (
  59741. a.setCrossOrigin(this.crossOrigin),
  59742. a.setPath(this.path),
  59743. a.load(
  59744. e,
  59745. function (e) {
  59746. (o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o);
  59747. },
  59748. i,
  59749. r
  59750. ),
  59751. o
  59752. );
  59753. },
  59754. setCrossOrigin: function (e) {
  59755. this.crossOrigin = e;
  59756. },
  59757. setPath: function (e) {
  59758. this.path = e;
  59759. },
  59760. }),
  59761. (n.CubeTextureLoader = function (e) {
  59762. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  59763. }),
  59764. (n.CubeTextureLoader.prototype = {
  59765. constructor: n.CubeTextureLoader,
  59766. load: function (e, t, i, r) {
  59767. function o(i) {
  59768. s.load(
  59769. e[i],
  59770. function (e) {
  59771. (a.images[i] = e),
  59772. l++,
  59773. 6 === l && ((a.needsUpdate = !0), t && t(a));
  59774. },
  59775. void 0,
  59776. r
  59777. );
  59778. }
  59779. var a = new n.CubeTexture(),
  59780. s = new n.ImageLoader(this.manager);
  59781. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path);
  59782. for (var l = 0, c = 0; c < e.length; ++c) o(c);
  59783. return a;
  59784. },
  59785. setCrossOrigin: function (e) {
  59786. this.crossOrigin = e;
  59787. },
  59788. setPath: function (e) {
  59789. this.path = e;
  59790. },
  59791. }),
  59792. (n.DataTextureLoader = n.BinaryTextureLoader =
  59793. function (e) {
  59794. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59795. (this._parser = null);
  59796. }),
  59797. (n.BinaryTextureLoader.prototype = {
  59798. constructor: n.BinaryTextureLoader,
  59799. load: function (e, t, i, r) {
  59800. var o = this,
  59801. a = new n.DataTexture(),
  59802. s = new n.XHRLoader(this.manager);
  59803. return (
  59804. s.setResponseType("arraybuffer"),
  59805. s.load(
  59806. e,
  59807. function (e) {
  59808. var i = o._parser(e);
  59809. i &&
  59810. (void 0 !== i.image
  59811. ? (a.image = i.image)
  59812. : void 0 !== i.data &&
  59813. ((a.image.width = i.width),
  59814. (a.image.height = i.height),
  59815. (a.image.data = i.data)),
  59816. (a.wrapS =
  59817. void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  59818. (a.wrapT =
  59819. void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  59820. (a.magFilter =
  59821. void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  59822. (a.minFilter =
  59823. void 0 !== i.minFilter
  59824. ? i.minFilter
  59825. : n.LinearMipMapLinearFilter),
  59826. (a.anisotropy =
  59827. void 0 !== i.anisotropy ? i.anisotropy : 1),
  59828. void 0 !== i.format && (a.format = i.format),
  59829. void 0 !== i.type && (a.type = i.type),
  59830. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  59831. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  59832. (a.needsUpdate = !0),
  59833. t && t(a, i));
  59834. },
  59835. i,
  59836. r
  59837. ),
  59838. a
  59839. );
  59840. },
  59841. }),
  59842. (n.CompressedTextureLoader = function (e) {
  59843. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  59844. (this._parser = null);
  59845. });
  59846. n.CompressedTextureLoader.prototype = {
  59847. constructor: n.CompressedTextureLoader,
  59848. load: function (e, t, i, r) {
  59849. function o(o) {
  59850. c.load(
  59851. e[o],
  59852. function (e) {
  59853. var i = a._parser(e, !0);
  59854. (s[o] = {
  59855. width: i.width,
  59856. height: i.height,
  59857. format: i.format,
  59858. mipmaps: i.mipmaps,
  59859. }),
  59860. (h += 1),
  59861. 6 === h &&
  59862. (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  59863. (l.format = i.format),
  59864. (l.needsUpdate = !0),
  59865. t && t(l));
  59866. },
  59867. i,
  59868. r
  59869. );
  59870. }
  59871. var a = this,
  59872. s = [],
  59873. l = new n.CompressedTexture();
  59874. l.image = s;
  59875. var c = new n.XHRLoader(this.manager);
  59876. if (
  59877. (c.setPath(this.path),
  59878. c.setResponseType("arraybuffer"),
  59879. Array.isArray(e))
  59880. )
  59881. for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u);
  59882. else
  59883. c.load(
  59884. e,
  59885. function (e) {
  59886. var i = a._parser(e, !0);
  59887. if (i.isCubemap)
  59888. for (
  59889. var r = i.mipmaps.length / i.mipmapCount, o = 0;
  59890. o < r;
  59891. o++
  59892. ) {
  59893. s[o] = {
  59894. mipmaps: [],
  59895. };
  59896. for (var c = 0; c < i.mipmapCount; c++)
  59897. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  59898. (s[o].format = i.format),
  59899. (s[o].width = i.width),
  59900. (s[o].height = i.height);
  59901. }
  59902. else
  59903. (l.image.width = i.width),
  59904. (l.image.height = i.height),
  59905. (l.mipmaps = i.mipmaps);
  59906. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  59907. (l.format = i.format),
  59908. (l.needsUpdate = !0),
  59909. t && t(l);
  59910. },
  59911. i,
  59912. r
  59913. );
  59914. return l;
  59915. },
  59916. setPath: function (e) {
  59917. this.path = e;
  59918. },
  59919. };
  59920. (n.Material = function () {
  59921. Object.defineProperty(this, "id", {
  59922. value: n.MaterialIdCount++,
  59923. }),
  59924. (this.uuid = n.Math.generateUUID()),
  59925. (this.name = ""),
  59926. (this.type = "Material"),
  59927. (this.side = n.FrontSide),
  59928. (this.opacity = 1),
  59929. (this.transparent = !1),
  59930. (this.blending = n.NormalBlending),
  59931. (this.blendSrc = n.SrcAlphaFactor),
  59932. (this.blendDst = n.OneMinusSrcAlphaFactor),
  59933. (this.blendEquation = n.AddEquation),
  59934. (this.blendSrcAlpha = null),
  59935. (this.blendDstAlpha = null),
  59936. (this.blendEquationAlpha = null),
  59937. (this.depthFunc = n.LessEqualDepth),
  59938. (this.depthTest = !0),
  59939. (this.depthWrite = !0),
  59940. (this.colorWrite = !0),
  59941. (this.precision = null),
  59942. (this.polygonOffset = !1),
  59943. (this.polygonOffsetFactor = 0),
  59944. (this.polygonOffsetUnits = 0),
  59945. (this.alphaTest = 0),
  59946. (this.premultipliedAlpha = !1),
  59947. (this.overdraw = 0),
  59948. (this.visible = !0),
  59949. (this._needsUpdate = !0);
  59950. }),
  59951. (n.Material.prototype = {
  59952. constructor: n.Material,
  59953. get needsUpdate() {
  59954. return this._needsUpdate;
  59955. },
  59956. set needsUpdate(e) {
  59957. e === !0 && this.update(), (this._needsUpdate = e);
  59958. },
  59959. setValues: function (e) {
  59960. if (void 0 !== e)
  59961. for (var t in e) {
  59962. var i = e[t];
  59963. if (void 0 !== i) {
  59964. var r = this[t];
  59965. void 0 !== r
  59966. ? r instanceof n.Color
  59967. ? r.set(i)
  59968. : r instanceof n.Vector3 && i instanceof n.Vector3
  59969. ? r.copy(i)
  59970. : "overdraw" === t
  59971. ? (this[t] = Number(i))
  59972. : (this[t] = i)
  59973. : console.warn(
  59974. "THREE." +
  59975. this.type +
  59976. ": '" +
  59977. t +
  59978. "' is not a property of this material."
  59979. );
  59980. } else
  59981. console.warn(
  59982. "THREE.Material: '" + t + "' parameter is undefined."
  59983. );
  59984. }
  59985. },
  59986. toJSON: function (e) {
  59987. function t(e) {
  59988. var t = [];
  59989. for (var i in e) {
  59990. var n = e[i];
  59991. delete n.metadata, t.push(n);
  59992. }
  59993. return t;
  59994. }
  59995. var i = void 0 === e;
  59996. i &&
  59997. (e = {
  59998. textures: {},
  59999. images: {},
  60000. });
  60001. var r = {
  60002. metadata: {
  60003. version: 4.4,
  60004. type: "Material",
  60005. generator: "Material.toJSON",
  60006. },
  60007. };
  60008. if (
  60009. ((r.uuid = this.uuid),
  60010. (r.type = this.type),
  60011. "" !== this.name && (r.name = this.name),
  60012. this.color instanceof n.Color &&
  60013. (r.color = this.color.getHex()),
  60014. 0.5 !== this.roughness && (r.roughness = this.roughness),
  60015. 0.5 !== this.metalness && (r.metalness = this.metalness),
  60016. this.emissive instanceof n.Color &&
  60017. (r.emissive = this.emissive.getHex()),
  60018. this.specular instanceof n.Color &&
  60019. (r.specular = this.specular.getHex()),
  60020. void 0 !== this.shininess && (r.shininess = this.shininess),
  60021. this.map instanceof n.Texture &&
  60022. (r.map = this.map.toJSON(e).uuid),
  60023. this.alphaMap instanceof n.Texture &&
  60024. (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  60025. this.lightMap instanceof n.Texture &&
  60026. (r.lightMap = this.lightMap.toJSON(e).uuid),
  60027. this.bumpMap instanceof n.Texture &&
  60028. ((r.bumpMap = this.bumpMap.toJSON(e).uuid),
  60029. (r.bumpScale = this.bumpScale)),
  60030. this.normalMap instanceof n.Texture &&
  60031. ((r.normalMap = this.normalMap.toJSON(e).uuid),
  60032. (r.normalScale = this.normalScale.toArray())),
  60033. this.displacementMap instanceof n.Texture &&
  60034. ((r.displacementMap = this.displacementMap.toJSON(e).uuid),
  60035. (r.displacementScale = this.displacementScale),
  60036. (r.displacementBias = this.displacementBias)),
  60037. this.roughnessMap instanceof n.Texture &&
  60038. (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  60039. this.metalnessMap instanceof n.Texture &&
  60040. (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  60041. this.emissiveMap instanceof n.Texture &&
  60042. (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  60043. this.specularMap instanceof n.Texture &&
  60044. (r.specularMap = this.specularMap.toJSON(e).uuid),
  60045. this.envMap instanceof n.Texture &&
  60046. ((r.envMap = this.envMap.toJSON(e).uuid),
  60047. (r.reflectivity = this.reflectivity)),
  60048. void 0 !== this.size && (r.size = this.size),
  60049. void 0 !== this.sizeAttenuation &&
  60050. (r.sizeAttenuation = this.sizeAttenuation),
  60051. void 0 !== this.vertexColors &&
  60052. this.vertexColors !== n.NoColors &&
  60053. (r.vertexColors = this.vertexColors),
  60054. void 0 !== this.shading &&
  60055. this.shading !== n.SmoothShading &&
  60056. (r.shading = this.shading),
  60057. void 0 !== this.blending &&
  60058. this.blending !== n.NormalBlending &&
  60059. (r.blending = this.blending),
  60060. void 0 !== this.side &&
  60061. this.side !== n.FrontSide &&
  60062. (r.side = this.side),
  60063. this.opacity < 1 && (r.opacity = this.opacity),
  60064. this.transparent === !0 && (r.transparent = this.transparent),
  60065. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  60066. this.premultipliedAlpha === !0 &&
  60067. (r.premultipliedAlpha = this.premultipliedAlpha),
  60068. this.wireframe === !0 && (r.wireframe = this.wireframe),
  60069. this.wireframeLinewidth > 1 &&
  60070. (r.wireframeLinewidth = this.wireframeLinewidth),
  60071. i)
  60072. ) {
  60073. var o = t(e.textures),
  60074. a = t(e.images);
  60075. o.length > 0 && (r.textures = o),
  60076. a.length > 0 && (r.images = a);
  60077. }
  60078. return r;
  60079. },
  60080. clone: function () {
  60081. return new this.constructor().copy(this);
  60082. },
  60083. copy: function (e) {
  60084. return (
  60085. (this.name = e.name),
  60086. (this.side = e.side),
  60087. (this.opacity = e.opacity),
  60088. (this.transparent = e.transparent),
  60089. (this.blending = e.blending),
  60090. (this.blendSrc = e.blendSrc),
  60091. (this.blendDst = e.blendDst),
  60092. (this.blendEquation = e.blendEquation),
  60093. (this.blendSrcAlpha = e.blendSrcAlpha),
  60094. (this.blendDstAlpha = e.blendDstAlpha),
  60095. (this.blendEquationAlpha = e.blendEquationAlpha),
  60096. (this.depthFunc = e.depthFunc),
  60097. (this.depthTest = e.depthTest),
  60098. (this.depthWrite = e.depthWrite),
  60099. (this.colorWrite = e.colorWrite),
  60100. (this.precision = e.precision),
  60101. (this.polygonOffset = e.polygonOffset),
  60102. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  60103. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  60104. (this.alphaTest = e.alphaTest),
  60105. (this.premultipliedAlpha = e.premultipliedAlpha),
  60106. (this.overdraw = e.overdraw),
  60107. (this.visible = e.visible),
  60108. this
  60109. );
  60110. },
  60111. update: function () {
  60112. this.dispatchEvent({
  60113. type: "update",
  60114. });
  60115. },
  60116. dispose: function () {
  60117. this.dispatchEvent({
  60118. type: "dispose",
  60119. });
  60120. },
  60121. }),
  60122. n.EventDispatcher.prototype.apply(n.Material.prototype),
  60123. (n.MaterialIdCount = 0),
  60124. (n.LineBasicMaterial = function (e) {
  60125. n.Material.call(this),
  60126. (this.type = "LineBasicMaterial"),
  60127. (this.color = new n.Color(16777215)),
  60128. (this.linewidth = 1),
  60129. (this.linecap = "round"),
  60130. (this.linejoin = "round"),
  60131. (this.blending = n.NormalBlending),
  60132. (this.vertexColors = n.NoColors),
  60133. (this.fog = !0),
  60134. this.setValues(e);
  60135. }),
  60136. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  60137. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  60138. (n.LineBasicMaterial.prototype.copy = function (e) {
  60139. return (
  60140. n.Material.prototype.copy.call(this, e),
  60141. this.color.copy(e.color),
  60142. (this.linewidth = e.linewidth),
  60143. (this.linecap = e.linecap),
  60144. (this.linejoin = e.linejoin),
  60145. (this.vertexColors = e.vertexColors),
  60146. (this.fog = e.fog),
  60147. this
  60148. );
  60149. }),
  60150. (n.LineDashedMaterial = function (e) {
  60151. n.Material.call(this),
  60152. (this.type = "LineDashedMaterial"),
  60153. (this.color = new n.Color(16777215)),
  60154. (this.linewidth = 1),
  60155. (this.scale = 1),
  60156. (this.dashSize = 3),
  60157. (this.gapSize = 1),
  60158. (this.blending = n.NormalBlending),
  60159. (this.vertexColors = n.NoColors),
  60160. (this.fog = !0),
  60161. this.setValues(e);
  60162. }),
  60163. (n.LineDashedMaterial.prototype = Object.create(
  60164. n.Material.prototype
  60165. )),
  60166. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  60167. (n.LineDashedMaterial.prototype.copy = function (e) {
  60168. return (
  60169. n.Material.prototype.copy.call(this, e),
  60170. this.color.copy(e.color),
  60171. (this.linewidth = e.linewidth),
  60172. (this.scale = e.scale),
  60173. (this.dashSize = e.dashSize),
  60174. (this.gapSize = e.gapSize),
  60175. (this.vertexColors = e.vertexColors),
  60176. (this.fog = e.fog),
  60177. this
  60178. );
  60179. }),
  60180. (n.MeshBasicMaterial = function (e) {
  60181. n.Material.call(this),
  60182. (this.type = "MeshBasicMaterial"),
  60183. (this.color = new n.Color(16777215)),
  60184. (this.map = null),
  60185. (this.aoMap = null),
  60186. (this.aoMapIntensity = 1),
  60187. (this.specularMap = null),
  60188. (this.alphaMap = null),
  60189. (this.envMap = null),
  60190. (this.combine = n.MultiplyOperation),
  60191. (this.reflectivity = 1),
  60192. (this.refractionRatio = 0.98),
  60193. (this.fog = !0),
  60194. (this.shading = n.SmoothShading),
  60195. (this.blending = n.NormalBlending),
  60196. (this.wireframe = !1),
  60197. (this.wireframeLinewidth = 1),
  60198. (this.wireframeLinecap = "round"),
  60199. (this.wireframeLinejoin = "round"),
  60200. (this.vertexColors = n.NoColors),
  60201. (this.skinning = !1),
  60202. (this.morphTargets = !1),
  60203. this.setValues(e);
  60204. }),
  60205. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  60206. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  60207. (n.MeshBasicMaterial.prototype.copy = function (e) {
  60208. return (
  60209. n.Material.prototype.copy.call(this, e),
  60210. this.color.copy(e.color),
  60211. (this.map = e.map),
  60212. (this.aoMap = e.aoMap),
  60213. (this.aoMapIntensity = e.aoMapIntensity),
  60214. (this.specularMap = e.specularMap),
  60215. (this.alphaMap = e.alphaMap),
  60216. (this.envMap = e.envMap),
  60217. (this.combine = e.combine),
  60218. (this.reflectivity = e.reflectivity),
  60219. (this.refractionRatio = e.refractionRatio),
  60220. (this.fog = e.fog),
  60221. (this.shading = e.shading),
  60222. (this.wireframe = e.wireframe),
  60223. (this.wireframeLinewidth = e.wireframeLinewidth),
  60224. (this.wireframeLinecap = e.wireframeLinecap),
  60225. (this.wireframeLinejoin = e.wireframeLinejoin),
  60226. (this.vertexColors = e.vertexColors),
  60227. (this.skinning = e.skinning),
  60228. (this.morphTargets = e.morphTargets),
  60229. this
  60230. );
  60231. }),
  60232. (n.MeshLambertMaterial = function (e) {
  60233. n.Material.call(this),
  60234. (this.type = "MeshLambertMaterial"),
  60235. (this.color = new n.Color(16777215)),
  60236. (this.map = null),
  60237. (this.lightMap = null),
  60238. (this.lightMapIntensity = 1),
  60239. (this.aoMap = null),
  60240. (this.aoMapIntensity = 1),
  60241. (this.emissive = new n.Color(0)),
  60242. (this.emissiveIntensity = 1),
  60243. (this.emissiveMap = null),
  60244. (this.specularMap = null),
  60245. (this.alphaMap = null),
  60246. (this.envMap = null),
  60247. (this.combine = n.MultiplyOperation),
  60248. (this.reflectivity = 1),
  60249. (this.refractionRatio = 0.98),
  60250. (this.fog = !0),
  60251. (this.blending = n.NormalBlending),
  60252. (this.wireframe = !1),
  60253. (this.wireframeLinewidth = 1),
  60254. (this.wireframeLinecap = "round"),
  60255. (this.wireframeLinejoin = "round"),
  60256. (this.vertexColors = n.NoColors),
  60257. (this.skinning = !1),
  60258. (this.morphTargets = !1),
  60259. (this.morphNormals = !1),
  60260. this.setValues(e);
  60261. }),
  60262. (n.MeshLambertMaterial.prototype = Object.create(
  60263. n.Material.prototype
  60264. )),
  60265. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  60266. (n.MeshLambertMaterial.prototype.copy = function (e) {
  60267. return (
  60268. n.Material.prototype.copy.call(this, e),
  60269. this.color.copy(e.color),
  60270. (this.map = e.map),
  60271. (this.lightMap = e.lightMap),
  60272. (this.lightMapIntensity = e.lightMapIntensity),
  60273. (this.aoMap = e.aoMap),
  60274. (this.aoMapIntensity = e.aoMapIntensity),
  60275. this.emissive.copy(e.emissive),
  60276. (this.emissiveMap = e.emissiveMap),
  60277. (this.emissiveIntensity = e.emissiveIntensity),
  60278. (this.specularMap = e.specularMap),
  60279. (this.alphaMap = e.alphaMap),
  60280. (this.envMap = e.envMap),
  60281. (this.combine = e.combine),
  60282. (this.reflectivity = e.reflectivity),
  60283. (this.refractionRatio = e.refractionRatio),
  60284. (this.fog = e.fog),
  60285. (this.wireframe = e.wireframe),
  60286. (this.wireframeLinewidth = e.wireframeLinewidth),
  60287. (this.wireframeLinecap = e.wireframeLinecap),
  60288. (this.wireframeLinejoin = e.wireframeLinejoin),
  60289. (this.vertexColors = e.vertexColors),
  60290. (this.skinning = e.skinning),
  60291. (this.morphTargets = e.morphTargets),
  60292. (this.morphNormals = e.morphNormals),
  60293. this
  60294. );
  60295. }),
  60296. (n.MeshPhongMaterial = function (e) {
  60297. n.Material.call(this),
  60298. (this.type = "MeshPhongMaterial"),
  60299. (this.color = new n.Color(16777215)),
  60300. (this.specular = new n.Color(1118481)),
  60301. (this.shininess = 30),
  60302. (this.map = null),
  60303. (this.lightMap = null),
  60304. (this.lightMapIntensity = 1),
  60305. (this.aoMap = null),
  60306. (this.aoMapIntensity = 1),
  60307. (this.emissive = new n.Color(0)),
  60308. (this.emissiveIntensity = 1),
  60309. (this.emissiveMap = null),
  60310. (this.bumpMap = null),
  60311. (this.bumpScale = 1),
  60312. (this.normalMap = null),
  60313. (this.normalScale = new n.Vector2(1, 1)),
  60314. (this.displacementMap = null),
  60315. (this.displacementScale = 1),
  60316. (this.displacementBias = 0),
  60317. (this.specularMap = null),
  60318. (this.alphaMap = null),
  60319. (this.envMap = null),
  60320. (this.combine = n.MultiplyOperation),
  60321. (this.reflectivity = 1),
  60322. (this.refractionRatio = 0.98),
  60323. (this.fog = !0),
  60324. (this.shading = n.SmoothShading),
  60325. (this.blending = n.NormalBlending),
  60326. (this.wireframe = !1),
  60327. (this.wireframeLinewidth = 1),
  60328. (this.wireframeLinecap = "round"),
  60329. (this.wireframeLinejoin = "round"),
  60330. (this.vertexColors = n.NoColors),
  60331. (this.skinning = !1),
  60332. (this.morphTargets = !1),
  60333. (this.morphNormals = !1),
  60334. this.setValues(e);
  60335. }),
  60336. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  60337. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  60338. (n.MeshPhongMaterial.prototype.copy = function (e) {
  60339. return (
  60340. n.Material.prototype.copy.call(this, e),
  60341. this.color.copy(e.color),
  60342. this.specular.copy(e.specular),
  60343. (this.shininess = e.shininess),
  60344. (this.map = e.map),
  60345. (this.lightMap = e.lightMap),
  60346. (this.lightMapIntensity = e.lightMapIntensity),
  60347. (this.aoMap = e.aoMap),
  60348. (this.aoMapIntensity = e.aoMapIntensity),
  60349. this.emissive.copy(e.emissive),
  60350. (this.emissiveMap = e.emissiveMap),
  60351. (this.emissiveIntensity = e.emissiveIntensity),
  60352. (this.bumpMap = e.bumpMap),
  60353. (this.bumpScale = e.bumpScale),
  60354. (this.normalMap = e.normalMap),
  60355. this.normalScale.copy(e.normalScale),
  60356. (this.displacementMap = e.displacementMap),
  60357. (this.displacementScale = e.displacementScale),
  60358. (this.displacementBias = e.displacementBias),
  60359. (this.specularMap = e.specularMap),
  60360. (this.alphaMap = e.alphaMap),
  60361. (this.envMap = e.envMap),
  60362. (this.combine = e.combine),
  60363. (this.reflectivity = e.reflectivity),
  60364. (this.refractionRatio = e.refractionRatio),
  60365. (this.fog = e.fog),
  60366. (this.shading = e.shading),
  60367. (this.wireframe = e.wireframe),
  60368. (this.wireframeLinewidth = e.wireframeLinewidth),
  60369. (this.wireframeLinecap = e.wireframeLinecap),
  60370. (this.wireframeLinejoin = e.wireframeLinejoin),
  60371. (this.vertexColors = e.vertexColors),
  60372. (this.skinning = e.skinning),
  60373. (this.morphTargets = e.morphTargets),
  60374. (this.morphNormals = e.morphNormals),
  60375. this
  60376. );
  60377. }),
  60378. (n.MeshStandardMaterial = function (e) {
  60379. n.Material.call(this),
  60380. (this.type = "MeshStandardMaterial"),
  60381. (this.color = new n.Color(16777215)),
  60382. (this.roughness = 0.5),
  60383. (this.metalness = 0.5),
  60384. (this.map = null),
  60385. (this.lightMap = null),
  60386. (this.lightMapIntensity = 1),
  60387. (this.aoMap = null),
  60388. (this.aoMapIntensity = 1),
  60389. (this.emissive = new n.Color(0)),
  60390. (this.emissiveIntensity = 1),
  60391. (this.emissiveMap = null),
  60392. (this.bumpMap = null),
  60393. (this.bumpScale = 1),
  60394. (this.normalMap = null),
  60395. (this.normalScale = new n.Vector2(1, 1)),
  60396. (this.displacementMap = null),
  60397. (this.displacementScale = 1),
  60398. (this.displacementBias = 0),
  60399. (this.roughnessMap = null),
  60400. (this.metalnessMap = null),
  60401. (this.alphaMap = null),
  60402. (this.envMap = null),
  60403. (this.envMapIntensity = 1),
  60404. (this.refractionRatio = 0.98),
  60405. (this.fog = !0),
  60406. (this.shading = n.SmoothShading),
  60407. (this.blending = n.NormalBlending),
  60408. (this.wireframe = !1),
  60409. (this.wireframeLinewidth = 1),
  60410. (this.wireframeLinecap = "round"),
  60411. (this.wireframeLinejoin = "round"),
  60412. (this.vertexColors = n.NoColors),
  60413. (this.skinning = !1),
  60414. (this.morphTargets = !1),
  60415. (this.morphNormals = !1),
  60416. this.setValues(e);
  60417. }),
  60418. (n.MeshStandardMaterial.prototype = Object.create(
  60419. n.Material.prototype
  60420. )),
  60421. (n.MeshStandardMaterial.prototype.constructor =
  60422. n.MeshStandardMaterial),
  60423. (n.MeshStandardMaterial.prototype.copy = function (e) {
  60424. return (
  60425. n.Material.prototype.copy.call(this, e),
  60426. this.color.copy(e.color),
  60427. (this.roughness = e.roughness),
  60428. (this.metalness = e.metalness),
  60429. (this.map = e.map),
  60430. (this.lightMap = e.lightMap),
  60431. (this.lightMapIntensity = e.lightMapIntensity),
  60432. (this.aoMap = e.aoMap),
  60433. (this.aoMapIntensity = e.aoMapIntensity),
  60434. this.emissive.copy(e.emissive),
  60435. (this.emissiveMap = e.emissiveMap),
  60436. (this.emissiveIntensity = e.emissiveIntensity),
  60437. (this.bumpMap = e.bumpMap),
  60438. (this.bumpScale = e.bumpScale),
  60439. (this.normalMap = e.normalMap),
  60440. this.normalScale.copy(e.normalScale),
  60441. (this.displacementMap = e.displacementMap),
  60442. (this.displacementScale = e.displacementScale),
  60443. (this.displacementBias = e.displacementBias),
  60444. (this.roughnessMap = e.roughnessMap),
  60445. (this.metalnessMap = e.metalnessMap),
  60446. (this.alphaMap = e.alphaMap),
  60447. (this.envMap = e.envMap),
  60448. (this.envMapIntensity = e.envMapIntensity),
  60449. (this.refractionRatio = e.refractionRatio),
  60450. (this.fog = e.fog),
  60451. (this.shading = e.shading),
  60452. (this.wireframe = e.wireframe),
  60453. (this.wireframeLinewidth = e.wireframeLinewidth),
  60454. (this.wireframeLinecap = e.wireframeLinecap),
  60455. (this.wireframeLinejoin = e.wireframeLinejoin),
  60456. (this.vertexColors = e.vertexColors),
  60457. (this.skinning = e.skinning),
  60458. (this.morphTargets = e.morphTargets),
  60459. (this.morphNormals = e.morphNormals),
  60460. this
  60461. );
  60462. }),
  60463. (n.MeshDepthMaterial = function (e) {
  60464. n.Material.call(this),
  60465. (this.type = "MeshDepthMaterial"),
  60466. (this.morphTargets = !1),
  60467. (this.wireframe = !1),
  60468. (this.wireframeLinewidth = 1),
  60469. this.setValues(e);
  60470. }),
  60471. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  60472. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  60473. (n.MeshDepthMaterial.prototype.copy = function (e) {
  60474. return (
  60475. n.Material.prototype.copy.call(this, e),
  60476. (this.wireframe = e.wireframe),
  60477. (this.wireframeLinewidth = e.wireframeLinewidth),
  60478. this
  60479. );
  60480. }),
  60481. (n.MeshNormalMaterial = function (e) {
  60482. n.Material.call(this, e),
  60483. (this.type = "MeshNormalMaterial"),
  60484. (this.wireframe = !1),
  60485. (this.wireframeLinewidth = 1),
  60486. (this.morphTargets = !1),
  60487. this.setValues(e);
  60488. }),
  60489. (n.MeshNormalMaterial.prototype = Object.create(
  60490. n.Material.prototype
  60491. )),
  60492. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  60493. (n.MeshNormalMaterial.prototype.copy = function (e) {
  60494. return (
  60495. n.Material.prototype.copy.call(this, e),
  60496. (this.wireframe = e.wireframe),
  60497. (this.wireframeLinewidth = e.wireframeLinewidth),
  60498. this
  60499. );
  60500. }),
  60501. (n.MultiMaterial = function (e) {
  60502. (this.uuid = n.Math.generateUUID()),
  60503. (this.type = "MultiMaterial"),
  60504. (this.materials = e instanceof Array ? e : []),
  60505. (this.visible = !0);
  60506. }),
  60507. (n.MultiMaterial.prototype = {
  60508. constructor: n.MultiMaterial,
  60509. toJSON: function (e) {
  60510. for (
  60511. var t = {
  60512. metadata: {
  60513. version: 4.2,
  60514. type: "material",
  60515. generator: "MaterialExporter",
  60516. },
  60517. uuid: this.uuid,
  60518. type: this.type,
  60519. materials: [],
  60520. },
  60521. i = this.materials,
  60522. n = 0,
  60523. r = i.length;
  60524. n < r;
  60525. n++
  60526. ) {
  60527. var o = i[n].toJSON(e);
  60528. delete o.metadata, t.materials.push(o);
  60529. }
  60530. return (t.visible = this.visible), t;
  60531. },
  60532. clone: function () {
  60533. for (
  60534. var e = new this.constructor(), t = 0;
  60535. t < this.materials.length;
  60536. t++
  60537. )
  60538. e.materials.push(this.materials[t].clone());
  60539. return (e.visible = this.visible), e;
  60540. },
  60541. }),
  60542. (n.PointsMaterial = function (e) {
  60543. n.Material.call(this),
  60544. (this.type = "PointsMaterial"),
  60545. (this.color = new n.Color(16777215)),
  60546. (this.map = null),
  60547. (this.size = 1),
  60548. (this.sizeAttenuation = !0),
  60549. (this.blending = n.NormalBlending),
  60550. (this.vertexColors = n.NoColors),
  60551. (this.fog = !0),
  60552. this.setValues(e);
  60553. }),
  60554. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  60555. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  60556. (n.PointsMaterial.prototype.copy = function (e) {
  60557. return (
  60558. n.Material.prototype.copy.call(this, e),
  60559. this.color.copy(e.color),
  60560. (this.map = e.map),
  60561. (this.size = e.size),
  60562. (this.sizeAttenuation = e.sizeAttenuation),
  60563. (this.vertexColors = e.vertexColors),
  60564. (this.fog = e.fog),
  60565. this
  60566. );
  60567. }),
  60568. (n.ShaderMaterial = function (e) {
  60569. n.Material.call(this),
  60570. (this.type = "ShaderMaterial"),
  60571. (this.defines = {}),
  60572. (this.uniforms = {}),
  60573. (this.vertexShader =
  60574. "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"),
  60575. (this.fragmentShader =
  60576. "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"),
  60577. (this.shading = n.SmoothShading),
  60578. (this.linewidth = 1),
  60579. (this.wireframe = !1),
  60580. (this.wireframeLinewidth = 1),
  60581. (this.fog = !1),
  60582. (this.lights = !1),
  60583. (this.vertexColors = n.NoColors),
  60584. (this.skinning = !1),
  60585. (this.morphTargets = !1),
  60586. (this.morphNormals = !1),
  60587. (this.extensions = {
  60588. derivatives: !1,
  60589. fragDepth: !1,
  60590. drawBuffers: !1,
  60591. shaderTextureLOD: !1,
  60592. }),
  60593. (this.defaultAttributeValues = {
  60594. color: [1, 1, 1],
  60595. uv: [0, 0],
  60596. uv2: [0, 0],
  60597. }),
  60598. (this.index0AttributeName = void 0),
  60599. void 0 !== e &&
  60600. (void 0 !== e.attributes &&
  60601. console.error(
  60602. "THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."
  60603. ),
  60604. this.setValues(e));
  60605. }),
  60606. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  60607. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  60608. (n.ShaderMaterial.prototype.copy = function (e) {
  60609. return (
  60610. n.Material.prototype.copy.call(this, e),
  60611. (this.fragmentShader = e.fragmentShader),
  60612. (this.vertexShader = e.vertexShader),
  60613. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  60614. (this.defines = e.defines),
  60615. (this.shading = e.shading),
  60616. (this.wireframe = e.wireframe),
  60617. (this.wireframeLinewidth = e.wireframeLinewidth),
  60618. (this.fog = e.fog),
  60619. (this.lights = e.lights),
  60620. (this.vertexColors = e.vertexColors),
  60621. (this.skinning = e.skinning),
  60622. (this.morphTargets = e.morphTargets),
  60623. (this.morphNormals = e.morphNormals),
  60624. (this.extensions = e.extensions),
  60625. this
  60626. );
  60627. }),
  60628. (n.ShaderMaterial.prototype.toJSON = function (e) {
  60629. var t = n.Material.prototype.toJSON.call(this, e);
  60630. return (
  60631. (t.uniforms = this.uniforms),
  60632. (t.vertexShader = this.vertexShader),
  60633. (t.fragmentShader = this.fragmentShader),
  60634. t
  60635. );
  60636. }),
  60637. (n.RawShaderMaterial = function (e) {
  60638. n.ShaderMaterial.call(this, e), (this.type = "RawShaderMaterial");
  60639. }),
  60640. (n.RawShaderMaterial.prototype = Object.create(
  60641. n.ShaderMaterial.prototype
  60642. )),
  60643. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  60644. (n.SpriteMaterial = function (e) {
  60645. n.Material.call(this),
  60646. (this.type = "SpriteMaterial"),
  60647. (this.color = new n.Color(16777215)),
  60648. (this.map = null),
  60649. (this.rotation = 0),
  60650. (this.fog = !1),
  60651. this.setValues(e);
  60652. }),
  60653. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  60654. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  60655. (n.SpriteMaterial.prototype.copy = function (e) {
  60656. return (
  60657. n.Material.prototype.copy.call(this, e),
  60658. this.color.copy(e.color),
  60659. (this.map = e.map),
  60660. (this.rotation = e.rotation),
  60661. (this.fog = e.fog),
  60662. this
  60663. );
  60664. }),
  60665. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  60666. Object.defineProperty(this, "id", {
  60667. value: n.TextureIdCount++,
  60668. }),
  60669. (this.uuid = n.Math.generateUUID()),
  60670. (this.name = ""),
  60671. (this.sourceFile = ""),
  60672. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  60673. (this.mipmaps = []),
  60674. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  60675. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  60676. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  60677. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  60678. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  60679. (this.anisotropy = void 0 !== c ? c : 1),
  60680. (this.format = void 0 !== s ? s : n.RGBAFormat),
  60681. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  60682. (this.offset = new n.Vector2(0, 0)),
  60683. (this.repeat = new n.Vector2(1, 1)),
  60684. (this.generateMipmaps = !0),
  60685. (this.premultiplyAlpha = !1),
  60686. (this.flipY = !0),
  60687. (this.unpackAlignment = 4),
  60688. (this.encoding = n.LinearEncoding),
  60689. (this.version = 0),
  60690. (this.onUpdate = null);
  60691. }),
  60692. (n.Texture.DEFAULT_IMAGE = void 0),
  60693. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  60694. (n.Texture.prototype = {
  60695. constructor: n.Texture,
  60696. set needsUpdate(e) {
  60697. e === !0 && this.version++;
  60698. },
  60699. clone: function () {
  60700. return new this.constructor().copy(this);
  60701. },
  60702. copy: function (e) {
  60703. return (
  60704. (this.image = e.image),
  60705. (this.mipmaps = e.mipmaps.slice(0)),
  60706. (this.mapping = e.mapping),
  60707. (this.wrapS = e.wrapS),
  60708. (this.wrapT = e.wrapT),
  60709. (this.magFilter = e.magFilter),
  60710. (this.minFilter = e.minFilter),
  60711. (this.anisotropy = e.anisotropy),
  60712. (this.format = e.format),
  60713. (this.type = e.type),
  60714. this.offset.copy(e.offset),
  60715. this.repeat.copy(e.repeat),
  60716. (this.generateMipmaps = e.generateMipmaps),
  60717. (this.premultiplyAlpha = e.premultiplyAlpha),
  60718. (this.flipY = e.flipY),
  60719. (this.unpackAlignment = e.unpackAlignment),
  60720. (this.encoding = e.encoding),
  60721. this
  60722. );
  60723. },
  60724. toJSON: function (e) {
  60725. function t(e) {
  60726. var t;
  60727. return (
  60728. void 0 !== e.toDataURL
  60729. ? (t = e)
  60730. : ((t = document.createElement("canvas")),
  60731. (t.width = e.width),
  60732. (t.height = e.height),
  60733. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  60734. t.width > 2048 || t.height > 2048
  60735. ? t.toDataURL("image/jpeg", 0.6)
  60736. : t.toDataURL("image/png")
  60737. );
  60738. }
  60739. if (void 0 !== e.textures[this.uuid])
  60740. return e.textures[this.uuid];
  60741. var i = {
  60742. metadata: {
  60743. version: 4.4,
  60744. type: "Texture",
  60745. generator: "Texture.toJSON",
  60746. },
  60747. uuid: this.uuid,
  60748. name: this.name,
  60749. mapping: this.mapping,
  60750. repeat: [this.repeat.x, this.repeat.y],
  60751. offset: [this.offset.x, this.offset.y],
  60752. wrap: [this.wrapS, this.wrapT],
  60753. minFilter: this.minFilter,
  60754. magFilter: this.magFilter,
  60755. anisotropy: this.anisotropy,
  60756. };
  60757. if (void 0 !== this.image) {
  60758. var r = this.image;
  60759. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  60760. void 0 === e.images[r.uuid] &&
  60761. (e.images[r.uuid] = {
  60762. uuid: r.uuid,
  60763. url: t(r),
  60764. }),
  60765. (i.image = r.uuid);
  60766. }
  60767. return (e.textures[this.uuid] = i), i;
  60768. },
  60769. dispose: function () {
  60770. this.dispatchEvent({
  60771. type: "dispose",
  60772. });
  60773. },
  60774. transformUv: function (e) {
  60775. if (this.mapping === n.UVMapping) {
  60776. if (
  60777. (e.multiply(this.repeat),
  60778. e.add(this.offset),
  60779. e.x < 0 || e.x > 1)
  60780. )
  60781. switch (this.wrapS) {
  60782. case n.RepeatWrapping:
  60783. e.x = e.x - Math.floor(e.x);
  60784. break;
  60785. case n.ClampToEdgeWrapping:
  60786. e.x = e.x < 0 ? 0 : 1;
  60787. break;
  60788. case n.MirroredRepeatWrapping:
  60789. 1 === Math.abs(Math.floor(e.x) % 2)
  60790. ? (e.x = Math.ceil(e.x) - e.x)
  60791. : (e.x = e.x - Math.floor(e.x));
  60792. }
  60793. if (e.y < 0 || e.y > 1)
  60794. switch (this.wrapT) {
  60795. case n.RepeatWrapping:
  60796. e.y = e.y - Math.floor(e.y);
  60797. break;
  60798. case n.ClampToEdgeWrapping:
  60799. e.y = e.y < 0 ? 0 : 1;
  60800. break;
  60801. case n.MirroredRepeatWrapping:
  60802. 1 === Math.abs(Math.floor(e.y) % 2)
  60803. ? (e.y = Math.ceil(e.y) - e.y)
  60804. : (e.y = e.y - Math.floor(e.y));
  60805. }
  60806. this.flipY && (e.y = 1 - e.y);
  60807. }
  60808. },
  60809. }),
  60810. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  60811. (n.TextureIdCount = 0),
  60812. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  60813. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  60814. (this.needsUpdate = !0);
  60815. }),
  60816. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  60817. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  60818. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  60819. (e = void 0 !== e ? e : []),
  60820. (t = void 0 !== t ? t : n.CubeReflectionMapping),
  60821. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  60822. (this.flipY = !1);
  60823. }),
  60824. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  60825. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  60826. Object.defineProperty(n.CubeTexture.prototype, "images", {
  60827. get: function () {
  60828. return this.image;
  60829. },
  60830. set: function (e) {
  60831. this.image = e;
  60832. },
  60833. }),
  60834. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  60835. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  60836. (this.image = {
  60837. width: t,
  60838. height: i,
  60839. }),
  60840. (this.mipmaps = e),
  60841. (this.flipY = !1),
  60842. (this.generateMipmaps = !1);
  60843. }),
  60844. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  60845. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  60846. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  60847. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  60848. (this.image = {
  60849. data: e,
  60850. width: t,
  60851. height: i,
  60852. }),
  60853. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  60854. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  60855. (this.flipY = !1),
  60856. (this.generateMipmaps = !1);
  60857. }),
  60858. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  60859. (n.DataTexture.prototype.constructor = n.DataTexture),
  60860. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  60861. function h() {
  60862. requestAnimationFrame(h);
  60863. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  60864. //改 add !e.paused
  60865. u.needsUpdate = !0;
  60866. }
  60867. }
  60868. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  60869. (this.generateMipmaps = !1);
  60870. var u = this;
  60871. h();
  60872. }),
  60873. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  60874. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  60875. (n.Group = function () {
  60876. n.Object3D.call(this), (this.type = "Group");
  60877. }),
  60878. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  60879. (n.Group.prototype.constructor = n.Group),
  60880. (n.Points = function (e, t) {
  60881. n.Object3D.call(this),
  60882. (this.type = "Points"),
  60883. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  60884. (this.material =
  60885. void 0 !== t
  60886. ? t
  60887. : new n.PointsMaterial({
  60888. color: 16777215 * Math.random(),
  60889. }));
  60890. }),
  60891. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  60892. (n.Points.prototype.constructor = n.Points),
  60893. (n.Points.prototype.raycast = (function () {
  60894. var e = new n.Matrix4(),
  60895. t = new n.Ray(),
  60896. i = new n.Sphere();
  60897. return function (r, o) {
  60898. function a(e, i) {
  60899. var n = t.distanceSqToPoint(e);
  60900. if (n < d) {
  60901. var a = t.closestPointToPoint(e);
  60902. a.applyMatrix4(c);
  60903. var l = r.ray.origin.distanceTo(a);
  60904. if (l < r.near || l > r.far) return;
  60905. o.push({
  60906. distance: l,
  60907. distanceToRay: Math.sqrt(n),
  60908. point: a.clone(),
  60909. index: i,
  60910. face: null,
  60911. object: s,
  60912. });
  60913. }
  60914. }
  60915. var s = this,
  60916. l = this.geometry,
  60917. c = this.matrixWorld,
  60918. h = r.params.Points.threshold;
  60919. if (
  60920. (null === l.boundingSphere && l.computeBoundingSphere(),
  60921. i.copy(l.boundingSphere),
  60922. i.applyMatrix4(c),
  60923. r.ray.intersectsSphere(i) !== !1)
  60924. ) {
  60925. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  60926. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  60927. d = u * u,
  60928. p = new n.Vector3();
  60929. if (l instanceof n.BufferGeometry) {
  60930. var f = l.index,
  60931. g = l.attributes,
  60932. m = g.position.array;
  60933. if (null !== f)
  60934. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  60935. var C = v[A];
  60936. p.fromArray(m, 3 * C), a(p, C);
  60937. }
  60938. else
  60939. for (var A = 0, I = m.length / 3; A < I; A++)
  60940. p.fromArray(m, 3 * A), a(p, A);
  60941. } else
  60942. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  60943. a(E[A], A);
  60944. }
  60945. };
  60946. })()),
  60947. (n.Points.prototype.clone = function () {
  60948. return new this.constructor(this.geometry, this.material).copy(
  60949. this
  60950. );
  60951. }),
  60952. (n.Line = function (e, t, i) {
  60953. return 1 === i
  60954. ? (console.warn(
  60955. "THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."
  60956. ),
  60957. new n.LineSegments(e, t))
  60958. : (n.Object3D.call(this),
  60959. (this.type = "Line"),
  60960. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  60961. void (this.material =
  60962. void 0 !== t
  60963. ? t
  60964. : new n.LineBasicMaterial({
  60965. color: 16777215 * Math.random(),
  60966. })));
  60967. }),
  60968. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  60969. (n.Line.prototype.constructor = n.Line),
  60970. (n.Line.prototype.raycast = (function () {
  60971. var e = new n.Matrix4(),
  60972. t = new n.Ray(),
  60973. i = new n.Sphere();
  60974. return function (r, o) {
  60975. var a = r.linePrecision,
  60976. s = a * a,
  60977. l = this.geometry,
  60978. c = this.matrixWorld;
  60979. if (
  60980. (null === l.boundingSphere && l.computeBoundingSphere(),
  60981. i.copy(l.boundingSphere),
  60982. i.applyMatrix4(c),
  60983. r.ray.intersectsSphere(i) !== !1)
  60984. ) {
  60985. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  60986. var h = new n.Vector3(),
  60987. u = new n.Vector3(),
  60988. d = new n.Vector3(),
  60989. p = new n.Vector3(),
  60990. f = this instanceof n.LineSegments ? 2 : 1;
  60991. if (l instanceof n.BufferGeometry) {
  60992. var g = l.index,
  60993. m = l.attributes,
  60994. v = m.position.array;
  60995. if (null !== g)
  60996. for (
  60997. var A = g.array, y = 0, C = A.length - 1;
  60998. y < C;
  60999. y += f
  61000. ) {
  61001. var I = A[y],
  61002. E = A[y + 1];
  61003. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E);
  61004. var b = t.distanceSqToSegment(h, u, p, d);
  61005. if (!(b > s)) {
  61006. p.applyMatrix4(this.matrixWorld);
  61007. var w = r.ray.origin.distanceTo(p);
  61008. w < r.near ||
  61009. w > r.far ||
  61010. o.push({
  61011. distance: w,
  61012. point: d.clone().applyMatrix4(this.matrixWorld),
  61013. index: y,
  61014. face: null,
  61015. faceIndex: null,
  61016. object: this,
  61017. });
  61018. }
  61019. }
  61020. else
  61021. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  61022. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3);
  61023. var b = t.distanceSqToSegment(h, u, p, d);
  61024. if (!(b > s)) {
  61025. p.applyMatrix4(this.matrixWorld);
  61026. var w = r.ray.origin.distanceTo(p);
  61027. w < r.near ||
  61028. w > r.far ||
  61029. o.push({
  61030. distance: w,
  61031. point: d.clone().applyMatrix4(this.matrixWorld),
  61032. index: y,
  61033. face: null,
  61034. faceIndex: null,
  61035. object: this,
  61036. });
  61037. }
  61038. }
  61039. } else if (l instanceof n.Geometry)
  61040. for (
  61041. var _ = l.vertices, T = _.length, y = 0;
  61042. y < T - 1;
  61043. y += f
  61044. ) {
  61045. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  61046. if (!(b > s)) {
  61047. p.applyMatrix4(this.matrixWorld);
  61048. var w = r.ray.origin.distanceTo(p);
  61049. w < r.near ||
  61050. w > r.far ||
  61051. o.push({
  61052. distance: w,
  61053. point: d.clone().applyMatrix4(this.matrixWorld),
  61054. index: y,
  61055. face: null,
  61056. faceIndex: null,
  61057. object: this,
  61058. });
  61059. }
  61060. }
  61061. }
  61062. };
  61063. })()),
  61064. (n.Line.prototype.clone = function () {
  61065. return new this.constructor(this.geometry, this.material).copy(
  61066. this
  61067. );
  61068. }),
  61069. (n.LineStrip = 0),
  61070. (n.LinePieces = 1),
  61071. (n.LineSegments = function (e, t) {
  61072. n.Line.call(this, e, t), (this.type = "LineSegments");
  61073. }),
  61074. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  61075. (n.LineSegments.prototype.constructor = n.LineSegments),
  61076. (n.Mesh = function (e, t) {
  61077. n.Object3D.call(this),
  61078. (this.type = "Mesh"),
  61079. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  61080. (this.material =
  61081. void 0 !== t
  61082. ? t
  61083. : new n.MeshBasicMaterial({
  61084. color: 16777215 * Math.random(),
  61085. })),
  61086. (this.drawMode = n.TrianglesDrawMode),
  61087. this.updateMorphTargets();
  61088. }),
  61089. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  61090. (n.Mesh.prototype.constructor = n.Mesh),
  61091. (n.Mesh.prototype.setDrawMode = function (e) {
  61092. this.drawMode = e;
  61093. }),
  61094. (n.Mesh.prototype.updateMorphTargets = function () {
  61095. if (
  61096. void 0 !== this.geometry.morphTargets &&
  61097. this.geometry.morphTargets.length > 0
  61098. ) {
  61099. (this.morphTargetBase = -1),
  61100. (this.morphTargetInfluences = []),
  61101. (this.morphTargetDictionary = {});
  61102. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  61103. this.morphTargetInfluences.push(0),
  61104. (this.morphTargetDictionary[
  61105. this.geometry.morphTargets[e].name
  61106. ] = e);
  61107. }
  61108. }),
  61109. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  61110. return void 0 !== this.morphTargetDictionary[e]
  61111. ? this.morphTargetDictionary[e]
  61112. : (console.warn(
  61113. "THREE.Mesh.getMorphTargetIndexByName: morph target " +
  61114. e +
  61115. " does not exist. Returning 0."
  61116. ),
  61117. 0);
  61118. }),
  61119. (n.Mesh.prototype.raycast = (function () {
  61120. function e(e, t, i, r, o, a, s) {
  61121. return (
  61122. n.Triangle.barycoordFromPoint(e, t, i, r, m),
  61123. o.multiplyScalar(m.x),
  61124. a.multiplyScalar(m.y),
  61125. s.multiplyScalar(m.z),
  61126. o.add(a).add(s),
  61127. o.clone()
  61128. );
  61129. }
  61130. function t(e, t, i, r, o, a, s) {
  61131. var l,
  61132. c = e.material;
  61133. if (
  61134. ((l =
  61135. c.side === n.BackSide
  61136. ? i.intersectTriangle(a, o, r, !0, s)
  61137. : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)),
  61138. null === l)
  61139. )
  61140. return null;
  61141. A.copy(s), A.applyMatrix4(e.matrixWorld);
  61142. var h = t.ray.origin.distanceTo(A);
  61143. return h < t.near || h > t.far
  61144. ? null
  61145. : {
  61146. distance: h,
  61147. point: A.clone(),
  61148. object: e,
  61149. };
  61150. }
  61151. function i(i, r, o, a, h, u, d, m) {
  61152. s.fromArray(a, 3 * u),
  61153. l.fromArray(a, 3 * d),
  61154. c.fromArray(a, 3 * m);
  61155. var A = t(i, r, o, s, l, c, v);
  61156. return (
  61157. A &&
  61158. (h &&
  61159. (p.fromArray(h, 2 * u),
  61160. f.fromArray(h, 2 * d),
  61161. g.fromArray(h, 2 * m),
  61162. (A.uv = e(v, s, l, c, p, f, g))),
  61163. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  61164. (A.faceIndex = u)),
  61165. A
  61166. );
  61167. }
  61168. var r = new n.Matrix4(),
  61169. o = new n.Ray(),
  61170. a = new n.Sphere(),
  61171. s = new n.Vector3(),
  61172. l = new n.Vector3(),
  61173. c = new n.Vector3(),
  61174. h = new n.Vector3(),
  61175. u = new n.Vector3(),
  61176. d = new n.Vector3(),
  61177. p = new n.Vector2(),
  61178. f = new n.Vector2(),
  61179. g = new n.Vector2(),
  61180. m = new n.Vector3(),
  61181. v = new n.Vector3(),
  61182. A = new n.Vector3();
  61183. return function (m, A) {
  61184. var y = this.geometry,
  61185. C = this.material,
  61186. I = this.matrixWorld;
  61187. if (
  61188. void 0 !== C &&
  61189. (null === y.boundingSphere && y.computeBoundingSphere(),
  61190. a.copy(y.boundingSphere),
  61191. a.applyMatrix4(I),
  61192. m.ray.intersectsSphere(a) !== !1 &&
  61193. (r.getInverse(I),
  61194. o.copy(m.ray).applyMatrix4(r),
  61195. null === y.boundingBox ||
  61196. o.intersectsBox(y.boundingBox) !== !1))
  61197. ) {
  61198. var E, b;
  61199. if (y instanceof n.BufferGeometry) {
  61200. var w,
  61201. _,
  61202. T,
  61203. x = y.index,
  61204. S = y.attributes,
  61205. M = S.position.array;
  61206. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  61207. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  61208. (w = R[P]),
  61209. (_ = R[P + 1]),
  61210. (T = R[P + 2]),
  61211. (b = i(this, m, o, M, E, w, _, T)),
  61212. b && ((b.faceIndex = Math.floor(P / 3)), A.push(b));
  61213. else
  61214. for (var P = 0, O = M.length; P < O; P += 9)
  61215. (w = P / 3),
  61216. (_ = w + 1),
  61217. (T = w + 2),
  61218. (b = i(this, m, o, M, E, w, _, T)),
  61219. b && ((b.index = w), A.push(b));
  61220. } else if (y instanceof n.Geometry) {
  61221. var L,
  61222. D,
  61223. N,
  61224. B = C instanceof n.MultiMaterial,
  61225. F = B === !0 ? C.materials : null,
  61226. V = y.vertices,
  61227. U = y.faces,
  61228. k = y.faceVertexUvs[0];
  61229. k.length > 0 && (E = k);
  61230. for (var H = 0, G = U.length; H < G; H++) {
  61231. var z = U[H],
  61232. W = B === !0 ? F[z.materialIndex] : C;
  61233. if (void 0 !== W) {
  61234. if (
  61235. ((L = V[z.a]),
  61236. (D = V[z.b]),
  61237. (N = V[z.c]),
  61238. W.morphTargets === !0)
  61239. ) {
  61240. var j = y.morphTargets,
  61241. Y = this.morphTargetInfluences;
  61242. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0);
  61243. for (var X = 0, Z = j.length; X < Z; X++) {
  61244. var q = Y[X];
  61245. if (0 !== q) {
  61246. var K = j[X].vertices;
  61247. s.addScaledVector(h.subVectors(K[z.a], L), q),
  61248. l.addScaledVector(u.subVectors(K[z.b], D), q),
  61249. c.addScaledVector(d.subVectors(K[z.c], N), q);
  61250. }
  61251. }
  61252. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c);
  61253. }
  61254. if ((b = t(this, m, o, L, D, N, v))) {
  61255. if (E) {
  61256. var Q = E[H];
  61257. p.copy(Q[0]),
  61258. f.copy(Q[1]),
  61259. g.copy(Q[2]),
  61260. (b.uv = e(v, L, D, N, p, f, g));
  61261. }
  61262. (b.face = z), (b.faceIndex = H), A.push(b);
  61263. }
  61264. }
  61265. }
  61266. }
  61267. }
  61268. };
  61269. })()),
  61270. (n.Mesh.prototype.clone = function () {
  61271. return new this.constructor(this.geometry, this.material).copy(
  61272. this
  61273. );
  61274. }),
  61275. (n.Bone = function (e) {
  61276. n.Object3D.call(this), (this.type = "Bone"), (this.skin = e);
  61277. }),
  61278. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  61279. (n.Bone.prototype.constructor = n.Bone),
  61280. (n.Bone.prototype.copy = function (e) {
  61281. return (
  61282. n.Object3D.prototype.copy.call(this, e),
  61283. (this.skin = e.skin),
  61284. this
  61285. );
  61286. }),
  61287. (n.Skeleton = function (e, t, i) {
  61288. if (
  61289. ((this.useVertexTexture = void 0 === i || i),
  61290. (this.identityMatrix = new n.Matrix4()),
  61291. (e = e || []),
  61292. (this.bones = e.slice(0)),
  61293. this.useVertexTexture)
  61294. ) {
  61295. var r = Math.sqrt(4 * this.bones.length);
  61296. (r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  61297. (r = Math.max(r, 4)),
  61298. (this.boneTextureWidth = r),
  61299. (this.boneTextureHeight = r),
  61300. (this.boneMatrices = new Float32Array(
  61301. this.boneTextureWidth * this.boneTextureHeight * 4
  61302. )),
  61303. (this.boneTexture = new n.DataTexture(
  61304. this.boneMatrices,
  61305. this.boneTextureWidth,
  61306. this.boneTextureHeight,
  61307. n.RGBAFormat,
  61308. n.FloatType
  61309. ));
  61310. } else this.boneMatrices = new Float32Array(16 * this.bones.length);
  61311. if (void 0 === t) this.calculateInverses();
  61312. else if (this.bones.length === t.length)
  61313. this.boneInverses = t.slice(0);
  61314. else {
  61315. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  61316. (this.boneInverses = []);
  61317. for (var o = 0, a = this.bones.length; o < a; o++)
  61318. this.boneInverses.push(new n.Matrix4());
  61319. }
  61320. }),
  61321. (n.Skeleton.prototype.calculateInverses = function () {
  61322. this.boneInverses = [];
  61323. for (var e = 0, t = this.bones.length; e < t; e++) {
  61324. var i = new n.Matrix4();
  61325. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  61326. this.boneInverses.push(i);
  61327. }
  61328. }),
  61329. (n.Skeleton.prototype.pose = function () {
  61330. for (var e, t = 0, i = this.bones.length; t < i; t++)
  61331. (e = this.bones[t]),
  61332. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  61333. for (var t = 0, i = this.bones.length; t < i; t++)
  61334. (e = this.bones[t]),
  61335. e &&
  61336. (e.parent
  61337. ? (e.matrix.getInverse(e.parent.matrixWorld),
  61338. e.matrix.multiply(e.matrixWorld))
  61339. : e.matrix.copy(e.matrixWorld),
  61340. e.matrix.decompose(e.position, e.quaternion, e.scale));
  61341. }),
  61342. (n.Skeleton.prototype.update = (function () {
  61343. var e = new n.Matrix4();
  61344. return function () {
  61345. for (var t = 0, i = this.bones.length; t < i; t++) {
  61346. var n = this.bones[t]
  61347. ? this.bones[t].matrixWorld
  61348. : this.identityMatrix;
  61349. e.multiplyMatrices(n, this.boneInverses[t]),
  61350. e.flattenToArrayOffset(this.boneMatrices, 16 * t);
  61351. }
  61352. this.useVertexTexture && (this.boneTexture.needsUpdate = !0);
  61353. };
  61354. })()),
  61355. (n.Skeleton.prototype.clone = function () {
  61356. return new n.Skeleton(
  61357. this.bones,
  61358. this.boneInverses,
  61359. this.useVertexTexture
  61360. );
  61361. }),
  61362. (n.SkinnedMesh = function (e, t, i) {
  61363. n.Mesh.call(this, e, t),
  61364. (this.type = "SkinnedMesh"),
  61365. (this.bindMode = "attached"),
  61366. (this.bindMatrix = new n.Matrix4()),
  61367. (this.bindMatrixInverse = new n.Matrix4());
  61368. var r = [];
  61369. if (this.geometry && void 0 !== this.geometry.bones) {
  61370. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  61371. (a = this.geometry.bones[s]),
  61372. (o = new n.Bone(this)),
  61373. r.push(o),
  61374. (o.name = a.name),
  61375. o.position.fromArray(a.pos),
  61376. o.quaternion.fromArray(a.rotq),
  61377. void 0 !== a.scl && o.scale.fromArray(a.scl);
  61378. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  61379. (a = this.geometry.bones[s]),
  61380. a.parent !== -1 && null !== a.parent
  61381. ? r[a.parent].add(r[s])
  61382. : this.add(r[s]);
  61383. }
  61384. this.normalizeSkinWeights(),
  61385. this.updateMatrixWorld(!0),
  61386. this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld);
  61387. }),
  61388. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  61389. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  61390. (n.SkinnedMesh.prototype.bind = function (e, t) {
  61391. (this.skeleton = e),
  61392. void 0 === t &&
  61393. (this.updateMatrixWorld(!0),
  61394. this.skeleton.calculateInverses(),
  61395. (t = this.matrixWorld)),
  61396. this.bindMatrix.copy(t),
  61397. this.bindMatrixInverse.getInverse(t);
  61398. }),
  61399. (n.SkinnedMesh.prototype.pose = function () {
  61400. this.skeleton.pose();
  61401. }),
  61402. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  61403. if (this.geometry instanceof n.Geometry)
  61404. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  61405. var t = this.geometry.skinWeights[e],
  61406. i = 1 / t.lengthManhattan();
  61407. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0);
  61408. }
  61409. else if (this.geometry instanceof n.BufferGeometry)
  61410. for (
  61411. var r = new n.Vector4(),
  61412. o = this.geometry.attributes.skinWeight,
  61413. e = 0;
  61414. e < o.count;
  61415. e++
  61416. ) {
  61417. (r.x = o.getX(e)),
  61418. (r.y = o.getY(e)),
  61419. (r.z = o.getZ(e)),
  61420. (r.w = o.getW(e));
  61421. var i = 1 / r.lengthManhattan();
  61422. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  61423. o.setXYZW(e, r.x, r.y, r.z, r.w);
  61424. }
  61425. }),
  61426. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  61427. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  61428. "attached" === this.bindMode
  61429. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  61430. : "detached" === this.bindMode
  61431. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  61432. : console.warn(
  61433. "THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode
  61434. );
  61435. }),
  61436. (n.SkinnedMesh.prototype.clone = function () {
  61437. return new this.constructor(
  61438. this.geometry,
  61439. this.material,
  61440. this.useVertexTexture
  61441. ).copy(this);
  61442. }),
  61443. (n.LOD = function () {
  61444. n.Object3D.call(this),
  61445. (this.type = "LOD"),
  61446. Object.defineProperties(this, {
  61447. levels: {
  61448. enumerable: !0,
  61449. value: [],
  61450. },
  61451. objects: {
  61452. get: function () {
  61453. return (
  61454. console.warn(
  61455. "THREE.LOD: .objects has been renamed to .levels."
  61456. ),
  61457. this.levels
  61458. );
  61459. },
  61460. },
  61461. });
  61462. }),
  61463. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  61464. (n.LOD.prototype.constructor = n.LOD),
  61465. (n.LOD.prototype.addLevel = function (e, t) {
  61466. void 0 === t && (t = 0), (t = Math.abs(t));
  61467. for (
  61468. var i = this.levels, n = 0;
  61469. n < i.length && !(t < i[n].distance);
  61470. n++
  61471. );
  61472. i.splice(n, 0, {
  61473. distance: t,
  61474. object: e,
  61475. }),
  61476. this.add(e);
  61477. }),
  61478. (n.LOD.prototype.getObjectForDistance = function (e) {
  61479. for (
  61480. var t = this.levels, i = 1, n = t.length;
  61481. i < n && !(e < t[i].distance);
  61482. i++
  61483. );
  61484. return t[i - 1].object;
  61485. }),
  61486. (n.LOD.prototype.raycast = (function () {
  61487. var e = new n.Vector3();
  61488. return function (t, i) {
  61489. e.setFromMatrixPosition(this.matrixWorld);
  61490. var n = t.ray.origin.distanceTo(e);
  61491. this.getObjectForDistance(n).raycast(t, i);
  61492. };
  61493. })()),
  61494. (n.LOD.prototype.update = (function () {
  61495. var e = new n.Vector3(),
  61496. t = new n.Vector3();
  61497. return function (i) {
  61498. var n = this.levels;
  61499. if (n.length > 1) {
  61500. e.setFromMatrixPosition(i.matrixWorld),
  61501. t.setFromMatrixPosition(this.matrixWorld);
  61502. var r = e.distanceTo(t);
  61503. n[0].object.visible = !0;
  61504. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  61505. (n[o - 1].object.visible = !1), (n[o].object.visible = !0);
  61506. for (; o < a; o++) n[o].object.visible = !1;
  61507. }
  61508. };
  61509. })()),
  61510. (n.LOD.prototype.copy = function (e) {
  61511. n.Object3D.prototype.copy.call(this, e, !1);
  61512. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  61513. var o = t[i];
  61514. this.addLevel(o.object.clone(), o.distance);
  61515. }
  61516. return this;
  61517. }),
  61518. (n.LOD.prototype.toJSON = function (e) {
  61519. var t = n.Object3D.prototype.toJSON.call(this, e);
  61520. t.object.levels = [];
  61521. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  61522. var a = i[r];
  61523. t.object.levels.push({
  61524. object: a.object.uuid,
  61525. distance: a.distance,
  61526. });
  61527. }
  61528. return t;
  61529. }),
  61530. (n.Sprite = (function () {
  61531. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  61532. t = new Float32Array([
  61533. -0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0,
  61534. ]),
  61535. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  61536. r = new n.BufferGeometry();
  61537. return (
  61538. r.setIndex(new n.BufferAttribute(e, 1)),
  61539. r.addAttribute("position", new n.BufferAttribute(t, 3)),
  61540. r.addAttribute("uv", new n.BufferAttribute(i, 2)),
  61541. function (e) {
  61542. n.Object3D.call(this),
  61543. (this.type = "Sprite"),
  61544. (this.geometry = r),
  61545. (this.material = void 0 !== e ? e : new n.SpriteMaterial());
  61546. }
  61547. );
  61548. })()),
  61549. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  61550. (n.Sprite.prototype.constructor = n.Sprite),
  61551. (n.Sprite.prototype.raycast = (function () {
  61552. var e = new n.Vector3();
  61553. return function (t, i) {
  61554. e.setFromMatrixPosition(this.matrixWorld);
  61555. var n = t.ray.distanceSqToPoint(e),
  61556. r = this.scale.x * this.scale.y;
  61557. n > r ||
  61558. i.push({
  61559. distance: Math.sqrt(n),
  61560. point: this.position,
  61561. face: null,
  61562. object: this,
  61563. });
  61564. };
  61565. })()),
  61566. (n.Sprite.prototype.clone = function () {
  61567. return new this.constructor(this.material).copy(this);
  61568. }),
  61569. (n.Particle = n.Sprite),
  61570. (n.LensFlare = function (e, t, i, r, o) {
  61571. n.Object3D.call(this),
  61572. (this.lensFlares = []),
  61573. (this.positionScreen = new n.Vector3()),
  61574. (this.customUpdateCallback = void 0),
  61575. void 0 !== e && this.add(e, t, i, r, o);
  61576. }),
  61577. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  61578. (n.LensFlare.prototype.constructor = n.LensFlare),
  61579. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  61580. void 0 === t && (t = -1),
  61581. void 0 === i && (i = 0),
  61582. void 0 === a && (a = 1),
  61583. void 0 === o && (o = new n.Color(16777215)),
  61584. void 0 === r && (r = n.NormalBlending),
  61585. (i = Math.min(i, Math.max(0, i))),
  61586. this.lensFlares.push({
  61587. texture: e,
  61588. size: t,
  61589. distance: i,
  61590. x: 0,
  61591. y: 0,
  61592. z: 0,
  61593. scale: 1,
  61594. rotation: 0,
  61595. opacity: a,
  61596. color: o,
  61597. blending: r,
  61598. });
  61599. }),
  61600. (n.LensFlare.prototype.updateLensFlares = function () {
  61601. var e,
  61602. t,
  61603. i = this.lensFlares.length,
  61604. n = 2 * -this.positionScreen.x,
  61605. r = 2 * -this.positionScreen.y;
  61606. for (e = 0; e < i; e++)
  61607. (t = this.lensFlares[e]),
  61608. (t.x = this.positionScreen.x + n * t.distance),
  61609. (t.y = this.positionScreen.y + r * t.distance),
  61610. (t.wantedRotation = t.x * Math.PI * 0.25),
  61611. (t.rotation += 0.25 * (t.wantedRotation - t.rotation));
  61612. }),
  61613. (n.LensFlare.prototype.copy = function (e) {
  61614. n.Object3D.prototype.copy.call(this, e),
  61615. this.positionScreen.copy(e.positionScreen),
  61616. (this.customUpdateCallback = e.customUpdateCallback);
  61617. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  61618. this.lensFlares.push(e.lensFlares[t]);
  61619. return this;
  61620. }),
  61621. (n.Scene = function () {
  61622. n.Object3D.call(this),
  61623. (this.type = "Scene"),
  61624. (this.fog = null),
  61625. (this.overrideMaterial = null),
  61626. (this.autoUpdate = !0);
  61627. }),
  61628. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  61629. (n.Scene.prototype.constructor = n.Scene),
  61630. (n.Scene.prototype.copy = function (e, t) {
  61631. return (
  61632. n.Object3D.prototype.copy.call(this, e, t),
  61633. null !== e.fog && (this.fog = e.fog.clone()),
  61634. null !== e.overrideMaterial &&
  61635. (this.overrideMaterial = e.overrideMaterial.clone()),
  61636. (this.autoUpdate = e.autoUpdate),
  61637. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  61638. this
  61639. );
  61640. }),
  61641. (n.Fog = function (e, t, i) {
  61642. (this.name = ""),
  61643. (this.color = new n.Color(e)),
  61644. (this.near = void 0 !== t ? t : 1),
  61645. (this.far = void 0 !== i ? i : 1e3);
  61646. }),
  61647. (n.Fog.prototype.clone = function () {
  61648. return new n.Fog(this.color.getHex(), this.near, this.far);
  61649. }),
  61650. (n.FogExp2 = function (e, t) {
  61651. (this.name = ""),
  61652. (this.color = new n.Color(e)),
  61653. (this.density = void 0 !== t ? t : 25e-5);
  61654. }),
  61655. (n.FogExp2.prototype.clone = function () {
  61656. return new n.FogExp2(this.color.getHex(), this.density);
  61657. }),
  61658. (n.ShaderChunk = {}),
  61659. (n.ShaderChunk.alphamap_fragment =
  61660. "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n"),
  61661. (n.ShaderChunk.alphamap_pars_fragment =
  61662. "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n"),
  61663. (n.ShaderChunk.alphatest_fragment =
  61664. "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n"),
  61665. (n.ShaderChunk.aomap_fragment =
  61666. "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n"),
  61667. (n.ShaderChunk.aomap_pars_fragment =
  61668. "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"),
  61669. (n.ShaderChunk.begin_vertex =
  61670. "\nvec3 transformed = vec3( position );\n"),
  61671. (n.ShaderChunk.beginnormal_vertex =
  61672. "\nvec3 objectNormal = vec3( normal );\n"),
  61673. (n.ShaderChunk.bsdfs =
  61674. "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n"),
  61675. (n.ShaderChunk.bumpmap_pars_fragment =
  61676. "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n"),
  61677. (n.ShaderChunk.color_fragment =
  61678. "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif"),
  61679. (n.ShaderChunk.color_pars_fragment =
  61680. "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n"),
  61681. (n.ShaderChunk.color_pars_vertex =
  61682. "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif"),
  61683. (n.ShaderChunk.color_vertex =
  61684. "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif"),
  61685. (n.ShaderChunk.common =
  61686. "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n"),
  61687. (n.ShaderChunk.cube_uv_reflection_fragment =
  61688. "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n"),
  61689. (n.ShaderChunk.defaultnormal_vertex =
  61690. "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n"),
  61691. (n.ShaderChunk.displacementmap_vertex =
  61692. "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n"),
  61693. (n.ShaderChunk.displacementmap_pars_vertex =
  61694. "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n"),
  61695. (n.ShaderChunk.emissivemap_fragment =
  61696. "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n"),
  61697. (n.ShaderChunk.emissivemap_pars_fragment =
  61698. "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n"),
  61699. (n.ShaderChunk.encodings_pars_fragment =
  61700. "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n"),
  61701. (n.ShaderChunk.encodings_fragment =
  61702. " gl_FragColor = linearToOutputTexel( gl_FragColor );\n"),
  61703. (n.ShaderChunk.envmap_fragment =
  61704. "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n"),
  61705. (n.ShaderChunk.envmap_pars_fragment =
  61706. "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n"),
  61707. (n.ShaderChunk.envmap_pars_vertex =
  61708. "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n"),
  61709. (n.ShaderChunk.envmap_vertex =
  61710. "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n"),
  61711. (n.ShaderChunk.fog_fragment =
  61712. "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n"),
  61713. (n.ShaderChunk.fog_pars_fragment =
  61714. "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif"),
  61715. (n.ShaderChunk.lightmap_fragment =
  61716. "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n"),
  61717. (n.ShaderChunk.lightmap_pars_fragment =
  61718. "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif"),
  61719. (n.ShaderChunk.lights_lambert_vertex =
  61720. "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n"),
  61721. (n.ShaderChunk.lights_pars =
  61722. "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n"),
  61723. (n.ShaderChunk.lights_phong_fragment =
  61724. "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n"),
  61725. (n.ShaderChunk.lights_phong_pars_fragment =
  61726. "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n"),
  61727. (n.ShaderChunk.lights_phong_pars_vertex =
  61728. "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n"),
  61729. (n.ShaderChunk.lights_phong_vertex =
  61730. "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n"),
  61731. (n.ShaderChunk.lights_standard_fragment =
  61732. "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n"),
  61733. (n.ShaderChunk.lights_standard_pars_fragment =
  61734. "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n"),
  61735. (n.ShaderChunk.lights_template =
  61736. "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n"),
  61737. (n.ShaderChunk.logdepthbuf_fragment =
  61738. "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif"),
  61739. (n.ShaderChunk.logdepthbuf_pars_fragment =
  61740. "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n"),
  61741. (n.ShaderChunk.logdepthbuf_pars_vertex =
  61742. "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif"),
  61743. (n.ShaderChunk.logdepthbuf_vertex =
  61744. "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n"),
  61745. (n.ShaderChunk.map_fragment =
  61746. "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n"),
  61747. (n.ShaderChunk.map_pars_fragment =
  61748. "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n"),
  61749. (n.ShaderChunk.map_particle_fragment =
  61750. "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n"),
  61751. (n.ShaderChunk.map_particle_pars_fragment =
  61752. "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n"),
  61753. (n.ShaderChunk.metalnessmap_fragment =
  61754. "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n"),
  61755. (n.ShaderChunk.metalnessmap_pars_fragment =
  61756. "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif"),
  61757. (n.ShaderChunk.morphnormal_vertex =
  61758. "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n"),
  61759. (n.ShaderChunk.morphtarget_pars_vertex =
  61760. "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif");
  61761. n.ShaderChunk.morphtarget_vertex =
  61762. "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
  61763. (n.ShaderChunk.normal_fragment =
  61764. "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n"),
  61765. (n.ShaderChunk.normalmap_pars_fragment =
  61766. "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n"),
  61767. (n.ShaderChunk.premultiplied_alpha_fragment =
  61768. "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n"),
  61769. (n.ShaderChunk.project_vertex =
  61770. "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n"),
  61771. (n.ShaderChunk.roughnessmap_fragment =
  61772. "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n"),
  61773. (n.ShaderChunk.roughnessmap_pars_fragment =
  61774. "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif"),
  61775. (n.ShaderChunk.shadowmap_pars_fragment =
  61776. "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n"),
  61777. (n.ShaderChunk.shadowmap_pars_vertex =
  61778. "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n"),
  61779. (n.ShaderChunk.shadowmap_vertex =
  61780. "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n"),
  61781. (n.ShaderChunk.shadowmask_pars_fragment =
  61782. "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n"),
  61783. (n.ShaderChunk.skinbase_vertex =
  61784. "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif"),
  61785. (n.ShaderChunk.skinning_pars_vertex =
  61786. "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n"),
  61787. (n.ShaderChunk.skinning_vertex =
  61788. "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n"),
  61789. (n.ShaderChunk.skinnormal_vertex =
  61790. "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n"),
  61791. (n.ShaderChunk.specularmap_fragment =
  61792. "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif"),
  61793. (n.ShaderChunk.specularmap_pars_fragment =
  61794. "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif"),
  61795. (n.ShaderChunk.tonemapping_fragment =
  61796. "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n"),
  61797. (n.ShaderChunk.tonemapping_pars_fragment =
  61798. "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n"),
  61799. (n.ShaderChunk.uv2_pars_fragment =
  61800. "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif"),
  61801. (n.ShaderChunk.uv2_pars_vertex =
  61802. "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif"),
  61803. (n.ShaderChunk.uv2_vertex =
  61804. "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif"),
  61805. (n.ShaderChunk.uv_pars_fragment =
  61806. "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif"),
  61807. (n.ShaderChunk.uv_pars_vertex =
  61808. "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n"),
  61809. (n.ShaderChunk.uv_vertex =
  61810. "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif"),
  61811. (n.ShaderChunk.worldpos_vertex =
  61812. "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n"),
  61813. (n.UniformsUtils = {
  61814. merge: function (e) {
  61815. for (var t = {}, i = 0; i < e.length; i++) {
  61816. var n = this.clone(e[i]);
  61817. for (var r in n) t[r] = n[r];
  61818. }
  61819. return t;
  61820. },
  61821. clone: function (e) {
  61822. var t = {};
  61823. for (var i in e) {
  61824. t[i] = {};
  61825. for (var r in e[i]) {
  61826. var o = e[i][r];
  61827. o instanceof n.Color ||
  61828. o instanceof n.Vector2 ||
  61829. o instanceof n.Vector3 ||
  61830. o instanceof n.Vector4 ||
  61831. o instanceof n.Matrix3 ||
  61832. o instanceof n.Matrix4 ||
  61833. o instanceof n.Texture
  61834. ? (t[i][r] = o.clone())
  61835. : Array.isArray(o)
  61836. ? (t[i][r] = o.slice())
  61837. : (t[i][r] = o);
  61838. }
  61839. }
  61840. return t;
  61841. },
  61842. }),
  61843. (n.UniformsLib = {
  61844. common: {
  61845. diffuse: {
  61846. type: "c",
  61847. value: new n.Color(15658734),
  61848. },
  61849. opacity: {
  61850. type: "f",
  61851. value: 1,
  61852. },
  61853. map: {
  61854. type: "t",
  61855. value: null,
  61856. },
  61857. offsetRepeat: {
  61858. type: "v4",
  61859. value: new n.Vector4(0, 0, 1, 1),
  61860. },
  61861. specularMap: {
  61862. type: "t",
  61863. value: null,
  61864. },
  61865. alphaMap: {
  61866. type: "t",
  61867. value: null,
  61868. },
  61869. envMap: {
  61870. type: "t",
  61871. value: null,
  61872. },
  61873. flipEnvMap: {
  61874. type: "f",
  61875. value: -1,
  61876. },
  61877. reflectivity: {
  61878. type: "f",
  61879. value: 1,
  61880. },
  61881. refractionRatio: {
  61882. type: "f",
  61883. value: 0.98,
  61884. },
  61885. },
  61886. aomap: {
  61887. aoMap: {
  61888. type: "t",
  61889. value: null,
  61890. },
  61891. aoMapIntensity: {
  61892. type: "f",
  61893. value: 1,
  61894. },
  61895. },
  61896. lightmap: {
  61897. lightMap: {
  61898. type: "t",
  61899. value: null,
  61900. },
  61901. lightMapIntensity: {
  61902. type: "f",
  61903. value: 1,
  61904. },
  61905. },
  61906. emissivemap: {
  61907. emissiveMap: {
  61908. type: "t",
  61909. value: null,
  61910. },
  61911. },
  61912. bumpmap: {
  61913. bumpMap: {
  61914. type: "t",
  61915. value: null,
  61916. },
  61917. bumpScale: {
  61918. type: "f",
  61919. value: 1,
  61920. },
  61921. },
  61922. normalmap: {
  61923. normalMap: {
  61924. type: "t",
  61925. value: null,
  61926. },
  61927. normalScale: {
  61928. type: "v2",
  61929. value: new n.Vector2(1, 1),
  61930. },
  61931. },
  61932. displacementmap: {
  61933. displacementMap: {
  61934. type: "t",
  61935. value: null,
  61936. },
  61937. displacementScale: {
  61938. type: "f",
  61939. value: 1,
  61940. },
  61941. displacementBias: {
  61942. type: "f",
  61943. value: 0,
  61944. },
  61945. },
  61946. roughnessmap: {
  61947. roughnessMap: {
  61948. type: "t",
  61949. value: null,
  61950. },
  61951. },
  61952. metalnessmap: {
  61953. metalnessMap: {
  61954. type: "t",
  61955. value: null,
  61956. },
  61957. },
  61958. fog: {
  61959. fogDensity: {
  61960. type: "f",
  61961. value: 25e-5,
  61962. },
  61963. fogNear: {
  61964. type: "f",
  61965. value: 1,
  61966. },
  61967. fogFar: {
  61968. type: "f",
  61969. value: 2e3,
  61970. },
  61971. fogColor: {
  61972. type: "c",
  61973. value: new n.Color(16777215),
  61974. },
  61975. },
  61976. lights: {
  61977. ambientLightColor: {
  61978. type: "fv",
  61979. value: [],
  61980. },
  61981. directionalLights: {
  61982. type: "sa",
  61983. value: [],
  61984. properties: {
  61985. direction: {
  61986. type: "v3",
  61987. },
  61988. color: {
  61989. type: "c",
  61990. },
  61991. shadow: {
  61992. type: "i",
  61993. },
  61994. shadowBias: {
  61995. type: "f",
  61996. },
  61997. shadowRadius: {
  61998. type: "f",
  61999. },
  62000. shadowMapSize: {
  62001. type: "v2",
  62002. },
  62003. },
  62004. },
  62005. directionalShadowMap: {
  62006. type: "tv",
  62007. value: [],
  62008. },
  62009. directionalShadowMatrix: {
  62010. type: "m4v",
  62011. value: [],
  62012. },
  62013. spotLights: {
  62014. type: "sa",
  62015. value: [],
  62016. properties: {
  62017. color: {
  62018. type: "c",
  62019. },
  62020. position: {
  62021. type: "v3",
  62022. },
  62023. direction: {
  62024. type: "v3",
  62025. },
  62026. distance: {
  62027. type: "f",
  62028. },
  62029. coneCos: {
  62030. type: "f",
  62031. },
  62032. penumbraCos: {
  62033. type: "f",
  62034. },
  62035. decay: {
  62036. type: "f",
  62037. },
  62038. shadow: {
  62039. type: "i",
  62040. },
  62041. shadowBias: {
  62042. type: "f",
  62043. },
  62044. shadowRadius: {
  62045. type: "f",
  62046. },
  62047. shadowMapSize: {
  62048. type: "v2",
  62049. },
  62050. },
  62051. },
  62052. spotShadowMap: {
  62053. type: "tv",
  62054. value: [],
  62055. },
  62056. spotShadowMatrix: {
  62057. type: "m4v",
  62058. value: [],
  62059. },
  62060. pointLights: {
  62061. type: "sa",
  62062. value: [],
  62063. properties: {
  62064. color: {
  62065. type: "c",
  62066. },
  62067. position: {
  62068. type: "v3",
  62069. },
  62070. decay: {
  62071. type: "f",
  62072. },
  62073. distance: {
  62074. type: "f",
  62075. },
  62076. shadow: {
  62077. type: "i",
  62078. },
  62079. shadowBias: {
  62080. type: "f",
  62081. },
  62082. shadowRadius: {
  62083. type: "f",
  62084. },
  62085. shadowMapSize: {
  62086. type: "v2",
  62087. },
  62088. },
  62089. },
  62090. pointShadowMap: {
  62091. type: "tv",
  62092. value: [],
  62093. },
  62094. pointShadowMatrix: {
  62095. type: "m4v",
  62096. value: [],
  62097. },
  62098. hemisphereLights: {
  62099. type: "sa",
  62100. value: [],
  62101. properties: {
  62102. direction: {
  62103. type: "v3",
  62104. },
  62105. skyColor: {
  62106. type: "c",
  62107. },
  62108. groundColor: {
  62109. type: "c",
  62110. },
  62111. },
  62112. },
  62113. },
  62114. points: {
  62115. diffuse: {
  62116. type: "c",
  62117. value: new n.Color(15658734),
  62118. },
  62119. opacity: {
  62120. type: "f",
  62121. value: 1,
  62122. },
  62123. size: {
  62124. type: "f",
  62125. value: 1,
  62126. },
  62127. scale: {
  62128. type: "f",
  62129. value: 1,
  62130. },
  62131. map: {
  62132. type: "t",
  62133. value: null,
  62134. },
  62135. offsetRepeat: {
  62136. type: "v4",
  62137. value: new n.Vector4(0, 0, 1, 1),
  62138. },
  62139. },
  62140. }),
  62141. (n.ShaderChunk.cube_frag =
  62142. "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n"),
  62143. (n.ShaderChunk.cube_vert =
  62144. "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n"),
  62145. (n.ShaderChunk.depth_frag =
  62146. "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n"),
  62147. (n.ShaderChunk.depth_vert =
  62148. "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n"),
  62149. (n.ShaderChunk.depthRGBA_frag =
  62150. "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n"),
  62151. (n.ShaderChunk.depthRGBA_vert =
  62152. "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n"),
  62153. (n.ShaderChunk.distanceRGBA_frag =
  62154. "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n"),
  62155. (n.ShaderChunk.distanceRGBA_vert =
  62156. "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n"),
  62157. (n.ShaderChunk.equirect_frag =
  62158. "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n"),
  62159. (n.ShaderChunk.equirect_vert =
  62160. "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n"),
  62161. (n.ShaderChunk.linedashed_frag =
  62162. "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n"),
  62163. (n.ShaderChunk.linedashed_vert =
  62164. "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n"),
  62165. (n.ShaderChunk.meshbasic_frag =
  62166. "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n"),
  62167. (n.ShaderChunk.meshbasic_vert =
  62168. "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n"),
  62169. (n.ShaderChunk.meshlambert_frag =
  62170. "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n"),
  62171. (n.ShaderChunk.meshlambert_vert =
  62172. "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n"),
  62173. (n.ShaderChunk.meshphong_frag =
  62174. "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n"),
  62175. (n.ShaderChunk.meshphong_vert =
  62176. "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n"),
  62177. (n.ShaderChunk.meshstandard_frag =
  62178. "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n"),
  62179. (n.ShaderChunk.meshstandard_vert =
  62180. "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n"),
  62181. (n.ShaderChunk.normal_frag =
  62182. "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n"),
  62183. (n.ShaderChunk.normal_vert =
  62184. "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n"),
  62185. (n.ShaderChunk.points_frag =
  62186. "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n"),
  62187. (n.ShaderChunk.points_vert =
  62188. "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n"),
  62189. (n.ShaderLib = {
  62190. basic: {
  62191. uniforms: n.UniformsUtils.merge([
  62192. n.UniformsLib.common,
  62193. n.UniformsLib.aomap,
  62194. n.UniformsLib.fog,
  62195. ]),
  62196. vertexShader: n.ShaderChunk.meshbasic_vert,
  62197. fragmentShader: n.ShaderChunk.meshbasic_frag,
  62198. },
  62199. lambert: {
  62200. uniforms: n.UniformsUtils.merge([
  62201. n.UniformsLib.common,
  62202. n.UniformsLib.aomap,
  62203. n.UniformsLib.lightmap,
  62204. n.UniformsLib.emissivemap,
  62205. n.UniformsLib.fog,
  62206. n.UniformsLib.lights,
  62207. {
  62208. emissive: {
  62209. type: "c",
  62210. value: new n.Color(0),
  62211. },
  62212. },
  62213. ]),
  62214. vertexShader: n.ShaderChunk.meshlambert_vert,
  62215. fragmentShader: n.ShaderChunk.meshlambert_frag,
  62216. },
  62217. phong: {
  62218. uniforms: n.UniformsUtils.merge([
  62219. n.UniformsLib.common,
  62220. n.UniformsLib.aomap,
  62221. n.UniformsLib.lightmap,
  62222. n.UniformsLib.emissivemap,
  62223. n.UniformsLib.bumpmap,
  62224. n.UniformsLib.normalmap,
  62225. n.UniformsLib.displacementmap,
  62226. n.UniformsLib.fog,
  62227. n.UniformsLib.lights,
  62228. {
  62229. emissive: {
  62230. type: "c",
  62231. value: new n.Color(0),
  62232. },
  62233. specular: {
  62234. type: "c",
  62235. value: new n.Color(1118481),
  62236. },
  62237. shininess: {
  62238. type: "f",
  62239. value: 30,
  62240. },
  62241. },
  62242. ]),
  62243. vertexShader: n.ShaderChunk.meshphong_vert,
  62244. fragmentShader: n.ShaderChunk.meshphong_frag,
  62245. },
  62246. standard: {
  62247. uniforms: n.UniformsUtils.merge([
  62248. n.UniformsLib.common,
  62249. n.UniformsLib.aomap,
  62250. n.UniformsLib.lightmap,
  62251. n.UniformsLib.emissivemap,
  62252. n.UniformsLib.bumpmap,
  62253. n.UniformsLib.normalmap,
  62254. n.UniformsLib.displacementmap,
  62255. n.UniformsLib.roughnessmap,
  62256. n.UniformsLib.metalnessmap,
  62257. n.UniformsLib.fog,
  62258. n.UniformsLib.lights,
  62259. {
  62260. emissive: {
  62261. type: "c",
  62262. value: new n.Color(0),
  62263. },
  62264. roughness: {
  62265. type: "f",
  62266. value: 0.5,
  62267. },
  62268. metalness: {
  62269. type: "f",
  62270. value: 0,
  62271. },
  62272. envMapIntensity: {
  62273. type: "f",
  62274. value: 1,
  62275. },
  62276. },
  62277. ]),
  62278. vertexShader: n.ShaderChunk.meshstandard_vert,
  62279. fragmentShader: n.ShaderChunk.meshstandard_frag,
  62280. },
  62281. points: {
  62282. uniforms: n.UniformsUtils.merge([
  62283. n.UniformsLib.points,
  62284. n.UniformsLib.fog,
  62285. ]),
  62286. vertexShader: n.ShaderChunk.points_vert,
  62287. fragmentShader: n.ShaderChunk.points_frag,
  62288. },
  62289. dashed: {
  62290. uniforms: n.UniformsUtils.merge([
  62291. n.UniformsLib.common,
  62292. n.UniformsLib.fog,
  62293. {
  62294. scale: {
  62295. type: "f",
  62296. value: 1,
  62297. },
  62298. dashSize: {
  62299. type: "f",
  62300. value: 1,
  62301. },
  62302. totalSize: {
  62303. type: "f",
  62304. value: 2,
  62305. },
  62306. },
  62307. ]),
  62308. vertexShader: n.ShaderChunk.linedashed_vert,
  62309. fragmentShader: n.ShaderChunk.linedashed_frag,
  62310. },
  62311. depth: {
  62312. uniforms: {
  62313. mNear: {
  62314. type: "f",
  62315. value: 1,
  62316. },
  62317. mFar: {
  62318. type: "f",
  62319. value: 2e3,
  62320. },
  62321. opacity: {
  62322. type: "f",
  62323. value: 1,
  62324. },
  62325. },
  62326. vertexShader: n.ShaderChunk.depth_vert,
  62327. fragmentShader: n.ShaderChunk.depth_frag,
  62328. },
  62329. normal: {
  62330. uniforms: {
  62331. opacity: {
  62332. type: "f",
  62333. value: 1,
  62334. },
  62335. },
  62336. vertexShader: n.ShaderChunk.normal_vert,
  62337. fragmentShader: n.ShaderChunk.normal_frag,
  62338. },
  62339. cube: {
  62340. uniforms: {
  62341. tCube: {
  62342. type: "t",
  62343. value: null,
  62344. },
  62345. tFlip: {
  62346. type: "f",
  62347. value: -1,
  62348. },
  62349. },
  62350. vertexShader: n.ShaderChunk.cube_vert,
  62351. fragmentShader: n.ShaderChunk.cube_frag,
  62352. },
  62353. equirect: {
  62354. uniforms: {
  62355. tEquirect: {
  62356. type: "t",
  62357. value: null,
  62358. },
  62359. tFlip: {
  62360. type: "f",
  62361. value: -1,
  62362. },
  62363. },
  62364. vertexShader: n.ShaderChunk.equirect_vert,
  62365. fragmentShader: n.ShaderChunk.equirect_frag,
  62366. },
  62367. depthRGBA: {
  62368. uniforms: {},
  62369. vertexShader: n.ShaderChunk.depthRGBA_vert,
  62370. fragmentShader: n.ShaderChunk.depthRGBA_frag,
  62371. },
  62372. distanceRGBA: {
  62373. uniforms: {
  62374. lightPos: {
  62375. type: "v3",
  62376. value: new n.Vector3(0, 0, 0),
  62377. },
  62378. },
  62379. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  62380. fragmentShader: n.ShaderChunk.distanceRGBA_frag,
  62381. },
  62382. }),
  62383. (n.WebGLRenderer = function (e) {
  62384. function t() {
  62385. return null === ye ? Oe : 1;
  62386. }
  62387. function i(e, t, i, n) {
  62388. se === !0 && ((e *= n), (t *= n), (i *= n)),
  62389. Ye.clearColor(e, t, i, n);
  62390. }
  62391. function r() {
  62392. Ye.init(),
  62393. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  62394. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  62395. i(Se.r, Se.g, Se.b, Me);
  62396. }
  62397. function o() {
  62398. (Ae = null), (be = null), (Ee = ""), (Ie = -1), Ye.reset();
  62399. }
  62400. function a(e) {
  62401. e.preventDefault(), o(), r(), Xe.clear();
  62402. }
  62403. function s(e) {
  62404. var t = e.target;
  62405. t.removeEventListener("dispose", s), h(t), ke.textures--;
  62406. }
  62407. function l(e) {
  62408. var t = e.target;
  62409. t.removeEventListener("dispose", l), u(t), ke.textures--;
  62410. }
  62411. function c(e) {
  62412. var t = e.target;
  62413. t.removeEventListener("dispose", c), d(t);
  62414. }
  62415. function h(e) {
  62416. var t = Xe.get(e);
  62417. if (e.image && t.__image__webglTextureCube)
  62418. Ge.deleteTexture(t.__image__webglTextureCube);
  62419. else {
  62420. if (void 0 === t.__webglInit) return;
  62421. Ge.deleteTexture(t.__webglTexture);
  62422. }
  62423. Xe.delete(e);
  62424. }
  62425. function u(e) {
  62426. var t = Xe.get(e),
  62427. i = Xe.get(e.texture);
  62428. if (e && void 0 !== i.__webglTexture) {
  62429. if (
  62430. (Ge.deleteTexture(i.__webglTexture),
  62431. e instanceof n.WebGLRenderTargetCube)
  62432. )
  62433. for (var r = 0; r < 6; r++)
  62434. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  62435. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  62436. else
  62437. Ge.deleteFramebuffer(t.__webglFramebuffer),
  62438. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  62439. Xe.delete(e.texture), Xe.delete(e);
  62440. }
  62441. }
  62442. function d(e) {
  62443. p(e), Xe.delete(e);
  62444. }
  62445. function p(e) {
  62446. var t = Xe.get(e).program;
  62447. (e.program = void 0), void 0 !== t && qe.releaseProgram(t);
  62448. }
  62449. function f(e, t, i, r) {
  62450. var o;
  62451. if (
  62452. i instanceof n.InstancedBufferGeometry &&
  62453. ((o = We.get("ANGLE_instanced_arrays")), null === o)
  62454. )
  62455. return void console.error(
  62456. "THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."
  62457. );
  62458. void 0 === r && (r = 0), Ye.initAttributes();
  62459. var a = i.attributes,
  62460. s = t.getAttributes(),
  62461. l = e.defaultAttributeValues;
  62462. for (var c in s) {
  62463. var h = s[c];
  62464. if (h >= 0) {
  62465. var u = a[c];
  62466. if (void 0 !== u) {
  62467. var d = u.itemSize,
  62468. p = Ze.getAttributeBuffer(u);
  62469. if (u instanceof n.InterleavedBufferAttribute) {
  62470. var f = u.data,
  62471. g = f.stride,
  62472. m = u.offset;
  62473. f instanceof n.InstancedInterleavedBuffer
  62474. ? (Ye.enableAttributeAndDivisor(
  62475. h,
  62476. f.meshPerAttribute,
  62477. o
  62478. ),
  62479. void 0 === i.maxInstancedCount &&
  62480. (i.maxInstancedCount =
  62481. f.meshPerAttribute * f.count))
  62482. : Ye.enableAttribute(h),
  62483. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  62484. Ge.vertexAttribPointer(
  62485. h,
  62486. d,
  62487. Ge.FLOAT,
  62488. !1,
  62489. g * f.array.BYTES_PER_ELEMENT,
  62490. (r * g + m) * f.array.BYTES_PER_ELEMENT
  62491. );
  62492. } else
  62493. u instanceof n.InstancedBufferAttribute
  62494. ? (Ye.enableAttributeAndDivisor(
  62495. h,
  62496. u.meshPerAttribute,
  62497. o
  62498. ),
  62499. void 0 === i.maxInstancedCount &&
  62500. (i.maxInstancedCount =
  62501. u.meshPerAttribute * u.count))
  62502. : Ye.enableAttribute(h),
  62503. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  62504. Ge.vertexAttribPointer(
  62505. h,
  62506. d,
  62507. Ge.FLOAT,
  62508. !1,
  62509. 0,
  62510. r * d * 4
  62511. );
  62512. } else if (void 0 !== l) {
  62513. var v = l[c];
  62514. if (void 0 !== v)
  62515. switch (v.length) {
  62516. case 2:
  62517. Ge.vertexAttrib2fv(h, v);
  62518. break;
  62519. case 3:
  62520. Ge.vertexAttrib3fv(h, v);
  62521. break;
  62522. case 4:
  62523. Ge.vertexAttrib4fv(h, v);
  62524. break;
  62525. default:
  62526. Ge.vertexAttrib1fv(h, v);
  62527. }
  62528. }
  62529. }
  62530. }
  62531. Ye.disableUnusedAttributes();
  62532. }
  62533. function g(e, t) {
  62534. return Math.abs(t[0]) - Math.abs(e[0]);
  62535. }
  62536. function m(e, t) {
  62537. return e.object.renderOrder !== t.object.renderOrder
  62538. ? e.object.renderOrder - t.object.renderOrder
  62539. : e.material.id !== t.material.id
  62540. ? e.material.id - t.material.id
  62541. : e.z !== t.z
  62542. ? e.z - t.z
  62543. : e.id - t.id;
  62544. }
  62545. function v(e, t) {
  62546. return e.object.renderOrder !== t.object.renderOrder
  62547. ? e.object.renderOrder - t.object.renderOrder
  62548. : e.z !== t.z
  62549. ? t.z - e.z
  62550. : e.id - t.id;
  62551. }
  62552. function A(e, t, i, n, r) {
  62553. var o, a;
  62554. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue));
  62555. var s = o[a];
  62556. void 0 !== s
  62557. ? ((s.id = e.id),
  62558. (s.object = e),
  62559. (s.geometry = t),
  62560. (s.material = i),
  62561. (s.z = Ve.z),
  62562. (s.group = r))
  62563. : ((s = {
  62564. id: e.id,
  62565. object: e,
  62566. geometry: t,
  62567. material: i,
  62568. z: Ve.z,
  62569. group: r,
  62570. }),
  62571. o.push(s));
  62572. }
  62573. function y(e, t) {
  62574. if (e.visible !== !1) {
  62575. if (e.layers.test(t.layers))
  62576. if (e instanceof n.Light) ce.push(e);
  62577. else if (e instanceof n.Sprite)
  62578. (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) ||
  62579. ge.push(e);
  62580. else if (e instanceof n.LensFlare) me.push(e);
  62581. else if (e instanceof n.ImmediateRenderObject)
  62582. ve.sortObjects === !0 &&
  62583. (Ve.setFromMatrixPosition(e.matrixWorld),
  62584. Ve.applyProjection(Fe)),
  62585. A(e, null, e.material, Ve.z, null);
  62586. else if (
  62587. (e instanceof n.Mesh ||
  62588. e instanceof n.Line ||
  62589. e instanceof n.Points) &&
  62590. (e instanceof n.SkinnedMesh && e.skeleton.update(),
  62591. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  62592. ) {
  62593. var i = e.material;
  62594. if (i.visible === !0) {
  62595. ve.sortObjects === !0 &&
  62596. (Ve.setFromMatrixPosition(e.matrixWorld),
  62597. Ve.applyProjection(Fe));
  62598. var r = Ze.update(e);
  62599. if (i instanceof n.MultiMaterial)
  62600. for (
  62601. var o = r.groups,
  62602. a = i.materials,
  62603. s = 0,
  62604. l = o.length;
  62605. s < l;
  62606. s++
  62607. ) {
  62608. var c = o[s],
  62609. h = a[c.materialIndex];
  62610. h.visible === !0 && A(e, r, h, Ve.z, c);
  62611. }
  62612. else A(e, r, i, Ve.z, null);
  62613. }
  62614. }
  62615. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  62616. y(u[s], t);
  62617. }
  62618. }
  62619. function C(e, t, i, r) {
  62620. for (var o = 0, a = e.length; o < a; o++) {
  62621. var s = e[o],
  62622. l = s.object,
  62623. c = s.geometry,
  62624. h = void 0 === r ? s.material : r,
  62625. u = s.group;
  62626. if (
  62627. (l.modelViewMatrix.multiplyMatrices(
  62628. t.matrixWorldInverse,
  62629. l.matrixWorld
  62630. ),
  62631. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  62632. l instanceof n.ImmediateRenderObject)
  62633. ) {
  62634. E(h);
  62635. var d = w(t, i, h, l);
  62636. (Ee = ""),
  62637. l.render(function (e) {
  62638. ve.renderBufferImmediate(e, d, h);
  62639. });
  62640. } else ve.renderBufferDirect(t, i, c, h, l, u);
  62641. }
  62642. }
  62643. function I(e, t, i) {
  62644. var r = Xe.get(e),
  62645. o = qe.getParameters(e, Ue, t, i),
  62646. a = qe.getProgramCode(e, o),
  62647. s = r.program,
  62648. l = !0;
  62649. if (void 0 === s) e.addEventListener("dispose", c);
  62650. else if (s.code !== a) p(e);
  62651. else {
  62652. if (void 0 !== o.shaderID) return;
  62653. l = !1;
  62654. }
  62655. if (l) {
  62656. if (o.shaderID) {
  62657. var h = n.ShaderLib[o.shaderID];
  62658. r.__webglShader = {
  62659. name: e.type,
  62660. uniforms: n.UniformsUtils.clone(h.uniforms),
  62661. vertexShader: h.vertexShader,
  62662. fragmentShader: h.fragmentShader,
  62663. };
  62664. } else
  62665. r.__webglShader = {
  62666. name: e.type,
  62667. uniforms: e.uniforms,
  62668. vertexShader: e.vertexShader,
  62669. fragmentShader: e.fragmentShader,
  62670. };
  62671. (e.__webglShader = r.__webglShader),
  62672. (s = qe.acquireProgram(e, o, a)),
  62673. (r.program = s),
  62674. (e.program = s);
  62675. }
  62676. var u = s.getAttributes();
  62677. if (e.morphTargets) {
  62678. e.numSupportedMorphTargets = 0;
  62679. for (var d = 0; d < ve.maxMorphTargets; d++)
  62680. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++;
  62681. }
  62682. if (e.morphNormals) {
  62683. e.numSupportedMorphNormals = 0;
  62684. for (var d = 0; d < ve.maxMorphNormals; d++)
  62685. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++;
  62686. }
  62687. r.uniformsList = [];
  62688. var f = r.__webglShader.uniforms,
  62689. g = r.program.getUniforms();
  62690. for (var m in f) {
  62691. var v = g[m];
  62692. v && r.uniformsList.push([r.__webglShader.uniforms[m], v]);
  62693. }
  62694. (e instanceof n.MeshPhongMaterial ||
  62695. e instanceof n.MeshLambertMaterial ||
  62696. e instanceof n.MeshStandardMaterial ||
  62697. e.lights) &&
  62698. ((r.lightsHash = Ue.hash),
  62699. (f.ambientLightColor.value = Ue.ambient),
  62700. (f.directionalLights.value = Ue.directional),
  62701. (f.spotLights.value = Ue.spot),
  62702. (f.pointLights.value = Ue.point),
  62703. (f.hemisphereLights.value = Ue.hemi),
  62704. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  62705. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  62706. (f.spotShadowMap.value = Ue.spotShadowMap),
  62707. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  62708. (f.pointShadowMap.value = Ue.pointShadowMap),
  62709. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  62710. (r.hasDynamicUniforms = !1);
  62711. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  62712. var C = r.uniformsList[A][0];
  62713. if (C.dynamic === !0) {
  62714. r.hasDynamicUniforms = !0;
  62715. break;
  62716. }
  62717. }
  62718. }
  62719. function E(e) {
  62720. b(e),
  62721. e.transparent === !0
  62722. ? Ye.setBlending(
  62723. e.blending,
  62724. e.blendEquation,
  62725. e.blendSrc,
  62726. e.blendDst,
  62727. e.blendEquationAlpha,
  62728. e.blendSrcAlpha,
  62729. e.blendDstAlpha,
  62730. e.premultipliedAlpha
  62731. )
  62732. : Ye.setBlending(n.NoBlending),
  62733. Ye.setDepthFunc(e.depthFunc),
  62734. Ye.setDepthTest(e.depthTest),
  62735. Ye.setDepthWrite(e.depthWrite),
  62736. Ye.setColorWrite(e.colorWrite),
  62737. Ye.setPolygonOffset(
  62738. e.polygonOffset,
  62739. e.polygonOffsetFactor,
  62740. e.polygonOffsetUnits
  62741. );
  62742. }
  62743. function b(e) {
  62744. e.side !== n.DoubleSide
  62745. ? Ye.enable(Ge.CULL_FACE)
  62746. : Ye.disable(Ge.CULL_FACE),
  62747. Ye.setFlipSided(e.side === n.BackSide);
  62748. }
  62749. function w(e, t, i, r) {
  62750. xe = 0;
  62751. var o = Xe.get(i);
  62752. void 0 === o.program && (i.needsUpdate = !0),
  62753. void 0 !== o.lightsHash &&
  62754. o.lightsHash !== Ue.hash &&
  62755. (i.needsUpdate = !0),
  62756. i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1));
  62757. var a = !1,
  62758. s = !1,
  62759. l = !1,
  62760. c = o.program,
  62761. h = c.getUniforms(),
  62762. u = o.__webglShader.uniforms;
  62763. if (
  62764. (c.id !== Ae &&
  62765. (Ge.useProgram(c.program),
  62766. (Ae = c.id),
  62767. (a = !0),
  62768. (s = !0),
  62769. (l = !0)),
  62770. i.id !== Ie && ((Ie = i.id), (s = !0)),
  62771. (a || e !== be) &&
  62772. (Ge.uniformMatrix4fv(
  62773. h.projectionMatrix,
  62774. !1,
  62775. e.projectionMatrix.elements
  62776. ),
  62777. je.logarithmicDepthBuffer &&
  62778. Ge.uniform1f(
  62779. h.logDepthBufFC,
  62780. 2 / (Math.log(e.far + 1) / Math.LN2)
  62781. ),
  62782. e !== be && ((be = e), (s = !0), (l = !0)),
  62783. (i instanceof n.ShaderMaterial ||
  62784. i instanceof n.MeshPhongMaterial ||
  62785. i instanceof n.MeshStandardMaterial ||
  62786. i.envMap) &&
  62787. void 0 !== h.cameraPosition &&
  62788. (Ve.setFromMatrixPosition(e.matrixWorld),
  62789. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  62790. (i instanceof n.MeshPhongMaterial ||
  62791. i instanceof n.MeshLambertMaterial ||
  62792. i instanceof n.MeshBasicMaterial ||
  62793. i instanceof n.MeshStandardMaterial ||
  62794. i instanceof n.ShaderMaterial ||
  62795. i.skinning) &&
  62796. void 0 !== h.viewMatrix &&
  62797. Ge.uniformMatrix4fv(
  62798. h.viewMatrix,
  62799. !1,
  62800. e.matrixWorldInverse.elements
  62801. ),
  62802. void 0 !== h.toneMappingExposure &&
  62803. Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  62804. void 0 !== h.toneMappingWhitePoint &&
  62805. Ge.uniform1f(
  62806. h.toneMappingWhitePoint,
  62807. ve.toneMappingWhitePoint
  62808. )),
  62809. i.skinning)
  62810. )
  62811. if (
  62812. (r.bindMatrix &&
  62813. void 0 !== h.bindMatrix &&
  62814. Ge.uniformMatrix4fv(
  62815. h.bindMatrix,
  62816. !1,
  62817. r.bindMatrix.elements
  62818. ),
  62819. r.bindMatrixInverse &&
  62820. void 0 !== h.bindMatrixInverse &&
  62821. Ge.uniformMatrix4fv(
  62822. h.bindMatrixInverse,
  62823. !1,
  62824. r.bindMatrixInverse.elements
  62825. ),
  62826. je.floatVertexTextures &&
  62827. r.skeleton &&
  62828. r.skeleton.useVertexTexture)
  62829. ) {
  62830. if (void 0 !== h.boneTexture) {
  62831. var d = B();
  62832. Ge.uniform1i(h.boneTexture, d),
  62833. ve.setTexture(r.skeleton.boneTexture, d);
  62834. }
  62835. void 0 !== h.boneTextureWidth &&
  62836. Ge.uniform1i(
  62837. h.boneTextureWidth,
  62838. r.skeleton.boneTextureWidth
  62839. ),
  62840. void 0 !== h.boneTextureHeight &&
  62841. Ge.uniform1i(
  62842. h.boneTextureHeight,
  62843. r.skeleton.boneTextureHeight
  62844. );
  62845. } else
  62846. r.skeleton &&
  62847. r.skeleton.boneMatrices &&
  62848. void 0 !== h.boneGlobalMatrices &&
  62849. Ge.uniformMatrix4fv(
  62850. h.boneGlobalMatrices,
  62851. !1,
  62852. r.skeleton.boneMatrices
  62853. );
  62854. return (
  62855. s &&
  62856. ((i instanceof n.MeshPhongMaterial ||
  62857. i instanceof n.MeshLambertMaterial ||
  62858. i instanceof n.MeshStandardMaterial ||
  62859. i.lights) &&
  62860. D(u, l),
  62861. t && i.fog && R(u, t),
  62862. (i instanceof n.MeshBasicMaterial ||
  62863. i instanceof n.MeshLambertMaterial ||
  62864. i instanceof n.MeshPhongMaterial ||
  62865. i instanceof n.MeshStandardMaterial) &&
  62866. T(u, i),
  62867. i instanceof n.LineBasicMaterial
  62868. ? x(u, i)
  62869. : i instanceof n.LineDashedMaterial
  62870. ? (x(u, i), S(u, i))
  62871. : i instanceof n.PointsMaterial
  62872. ? M(u, i)
  62873. : i instanceof n.MeshLambertMaterial
  62874. ? P(u, i)
  62875. : i instanceof n.MeshPhongMaterial
  62876. ? O(u, i)
  62877. : i instanceof n.MeshStandardMaterial
  62878. ? L(u, i)
  62879. : i instanceof n.MeshDepthMaterial
  62880. ? ((u.mNear.value = e.near),
  62881. (u.mFar.value = e.far),
  62882. (u.opacity.value = i.opacity))
  62883. : i instanceof n.MeshNormalMaterial &&
  62884. (u.opacity.value = i.opacity),
  62885. V(o.uniformsList)),
  62886. N(h, r),
  62887. void 0 !== h.modelMatrix &&
  62888. Ge.uniformMatrix4fv(
  62889. h.modelMatrix,
  62890. !1,
  62891. r.matrixWorld.elements
  62892. ),
  62893. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  62894. c
  62895. );
  62896. }
  62897. function _(e, t, i) {
  62898. for (var n = [], r = 0, o = e.length; r < o; r++) {
  62899. var a = e[r][0],
  62900. s = a.onUpdateCallback;
  62901. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]));
  62902. }
  62903. V(n);
  62904. }
  62905. function T(e, t) {
  62906. (e.opacity.value = t.opacity),
  62907. (e.diffuse.value = t.color),
  62908. t.emissive &&
  62909. e.emissive.value
  62910. .copy(t.emissive)
  62911. .multiplyScalar(t.emissiveIntensity),
  62912. (e.map.value = t.map),
  62913. (e.specularMap.value = t.specularMap),
  62914. (e.alphaMap.value = t.alphaMap),
  62915. t.aoMap &&
  62916. ((e.aoMap.value = t.aoMap),
  62917. (e.aoMapIntensity.value = t.aoMapIntensity));
  62918. var i;
  62919. if (
  62920. (t.map
  62921. ? (i = t.map)
  62922. : t.specularMap
  62923. ? (i = t.specularMap)
  62924. : t.displacementMap
  62925. ? (i = t.displacementMap)
  62926. : t.normalMap
  62927. ? (i = t.normalMap)
  62928. : t.bumpMap
  62929. ? (i = t.bumpMap)
  62930. : t.roughnessMap
  62931. ? (i = t.roughnessMap)
  62932. : t.metalnessMap
  62933. ? (i = t.metalnessMap)
  62934. : t.alphaMap
  62935. ? (i = t.alphaMap)
  62936. : t.emissiveMap && (i = t.emissiveMap),
  62937. void 0 !== i)
  62938. ) {
  62939. i instanceof n.WebGLRenderTarget && (i = i.texture);
  62940. var r = i.offset,
  62941. o = i.repeat;
  62942. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y);
  62943. }
  62944. (e.envMap.value = t.envMap),
  62945. (e.flipEnvMap.value =
  62946. t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  62947. (e.reflectivity.value = t.reflectivity),
  62948. (e.refractionRatio.value = t.refractionRatio);
  62949. }
  62950. function x(e, t) {
  62951. (e.diffuse.value = t.color), (e.opacity.value = t.opacity);
  62952. }
  62953. function S(e, t) {
  62954. (e.dashSize.value = t.dashSize),
  62955. (e.totalSize.value = t.dashSize + t.gapSize),
  62956. (e.scale.value = t.scale);
  62957. }
  62958. function M(e, t) {
  62959. if (
  62960. ((e.diffuse.value = t.color),
  62961. (e.opacity.value = t.opacity),
  62962. (e.size.value = t.size * Oe),
  62963. (e.scale.value = te.clientHeight / 2),
  62964. (e.map.value = t.map),
  62965. null !== t.map)
  62966. ) {
  62967. var i = t.map.offset,
  62968. n = t.map.repeat;
  62969. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y);
  62970. }
  62971. }
  62972. function R(e, t) {
  62973. (e.fogColor.value = t.color),
  62974. t instanceof n.Fog
  62975. ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far))
  62976. : t instanceof n.FogExp2 && (e.fogDensity.value = t.density);
  62977. }
  62978. function P(e, t) {
  62979. t.lightMap &&
  62980. ((e.lightMap.value = t.lightMap),
  62981. (e.lightMapIntensity.value = t.lightMapIntensity)),
  62982. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap);
  62983. }
  62984. function O(e, t) {
  62985. (e.specular.value = t.specular),
  62986. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  62987. t.lightMap &&
  62988. ((e.lightMap.value = t.lightMap),
  62989. (e.lightMapIntensity.value = t.lightMapIntensity)),
  62990. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  62991. t.bumpMap &&
  62992. ((e.bumpMap.value = t.bumpMap),
  62993. (e.bumpScale.value = t.bumpScale)),
  62994. t.normalMap &&
  62995. ((e.normalMap.value = t.normalMap),
  62996. e.normalScale.value.copy(t.normalScale)),
  62997. t.displacementMap &&
  62998. ((e.displacementMap.value = t.displacementMap),
  62999. (e.displacementScale.value = t.displacementScale),
  63000. (e.displacementBias.value = t.displacementBias));
  63001. }
  63002. function L(e, t) {
  63003. (e.roughness.value = t.roughness),
  63004. (e.metalness.value = t.metalness),
  63005. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  63006. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  63007. t.lightMap &&
  63008. ((e.lightMap.value = t.lightMap),
  63009. (e.lightMapIntensity.value = t.lightMapIntensity)),
  63010. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  63011. t.bumpMap &&
  63012. ((e.bumpMap.value = t.bumpMap),
  63013. (e.bumpScale.value = t.bumpScale)),
  63014. t.normalMap &&
  63015. ((e.normalMap.value = t.normalMap),
  63016. e.normalScale.value.copy(t.normalScale)),
  63017. t.displacementMap &&
  63018. ((e.displacementMap.value = t.displacementMap),
  63019. (e.displacementScale.value = t.displacementScale),
  63020. (e.displacementBias.value = t.displacementBias)),
  63021. t.envMap && (e.envMapIntensity.value = t.envMapIntensity);
  63022. }
  63023. function D(e, t) {
  63024. (e.ambientLightColor.needsUpdate = t),
  63025. (e.directionalLights.needsUpdate = t),
  63026. (e.pointLights.needsUpdate = t),
  63027. (e.spotLights.needsUpdate = t),
  63028. (e.hemisphereLights.needsUpdate = t);
  63029. }
  63030. function N(e, t) {
  63031. Ge.uniformMatrix4fv(
  63032. e.modelViewMatrix,
  63033. !1,
  63034. t.modelViewMatrix.elements
  63035. ),
  63036. e.normalMatrix &&
  63037. Ge.uniformMatrix3fv(
  63038. e.normalMatrix,
  63039. !1,
  63040. t.normalMatrix.elements
  63041. );
  63042. }
  63043. function B() {
  63044. var e = xe;
  63045. return (
  63046. e >= je.maxTextures &&
  63047. console.warn(
  63048. "WebGLRenderer: trying to use " +
  63049. e +
  63050. " texture units while this GPU supports only " +
  63051. je.maxTextures
  63052. ),
  63053. (xe += 1),
  63054. e
  63055. );
  63056. }
  63057. function F(e, t, i, r) {
  63058. var o, a;
  63059. if ("1i" === t) Ge.uniform1i(i, r);
  63060. else if ("1f" === t) Ge.uniform1f(i, r);
  63061. else if ("2f" === t) Ge.uniform2f(i, r[0], r[1]);
  63062. else if ("3f" === t) Ge.uniform3f(i, r[0], r[1], r[2]);
  63063. else if ("4f" === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  63064. else if ("1iv" === t) Ge.uniform1iv(i, r);
  63065. else if ("3iv" === t) Ge.uniform3iv(i, r);
  63066. else if ("1fv" === t) Ge.uniform1fv(i, r);
  63067. else if ("2fv" === t) Ge.uniform2fv(i, r);
  63068. else if ("3fv" === t) Ge.uniform3fv(i, r);
  63069. else if ("4fv" === t) Ge.uniform4fv(i, r);
  63070. else if ("Matrix2fv" === t) Ge.uniformMatrix2fv(i, !1, r);
  63071. else if ("Matrix3fv" === t) Ge.uniformMatrix3fv(i, !1, r);
  63072. else if ("Matrix4fv" === t) Ge.uniformMatrix4fv(i, !1, r);
  63073. else if ("i" === t) Ge.uniform1i(i, r);
  63074. else if ("f" === t) Ge.uniform1f(i, r);
  63075. else if ("v2" === t) Ge.uniform2f(i, r.x, r.y);
  63076. else if ("v3" === t) Ge.uniform3f(i, r.x, r.y, r.z);
  63077. else if ("v4" === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  63078. else if ("c" === t) Ge.uniform3f(i, r.r, r.g, r.b);
  63079. else if ("s" === t) {
  63080. var s = e.properties;
  63081. for (var l in s) {
  63082. var c = s[l],
  63083. h = i[l],
  63084. u = r[l];
  63085. F(c, c.type, h, u);
  63086. }
  63087. } else if ("sa" === t)
  63088. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  63089. for (var l in s) {
  63090. var c = s[l],
  63091. h = i[d][l],
  63092. u = r[d][l];
  63093. F(c, c.type, h, u);
  63094. }
  63095. else if ("iv1" === t) Ge.uniform1iv(i, r);
  63096. else if ("iv" === t) Ge.uniform3iv(i, r);
  63097. else if ("fv1" === t) Ge.uniform1fv(i, r);
  63098. else if ("fv" === t) Ge.uniform3fv(i, r);
  63099. else if ("v2v" === t) {
  63100. void 0 === e._array &&
  63101. (e._array = new Float32Array(2 * r.length));
  63102. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2)
  63103. (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y);
  63104. Ge.uniform2fv(i, e._array);
  63105. } else if ("v3v" === t) {
  63106. void 0 === e._array &&
  63107. (e._array = new Float32Array(3 * r.length));
  63108. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3)
  63109. (e._array[m + 0] = r[d].x),
  63110. (e._array[m + 1] = r[d].y),
  63111. (e._array[m + 2] = r[d].z);
  63112. Ge.uniform3fv(i, e._array);
  63113. } else if ("v4v" === t) {
  63114. void 0 === e._array &&
  63115. (e._array = new Float32Array(4 * r.length));
  63116. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4)
  63117. (e._array[v + 0] = r[d].x),
  63118. (e._array[v + 1] = r[d].y),
  63119. (e._array[v + 2] = r[d].z),
  63120. (e._array[v + 3] = r[d].w);
  63121. Ge.uniform4fv(i, e._array);
  63122. } else if ("m2" === t) Ge.uniformMatrix2fv(i, !1, r.elements);
  63123. else if ("m3" === t) Ge.uniformMatrix3fv(i, !1, r.elements);
  63124. else if ("m3v" === t) {
  63125. void 0 === e._array &&
  63126. (e._array = new Float32Array(9 * r.length));
  63127. for (var d = 0, g = r.length; d < g; d++)
  63128. r[d].flattenToArrayOffset(e._array, 9 * d);
  63129. Ge.uniformMatrix3fv(i, !1, e._array);
  63130. } else if ("m4" === t) Ge.uniformMatrix4fv(i, !1, r.elements);
  63131. else if ("m4v" === t) {
  63132. void 0 === e._array &&
  63133. (e._array = new Float32Array(16 * r.length));
  63134. for (var d = 0, g = r.length; d < g; d++)
  63135. r[d].flattenToArrayOffset(e._array, 16 * d);
  63136. Ge.uniformMatrix4fv(i, !1, e._array);
  63137. } else if ("t" === t) {
  63138. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return;
  63139. o instanceof n.CubeTexture ||
  63140. (Array.isArray(o.image) && 6 === o.image.length)
  63141. ? Y(o, a)
  63142. : o instanceof n.WebGLRenderTargetCube
  63143. ? X(o.texture, a)
  63144. : o instanceof n.WebGLRenderTarget
  63145. ? ve.setTexture(o.texture, a)
  63146. : ve.setTexture(o, a);
  63147. } else if ("tv" === t) {
  63148. void 0 === e._array && (e._array = []);
  63149. for (var d = 0, g = e.value.length; d < g; d++)
  63150. e._array[d] = B();
  63151. Ge.uniform1iv(i, e._array);
  63152. for (var d = 0, g = e.value.length; d < g; d++)
  63153. (o = e.value[d]),
  63154. (a = e._array[d]),
  63155. o &&
  63156. (o instanceof n.CubeTexture ||
  63157. (o.image instanceof Array && 6 === o.image.length)
  63158. ? Y(o, a)
  63159. : o instanceof n.WebGLRenderTarget
  63160. ? ve.setTexture(o.texture, a)
  63161. : o instanceof n.WebGLRenderTargetCube
  63162. ? X(o.texture, a)
  63163. : ve.setTexture(o, a));
  63164. } else
  63165. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t);
  63166. }
  63167. function V(e) {
  63168. for (var t = 0, i = e.length; t < i; t++) {
  63169. var n = e[t][0];
  63170. if (n.needsUpdate !== !1) {
  63171. var r = n.type,
  63172. o = e[t][1],
  63173. a = n.value;
  63174. F(n, r, o, a);
  63175. }
  63176. }
  63177. }
  63178. function U(e, t) {
  63179. var i,
  63180. r,
  63181. o,
  63182. a,
  63183. s,
  63184. l,
  63185. c = 0,
  63186. h = 0,
  63187. u = 0,
  63188. d = t.matrixWorldInverse,
  63189. p = 0,
  63190. f = 0,
  63191. g = 0,
  63192. m = 0,
  63193. v = 0;
  63194. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  63195. if (
  63196. ((o = e[i]),
  63197. (a = o.color),
  63198. (s = o.intensity),
  63199. (l = o.distance),
  63200. o instanceof n.AmbientLight)
  63201. )
  63202. (c += a.r * s), (h += a.g * s), (u += a.b * s);
  63203. else if (o instanceof n.DirectionalLight) {
  63204. var A = Ke.get(o);
  63205. A.color.copy(o.color).multiplyScalar(o.intensity),
  63206. A.direction.setFromMatrixPosition(o.matrixWorld),
  63207. Ve.setFromMatrixPosition(o.target.matrixWorld),
  63208. A.direction.sub(Ve),
  63209. A.direction.transformDirection(d),
  63210. (A.shadow = o.castShadow),
  63211. o.castShadow &&
  63212. ((A.shadowBias = o.shadow.bias),
  63213. (A.shadowRadius = o.shadow.radius),
  63214. (A.shadowMapSize = o.shadow.mapSize),
  63215. (Ue.shadows[v++] = o)),
  63216. (Ue.directionalShadowMap[p] = o.shadow.map),
  63217. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  63218. (Ue.directional[p++] = A);
  63219. } else if (o instanceof n.SpotLight) {
  63220. var A = Ke.get(o);
  63221. A.position.setFromMatrixPosition(o.matrixWorld),
  63222. A.position.applyMatrix4(d),
  63223. A.color.copy(a).multiplyScalar(s),
  63224. (A.distance = l),
  63225. A.direction.setFromMatrixPosition(o.matrixWorld),
  63226. Ve.setFromMatrixPosition(o.target.matrixWorld),
  63227. A.direction.sub(Ve),
  63228. A.direction.transformDirection(d),
  63229. (A.coneCos = Math.cos(o.angle)),
  63230. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  63231. (A.decay = 0 === o.distance ? 0 : o.decay),
  63232. (A.shadow = o.castShadow),
  63233. o.castShadow &&
  63234. ((A.shadowBias = o.shadow.bias),
  63235. (A.shadowRadius = o.shadow.radius),
  63236. (A.shadowMapSize = o.shadow.mapSize),
  63237. (Ue.shadows[v++] = o)),
  63238. (Ue.spotShadowMap[g] = o.shadow.map),
  63239. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  63240. (Ue.spot[g++] = A);
  63241. } else if (o instanceof n.PointLight) {
  63242. var A = Ke.get(o);
  63243. A.position.setFromMatrixPosition(o.matrixWorld),
  63244. A.position.applyMatrix4(d),
  63245. A.color.copy(o.color).multiplyScalar(o.intensity),
  63246. (A.distance = o.distance),
  63247. (A.decay = 0 === o.distance ? 0 : o.decay),
  63248. (A.shadow = o.castShadow),
  63249. o.castShadow &&
  63250. ((A.shadowBias = o.shadow.bias),
  63251. (A.shadowRadius = o.shadow.radius),
  63252. (A.shadowMapSize = o.shadow.mapSize),
  63253. (Ue.shadows[v++] = o)),
  63254. (Ue.pointShadowMap[f] = o.shadow.map),
  63255. void 0 === Ue.pointShadowMatrix[f] &&
  63256. (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  63257. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  63258. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  63259. (Ue.point[f++] = A);
  63260. } else if (o instanceof n.HemisphereLight) {
  63261. var A = Ke.get(o);
  63262. A.direction.setFromMatrixPosition(o.matrixWorld),
  63263. A.direction.transformDirection(d),
  63264. A.direction.normalize(),
  63265. A.skyColor.copy(o.color).multiplyScalar(s),
  63266. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  63267. (Ue.hemi[m++] = A);
  63268. }
  63269. (Ue.ambient[0] = c),
  63270. (Ue.ambient[1] = h),
  63271. (Ue.ambient[2] = u),
  63272. (Ue.directional.length = p),
  63273. (Ue.spot.length = g),
  63274. (Ue.point.length = f),
  63275. (Ue.hemi.length = m),
  63276. (Ue.shadows.length = v),
  63277. (Ue.hash = p + "," + f + "," + g + "," + m + "," + v);
  63278. }
  63279. function k(e, t, i) {
  63280. var r;
  63281. if (
  63282. (i
  63283. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  63284. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  63285. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  63286. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  63287. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  63288. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  63289. (t.wrapS === n.ClampToEdgeWrapping &&
  63290. t.wrapT === n.ClampToEdgeWrapping) ||
  63291. console.warn(
  63292. "THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",
  63293. t
  63294. ),
  63295. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  63296. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  63297. t.minFilter !== n.NearestFilter &&
  63298. t.minFilter !== n.LinearFilter &&
  63299. console.warn(
  63300. "THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",
  63301. t
  63302. )),
  63303. (r = We.get("EXT_texture_filter_anisotropic")))
  63304. ) {
  63305. if (
  63306. t.type === n.FloatType &&
  63307. null === We.get("OES_texture_float_linear")
  63308. )
  63309. return;
  63310. if (
  63311. t.type === n.HalfFloatType &&
  63312. null === We.get("OES_texture_half_float_linear")
  63313. )
  63314. return;
  63315. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  63316. (Ge.texParameterf(
  63317. e,
  63318. r.TEXTURE_MAX_ANISOTROPY_EXT,
  63319. Math.min(t.anisotropy, ve.getMaxAnisotropy())
  63320. ),
  63321. (Xe.get(t).__currentAnisotropy = t.anisotropy));
  63322. }
  63323. }
  63324. function H(e, t, i) {
  63325. void 0 === e.__webglInit &&
  63326. ((e.__webglInit = !0),
  63327. t.addEventListener("dispose", s),
  63328. (e.__webglTexture = Ge.createTexture()),
  63329. ke.textures++),
  63330. Ye.activeTexture(Ge.TEXTURE0 + i),
  63331. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  63332. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  63333. Ge.pixelStorei(
  63334. Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
  63335. t.premultiplyAlpha
  63336. ),
  63337. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  63338. var r = G(t.image, je.maxTextureSize);
  63339. W(t) && z(r) === !1 && (r = j(r));
  63340. var o = z(r),
  63341. a = ee(t.format),
  63342. l = ee(t.type);
  63343. k(Ge.TEXTURE_2D, t, o);
  63344. var c,
  63345. h = t.mipmaps;
  63346. if (t instanceof n.DataTexture)
  63347. if (h.length > 0 && o) {
  63348. for (var u = 0, d = h.length; u < d; u++)
  63349. (c = h[u]),
  63350. Ye.texImage2D(
  63351. Ge.TEXTURE_2D,
  63352. u,
  63353. a,
  63354. c.width,
  63355. c.height,
  63356. 0,
  63357. a,
  63358. l,
  63359. c.data
  63360. );
  63361. t.generateMipmaps = !1;
  63362. } else
  63363. Ye.texImage2D(
  63364. Ge.TEXTURE_2D,
  63365. 0,
  63366. a,
  63367. r.width,
  63368. r.height,
  63369. 0,
  63370. a,
  63371. l,
  63372. r.data
  63373. );
  63374. else if (t instanceof n.CompressedTexture)
  63375. for (var u = 0, d = h.length; u < d; u++)
  63376. (c = h[u]),
  63377. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  63378. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  63379. ? Ye.compressedTexImage2D(
  63380. Ge.TEXTURE_2D,
  63381. u,
  63382. a,
  63383. c.width,
  63384. c.height,
  63385. 0,
  63386. c.data
  63387. )
  63388. : console.warn(
  63389. "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"
  63390. )
  63391. : Ye.texImage2D(
  63392. Ge.TEXTURE_2D,
  63393. u,
  63394. a,
  63395. c.width,
  63396. c.height,
  63397. 0,
  63398. a,
  63399. l,
  63400. c.data
  63401. );
  63402. else if (h.length > 0 && o) {
  63403. for (var u = 0, d = h.length; u < d; u++)
  63404. (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  63405. t.generateMipmaps = !1;
  63406. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  63407. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  63408. (e.__version = t.version),
  63409. t.onUpdate && t.onUpdate(t);
  63410. }
  63411. function G(e, t) {
  63412. if (e.width > t || e.height > t) {
  63413. var i = t / Math.max(e.width, e.height),
  63414. n = document.createElement("canvas");
  63415. (n.width = Math.floor(e.width * i)),
  63416. (n.height = Math.floor(e.height * i));
  63417. var r = n.getContext("2d");
  63418. return (
  63419. r.drawImage(
  63420. e,
  63421. 0,
  63422. 0,
  63423. e.width,
  63424. e.height,
  63425. 0,
  63426. 0,
  63427. n.width,
  63428. n.height
  63429. ),
  63430. console.warn(
  63431. "THREE.WebGLRenderer: image is too big (" +
  63432. e.width +
  63433. "x" +
  63434. e.height +
  63435. "). Resized to " +
  63436. n.width +
  63437. "x" +
  63438. n.height,
  63439. e
  63440. ),
  63441. n
  63442. );
  63443. }
  63444. return e;
  63445. }
  63446. function z(e) {
  63447. return (
  63448. n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  63449. );
  63450. }
  63451. function W(e) {
  63452. return (
  63453. e.wrapS !== n.ClampToEdgeWrapping ||
  63454. e.wrapT !== n.ClampToEdgeWrapping ||
  63455. (e.minFilter !== n.NearestFilter &&
  63456. e.minFilter !== n.LinearFilter)
  63457. );
  63458. }
  63459. function j(e) {
  63460. if (
  63461. e instanceof HTMLImageElement ||
  63462. e instanceof HTMLCanvasElement
  63463. ) {
  63464. var t = document.createElement("canvas");
  63465. (t.width = n.Math.nearestPowerOfTwo(e.width)),
  63466. (t.height = n.Math.nearestPowerOfTwo(e.height));
  63467. var i = t.getContext("2d");
  63468. return (
  63469. i.drawImage(e, 0, 0, t.width, t.height),
  63470. console.warn(
  63471. "THREE.WebGLRenderer: image is not power of two (" +
  63472. e.width +
  63473. "x" +
  63474. e.height +
  63475. "). Resized to " +
  63476. t.width +
  63477. "x" +
  63478. t.height,
  63479. e
  63480. ),
  63481. t
  63482. );
  63483. }
  63484. return e;
  63485. }
  63486. function Y(e, t) {
  63487. var i = Xe.get(e);
  63488. if (6 === e.image.length)
  63489. if (e.version > 0 && i.__version !== e.version) {
  63490. i.__image__webglTextureCube ||
  63491. (e.addEventListener("dispose", s),
  63492. (i.__image__webglTextureCube = Ge.createTexture()),
  63493. ke.textures++),
  63494. Ye.activeTexture(Ge.TEXTURE0 + t),
  63495. Ye.bindTexture(
  63496. Ge.TEXTURE_CUBE_MAP,
  63497. i.__image__webglTextureCube
  63498. ),
  63499. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  63500. for (
  63501. var r = e instanceof n.CompressedTexture,
  63502. o = e.image[0] instanceof n.DataTexture,
  63503. a = [],
  63504. l = 0;
  63505. l < 6;
  63506. l++
  63507. )
  63508. !ve.autoScaleCubemaps || r || o
  63509. ? (a[l] = o ? e.image[l].image : e.image[l])
  63510. : (a[l] = G(e.image[l], je.maxCubemapSize));
  63511. var c = a[0],
  63512. h = z(c),
  63513. u = ee(e.format),
  63514. d = ee(e.type);
  63515. k(Ge.TEXTURE_CUBE_MAP, e, h);
  63516. for (var l = 0; l < 6; l++)
  63517. if (r)
  63518. for (
  63519. var p, f = a[l].mipmaps, g = 0, m = f.length;
  63520. g < m;
  63521. g++
  63522. )
  63523. (p = f[g]),
  63524. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  63525. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  63526. ? Ye.compressedTexImage2D(
  63527. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63528. g,
  63529. u,
  63530. p.width,
  63531. p.height,
  63532. 0,
  63533. p.data
  63534. )
  63535. : console.warn(
  63536. "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"
  63537. )
  63538. : Ye.texImage2D(
  63539. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63540. g,
  63541. u,
  63542. p.width,
  63543. p.height,
  63544. 0,
  63545. u,
  63546. d,
  63547. p.data
  63548. );
  63549. else
  63550. o
  63551. ? Ye.texImage2D(
  63552. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63553. 0,
  63554. u,
  63555. a[l].width,
  63556. a[l].height,
  63557. 0,
  63558. u,
  63559. d,
  63560. a[l].data
  63561. )
  63562. : Ye.texImage2D(
  63563. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  63564. 0,
  63565. u,
  63566. u,
  63567. d,
  63568. a[l]
  63569. );
  63570. e.generateMipmaps &&
  63571. h &&
  63572. Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  63573. (i.__version = e.version),
  63574. e.onUpdate && e.onUpdate(e);
  63575. } else
  63576. Ye.activeTexture(Ge.TEXTURE0 + t),
  63577. Ye.bindTexture(
  63578. Ge.TEXTURE_CUBE_MAP,
  63579. i.__image__webglTextureCube
  63580. );
  63581. }
  63582. function X(e, t) {
  63583. Ye.activeTexture(Ge.TEXTURE0 + t),
  63584. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture);
  63585. }
  63586. function Z(e, t, i, n) {
  63587. var r = ee(t.texture.format),
  63588. o = ee(t.texture.type);
  63589. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  63590. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  63591. Ge.framebufferTexture2D(
  63592. Ge.FRAMEBUFFER,
  63593. i,
  63594. n,
  63595. Xe.get(t.texture).__webglTexture,
  63596. 0
  63597. ),
  63598. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  63599. }
  63600. function q(e, t) {
  63601. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  63602. t.depthBuffer && !t.stencilBuffer
  63603. ? (Ge.renderbufferStorage(
  63604. Ge.RENDERBUFFER,
  63605. Ge.DEPTH_COMPONENT16,
  63606. t.width,
  63607. t.height
  63608. ),
  63609. Ge.framebufferRenderbuffer(
  63610. Ge.FRAMEBUFFER,
  63611. Ge.DEPTH_ATTACHMENT,
  63612. Ge.RENDERBUFFER,
  63613. e
  63614. ))
  63615. : t.depthBuffer && t.stencilBuffer
  63616. ? (Ge.renderbufferStorage(
  63617. Ge.RENDERBUFFER,
  63618. Ge.DEPTH_STENCIL,
  63619. t.width,
  63620. t.height
  63621. ),
  63622. Ge.framebufferRenderbuffer(
  63623. Ge.FRAMEBUFFER,
  63624. Ge.DEPTH_STENCIL_ATTACHMENT,
  63625. Ge.RENDERBUFFER,
  63626. e
  63627. ))
  63628. : Ge.renderbufferStorage(
  63629. Ge.RENDERBUFFER,
  63630. Ge.RGBA4,
  63631. t.width,
  63632. t.height
  63633. ),
  63634. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null);
  63635. }
  63636. function K(e) {
  63637. var t = Xe.get(e),
  63638. i = e instanceof n.WebGLRenderTargetCube;
  63639. if (i) {
  63640. t.__webglDepthbuffer = [];
  63641. for (var r = 0; r < 6; r++)
  63642. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  63643. (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()),
  63644. q(t.__webglDepthbuffer[r], e);
  63645. } else
  63646. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  63647. (t.__webglDepthbuffer = Ge.createRenderbuffer()),
  63648. q(t.__webglDepthbuffer, e);
  63649. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  63650. }
  63651. function Q(e) {
  63652. var t = Xe.get(e),
  63653. i = Xe.get(e.texture);
  63654. e.addEventListener("dispose", l),
  63655. (i.__webglTexture = Ge.createTexture()),
  63656. ke.textures++;
  63657. var r = e instanceof n.WebGLRenderTargetCube,
  63658. o =
  63659. n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  63660. if (r) {
  63661. t.__webglFramebuffer = [];
  63662. for (var a = 0; a < 6; a++)
  63663. t.__webglFramebuffer[a] = Ge.createFramebuffer();
  63664. } else t.__webglFramebuffer = Ge.createFramebuffer();
  63665. if (r) {
  63666. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  63667. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  63668. for (var a = 0; a < 6; a++)
  63669. Z(
  63670. t.__webglFramebuffer[a],
  63671. e,
  63672. Ge.COLOR_ATTACHMENT0,
  63673. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a
  63674. );
  63675. e.texture.generateMipmaps &&
  63676. o &&
  63677. Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  63678. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null);
  63679. } else
  63680. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  63681. k(Ge.TEXTURE_2D, e.texture, o),
  63682. Z(
  63683. t.__webglFramebuffer,
  63684. e,
  63685. Ge.COLOR_ATTACHMENT0,
  63686. Ge.TEXTURE_2D
  63687. ),
  63688. e.texture.generateMipmaps &&
  63689. o &&
  63690. Ge.generateMipmap(Ge.TEXTURE_2D),
  63691. Ye.bindTexture(Ge.TEXTURE_2D, null);
  63692. e.depthBuffer && K(e);
  63693. }
  63694. function J(e) {
  63695. var t =
  63696. e instanceof n.WebGLRenderTargetCube
  63697. ? Ge.TEXTURE_CUBE_MAP
  63698. : Ge.TEXTURE_2D,
  63699. i = Xe.get(e.texture).__webglTexture;
  63700. Ye.bindTexture(t, i),
  63701. Ge.generateMipmap(t),
  63702. Ye.bindTexture(t, null);
  63703. }
  63704. function $(e) {
  63705. return e === n.NearestFilter ||
  63706. e === n.NearestMipMapNearestFilter ||
  63707. e === n.NearestMipMapLinearFilter
  63708. ? Ge.NEAREST
  63709. : Ge.LINEAR;
  63710. }
  63711. function ee(e) {
  63712. var t;
  63713. if (e === n.RepeatWrapping) return Ge.REPEAT;
  63714. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE;
  63715. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT;
  63716. if (e === n.NearestFilter) return Ge.NEAREST;
  63717. if (e === n.NearestMipMapNearestFilter)
  63718. return Ge.NEAREST_MIPMAP_NEAREST;
  63719. if (e === n.NearestMipMapLinearFilter)
  63720. return Ge.NEAREST_MIPMAP_LINEAR;
  63721. if (e === n.LinearFilter) return Ge.LINEAR;
  63722. if (e === n.LinearMipMapNearestFilter)
  63723. return Ge.LINEAR_MIPMAP_NEAREST;
  63724. if (e === n.LinearMipMapLinearFilter)
  63725. return Ge.LINEAR_MIPMAP_LINEAR;
  63726. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE;
  63727. if (e === n.UnsignedShort4444Type)
  63728. return Ge.UNSIGNED_SHORT_4_4_4_4;
  63729. if (e === n.UnsignedShort5551Type)
  63730. return Ge.UNSIGNED_SHORT_5_5_5_1;
  63731. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5;
  63732. if (e === n.ByteType) return Ge.BYTE;
  63733. if (e === n.ShortType) return Ge.SHORT;
  63734. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT;
  63735. if (e === n.IntType) return Ge.INT;
  63736. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT;
  63737. if (e === n.FloatType) return Ge.FLOAT;
  63738. if (
  63739. ((t = We.get("OES_texture_half_float")),
  63740. null !== t && e === n.HalfFloatType)
  63741. )
  63742. return t.HALF_FLOAT_OES;
  63743. if (e === n.AlphaFormat) return Ge.ALPHA;
  63744. if (e === n.RGBFormat) return Ge.RGB;
  63745. if (e === n.RGBAFormat) return Ge.RGBA;
  63746. if (e === n.LuminanceFormat) return Ge.LUMINANCE;
  63747. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA;
  63748. if (e === n.AddEquation) return Ge.FUNC_ADD;
  63749. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT;
  63750. if (e === n.ReverseSubtractEquation)
  63751. return Ge.FUNC_REVERSE_SUBTRACT;
  63752. if (e === n.ZeroFactor) return Ge.ZERO;
  63753. if (e === n.OneFactor) return Ge.ONE;
  63754. if (e === n.SrcColorFactor) return Ge.SRC_COLOR;
  63755. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR;
  63756. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA;
  63757. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA;
  63758. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA;
  63759. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA;
  63760. if (e === n.DstColorFactor) return Ge.DST_COLOR;
  63761. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR;
  63762. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE;
  63763. if (((t = We.get("WEBGL_compressed_texture_s3tc")), null !== t)) {
  63764. if (e === n.RGB_S3TC_DXT1_Format)
  63765. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  63766. if (e === n.RGBA_S3TC_DXT1_Format)
  63767. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  63768. if (e === n.RGBA_S3TC_DXT3_Format)
  63769. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  63770. if (e === n.RGBA_S3TC_DXT5_Format)
  63771. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  63772. }
  63773. if (
  63774. ((t = We.get("WEBGL_compressed_texture_pvrtc")), null !== t)
  63775. ) {
  63776. if (e === n.RGB_PVRTC_4BPPV1_Format)
  63777. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  63778. if (e === n.RGB_PVRTC_2BPPV1_Format)
  63779. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  63780. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  63781. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  63782. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  63783. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  63784. }
  63785. if (
  63786. ((t = We.get("WEBGL_compressed_texture_etc1")),
  63787. null !== t && e === n.RGB_ETC1_Format)
  63788. )
  63789. return t.COMPRESSED_RGB_ETC1_WEBGL;
  63790. if (((t = We.get("EXT_blend_minmax")), null !== t)) {
  63791. if (e === n.MinEquation) return t.MIN_EXT;
  63792. if (e === n.MaxEquation) return t.MAX_EXT;
  63793. }
  63794. return 0;
  63795. }
  63796. console.log("THREE.WebGLRenderer", n.REVISION), (e = e || {});
  63797. var te =
  63798. void 0 !== e.canvas
  63799. ? e.canvas
  63800. : document.createElement("canvas"),
  63801. ie = void 0 !== e.context ? e.context : null,
  63802. ne = void 0 !== e.alpha && e.alpha,
  63803. re = void 0 === e.depth || e.depth,
  63804. oe = void 0 === e.stencil || e.stencil,
  63805. ae = void 0 !== e.antialias && e.antialias,
  63806. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  63807. le =
  63808. void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  63809. ce = [],
  63810. he = [],
  63811. ue = -1,
  63812. de = [],
  63813. pe = -1,
  63814. fe = new Float32Array(8),
  63815. ge = [],
  63816. me = [];
  63817. (this.domElement = te),
  63818. (this.context = null),
  63819. (this.autoClear = !0),
  63820. (this.autoClearColor = !0),
  63821. (this.autoClearDepth = !0),
  63822. (this.autoClearStencil = !0),
  63823. (this.sortObjects = !0),
  63824. (this.gammaFactor = 2),
  63825. (this.gammaInput = !1),
  63826. (this.gammaOutput = !1),
  63827. (this.physicallyCorrectLights = !1),
  63828. (this.toneMapping = n.LinearToneMapping),
  63829. (this.toneMappingExposure = 1),
  63830. (this.toneMappingWhitePoint = 1),
  63831. (this.maxMorphTargets = 8),
  63832. (this.maxMorphNormals = 4),
  63833. (this.autoScaleCubemaps = !0);
  63834. var ve = this,
  63835. Ae = null,
  63836. ye = null,
  63837. Ce = null,
  63838. Ie = -1,
  63839. Ee = "",
  63840. be = null,
  63841. we = new n.Vector4(),
  63842. _e = null,
  63843. Te = new n.Vector4(),
  63844. xe = 0,
  63845. Se = new n.Color(0),
  63846. Me = 0,
  63847. Re = te.width,
  63848. Pe = te.height,
  63849. Oe = 1,
  63850. Le = new n.Vector4(0, 0, Re, Pe),
  63851. De = !1,
  63852. Ne = new n.Vector4(0, 0, Re, Pe),
  63853. Be = new n.Frustum(),
  63854. Fe = new n.Matrix4(),
  63855. Ve = new n.Vector3(),
  63856. Ue = {
  63857. hash: "",
  63858. ambient: [0, 0, 0],
  63859. directional: [],
  63860. directionalShadowMap: [],
  63861. directionalShadowMatrix: [],
  63862. spot: [],
  63863. spotShadowMap: [],
  63864. spotShadowMatrix: [],
  63865. point: [],
  63866. pointShadowMap: [],
  63867. pointShadowMatrix: [],
  63868. hemi: [],
  63869. shadows: [],
  63870. shadowsPointLight: 0,
  63871. },
  63872. ke = {
  63873. geometries: 0,
  63874. textures: 0,
  63875. },
  63876. He = {
  63877. calls: 0,
  63878. vertices: 0,
  63879. faces: 0,
  63880. points: 0,
  63881. };
  63882. this.info = {
  63883. render: He,
  63884. memory: ke,
  63885. programs: null,
  63886. };
  63887. var Ge;
  63888. try {
  63889. var ze = {
  63890. alpha: ne,
  63891. depth: re,
  63892. stencil: oe,
  63893. antialias: ae,
  63894. premultipliedAlpha: se,
  63895. preserveDrawingBuffer: le,
  63896. };
  63897. if (
  63898. ((Ge =
  63899. ie ||
  63900. te.getContext("webgl", ze) ||
  63901. te.getContext("experimental-webgl", ze)),
  63902. null === Ge)
  63903. )
  63904. throw null !== te.getContext("webgl")
  63905. ? "Error creating WebGL context with your selected attributes."
  63906. : "Error creating WebGL context.";
  63907. void 0 === Ge.getShaderPrecisionFormat &&
  63908. (Ge.getShaderPrecisionFormat = function () {
  63909. return {
  63910. rangeMin: 1,
  63911. rangeMax: 1,
  63912. precision: 1,
  63913. };
  63914. }),
  63915. te.addEventListener("webglcontextlost", a, !1);
  63916. } catch (e) {
  63917. console.error("THREE.WebGLRenderer: " + e);
  63918. }
  63919. var We = new n.WebGLExtensions(Ge);
  63920. We.get("OES_texture_float"),
  63921. We.get("OES_texture_float_linear"),
  63922. We.get("OES_texture_half_float"),
  63923. We.get("OES_texture_half_float_linear"),
  63924. We.get("OES_standard_derivatives"),
  63925. We.get("ANGLE_instanced_arrays"),
  63926. We.get("OES_element_index_uint") &&
  63927. (n.BufferGeometry.MaxIndex = 4294967296);
  63928. var je = new n.WebGLCapabilities(Ge, We, e),
  63929. Ye = new n.WebGLState(Ge, We, ee),
  63930. Xe = new n.WebGLProperties(),
  63931. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  63932. qe = new n.WebGLPrograms(this, je),
  63933. Ke = new n.WebGLLights();
  63934. this.info.programs = qe.programs;
  63935. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  63936. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He);
  63937. r(),
  63938. (this.context = Ge),
  63939. (this.capabilities = je),
  63940. (this.extensions = We),
  63941. (this.properties = Xe),
  63942. (this.state = Ye);
  63943. var $e = new n.WebGLShadowMap(this, Ue, Ze);
  63944. this.shadowMap = $e;
  63945. var et = new n.SpritePlugin(this, ge),
  63946. tt = new n.LensFlarePlugin(this, me);
  63947. (this.getContext = function () {
  63948. return Ge;
  63949. }),
  63950. (this.getContextAttributes = function () {
  63951. return Ge.getContextAttributes();
  63952. }),
  63953. (this.forceContextLoss = function () {
  63954. We.get("WEBGL_lose_context").loseContext();
  63955. }),
  63956. (this.getMaxAnisotropy = (function () {
  63957. var e;
  63958. return function () {
  63959. if (void 0 !== e) return e;
  63960. var t = We.get("EXT_texture_filter_anisotropic");
  63961. return (e =
  63962. null !== t
  63963. ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)
  63964. : 0);
  63965. };
  63966. })()),
  63967. (this.getPrecision = function () {
  63968. return je.precision;
  63969. }),
  63970. (this.getPixelRatio = function () {
  63971. return Oe;
  63972. }),
  63973. (this.setPixelRatio = function (e) {
  63974. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1));
  63975. }),
  63976. (this.getSize = function () {
  63977. return {
  63978. width: Re,
  63979. height: Pe,
  63980. };
  63981. }),
  63982. (this.setSize = function (e, t, i, devicePixelRatio) {
  63983. if (devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  63984. (Re = e),
  63985. (Pe = t),
  63986. (te.width = e * Oe),
  63987. (te.height = t * Oe),
  63988. i !== !1 &&
  63989. ((te.style.width = e + "px"), (te.style.height = t + "px")),
  63990. this.setViewport(0, 0, e, t);
  63991. }),
  63992. (this.setViewport = function (e, t, i, n) {
  63993. Ye.viewport(Ne.set(e, t, i, n));
  63994. }),
  63995. (this.setScissor = function (e, t, i, n) {
  63996. Ye.scissor(Le.set(e, t, i, n));
  63997. }),
  63998. (this.setScissorTest = function (e) {
  63999. Ye.setScissorTest((De = e));
  64000. }),
  64001. (this.getClearColor = function () {
  64002. return Se;
  64003. }),
  64004. (this.setClearColor = function (e, t) {
  64005. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me);
  64006. }),
  64007. (this.getClearAlpha = function () {
  64008. return Me;
  64009. }),
  64010. (this.setClearAlpha = function (e) {
  64011. (Me = e), i(Se.r, Se.g, Se.b, Me);
  64012. }),
  64013. (this.clear = function (e, t, i) {
  64014. var n = 0;
  64015. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  64016. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  64017. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  64018. Ge.clear(n);
  64019. }),
  64020. (this.clearColor = function () {
  64021. this.clear(!0, !1, !1);
  64022. }),
  64023. (this.clearDepth = function () {
  64024. this.clear(!1, !0, !1);
  64025. }),
  64026. (this.clearStencil = function () {
  64027. this.clear(!1, !1, !0);
  64028. }),
  64029. (this.clearTarget = function (e, t, i, n) {
  64030. this.setRenderTarget(e), this.clear(t, i, n);
  64031. }),
  64032. (this.resetGLState = o),
  64033. (this.dispose = function () {
  64034. te.removeEventListener("webglcontextlost", a, !1);
  64035. }),
  64036. (this.renderBufferImmediate = function (e, t, i) {
  64037. Ye.initAttributes();
  64038. var r = Xe.get(e);
  64039. e.hasPositions &&
  64040. !r.position &&
  64041. (r.position = Ge.createBuffer()),
  64042. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  64043. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  64044. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  64045. var o = t.getAttributes();
  64046. if (
  64047. (e.hasPositions &&
  64048. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  64049. Ge.bufferData(
  64050. Ge.ARRAY_BUFFER,
  64051. e.positionArray,
  64052. Ge.DYNAMIC_DRAW
  64053. ),
  64054. Ye.enableAttribute(o.position),
  64055. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  64056. e.hasNormals)
  64057. ) {
  64058. if (
  64059. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  64060. "MeshPhongMaterial" !== i.type &&
  64061. "MeshStandardMaterial" !== i.type &&
  64062. i.shading === n.FlatShading)
  64063. )
  64064. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  64065. var l = e.normalArray,
  64066. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  64067. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  64068. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  64069. (l[a + 0] = c),
  64070. (l[a + 1] = h),
  64071. (l[a + 2] = u),
  64072. (l[a + 3] = c),
  64073. (l[a + 4] = h),
  64074. (l[a + 5] = u),
  64075. (l[a + 6] = c),
  64076. (l[a + 7] = h),
  64077. (l[a + 8] = u);
  64078. }
  64079. Ge.bufferData(
  64080. Ge.ARRAY_BUFFER,
  64081. e.normalArray,
  64082. Ge.DYNAMIC_DRAW
  64083. ),
  64084. Ye.enableAttribute(o.normal),
  64085. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0);
  64086. }
  64087. e.hasUvs &&
  64088. i.map &&
  64089. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  64090. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  64091. Ye.enableAttribute(o.uv),
  64092. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  64093. e.hasColors &&
  64094. i.vertexColors !== n.NoColors &&
  64095. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  64096. Ge.bufferData(
  64097. Ge.ARRAY_BUFFER,
  64098. e.colorArray,
  64099. Ge.DYNAMIC_DRAW
  64100. ),
  64101. Ye.enableAttribute(o.color),
  64102. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  64103. Ye.disableUnusedAttributes(),
  64104. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  64105. (e.count = 0);
  64106. }),
  64107. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  64108. E(o);
  64109. var l = w(e, i, o, a),
  64110. c = !1,
  64111. h = r.id + "_" + l.id + "_" + o.wireframe;
  64112. h !== Ee && ((Ee = h), (c = !0));
  64113. var u = a.morphTargetInfluences;
  64114. if (void 0 !== u) {
  64115. for (var d = [], p = 0, m = u.length; p < m; p++) {
  64116. var v = u[p];
  64117. d.push([v, p]);
  64118. }
  64119. d.sort(g), d.length > 8 && (d.length = 8);
  64120. for (
  64121. var A = r.morphAttributes, p = 0, m = d.length;
  64122. p < m;
  64123. p++
  64124. ) {
  64125. var v = d[p];
  64126. if (((fe[p] = v[0]), 0 !== v[0])) {
  64127. var y = v[1];
  64128. o.morphTargets === !0 &&
  64129. A.position &&
  64130. r.addAttribute("morphTarget" + p, A.position[y]),
  64131. o.morphNormals === !0 &&
  64132. A.normal &&
  64133. r.addAttribute("morphNormal" + p, A.normal[y]);
  64134. } else
  64135. o.morphTargets === !0 &&
  64136. r.removeAttribute("morphTarget" + p),
  64137. o.morphNormals === !0 &&
  64138. r.removeAttribute("morphNormal" + p);
  64139. }
  64140. var C = l.getUniforms();
  64141. null !== C.morphTargetInfluences &&
  64142. Ge.uniform1fv(C.morphTargetInfluences, fe),
  64143. (c = !0);
  64144. }
  64145. var y = r.index,
  64146. I = r.attributes.position;
  64147. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  64148. var b;
  64149. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe),
  64150. c &&
  64151. (f(o, l, r),
  64152. null !== y &&
  64153. Ge.bindBuffer(
  64154. Ge.ELEMENT_ARRAY_BUFFER,
  64155. Ze.getAttributeBuffer(y)
  64156. ));
  64157. var _ = 0,
  64158. T = 1 / 0;
  64159. null !== y ? (T = y.count) : void 0 !== I && (T = I.count);
  64160. var x = r.drawRange.start,
  64161. S = r.drawRange.count,
  64162. M = null !== s ? s.start : 0,
  64163. R = null !== s ? s.count : 1 / 0,
  64164. P = Math.max(_, x, M),
  64165. O = Math.min(_ + T, x + S, M + R) - 1,
  64166. L = Math.max(0, O - P + 1);
  64167. if (a instanceof n.Mesh)
  64168. if (o.wireframe === !0)
  64169. Ye.setLineWidth(o.wireframeLinewidth * t()),
  64170. b.setMode(Ge.LINES);
  64171. else
  64172. switch (a.drawMode) {
  64173. case n.TrianglesDrawMode:
  64174. b.setMode(Ge.TRIANGLES);
  64175. break;
  64176. case n.TriangleStripDrawMode:
  64177. b.setMode(Ge.TRIANGLE_STRIP);
  64178. break;
  64179. case n.TriangleFanDrawMode:
  64180. b.setMode(Ge.TRIANGLE_FAN);
  64181. }
  64182. else if (a instanceof n.Line) {
  64183. var D = o.linewidth;
  64184. void 0 === D && (D = 1),
  64185. Ye.setLineWidth(D * t()),
  64186. a instanceof n.LineSegments
  64187. ? b.setMode(Ge.LINES)
  64188. : b.setMode(Ge.LINE_STRIP);
  64189. } else a instanceof n.Points && b.setMode(Ge.POINTS);
  64190. r instanceof n.InstancedBufferGeometry
  64191. ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L)
  64192. : b.render(P, L);
  64193. }),
  64194. (this.render = function (e, t, i, r) {
  64195. if (t instanceof n.Camera == !1)
  64196. return void console.error(
  64197. "THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."
  64198. );
  64199. var o = e.fog;
  64200. if (
  64201. ((Ee = ""),
  64202. (Ie = -1),
  64203. (be = null),
  64204. e.autoUpdate === !0 && e.updateMatrixWorld(),
  64205. null === t.parent && t.updateMatrixWorld(),
  64206. t.matrixWorldInverse.getInverse(t.matrixWorld),
  64207. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  64208. Be.setFromMatrix(Fe),
  64209. (ce.length = 0),
  64210. (ue = -1),
  64211. (pe = -1),
  64212. (ge.length = 0),
  64213. (me.length = 0),
  64214. y(e, t),
  64215. (he.length = ue + 1),
  64216. (de.length = pe + 1),
  64217. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  64218. U(ce, t),
  64219. $e.render(e, t),
  64220. (He.calls = 0),
  64221. (He.vertices = 0),
  64222. (He.faces = 0),
  64223. (He.points = 0),
  64224. void 0 === i && (i = null),
  64225. this.setRenderTarget(i),
  64226. (this.autoClear || r) &&
  64227. this.clear(
  64228. this.autoClearColor,
  64229. this.autoClearDepth,
  64230. this.autoClearStencil
  64231. ),
  64232. e.overrideMaterial)
  64233. ) {
  64234. var a = e.overrideMaterial;
  64235. C(he, t, o, a), C(de, t, o, a);
  64236. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o);
  64237. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  64238. var s = i.texture;
  64239. s.generateMipmaps &&
  64240. z(i) &&
  64241. s.minFilter !== n.NearestFilter &&
  64242. s.minFilter !== n.LinearFilter &&
  64243. J(i);
  64244. }
  64245. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0);
  64246. }),
  64247. (this.setFaceCulling = function (e, t) {
  64248. e === n.CullFaceNone
  64249. ? Ye.disable(Ge.CULL_FACE)
  64250. : (t === n.FrontFaceDirectionCW
  64251. ? Ge.frontFace(Ge.CW)
  64252. : Ge.frontFace(Ge.CCW),
  64253. e === n.CullFaceBack
  64254. ? Ge.cullFace(Ge.BACK)
  64255. : e === n.CullFaceFront
  64256. ? Ge.cullFace(Ge.FRONT)
  64257. : Ge.cullFace(Ge.FRONT_AND_BACK),
  64258. Ye.enable(Ge.CULL_FACE));
  64259. }),
  64260. (this.setTexture = function (e, t) {
  64261. var i = Xe.get(e);
  64262. if (e.version > 0 && i.__version !== e.version) {
  64263. var n = e.image;
  64264. return void 0 === n
  64265. ? void console.warn(
  64266. "THREE.WebGLRenderer: Texture marked for update but image is undefined",
  64267. e
  64268. )
  64269. : n.complete === !1
  64270. ? void console.warn(
  64271. "THREE.WebGLRenderer: Texture marked for update but image is incomplete",
  64272. e
  64273. )
  64274. : void H(i, e, t);
  64275. }
  64276. Ye.activeTexture(Ge.TEXTURE0 + t),
  64277. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture);
  64278. }),
  64279. (this.getCurrentRenderTarget = function () {
  64280. return ye;
  64281. }),
  64282. (this.setRenderTargetFramebuffer = function (
  64283. renderTarget,
  64284. defaultFramebuffer
  64285. ) {
  64286. //add
  64287. const renderTargetProperties = Xe.get(renderTarget);
  64288. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  64289. renderTargetProperties.__useDefaultFramebuffer =
  64290. defaultFramebuffer === undefined;
  64291. }),
  64292. (this.setFramebuffer = function (value) {
  64293. //add
  64294. if (Ce !== value && ye === null)
  64295. Ge.bindFramebuffer(36160, value);
  64296. Ce = value;
  64297. }),
  64298. (this.setRenderTarget = function (e) {
  64299. (ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  64300. var t,
  64301. i = e instanceof n.WebGLRenderTargetCube;
  64302. if (e) {
  64303. var r = Xe.get(e);
  64304. (t = i
  64305. ? r.__webglFramebuffer[e.activeCubeFace]
  64306. : r.__webglFramebuffer),
  64307. we.copy(e.scissor),
  64308. (_e = e.scissorTest),
  64309. Te.copy(e.viewport);
  64310. } else
  64311. (t = null),
  64312. we.copy(Le).multiplyScalar(Oe),
  64313. (_e = De),
  64314. Te.copy(Ne).multiplyScalar(Oe);
  64315. if (
  64316. (Ce !== t &&
  64317. (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)),
  64318. Ye.scissor(we),
  64319. Ye.setScissorTest(_e),
  64320. Ye.viewport(Te),
  64321. i)
  64322. ) {
  64323. var o = Xe.get(e.texture);
  64324. Ge.framebufferTexture2D(
  64325. Ge.FRAMEBUFFER,
  64326. Ge.COLOR_ATTACHMENT0,
  64327. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace,
  64328. o.__webglTexture,
  64329. e.activeMipMapLevel
  64330. );
  64331. }
  64332. }),
  64333. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  64334. if (e instanceof n.WebGLRenderTarget == !1)
  64335. return void console.error(
  64336. "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."
  64337. );
  64338. var s = Xe.get(e).__webglFramebuffer;
  64339. if (s) {
  64340. var l = !1;
  64341. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0));
  64342. try {
  64343. var c = e.texture;
  64344. if (
  64345. c.format !== n.RGBAFormat &&
  64346. ee(c.format) !==
  64347. Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT)
  64348. )
  64349. return void console.error(
  64350. "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."
  64351. );
  64352. if (
  64353. !(
  64354. c.type === n.UnsignedByteType ||
  64355. ee(c.type) ===
  64356. Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  64357. (c.type === n.FloatType &&
  64358. We.get("WEBGL_color_buffer_float")) ||
  64359. (c.type === n.HalfFloatType &&
  64360. We.get("EXT_color_buffer_half_float"))
  64361. )
  64362. )
  64363. return void console.error(
  64364. "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."
  64365. );
  64366. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) ===
  64367. Ge.FRAMEBUFFER_COMPLETE
  64368. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  64369. : console.error(
  64370. "THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."
  64371. );
  64372. } finally {
  64373. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce);
  64374. }
  64375. }
  64376. });
  64377. }),
  64378. (n.WebGLRenderTarget = function (e, t, i) {
  64379. (this.uuid = n.Math.generateUUID()),
  64380. (this.width = e),
  64381. (this.height = t),
  64382. (this.scissor = new n.Vector4(0, 0, e, t)),
  64383. (this.scissorTest = !1),
  64384. (this.viewport = new n.Vector4(0, 0, e, t)),
  64385. (i = i || {}),
  64386. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  64387. (this.texture = new n.Texture(
  64388. void 0,
  64389. void 0,
  64390. i.wrapS,
  64391. i.wrapT,
  64392. i.magFilter,
  64393. i.minFilter,
  64394. i.format,
  64395. i.type,
  64396. i.anisotropy
  64397. )),
  64398. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  64399. (this.stencilBuffer =
  64400. void 0 === i.stencilBuffer || i.stencilBuffer);
  64401. }),
  64402. (n.WebGLRenderTarget.prototype = {
  64403. constructor: n.WebGLRenderTarget,
  64404. setSize: function (e, t) {
  64405. (this.width === e && this.height === t) ||
  64406. ((this.width = e), (this.height = t), this.dispose()),
  64407. this.viewport.set(0, 0, e, t),
  64408. this.scissor.set(0, 0, e, t);
  64409. },
  64410. clone: function () {
  64411. return new this.constructor().copy(this);
  64412. },
  64413. copy: function (e) {
  64414. return (
  64415. (this.width = e.width),
  64416. (this.height = e.height),
  64417. this.viewport.copy(e.viewport),
  64418. (this.texture = e.texture.clone()),
  64419. (this.depthBuffer = e.depthBuffer),
  64420. (this.stencilBuffer = e.stencilBuffer),
  64421. this
  64422. );
  64423. },
  64424. dispose: function () {
  64425. this.dispatchEvent({
  64426. type: "dispose",
  64427. });
  64428. },
  64429. }),
  64430. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  64431. (n.WebGLRenderTargetCube = function (e, t, i) {
  64432. n.WebGLRenderTarget.call(this, e, t, i),
  64433. (this.activeCubeFace = 0),
  64434. (this.activeMipMapLevel = 0);
  64435. }),
  64436. (n.WebGLRenderTargetCube.prototype = Object.create(
  64437. n.WebGLRenderTarget.prototype
  64438. )),
  64439. (n.WebGLRenderTargetCube.prototype.constructor =
  64440. n.WebGLRenderTargetCube),
  64441. (n.WebGLBufferRenderer = function (e, t, i) {
  64442. function r(e) {
  64443. s = e;
  64444. }
  64445. function o(t, n) {
  64446. e.drawArrays(s, t, n),
  64447. i.calls++,
  64448. (i.vertices += n),
  64449. s === e.TRIANGLES && (i.faces += n / 3);
  64450. }
  64451. function a(r) {
  64452. var o = t.get("ANGLE_instanced_arrays");
  64453. if (null === o)
  64454. return void console.error(
  64455. "THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."
  64456. );
  64457. var a = r.attributes.position,
  64458. l = 0;
  64459. a instanceof n.InterleavedBufferAttribute
  64460. ? ((l = a.data.count),
  64461. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  64462. : ((l = a.count),
  64463. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  64464. i.calls++,
  64465. (i.vertices += l * r.maxInstancedCount),
  64466. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3);
  64467. }
  64468. var s;
  64469. (this.setMode = r), (this.render = o), (this.renderInstances = a);
  64470. }),
  64471. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  64472. function n(e) {
  64473. s = e;
  64474. }
  64475. function r(i) {
  64476. i.array instanceof Uint32Array && t.get("OES_element_index_uint")
  64477. ? ((l = e.UNSIGNED_INT), (c = 4))
  64478. : ((l = e.UNSIGNED_SHORT), (c = 2));
  64479. }
  64480. function o(t, n) {
  64481. e.drawElements(s, n, l, t * c),
  64482. i.calls++,
  64483. (i.vertices += n),
  64484. s === e.TRIANGLES && (i.faces += n / 3);
  64485. }
  64486. function a(n, r, o) {
  64487. var a = t.get("ANGLE_instanced_arrays");
  64488. return null === a
  64489. ? void console.error(
  64490. "THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."
  64491. )
  64492. : (a.drawElementsInstancedANGLE(
  64493. s,
  64494. o,
  64495. l,
  64496. r * c,
  64497. n.maxInstancedCount
  64498. ),
  64499. i.calls++,
  64500. (i.vertices += o * n.maxInstancedCount),
  64501. void (
  64502. s === e.TRIANGLES &&
  64503. (i.faces += (n.maxInstancedCount * o) / 3)
  64504. ));
  64505. }
  64506. var s, l, c;
  64507. (this.setMode = n),
  64508. (this.setIndex = r),
  64509. (this.render = o),
  64510. (this.renderInstances = a);
  64511. }),
  64512. (n.WebGLExtensions = function (e) {
  64513. var t = {};
  64514. this.get = function (i) {
  64515. if (void 0 !== t[i]) return t[i];
  64516. var n;
  64517. switch (i) {
  64518. case "EXT_texture_filter_anisotropic":
  64519. n =
  64520. e.getExtension("EXT_texture_filter_anisotropic") ||
  64521. e.getExtension("MOZ_EXT_texture_filter_anisotropic") ||
  64522. e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  64523. break;
  64524. case "WEBGL_compressed_texture_s3tc":
  64525. n =
  64526. e.getExtension("WEBGL_compressed_texture_s3tc") ||
  64527. e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") ||
  64528. e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  64529. break;
  64530. case "WEBGL_compressed_texture_pvrtc":
  64531. n =
  64532. e.getExtension("WEBGL_compressed_texture_pvrtc") ||
  64533. e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  64534. break;
  64535. case "WEBGL_compressed_texture_etc1":
  64536. n = e.getExtension("WEBGL_compressed_texture_etc1");
  64537. break;
  64538. default:
  64539. n = e.getExtension(i);
  64540. }
  64541. return (
  64542. null === n &&
  64543. console.warn(
  64544. "THREE.WebGLRenderer: " + i + " extension not supported."
  64545. ),
  64546. (t[i] = n),
  64547. n
  64548. );
  64549. };
  64550. }),
  64551. (n.WebGLCapabilities = function (e, t, i) {
  64552. function n(t) {
  64553. if ("highp" === t) {
  64554. if (
  64555. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT)
  64556. .precision > 0 &&
  64557. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT)
  64558. .precision > 0
  64559. )
  64560. return "highp";
  64561. t = "mediump";
  64562. }
  64563. return "mediump" === t &&
  64564. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT)
  64565. .precision > 0 &&
  64566. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT)
  64567. .precision > 0
  64568. ? "mediump"
  64569. : "lowp";
  64570. }
  64571. (this.getMaxPrecision = n),
  64572. (this.precision = void 0 !== i.precision ? i.precision : "highp"),
  64573. (this.logarithmicDepthBuffer =
  64574. void 0 !== i.logarithmicDepthBuffer &&
  64575. i.logarithmicDepthBuffer),
  64576. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  64577. (this.maxVertexTextures = e.getParameter(
  64578. e.MAX_VERTEX_TEXTURE_IMAGE_UNITS
  64579. )),
  64580. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  64581. (this.maxCubemapSize = e.getParameter(
  64582. e.MAX_CUBE_MAP_TEXTURE_SIZE
  64583. )),
  64584. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  64585. (this.maxVertexUniforms = e.getParameter(
  64586. e.MAX_VERTEX_UNIFORM_VECTORS
  64587. )),
  64588. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  64589. (this.maxFragmentUniforms = e.getParameter(
  64590. e.MAX_FRAGMENT_UNIFORM_VECTORS
  64591. )),
  64592. (this.vertexTextures = this.maxVertexTextures > 0),
  64593. (this.floatFragmentTextures = !!t.get("OES_texture_float")),
  64594. (this.floatVertexTextures =
  64595. this.vertexTextures && this.floatFragmentTextures);
  64596. var r = n(this.precision);
  64597. r !== this.precision &&
  64598. (console.warn(
  64599. "THREE.WebGLRenderer:",
  64600. this.precision,
  64601. "not supported, using",
  64602. r,
  64603. "instead."
  64604. ),
  64605. (this.precision = r)),
  64606. this.logarithmicDepthBuffer &&
  64607. (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"));
  64608. }),
  64609. (n.WebGLGeometries = function (e, t, i) {
  64610. function r(e) {
  64611. var t = e.geometry;
  64612. if (void 0 !== h[t.id]) return h[t.id];
  64613. t.addEventListener("dispose", o);
  64614. var r;
  64615. return (
  64616. t instanceof n.BufferGeometry
  64617. ? (r = t)
  64618. : t instanceof n.Geometry &&
  64619. (void 0 === t._bufferGeometry &&
  64620. (t._bufferGeometry = new n.BufferGeometry().setFromObject(
  64621. e
  64622. )),
  64623. (r = t._bufferGeometry)),
  64624. (h[t.id] = r),
  64625. i.memory.geometries++,
  64626. r
  64627. );
  64628. }
  64629. function o(e) {
  64630. var n = e.target,
  64631. r = h[n.id];
  64632. null !== r.index && s(r.index),
  64633. l(r.attributes),
  64634. n.removeEventListener("dispose", o),
  64635. delete h[n.id];
  64636. var a = t.get(n);
  64637. a.wireframe && s(a.wireframe), t.delete(n);
  64638. var c = t.get(r);
  64639. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--;
  64640. }
  64641. function a(e) {
  64642. return e instanceof n.InterleavedBufferAttribute
  64643. ? t.get(e.data).__webglBuffer
  64644. : t.get(e).__webglBuffer;
  64645. }
  64646. function s(t) {
  64647. var i = a(t);
  64648. void 0 !== i && (e.deleteBuffer(i), c(t));
  64649. }
  64650. function l(e) {
  64651. for (var t in e) s(e[t]);
  64652. }
  64653. function c(e) {
  64654. e instanceof n.InterleavedBufferAttribute
  64655. ? t.delete(e.data)
  64656. : t.delete(e);
  64657. }
  64658. var h = {};
  64659. this.get = r;
  64660. }),
  64661. (n.WebGLLights = function () {
  64662. var e = {};
  64663. this.get = function (t) {
  64664. if (void 0 !== e[t.id]) return e[t.id];
  64665. var i;
  64666. switch (t.type) {
  64667. case "DirectionalLight":
  64668. i = {
  64669. direction: new n.Vector3(),
  64670. color: new n.Color(),
  64671. shadow: !1,
  64672. shadowBias: 0,
  64673. shadowRadius: 1,
  64674. shadowMapSize: new n.Vector2(),
  64675. };
  64676. break;
  64677. case "SpotLight":
  64678. i = {
  64679. position: new n.Vector3(),
  64680. direction: new n.Vector3(),
  64681. color: new n.Color(),
  64682. distance: 0,
  64683. coneCos: 0,
  64684. penumbraCos: 0,
  64685. decay: 0,
  64686. shadow: !1,
  64687. shadowBias: 0,
  64688. shadowRadius: 1,
  64689. shadowMapSize: new n.Vector2(),
  64690. };
  64691. break;
  64692. case "PointLight":
  64693. i = {
  64694. position: new n.Vector3(),
  64695. color: new n.Color(),
  64696. distance: 0,
  64697. decay: 0,
  64698. shadow: !1,
  64699. shadowBias: 0,
  64700. shadowRadius: 1,
  64701. shadowMapSize: new n.Vector2(),
  64702. };
  64703. break;
  64704. case "HemisphereLight":
  64705. i = {
  64706. direction: new n.Vector3(),
  64707. skyColor: new n.Color(),
  64708. groundColor: new n.Color(),
  64709. };
  64710. }
  64711. return (e[t.id] = i), i;
  64712. };
  64713. }),
  64714. (n.WebGLObjects = function (e, t, i) {
  64715. function r(t) {
  64716. var i = u.get(t);
  64717. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  64718. var r = i.index,
  64719. a = i.attributes;
  64720. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  64721. for (var s in a) o(a[s], e.ARRAY_BUFFER);
  64722. var l = i.morphAttributes;
  64723. for (var s in l)
  64724. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  64725. o(c[h], e.ARRAY_BUFFER);
  64726. return i;
  64727. }
  64728. function o(e, i) {
  64729. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  64730. o = t.get(r);
  64731. void 0 === o.__webglBuffer
  64732. ? a(o, r, i)
  64733. : o.version !== r.version && s(o, r, i);
  64734. }
  64735. function a(t, i, n) {
  64736. (t.__webglBuffer = e.createBuffer()),
  64737. e.bindBuffer(n, t.__webglBuffer);
  64738. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  64739. e.bufferData(n, i.array, r), (t.version = i.version);
  64740. }
  64741. function s(t, i, n) {
  64742. e.bindBuffer(n, t.__webglBuffer),
  64743. i.dynamic === !1 || i.updateRange.count === -1
  64744. ? e.bufferSubData(n, 0, i.array)
  64745. : 0 === i.updateRange.count
  64746. ? console.error(
  64747. "THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."
  64748. )
  64749. : (e.bufferSubData(
  64750. n,
  64751. i.updateRange.offset * i.array.BYTES_PER_ELEMENT,
  64752. i.array.subarray(
  64753. i.updateRange.offset,
  64754. i.updateRange.offset + i.updateRange.count
  64755. )
  64756. ),
  64757. (i.updateRange.count = 0)),
  64758. (t.version = i.version);
  64759. }
  64760. function l(e) {
  64761. return e instanceof n.InterleavedBufferAttribute
  64762. ? t.get(e.data).__webglBuffer
  64763. : t.get(e).__webglBuffer;
  64764. }
  64765. function c(i) {
  64766. var r = t.get(i);
  64767. if (void 0 !== r.wireframe) return r.wireframe;
  64768. var a = [],
  64769. s = i.index,
  64770. l = i.attributes,
  64771. c = l.position;
  64772. if (null !== s)
  64773. for (
  64774. var u = {}, d = s.array, p = 0, f = d.length;
  64775. p < f;
  64776. p += 3
  64777. ) {
  64778. var g = d[p + 0],
  64779. m = d[p + 1],
  64780. v = d[p + 2];
  64781. h(u, g, m) && a.push(g, m),
  64782. h(u, m, v) && a.push(m, v),
  64783. h(u, v, g) && a.push(v, g);
  64784. }
  64785. else
  64786. for (
  64787. var d = l.position.array, p = 0, f = d.length / 3 - 1;
  64788. p < f;
  64789. p += 3
  64790. ) {
  64791. var g = p + 0,
  64792. m = p + 1,
  64793. v = p + 2;
  64794. a.push(g, m, m, v, v, g);
  64795. }
  64796. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  64797. y = new n.BufferAttribute(new A(a), 1);
  64798. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y;
  64799. }
  64800. function h(e, t, i) {
  64801. if (t > i) {
  64802. var n = t;
  64803. (t = i), (i = n);
  64804. }
  64805. var r = e[t];
  64806. return void 0 === r
  64807. ? ((e[t] = [i]), !0)
  64808. : r.indexOf(i) === -1 && (r.push(i), !0);
  64809. }
  64810. var u = new n.WebGLGeometries(e, t, i);
  64811. (this.getAttributeBuffer = l),
  64812. (this.getWireframeAttribute = c),
  64813. (this.update = r);
  64814. }),
  64815. (n.WebGLProgram = (function () {
  64816. function e(e) {
  64817. switch (e) {
  64818. case n.LinearEncoding:
  64819. return ["Linear", "( value )"];
  64820. case n.sRGBEncoding:
  64821. return ["sRGB", "( value )"];
  64822. case n.RGBEEncoding:
  64823. return ["RGBE", "( value )"];
  64824. case n.RGBM7Encoding:
  64825. return ["RGBM", "( value, 7.0 )"];
  64826. case n.RGBM16Encoding:
  64827. return ["RGBM", "( value, 16.0 )"];
  64828. case n.RGBDEncoding:
  64829. return ["RGBD", "( value, 256.0 )"];
  64830. case n.GammaEncoding:
  64831. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  64832. default:
  64833. throw new Error("unsupported encoding: " + e);
  64834. }
  64835. }
  64836. function t(t, i) {
  64837. var n = e(i);
  64838. return (
  64839. "vec4 " +
  64840. t +
  64841. "( vec4 value ) { return " +
  64842. n[0] +
  64843. "ToLinear" +
  64844. n[1] +
  64845. "; }"
  64846. );
  64847. }
  64848. function i(t, i) {
  64849. var n = e(i);
  64850. return (
  64851. "vec4 " +
  64852. t +
  64853. "( vec4 value ) { return LinearTo" +
  64854. n[0] +
  64855. n[1] +
  64856. "; }"
  64857. );
  64858. }
  64859. function r(e, t) {
  64860. var i;
  64861. switch (t) {
  64862. case n.LinearToneMapping:
  64863. i = "Linear";
  64864. break;
  64865. case n.ReinhardToneMapping:
  64866. i = "Reinhard";
  64867. break;
  64868. case n.Uncharted2ToneMapping:
  64869. i = "Uncharted2";
  64870. break;
  64871. case n.CineonToneMapping:
  64872. i = "OptimizedCineon";
  64873. break;
  64874. default:
  64875. throw new Error("unsupported toneMapping: " + t);
  64876. }
  64877. return (
  64878. "vec3 " +
  64879. e +
  64880. "( vec3 color ) { return " +
  64881. i +
  64882. "ToneMapping( color ); }"
  64883. );
  64884. }
  64885. function o(e, t, i) {
  64886. e = e || {};
  64887. var n = [
  64888. e.derivatives ||
  64889. t.envMapCubeUV ||
  64890. t.bumpMap ||
  64891. t.normalMap ||
  64892. t.flatShading
  64893. ? "#extension GL_OES_standard_derivatives : enable"
  64894. : "",
  64895. (e.fragDepth || t.logarithmicDepthBuffer) &&
  64896. i.get("EXT_frag_depth")
  64897. ? "#extension GL_EXT_frag_depth : enable"
  64898. : "",
  64899. e.drawBuffers && i.get("WEBGL_draw_buffers")
  64900. ? "#extension GL_EXT_draw_buffers : require"
  64901. : "",
  64902. (e.shaderTextureLOD || t.envMap) &&
  64903. i.get("EXT_shader_texture_lod")
  64904. ? "#extension GL_EXT_shader_texture_lod : enable"
  64905. : "",
  64906. ];
  64907. return n.filter(c).join("\n");
  64908. }
  64909. function a(e) {
  64910. var t = [];
  64911. for (var i in e) {
  64912. var n = e[i];
  64913. n !== !1 && t.push("#define " + i + " " + n);
  64914. }
  64915. return t.join("\n");
  64916. }
  64917. function s(e, t, i) {
  64918. for (
  64919. var n = {},
  64920. r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS),
  64921. o = 0;
  64922. o < r;
  64923. o++
  64924. ) {
  64925. var a = e.getActiveUniform(t, o),
  64926. s = a.name,
  64927. l = e.getUniformLocation(t, s),
  64928. c = f.exec(s);
  64929. if (c) {
  64930. var h = c[1],
  64931. u = c[2],
  64932. d = n[h];
  64933. d || (d = n[h] = {}), (d[u] = l);
  64934. } else if ((c = g.exec(s))) {
  64935. var p = c[1],
  64936. v = c[2],
  64937. A = c[3],
  64938. y = n[p];
  64939. y || (y = n[p] = []);
  64940. var C = y[v];
  64941. C || (C = y[v] = {}), (C[A] = l);
  64942. } else if ((c = m.exec(s))) {
  64943. var p = c[1];
  64944. n[p] = l;
  64945. } else n[s] = l;
  64946. }
  64947. return n;
  64948. }
  64949. function l(e, t, i) {
  64950. for (
  64951. var n = {},
  64952. r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES),
  64953. o = 0;
  64954. o < r;
  64955. o++
  64956. ) {
  64957. var a = e.getActiveAttrib(t, o),
  64958. s = a.name;
  64959. n[s] = e.getAttribLocation(t, s);
  64960. }
  64961. return n;
  64962. }
  64963. function c(e) {
  64964. return "" !== e;
  64965. }
  64966. function h(e, t) {
  64967. return e
  64968. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  64969. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  64970. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  64971. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights);
  64972. }
  64973. function u(e) {
  64974. function t(e, t) {
  64975. var i = n.ShaderChunk[t];
  64976. if (void 0 === i)
  64977. throw new Error("Can not resolve #include <" + t + ">");
  64978. return u(i);
  64979. }
  64980. var i = /#include +<([\w\d.]+)>/g;
  64981. return e.replace(i, t);
  64982. }
  64983. function d(e) {
  64984. function t(e, t, i, n) {
  64985. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  64986. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  64987. return r;
  64988. }
  64989. var i =
  64990. /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  64991. return e.replace(i, t);
  64992. }
  64993. var p = 0,
  64994. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  64995. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  64996. m = /^([\w\d_]+)\[0\]$/;
  64997. return function (e, f, g, m) {
  64998. var v = e.context,
  64999. A = g.extensions,
  65000. y = g.defines,
  65001. C = g.__webglShader.vertexShader,
  65002. I = g.__webglShader.fragmentShader,
  65003. E = "SHADOWMAP_TYPE_BASIC";
  65004. m.shadowMapType === n.PCFShadowMap
  65005. ? (E = "SHADOWMAP_TYPE_PCF")
  65006. : m.shadowMapType === n.PCFSoftShadowMap &&
  65007. (E = "SHADOWMAP_TYPE_PCF_SOFT");
  65008. var b = "ENVMAP_TYPE_CUBE",
  65009. w = "ENVMAP_MODE_REFLECTION",
  65010. _ = "ENVMAP_BLENDING_MULTIPLY";
  65011. if (m.envMap) {
  65012. switch (g.envMap.mapping) {
  65013. case n.CubeReflectionMapping:
  65014. case n.CubeRefractionMapping:
  65015. b = "ENVMAP_TYPE_CUBE";
  65016. break;
  65017. case n.CubeUVReflectionMapping:
  65018. case n.CubeUVRefractionMapping:
  65019. b = "ENVMAP_TYPE_CUBE_UV";
  65020. break;
  65021. case n.EquirectangularReflectionMapping:
  65022. case n.EquirectangularRefractionMapping:
  65023. b = "ENVMAP_TYPE_EQUIREC";
  65024. break;
  65025. case n.SphericalReflectionMapping:
  65026. b = "ENVMAP_TYPE_SPHERE";
  65027. }
  65028. switch (g.envMap.mapping) {
  65029. case n.CubeRefractionMapping:
  65030. case n.EquirectangularRefractionMapping:
  65031. w = "ENVMAP_MODE_REFRACTION";
  65032. }
  65033. switch (g.combine) {
  65034. case n.MultiplyOperation:
  65035. _ = "ENVMAP_BLENDING_MULTIPLY";
  65036. break;
  65037. case n.MixOperation:
  65038. _ = "ENVMAP_BLENDING_MIX";
  65039. break;
  65040. case n.AddOperation:
  65041. _ = "ENVMAP_BLENDING_ADD";
  65042. }
  65043. }
  65044. var T,
  65045. x,
  65046. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  65047. M = o(A, m, e.extensions),
  65048. R = a(y),
  65049. P = v.createProgram();
  65050. g instanceof n.RawShaderMaterial
  65051. ? ((T = ""), (x = ""))
  65052. : ((T = [
  65053. "precision " + m.precision + " float;",
  65054. "precision " + m.precision + " int;",
  65055. "#define SHADER_NAME " + g.__webglShader.name,
  65056. R,
  65057. m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "",
  65058. "#define GAMMA_FACTOR " + S,
  65059. "#define MAX_BONES " + m.maxBones,
  65060. m.map ? "#define USE_MAP" : "",
  65061. m.envMap ? "#define USE_ENVMAP" : "",
  65062. m.envMap ? "#define " + w : "",
  65063. m.lightMap ? "#define USE_LIGHTMAP" : "",
  65064. m.aoMap ? "#define USE_AOMAP" : "",
  65065. m.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
  65066. m.bumpMap ? "#define USE_BUMPMAP" : "",
  65067. m.normalMap ? "#define USE_NORMALMAP" : "",
  65068. m.displacementMap && m.supportsVertexTextures
  65069. ? "#define USE_DISPLACEMENTMAP"
  65070. : "",
  65071. m.specularMap ? "#define USE_SPECULARMAP" : "",
  65072. m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "",
  65073. m.metalnessMap ? "#define USE_METALNESSMAP" : "",
  65074. m.alphaMap ? "#define USE_ALPHAMAP" : "",
  65075. m.vertexColors ? "#define USE_COLOR" : "",
  65076. m.flatShading ? "#define FLAT_SHADED" : "",
  65077. m.skinning ? "#define USE_SKINNING" : "",
  65078. m.useVertexTexture ? "#define BONE_TEXTURE" : "",
  65079. m.morphTargets ? "#define USE_MORPHTARGETS" : "",
  65080. m.morphNormals && m.flatShading === !1
  65081. ? "#define USE_MORPHNORMALS"
  65082. : "",
  65083. m.doubleSided ? "#define DOUBLE_SIDED" : "",
  65084. m.flipSided ? "#define FLIP_SIDED" : "",
  65085. m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "",
  65086. m.shadowMapEnabled ? "#define " + E : "",
  65087. m.pointLightShadows > 0
  65088. ? "#define POINT_LIGHT_SHADOWS"
  65089. : "",
  65090. m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "",
  65091. m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "",
  65092. m.logarithmicDepthBuffer &&
  65093. e.extensions.get("EXT_frag_depth")
  65094. ? "#define USE_LOGDEPTHBUF_EXT"
  65095. : "",
  65096. "uniform mat4 modelMatrix;",
  65097. "uniform mat4 modelViewMatrix;",
  65098. "uniform mat4 projectionMatrix;",
  65099. "uniform mat4 viewMatrix;",
  65100. "uniform mat3 normalMatrix;",
  65101. "uniform vec3 cameraPosition;",
  65102. "attribute vec3 position;",
  65103. "attribute vec3 normal;",
  65104. "attribute vec2 uv;",
  65105. "#ifdef USE_COLOR",
  65106. "\tattribute vec3 color;",
  65107. "#endif",
  65108. "#ifdef USE_MORPHTARGETS",
  65109. "\tattribute vec3 morphTarget0;",
  65110. "\tattribute vec3 morphTarget1;",
  65111. "\tattribute vec3 morphTarget2;",
  65112. "\tattribute vec3 morphTarget3;",
  65113. "\t#ifdef USE_MORPHNORMALS",
  65114. "\t\tattribute vec3 morphNormal0;",
  65115. "\t\tattribute vec3 morphNormal1;",
  65116. "\t\tattribute vec3 morphNormal2;",
  65117. "\t\tattribute vec3 morphNormal3;",
  65118. "\t#else",
  65119. "\t\tattribute vec3 morphTarget4;",
  65120. "\t\tattribute vec3 morphTarget5;",
  65121. "\t\tattribute vec3 morphTarget6;",
  65122. "\t\tattribute vec3 morphTarget7;",
  65123. "\t#endif",
  65124. "#endif",
  65125. "#ifdef USE_SKINNING",
  65126. "\tattribute vec4 skinIndex;",
  65127. "\tattribute vec4 skinWeight;",
  65128. "#endif",
  65129. "\n",
  65130. ]
  65131. .filter(c)
  65132. .join("\n")),
  65133. (x = [
  65134. M,
  65135. "precision " + m.precision + " float;",
  65136. "precision " + m.precision + " int;",
  65137. "#define SHADER_NAME " + g.__webglShader.name,
  65138. R,
  65139. m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "",
  65140. "#define GAMMA_FACTOR " + S,
  65141. m.useFog && m.fog ? "#define USE_FOG" : "",
  65142. m.useFog && m.fogExp ? "#define FOG_EXP2" : "",
  65143. m.map ? "#define USE_MAP" : "",
  65144. m.envMap ? "#define USE_ENVMAP" : "",
  65145. m.envMap ? "#define " + b : "",
  65146. m.envMap ? "#define " + w : "",
  65147. m.envMap ? "#define " + _ : "",
  65148. m.lightMap ? "#define USE_LIGHTMAP" : "",
  65149. m.aoMap ? "#define USE_AOMAP" : "",
  65150. m.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
  65151. m.bumpMap ? "#define USE_BUMPMAP" : "",
  65152. m.normalMap ? "#define USE_NORMALMAP" : "",
  65153. m.specularMap ? "#define USE_SPECULARMAP" : "",
  65154. m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "",
  65155. m.metalnessMap ? "#define USE_METALNESSMAP" : "",
  65156. m.alphaMap ? "#define USE_ALPHAMAP" : "",
  65157. m.vertexColors ? "#define USE_COLOR" : "",
  65158. m.flatShading ? "#define FLAT_SHADED" : "",
  65159. m.doubleSided ? "#define DOUBLE_SIDED" : "",
  65160. m.flipSided ? "#define FLIP_SIDED" : "",
  65161. m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "",
  65162. m.shadowMapEnabled ? "#define " + E : "",
  65163. m.pointLightShadows > 0
  65164. ? "#define POINT_LIGHT_SHADOWS"
  65165. : "",
  65166. m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "",
  65167. m.physicallyCorrectLights
  65168. ? "#define PHYSICALLY_CORRECT_LIGHTS"
  65169. : "",
  65170. m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "",
  65171. m.logarithmicDepthBuffer &&
  65172. e.extensions.get("EXT_frag_depth")
  65173. ? "#define USE_LOGDEPTHBUF_EXT"
  65174. : "",
  65175. m.envMap && e.extensions.get("EXT_shader_texture_lod")
  65176. ? "#define TEXTURE_LOD_EXT"
  65177. : "",
  65178. "uniform mat4 viewMatrix;",
  65179. "uniform vec3 cameraPosition;",
  65180. m.toneMapping !== n.NoToneMapping
  65181. ? "#define TONE_MAPPING"
  65182. : "",
  65183. m.toneMapping !== n.NoToneMapping
  65184. ? n.ShaderChunk.tonemapping_pars_fragment
  65185. : "",
  65186. m.toneMapping !== n.NoToneMapping
  65187. ? r("toneMapping", m.toneMapping)
  65188. : "",
  65189. m.outputEncoding ||
  65190. m.mapEncoding ||
  65191. m.envMapEncoding ||
  65192. m.emissiveMapEncoding
  65193. ? n.ShaderChunk.encodings_pars_fragment
  65194. : "",
  65195. m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "",
  65196. m.envMapEncoding
  65197. ? t("envMapTexelToLinear", m.envMapEncoding)
  65198. : "",
  65199. m.emissiveMapEncoding
  65200. ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding)
  65201. : "",
  65202. m.outputEncoding
  65203. ? i("linearToOutputTexel", m.outputEncoding)
  65204. : "",
  65205. "\n",
  65206. ]
  65207. .filter(c)
  65208. .join("\n"))),
  65209. (C = u(C, m)),
  65210. (C = h(C, m)),
  65211. (I = u(I, m)),
  65212. (I = h(I, m)),
  65213. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)));
  65214. var O = T + C,
  65215. L = x + I,
  65216. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  65217. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  65218. v.attachShader(P, D),
  65219. v.attachShader(P, N),
  65220. void 0 !== g.index0AttributeName
  65221. ? v.bindAttribLocation(P, 0, g.index0AttributeName)
  65222. : m.morphTargets === !0 &&
  65223. v.bindAttribLocation(P, 0, "position"),
  65224. v.linkProgram(P);
  65225. var B = v.getProgramInfoLog(P),
  65226. F = v.getShaderInfoLog(D),
  65227. V = v.getShaderInfoLog(N),
  65228. U = !0,
  65229. k = !0;
  65230. v.getProgramParameter(P, v.LINK_STATUS) === !1
  65231. ? ((U = !1),
  65232. console.error(
  65233. "THREE.WebGLProgram: shader error: ",
  65234. v.getError(),
  65235. "gl.VALIDATE_STATUS",
  65236. v.getProgramParameter(P, v.VALIDATE_STATUS),
  65237. "gl.getProgramInfoLog",
  65238. B,
  65239. F,
  65240. V
  65241. ))
  65242. : "" !== B
  65243. ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B)
  65244. : ("" !== F && "" !== V) || (k = !1),
  65245. k &&
  65246. (this.diagnostics = {
  65247. runnable: U,
  65248. material: g,
  65249. programLog: B,
  65250. vertexShader: {
  65251. log: F,
  65252. prefix: T,
  65253. },
  65254. fragmentShader: {
  65255. log: V,
  65256. prefix: x,
  65257. },
  65258. }),
  65259. v.deleteShader(D),
  65260. v.deleteShader(N);
  65261. var H;
  65262. this.getUniforms = function () {
  65263. return void 0 === H && (H = s(v, P)), H;
  65264. };
  65265. var G;
  65266. return (
  65267. (this.getAttributes = function () {
  65268. return void 0 === G && (G = l(v, P)), G;
  65269. }),
  65270. (this.destroy = function () {
  65271. v.deleteProgram(P), (this.program = void 0);
  65272. }),
  65273. Object.defineProperties(this, {
  65274. uniforms: {
  65275. get: function () {
  65276. return (
  65277. console.warn(
  65278. "THREE.WebGLProgram: .uniforms is now .getUniforms()."
  65279. ),
  65280. this.getUniforms()
  65281. );
  65282. },
  65283. },
  65284. attributes: {
  65285. get: function () {
  65286. return (
  65287. console.warn(
  65288. "THREE.WebGLProgram: .attributes is now .getAttributes()."
  65289. ),
  65290. this.getAttributes()
  65291. );
  65292. },
  65293. },
  65294. }),
  65295. (this.id = p++),
  65296. (this.code = f),
  65297. (this.usedTimes = 1),
  65298. (this.program = P),
  65299. (this.vertexShader = D),
  65300. (this.fragmentShader = N),
  65301. this
  65302. );
  65303. };
  65304. })()),
  65305. (n.WebGLPrograms = function (e, t) {
  65306. function i(e) {
  65307. if (
  65308. t.floatVertexTextures &&
  65309. e &&
  65310. e.skeleton &&
  65311. e.skeleton.useVertexTexture
  65312. )
  65313. return 1024;
  65314. var i = t.maxVertexUniforms,
  65315. r = Math.floor((i - 20) / 4),
  65316. o = r;
  65317. return (
  65318. void 0 !== e &&
  65319. e instanceof n.SkinnedMesh &&
  65320. ((o = Math.min(e.skeleton.bones.length, o)),
  65321. o < e.skeleton.bones.length &&
  65322. console.warn(
  65323. "WebGLRenderer: too many bones - " +
  65324. e.skeleton.bones.length +
  65325. ", this GPU supports just " +
  65326. o +
  65327. " (try OpenGL instead of ANGLE)"
  65328. )),
  65329. o
  65330. );
  65331. }
  65332. function r(e, t) {
  65333. var i;
  65334. return (
  65335. e
  65336. ? e instanceof n.Texture
  65337. ? (i = e.encoding)
  65338. : e instanceof n.WebGLRenderTarget &&
  65339. (i = e.texture.encoding)
  65340. : (i = n.LinearEncoding),
  65341. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  65342. i
  65343. );
  65344. }
  65345. var o = [],
  65346. a = {
  65347. MeshDepthMaterial: "depth",
  65348. MeshNormalMaterial: "normal",
  65349. MeshBasicMaterial: "basic",
  65350. MeshLambertMaterial: "lambert",
  65351. MeshPhongMaterial: "phong",
  65352. MeshStandardMaterial: "standard",
  65353. LineBasicMaterial: "basic",
  65354. LineDashedMaterial: "dashed",
  65355. PointsMaterial: "points",
  65356. },
  65357. s = [
  65358. "precision",
  65359. "supportsVertexTextures",
  65360. "map",
  65361. "mapEncoding",
  65362. "envMap",
  65363. "envMapMode",
  65364. "envMapEncoding",
  65365. "lightMap",
  65366. "aoMap",
  65367. "emissiveMap",
  65368. "emissiveMapEncoding",
  65369. "bumpMap",
  65370. "normalMap",
  65371. "displacementMap",
  65372. "specularMap",
  65373. "roughnessMap",
  65374. "metalnessMap",
  65375. "alphaMap",
  65376. "combine",
  65377. "vertexColors",
  65378. "fog",
  65379. "useFog",
  65380. "fogExp",
  65381. "flatShading",
  65382. "sizeAttenuation",
  65383. "logarithmicDepthBuffer",
  65384. "skinning",
  65385. "maxBones",
  65386. "useVertexTexture",
  65387. "morphTargets",
  65388. "morphNormals",
  65389. "maxMorphTargets",
  65390. "maxMorphNormals",
  65391. "premultipliedAlpha",
  65392. "numDirLights",
  65393. "numPointLights",
  65394. "numSpotLights",
  65395. "numHemiLights",
  65396. "shadowMapEnabled",
  65397. "pointLightShadows",
  65398. "toneMapping",
  65399. "physicallyCorrectLights",
  65400. "shadowMapType",
  65401. "alphaTest",
  65402. "doubleSided",
  65403. "flipSided",
  65404. ];
  65405. (this.getParameters = function (o, s, l, c) {
  65406. var h = a[o.type],
  65407. u = i(c),
  65408. d = e.getPrecision();
  65409. null !== o.precision &&
  65410. ((d = t.getMaxPrecision(o.precision)),
  65411. d !== o.precision &&
  65412. console.warn(
  65413. "THREE.WebGLProgram.getParameters:",
  65414. o.precision,
  65415. "not supported, using",
  65416. d,
  65417. "instead."
  65418. ));
  65419. var p = {
  65420. shaderID: h,
  65421. precision: d,
  65422. supportsVertexTextures: t.vertexTextures,
  65423. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  65424. map: !!o.map,
  65425. mapEncoding: r(o.map, e.gammaInput),
  65426. envMap: !!o.envMap,
  65427. envMapMode: o.envMap && o.envMap.mapping,
  65428. envMapEncoding: r(o.envMap, e.gammaInput),
  65429. envMapCubeUV:
  65430. !!o.envMap &&
  65431. (o.envMap.mapping === n.CubeUVReflectionMapping ||
  65432. o.envMap.mapping === n.CubeUVRefractionMapping),
  65433. lightMap: !!o.lightMap,
  65434. aoMap: !!o.aoMap,
  65435. emissiveMap: !!o.emissiveMap,
  65436. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  65437. bumpMap: !!o.bumpMap,
  65438. normalMap: !!o.normalMap,
  65439. displacementMap: !!o.displacementMap,
  65440. roughnessMap: !!o.roughnessMap,
  65441. metalnessMap: !!o.metalnessMap,
  65442. specularMap: !!o.specularMap,
  65443. alphaMap: !!o.alphaMap,
  65444. combine: o.combine,
  65445. vertexColors: o.vertexColors,
  65446. fog: l,
  65447. useFog: o.fog,
  65448. fogExp: l instanceof n.FogExp2,
  65449. flatShading: o.shading === n.FlatShading,
  65450. sizeAttenuation: o.sizeAttenuation,
  65451. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  65452. skinning: o.skinning,
  65453. maxBones: u,
  65454. useVertexTexture:
  65455. t.floatVertexTextures &&
  65456. c &&
  65457. c.skeleton &&
  65458. c.skeleton.useVertexTexture,
  65459. morphTargets: o.morphTargets,
  65460. morphNormals: o.morphNormals,
  65461. maxMorphTargets: e.maxMorphTargets,
  65462. maxMorphNormals: e.maxMorphNormals,
  65463. numDirLights: s.directional.length,
  65464. numPointLights: s.point.length,
  65465. numSpotLights: s.spot.length,
  65466. numHemiLights: s.hemi.length,
  65467. pointLightShadows: s.shadowsPointLight,
  65468. shadowMapEnabled:
  65469. e.shadowMap.enabled &&
  65470. c.receiveShadow &&
  65471. s.shadows.length > 0,
  65472. shadowMapType: e.shadowMap.type,
  65473. toneMapping: e.toneMapping,
  65474. physicallyCorrectLights: e.physicallyCorrectLights,
  65475. premultipliedAlpha: o.premultipliedAlpha,
  65476. alphaTest: o.alphaTest,
  65477. doubleSided: o.side === n.DoubleSide,
  65478. flipSided: o.side === n.BackSide,
  65479. };
  65480. return p;
  65481. }),
  65482. (this.getProgramCode = function (e, t) {
  65483. var i = [];
  65484. if (
  65485. (t.shaderID
  65486. ? i.push(t.shaderID)
  65487. : (i.push(e.fragmentShader), i.push(e.vertexShader)),
  65488. void 0 !== e.defines)
  65489. )
  65490. for (var n in e.defines) i.push(n), i.push(e.defines[n]);
  65491. for (var r = 0; r < s.length; r++) {
  65492. var o = s[r];
  65493. i.push(o), i.push(t[o]);
  65494. }
  65495. return i.join();
  65496. }),
  65497. (this.acquireProgram = function (t, i, r) {
  65498. for (var a, s = 0, l = o.length; s < l; s++) {
  65499. var c = o[s];
  65500. if (c.code === r) {
  65501. (a = c), ++a.usedTimes;
  65502. break;
  65503. }
  65504. }
  65505. return (
  65506. void 0 === a &&
  65507. ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)),
  65508. a
  65509. );
  65510. }),
  65511. (this.releaseProgram = function (e) {
  65512. if (0 === --e.usedTimes) {
  65513. var t = o.indexOf(e);
  65514. (o[t] = o[o.length - 1]), o.pop(), e.destroy();
  65515. }
  65516. }),
  65517. (this.programs = o);
  65518. }),
  65519. (n.WebGLProperties = function () {
  65520. var e = {};
  65521. (this.get = function (t) {
  65522. var i = t.uuid,
  65523. n = e[i];
  65524. return void 0 === n && ((n = {}), (e[i] = n)), n;
  65525. }),
  65526. (this.delete = function (t) {
  65527. delete e[t.uuid];
  65528. }),
  65529. (this.clear = function () {
  65530. e = {};
  65531. });
  65532. }),
  65533. (n.WebGLShader = (function () {
  65534. function e(e) {
  65535. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  65536. t[i] = i + 1 + ": " + t[i];
  65537. return t.join("\n");
  65538. }
  65539. return function (t, i, n) {
  65540. var r = t.createShader(i);
  65541. return (
  65542. t.shaderSource(r, n),
  65543. t.compileShader(r),
  65544. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 &&
  65545. console.error("THREE.WebGLShader: Shader couldn't compile."),
  65546. "" !== t.getShaderInfoLog(r) &&
  65547. console.warn(
  65548. "THREE.WebGLShader: gl.getShaderInfoLog()",
  65549. i === t.VERTEX_SHADER ? "vertex" : "fragment",
  65550. t.getShaderInfoLog(r),
  65551. e(n)
  65552. ),
  65553. r
  65554. );
  65555. };
  65556. })()),
  65557. (n.WebGLShadowMap = function (e, t, i) {
  65558. function r(e, t, i, r) {
  65559. var o = e.geometry,
  65560. a = null,
  65561. s = v,
  65562. l = e.customDepthMaterial;
  65563. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l;
  65564. else {
  65565. var c =
  65566. void 0 !== o.morphTargets &&
  65567. o.morphTargets.length > 0 &&
  65568. t.morphTargets,
  65569. h = e instanceof n.SkinnedMesh && t.skinning,
  65570. u = 0;
  65571. c && (u |= f), h && (u |= g), (a = s[u]);
  65572. }
  65573. return (
  65574. (a.visible = t.visible),
  65575. (a.wireframe = t.wireframe),
  65576. (a.wireframeLinewidth = t.wireframeLinewidth),
  65577. i &&
  65578. void 0 !== a.uniforms.lightPos &&
  65579. a.uniforms.lightPos.value.copy(r),
  65580. a
  65581. );
  65582. }
  65583. function o(e, t, i) {
  65584. if (e.visible !== !1) {
  65585. if (
  65586. e.layers.test(t.layers) &&
  65587. (e instanceof n.Mesh ||
  65588. e instanceof n.Line ||
  65589. e instanceof n.Points) &&
  65590. e.castShadow &&
  65591. (e.frustumCulled === !1 || l.intersectsObject(e) === !0)
  65592. ) {
  65593. var r = e.material;
  65594. r.visible === !0 &&
  65595. (e.modelViewMatrix.multiplyMatrices(
  65596. i.matrixWorldInverse,
  65597. e.matrixWorld
  65598. ),
  65599. p.push(e));
  65600. }
  65601. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  65602. o(a[s], t, i);
  65603. }
  65604. }
  65605. for (
  65606. var a = e.context,
  65607. s = e.state,
  65608. l = new n.Frustum(),
  65609. c = new n.Matrix4(),
  65610. h = new n.Vector2(),
  65611. u = new n.Vector3(),
  65612. d = new n.Vector3(),
  65613. p = [],
  65614. f = 1,
  65615. g = 2,
  65616. m = (f | g) + 1,
  65617. v = new Array(m),
  65618. A = new Array(m),
  65619. y = [
  65620. new n.Vector3(1, 0, 0),
  65621. new n.Vector3(-1, 0, 0),
  65622. new n.Vector3(0, 0, 1),
  65623. new n.Vector3(0, 0, -1),
  65624. new n.Vector3(0, 1, 0),
  65625. new n.Vector3(0, -1, 0),
  65626. ],
  65627. C = [
  65628. new n.Vector3(0, 1, 0),
  65629. new n.Vector3(0, 1, 0),
  65630. new n.Vector3(0, 1, 0),
  65631. new n.Vector3(0, 1, 0),
  65632. new n.Vector3(0, 0, 1),
  65633. new n.Vector3(0, 0, -1),
  65634. ],
  65635. I = [
  65636. new n.Vector4(),
  65637. new n.Vector4(),
  65638. new n.Vector4(),
  65639. new n.Vector4(),
  65640. new n.Vector4(),
  65641. new n.Vector4(),
  65642. ],
  65643. E = n.ShaderLib.depthRGBA,
  65644. b = n.UniformsUtils.clone(E.uniforms),
  65645. w = n.ShaderLib.distanceRGBA,
  65646. _ = n.UniformsUtils.clone(w.uniforms),
  65647. T = 0;
  65648. T !== m;
  65649. ++T
  65650. ) {
  65651. var x = 0 !== (T & f),
  65652. S = 0 !== (T & g),
  65653. M = new n.ShaderMaterial({
  65654. uniforms: b,
  65655. vertexShader: E.vertexShader,
  65656. fragmentShader: E.fragmentShader,
  65657. morphTargets: x,
  65658. skinning: S,
  65659. });
  65660. v[T] = M;
  65661. var R = new n.ShaderMaterial({
  65662. defines: {
  65663. USE_SHADOWMAP: "",
  65664. },
  65665. uniforms: _,
  65666. vertexShader: w.vertexShader,
  65667. fragmentShader: w.fragmentShader,
  65668. morphTargets: x,
  65669. skinning: S,
  65670. });
  65671. A[T] = R;
  65672. }
  65673. var P = this;
  65674. (this.enabled = !1),
  65675. (this.autoUpdate = !0),
  65676. (this.needsUpdate = !1),
  65677. (this.type = n.PCFShadowMap),
  65678. (this.cullFace = n.CullFaceFront),
  65679. (this.render = function (f, g) {
  65680. var m,
  65681. v,
  65682. A = t.shadows;
  65683. if (
  65684. 0 !== A.length &&
  65685. P.enabled !== !1 &&
  65686. (P.autoUpdate !== !1 || P.needsUpdate !== !1)
  65687. ) {
  65688. s.clearColor(1, 1, 1, 1),
  65689. s.disable(a.BLEND),
  65690. s.enable(a.CULL_FACE),
  65691. a.frontFace(a.CCW),
  65692. a.cullFace(
  65693. P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK
  65694. ),
  65695. s.setDepthTest(!0),
  65696. s.setScissorTest(!1);
  65697. for (var E = 0, b = A.length; E < b; E++) {
  65698. var w = A[E],
  65699. _ = w.shadow,
  65700. T = _.camera;
  65701. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  65702. (m = 6), (v = !0);
  65703. var x = h.x,
  65704. S = h.y;
  65705. I[0].set(2 * x, S, x, S),
  65706. I[1].set(0, S, x, S),
  65707. I[2].set(3 * x, S, x, S),
  65708. I[3].set(x, S, x, S),
  65709. I[4].set(3 * x, 0, x, S),
  65710. I[5].set(x, 0, x, S),
  65711. (h.x *= 4),
  65712. (h.y *= 2);
  65713. } else (m = 1), (v = !1);
  65714. if (null === _.map) {
  65715. var M = {
  65716. minFilter: n.NearestFilter,
  65717. magFilter: n.NearestFilter,
  65718. format: n.RGBAFormat,
  65719. };
  65720. (_.map = new n.WebGLRenderTarget(h.x, h.y, M)),
  65721. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  65722. T.updateProjectionMatrix();
  65723. }
  65724. var R = _.map,
  65725. O = _.matrix;
  65726. d.setFromMatrixPosition(w.matrixWorld),
  65727. T.position.copy(d),
  65728. e.setRenderTarget(R),
  65729. e.clear();
  65730. for (var L = 0; L < m; L++) {
  65731. if (v) {
  65732. u.copy(T.position),
  65733. u.add(y[L]),
  65734. T.up.copy(C[L]),
  65735. T.lookAt(u);
  65736. var D = I[L];
  65737. s.viewport(D);
  65738. } else
  65739. u.setFromMatrixPosition(w.target.matrixWorld),
  65740. T.lookAt(u);
  65741. T.updateMatrixWorld(),
  65742. T.matrixWorldInverse.getInverse(T.matrixWorld),
  65743. O.set(
  65744. 0.5,
  65745. 0,
  65746. 0,
  65747. 0.5,
  65748. 0,
  65749. 0.5,
  65750. 0,
  65751. 0.5,
  65752. 0,
  65753. 0,
  65754. 0.5,
  65755. 0.5,
  65756. 0,
  65757. 0,
  65758. 0,
  65759. 1
  65760. ),
  65761. O.multiply(T.projectionMatrix),
  65762. O.multiply(T.matrixWorldInverse),
  65763. c.multiplyMatrices(
  65764. T.projectionMatrix,
  65765. T.matrixWorldInverse
  65766. ),
  65767. l.setFromMatrix(c),
  65768. (p.length = 0),
  65769. o(f, g, T);
  65770. for (var N = 0, B = p.length; N < B; N++) {
  65771. var F = p[N],
  65772. V = i.update(F),
  65773. U = F.material;
  65774. if (U instanceof n.MultiMaterial)
  65775. for (
  65776. var k = V.groups,
  65777. H = U.materials,
  65778. G = 0,
  65779. z = k.length;
  65780. G < z;
  65781. G++
  65782. ) {
  65783. var W = k[G],
  65784. j = H[W.materialIndex];
  65785. if (j.visible === !0) {
  65786. var Y = r(F, j, v, d);
  65787. e.renderBufferDirect(T, null, V, Y, F, W);
  65788. }
  65789. }
  65790. else {
  65791. var Y = r(F, U, v, d);
  65792. e.renderBufferDirect(T, null, V, Y, F, null);
  65793. }
  65794. }
  65795. }
  65796. }
  65797. var X = e.getClearColor(),
  65798. Z = e.getClearAlpha();
  65799. e.setClearColor(X, Z),
  65800. s.enable(a.BLEND),
  65801. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  65802. (P.needsUpdate = !1);
  65803. }
  65804. });
  65805. }),
  65806. (n.WebGLState = function (e, t, i) {
  65807. var r = this,
  65808. o = new n.Vector4(),
  65809. a = new Uint8Array(16),
  65810. s = new Uint8Array(16),
  65811. l = new Uint8Array(16),
  65812. c = {},
  65813. h = null,
  65814. u = null,
  65815. d = null,
  65816. p = null,
  65817. f = null,
  65818. g = null,
  65819. m = null,
  65820. v = null,
  65821. A = !1,
  65822. y = null,
  65823. C = null,
  65824. I = null,
  65825. E = null,
  65826. b = null,
  65827. w = null,
  65828. _ = null,
  65829. T = null,
  65830. x = null,
  65831. S = null,
  65832. M = null,
  65833. R = null,
  65834. P = null,
  65835. O = null,
  65836. L = null,
  65837. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  65838. N = void 0,
  65839. B = {},
  65840. F = new n.Vector4(),
  65841. V = null,
  65842. U = null,
  65843. k = new n.Vector4(),
  65844. H = new n.Vector4(),
  65845. G = e.createTexture();
  65846. e.bindTexture(e.TEXTURE_2D, G),
  65847. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  65848. e.texImage2D(
  65849. e.TEXTURE_2D,
  65850. 0,
  65851. e.RGB,
  65852. 1,
  65853. 1,
  65854. 0,
  65855. e.RGB,
  65856. e.UNSIGNED_BYTE,
  65857. new Uint8Array(3)
  65858. ),
  65859. (this.init = function () {
  65860. this.clearColor(0, 0, 0, 1),
  65861. this.clearDepth(1),
  65862. this.clearStencil(0),
  65863. this.enable(e.DEPTH_TEST),
  65864. e.depthFunc(e.LEQUAL),
  65865. e.frontFace(e.CCW),
  65866. e.cullFace(e.BACK),
  65867. this.enable(e.CULL_FACE),
  65868. this.enable(e.BLEND),
  65869. e.blendEquation(e.FUNC_ADD),
  65870. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  65871. }),
  65872. (this.initAttributes = function () {
  65873. for (var e = 0, t = a.length; e < t; e++) a[e] = 0;
  65874. }),
  65875. (this.enableAttribute = function (i) {
  65876. if (
  65877. ((a[i] = 1),
  65878. 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)),
  65879. 0 !== l[i])
  65880. ) {
  65881. var n = t.get("ANGLE_instanced_arrays");
  65882. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0);
  65883. }
  65884. }),
  65885. (this.enableAttributeAndDivisor = function (t, i, n) {
  65886. (a[t] = 1),
  65887. 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)),
  65888. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i));
  65889. }),
  65890. (this.disableUnusedAttributes = function () {
  65891. for (var t = 0, i = s.length; t < i; t++)
  65892. s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  65893. }),
  65894. (this.enable = function (t) {
  65895. c[t] !== !0 && (e.enable(t), (c[t] = !0));
  65896. }),
  65897. (this.disable = function (t) {
  65898. c[t] !== !1 && (e.disable(t), (c[t] = !1));
  65899. }),
  65900. (this.getCompressedTextureFormats = function () {
  65901. if (
  65902. null === h &&
  65903. ((h = []),
  65904. t.get("WEBGL_compressed_texture_pvrtc") ||
  65905. t.get("WEBGL_compressed_texture_s3tc") ||
  65906. t.get("WEBGL_compressed_texture_etc1"))
  65907. )
  65908. for (
  65909. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  65910. n < i.length;
  65911. n++
  65912. )
  65913. h.push(i[n]);
  65914. return h;
  65915. }),
  65916. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  65917. t === n.NoBlending
  65918. ? this.disable(e.BLEND)
  65919. : this.enable(e.BLEND),
  65920. (t === u && h === A) ||
  65921. (t === n.AdditiveBlending
  65922. ? h
  65923. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65924. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  65925. : (e.blendEquation(e.FUNC_ADD),
  65926. e.blendFunc(e.SRC_ALPHA, e.ONE))
  65927. : t === n.SubtractiveBlending
  65928. ? h
  65929. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65930. e.blendFuncSeparate(
  65931. e.ZERO,
  65932. e.ZERO,
  65933. e.ONE_MINUS_SRC_COLOR,
  65934. e.ONE_MINUS_SRC_ALPHA
  65935. ))
  65936. : (e.blendEquation(e.FUNC_ADD),
  65937. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  65938. : t === n.MultiplyBlending
  65939. ? h
  65940. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65941. e.blendFuncSeparate(
  65942. e.ZERO,
  65943. e.ZERO,
  65944. e.SRC_COLOR,
  65945. e.SRC_ALPHA
  65946. ))
  65947. : (e.blendEquation(e.FUNC_ADD),
  65948. e.blendFunc(e.ZERO, e.SRC_COLOR))
  65949. : h
  65950. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65951. e.blendFuncSeparate(
  65952. e.ONE,
  65953. e.ONE_MINUS_SRC_ALPHA,
  65954. e.ONE,
  65955. e.ONE_MINUS_SRC_ALPHA
  65956. ))
  65957. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  65958. e.blendFuncSeparate(
  65959. e.SRC_ALPHA,
  65960. e.ONE_MINUS_SRC_ALPHA,
  65961. e.ONE,
  65962. e.ONE_MINUS_SRC_ALPHA
  65963. )),
  65964. (u = t),
  65965. (A = h)),
  65966. t === n.CustomBlending
  65967. ? ((s = s || r),
  65968. (l = l || o),
  65969. (c = c || a),
  65970. (r === d && s === g) ||
  65971. (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  65972. (o === p && a === f && l === m && c === v) ||
  65973. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  65974. (p = o),
  65975. (f = a),
  65976. (m = l),
  65977. (v = c)))
  65978. : ((d = null),
  65979. (p = null),
  65980. (f = null),
  65981. (g = null),
  65982. (m = null),
  65983. (v = null));
  65984. }),
  65985. (this.setDepthFunc = function (t) {
  65986. if (y !== t) {
  65987. if (t)
  65988. switch (t) {
  65989. case n.NeverDepth:
  65990. e.depthFunc(e.NEVER);
  65991. break;
  65992. case n.AlwaysDepth:
  65993. e.depthFunc(e.ALWAYS);
  65994. break;
  65995. case n.LessDepth:
  65996. e.depthFunc(e.LESS);
  65997. break;
  65998. case n.LessEqualDepth:
  65999. e.depthFunc(e.LEQUAL);
  66000. break;
  66001. case n.EqualDepth:
  66002. e.depthFunc(e.EQUAL);
  66003. break;
  66004. case n.GreaterEqualDepth:
  66005. e.depthFunc(e.GEQUAL);
  66006. break;
  66007. case n.GreaterDepth:
  66008. e.depthFunc(e.GREATER);
  66009. break;
  66010. case n.NotEqualDepth:
  66011. e.depthFunc(e.NOTEQUAL);
  66012. break;
  66013. default:
  66014. e.depthFunc(e.LEQUAL);
  66015. }
  66016. else e.depthFunc(e.LEQUAL);
  66017. y = t;
  66018. }
  66019. }),
  66020. (this.setDepthTest = function (t) {
  66021. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  66022. }),
  66023. (this.setDepthWrite = function (t) {
  66024. C !== t && (e.depthMask(t), (C = t));
  66025. }),
  66026. (this.setColorWrite = function (t) {
  66027. I !== t && (e.colorMask(t, t, t, t), (I = t));
  66028. }),
  66029. (this.setStencilFunc = function (t, i, n) {
  66030. (b === t && w === i && _ === n) ||
  66031. (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n));
  66032. }),
  66033. (this.setStencilOp = function (t, i, n) {
  66034. (T === t && x === i && S === n) ||
  66035. (e.stencilOp(t, i, n), (T = t), (x = i), (S = n));
  66036. }),
  66037. (this.setStencilTest = function (t) {
  66038. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  66039. }),
  66040. (this.setStencilWrite = function (t) {
  66041. E !== t && (e.stencilMask(t), (E = t));
  66042. }),
  66043. (this.setFlipSided = function (t) {
  66044. M !== t &&
  66045. (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t));
  66046. }),
  66047. (this.setLineWidth = function (t) {
  66048. t !== R && (e.lineWidth(t), (R = t));
  66049. }),
  66050. (this.setPolygonOffset = function (t, i, n) {
  66051. t
  66052. ? this.enable(e.POLYGON_OFFSET_FILL)
  66053. : this.disable(e.POLYGON_OFFSET_FILL),
  66054. !t ||
  66055. (P === i && O === n) ||
  66056. (e.polygonOffset(i, n), (P = i), (O = n));
  66057. }),
  66058. (this.getScissorTest = function () {
  66059. return L;
  66060. }),
  66061. (this.setScissorTest = function (t) {
  66062. (L = t),
  66063. t
  66064. ? this.enable(e.SCISSOR_TEST)
  66065. : this.disable(e.SCISSOR_TEST);
  66066. }),
  66067. (this.activeTexture = function (t) {
  66068. void 0 === t && (t = e.TEXTURE0 + D - 1),
  66069. N !== t && (e.activeTexture(t), (N = t));
  66070. }),
  66071. (this.bindTexture = function (t, i) {
  66072. void 0 === N && r.activeTexture();
  66073. var n = B[N];
  66074. void 0 === n &&
  66075. ((n = {
  66076. type: void 0,
  66077. texture: void 0,
  66078. }),
  66079. (B[N] = n)),
  66080. (n.type === t && n.texture === i) ||
  66081. (e.bindTexture(t, i || G), (n.type = t), (n.texture = i));
  66082. }),
  66083. (this.compressedTexImage2D = function () {
  66084. try {
  66085. e.compressedTexImage2D.apply(e, arguments);
  66086. } catch (e) {
  66087. console.error(e);
  66088. }
  66089. }),
  66090. (this.texImage2D = function () {
  66091. try {
  66092. e.texImage2D.apply(e, arguments);
  66093. } catch (e) {
  66094. console.error(e);
  66095. }
  66096. }),
  66097. (this.clearColor = function (t, i, n, r) {
  66098. o.set(t, i, n, r),
  66099. F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o));
  66100. }),
  66101. (this.clearDepth = function (t) {
  66102. V !== t && (e.clearDepth(t), (V = t));
  66103. }),
  66104. (this.clearStencil = function (t) {
  66105. U !== t && (e.clearStencil(t), (U = t));
  66106. }),
  66107. (this.scissor = function (t) {
  66108. k.equals(t) === !1 &&
  66109. (e.scissor(t.x, t.y, t.z, t.w), k.copy(t));
  66110. }),
  66111. (this.viewport = function (t) {
  66112. H.equals(t) === !1 &&
  66113. (e.viewport(t.x, t.y, t.z, t.w), H.copy(t));
  66114. }),
  66115. (this.reset = function () {
  66116. for (var t = 0; t < s.length; t++)
  66117. 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  66118. (c = {}),
  66119. (h = null),
  66120. (N = void 0),
  66121. (B = {}),
  66122. (u = null),
  66123. (I = null),
  66124. (C = null),
  66125. (E = null),
  66126. (M = null);
  66127. });
  66128. }),
  66129. (n.LensFlarePlugin = function (e, t) {
  66130. function i() {
  66131. var e = new Float32Array([
  66132. -1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1,
  66133. ]),
  66134. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  66135. (o = p.createBuffer()),
  66136. (a = p.createBuffer()),
  66137. p.bindBuffer(p.ARRAY_BUFFER, o),
  66138. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  66139. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  66140. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  66141. (u = p.createTexture()),
  66142. (d = p.createTexture()),
  66143. f.bindTexture(p.TEXTURE_2D, u),
  66144. p.texImage2D(
  66145. p.TEXTURE_2D,
  66146. 0,
  66147. p.RGB,
  66148. 16,
  66149. 16,
  66150. 0,
  66151. p.RGB,
  66152. p.UNSIGNED_BYTE,
  66153. null
  66154. ),
  66155. p.texParameteri(
  66156. p.TEXTURE_2D,
  66157. p.TEXTURE_WRAP_S,
  66158. p.CLAMP_TO_EDGE
  66159. ),
  66160. p.texParameteri(
  66161. p.TEXTURE_2D,
  66162. p.TEXTURE_WRAP_T,
  66163. p.CLAMP_TO_EDGE
  66164. ),
  66165. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  66166. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  66167. f.bindTexture(p.TEXTURE_2D, d),
  66168. p.texImage2D(
  66169. p.TEXTURE_2D,
  66170. 0,
  66171. p.RGBA,
  66172. 16,
  66173. 16,
  66174. 0,
  66175. p.RGBA,
  66176. p.UNSIGNED_BYTE,
  66177. null
  66178. ),
  66179. p.texParameteri(
  66180. p.TEXTURE_2D,
  66181. p.TEXTURE_WRAP_S,
  66182. p.CLAMP_TO_EDGE
  66183. ),
  66184. p.texParameteri(
  66185. p.TEXTURE_2D,
  66186. p.TEXTURE_WRAP_T,
  66187. p.CLAMP_TO_EDGE
  66188. ),
  66189. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  66190. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  66191. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0);
  66192. var i;
  66193. (i = h
  66194. ? {
  66195. vertexShader: [
  66196. "uniform lowp int renderType;",
  66197. "uniform vec3 screenPosition;",
  66198. "uniform vec2 scale;",
  66199. "uniform float rotation;",
  66200. "uniform sampler2D occlusionMap;",
  66201. "attribute vec2 position;",
  66202. "attribute vec2 uv;",
  66203. "varying vec2 vUV;",
  66204. "varying float vVisibility;",
  66205. "void main() {",
  66206. "vUV = uv;",
  66207. "vec2 pos = position;",
  66208. "if ( renderType == 2 ) {",
  66209. "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );",
  66210. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );",
  66211. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );",
  66212. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );",
  66213. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );",
  66214. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );",
  66215. "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );",
  66216. "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );",
  66217. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );",
  66218. "vVisibility = visibility.r / 9.0;",
  66219. "vVisibility *= 1.0 - visibility.g / 9.0;",
  66220. "vVisibility *= visibility.b / 9.0;",
  66221. "vVisibility *= 1.0 - visibility.a / 9.0;",
  66222. "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;",
  66223. "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;",
  66224. "}",
  66225. "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );",
  66226. "}",
  66227. ].join("\n"),
  66228. fragmentShader: [
  66229. "uniform lowp int renderType;",
  66230. "uniform sampler2D map;",
  66231. "uniform float opacity;",
  66232. "uniform vec3 color;",
  66233. "varying vec2 vUV;",
  66234. "varying float vVisibility;",
  66235. "void main() {",
  66236. "if ( renderType == 0 ) {",
  66237. "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );",
  66238. "} else if ( renderType == 1 ) {",
  66239. "gl_FragColor = texture2D( map, vUV );",
  66240. "} else {",
  66241. "vec4 texture = texture2D( map, vUV );",
  66242. "texture.a *= opacity * vVisibility;",
  66243. "gl_FragColor = texture;",
  66244. "gl_FragColor.rgb *= color;",
  66245. "}",
  66246. "}",
  66247. ].join("\n"),
  66248. }
  66249. : {
  66250. vertexShader: [
  66251. "uniform lowp int renderType;",
  66252. "uniform vec3 screenPosition;",
  66253. "uniform vec2 scale;",
  66254. "uniform float rotation;",
  66255. "attribute vec2 position;",
  66256. "attribute vec2 uv;",
  66257. "varying vec2 vUV;",
  66258. "void main() {",
  66259. "vUV = uv;",
  66260. "vec2 pos = position;",
  66261. "if ( renderType == 2 ) {",
  66262. "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;",
  66263. "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;",
  66264. "}",
  66265. "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );",
  66266. "}",
  66267. ].join("\n"),
  66268. fragmentShader: [
  66269. "precision mediump float;",
  66270. "uniform lowp int renderType;",
  66271. "uniform sampler2D map;",
  66272. "uniform sampler2D occlusionMap;",
  66273. "uniform float opacity;",
  66274. "uniform vec3 color;",
  66275. "varying vec2 vUV;",
  66276. "void main() {",
  66277. "if ( renderType == 0 ) {",
  66278. "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );",
  66279. "} else if ( renderType == 1 ) {",
  66280. "gl_FragColor = texture2D( map, vUV );",
  66281. "} else {",
  66282. "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;",
  66283. "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;",
  66284. "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;",
  66285. "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;",
  66286. "visibility = ( 1.0 - visibility / 4.0 );",
  66287. "vec4 texture = texture2D( map, vUV );",
  66288. "texture.a *= opacity * visibility;",
  66289. "gl_FragColor = texture;",
  66290. "gl_FragColor.rgb *= color;",
  66291. "}",
  66292. "}",
  66293. ].join("\n"),
  66294. }),
  66295. (s = r(i)),
  66296. (l = {
  66297. vertex: p.getAttribLocation(s, "position"),
  66298. uv: p.getAttribLocation(s, "uv"),
  66299. }),
  66300. (c = {
  66301. renderType: p.getUniformLocation(s, "renderType"),
  66302. map: p.getUniformLocation(s, "map"),
  66303. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  66304. opacity: p.getUniformLocation(s, "opacity"),
  66305. color: p.getUniformLocation(s, "color"),
  66306. scale: p.getUniformLocation(s, "scale"),
  66307. rotation: p.getUniformLocation(s, "rotation"),
  66308. screenPosition: p.getUniformLocation(s, "screenPosition"),
  66309. });
  66310. }
  66311. function r(t) {
  66312. var i = p.createProgram(),
  66313. n = p.createShader(p.FRAGMENT_SHADER),
  66314. r = p.createShader(p.VERTEX_SHADER),
  66315. o = "precision " + e.getPrecision() + " float;\n";
  66316. return (
  66317. p.shaderSource(n, o + t.fragmentShader),
  66318. p.shaderSource(r, o + t.vertexShader),
  66319. p.compileShader(n),
  66320. p.compileShader(r),
  66321. p.attachShader(i, n),
  66322. p.attachShader(i, r),
  66323. p.linkProgram(i),
  66324. i
  66325. );
  66326. }
  66327. var o,
  66328. a,
  66329. s,
  66330. l,
  66331. c,
  66332. h,
  66333. u,
  66334. d,
  66335. p = e.context,
  66336. f = e.state;
  66337. this.render = function (r, g, m) {
  66338. if (0 !== t.length) {
  66339. var v = new n.Vector3(),
  66340. A = m.w / m.z,
  66341. y = 0.5 * m.z,
  66342. C = 0.5 * m.w,
  66343. I = 16 / m.w,
  66344. E = new n.Vector2(I * A, I),
  66345. b = new n.Vector3(1, 1, 0),
  66346. w = new n.Vector2(1, 1);
  66347. void 0 === s && i(),
  66348. p.useProgram(s),
  66349. f.initAttributes(),
  66350. f.enableAttribute(l.vertex),
  66351. f.enableAttribute(l.uv),
  66352. f.disableUnusedAttributes(),
  66353. p.uniform1i(c.occlusionMap, 0),
  66354. p.uniform1i(c.map, 1),
  66355. p.bindBuffer(p.ARRAY_BUFFER, o),
  66356. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  66357. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  66358. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  66359. f.disable(p.CULL_FACE),
  66360. f.setDepthWrite(!1);
  66361. for (var _ = 0, T = t.length; _ < T; _++) {
  66362. (I = 16 / m.w), E.set(I * A, I);
  66363. var x = t[_];
  66364. if (
  66365. (v.set(
  66366. x.matrixWorld.elements[12],
  66367. x.matrixWorld.elements[13],
  66368. x.matrixWorld.elements[14]
  66369. ),
  66370. v.applyMatrix4(g.matrixWorldInverse),
  66371. v.applyProjection(g.projectionMatrix),
  66372. b.copy(v),
  66373. (w.x = b.x * y + y),
  66374. (w.y = b.y * C + C),
  66375. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  66376. ) {
  66377. f.activeTexture(p.TEXTURE0),
  66378. f.bindTexture(p.TEXTURE_2D, null),
  66379. f.activeTexture(p.TEXTURE1),
  66380. f.bindTexture(p.TEXTURE_2D, u),
  66381. p.copyTexImage2D(
  66382. p.TEXTURE_2D,
  66383. 0,
  66384. p.RGB,
  66385. m.x + w.x - 8,
  66386. m.y + w.y - 8,
  66387. 16,
  66388. 16,
  66389. 0
  66390. ),
  66391. p.uniform1i(c.renderType, 0),
  66392. p.uniform2f(c.scale, E.x, E.y),
  66393. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  66394. f.disable(p.BLEND),
  66395. f.enable(p.DEPTH_TEST),
  66396. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  66397. f.activeTexture(p.TEXTURE0),
  66398. f.bindTexture(p.TEXTURE_2D, d),
  66399. p.copyTexImage2D(
  66400. p.TEXTURE_2D,
  66401. 0,
  66402. p.RGBA,
  66403. m.x + w.x - 8,
  66404. m.y + w.y - 8,
  66405. 16,
  66406. 16,
  66407. 0
  66408. ),
  66409. p.uniform1i(c.renderType, 1),
  66410. f.disable(p.DEPTH_TEST),
  66411. f.activeTexture(p.TEXTURE1),
  66412. f.bindTexture(p.TEXTURE_2D, u),
  66413. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  66414. x.positionScreen.copy(b),
  66415. x.customUpdateCallback
  66416. ? x.customUpdateCallback(x)
  66417. : x.updateLensFlares(),
  66418. p.uniform1i(c.renderType, 2),
  66419. f.enable(p.BLEND);
  66420. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  66421. var R = x.lensFlares[S];
  66422. R.opacity > 0.001 &&
  66423. R.scale > 0.001 &&
  66424. ((b.x = R.x),
  66425. (b.y = R.y),
  66426. (b.z = R.z),
  66427. (I = (R.size * R.scale) / m.w),
  66428. (E.x = I * A),
  66429. (E.y = I),
  66430. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  66431. p.uniform2f(c.scale, E.x, E.y),
  66432. p.uniform1f(c.rotation, R.rotation),
  66433. p.uniform1f(c.opacity, R.opacity),
  66434. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  66435. f.setBlending(
  66436. R.blending,
  66437. R.blendEquation,
  66438. R.blendSrc,
  66439. R.blendDst
  66440. ),
  66441. e.setTexture(R.texture, 1),
  66442. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0));
  66443. }
  66444. }
  66445. }
  66446. f.enable(p.CULL_FACE),
  66447. f.enable(p.DEPTH_TEST),
  66448. f.setDepthWrite(!0),
  66449. e.resetGLState();
  66450. }
  66451. };
  66452. }),
  66453. (n.SpritePlugin = function (e, t) {
  66454. function i() {
  66455. var e = new Float32Array([
  66456. -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5,
  66457. 0, 1,
  66458. ]),
  66459. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  66460. (a = d.createBuffer()),
  66461. (s = d.createBuffer()),
  66462. d.bindBuffer(d.ARRAY_BUFFER, a),
  66463. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  66464. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  66465. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  66466. (l = r()),
  66467. (c = {
  66468. position: d.getAttribLocation(l, "position"),
  66469. uv: d.getAttribLocation(l, "uv"),
  66470. }),
  66471. (h = {
  66472. uvOffset: d.getUniformLocation(l, "uvOffset"),
  66473. uvScale: d.getUniformLocation(l, "uvScale"),
  66474. rotation: d.getUniformLocation(l, "rotation"),
  66475. scale: d.getUniformLocation(l, "scale"),
  66476. color: d.getUniformLocation(l, "color"),
  66477. map: d.getUniformLocation(l, "map"),
  66478. opacity: d.getUniformLocation(l, "opacity"),
  66479. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  66480. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  66481. fogType: d.getUniformLocation(l, "fogType"),
  66482. fogDensity: d.getUniformLocation(l, "fogDensity"),
  66483. fogNear: d.getUniformLocation(l, "fogNear"),
  66484. fogFar: d.getUniformLocation(l, "fogFar"),
  66485. fogColor: d.getUniformLocation(l, "fogColor"),
  66486. alphaTest: d.getUniformLocation(l, "alphaTest"),
  66487. });
  66488. var i = document.createElement("canvas");
  66489. (i.width = 8), (i.height = 8);
  66490. var o = i.getContext("2d");
  66491. (o.fillStyle = "white"),
  66492. o.fillRect(0, 0, 8, 8),
  66493. (u = new n.Texture(i)),
  66494. (u.needsUpdate = !0);
  66495. }
  66496. function r() {
  66497. var t = d.createProgram(),
  66498. i = d.createShader(d.VERTEX_SHADER),
  66499. n = d.createShader(d.FRAGMENT_SHADER);
  66500. return (
  66501. d.shaderSource(
  66502. i,
  66503. [
  66504. "precision " + e.getPrecision() + " float;",
  66505. "uniform mat4 modelViewMatrix;",
  66506. "uniform mat4 projectionMatrix;",
  66507. "uniform float rotation;",
  66508. "uniform vec2 scale;",
  66509. "uniform vec2 uvOffset;",
  66510. "uniform vec2 uvScale;",
  66511. "attribute vec2 position;",
  66512. "attribute vec2 uv;",
  66513. "varying vec2 vUV;",
  66514. "void main() {",
  66515. "vUV = uvOffset + uv * uvScale;",
  66516. "vec2 alignedPosition = position * scale;",
  66517. "vec2 rotatedPosition;",
  66518. "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;",
  66519. "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;",
  66520. "vec4 finalPosition;",
  66521. "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );",
  66522. "finalPosition.xy += rotatedPosition;",
  66523. "finalPosition = projectionMatrix * finalPosition;",
  66524. "gl_Position = finalPosition;",
  66525. "}",
  66526. ].join("\n")
  66527. ),
  66528. d.shaderSource(
  66529. n,
  66530. [
  66531. "precision " + e.getPrecision() + " float;",
  66532. "uniform vec3 color;",
  66533. "uniform sampler2D map;",
  66534. "uniform float opacity;",
  66535. "uniform int fogType;",
  66536. "uniform vec3 fogColor;",
  66537. "uniform float fogDensity;",
  66538. "uniform float fogNear;",
  66539. "uniform float fogFar;",
  66540. "uniform float alphaTest;",
  66541. "varying vec2 vUV;",
  66542. "void main() {",
  66543. "vec4 texture = texture2D( map, vUV );",
  66544. "if ( texture.a < alphaTest ) discard;",
  66545. "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );",
  66546. "if ( fogType > 0 ) {",
  66547. "float depth = gl_FragCoord.z / gl_FragCoord.w;",
  66548. "float fogFactor = 0.0;",
  66549. "if ( fogType == 1 ) {",
  66550. "fogFactor = smoothstep( fogNear, fogFar, depth );",
  66551. "} else {",
  66552. "const float LOG2 = 1.442695;",
  66553. "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );",
  66554. "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );",
  66555. "}",
  66556. "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );",
  66557. "}",
  66558. "}",
  66559. ].join("\n")
  66560. ),
  66561. d.compileShader(i),
  66562. d.compileShader(n),
  66563. d.attachShader(t, i),
  66564. d.attachShader(t, n),
  66565. d.linkProgram(t),
  66566. t
  66567. );
  66568. }
  66569. function o(e, t) {
  66570. return e.renderOrder !== t.renderOrder
  66571. ? e.renderOrder - t.renderOrder
  66572. : e.z !== t.z
  66573. ? t.z - e.z
  66574. : t.id - e.id;
  66575. }
  66576. var a,
  66577. s,
  66578. l,
  66579. c,
  66580. h,
  66581. u,
  66582. d = e.context,
  66583. p = e.state,
  66584. f = new n.Vector3(),
  66585. g = new n.Quaternion(),
  66586. m = new n.Vector3();
  66587. this.render = function (r, v) {
  66588. if (0 !== t.length) {
  66589. void 0 === l && i(),
  66590. d.useProgram(l),
  66591. p.initAttributes(),
  66592. p.enableAttribute(c.position),
  66593. p.enableAttribute(c.uv),
  66594. p.disableUnusedAttributes(),
  66595. p.disable(d.CULL_FACE),
  66596. p.enable(d.BLEND),
  66597. d.bindBuffer(d.ARRAY_BUFFER, a),
  66598. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  66599. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  66600. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  66601. d.uniformMatrix4fv(
  66602. h.projectionMatrix,
  66603. !1,
  66604. v.projectionMatrix.elements
  66605. ),
  66606. p.activeTexture(d.TEXTURE0),
  66607. d.uniform1i(h.map, 0);
  66608. var A = 0,
  66609. y = 0,
  66610. C = r.fog;
  66611. C
  66612. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  66613. C instanceof n.Fog
  66614. ? (d.uniform1f(h.fogNear, C.near),
  66615. d.uniform1f(h.fogFar, C.far),
  66616. d.uniform1i(h.fogType, 1),
  66617. (A = 1),
  66618. (y = 1))
  66619. : C instanceof n.FogExp2 &&
  66620. (d.uniform1f(h.fogDensity, C.density),
  66621. d.uniform1i(h.fogType, 2),
  66622. (A = 2),
  66623. (y = 2)))
  66624. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0));
  66625. for (var I = 0, E = t.length; I < E; I++) {
  66626. var b = t[I];
  66627. b.modelViewMatrix.multiplyMatrices(
  66628. v.matrixWorldInverse,
  66629. b.matrixWorld
  66630. ),
  66631. (b.z = -b.modelViewMatrix.elements[14]);
  66632. }
  66633. t.sort(o);
  66634. for (var w = [], I = 0, E = t.length; I < E; I++) {
  66635. var b = t[I],
  66636. _ = b.material;
  66637. d.uniform1f(h.alphaTest, _.alphaTest),
  66638. d.uniformMatrix4fv(
  66639. h.modelViewMatrix,
  66640. !1,
  66641. b.modelViewMatrix.elements
  66642. ),
  66643. b.matrixWorld.decompose(f, g, m),
  66644. (w[0] = m.x),
  66645. (w[1] = m.y);
  66646. var T = 0;
  66647. r.fog && _.fog && (T = y),
  66648. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  66649. null !== _.map
  66650. ? (d.uniform2f(
  66651. h.uvOffset,
  66652. _.map.offset.x,
  66653. _.map.offset.y
  66654. ),
  66655. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  66656. : (d.uniform2f(h.uvOffset, 0, 0),
  66657. d.uniform2f(h.uvScale, 1, 1)),
  66658. d.uniform1f(h.opacity, _.opacity),
  66659. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  66660. d.uniform1f(h.rotation, _.rotation),
  66661. d.uniform2fv(h.scale, w),
  66662. p.setBlending(
  66663. _.blending,
  66664. _.blendEquation,
  66665. _.blendSrc,
  66666. _.blendDst
  66667. ),
  66668. p.setDepthTest(_.depthTest),
  66669. p.setDepthWrite(_.depthWrite),
  66670. _.map && _.map.image && _.map.image.width
  66671. ? e.setTexture(_.map, 0)
  66672. : e.setTexture(u, 0),
  66673. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0);
  66674. }
  66675. p.enable(d.CULL_FACE), e.resetGLState();
  66676. }
  66677. };
  66678. }),
  66679. Object.defineProperties(n.Box2.prototype, {
  66680. empty: {
  66681. value: function () {
  66682. return (
  66683. console.warn(
  66684. "THREE.Box2: .empty() has been renamed to .isEmpty()."
  66685. ),
  66686. this.isEmpty()
  66687. );
  66688. },
  66689. },
  66690. isIntersectionBox: {
  66691. value: function (e) {
  66692. return (
  66693. console.warn(
  66694. "THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."
  66695. ),
  66696. this.intersectsBox(e)
  66697. );
  66698. },
  66699. },
  66700. }),
  66701. Object.defineProperties(n.Box3.prototype, {
  66702. empty: {
  66703. value: function () {
  66704. return (
  66705. console.warn(
  66706. "THREE.Box3: .empty() has been renamed to .isEmpty()."
  66707. ),
  66708. this.isEmpty()
  66709. );
  66710. },
  66711. },
  66712. isIntersectionBox: {
  66713. value: function (e) {
  66714. return (
  66715. console.warn(
  66716. "THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."
  66717. ),
  66718. this.intersectsBox(e)
  66719. );
  66720. },
  66721. },
  66722. isIntersectionSphere: {
  66723. value: function (e) {
  66724. return (
  66725. console.warn(
  66726. "THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."
  66727. ),
  66728. this.intersectsSphere(e)
  66729. );
  66730. },
  66731. },
  66732. }),
  66733. Object.defineProperties(n.Matrix3.prototype, {
  66734. multiplyVector3: {
  66735. value: function (e) {
  66736. return (
  66737. console.warn(
  66738. "THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."
  66739. ),
  66740. e.applyMatrix3(this)
  66741. );
  66742. },
  66743. },
  66744. multiplyVector3Array: {
  66745. value: function (e) {
  66746. return (
  66747. console.warn(
  66748. "THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."
  66749. ),
  66750. this.applyToVector3Array(e)
  66751. );
  66752. },
  66753. },
  66754. }),
  66755. Object.defineProperties(n.Matrix4.prototype, {
  66756. extractPosition: {
  66757. value: function (e) {
  66758. return (
  66759. console.warn(
  66760. "THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."
  66761. ),
  66762. this.copyPosition(e)
  66763. );
  66764. },
  66765. },
  66766. setRotationFromQuaternion: {
  66767. value: function (e) {
  66768. return (
  66769. console.warn(
  66770. "THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."
  66771. ),
  66772. this.makeRotationFromQuaternion(e)
  66773. );
  66774. },
  66775. },
  66776. multiplyVector3: {
  66777. value: function (e) {
  66778. return (
  66779. console.warn(
  66780. "THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."
  66781. ),
  66782. e.applyProjection(this)
  66783. );
  66784. },
  66785. },
  66786. multiplyVector4: {
  66787. value: function (e) {
  66788. return (
  66789. console.warn(
  66790. "THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."
  66791. ),
  66792. e.applyMatrix4(this)
  66793. );
  66794. },
  66795. },
  66796. multiplyVector3Array: {
  66797. value: function (e) {
  66798. return (
  66799. console.warn(
  66800. "THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."
  66801. ),
  66802. this.applyToVector3Array(e)
  66803. );
  66804. },
  66805. },
  66806. rotateAxis: {
  66807. value: function (e) {
  66808. console.warn(
  66809. "THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."
  66810. ),
  66811. e.transformDirection(this);
  66812. },
  66813. },
  66814. crossVector: {
  66815. value: function (e) {
  66816. return (
  66817. console.warn(
  66818. "THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."
  66819. ),
  66820. e.applyMatrix4(this)
  66821. );
  66822. },
  66823. },
  66824. translate: {
  66825. value: function (e) {
  66826. console.error("THREE.Matrix4: .translate() has been removed.");
  66827. },
  66828. },
  66829. rotateX: {
  66830. value: function (e) {
  66831. console.error("THREE.Matrix4: .rotateX() has been removed.");
  66832. },
  66833. },
  66834. rotateY: {
  66835. value: function (e) {
  66836. console.error("THREE.Matrix4: .rotateY() has been removed.");
  66837. },
  66838. },
  66839. rotateZ: {
  66840. value: function (e) {
  66841. console.error("THREE.Matrix4: .rotateZ() has been removed.");
  66842. },
  66843. },
  66844. rotateByAxis: {
  66845. value: function (e, t) {
  66846. console.error(
  66847. "THREE.Matrix4: .rotateByAxis() has been removed."
  66848. );
  66849. },
  66850. },
  66851. }),
  66852. Object.defineProperties(n.Plane.prototype, {
  66853. isIntersectionLine: {
  66854. value: function (e) {
  66855. return (
  66856. console.warn(
  66857. "THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."
  66858. ),
  66859. this.intersectsLine(e)
  66860. );
  66861. },
  66862. },
  66863. }),
  66864. Object.defineProperties(n.Quaternion.prototype, {
  66865. multiplyVector3: {
  66866. value: function (e) {
  66867. return (
  66868. console.warn(
  66869. "THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."
  66870. ),
  66871. e.applyQuaternion(this)
  66872. );
  66873. },
  66874. },
  66875. }),
  66876. Object.defineProperties(n.Ray.prototype, {
  66877. isIntersectionBox: {
  66878. value: function (e) {
  66879. return (
  66880. console.warn(
  66881. "THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."
  66882. ),
  66883. this.intersectsBox(e)
  66884. );
  66885. },
  66886. },
  66887. isIntersectionPlane: {
  66888. value: function (e) {
  66889. return (
  66890. console.warn(
  66891. "THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."
  66892. ),
  66893. this.intersectsPlane(e)
  66894. );
  66895. },
  66896. },
  66897. isIntersectionSphere: {
  66898. value: function (e) {
  66899. return (
  66900. console.warn(
  66901. "THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."
  66902. ),
  66903. this.intersectsSphere(e)
  66904. );
  66905. },
  66906. },
  66907. }),
  66908. Object.defineProperties(n.Vector3.prototype, {
  66909. setEulerFromRotationMatrix: {
  66910. value: function () {
  66911. console.error(
  66912. "THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead."
  66913. );
  66914. },
  66915. },
  66916. setEulerFromQuaternion: {
  66917. value: function () {
  66918. console.error(
  66919. "THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead."
  66920. );
  66921. },
  66922. },
  66923. getPositionFromMatrix: {
  66924. value: function (e) {
  66925. return (
  66926. console.warn(
  66927. "THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."
  66928. ),
  66929. this.setFromMatrixPosition(e)
  66930. );
  66931. },
  66932. },
  66933. getScaleFromMatrix: {
  66934. value: function (e) {
  66935. return (
  66936. console.warn(
  66937. "THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."
  66938. ),
  66939. this.setFromMatrixScale(e)
  66940. );
  66941. },
  66942. },
  66943. getColumnFromMatrix: {
  66944. value: function (e, t) {
  66945. return (
  66946. console.warn(
  66947. "THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."
  66948. ),
  66949. this.setFromMatrixColumn(e, t)
  66950. );
  66951. },
  66952. },
  66953. }),
  66954. (n.Face4 = function (e, t, i, r, o, a, s) {
  66955. return (
  66956. console.warn(
  66957. "THREE.Face4 has been removed. A THREE.Face3 will be created instead."
  66958. ),
  66959. new n.Face3(e, t, i, o, a, s)
  66960. );
  66961. }),
  66962. (n.Vertex = function (e, t, i) {
  66963. return (
  66964. console.warn(
  66965. "THREE.Vertex has been removed. Use THREE.Vector3 instead."
  66966. ),
  66967. new n.Vector3(e, t, i)
  66968. );
  66969. }),
  66970. Object.defineProperties(n.Object3D.prototype, {
  66971. eulerOrder: {
  66972. get: function () {
  66973. return (
  66974. console.warn(
  66975. "THREE.Object3D: .eulerOrder is now .rotation.order."
  66976. ),
  66977. this.rotation.order
  66978. );
  66979. },
  66980. set: function (e) {
  66981. console.warn(
  66982. "THREE.Object3D: .eulerOrder is now .rotation.order."
  66983. ),
  66984. (this.rotation.order = e);
  66985. },
  66986. },
  66987. getChildByName: {
  66988. value: function (e) {
  66989. return (
  66990. console.warn(
  66991. "THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."
  66992. ),
  66993. this.getObjectByName(e)
  66994. );
  66995. },
  66996. },
  66997. renderDepth: {
  66998. set: function (e) {
  66999. console.warn(
  67000. "THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead."
  67001. );
  67002. },
  67003. },
  67004. translate: {
  67005. value: function (e, t) {
  67006. return (
  67007. console.warn(
  67008. "THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."
  67009. ),
  67010. this.translateOnAxis(t, e)
  67011. );
  67012. },
  67013. },
  67014. useQuaternion: {
  67015. get: function () {
  67016. console.warn(
  67017. "THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."
  67018. );
  67019. },
  67020. set: function (e) {
  67021. console.warn(
  67022. "THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default."
  67023. );
  67024. },
  67025. },
  67026. }),
  67027. Object.defineProperties(n, {
  67028. PointCloud: {
  67029. value: function (e, t) {
  67030. return (
  67031. console.warn(
  67032. "THREE.PointCloud has been renamed to THREE.Points."
  67033. ),
  67034. new n.Points(e, t)
  67035. );
  67036. },
  67037. },
  67038. ParticleSystem: {
  67039. value: function (e, t) {
  67040. return (
  67041. console.warn(
  67042. "THREE.ParticleSystem has been renamed to THREE.Points."
  67043. ),
  67044. new n.Points(e, t)
  67045. );
  67046. },
  67047. },
  67048. }),
  67049. Object.defineProperties(n.Light.prototype, {
  67050. onlyShadow: {
  67051. set: function (e) {
  67052. console.warn("THREE.Light: .onlyShadow has been removed.");
  67053. },
  67054. },
  67055. shadowCameraFov: {
  67056. set: function (e) {
  67057. console.warn(
  67058. "THREE.Light: .shadowCameraFov is now .shadow.camera.fov."
  67059. ),
  67060. (this.shadow.camera.fov = e);
  67061. },
  67062. },
  67063. shadowCameraLeft: {
  67064. set: function (e) {
  67065. console.warn(
  67066. "THREE.Light: .shadowCameraLeft is now .shadow.camera.left."
  67067. ),
  67068. (this.shadow.camera.left = e);
  67069. },
  67070. },
  67071. shadowCameraRight: {
  67072. set: function (e) {
  67073. console.warn(
  67074. "THREE.Light: .shadowCameraRight is now .shadow.camera.right."
  67075. ),
  67076. (this.shadow.camera.right = e);
  67077. },
  67078. },
  67079. shadowCameraTop: {
  67080. set: function (e) {
  67081. console.warn(
  67082. "THREE.Light: .shadowCameraTop is now .shadow.camera.top."
  67083. ),
  67084. (this.shadow.camera.top = e);
  67085. },
  67086. },
  67087. shadowCameraBottom: {
  67088. set: function (e) {
  67089. console.warn(
  67090. "THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."
  67091. ),
  67092. (this.shadow.camera.bottom = e);
  67093. },
  67094. },
  67095. shadowCameraNear: {
  67096. set: function (e) {
  67097. console.warn(
  67098. "THREE.Light: .shadowCameraNear is now .shadow.camera.near."
  67099. ),
  67100. (this.shadow.camera.near = e);
  67101. },
  67102. },
  67103. shadowCameraFar: {
  67104. set: function (e) {
  67105. console.warn(
  67106. "THREE.Light: .shadowCameraFar is now .shadow.camera.far."
  67107. ),
  67108. (this.shadow.camera.far = e);
  67109. },
  67110. },
  67111. shadowCameraVisible: {
  67112. set: function (e) {
  67113. console.warn(
  67114. "THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead."
  67115. );
  67116. },
  67117. },
  67118. shadowBias: {
  67119. set: function (e) {
  67120. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  67121. (this.shadow.bias = e);
  67122. },
  67123. },
  67124. shadowDarkness: {
  67125. set: function (e) {
  67126. console.warn("THREE.Light: .shadowDarkness has been removed.");
  67127. },
  67128. },
  67129. shadowMapWidth: {
  67130. set: function (e) {
  67131. console.warn(
  67132. "THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."
  67133. ),
  67134. (this.shadow.mapSize.width = e);
  67135. },
  67136. },
  67137. shadowMapHeight: {
  67138. set: function (e) {
  67139. console.warn(
  67140. "THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."
  67141. ),
  67142. (this.shadow.mapSize.height = e);
  67143. },
  67144. },
  67145. }),
  67146. Object.defineProperties(n.BufferAttribute.prototype, {
  67147. length: {
  67148. get: function () {
  67149. return (
  67150. console.warn(
  67151. "THREE.BufferAttribute: .length has been deprecated. Please use .count."
  67152. ),
  67153. this.array.length
  67154. );
  67155. },
  67156. },
  67157. }),
  67158. Object.defineProperties(n.BufferGeometry.prototype, {
  67159. drawcalls: {
  67160. get: function () {
  67161. return (
  67162. console.error(
  67163. "THREE.BufferGeometry: .drawcalls has been renamed to .groups."
  67164. ),
  67165. this.groups
  67166. );
  67167. },
  67168. },
  67169. offsets: {
  67170. get: function () {
  67171. return (
  67172. console.warn(
  67173. "THREE.BufferGeometry: .offsets has been renamed to .groups."
  67174. ),
  67175. this.groups
  67176. );
  67177. },
  67178. },
  67179. addIndex: {
  67180. value: function (e) {
  67181. console.warn(
  67182. "THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."
  67183. ),
  67184. this.setIndex(e);
  67185. },
  67186. },
  67187. addDrawCall: {
  67188. value: function (e, t, i) {
  67189. void 0 !== i &&
  67190. console.warn(
  67191. "THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."
  67192. ),
  67193. console.warn(
  67194. "THREE.BufferGeometry: .addDrawCall() is now .addGroup()."
  67195. ),
  67196. this.addGroup(e, t);
  67197. },
  67198. },
  67199. clearDrawCalls: {
  67200. value: function () {
  67201. console.warn(
  67202. "THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."
  67203. ),
  67204. this.clearGroups();
  67205. },
  67206. },
  67207. computeTangents: {
  67208. value: function () {
  67209. console.warn(
  67210. "THREE.BufferGeometry: .computeTangents() has been removed."
  67211. );
  67212. },
  67213. },
  67214. computeOffsets: {
  67215. value: function () {
  67216. console.warn(
  67217. "THREE.BufferGeometry: .computeOffsets() has been removed."
  67218. );
  67219. },
  67220. },
  67221. }),
  67222. Object.defineProperties(n.Material.prototype, {
  67223. wrapAround: {
  67224. get: function () {
  67225. console.warn(
  67226. "THREE." + this.type + ": .wrapAround has been removed."
  67227. );
  67228. },
  67229. set: function (e) {
  67230. console.warn(
  67231. "THREE." + this.type + ": .wrapAround has been removed."
  67232. );
  67233. },
  67234. },
  67235. wrapRGB: {
  67236. get: function () {
  67237. return (
  67238. console.warn(
  67239. "THREE." + this.type + ": .wrapRGB has been removed."
  67240. ),
  67241. new n.Color()
  67242. );
  67243. },
  67244. },
  67245. }),
  67246. Object.defineProperties(n, {
  67247. PointCloudMaterial: {
  67248. value: function (e) {
  67249. return (
  67250. console.warn(
  67251. "THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."
  67252. ),
  67253. new n.PointsMaterial(e)
  67254. );
  67255. },
  67256. },
  67257. ParticleBasicMaterial: {
  67258. value: function (e) {
  67259. return (
  67260. console.warn(
  67261. "THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."
  67262. ),
  67263. new n.PointsMaterial(e)
  67264. );
  67265. },
  67266. },
  67267. ParticleSystemMaterial: {
  67268. value: function (e) {
  67269. return (
  67270. console.warn(
  67271. "THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."
  67272. ),
  67273. new n.PointsMaterial(e)
  67274. );
  67275. },
  67276. },
  67277. }),
  67278. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  67279. metal: {
  67280. get: function () {
  67281. return (
  67282. console.warn(
  67283. "THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."
  67284. ),
  67285. !1
  67286. );
  67287. },
  67288. set: function (e) {
  67289. console.warn(
  67290. "THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead"
  67291. );
  67292. },
  67293. },
  67294. }),
  67295. Object.defineProperties(n.ShaderMaterial.prototype, {
  67296. derivatives: {
  67297. get: function () {
  67298. return (
  67299. console.warn(
  67300. "THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."
  67301. ),
  67302. this.extensions.derivatives
  67303. );
  67304. },
  67305. set: function (e) {
  67306. console.warn(
  67307. "THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."
  67308. ),
  67309. (this.extensions.derivatives = e);
  67310. },
  67311. },
  67312. }),
  67313. Object.defineProperties(n.WebGLRenderer.prototype, {
  67314. supportsFloatTextures: {
  67315. value: function () {
  67316. return (
  67317. console.warn(
  67318. "THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."
  67319. ),
  67320. this.extensions.get("OES_texture_float")
  67321. );
  67322. },
  67323. },
  67324. supportsHalfFloatTextures: {
  67325. value: function () {
  67326. return (
  67327. console.warn(
  67328. "THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."
  67329. ),
  67330. this.extensions.get("OES_texture_half_float")
  67331. );
  67332. },
  67333. },
  67334. supportsStandardDerivatives: {
  67335. value: function () {
  67336. return (
  67337. console.warn(
  67338. "THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."
  67339. ),
  67340. this.extensions.get("OES_standard_derivatives")
  67341. );
  67342. },
  67343. },
  67344. supportsCompressedTextureS3TC: {
  67345. value: function () {
  67346. return (
  67347. console.warn(
  67348. "THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."
  67349. ),
  67350. this.extensions.get("WEBGL_compressed_texture_s3tc")
  67351. );
  67352. },
  67353. },
  67354. supportsCompressedTexturePVRTC: {
  67355. value: function () {
  67356. return (
  67357. console.warn(
  67358. "THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."
  67359. ),
  67360. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  67361. );
  67362. },
  67363. },
  67364. supportsBlendMinMax: {
  67365. value: function () {
  67366. return (
  67367. console.warn(
  67368. "THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."
  67369. ),
  67370. this.extensions.get("EXT_blend_minmax")
  67371. );
  67372. },
  67373. },
  67374. supportsVertexTextures: {
  67375. value: function () {
  67376. return this.capabilities.vertexTextures;
  67377. },
  67378. },
  67379. supportsInstancedArrays: {
  67380. value: function () {
  67381. return (
  67382. console.warn(
  67383. "THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."
  67384. ),
  67385. this.extensions.get("ANGLE_instanced_arrays")
  67386. );
  67387. },
  67388. },
  67389. enableScissorTest: {
  67390. value: function (e) {
  67391. console.warn(
  67392. "THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."
  67393. ),
  67394. this.setScissorTest(e);
  67395. },
  67396. },
  67397. initMaterial: {
  67398. value: function () {
  67399. console.warn(
  67400. "THREE.WebGLRenderer: .initMaterial() has been removed."
  67401. );
  67402. },
  67403. },
  67404. addPrePlugin: {
  67405. value: function () {
  67406. console.warn(
  67407. "THREE.WebGLRenderer: .addPrePlugin() has been removed."
  67408. );
  67409. },
  67410. },
  67411. addPostPlugin: {
  67412. value: function () {
  67413. console.warn(
  67414. "THREE.WebGLRenderer: .addPostPlugin() has been removed."
  67415. );
  67416. },
  67417. },
  67418. updateShadowMap: {
  67419. value: function () {
  67420. console.warn(
  67421. "THREE.WebGLRenderer: .updateShadowMap() has been removed."
  67422. );
  67423. },
  67424. },
  67425. shadowMapEnabled: {
  67426. get: function () {
  67427. return this.shadowMap.enabled;
  67428. },
  67429. set: function (e) {
  67430. console.warn(
  67431. "THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."
  67432. ),
  67433. (this.shadowMap.enabled = e);
  67434. },
  67435. },
  67436. shadowMapType: {
  67437. get: function () {
  67438. return this.shadowMap.type;
  67439. },
  67440. set: function (e) {
  67441. console.warn(
  67442. "THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."
  67443. ),
  67444. (this.shadowMap.type = e);
  67445. },
  67446. },
  67447. shadowMapCullFace: {
  67448. get: function () {
  67449. return this.shadowMap.cullFace;
  67450. },
  67451. set: function (e) {
  67452. console.warn(
  67453. "THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."
  67454. ),
  67455. (this.shadowMap.cullFace = e);
  67456. },
  67457. },
  67458. }),
  67459. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  67460. wrapS: {
  67461. get: function () {
  67462. return (
  67463. console.warn(
  67464. "THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."
  67465. ),
  67466. this.texture.wrapS
  67467. );
  67468. },
  67469. set: function (e) {
  67470. console.warn(
  67471. "THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."
  67472. ),
  67473. (this.texture.wrapS = e);
  67474. },
  67475. },
  67476. wrapT: {
  67477. get: function () {
  67478. return (
  67479. console.warn(
  67480. "THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."
  67481. ),
  67482. this.texture.wrapT
  67483. );
  67484. },
  67485. set: function (e) {
  67486. console.warn(
  67487. "THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."
  67488. ),
  67489. (this.texture.wrapT = e);
  67490. },
  67491. },
  67492. magFilter: {
  67493. get: function () {
  67494. return (
  67495. console.warn(
  67496. "THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."
  67497. ),
  67498. this.texture.magFilter
  67499. );
  67500. },
  67501. set: function (e) {
  67502. console.warn(
  67503. "THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."
  67504. ),
  67505. (this.texture.magFilter = e);
  67506. },
  67507. },
  67508. minFilter: {
  67509. get: function () {
  67510. return (
  67511. console.warn(
  67512. "THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."
  67513. ),
  67514. this.texture.minFilter
  67515. );
  67516. },
  67517. set: function (e) {
  67518. console.warn(
  67519. "THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."
  67520. ),
  67521. (this.texture.minFilter = e);
  67522. },
  67523. },
  67524. anisotropy: {
  67525. get: function () {
  67526. return (
  67527. console.warn(
  67528. "THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."
  67529. ),
  67530. this.texture.anisotropy
  67531. );
  67532. },
  67533. set: function (e) {
  67534. console.warn(
  67535. "THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."
  67536. ),
  67537. (this.texture.anisotropy = e);
  67538. },
  67539. },
  67540. offset: {
  67541. get: function () {
  67542. return (
  67543. console.warn(
  67544. "THREE.WebGLRenderTarget: .offset is now .texture.offset."
  67545. ),
  67546. this.texture.offset
  67547. );
  67548. },
  67549. set: function (e) {
  67550. console.warn(
  67551. "THREE.WebGLRenderTarget: .offset is now .texture.offset."
  67552. ),
  67553. (this.texture.offset = e);
  67554. },
  67555. },
  67556. repeat: {
  67557. get: function () {
  67558. return (
  67559. console.warn(
  67560. "THREE.WebGLRenderTarget: .repeat is now .texture.repeat."
  67561. ),
  67562. this.texture.repeat
  67563. );
  67564. },
  67565. set: function (e) {
  67566. console.warn(
  67567. "THREE.WebGLRenderTarget: .repeat is now .texture.repeat."
  67568. ),
  67569. (this.texture.repeat = e);
  67570. },
  67571. },
  67572. format: {
  67573. get: function () {
  67574. return (
  67575. console.warn(
  67576. "THREE.WebGLRenderTarget: .format is now .texture.format."
  67577. ),
  67578. this.texture.format
  67579. );
  67580. },
  67581. set: function (e) {
  67582. console.warn(
  67583. "THREE.WebGLRenderTarget: .format is now .texture.format."
  67584. ),
  67585. (this.texture.format = e);
  67586. },
  67587. },
  67588. type: {
  67589. get: function () {
  67590. return (
  67591. console.warn(
  67592. "THREE.WebGLRenderTarget: .type is now .texture.type."
  67593. ),
  67594. this.texture.type
  67595. );
  67596. },
  67597. set: function (e) {
  67598. console.warn(
  67599. "THREE.WebGLRenderTarget: .type is now .texture.type."
  67600. ),
  67601. (this.texture.type = e);
  67602. },
  67603. },
  67604. generateMipmaps: {
  67605. get: function () {
  67606. return (
  67607. console.warn(
  67608. "THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."
  67609. ),
  67610. this.texture.generateMipmaps
  67611. );
  67612. },
  67613. set: function (e) {
  67614. console.warn(
  67615. "THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."
  67616. ),
  67617. (this.texture.generateMipmaps = e);
  67618. },
  67619. },
  67620. }),
  67621. (n.GeometryUtils = {
  67622. merge: function (e, t, i) {
  67623. console.warn(
  67624. "THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."
  67625. );
  67626. var r;
  67627. t instanceof n.Mesh &&
  67628. (t.matrixAutoUpdate && t.updateMatrix(),
  67629. (r = t.matrix),
  67630. (t = t.geometry)),
  67631. e.merge(t, r, i);
  67632. },
  67633. center: function (e) {
  67634. return (
  67635. console.warn(
  67636. "THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."
  67637. ),
  67638. e.center()
  67639. );
  67640. },
  67641. }),
  67642. (n.ImageUtils = {
  67643. crossOrigin: void 0,
  67644. loadTexture: function (e, t, i, r) {
  67645. console.warn(
  67646. "THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead."
  67647. );
  67648. var o = new n.TextureLoader();
  67649. o.setCrossOrigin(this.crossOrigin);
  67650. var a = o.load(e, i, void 0, r);
  67651. return t && (a.mapping = t), a;
  67652. },
  67653. loadTextureCube: function (e, t, i, r) {
  67654. console.warn(
  67655. "THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead."
  67656. );
  67657. var o = new n.CubeTextureLoader();
  67658. o.setCrossOrigin(this.crossOrigin);
  67659. var a = o.load(e, i, void 0, r);
  67660. return t && (a.mapping = t), a;
  67661. },
  67662. loadCompressedTexture: function () {
  67663. console.error(
  67664. "THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead."
  67665. );
  67666. },
  67667. loadCompressedTextureCube: function () {
  67668. console.error(
  67669. "THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead."
  67670. );
  67671. },
  67672. }),
  67673. (n.Projector = function () {
  67674. console.error(
  67675. "THREE.Projector has been moved to /examples/js/renderers/Projector.js."
  67676. ),
  67677. (this.projectVector = function (e, t) {
  67678. console.warn(
  67679. "THREE.Projector: .projectVector() is now vector.project()."
  67680. ),
  67681. e.project(t);
  67682. }),
  67683. (this.unprojectVector = function (e, t) {
  67684. console.warn(
  67685. "THREE.Projector: .unprojectVector() is now vector.unproject()."
  67686. ),
  67687. e.unproject(t);
  67688. }),
  67689. (this.pickingRay = function (e, t) {
  67690. console.error(
  67691. "THREE.Projector: .pickingRay() is now raycaster.setFromCamera()."
  67692. );
  67693. });
  67694. }),
  67695. (n.CanvasRenderer = function () {
  67696. console.error(
  67697. "THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"
  67698. ),
  67699. (this.domElement = document.createElement("canvas")),
  67700. (this.clear = function () {}),
  67701. (this.render = function () {}),
  67702. (this.setClearColor = function () {}),
  67703. (this.setSize = function () {});
  67704. }),
  67705. (n.MeshFaceMaterial = n.MultiMaterial),
  67706. (n.CurveUtils = {
  67707. tangentQuadraticBezier: function (e, t, i, n) {
  67708. return 2 * (1 - e) * (i - t) + 2 * e * (n - i);
  67709. },
  67710. tangentCubicBezier: function (e, t, i, n, r) {
  67711. return (
  67712. -3 * t * (1 - e) * (1 - e) +
  67713. 3 * i * (1 - e) * (1 - e) -
  67714. 6 * e * i * (1 - e) +
  67715. 6 * e * n * (1 - e) -
  67716. 3 * e * e * n +
  67717. 3 * e * e * r
  67718. );
  67719. },
  67720. tangentSpline: function (e, t, i, n, r) {
  67721. var o = 6 * e * e - 6 * e,
  67722. a = 3 * e * e - 4 * e + 1,
  67723. s = -6 * e * e + 6 * e,
  67724. l = 3 * e * e - 2 * e;
  67725. return o + a + s + l;
  67726. },
  67727. interpolate: function (e, t, i, n, r) {
  67728. var o = 0.5 * (i - e),
  67729. a = 0.5 * (n - t),
  67730. s = r * r,
  67731. l = r * s;
  67732. return (
  67733. (2 * t - 2 * i + o + a) * l +
  67734. (-3 * t + 3 * i - 2 * o - a) * s +
  67735. o * r +
  67736. t
  67737. );
  67738. },
  67739. }),
  67740. (n.SceneUtils = {
  67741. createMultiMaterialObject: function (e, t) {
  67742. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++)
  67743. i.add(new n.Mesh(e, t[r]));
  67744. return i;
  67745. },
  67746. detach: function (e, t, i) {
  67747. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e);
  67748. },
  67749. attach: function (e, t, i) {
  67750. var r = new n.Matrix4();
  67751. r.getInverse(i.matrixWorld),
  67752. e.applyMatrix(r),
  67753. t.remove(e),
  67754. i.add(e);
  67755. },
  67756. }),
  67757. (n.ShapeUtils = {
  67758. area: function (e) {
  67759. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  67760. i += e[n].x * e[r].y - e[r].x * e[n].y;
  67761. return 0.5 * i;
  67762. },
  67763. triangulate: (function () {
  67764. function e(e, t, i, n, r, o) {
  67765. var a, s, l, c, h, u, d, p, f;
  67766. if (
  67767. ((s = e[o[t]].x),
  67768. (l = e[o[t]].y),
  67769. (c = e[o[i]].x),
  67770. (h = e[o[i]].y),
  67771. (u = e[o[n]].x),
  67772. (d = e[o[n]].y),
  67773. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  67774. )
  67775. return !1;
  67776. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  67777. for (
  67778. g = u - c,
  67779. m = d - h,
  67780. v = s - u,
  67781. A = l - d,
  67782. y = c - s,
  67783. C = h - l,
  67784. a = 0;
  67785. a < r;
  67786. a++
  67787. )
  67788. if (
  67789. ((p = e[o[a]].x),
  67790. (f = e[o[a]].y),
  67791. !(
  67792. (p === s && f === l) ||
  67793. (p === c && f === h) ||
  67794. (p === u && f === d)
  67795. ) &&
  67796. ((I = p - s),
  67797. (E = f - l),
  67798. (b = p - c),
  67799. (w = f - h),
  67800. (_ = p - u),
  67801. (T = f - d),
  67802. (M = g * w - m * b),
  67803. (x = y * E - C * I),
  67804. (S = v * T - A * _),
  67805. M >= -Number.EPSILON &&
  67806. S >= -Number.EPSILON &&
  67807. x >= -Number.EPSILON))
  67808. )
  67809. return !1;
  67810. return !0;
  67811. }
  67812. return function (t, i) {
  67813. var r = t.length;
  67814. if (r < 3) return null;
  67815. var o,
  67816. a,
  67817. s,
  67818. l = [],
  67819. c = [],
  67820. h = [];
  67821. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a;
  67822. else for (a = 0; a < r; a++) c[a] = r - 1 - a;
  67823. var u = r,
  67824. d = 2 * u;
  67825. for (a = u - 1; u > 2; ) {
  67826. if (d-- <= 0)
  67827. return (
  67828. console.warn(
  67829. "THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"
  67830. ),
  67831. i ? h : l
  67832. );
  67833. if (
  67834. ((o = a),
  67835. u <= o && (o = 0),
  67836. (a = o + 1),
  67837. u <= a && (a = 0),
  67838. (s = a + 1),
  67839. u <= s && (s = 0),
  67840. e(t, o, a, s, u, c))
  67841. ) {
  67842. var p, f, g, m, v;
  67843. for (
  67844. p = c[o],
  67845. f = c[a],
  67846. g = c[s],
  67847. l.push([t[p], t[f], t[g]]),
  67848. h.push([c[o], c[a], c[s]]),
  67849. m = a,
  67850. v = a + 1;
  67851. v < u;
  67852. m++, v++
  67853. )
  67854. c[m] = c[v];
  67855. u--, (d = 2 * u);
  67856. }
  67857. }
  67858. return i ? h : l;
  67859. };
  67860. })(),
  67861. triangulateShape: function (e, t) {
  67862. function i(e, t, i) {
  67863. return e.x !== t.x
  67864. ? e.x < t.x
  67865. ? e.x <= i.x && i.x <= t.x
  67866. : t.x <= i.x && i.x <= e.x
  67867. : e.y < t.y
  67868. ? e.y <= i.y && i.y <= t.y
  67869. : t.y <= i.y && i.y <= e.y;
  67870. }
  67871. function r(e, t, n, r, o) {
  67872. var a = t.x - e.x,
  67873. s = t.y - e.y,
  67874. l = r.x - n.x,
  67875. c = r.y - n.y,
  67876. h = e.x - n.x,
  67877. u = e.y - n.y,
  67878. d = s * l - a * c,
  67879. p = s * h - a * u;
  67880. if (Math.abs(d) > Number.EPSILON) {
  67881. var f;
  67882. if (d > 0) {
  67883. if (p < 0 || p > d) return [];
  67884. if (((f = c * h - l * u), f < 0 || f > d)) return [];
  67885. } else {
  67886. if (p > 0 || p < d) return [];
  67887. if (((f = c * h - l * u), f > 0 || f < d)) return [];
  67888. }
  67889. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : [];
  67890. if (f === d) return !o || (0 !== p && p !== d) ? [t] : [];
  67891. if (0 === p) return [n];
  67892. if (p === d) return [r];
  67893. var g = f / d;
  67894. return [
  67895. {
  67896. x: e.x + g * a,
  67897. y: e.y + g * s,
  67898. },
  67899. ];
  67900. }
  67901. if (0 !== p || c * h !== l * u) return [];
  67902. var m = 0 === a && 0 === s,
  67903. v = 0 === l && 0 === c;
  67904. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e];
  67905. if (m) return i(n, r, e) ? [e] : [];
  67906. if (v) return i(e, t, n) ? [n] : [];
  67907. var A, y, C, I, E, b, w, _;
  67908. return (
  67909. 0 !== a
  67910. ? (e.x < t.x
  67911. ? ((A = e), (C = e.x), (y = t), (I = t.x))
  67912. : ((A = t), (C = t.x), (y = e), (I = e.x)),
  67913. n.x < r.x
  67914. ? ((E = n), (w = n.x), (b = r), (_ = r.x))
  67915. : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  67916. : (e.y < t.y
  67917. ? ((A = e), (C = e.y), (y = t), (I = t.y))
  67918. : ((A = t), (C = t.y), (y = e), (I = e.y)),
  67919. n.y < r.y
  67920. ? ((E = n), (w = n.y), (b = r), (_ = r.y))
  67921. : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  67922. C <= w
  67923. ? I < w
  67924. ? []
  67925. : I === w
  67926. ? o
  67927. ? []
  67928. : [E]
  67929. : I <= _
  67930. ? [E, y]
  67931. : [E, b]
  67932. : C > _
  67933. ? []
  67934. : C === _
  67935. ? o
  67936. ? []
  67937. : [A]
  67938. : I <= _
  67939. ? [A, y]
  67940. : [A, b]
  67941. );
  67942. }
  67943. function o(e, t, i, n) {
  67944. var r = t.x - e.x,
  67945. o = t.y - e.y,
  67946. a = i.x - e.x,
  67947. s = i.y - e.y,
  67948. l = n.x - e.x,
  67949. c = n.y - e.y,
  67950. h = r * s - o * a,
  67951. u = r * c - o * l;
  67952. if (Math.abs(h) > Number.EPSILON) {
  67953. var d = l * s - c * a;
  67954. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0;
  67955. }
  67956. return u > 0;
  67957. }
  67958. function a(e, t) {
  67959. function i(e, t) {
  67960. var i = A.length - 1,
  67961. n = e - 1;
  67962. n < 0 && (n = i);
  67963. var r = e + 1;
  67964. r > i && (r = 0);
  67965. var a = o(A[e], A[n], A[r], s[t]);
  67966. if (!a) return !1;
  67967. var l = s.length - 1,
  67968. c = t - 1;
  67969. c < 0 && (c = l);
  67970. var h = t + 1;
  67971. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a;
  67972. }
  67973. function n(e, t) {
  67974. var i, n, o;
  67975. for (i = 0; i < A.length; i++)
  67976. if (
  67977. ((n = i + 1),
  67978. (n %= A.length),
  67979. (o = r(e, t, A[i], A[n], !0)),
  67980. o.length > 0)
  67981. )
  67982. return !0;
  67983. return !1;
  67984. }
  67985. function a(e, i) {
  67986. var n, o, a, s, l;
  67987. for (n = 0; n < y.length; n++)
  67988. for (o = t[y[n]], a = 0; a < o.length; a++)
  67989. if (
  67990. ((s = a + 1),
  67991. (s %= o.length),
  67992. (l = r(e, i, o[a], o[s], !0)),
  67993. l.length > 0)
  67994. )
  67995. return !0;
  67996. return !1;
  67997. }
  67998. for (
  67999. var s,
  68000. l,
  68001. c,
  68002. h,
  68003. u,
  68004. d,
  68005. p,
  68006. f,
  68007. g,
  68008. m,
  68009. v,
  68010. A = e.concat(),
  68011. y = [],
  68012. C = [],
  68013. I = 0,
  68014. E = t.length;
  68015. I < E;
  68016. I++
  68017. )
  68018. y.push(I);
  68019. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  68020. if ((w--, w < 0)) {
  68021. console.log(
  68022. "Infinite Loop! Holes left:" +
  68023. y.length +
  68024. ", Probably Hole outside Shape!"
  68025. );
  68026. break;
  68027. }
  68028. for (c = b; c < A.length; c++) {
  68029. (h = A[c]), (l = -1);
  68030. for (var I = 0; I < y.length; I++)
  68031. if (
  68032. ((d = y[I]),
  68033. (p = h.x + ":" + h.y + ":" + d),
  68034. void 0 === C[p])
  68035. ) {
  68036. s = t[d];
  68037. for (var _ = 0; _ < s.length; _++)
  68038. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  68039. (l = _),
  68040. y.splice(I, 1),
  68041. (f = A.slice(0, c + 1)),
  68042. (g = A.slice(c)),
  68043. (m = s.slice(l)),
  68044. (v = s.slice(0, l + 1)),
  68045. (A = f.concat(m).concat(v).concat(g)),
  68046. (b = c);
  68047. break;
  68048. }
  68049. if (l >= 0) break;
  68050. C[p] = !0;
  68051. }
  68052. if (l >= 0) break;
  68053. }
  68054. }
  68055. return A;
  68056. }
  68057. for (
  68058. var s,
  68059. l,
  68060. c,
  68061. h,
  68062. u,
  68063. d,
  68064. p = {},
  68065. f = e.concat(),
  68066. g = 0,
  68067. m = t.length;
  68068. g < m;
  68069. g++
  68070. )
  68071. Array.prototype.push.apply(f, t[g]);
  68072. for (s = 0, l = f.length; s < l; s++)
  68073. (u = f[s].x + ":" + f[s].y),
  68074. void 0 !== p[u] &&
  68075. console.warn("THREE.Shape: Duplicate point", u),
  68076. (p[u] = s);
  68077. var v = a(e, t),
  68078. A = n.ShapeUtils.triangulate(v, !1);
  68079. for (s = 0, l = A.length; s < l; s++)
  68080. for (h = A[s], c = 0; c < 3; c++)
  68081. (u = h[c].x + ":" + h[c].y),
  68082. (d = p[u]),
  68083. void 0 !== d && (h[c] = d);
  68084. return A.concat();
  68085. },
  68086. isClockWise: function (e) {
  68087. return n.ShapeUtils.area(e) < 0;
  68088. },
  68089. b2: (function () {
  68090. function e(e, t) {
  68091. var i = 1 - e;
  68092. return i * i * t;
  68093. }
  68094. function t(e, t) {
  68095. return 2 * (1 - e) * e * t;
  68096. }
  68097. function i(e, t) {
  68098. return e * e * t;
  68099. }
  68100. return function (n, r, o, a) {
  68101. return e(n, r) + t(n, o) + i(n, a);
  68102. };
  68103. })(),
  68104. b3: (function () {
  68105. function e(e, t) {
  68106. var i = 1 - e;
  68107. return i * i * i * t;
  68108. }
  68109. function t(e, t) {
  68110. var i = 1 - e;
  68111. return 3 * i * i * e * t;
  68112. }
  68113. function i(e, t) {
  68114. var i = 1 - e;
  68115. return 3 * i * e * e * t;
  68116. }
  68117. function n(e, t) {
  68118. return e * e * e * t;
  68119. }
  68120. return function (r, o, a, s, l) {
  68121. return e(r, o) + t(r, a) + i(r, s) + n(r, l);
  68122. };
  68123. })(),
  68124. }),
  68125. (n.Curve = function () {}),
  68126. (n.Curve.prototype = {
  68127. constructor: n.Curve,
  68128. getPoint: function (e) {
  68129. return (
  68130. console.warn(
  68131. "THREE.Curve: Warning, getPoint() not implemented!"
  68132. ),
  68133. null
  68134. );
  68135. },
  68136. getPointAt: function (e) {
  68137. var t = this.getUtoTmapping(e);
  68138. return this.getPoint(t);
  68139. },
  68140. getPoints: function (e) {
  68141. e || (e = 5);
  68142. var t,
  68143. i = [];
  68144. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e));
  68145. return i;
  68146. },
  68147. getSpacedPoints: function (e) {
  68148. e || (e = 5);
  68149. var t,
  68150. i = [];
  68151. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e));
  68152. return i;
  68153. },
  68154. getLength: function () {
  68155. var e = this.getLengths();
  68156. return e[e.length - 1];
  68157. },
  68158. getLengths: function (e) {
  68159. if (
  68160. (e ||
  68161. (e = this.__arcLengthDivisions
  68162. ? this.__arcLengthDivisions
  68163. : 200),
  68164. this.cacheArcLengths &&
  68165. this.cacheArcLengths.length === e + 1 &&
  68166. !this.needsUpdate)
  68167. )
  68168. return this.cacheArcLengths;
  68169. this.needsUpdate = !1;
  68170. var t,
  68171. i,
  68172. n = [],
  68173. r = this.getPoint(0),
  68174. o = 0;
  68175. for (n.push(0), i = 1; i <= e; i++)
  68176. (t = this.getPoint(i / e)),
  68177. (o += t.distanceTo(r)),
  68178. n.push(o),
  68179. (r = t);
  68180. return (this.cacheArcLengths = n), n;
  68181. },
  68182. updateArcLengths: function () {
  68183. (this.needsUpdate = !0), this.getLengths();
  68184. },
  68185. getUtoTmapping: function (e, t) {
  68186. var i,
  68187. n = this.getLengths(),
  68188. r = 0,
  68189. o = n.length;
  68190. i = t ? t : e * n[o - 1];
  68191. for (var a, s = 0, l = o - 1; s <= l; )
  68192. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0))
  68193. s = r + 1;
  68194. else {
  68195. if (!(a > 0)) {
  68196. l = r;
  68197. break;
  68198. }
  68199. l = r - 1;
  68200. }
  68201. if (((r = l), n[r] === i)) {
  68202. var c = r / (o - 1);
  68203. return c;
  68204. }
  68205. var h = n[r],
  68206. u = n[r + 1],
  68207. d = u - h,
  68208. p = (i - h) / d,
  68209. c = (r + p) / (o - 1);
  68210. return c;
  68211. },
  68212. getTangent: function (e) {
  68213. var t = 1e-4,
  68214. i = e - t,
  68215. n = e + t;
  68216. i < 0 && (i = 0), n > 1 && (n = 1);
  68217. var r = this.getPoint(i),
  68218. o = this.getPoint(n),
  68219. a = o.clone().sub(r);
  68220. return a.normalize();
  68221. },
  68222. getTangentAt: function (e) {
  68223. var t = this.getUtoTmapping(e);
  68224. return this.getTangent(t);
  68225. },
  68226. }),
  68227. (n.Curve.create = function (e, t) {
  68228. return (
  68229. (e.prototype = Object.create(n.Curve.prototype)),
  68230. (e.prototype.constructor = e),
  68231. (e.prototype.getPoint = t),
  68232. e
  68233. );
  68234. }),
  68235. (n.CurvePath = function () {
  68236. (this.curves = []), (this.autoClose = !1);
  68237. }),
  68238. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  68239. (n.CurvePath.prototype.constructor = n.CurvePath),
  68240. (n.CurvePath.prototype.add = function (e) {
  68241. this.curves.push(e);
  68242. }),
  68243. (n.CurvePath.prototype.closePath = function () {
  68244. var e = this.curves[0].getPoint(0),
  68245. t = this.curves[this.curves.length - 1].getPoint(1);
  68246. e.equals(t) || this.curves.push(new n.LineCurve(t, e));
  68247. }),
  68248. (n.CurvePath.prototype.getPoint = function (e) {
  68249. for (
  68250. var t = e * this.getLength(), i = this.getCurveLengths(), n = 0;
  68251. n < i.length;
  68252. ) {
  68253. if (i[n] >= t) {
  68254. var r = i[n] - t,
  68255. o = this.curves[n],
  68256. a = 1 - r / o.getLength();
  68257. return o.getPointAt(a);
  68258. }
  68259. n++;
  68260. }
  68261. return null;
  68262. }),
  68263. (n.CurvePath.prototype.getLength = function () {
  68264. var e = this.getCurveLengths();
  68265. return e[e.length - 1];
  68266. }),
  68267. (n.CurvePath.prototype.getCurveLengths = function () {
  68268. if (
  68269. this.cacheLengths &&
  68270. this.cacheLengths.length === this.curves.length
  68271. )
  68272. return this.cacheLengths;
  68273. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  68274. (t += this.curves[i].getLength()), e.push(t);
  68275. return (this.cacheLengths = e), e;
  68276. }),
  68277. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  68278. var t = this.getPoints(e);
  68279. return this.createGeometry(t);
  68280. }),
  68281. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  68282. var t = this.getSpacedPoints(e);
  68283. return this.createGeometry(t);
  68284. }),
  68285. (n.CurvePath.prototype.createGeometry = function (e) {
  68286. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  68287. var o = e[i];
  68288. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0));
  68289. }
  68290. return t;
  68291. }),
  68292. (n.Font = function (e) {
  68293. this.data = e;
  68294. }),
  68295. (n.Font.prototype = {
  68296. constructor: n.Font,
  68297. generateShapes: function (e, t, i) {
  68298. function r(e) {
  68299. for (
  68300. var i = String(e).split(""),
  68301. n = t / a.resolution,
  68302. r = 0,
  68303. s = [],
  68304. l = 0;
  68305. l < i.length;
  68306. l++
  68307. ) {
  68308. var c = o(i[l], n, r);
  68309. (r += c.offset), s.push(c.path);
  68310. }
  68311. return s;
  68312. }
  68313. function o(e, t, r) {
  68314. var o = a.glyphs[e] || a.glyphs["?"];
  68315. if (o) {
  68316. var s,
  68317. l,
  68318. c,
  68319. h,
  68320. u,
  68321. d,
  68322. p,
  68323. f,
  68324. g,
  68325. m,
  68326. v,
  68327. A = new n.Path(),
  68328. y = [],
  68329. C = n.ShapeUtils.b2,
  68330. I = n.ShapeUtils.b3;
  68331. if (o.o)
  68332. for (
  68333. var E =
  68334. o._cachedOutline ||
  68335. (o._cachedOutline = o.o.split(" ")),
  68336. b = 0,
  68337. w = E.length;
  68338. b < w;
  68339. ) {
  68340. var _ = E[b++];
  68341. switch (_) {
  68342. case "m":
  68343. (s = E[b++] * t + r),
  68344. (l = E[b++] * t),
  68345. A.moveTo(s, l);
  68346. break;
  68347. case "l":
  68348. (s = E[b++] * t + r),
  68349. (l = E[b++] * t),
  68350. A.lineTo(s, l);
  68351. break;
  68352. case "q":
  68353. if (
  68354. ((c = E[b++] * t + r),
  68355. (h = E[b++] * t),
  68356. (p = E[b++] * t + r),
  68357. (f = E[b++] * t),
  68358. A.quadraticCurveTo(p, f, c, h),
  68359. (v = y[y.length - 1]))
  68360. ) {
  68361. (u = v.x), (d = v.y);
  68362. for (var T = 1; T <= i; T++) {
  68363. var x = T / i;
  68364. C(x, u, p, c), C(x, d, f, h);
  68365. }
  68366. }
  68367. break;
  68368. case "b":
  68369. if (
  68370. ((c = E[b++] * t + r),
  68371. (h = E[b++] * t),
  68372. (p = E[b++] * t + r),
  68373. (f = E[b++] * t),
  68374. (g = E[b++] * t + r),
  68375. (m = E[b++] * t),
  68376. A.bezierCurveTo(p, f, g, m, c, h),
  68377. (v = y[y.length - 1]))
  68378. ) {
  68379. (u = v.x), (d = v.y);
  68380. for (var T = 1; T <= i; T++) {
  68381. var x = T / i;
  68382. I(x, u, p, g, c), I(x, d, f, m, h);
  68383. }
  68384. }
  68385. }
  68386. }
  68387. return {
  68388. offset: o.ha * t,
  68389. path: A,
  68390. };
  68391. }
  68392. }
  68393. void 0 === t && (t = 100), void 0 === i && (i = 4);
  68394. for (
  68395. var a = this.data, s = r(e), l = [], c = 0, h = s.length;
  68396. c < h;
  68397. c++
  68398. )
  68399. Array.prototype.push.apply(l, s[c].toShapes());
  68400. return l;
  68401. },
  68402. }),
  68403. (n.Path = function (e) {
  68404. n.CurvePath.call(this),
  68405. (this.actions = []),
  68406. e && this.fromPoints(e);
  68407. }),
  68408. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  68409. (n.Path.prototype.constructor = n.Path),
  68410. (n.Path.prototype.fromPoints = function (e) {
  68411. this.moveTo(e[0].x, e[0].y);
  68412. for (var t = 1, i = e.length; t < i; t++)
  68413. this.lineTo(e[t].x, e[t].y);
  68414. }),
  68415. (n.Path.prototype.moveTo = function (e, t) {
  68416. this.actions.push({
  68417. action: "moveTo",
  68418. args: [e, t],
  68419. });
  68420. }),
  68421. (n.Path.prototype.lineTo = function (e, t) {
  68422. var i = this.actions[this.actions.length - 1].args,
  68423. r = i[i.length - 2],
  68424. o = i[i.length - 1],
  68425. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t));
  68426. this.curves.push(a),
  68427. this.actions.push({
  68428. action: "lineTo",
  68429. args: [e, t],
  68430. });
  68431. }),
  68432. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  68433. var o = this.actions[this.actions.length - 1].args,
  68434. a = o[o.length - 2],
  68435. s = o[o.length - 1],
  68436. l = new n.QuadraticBezierCurve(
  68437. new n.Vector2(a, s),
  68438. new n.Vector2(e, t),
  68439. new n.Vector2(i, r)
  68440. );
  68441. this.curves.push(l),
  68442. this.actions.push({
  68443. action: "quadraticCurveTo",
  68444. args: [e, t, i, r],
  68445. });
  68446. }),
  68447. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  68448. var s = this.actions[this.actions.length - 1].args,
  68449. l = s[s.length - 2],
  68450. c = s[s.length - 1],
  68451. h = new n.CubicBezierCurve(
  68452. new n.Vector2(l, c),
  68453. new n.Vector2(e, t),
  68454. new n.Vector2(i, r),
  68455. new n.Vector2(o, a)
  68456. );
  68457. this.curves.push(h),
  68458. this.actions.push({
  68459. action: "bezierCurveTo",
  68460. args: [e, t, i, r, o, a],
  68461. });
  68462. }),
  68463. (n.Path.prototype.splineThru = function (e) {
  68464. var t = Array.prototype.slice.call(arguments),
  68465. i = this.actions[this.actions.length - 1].args,
  68466. r = i[i.length - 2],
  68467. o = i[i.length - 1],
  68468. a = [new n.Vector2(r, o)];
  68469. Array.prototype.push.apply(a, e);
  68470. var s = new n.SplineCurve(a);
  68471. this.curves.push(s),
  68472. this.actions.push({
  68473. action: "splineThru",
  68474. args: t,
  68475. });
  68476. }),
  68477. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  68478. var a = this.actions[this.actions.length - 1].args,
  68479. s = a[a.length - 2],
  68480. l = a[a.length - 1];
  68481. this.absarc(e + s, t + l, i, n, r, o);
  68482. }),
  68483. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  68484. this.absellipse(e, t, i, i, n, r, o);
  68485. }),
  68486. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  68487. var l = this.actions[this.actions.length - 1].args,
  68488. c = l[l.length - 2],
  68489. h = l[l.length - 1];
  68490. this.absellipse(e + c, t + h, i, n, r, o, a, s);
  68491. }),
  68492. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  68493. var c = [e, t, i, r, o, a, s, l || 0],
  68494. h = new n.EllipseCurve(e, t, i, r, o, a, s, l);
  68495. this.curves.push(h);
  68496. var u = h.getPoint(1);
  68497. c.push(u.x),
  68498. c.push(u.y),
  68499. this.actions.push({
  68500. action: "ellipse",
  68501. args: c,
  68502. });
  68503. }),
  68504. (n.Path.prototype.getSpacedPoints = function (e) {
  68505. e || (e = 40);
  68506. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e));
  68507. return this.autoClose && t.push(t[0]), t;
  68508. }),
  68509. (n.Path.prototype.getPoints = function (e) {
  68510. e = e || 12;
  68511. for (
  68512. var t,
  68513. i,
  68514. r,
  68515. o,
  68516. a,
  68517. s,
  68518. l,
  68519. c,
  68520. h,
  68521. u,
  68522. d,
  68523. p = n.ShapeUtils.b2,
  68524. f = n.ShapeUtils.b3,
  68525. g = [],
  68526. m = 0,
  68527. v = this.actions.length;
  68528. m < v;
  68529. m++
  68530. ) {
  68531. var A = this.actions[m],
  68532. y = A.action,
  68533. C = A.args;
  68534. switch (y) {
  68535. case "moveTo":
  68536. g.push(new n.Vector2(C[0], C[1]));
  68537. break;
  68538. case "lineTo":
  68539. g.push(new n.Vector2(C[0], C[1]));
  68540. break;
  68541. case "quadraticCurveTo":
  68542. (t = C[2]),
  68543. (i = C[3]),
  68544. (a = C[0]),
  68545. (s = C[1]),
  68546. g.length > 0
  68547. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  68548. : ((h = this.actions[m - 1].args),
  68549. (l = h[h.length - 2]),
  68550. (c = h[h.length - 1]));
  68551. for (var I = 1; I <= e; I++) {
  68552. var E = I / e;
  68553. (u = p(E, l, a, t)),
  68554. (d = p(E, c, s, i)),
  68555. g.push(new n.Vector2(u, d));
  68556. }
  68557. break;
  68558. case "bezierCurveTo":
  68559. (t = C[4]),
  68560. (i = C[5]),
  68561. (a = C[0]),
  68562. (s = C[1]),
  68563. (r = C[2]),
  68564. (o = C[3]),
  68565. g.length > 0
  68566. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  68567. : ((h = this.actions[m - 1].args),
  68568. (l = h[h.length - 2]),
  68569. (c = h[h.length - 1]));
  68570. for (var I = 1; I <= e; I++) {
  68571. var E = I / e;
  68572. (u = f(E, l, a, r, t)),
  68573. (d = f(E, c, s, o, i)),
  68574. g.push(new n.Vector2(u, d));
  68575. }
  68576. break;
  68577. case "splineThru":
  68578. h = this.actions[m - 1].args;
  68579. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  68580. w = [b],
  68581. _ = e * C[0].length;
  68582. w = w.concat(C[0]);
  68583. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  68584. g.push(T.getPointAt(I / _));
  68585. break;
  68586. case "arc":
  68587. for (
  68588. var x,
  68589. S = C[0],
  68590. M = C[1],
  68591. R = C[2],
  68592. P = C[3],
  68593. O = C[4],
  68594. L = !!C[5],
  68595. D = O - P,
  68596. N = 2 * e,
  68597. I = 1;
  68598. I <= N;
  68599. I++
  68600. ) {
  68601. var E = I / N;
  68602. L || (E = 1 - E),
  68603. (x = P + E * D),
  68604. (u = S + R * Math.cos(x)),
  68605. (d = M + R * Math.sin(x)),
  68606. g.push(new n.Vector2(u, d));
  68607. }
  68608. break;
  68609. case "ellipse":
  68610. var x,
  68611. B,
  68612. F,
  68613. S = C[0],
  68614. M = C[1],
  68615. V = C[2],
  68616. U = C[3],
  68617. P = C[4],
  68618. O = C[5],
  68619. L = !!C[6],
  68620. k = C[7],
  68621. D = O - P,
  68622. N = 2 * e;
  68623. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)));
  68624. for (var I = 1; I <= N; I++) {
  68625. var E = I / N;
  68626. if (
  68627. (L || (E = 1 - E),
  68628. (x = P + E * D),
  68629. (u = S + V * Math.cos(x)),
  68630. (d = M + U * Math.sin(x)),
  68631. 0 !== k)
  68632. ) {
  68633. var H = u,
  68634. G = d;
  68635. (u = (H - S) * B - (G - M) * F + S),
  68636. (d = (H - S) * F + (G - M) * B + M);
  68637. }
  68638. g.push(new n.Vector2(u, d));
  68639. }
  68640. }
  68641. }
  68642. var z = g[g.length - 1];
  68643. return (
  68644. Math.abs(z.x - g[0].x) < Number.EPSILON &&
  68645. Math.abs(z.y - g[0].y) < Number.EPSILON &&
  68646. g.splice(g.length - 1, 1),
  68647. this.autoClose && g.push(g[0]),
  68648. g
  68649. );
  68650. }),
  68651. (n.Path.prototype.toShapes = function (e, t) {
  68652. function i(e) {
  68653. for (
  68654. var t = [], i = new n.Path(), r = 0, o = e.length;
  68655. r < o;
  68656. r++
  68657. ) {
  68658. var a = e[r],
  68659. s = a.args,
  68660. l = a.action;
  68661. "moveTo" === l &&
  68662. 0 !== i.actions.length &&
  68663. (t.push(i), (i = new n.Path())),
  68664. i[l].apply(i, s);
  68665. }
  68666. return 0 !== i.actions.length && t.push(i), t;
  68667. }
  68668. function r(e) {
  68669. for (var t = [], i = 0, r = e.length; i < r; i++) {
  68670. var o = e[i],
  68671. a = new n.Shape();
  68672. (a.actions = o.actions), (a.curves = o.curves), t.push(a);
  68673. }
  68674. return t;
  68675. }
  68676. function o(e, t) {
  68677. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  68678. var a = t[r],
  68679. s = t[o],
  68680. l = s.x - a.x,
  68681. c = s.y - a.y;
  68682. if (Math.abs(c) > Number.EPSILON) {
  68683. if (
  68684. (c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)),
  68685. e.y < a.y || e.y > s.y)
  68686. )
  68687. continue;
  68688. if (e.y === a.y) {
  68689. if (e.x === a.x) return !0;
  68690. } else {
  68691. var h = c * (e.x - a.x) - l * (e.y - a.y);
  68692. if (0 === h) return !0;
  68693. if (h < 0) continue;
  68694. n = !n;
  68695. }
  68696. } else {
  68697. if (e.y !== a.y) continue;
  68698. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x))
  68699. return !0;
  68700. }
  68701. }
  68702. return n;
  68703. }
  68704. var a = n.ShapeUtils.isClockWise,
  68705. s = i(this.actions);
  68706. if (0 === s.length) return [];
  68707. if (t === !0) return r(s);
  68708. var l,
  68709. c,
  68710. h,
  68711. u = [];
  68712. if (1 === s.length)
  68713. return (
  68714. (c = s[0]),
  68715. (h = new n.Shape()),
  68716. (h.actions = c.actions),
  68717. (h.curves = c.curves),
  68718. u.push(h),
  68719. u
  68720. );
  68721. var d = !a(s[0].getPoints());
  68722. d = e ? !d : d;
  68723. var p,
  68724. f = [],
  68725. g = [],
  68726. m = [],
  68727. v = 0;
  68728. (g[v] = void 0), (m[v] = []);
  68729. for (var A = 0, y = s.length; A < y; A++)
  68730. (c = s[A]),
  68731. (p = c.getPoints()),
  68732. (l = a(p)),
  68733. (l = e ? !l : l),
  68734. l
  68735. ? (!d && g[v] && v++,
  68736. (g[v] = {
  68737. s: new n.Shape(),
  68738. p: p,
  68739. }),
  68740. (g[v].s.actions = c.actions),
  68741. (g[v].s.curves = c.curves),
  68742. d && v++,
  68743. (m[v] = []))
  68744. : m[v].push({
  68745. h: c,
  68746. p: p[0],
  68747. });
  68748. if (!g[0]) return r(s);
  68749. if (g.length > 1) {
  68750. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  68751. f[E] = [];
  68752. for (var E = 0, b = g.length; E < b; E++)
  68753. for (var w = m[E], _ = 0; _ < w.length; _++) {
  68754. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  68755. o(T.p, g[S].p) &&
  68756. (E !== S &&
  68757. I.push({
  68758. froms: E,
  68759. tos: S,
  68760. hole: _,
  68761. }),
  68762. x ? ((x = !1), f[S].push(T)) : (C = !0));
  68763. x && f[E].push(T);
  68764. }
  68765. I.length > 0 && (C || (m = f));
  68766. }
  68767. for (var M, A = 0, R = g.length; A < R; A++) {
  68768. (h = g[A].s), u.push(h), (M = m[A]);
  68769. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h);
  68770. }
  68771. return u;
  68772. }),
  68773. (n.Shape = function () {
  68774. n.Path.apply(this, arguments), (this.holes = []);
  68775. }),
  68776. (n.Shape.prototype = Object.create(n.Path.prototype)),
  68777. (n.Shape.prototype.constructor = n.Shape),
  68778. (n.Shape.prototype.extrude = function (e) {
  68779. return new n.ExtrudeGeometry(this, e);
  68780. }),
  68781. (n.Shape.prototype.makeGeometry = function (e) {
  68782. return new n.ShapeGeometry(this, e);
  68783. }),
  68784. (n.Shape.prototype.getPointsHoles = function (e) {
  68785. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  68786. t[i] = this.holes[i].getPoints(e);
  68787. return t;
  68788. }),
  68789. (n.Shape.prototype.extractAllPoints = function (e) {
  68790. return {
  68791. shape: this.getPoints(e),
  68792. holes: this.getPointsHoles(e),
  68793. };
  68794. }),
  68795. (n.Shape.prototype.extractPoints = function (e) {
  68796. return this.extractAllPoints(e);
  68797. }),
  68798. (n.LineCurve = function (e, t) {
  68799. (this.v1 = e), (this.v2 = t);
  68800. }),
  68801. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  68802. (n.LineCurve.prototype.constructor = n.LineCurve),
  68803. (n.LineCurve.prototype.getPoint = function (e) {
  68804. var t = this.v2.clone().sub(this.v1);
  68805. return t.multiplyScalar(e).add(this.v1), t;
  68806. }),
  68807. (n.LineCurve.prototype.getPointAt = function (e) {
  68808. return this.getPoint(e);
  68809. }),
  68810. (n.LineCurve.prototype.getTangent = function (e) {
  68811. var t = this.v2.clone().sub(this.v1);
  68812. return t.normalize();
  68813. }),
  68814. (n.QuadraticBezierCurve = function (e, t, i) {
  68815. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  68816. }),
  68817. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  68818. (n.QuadraticBezierCurve.prototype.constructor =
  68819. n.QuadraticBezierCurve),
  68820. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  68821. var t = n.ShapeUtils.b2;
  68822. return new n.Vector2(
  68823. t(e, this.v0.x, this.v1.x, this.v2.x),
  68824. t(e, this.v0.y, this.v1.y, this.v2.y)
  68825. );
  68826. }),
  68827. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  68828. var t = n.CurveUtils.tangentQuadraticBezier;
  68829. return new n.Vector2(
  68830. t(e, this.v0.x, this.v1.x, this.v2.x),
  68831. t(e, this.v0.y, this.v1.y, this.v2.y)
  68832. ).normalize();
  68833. }),
  68834. (n.CubicBezierCurve = function (e, t, i, n) {
  68835. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  68836. }),
  68837. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  68838. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  68839. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  68840. var t = n.ShapeUtils.b3;
  68841. return new n.Vector2(
  68842. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  68843. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  68844. );
  68845. }),
  68846. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  68847. var t = n.CurveUtils.tangentCubicBezier;
  68848. return new n.Vector2(
  68849. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  68850. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  68851. ).normalize();
  68852. }),
  68853. (n.SplineCurve = function (e) {
  68854. this.points = void 0 == e ? [] : e;
  68855. }),
  68856. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  68857. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  68858. (n.SplineCurve.prototype.getPoint = function (e) {
  68859. var t = this.points,
  68860. i = (t.length - 1) * e,
  68861. r = Math.floor(i),
  68862. o = i - r,
  68863. a = t[0 === r ? r : r - 1],
  68864. s = t[r],
  68865. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  68866. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  68867. h = n.CurveUtils.interpolate;
  68868. return new n.Vector2(
  68869. h(a.x, s.x, l.x, c.x, o),
  68870. h(a.y, s.y, l.y, c.y, o)
  68871. );
  68872. }),
  68873. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  68874. (this.aX = e),
  68875. (this.aY = t),
  68876. (this.xRadius = i),
  68877. (this.yRadius = n),
  68878. (this.aStartAngle = r),
  68879. (this.aEndAngle = o),
  68880. (this.aClockwise = a),
  68881. (this.aRotation = s || 0);
  68882. }),
  68883. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  68884. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  68885. (n.EllipseCurve.prototype.getPoint = function (e) {
  68886. var t = this.aEndAngle - this.aStartAngle;
  68887. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI);
  68888. var i;
  68889. i =
  68890. this.aClockwise === !0
  68891. ? this.aEndAngle + (1 - e) * (2 * Math.PI - t)
  68892. : this.aStartAngle + e * t;
  68893. var r = this.aX + this.xRadius * Math.cos(i),
  68894. o = this.aY + this.yRadius * Math.sin(i);
  68895. if (0 !== this.aRotation) {
  68896. var a = Math.cos(this.aRotation),
  68897. s = Math.sin(this.aRotation),
  68898. l = r,
  68899. c = o;
  68900. (r = (l - this.aX) * a - (c - this.aY) * s + this.aX),
  68901. (o = (l - this.aX) * s + (c - this.aY) * a + this.aY);
  68902. }
  68903. return new n.Vector2(r, o);
  68904. }),
  68905. (n.ArcCurve = function (e, t, i, r, o, a) {
  68906. n.EllipseCurve.call(this, e, t, i, i, r, o, a);
  68907. }),
  68908. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  68909. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  68910. (n.LineCurve3 = n.Curve.create(
  68911. function (e, t) {
  68912. (this.v1 = e), (this.v2 = t);
  68913. },
  68914. function (e) {
  68915. var t = new n.Vector3();
  68916. return (
  68917. t.subVectors(this.v2, this.v1),
  68918. t.multiplyScalar(e),
  68919. t.add(this.v1),
  68920. t
  68921. );
  68922. }
  68923. )),
  68924. (n.QuadraticBezierCurve3 = n.Curve.create(
  68925. function (e, t, i) {
  68926. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  68927. },
  68928. function (e) {
  68929. var t = n.ShapeUtils.b2;
  68930. return new n.Vector3(
  68931. t(e, this.v0.x, this.v1.x, this.v2.x),
  68932. t(e, this.v0.y, this.v1.y, this.v2.y),
  68933. t(e, this.v0.z, this.v1.z, this.v2.z)
  68934. );
  68935. }
  68936. )),
  68937. (n.CubicBezierCurve3 = n.Curve.create(
  68938. function (e, t, i, n) {
  68939. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  68940. },
  68941. function (e) {
  68942. var t = n.ShapeUtils.b3;
  68943. return new n.Vector3(
  68944. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  68945. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),
  68946. t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z)
  68947. );
  68948. }
  68949. )),
  68950. (n.SplineCurve3 = n.Curve.create(
  68951. function (e) {
  68952. console.warn(
  68953. "THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"
  68954. ),
  68955. (this.points = void 0 == e ? [] : e);
  68956. },
  68957. function (e) {
  68958. var t = this.points,
  68959. i = (t.length - 1) * e,
  68960. r = Math.floor(i),
  68961. o = i - r,
  68962. a = t[0 == r ? r : r - 1],
  68963. s = t[r],
  68964. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  68965. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  68966. h = n.CurveUtils.interpolate;
  68967. return new n.Vector3(
  68968. h(a.x, s.x, l.x, c.x, o),
  68969. h(a.y, s.y, l.y, c.y, o),
  68970. h(a.z, s.z, l.z, c.z, o)
  68971. );
  68972. }
  68973. )),
  68974. (n.CatmullRomCurve3 = (function () {
  68975. function e() {}
  68976. var t = new n.Vector3(),
  68977. i = new e(),
  68978. r = new e(),
  68979. o = new e();
  68980. return (
  68981. (e.prototype.init = function (e, t, i, n) {
  68982. (this.c0 = e),
  68983. (this.c1 = i),
  68984. (this.c2 = -3 * e + 3 * t - 2 * i - n),
  68985. (this.c3 = 2 * e - 2 * t + i + n);
  68986. }),
  68987. (e.prototype.initNonuniformCatmullRom = function (
  68988. e,
  68989. t,
  68990. i,
  68991. n,
  68992. r,
  68993. o,
  68994. a
  68995. ) {
  68996. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  68997. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  68998. (s *= o), (l *= o), this.init(t, i, s, l);
  68999. }),
  69000. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  69001. this.init(t, i, r * (i - e), r * (n - t));
  69002. }),
  69003. (e.prototype.calc = function (e) {
  69004. var t = e * e,
  69005. i = t * e;
  69006. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i;
  69007. }),
  69008. n.Curve.create(
  69009. function (e) {
  69010. (this.points = e || []), (this.closed = !1);
  69011. },
  69012. function (e) {
  69013. var a,
  69014. s,
  69015. l,
  69016. c,
  69017. h = this.points;
  69018. (c = h.length),
  69019. c < 2 && console.log("duh, you need at least 2 points"),
  69020. (a = (c - (this.closed ? 0 : 1)) * e),
  69021. (s = Math.floor(a)),
  69022. (l = a - s),
  69023. this.closed
  69024. ? (s +=
  69025. s > 0
  69026. ? 0
  69027. : (Math.floor(Math.abs(s) / h.length) + 1) *
  69028. h.length)
  69029. : 0 === l && s === c - 1 && ((s = c - 2), (l = 1));
  69030. var u, d, p, f;
  69031. if (
  69032. (this.closed || s > 0
  69033. ? (u = h[(s - 1) % c])
  69034. : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  69035. (d = h[s % c]),
  69036. (p = h[(s + 1) % c]),
  69037. this.closed || s + 2 < c
  69038. ? (f = h[(s + 2) % c])
  69039. : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  69040. (f = t)),
  69041. void 0 === this.type ||
  69042. "centripetal" === this.type ||
  69043. "chordal" === this.type)
  69044. ) {
  69045. var g = "chordal" === this.type ? 0.5 : 0.25,
  69046. m = Math.pow(u.distanceToSquared(d), g),
  69047. v = Math.pow(d.distanceToSquared(p), g),
  69048. A = Math.pow(p.distanceToSquared(f), g);
  69049. v < 1e-4 && (v = 1),
  69050. m < 1e-4 && (m = v),
  69051. A < 1e-4 && (A = v),
  69052. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  69053. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  69054. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A);
  69055. } else if ("catmullrom" === this.type) {
  69056. var y = void 0 !== this.tension ? this.tension : 0.5;
  69057. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  69058. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  69059. o.initCatmullRom(u.z, d.z, p.z, f.z, y);
  69060. }
  69061. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l));
  69062. return C;
  69063. }
  69064. )
  69065. );
  69066. })()),
  69067. (n.ClosedSplineCurve3 = function (e) {
  69068. console.warn(
  69069. "THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."
  69070. ),
  69071. n.CatmullRomCurve3.call(this, e),
  69072. (this.type = "catmullrom"),
  69073. (this.closed = !0);
  69074. }),
  69075. (n.ClosedSplineCurve3.prototype = Object.create(
  69076. n.CatmullRomCurve3.prototype
  69077. )),
  69078. (n.BoxGeometry = function (e, t, i, r, o, a) {
  69079. n.Geometry.call(this),
  69080. (this.type = "BoxGeometry"),
  69081. (this.parameters = {
  69082. width: e,
  69083. height: t,
  69084. depth: i,
  69085. widthSegments: r,
  69086. heightSegments: o,
  69087. depthSegments: a,
  69088. }),
  69089. this.fromBufferGeometry(
  69090. new n.BoxBufferGeometry(e, t, i, r, o, a)
  69091. ),
  69092. this.mergeVertices();
  69093. }),
  69094. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  69095. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  69096. (n.CubeGeometry = n.BoxGeometry),
  69097. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  69098. function s(e, t, i) {
  69099. var n = 0;
  69100. return (
  69101. (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n
  69102. );
  69103. }
  69104. function l(e, t, i, r, o, a, s, l, h, u, I) {
  69105. for (
  69106. var E = a / h,
  69107. b = s / u,
  69108. w = a / 2,
  69109. _ = s / 2,
  69110. T = l / 2,
  69111. x = h + 1,
  69112. S = u + 1,
  69113. M = 0,
  69114. R = 0,
  69115. P = new n.Vector3(),
  69116. O = 0;
  69117. O < S;
  69118. O++
  69119. )
  69120. for (var L = O * b - _, D = 0; D < x; D++) {
  69121. var N = D * E - w;
  69122. (P[e] = N * r),
  69123. (P[t] = L * o),
  69124. (P[i] = T),
  69125. (p[m] = P.x),
  69126. (p[m + 1] = P.y),
  69127. (p[m + 2] = P.z),
  69128. (P[e] = 0),
  69129. (P[t] = 0),
  69130. (P[i] = l > 0 ? 1 : -1),
  69131. (f[m] = P.x),
  69132. (f[m + 1] = P.y),
  69133. (f[m + 2] = P.z),
  69134. (g[v] = D / h),
  69135. (g[v + 1] = 1 - O / u),
  69136. (m += 3),
  69137. (v += 2),
  69138. (M += 1);
  69139. }
  69140. for (O = 0; O < u; O++)
  69141. for (D = 0; D < h; D++) {
  69142. var B = y + D + x * O,
  69143. F = y + D + x * (O + 1),
  69144. V = y + (D + 1) + x * (O + 1),
  69145. U = y + (D + 1) + x * O;
  69146. (d[A] = B),
  69147. (d[A + 1] = F),
  69148. (d[A + 2] = U),
  69149. (d[A + 3] = F),
  69150. (d[A + 4] = V),
  69151. (d[A + 5] = U),
  69152. (A += 6),
  69153. (R += 6);
  69154. }
  69155. c.addGroup(C, R, I), (C += R), (y += M);
  69156. }
  69157. n.BufferGeometry.call(this),
  69158. (this.type = "BoxBufferGeometry"),
  69159. (this.parameters = {
  69160. width: e,
  69161. height: t,
  69162. depth: i,
  69163. widthSegments: r,
  69164. heightSegments: o,
  69165. depthSegments: a,
  69166. });
  69167. var c = this;
  69168. (r = Math.floor(r) || 1),
  69169. (o = Math.floor(o) || 1),
  69170. (a = Math.floor(a) || 1);
  69171. var h = s(r, o, a),
  69172. u = (h / 4) * 6,
  69173. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  69174. p = new Float32Array(3 * h),
  69175. f = new Float32Array(3 * h),
  69176. g = new Float32Array(2 * h),
  69177. m = 0,
  69178. v = 0,
  69179. A = 0,
  69180. y = 0,
  69181. C = 0;
  69182. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  69183. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  69184. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  69185. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  69186. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  69187. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  69188. this.setIndex(new n.BufferAttribute(d, 1)),
  69189. this.addAttribute("position", new n.BufferAttribute(p, 3)),
  69190. this.addAttribute("normal", new n.BufferAttribute(f, 3)),
  69191. this.addAttribute("uv", new n.BufferAttribute(g, 2));
  69192. }),
  69193. (n.BoxBufferGeometry.prototype = Object.create(
  69194. n.BufferGeometry.prototype
  69195. )),
  69196. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  69197. (n.CircleGeometry = function (e, t, i, r) {
  69198. n.Geometry.call(this),
  69199. (this.type = "CircleGeometry"),
  69200. (this.parameters = {
  69201. radius: e,
  69202. segments: t,
  69203. thetaStart: i,
  69204. thetaLength: r,
  69205. }),
  69206. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r));
  69207. }),
  69208. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  69209. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  69210. (n.CircleBufferGeometry = function (e, t, i, r) {
  69211. n.BufferGeometry.call(this),
  69212. (this.type = "CircleBufferGeometry"),
  69213. (this.parameters = {
  69214. radius: e,
  69215. segments: t,
  69216. thetaStart: i,
  69217. thetaLength: r,
  69218. }),
  69219. (e = e || 50),
  69220. (t = void 0 !== t ? Math.max(3, t) : 8),
  69221. (i = void 0 !== i ? i : 0),
  69222. (r = void 0 !== r ? r : 2 * Math.PI);
  69223. var o = t + 2,
  69224. a = new Float32Array(3 * o),
  69225. s = new Float32Array(3 * o),
  69226. l = new Float32Array(2 * o);
  69227. (s[2] = 1), (l[0] = 0.5), (l[1] = 0.5);
  69228. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  69229. var d = i + (c / t) * r;
  69230. (a[h] = e * Math.cos(d)),
  69231. (a[h + 1] = e * Math.sin(d)),
  69232. (s[h + 2] = 1),
  69233. (l[u] = (a[h] / e + 1) / 2),
  69234. (l[u + 1] = (a[h + 1] / e + 1) / 2);
  69235. }
  69236. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0);
  69237. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  69238. this.addAttribute("position", new n.BufferAttribute(a, 3)),
  69239. this.addAttribute("normal", new n.BufferAttribute(s, 3)),
  69240. this.addAttribute("uv", new n.BufferAttribute(l, 2)),
  69241. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  69242. }),
  69243. (n.CircleBufferGeometry.prototype = Object.create(
  69244. n.BufferGeometry.prototype
  69245. )),
  69246. (n.CircleBufferGeometry.prototype.constructor =
  69247. n.CircleBufferGeometry),
  69248. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  69249. function c() {
  69250. var e = (r + 1) * (o + 1);
  69251. return a === !1 && (e += 2 * (r + 1) + 2 * r), e;
  69252. }
  69253. function h() {
  69254. var e = r * o * 2 * 3;
  69255. return a === !1 && (e += 2 * r * 3), e;
  69256. }
  69257. function u() {
  69258. var a,
  69259. c,
  69260. h = new n.Vector3(),
  69261. u = new n.Vector3(),
  69262. d = (t - e) / i;
  69263. for (c = 0; c <= o; c++) {
  69264. var p = [],
  69265. f = c / o,
  69266. b = f * (t - e) + e;
  69267. for (a = 0; a <= r; a++) {
  69268. var w = a / r;
  69269. (u.x = b * Math.sin(w * l + s)),
  69270. (u.y = -f * i + E),
  69271. (u.z = b * Math.cos(w * l + s)),
  69272. m.setXYZ(y, u.x, u.y, u.z),
  69273. h.copy(u),
  69274. ((0 === e && 0 === c) || (0 === t && c === o)) &&
  69275. ((h.x = Math.sin(w * l + s)),
  69276. (h.z = Math.cos(w * l + s))),
  69277. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  69278. v.setXYZ(y, h.x, h.y, h.z),
  69279. A.setXY(y, w, 1 - f),
  69280. p.push(y),
  69281. y++;
  69282. }
  69283. I.push(p);
  69284. }
  69285. for (a = 0; a < r; a++)
  69286. for (c = 0; c < o; c++) {
  69287. var _ = I[c][a],
  69288. T = I[c + 1][a],
  69289. x = I[c + 1][a + 1],
  69290. S = I[c][a + 1];
  69291. g.setX(C, _),
  69292. C++,
  69293. g.setX(C, T),
  69294. C++,
  69295. g.setX(C, S),
  69296. C++,
  69297. g.setX(C, T),
  69298. C++,
  69299. g.setX(C, x),
  69300. C++,
  69301. g.setX(C, S),
  69302. C++;
  69303. }
  69304. }
  69305. function d(i) {
  69306. var o,
  69307. a,
  69308. c,
  69309. h = new n.Vector2(),
  69310. u = new n.Vector3(),
  69311. d = i === !0 ? e : t,
  69312. p = i === !0 ? 1 : -1;
  69313. for (a = y, o = 1; o <= r; o++)
  69314. m.setXYZ(y, 0, E * p, 0),
  69315. v.setXYZ(y, 0, p, 0),
  69316. i === !0
  69317. ? ((h.x = o / r), (h.y = 0))
  69318. : ((h.x = (o - 1) / r), (h.y = 1)),
  69319. A.setXY(y, h.x, h.y),
  69320. y++;
  69321. for (c = y, o = 0; o <= r; o++) {
  69322. var f = o / r;
  69323. (u.x = d * Math.sin(f * l + s)),
  69324. (u.y = E * p),
  69325. (u.z = d * Math.cos(f * l + s)),
  69326. m.setXYZ(y, u.x, u.y, u.z),
  69327. v.setXYZ(y, 0, p, 0),
  69328. A.setXY(y, f, i === !0 ? 1 : 0),
  69329. y++;
  69330. }
  69331. for (o = 0; o < r; o++) {
  69332. var I = a + o,
  69333. b = c + o;
  69334. i === !0
  69335. ? (g.setX(C, b),
  69336. C++,
  69337. g.setX(C, b + 1),
  69338. C++,
  69339. g.setX(C, I),
  69340. C++)
  69341. : (g.setX(C, b + 1),
  69342. C++,
  69343. g.setX(C, b),
  69344. C++,
  69345. g.setX(C, I),
  69346. C++);
  69347. }
  69348. }
  69349. n.BufferGeometry.call(this),
  69350. (this.type = "CylinderBufferGeometry"),
  69351. (this.parameters = {
  69352. radiusTop: e,
  69353. radiusBottom: t,
  69354. height: i,
  69355. radialSegments: r,
  69356. heightSegments: o,
  69357. openEnded: a,
  69358. thetaStart: s,
  69359. thetaLength: l,
  69360. }),
  69361. (e = void 0 !== e ? e : 20),
  69362. (t = void 0 !== t ? t : 20),
  69363. (i = void 0 !== i ? i : 100),
  69364. (r = Math.floor(r) || 8),
  69365. (o = Math.floor(o) || 1),
  69366. (a = void 0 !== a && a),
  69367. (s = void 0 !== s ? s : 0),
  69368. (l = void 0 !== l ? l : 2 * Math.PI);
  69369. var p = c(),
  69370. f = h(),
  69371. g = new n.BufferAttribute(
  69372. new (f > 65535 ? Uint32Array : Uint16Array)(f),
  69373. 1
  69374. ),
  69375. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  69376. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  69377. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  69378. y = 0,
  69379. C = 0,
  69380. I = [],
  69381. E = i / 2;
  69382. u(),
  69383. a === !1 && (e > 0 && d(!0), t > 0 && d(!1)),
  69384. this.setIndex(g),
  69385. this.addAttribute("position", m),
  69386. this.addAttribute("normal", v),
  69387. this.addAttribute("uv", A);
  69388. }),
  69389. (n.CylinderBufferGeometry.prototype = Object.create(
  69390. n.BufferGeometry.prototype
  69391. )),
  69392. (n.CylinderBufferGeometry.prototype.constructor =
  69393. n.CylinderBufferGeometry),
  69394. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  69395. n.Geometry.call(this),
  69396. (this.type = "CylinderGeometry"),
  69397. (this.parameters = {
  69398. radiusTop: e,
  69399. radiusBottom: t,
  69400. height: i,
  69401. radialSegments: r,
  69402. heightSegments: o,
  69403. openEnded: a,
  69404. thetaStart: s,
  69405. thetaLength: l,
  69406. }),
  69407. this.fromBufferGeometry(
  69408. new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)
  69409. ),
  69410. this.mergeVertices();
  69411. }),
  69412. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  69413. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  69414. (n.EdgesGeometry = function (e, t) {
  69415. function i(e, t) {
  69416. return e - t;
  69417. }
  69418. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1);
  69419. var r,
  69420. o = Math.cos(n.Math.degToRad(t)),
  69421. a = [0, 0],
  69422. s = {},
  69423. l = ["a", "b", "c"];
  69424. e instanceof n.BufferGeometry
  69425. ? ((r = new n.Geometry()), r.fromBufferGeometry(e))
  69426. : (r = e.clone()),
  69427. r.mergeVertices(),
  69428. r.computeFaceNormals();
  69429. for (
  69430. var c = r.vertices, h = r.faces, u = 0, d = h.length;
  69431. u < d;
  69432. u++
  69433. )
  69434. for (var p = h[u], f = 0; f < 3; f++) {
  69435. (a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i);
  69436. var g = a.toString();
  69437. void 0 === s[g]
  69438. ? (s[g] = {
  69439. vert1: a[0],
  69440. vert2: a[1],
  69441. face1: u,
  69442. face2: void 0,
  69443. })
  69444. : (s[g].face2 = u);
  69445. }
  69446. var m = [];
  69447. for (var g in s) {
  69448. var v = s[g];
  69449. if (
  69450. void 0 === v.face2 ||
  69451. h[v.face1].normal.dot(h[v.face2].normal) <= o
  69452. ) {
  69453. var A = c[v.vert1];
  69454. m.push(A.x),
  69455. m.push(A.y),
  69456. m.push(A.z),
  69457. (A = c[v.vert2]),
  69458. m.push(A.x),
  69459. m.push(A.y),
  69460. m.push(A.z);
  69461. }
  69462. }
  69463. this.addAttribute(
  69464. "position",
  69465. new n.BufferAttribute(new Float32Array(m), 3)
  69466. );
  69467. }),
  69468. (n.EdgesGeometry.prototype = Object.create(
  69469. n.BufferGeometry.prototype
  69470. )),
  69471. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  69472. (n.ExtrudeGeometry = function (e, t) {
  69473. return "undefined" == typeof e
  69474. ? void (e = [])
  69475. : (n.Geometry.call(this),
  69476. (this.type = "ExtrudeGeometry"),
  69477. (e = Array.isArray(e) ? e : [e]),
  69478. this.addShapeList(e, t),
  69479. void this.computeFaceNormals());
  69480. });
  69481. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  69482. (n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  69483. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  69484. for (var i = e.length, n = 0; n < i; n++) {
  69485. var r = e[n];
  69486. this.addShape(r, t);
  69487. }
  69488. }),
  69489. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  69490. function i(e, t, i) {
  69491. return (
  69492. t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  69493. t.clone().multiplyScalar(i).add(e)
  69494. );
  69495. }
  69496. function r(e, t, i) {
  69497. var r,
  69498. o,
  69499. a = 1,
  69500. s = e.x - t.x,
  69501. l = e.y - t.y,
  69502. c = i.x - e.x,
  69503. h = i.y - e.y,
  69504. u = s * s + l * l,
  69505. d = s * h - l * c;
  69506. if (Math.abs(d) > Number.EPSILON) {
  69507. var p = Math.sqrt(u),
  69508. f = Math.sqrt(c * c + h * h),
  69509. g = t.x - l / p,
  69510. m = t.y + s / p,
  69511. v = i.x - h / f,
  69512. A = i.y + c / f,
  69513. y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  69514. (r = g + s * y - e.x), (o = m + l * y - e.y);
  69515. var C = r * r + o * o;
  69516. if (C <= 2) return new n.Vector2(r, o);
  69517. a = Math.sqrt(C / 2);
  69518. } else {
  69519. var I = !1;
  69520. s > Number.EPSILON
  69521. ? c > Number.EPSILON && (I = !0)
  69522. : s < -Number.EPSILON
  69523. ? c < -Number.EPSILON && (I = !0)
  69524. : Math.sign(l) === Math.sign(h) && (I = !0),
  69525. I
  69526. ? ((r = -l), (o = s), (a = Math.sqrt(u)))
  69527. : ((r = s), (o = l), (a = Math.sqrt(u / 2)));
  69528. }
  69529. return new n.Vector2(r / a, o / a);
  69530. }
  69531. function o() {
  69532. if (C) {
  69533. var e = 0,
  69534. t = z * e;
  69535. for (Y = 0; Y < W; Y++)
  69536. (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t);
  69537. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++)
  69538. (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t);
  69539. } else {
  69540. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0]);
  69541. for (Y = 0; Y < W; Y++)
  69542. (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E);
  69543. }
  69544. }
  69545. function a() {
  69546. var e = 0;
  69547. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++)
  69548. (T = L[x]), s(T, e), (e += T.length);
  69549. }
  69550. function s(e, t) {
  69551. var i, n;
  69552. for (Y = e.length; --Y >= 0; ) {
  69553. (i = Y), (n = Y - 1), n < 0 && (n = e.length - 1);
  69554. var r = 0,
  69555. o = E + 2 * y;
  69556. for (r = 0; r < o; r++) {
  69557. var a = z * r,
  69558. s = z * (r + 1),
  69559. l = t + i + a,
  69560. c = t + n + a,
  69561. u = t + n + s,
  69562. d = t + i + s;
  69563. h(l, c, u, d, e, r, o, i, n);
  69564. }
  69565. }
  69566. }
  69567. function l(e, t, i) {
  69568. M.vertices.push(new n.Vector3(e, t, i));
  69569. }
  69570. function c(e, t, i) {
  69571. (e += R),
  69572. (t += R),
  69573. (i += R),
  69574. M.faces.push(new n.Face3(e, t, i, null, null, 0));
  69575. var r = _.generateTopUV(M, e, t, i);
  69576. M.faceVertexUvs[0].push(r);
  69577. }
  69578. function h(e, t, i, r, o, a, s, l, c) {
  69579. (e += R),
  69580. (t += R),
  69581. (i += R),
  69582. (r += R),
  69583. M.faces.push(new n.Face3(e, t, r, null, null, 1)),
  69584. M.faces.push(new n.Face3(t, i, r, null, null, 1));
  69585. var h = _.generateSideWallUV(M, e, t, i, r);
  69586. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  69587. M.faceVertexUvs[0].push([h[1], h[2], h[3]]);
  69588. }
  69589. var u,
  69590. d,
  69591. p,
  69592. f,
  69593. g,
  69594. m = void 0 !== t.amount ? t.amount : 100,
  69595. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  69596. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  69597. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  69598. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  69599. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  69600. E = void 0 !== t.steps ? t.steps : 1,
  69601. b = t.extrudePath,
  69602. w = !1,
  69603. _ =
  69604. void 0 !== t.UVGenerator
  69605. ? t.UVGenerator
  69606. : n.ExtrudeGeometry.WorldUVGenerator;
  69607. b &&
  69608. ((u = b.getSpacedPoints(E)),
  69609. (w = !0),
  69610. (C = !1),
  69611. (d =
  69612. void 0 !== t.frames
  69613. ? t.frames
  69614. : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  69615. (p = new n.Vector3()),
  69616. (f = new n.Vector3()),
  69617. (g = new n.Vector3())),
  69618. C || ((y = 0), (v = 0), (A = 0));
  69619. var T,
  69620. x,
  69621. S,
  69622. M = this,
  69623. R = this.vertices.length,
  69624. P = e.extractPoints(I),
  69625. O = P.shape,
  69626. L = P.holes,
  69627. D = !n.ShapeUtils.isClockWise(O);
  69628. if (D) {
  69629. for (O = O.reverse(), x = 0, S = L.length; x < S; x++)
  69630. (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  69631. D = !1;
  69632. }
  69633. var N = n.ShapeUtils.triangulateShape(O, L),
  69634. B = O;
  69635. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T));
  69636. for (
  69637. var F,
  69638. V,
  69639. U,
  69640. k,
  69641. H,
  69642. G,
  69643. z = O.length,
  69644. W = N.length,
  69645. j = [],
  69646. Y = 0,
  69647. X = B.length,
  69648. Z = X - 1,
  69649. q = Y + 1;
  69650. Y < X;
  69651. Y++, Z++, q++
  69652. )
  69653. Z === X && (Z = 0),
  69654. q === X && (q = 0),
  69655. (j[Y] = r(B[Y], B[Z], B[q]));
  69656. var K,
  69657. Q = [],
  69658. J = j.concat();
  69659. for (x = 0, S = L.length; x < S; x++) {
  69660. for (
  69661. T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1;
  69662. Y < X;
  69663. Y++, Z++, q++
  69664. )
  69665. Z === X && (Z = 0),
  69666. q === X && (q = 0),
  69667. (K[Y] = r(T[Y], T[Z], T[q]));
  69668. Q.push(K), (J = J.concat(K));
  69669. }
  69670. for (F = 0; F < y; F++) {
  69671. for (
  69672. U = F / y,
  69673. k = v * (1 - U),
  69674. V = A * Math.sin((U * Math.PI) / 2),
  69675. Y = 0,
  69676. X = B.length;
  69677. Y < X;
  69678. Y++
  69679. )
  69680. (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k);
  69681. for (x = 0, S = L.length; x < S; x++)
  69682. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  69683. (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k);
  69684. }
  69685. for (V = A, Y = 0; Y < z; Y++)
  69686. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  69687. w
  69688. ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  69689. p.copy(d.binormals[0]).multiplyScalar(H.y),
  69690. g.copy(u[0]).add(f).add(p),
  69691. l(g.x, g.y, g.z))
  69692. : l(H.x, H.y, 0);
  69693. var $;
  69694. for ($ = 1; $ <= E; $++)
  69695. for (Y = 0; Y < z; Y++)
  69696. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  69697. w
  69698. ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  69699. p.copy(d.binormals[$]).multiplyScalar(H.y),
  69700. g.copy(u[$]).add(f).add(p),
  69701. l(g.x, g.y, g.z))
  69702. : l(H.x, H.y, (m / E) * $);
  69703. for (F = y - 1; F >= 0; F--) {
  69704. for (
  69705. U = F / y,
  69706. k = v * (1 - U),
  69707. V = A * Math.sin((U * Math.PI) / 2),
  69708. Y = 0,
  69709. X = B.length;
  69710. Y < X;
  69711. Y++
  69712. )
  69713. (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k);
  69714. for (x = 0, S = L.length; x < S; x++)
  69715. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  69716. (H = i(T[Y], K[Y], V)),
  69717. w
  69718. ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k)
  69719. : l(H.x, H.y, m + k);
  69720. }
  69721. o(), a();
  69722. }),
  69723. (n.ExtrudeGeometry.WorldUVGenerator = {
  69724. generateTopUV: function (e, t, i, r) {
  69725. var o = e.vertices,
  69726. a = o[t],
  69727. s = o[i],
  69728. l = o[r];
  69729. return [
  69730. new n.Vector2(a.x, a.y),
  69731. new n.Vector2(s.x, s.y),
  69732. new n.Vector2(l.x, l.y),
  69733. ];
  69734. },
  69735. generateSideWallUV: function (e, t, i, r, o) {
  69736. var a = e.vertices,
  69737. s = a[t],
  69738. l = a[i],
  69739. c = a[r],
  69740. h = a[o];
  69741. return Math.abs(s.y - l.y) < 0.01
  69742. ? [
  69743. new n.Vector2(s.x, 1 - s.z),
  69744. new n.Vector2(l.x, 1 - l.z),
  69745. new n.Vector2(c.x, 1 - c.z),
  69746. new n.Vector2(h.x, 1 - h.z),
  69747. ]
  69748. : [
  69749. new n.Vector2(s.y, 1 - s.z),
  69750. new n.Vector2(l.y, 1 - l.z),
  69751. new n.Vector2(c.y, 1 - c.z),
  69752. new n.Vector2(h.y, 1 - h.z),
  69753. ];
  69754. },
  69755. }),
  69756. (n.ShapeGeometry = function (e, t) {
  69757. n.Geometry.call(this),
  69758. (this.type = "ShapeGeometry"),
  69759. Array.isArray(e) === !1 && (e = [e]),
  69760. this.addShapeList(e, t),
  69761. this.computeFaceNormals();
  69762. }),
  69763. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  69764. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  69765. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  69766. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t);
  69767. return this;
  69768. }),
  69769. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  69770. void 0 === t && (t = {});
  69771. var i,
  69772. r,
  69773. o,
  69774. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  69775. s = t.material,
  69776. l =
  69777. void 0 === t.UVGenerator
  69778. ? n.ExtrudeGeometry.WorldUVGenerator
  69779. : t.UVGenerator,
  69780. c = this.vertices.length,
  69781. h = e.extractPoints(a),
  69782. u = h.shape,
  69783. d = h.holes,
  69784. p = !n.ShapeUtils.isClockWise(u);
  69785. if (p) {
  69786. for (u = u.reverse(), i = 0, r = d.length; i < r; i++)
  69787. (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  69788. p = !1;
  69789. }
  69790. var f = n.ShapeUtils.triangulateShape(u, d);
  69791. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o));
  69792. var g,
  69793. m,
  69794. v = u.length,
  69795. A = f.length;
  69796. for (i = 0; i < v; i++)
  69797. (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0));
  69798. for (i = 0; i < A; i++) {
  69799. m = f[i];
  69800. var y = m[0] + c,
  69801. C = m[1] + c,
  69802. I = m[2] + c;
  69803. this.faces.push(new n.Face3(y, C, I, null, null, s)),
  69804. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I));
  69805. }
  69806. }),
  69807. (n.LatheBufferGeometry = function (e, t, i, r) {
  69808. n.BufferGeometry.call(this),
  69809. (this.type = "LatheBufferGeometry"),
  69810. (this.parameters = {
  69811. points: e,
  69812. segments: t,
  69813. phiStart: i,
  69814. phiLength: r,
  69815. }),
  69816. (t = Math.floor(t) || 12),
  69817. (i = i || 0),
  69818. (r = r || 2 * Math.PI),
  69819. (r = n.Math.clamp(r, 0, 2 * Math.PI));
  69820. var o,
  69821. a,
  69822. s,
  69823. l = (t + 1) * e.length,
  69824. c = t * e.length * 2 * 3,
  69825. h = new n.BufferAttribute(
  69826. new (c > 65535 ? Uint32Array : Uint16Array)(c),
  69827. 1
  69828. ),
  69829. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  69830. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  69831. p = 0,
  69832. f = 0,
  69833. g = (1 / (e.length - 1), 1 / t),
  69834. m = new n.Vector3(),
  69835. v = new n.Vector2();
  69836. for (a = 0; a <= t; a++) {
  69837. var A = i + a * g * r,
  69838. y = Math.sin(A),
  69839. C = Math.cos(A);
  69840. for (s = 0; s <= e.length - 1; s++)
  69841. (m.x = e[s].x * y),
  69842. (m.y = e[s].y),
  69843. (m.z = e[s].x * C),
  69844. u.setXYZ(p, m.x, m.y, m.z),
  69845. (v.x = a / t),
  69846. (v.y = s / (e.length - 1)),
  69847. d.setXY(p, v.x, v.y),
  69848. p++;
  69849. }
  69850. for (a = 0; a < t; a++)
  69851. for (s = 0; s < e.length - 1; s++) {
  69852. o = s + a * e.length;
  69853. var I = o,
  69854. E = o + e.length,
  69855. b = o + e.length + 1,
  69856. w = o + 1;
  69857. h.setX(f, I),
  69858. f++,
  69859. h.setX(f, E),
  69860. f++,
  69861. h.setX(f, w),
  69862. f++,
  69863. h.setX(f, E),
  69864. f++,
  69865. h.setX(f, b),
  69866. f++,
  69867. h.setX(f, w),
  69868. f++;
  69869. }
  69870. if (
  69871. (this.setIndex(h),
  69872. this.addAttribute("position", u),
  69873. this.addAttribute("uv", d),
  69874. this.computeVertexNormals(),
  69875. r === 2 * Math.PI)
  69876. ) {
  69877. var _ = this.attributes.normal.array,
  69878. T = new n.Vector3(),
  69879. x = new n.Vector3(),
  69880. S = new n.Vector3();
  69881. for (
  69882. o = t * e.length * 3, a = 0, s = 0;
  69883. a < e.length;
  69884. a++, s += 3
  69885. )
  69886. (T.x = _[s + 0]),
  69887. (T.y = _[s + 1]),
  69888. (T.z = _[s + 2]),
  69889. (x.x = _[o + s + 0]),
  69890. (x.y = _[o + s + 1]),
  69891. (x.z = _[o + s + 2]),
  69892. S.addVectors(T, x).normalize(),
  69893. (_[s + 0] = _[o + s + 0] = S.x),
  69894. (_[s + 1] = _[o + s + 1] = S.y),
  69895. (_[s + 2] = _[o + s + 2] = S.z);
  69896. }
  69897. }),
  69898. (n.LatheBufferGeometry.prototype = Object.create(
  69899. n.BufferGeometry.prototype
  69900. )),
  69901. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  69902. (n.LatheGeometry = function (e, t, i, r) {
  69903. n.Geometry.call(this),
  69904. (this.type = "LatheGeometry"),
  69905. (this.parameters = {
  69906. points: e,
  69907. segments: t,
  69908. phiStart: i,
  69909. phiLength: r,
  69910. }),
  69911. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  69912. this.mergeVertices();
  69913. }),
  69914. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  69915. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  69916. (n.PlaneGeometry = function (e, t, i, r) {
  69917. n.Geometry.call(this),
  69918. (this.type = "PlaneGeometry"),
  69919. (this.parameters = {
  69920. width: e,
  69921. height: t,
  69922. widthSegments: i,
  69923. heightSegments: r,
  69924. }),
  69925. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r));
  69926. }),
  69927. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  69928. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  69929. (n.PlaneBufferGeometry = function (e, t, i, r) {
  69930. n.BufferGeometry.call(this),
  69931. (this.type = "PlaneBufferGeometry"),
  69932. (this.parameters = {
  69933. width: e,
  69934. height: t,
  69935. widthSegments: i,
  69936. heightSegments: r,
  69937. });
  69938. for (
  69939. var o = e / 2,
  69940. a = t / 2,
  69941. s = Math.floor(i) || 1,
  69942. l = Math.floor(r) || 1,
  69943. c = s + 1,
  69944. h = l + 1,
  69945. u = e / s,
  69946. d = t / l,
  69947. p = new Float32Array(c * h * 3),
  69948. f = new Float32Array(c * h * 3),
  69949. g = new Float32Array(c * h * 2),
  69950. m = 0,
  69951. v = 0,
  69952. A = 0;
  69953. A < h;
  69954. A++
  69955. )
  69956. for (var y = A * d - a, C = 0; C < c; C++) {
  69957. var I = C * u - o;
  69958. (p[m] = I),
  69959. (p[m + 1] = -y),
  69960. (f[m + 2] = 1),
  69961. (g[v] = C / s),
  69962. (g[v + 1] = 1 - A / l),
  69963. (m += 3),
  69964. (v += 2);
  69965. }
  69966. m = 0;
  69967. for (
  69968. var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(
  69969. s * l * 6
  69970. ),
  69971. A = 0;
  69972. A < l;
  69973. A++
  69974. )
  69975. for (var C = 0; C < s; C++) {
  69976. var b = C + c * A,
  69977. w = C + c * (A + 1),
  69978. _ = C + 1 + c * (A + 1),
  69979. T = C + 1 + c * A;
  69980. (E[m] = b),
  69981. (E[m + 1] = w),
  69982. (E[m + 2] = T),
  69983. (E[m + 3] = w),
  69984. (E[m + 4] = _),
  69985. (E[m + 5] = T),
  69986. (m += 6);
  69987. }
  69988. this.setIndex(new n.BufferAttribute(E, 1)),
  69989. this.addAttribute("position", new n.BufferAttribute(p, 3)),
  69990. this.addAttribute("normal", new n.BufferAttribute(f, 3)),
  69991. this.addAttribute("uv", new n.BufferAttribute(g, 2));
  69992. }),
  69993. (n.PlaneBufferGeometry.prototype = Object.create(
  69994. n.BufferGeometry.prototype
  69995. )),
  69996. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  69997. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  69998. n.BufferGeometry.call(this),
  69999. (this.type = "RingBufferGeometry"),
  70000. (this.parameters = {
  70001. innerRadius: e,
  70002. outerRadius: t,
  70003. thetaSegments: i,
  70004. phiSegments: r,
  70005. thetaStart: o,
  70006. thetaLength: a,
  70007. }),
  70008. (e = e || 20),
  70009. (t = t || 50),
  70010. (o = void 0 !== o ? o : 0),
  70011. (a = void 0 !== a ? a : 2 * Math.PI),
  70012. (i = void 0 !== i ? Math.max(3, i) : 8),
  70013. (r = void 0 !== r ? Math.max(1, r) : 1);
  70014. var s,
  70015. l,
  70016. c,
  70017. h = (i + 1) * (r + 1),
  70018. u = i * r * 2 * 3,
  70019. d = new n.BufferAttribute(
  70020. new (u > 65535 ? Uint32Array : Uint16Array)(u),
  70021. 1
  70022. ),
  70023. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  70024. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  70025. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  70026. m = 0,
  70027. v = 0,
  70028. A = e,
  70029. y = (t - e) / r,
  70030. C = new n.Vector3(),
  70031. I = new n.Vector2();
  70032. for (l = 0; l <= r; l++) {
  70033. for (c = 0; c <= i; c++)
  70034. (s = o + (c / i) * a),
  70035. (C.x = A * Math.cos(s)),
  70036. (C.y = A * Math.sin(s)),
  70037. p.setXYZ(m, C.x, C.y, C.z),
  70038. f.setXYZ(m, 0, 0, 1),
  70039. (I.x = (C.x / t + 1) / 2),
  70040. (I.y = (C.y / t + 1) / 2),
  70041. g.setXY(m, I.x, I.y),
  70042. m++;
  70043. A += y;
  70044. }
  70045. for (l = 0; l < r; l++) {
  70046. var E = l * (i + 1);
  70047. for (c = 0; c < i; c++) {
  70048. s = c + E;
  70049. var b = s,
  70050. w = s + i + 1,
  70051. _ = s + i + 2,
  70052. T = s + 1;
  70053. d.setX(v, b),
  70054. v++,
  70055. d.setX(v, w),
  70056. v++,
  70057. d.setX(v, _),
  70058. v++,
  70059. d.setX(v, b),
  70060. v++,
  70061. d.setX(v, _),
  70062. v++,
  70063. d.setX(v, T),
  70064. v++;
  70065. }
  70066. }
  70067. this.setIndex(d),
  70068. this.addAttribute("position", p),
  70069. this.addAttribute("normal", f),
  70070. this.addAttribute("uv", g);
  70071. }),
  70072. (n.RingBufferGeometry.prototype = Object.create(
  70073. n.BufferGeometry.prototype
  70074. )),
  70075. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  70076. (n.RingGeometry = function (e, t, i, r, o, a) {
  70077. n.Geometry.call(this),
  70078. (this.type = "RingGeometry"),
  70079. (this.parameters = {
  70080. innerRadius: e,
  70081. outerRadius: t,
  70082. thetaSegments: i,
  70083. phiSegments: r,
  70084. thetaStart: o,
  70085. thetaLength: a,
  70086. }),
  70087. this.fromBufferGeometry(
  70088. new n.RingBufferGeometry(e, t, i, r, o, a)
  70089. );
  70090. }),
  70091. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  70092. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  70093. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  70094. n.Geometry.call(this),
  70095. (this.type = "SphereGeometry"),
  70096. (this.parameters = {
  70097. radius: e,
  70098. widthSegments: t,
  70099. heightSegments: i,
  70100. phiStart: r,
  70101. phiLength: o,
  70102. thetaStart: a,
  70103. thetaLength: s,
  70104. }),
  70105. this.fromBufferGeometry(
  70106. new n.SphereBufferGeometry(e, t, i, r, o, a, s)
  70107. );
  70108. }),
  70109. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  70110. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  70111. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  70112. n.BufferGeometry.call(this),
  70113. (this.type = "SphereBufferGeometry"),
  70114. (this.parameters = {
  70115. radius: e,
  70116. widthSegments: t,
  70117. heightSegments: i,
  70118. phiStart: r,
  70119. phiLength: o,
  70120. thetaStart: a,
  70121. thetaLength: s,
  70122. }),
  70123. (e = e || 50),
  70124. (t = Math.max(3, Math.floor(t) || 8)),
  70125. (i = Math.max(2, Math.floor(i) || 6)),
  70126. (r = void 0 !== r ? r : 0),
  70127. (o = void 0 !== o ? o : 2 * Math.PI),
  70128. (a = void 0 !== a ? a : 0),
  70129. (s = void 0 !== s ? s : Math.PI);
  70130. for (
  70131. var l = a + s,
  70132. c = (t + 1) * (i + 1),
  70133. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  70134. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  70135. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  70136. p = 0,
  70137. f = [],
  70138. g = new n.Vector3(),
  70139. m = 0;
  70140. m <= i;
  70141. m++
  70142. ) {
  70143. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  70144. var C = y / t,
  70145. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  70146. E = e * Math.cos(a + A * s),
  70147. b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  70148. g.set(I, E, b).normalize(),
  70149. h.setXYZ(p, I, E, b),
  70150. u.setXYZ(p, g.x, g.y, g.z),
  70151. d.setXY(p, C, 1 - A),
  70152. v.push(p),
  70153. p++;
  70154. }
  70155. f.push(v);
  70156. }
  70157. for (var w = [], m = 0; m < i; m++)
  70158. for (var y = 0; y < t; y++) {
  70159. var _ = f[m][y + 1],
  70160. T = f[m][y],
  70161. x = f[m + 1][y],
  70162. S = f[m + 1][y + 1];
  70163. (0 !== m || a > 0) && w.push(_, T, S),
  70164. (m !== i - 1 || l < Math.PI) && w.push(T, x, S);
  70165. }
  70166. this.setIndex(
  70167. new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(
  70168. w,
  70169. 1
  70170. )
  70171. ),
  70172. this.addAttribute("position", h),
  70173. this.addAttribute("normal", u),
  70174. this.addAttribute("uv", d),
  70175. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  70176. }),
  70177. (n.SphereBufferGeometry.prototype = Object.create(
  70178. n.BufferGeometry.prototype
  70179. )),
  70180. (n.SphereBufferGeometry.prototype.constructor =
  70181. n.SphereBufferGeometry),
  70182. (n.TextGeometry = function (e, t) {
  70183. t = t || {};
  70184. var i = t.font;
  70185. if (i instanceof n.Font == !1)
  70186. return (
  70187. console.error(
  70188. "THREE.TextGeometry: font parameter is not an instance of THREE.Font."
  70189. ),
  70190. new n.Geometry()
  70191. );
  70192. var r = i.generateShapes(e, t.size, t.curveSegments);
  70193. (t.amount = void 0 !== t.height ? t.height : 50),
  70194. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  70195. void 0 === t.bevelSize && (t.bevelSize = 8),
  70196. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  70197. n.ExtrudeGeometry.call(this, r, t),
  70198. (this.type = "TextGeometry");
  70199. }),
  70200. (n.TextGeometry.prototype = Object.create(
  70201. n.ExtrudeGeometry.prototype
  70202. )),
  70203. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  70204. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  70205. n.BufferGeometry.call(this),
  70206. (this.type = "TorusBufferGeometry"),
  70207. (this.parameters = {
  70208. radius: e,
  70209. tube: t,
  70210. radialSegments: i,
  70211. tubularSegments: r,
  70212. arc: o,
  70213. }),
  70214. (e = e || 100),
  70215. (t = t || 40),
  70216. (i = Math.floor(i) || 8),
  70217. (r = Math.floor(r) || 6),
  70218. (o = o || 2 * Math.PI);
  70219. var a,
  70220. s,
  70221. l = (i + 1) * (r + 1),
  70222. c = i * r * 2 * 3,
  70223. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  70224. u = new Float32Array(3 * l),
  70225. d = new Float32Array(3 * l),
  70226. p = new Float32Array(2 * l),
  70227. f = 0,
  70228. g = 0,
  70229. m = 0,
  70230. v = new n.Vector3(),
  70231. A = new n.Vector3(),
  70232. y = new n.Vector3();
  70233. for (a = 0; a <= i; a++)
  70234. for (s = 0; s <= r; s++) {
  70235. var C = (s / r) * o,
  70236. I = (a / i) * Math.PI * 2;
  70237. (A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  70238. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  70239. (A.z = t * Math.sin(I)),
  70240. (u[f] = A.x),
  70241. (u[f + 1] = A.y),
  70242. (u[f + 2] = A.z),
  70243. (v.x = e * Math.cos(C)),
  70244. (v.y = e * Math.sin(C)),
  70245. y.subVectors(A, v).normalize(),
  70246. (d[f] = y.x),
  70247. (d[f + 1] = y.y),
  70248. (d[f + 2] = y.z),
  70249. (p[g] = s / r),
  70250. (p[g + 1] = a / i),
  70251. (f += 3),
  70252. (g += 2);
  70253. }
  70254. for (a = 1; a <= i; a++)
  70255. for (s = 1; s <= r; s++) {
  70256. var E = (r + 1) * a + s - 1,
  70257. b = (r + 1) * (a - 1) + s - 1,
  70258. w = (r + 1) * (a - 1) + s,
  70259. _ = (r + 1) * a + s;
  70260. (h[m] = E),
  70261. (h[m + 1] = b),
  70262. (h[m + 2] = _),
  70263. (h[m + 3] = b),
  70264. (h[m + 4] = w),
  70265. (h[m + 5] = _),
  70266. (m += 6);
  70267. }
  70268. this.setIndex(new n.BufferAttribute(h, 1)),
  70269. this.addAttribute("position", new n.BufferAttribute(u, 3)),
  70270. this.addAttribute("normal", new n.BufferAttribute(d, 3)),
  70271. this.addAttribute("uv", new n.BufferAttribute(p, 2));
  70272. }),
  70273. (n.TorusBufferGeometry.prototype = Object.create(
  70274. n.BufferGeometry.prototype
  70275. )),
  70276. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  70277. (n.TorusGeometry = function (e, t, i, r, o) {
  70278. n.Geometry.call(this),
  70279. (this.type = "TorusGeometry"),
  70280. (this.parameters = {
  70281. radius: e,
  70282. tube: t,
  70283. radialSegments: i,
  70284. tubularSegments: r,
  70285. arc: o,
  70286. }),
  70287. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o));
  70288. }),
  70289. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  70290. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  70291. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  70292. function s(e, t, i, n, r) {
  70293. var o = Math.cos(e),
  70294. a = Math.sin(e),
  70295. s = (i / t) * e,
  70296. l = Math.cos(s);
  70297. (r.x = n * (2 + l) * 0.5 * o),
  70298. (r.y = n * (2 + l) * a * 0.5),
  70299. (r.z = n * Math.sin(s) * 0.5);
  70300. }
  70301. n.BufferGeometry.call(this),
  70302. (this.type = "TorusKnotBufferGeometry"),
  70303. (this.parameters = {
  70304. radius: e,
  70305. tube: t,
  70306. tubularSegments: i,
  70307. radialSegments: r,
  70308. p: o,
  70309. q: a,
  70310. }),
  70311. (e = e || 100),
  70312. (t = t || 40),
  70313. (i = Math.floor(i) || 64),
  70314. (r = Math.floor(r) || 8),
  70315. (o = o || 2),
  70316. (a = a || 3);
  70317. var l,
  70318. c,
  70319. h = (r + 1) * (i + 1),
  70320. u = r * i * 2 * 3,
  70321. d = new n.BufferAttribute(
  70322. new (u > 65535 ? Uint32Array : Uint16Array)(u),
  70323. 1
  70324. ),
  70325. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  70326. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  70327. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  70328. m = 0,
  70329. v = 0,
  70330. A = new n.Vector3(),
  70331. y = new n.Vector3(),
  70332. C = new n.Vector2(),
  70333. I = new n.Vector3(),
  70334. E = new n.Vector3(),
  70335. b = new n.Vector3(),
  70336. w = new n.Vector3(),
  70337. _ = new n.Vector3();
  70338. for (l = 0; l <= i; ++l) {
  70339. var T = (l / i) * o * Math.PI * 2;
  70340. for (
  70341. s(T, o, a, e, I),
  70342. s(T + 0.01, o, a, e, E),
  70343. w.subVectors(E, I),
  70344. _.addVectors(E, I),
  70345. b.crossVectors(w, _),
  70346. _.crossVectors(b, w),
  70347. b.normalize(),
  70348. _.normalize(),
  70349. c = 0;
  70350. c <= r;
  70351. ++c
  70352. ) {
  70353. var x = (c / r) * Math.PI * 2,
  70354. S = -t * Math.cos(x),
  70355. M = t * Math.sin(x);
  70356. (A.x = I.x + (S * _.x + M * b.x)),
  70357. (A.y = I.y + (S * _.y + M * b.y)),
  70358. (A.z = I.z + (S * _.z + M * b.z)),
  70359. p.setXYZ(m, A.x, A.y, A.z),
  70360. y.subVectors(A, I).normalize(),
  70361. f.setXYZ(m, y.x, y.y, y.z),
  70362. (C.x = l / i),
  70363. (C.y = c / r),
  70364. g.setXY(m, C.x, C.y),
  70365. m++;
  70366. }
  70367. }
  70368. for (c = 1; c <= i; c++)
  70369. for (l = 1; l <= r; l++) {
  70370. var R = (r + 1) * (c - 1) + (l - 1),
  70371. P = (r + 1) * c + (l - 1),
  70372. O = (r + 1) * c + l,
  70373. L = (r + 1) * (c - 1) + l;
  70374. d.setX(v, R),
  70375. v++,
  70376. d.setX(v, P),
  70377. v++,
  70378. d.setX(v, L),
  70379. v++,
  70380. d.setX(v, P),
  70381. v++,
  70382. d.setX(v, O),
  70383. v++,
  70384. d.setX(v, L),
  70385. v++;
  70386. }
  70387. this.setIndex(d),
  70388. this.addAttribute("position", p),
  70389. this.addAttribute("normal", f),
  70390. this.addAttribute("uv", g);
  70391. }),
  70392. (n.TorusKnotBufferGeometry.prototype = Object.create(
  70393. n.BufferGeometry.prototype
  70394. )),
  70395. (n.TorusKnotBufferGeometry.prototype.constructor =
  70396. n.TorusKnotBufferGeometry),
  70397. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  70398. n.Geometry.call(this),
  70399. (this.type = "TorusKnotGeometry"),
  70400. (this.parameters = {
  70401. radius: e,
  70402. tube: t,
  70403. tubularSegments: i,
  70404. radialSegments: r,
  70405. p: o,
  70406. q: a,
  70407. }),
  70408. void 0 !== s &&
  70409. console.warn(
  70410. "THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."
  70411. ),
  70412. this.fromBufferGeometry(
  70413. new n.TorusKnotBufferGeometry(e, t, i, r, o, a)
  70414. ),
  70415. this.mergeVertices();
  70416. }),
  70417. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  70418. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  70419. (n.TubeGeometry = function (e, t, i, r, o, a) {
  70420. function s(e, t, i) {
  70421. return R.vertices.push(new n.Vector3(e, t, i)) - 1;
  70422. }
  70423. n.Geometry.call(this),
  70424. (this.type = "TubeGeometry"),
  70425. (this.parameters = {
  70426. path: e,
  70427. segments: t,
  70428. radius: i,
  70429. radialSegments: r,
  70430. closed: o,
  70431. taper: a,
  70432. }),
  70433. (t = t || 64),
  70434. (i = i || 1),
  70435. (r = r || 8),
  70436. (o = o || !1),
  70437. (a = a || n.TubeGeometry.NoTaper);
  70438. var l,
  70439. c,
  70440. h,
  70441. u,
  70442. d,
  70443. p,
  70444. f,
  70445. g,
  70446. m,
  70447. v,
  70448. A,
  70449. y,
  70450. C,
  70451. I,
  70452. E,
  70453. b,
  70454. w,
  70455. _,
  70456. T,
  70457. x,
  70458. S,
  70459. M = [],
  70460. R = this,
  70461. P = t + 1,
  70462. O = new n.Vector3(),
  70463. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  70464. D = L.tangents,
  70465. N = L.normals,
  70466. B = L.binormals;
  70467. for (
  70468. this.tangents = D, this.normals = N, this.binormals = B, v = 0;
  70469. v < P;
  70470. v++
  70471. )
  70472. for (
  70473. M[v] = [],
  70474. u = v / (P - 1),
  70475. m = e.getPointAt(u),
  70476. l = D[v],
  70477. c = N[v],
  70478. h = B[v],
  70479. p = i * a(u),
  70480. A = 0;
  70481. A < r;
  70482. A++
  70483. )
  70484. (d = (A / r) * 2 * Math.PI),
  70485. (f = -p * Math.cos(d)),
  70486. (g = p * Math.sin(d)),
  70487. O.copy(m),
  70488. (O.x += f * c.x + g * h.x),
  70489. (O.y += f * c.y + g * h.y),
  70490. (O.z += f * c.z + g * h.z),
  70491. (M[v][A] = s(O.x, O.y, O.z));
  70492. for (v = 0; v < t; v++)
  70493. for (A = 0; A < r; A++)
  70494. (y = o ? (v + 1) % t : v + 1),
  70495. (C = (A + 1) % r),
  70496. (I = M[v][A]),
  70497. (E = M[y][A]),
  70498. (b = M[y][C]),
  70499. (w = M[v][C]),
  70500. (_ = new n.Vector2(v / t, A / r)),
  70501. (T = new n.Vector2((v + 1) / t, A / r)),
  70502. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  70503. (S = new n.Vector2(v / t, (A + 1) / r)),
  70504. this.faces.push(new n.Face3(I, E, w)),
  70505. this.faceVertexUvs[0].push([_, T, S]),
  70506. this.faces.push(new n.Face3(E, b, w)),
  70507. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  70508. this.computeFaceNormals(), this.computeVertexNormals();
  70509. }),
  70510. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  70511. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  70512. (n.TubeGeometry.NoTaper = function (e) {
  70513. return 1;
  70514. }),
  70515. (n.TubeGeometry.SinusoidalTaper = function (e) {
  70516. return Math.sin(Math.PI * e);
  70517. }),
  70518. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  70519. function r() {
  70520. (f[0] = new n.Vector3()),
  70521. (g[0] = new n.Vector3()),
  70522. (a = Number.MAX_VALUE),
  70523. (s = Math.abs(p[0].x)),
  70524. (l = Math.abs(p[0].y)),
  70525. (c = Math.abs(p[0].z)),
  70526. s <= a && ((a = s), d.set(1, 0, 0)),
  70527. l <= a && ((a = l), d.set(0, 1, 0)),
  70528. c <= a && d.set(0, 0, 1),
  70529. m.crossVectors(p[0], d).normalize(),
  70530. f[0].crossVectors(p[0], m),
  70531. g[0].crossVectors(p[0], f[0]);
  70532. }
  70533. var o,
  70534. a,
  70535. s,
  70536. l,
  70537. c,
  70538. h,
  70539. u,
  70540. d = new n.Vector3(),
  70541. p = [],
  70542. f = [],
  70543. g = [],
  70544. m = new n.Vector3(),
  70545. v = new n.Matrix4(),
  70546. A = t + 1;
  70547. for (
  70548. this.tangents = p, this.normals = f, this.binormals = g, h = 0;
  70549. h < A;
  70550. h++
  70551. )
  70552. (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize();
  70553. for (r(), h = 1; h < A; h++)
  70554. (f[h] = f[h - 1].clone()),
  70555. (g[h] = g[h - 1].clone()),
  70556. m.crossVectors(p[h - 1], p[h]),
  70557. m.length() > Number.EPSILON &&
  70558. (m.normalize(),
  70559. (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))),
  70560. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  70561. g[h].crossVectors(p[h], f[h]);
  70562. if (i)
  70563. for (
  70564. o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  70565. o /= A - 1,
  70566. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  70567. h = 1;
  70568. h < A;
  70569. h++
  70570. )
  70571. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  70572. g[h].crossVectors(p[h], f[h]);
  70573. }),
  70574. (n.PolyhedronGeometry = function (e, t, i, r) {
  70575. function o(e) {
  70576. var t = e.normalize().clone();
  70577. t.index = u.vertices.push(t) - 1;
  70578. var i = l(e) / 2 / Math.PI + 0.5,
  70579. r = c(e) / Math.PI + 0.5;
  70580. return (t.uv = new n.Vector2(i, 1 - r)), t;
  70581. }
  70582. function a(e, t, i, r) {
  70583. var o = new n.Face3(
  70584. e.index,
  70585. t.index,
  70586. i.index,
  70587. [e.clone(), t.clone(), i.clone()],
  70588. void 0,
  70589. r
  70590. );
  70591. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3);
  70592. var a = l(C);
  70593. u.faceVertexUvs[0].push([
  70594. h(e.uv, e, a),
  70595. h(t.uv, t, a),
  70596. h(i.uv, i, a),
  70597. ]);
  70598. }
  70599. function s(e, t) {
  70600. for (
  70601. var i = Math.pow(2, t),
  70602. n = o(u.vertices[e.a]),
  70603. r = o(u.vertices[e.b]),
  70604. s = o(u.vertices[e.c]),
  70605. l = [],
  70606. c = e.materialIndex,
  70607. h = 0;
  70608. h <= i;
  70609. h++
  70610. ) {
  70611. l[h] = [];
  70612. for (
  70613. var d = o(n.clone().lerp(s, h / i)),
  70614. p = o(r.clone().lerp(s, h / i)),
  70615. f = i - h,
  70616. g = 0;
  70617. g <= f;
  70618. g++
  70619. )
  70620. 0 === g && h === i
  70621. ? (l[h][g] = d)
  70622. : (l[h][g] = o(d.clone().lerp(p, g / f)));
  70623. }
  70624. for (var h = 0; h < i; h++)
  70625. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  70626. var m = Math.floor(g / 2);
  70627. g % 2 === 0
  70628. ? a(l[h][m + 1], l[h + 1][m], l[h][m], c)
  70629. : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c);
  70630. }
  70631. }
  70632. function l(e) {
  70633. return Math.atan2(e.z, -e.x);
  70634. }
  70635. function c(e) {
  70636. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z));
  70637. }
  70638. function h(e, t, i) {
  70639. return (
  70640. i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)),
  70641. 0 === t.x &&
  70642. 0 === t.z &&
  70643. (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)),
  70644. e.clone()
  70645. );
  70646. }
  70647. n.Geometry.call(this),
  70648. (this.type = "PolyhedronGeometry"),
  70649. (this.parameters = {
  70650. vertices: e,
  70651. indices: t,
  70652. radius: i,
  70653. detail: r,
  70654. }),
  70655. (i = i || 1),
  70656. (r = r || 0);
  70657. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  70658. o(new n.Vector3(e[d], e[d + 1], e[d + 2]));
  70659. for (
  70660. var f = this.vertices, g = [], d = 0, m = 0, p = t.length;
  70661. d < p;
  70662. d += 3, m++
  70663. ) {
  70664. var v = f[t[d]],
  70665. A = f[t[d + 1]],
  70666. y = f[t[d + 2]];
  70667. g[m] = new n.Face3(
  70668. v.index,
  70669. A.index,
  70670. y.index,
  70671. [v.clone(), A.clone(), y.clone()],
  70672. void 0,
  70673. m
  70674. );
  70675. }
  70676. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++)
  70677. s(g[d], r);
  70678. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  70679. var I = this.faceVertexUvs[0][d],
  70680. E = I[0].x,
  70681. b = I[1].x,
  70682. w = I[2].x,
  70683. _ = Math.max(E, b, w),
  70684. T = Math.min(E, b, w);
  70685. _ > 0.9 &&
  70686. T < 0.1 &&
  70687. (E < 0.2 && (I[0].x += 1),
  70688. b < 0.2 && (I[1].x += 1),
  70689. w < 0.2 && (I[2].x += 1));
  70690. }
  70691. for (var d = 0, p = this.vertices.length; d < p; d++)
  70692. this.vertices[d].multiplyScalar(i);
  70693. this.mergeVertices(),
  70694. this.computeFaceNormals(),
  70695. (this.boundingSphere = new n.Sphere(new n.Vector3(), i));
  70696. }),
  70697. (n.PolyhedronGeometry.prototype = Object.create(
  70698. n.Geometry.prototype
  70699. )),
  70700. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  70701. (n.DodecahedronGeometry = function (e, t) {
  70702. var i = (1 + Math.sqrt(5)) / 2,
  70703. r = 1 / i,
  70704. o = [
  70705. -1,
  70706. -1,
  70707. -1,
  70708. -1,
  70709. -1,
  70710. 1,
  70711. -1,
  70712. 1,
  70713. -1,
  70714. -1,
  70715. 1,
  70716. 1,
  70717. 1,
  70718. -1,
  70719. -1,
  70720. 1,
  70721. -1,
  70722. 1,
  70723. 1,
  70724. 1,
  70725. -1,
  70726. 1,
  70727. 1,
  70728. 1,
  70729. 0,
  70730. -r,
  70731. -i,
  70732. 0,
  70733. -r,
  70734. i,
  70735. 0,
  70736. r,
  70737. -i,
  70738. 0,
  70739. r,
  70740. i,
  70741. -r,
  70742. -i,
  70743. 0,
  70744. -r,
  70745. i,
  70746. 0,
  70747. r,
  70748. -i,
  70749. 0,
  70750. r,
  70751. i,
  70752. 0,
  70753. -i,
  70754. 0,
  70755. -r,
  70756. i,
  70757. 0,
  70758. -r,
  70759. -i,
  70760. 0,
  70761. r,
  70762. i,
  70763. 0,
  70764. r,
  70765. ],
  70766. a = [
  70767. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15,
  70768. 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0,
  70769. 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2,
  70770. 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4,
  70771. 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19,
  70772. 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9,
  70773. ];
  70774. n.PolyhedronGeometry.call(this, o, a, e, t),
  70775. (this.type = "DodecahedronGeometry"),
  70776. (this.parameters = {
  70777. radius: e,
  70778. detail: t,
  70779. });
  70780. }),
  70781. (n.DodecahedronGeometry.prototype = Object.create(
  70782. n.PolyhedronGeometry.prototype
  70783. )),
  70784. (n.DodecahedronGeometry.prototype.constructor =
  70785. n.DodecahedronGeometry),
  70786. (n.IcosahedronGeometry = function (e, t) {
  70787. var i = (1 + Math.sqrt(5)) / 2,
  70788. r = [
  70789. -1,
  70790. i,
  70791. 0,
  70792. 1,
  70793. i,
  70794. 0,
  70795. -1,
  70796. -i,
  70797. 0,
  70798. 1,
  70799. -i,
  70800. 0,
  70801. 0,
  70802. -1,
  70803. i,
  70804. 0,
  70805. 1,
  70806. i,
  70807. 0,
  70808. -1,
  70809. -i,
  70810. 0,
  70811. 1,
  70812. -i,
  70813. i,
  70814. 0,
  70815. -1,
  70816. i,
  70817. 0,
  70818. 1,
  70819. -i,
  70820. 0,
  70821. -1,
  70822. -i,
  70823. 0,
  70824. 1,
  70825. ],
  70826. o = [
  70827. 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11,
  70828. 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3,
  70829. 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1,
  70830. ];
  70831. n.PolyhedronGeometry.call(this, r, o, e, t),
  70832. (this.type = "IcosahedronGeometry"),
  70833. (this.parameters = {
  70834. radius: e,
  70835. detail: t,
  70836. });
  70837. }),
  70838. (n.IcosahedronGeometry.prototype = Object.create(
  70839. n.PolyhedronGeometry.prototype
  70840. )),
  70841. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  70842. (n.OctahedronGeometry = function (e, t) {
  70843. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  70844. r = [
  70845. 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4,
  70846. 1, 4, 2,
  70847. ];
  70848. n.PolyhedronGeometry.call(this, i, r, e, t),
  70849. (this.type = "OctahedronGeometry"),
  70850. (this.parameters = {
  70851. radius: e,
  70852. detail: t,
  70853. });
  70854. }),
  70855. (n.OctahedronGeometry.prototype = Object.create(
  70856. n.PolyhedronGeometry.prototype
  70857. )),
  70858. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  70859. (n.TetrahedronGeometry = function (e, t) {
  70860. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  70861. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  70862. n.PolyhedronGeometry.call(this, i, r, e, t),
  70863. (this.type = "TetrahedronGeometry"),
  70864. (this.parameters = {
  70865. radius: e,
  70866. detail: t,
  70867. });
  70868. }),
  70869. (n.TetrahedronGeometry.prototype = Object.create(
  70870. n.PolyhedronGeometry.prototype
  70871. )),
  70872. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  70873. (n.ParametricGeometry = function (e, t, i) {
  70874. n.Geometry.call(this),
  70875. (this.type = "ParametricGeometry"),
  70876. (this.parameters = {
  70877. func: e,
  70878. slices: t,
  70879. stacks: i,
  70880. });
  70881. var r,
  70882. o,
  70883. a,
  70884. s,
  70885. l,
  70886. c = this.vertices,
  70887. h = this.faces,
  70888. u = this.faceVertexUvs[0],
  70889. d = t + 1;
  70890. for (r = 0; r <= i; r++)
  70891. for (l = r / i, o = 0; o <= t; o++)
  70892. (s = o / t), (a = e(s, l)), c.push(a);
  70893. var p, f, g, m, v, A, y, C;
  70894. for (r = 0; r < i; r++)
  70895. for (o = 0; o < t; o++)
  70896. (p = r * d + o),
  70897. (f = r * d + o + 1),
  70898. (g = (r + 1) * d + o + 1),
  70899. (m = (r + 1) * d + o),
  70900. (v = new n.Vector2(o / t, r / i)),
  70901. (A = new n.Vector2((o + 1) / t, r / i)),
  70902. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  70903. (C = new n.Vector2(o / t, (r + 1) / i)),
  70904. h.push(new n.Face3(p, f, m)),
  70905. u.push([v, A, C]),
  70906. h.push(new n.Face3(f, g, m)),
  70907. u.push([A.clone(), y, C.clone()]);
  70908. this.computeFaceNormals(), this.computeVertexNormals();
  70909. }),
  70910. (n.ParametricGeometry.prototype = Object.create(
  70911. n.Geometry.prototype
  70912. )),
  70913. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  70914. (n.WireframeGeometry = function (e) {
  70915. function t(e, t) {
  70916. return e - t;
  70917. }
  70918. n.BufferGeometry.call(this);
  70919. var i = [0, 0],
  70920. r = {},
  70921. o = ["a", "b", "c"];
  70922. if (e instanceof n.Geometry) {
  70923. for (
  70924. var a = e.vertices,
  70925. s = e.faces,
  70926. l = 0,
  70927. c = new Uint32Array(6 * s.length),
  70928. h = 0,
  70929. u = s.length;
  70930. h < u;
  70931. h++
  70932. )
  70933. for (var d = s[h], p = 0; p < 3; p++) {
  70934. (i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t);
  70935. var f = i.toString();
  70936. void 0 === r[f] &&
  70937. ((c[2 * l] = i[0]),
  70938. (c[2 * l + 1] = i[1]),
  70939. (r[f] = !0),
  70940. l++);
  70941. }
  70942. for (
  70943. var g = new Float32Array(2 * l * 3), h = 0, u = l;
  70944. h < u;
  70945. h++
  70946. )
  70947. for (var p = 0; p < 2; p++) {
  70948. var m = a[c[2 * h + p]],
  70949. v = 6 * h + 3 * p;
  70950. (g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z);
  70951. }
  70952. this.addAttribute("position", new n.BufferAttribute(g, 3));
  70953. } else if (e instanceof n.BufferGeometry)
  70954. if (null !== e.index) {
  70955. var A = e.index.array,
  70956. a = e.attributes.position,
  70957. y = e.groups,
  70958. l = 0;
  70959. 0 === y.length && e.addGroup(0, A.length);
  70960. for (
  70961. var c = new Uint32Array(2 * A.length), C = 0, I = y.length;
  70962. C < I;
  70963. ++C
  70964. )
  70965. for (
  70966. var E = y[C], b = E.start, w = E.count, h = b, _ = b + w;
  70967. h < _;
  70968. h += 3
  70969. )
  70970. for (var p = 0; p < 3; p++) {
  70971. (i[0] = A[h + p]),
  70972. (i[1] = A[h + ((p + 1) % 3)]),
  70973. i.sort(t);
  70974. var f = i.toString();
  70975. void 0 === r[f] &&
  70976. ((c[2 * l] = i[0]),
  70977. (c[2 * l + 1] = i[1]),
  70978. (r[f] = !0),
  70979. l++);
  70980. }
  70981. for (
  70982. var g = new Float32Array(2 * l * 3), h = 0, u = l;
  70983. h < u;
  70984. h++
  70985. )
  70986. for (var p = 0; p < 2; p++) {
  70987. var v = 6 * h + 3 * p,
  70988. T = c[2 * h + p];
  70989. (g[v + 0] = a.getX(T)),
  70990. (g[v + 1] = a.getY(T)),
  70991. (g[v + 2] = a.getZ(T));
  70992. }
  70993. this.addAttribute("position", new n.BufferAttribute(g, 3));
  70994. } else {
  70995. for (
  70996. var a = e.attributes.position.array,
  70997. l = a.length / 3,
  70998. x = l / 3,
  70999. g = new Float32Array(2 * l * 3),
  71000. h = 0,
  71001. u = x;
  71002. h < u;
  71003. h++
  71004. )
  71005. for (var p = 0; p < 3; p++) {
  71006. var v = 18 * h + 6 * p,
  71007. S = 9 * h + 3 * p;
  71008. (g[v + 0] = a[S]),
  71009. (g[v + 1] = a[S + 1]),
  71010. (g[v + 2] = a[S + 2]);
  71011. var T = 9 * h + 3 * ((p + 1) % 3);
  71012. (g[v + 3] = a[T]),
  71013. (g[v + 4] = a[T + 1]),
  71014. (g[v + 5] = a[T + 2]);
  71015. }
  71016. this.addAttribute("position", new n.BufferAttribute(g, 3));
  71017. }
  71018. }),
  71019. (n.WireframeGeometry.prototype = Object.create(
  71020. n.BufferGeometry.prototype
  71021. )),
  71022. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  71023. (n.AxisHelper = function (e) {
  71024. e = e || 1;
  71025. var t = new Float32Array([
  71026. 0,
  71027. 0,
  71028. 0,
  71029. e,
  71030. 0,
  71031. 0,
  71032. 0,
  71033. 0,
  71034. 0,
  71035. 0,
  71036. e,
  71037. 0,
  71038. 0,
  71039. 0,
  71040. 0,
  71041. 0,
  71042. 0,
  71043. e,
  71044. ]),
  71045. i = new Float32Array([
  71046. 1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1,
  71047. ]),
  71048. r = new n.BufferGeometry();
  71049. r.addAttribute("position", new n.BufferAttribute(t, 3)),
  71050. r.addAttribute("color", new n.BufferAttribute(i, 3));
  71051. var o = new n.LineBasicMaterial({
  71052. vertexColors: n.VertexColors,
  71053. });
  71054. n.LineSegments.call(this, r, o);
  71055. }),
  71056. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  71057. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  71058. (n.ArrowHelper = (function () {
  71059. var e = new n.Geometry();
  71060. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0));
  71061. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1);
  71062. return (
  71063. t.translate(0, -0.5, 0),
  71064. function (i, r, o, a, s, l) {
  71065. n.Object3D.call(this),
  71066. void 0 === a && (a = 16776960),
  71067. void 0 === o && (o = 1),
  71068. void 0 === s && (s = 0.2 * o),
  71069. void 0 === l && (l = 0.2 * s),
  71070. this.position.copy(r),
  71071. (this.line = new n.Line(
  71072. e,
  71073. new n.LineBasicMaterial({
  71074. color: a,
  71075. })
  71076. )),
  71077. (this.line.matrixAutoUpdate = !1),
  71078. this.add(this.line),
  71079. (this.cone = new n.Mesh(
  71080. t,
  71081. new n.MeshBasicMaterial({
  71082. color: a,
  71083. })
  71084. )),
  71085. (this.cone.matrixAutoUpdate = !1),
  71086. this.add(this.cone),
  71087. this.setDirection(i),
  71088. this.setLength(o, s, l);
  71089. }
  71090. );
  71091. })()),
  71092. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  71093. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  71094. (n.ArrowHelper.prototype.setDirection = (function () {
  71095. var e,
  71096. t = new n.Vector3();
  71097. return function (i) {
  71098. i.y > 0.99999
  71099. ? this.quaternion.set(0, 0, 0, 1)
  71100. : i.y < -0.99999
  71101. ? this.quaternion.set(1, 0, 0, 0)
  71102. : (t.set(i.z, 0, -i.x).normalize(),
  71103. (e = Math.acos(i.y)),
  71104. this.quaternion.setFromAxisAngle(t, e));
  71105. };
  71106. })()),
  71107. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  71108. void 0 === t && (t = 0.2 * e),
  71109. void 0 === i && (i = 0.2 * t),
  71110. this.line.scale.set(1, Math.max(0, e - t), 1),
  71111. this.line.updateMatrix(),
  71112. this.cone.scale.set(i, t, i),
  71113. (this.cone.position.y = e),
  71114. this.cone.updateMatrix();
  71115. }),
  71116. (n.ArrowHelper.prototype.setColor = function (e) {
  71117. this.line.material.color.set(e), this.cone.material.color.set(e);
  71118. }),
  71119. (n.BoxHelper = function (e) {
  71120. var t = new Uint16Array([
  71121. 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2,
  71122. 6, 3, 7,
  71123. ]),
  71124. i = new Float32Array(24),
  71125. r = new n.BufferGeometry();
  71126. r.setIndex(new n.BufferAttribute(t, 1)),
  71127. r.addAttribute("position", new n.BufferAttribute(i, 3)),
  71128. n.LineSegments.call(
  71129. this,
  71130. r,
  71131. new n.LineBasicMaterial({
  71132. color: 16776960,
  71133. })
  71134. ),
  71135. void 0 !== e && this.update(e);
  71136. }),
  71137. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  71138. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  71139. (n.BoxHelper.prototype.update = (function () {
  71140. var e = new n.Box3();
  71141. return function (t) {
  71142. if ((e.setFromObject(t), !e.isEmpty())) {
  71143. var i = e.min,
  71144. n = e.max,
  71145. r = this.geometry.attributes.position,
  71146. o = r.array;
  71147. (o[0] = n.x),
  71148. (o[1] = n.y),
  71149. (o[2] = n.z),
  71150. (o[3] = i.x),
  71151. (o[4] = n.y),
  71152. (o[5] = n.z),
  71153. (o[6] = i.x),
  71154. (o[7] = i.y),
  71155. (o[8] = n.z),
  71156. (o[9] = n.x),
  71157. (o[10] = i.y),
  71158. (o[11] = n.z),
  71159. (o[12] = n.x),
  71160. (o[13] = n.y),
  71161. (o[14] = i.z),
  71162. (o[15] = i.x),
  71163. (o[16] = n.y),
  71164. (o[17] = i.z),
  71165. (o[18] = i.x),
  71166. (o[19] = i.y),
  71167. (o[20] = i.z),
  71168. (o[21] = n.x),
  71169. (o[22] = i.y),
  71170. (o[23] = i.z),
  71171. (r.needsUpdate = !0),
  71172. this.geometry.computeBoundingSphere();
  71173. }
  71174. };
  71175. })()),
  71176. (n.BoundingBoxHelper = function (e, t) {
  71177. var i = void 0 !== t ? t : 8947848;
  71178. (this.object = e),
  71179. (this.box = new n.Box3()),
  71180. n.Mesh.call(
  71181. this,
  71182. new n.BoxGeometry(1, 1, 1),
  71183. new n.MeshBasicMaterial({
  71184. color: i,
  71185. wireframe: !0,
  71186. })
  71187. );
  71188. }),
  71189. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  71190. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  71191. (n.BoundingBoxHelper.prototype.update = function () {
  71192. this.box.setFromObject(this.object),
  71193. this.box.size(this.scale),
  71194. this.box.center(this.position);
  71195. }),
  71196. (n.CameraHelper = function (e) {
  71197. function t(e, t, n) {
  71198. i(e, n), i(t, n);
  71199. }
  71200. function i(e, t) {
  71201. r.vertices.push(new n.Vector3()),
  71202. r.colors.push(new n.Color(t)),
  71203. void 0 === a[e] && (a[e] = []),
  71204. a[e].push(r.vertices.length - 1);
  71205. }
  71206. var r = new n.Geometry(),
  71207. o = new n.LineBasicMaterial({
  71208. color: 16777215,
  71209. vertexColors: n.FaceColors,
  71210. }),
  71211. a = {},
  71212. s = 16755200,
  71213. l = 16711680,
  71214. c = 43775,
  71215. h = 16777215,
  71216. u = 3355443;
  71217. t("n1", "n2", s),
  71218. t("n2", "n4", s),
  71219. t("n4", "n3", s),
  71220. t("n3", "n1", s),
  71221. t("f1", "f2", s),
  71222. t("f2", "f4", s),
  71223. t("f4", "f3", s),
  71224. t("f3", "f1", s),
  71225. t("n1", "f1", s),
  71226. t("n2", "f2", s),
  71227. t("n3", "f3", s),
  71228. t("n4", "f4", s),
  71229. t("p", "n1", l),
  71230. t("p", "n2", l),
  71231. t("p", "n3", l),
  71232. t("p", "n4", l),
  71233. t("u1", "u2", c),
  71234. t("u2", "u3", c),
  71235. t("u3", "u1", c),
  71236. t("c", "t", h),
  71237. t("p", "c", u),
  71238. t("cn1", "cn2", u),
  71239. t("cn3", "cn4", u),
  71240. t("cf1", "cf2", u),
  71241. t("cf3", "cf4", u),
  71242. n.LineSegments.call(this, r, o),
  71243. (this.camera = e),
  71244. this.camera.updateProjectionMatrix(),
  71245. (this.matrix = e.matrixWorld),
  71246. (this.matrixAutoUpdate = !1),
  71247. (this.pointMap = a),
  71248. this.update();
  71249. }),
  71250. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  71251. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  71252. (n.CameraHelper.prototype.update = (function () {
  71253. function e(e, n, a, s) {
  71254. r.set(n, a, s).unproject(o);
  71255. var l = i[e];
  71256. if (void 0 !== l)
  71257. for (var c = 0, h = l.length; c < h; c++)
  71258. t.vertices[l[c]].copy(r);
  71259. }
  71260. var t,
  71261. i,
  71262. r = new n.Vector3(),
  71263. o = new n.Camera();
  71264. return function () {
  71265. (t = this.geometry), (i = this.pointMap);
  71266. var n = 1,
  71267. r = 1;
  71268. o.projectionMatrix.copy(this.camera.projectionMatrix),
  71269. e("c", 0, 0, -1),
  71270. e("t", 0, 0, 1),
  71271. e("n1", -n, -r, -1),
  71272. e("n2", n, -r, -1),
  71273. e("n3", -n, r, -1),
  71274. e("n4", n, r, -1),
  71275. e("f1", -n, -r, 1),
  71276. e("f2", n, -r, 1),
  71277. e("f3", -n, r, 1),
  71278. e("f4", n, r, 1),
  71279. e("u1", 0.7 * n, 1.1 * r, -1),
  71280. e("u2", 0.7 * -n, 1.1 * r, -1),
  71281. e("u3", 0, 2 * r, -1),
  71282. e("cf1", -n, 0, 1),
  71283. e("cf2", n, 0, 1),
  71284. e("cf3", 0, -r, 1),
  71285. e("cf4", 0, r, 1),
  71286. e("cn1", -n, 0, -1),
  71287. e("cn2", n, 0, -1),
  71288. e("cn3", 0, -r, -1),
  71289. e("cn4", 0, r, -1),
  71290. (t.verticesNeedUpdate = !0);
  71291. };
  71292. })()),
  71293. (n.DirectionalLightHelper = function (e, t) {
  71294. n.Object3D.call(this),
  71295. (this.light = e),
  71296. this.light.updateMatrixWorld(),
  71297. (this.matrix = e.matrixWorld),
  71298. (this.matrixAutoUpdate = !1),
  71299. (t = t || 1);
  71300. var i = new n.Geometry();
  71301. i.vertices.push(
  71302. new n.Vector3(-t, t, 0),
  71303. new n.Vector3(t, t, 0),
  71304. new n.Vector3(t, -t, 0),
  71305. new n.Vector3(-t, -t, 0),
  71306. new n.Vector3(-t, t, 0)
  71307. );
  71308. var r = new n.LineBasicMaterial({
  71309. fog: !1,
  71310. });
  71311. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  71312. (this.lightPlane = new n.Line(i, r)),
  71313. this.add(this.lightPlane),
  71314. (i = new n.Geometry()),
  71315. i.vertices.push(new n.Vector3(), new n.Vector3()),
  71316. (r = new n.LineBasicMaterial({
  71317. fog: !1,
  71318. })),
  71319. r.color
  71320. .copy(this.light.color)
  71321. .multiplyScalar(this.light.intensity),
  71322. (this.targetLine = new n.Line(i, r)),
  71323. this.add(this.targetLine),
  71324. this.update();
  71325. }),
  71326. (n.DirectionalLightHelper.prototype = Object.create(
  71327. n.Object3D.prototype
  71328. )),
  71329. (n.DirectionalLightHelper.prototype.constructor =
  71330. n.DirectionalLightHelper),
  71331. (n.DirectionalLightHelper.prototype.dispose = function () {
  71332. this.lightPlane.geometry.dispose(),
  71333. this.lightPlane.material.dispose(),
  71334. this.targetLine.geometry.dispose(),
  71335. this.targetLine.material.dispose();
  71336. }),
  71337. (n.DirectionalLightHelper.prototype.update = (function () {
  71338. var e = new n.Vector3(),
  71339. t = new n.Vector3(),
  71340. i = new n.Vector3();
  71341. return function () {
  71342. e.setFromMatrixPosition(this.light.matrixWorld),
  71343. t.setFromMatrixPosition(this.light.target.matrixWorld),
  71344. i.subVectors(t, e),
  71345. this.lightPlane.lookAt(i),
  71346. this.lightPlane.material.color
  71347. .copy(this.light.color)
  71348. .multiplyScalar(this.light.intensity),
  71349. this.targetLine.geometry.vertices[1].copy(i),
  71350. (this.targetLine.geometry.verticesNeedUpdate = !0),
  71351. this.targetLine.material.color.copy(
  71352. this.lightPlane.material.color
  71353. );
  71354. };
  71355. })()),
  71356. (n.EdgesHelper = function (e, t, i) {
  71357. var r = void 0 !== t ? t : 16777215;
  71358. n.LineSegments.call(
  71359. this,
  71360. new n.EdgesGeometry(e.geometry, i),
  71361. new n.LineBasicMaterial({
  71362. color: r,
  71363. })
  71364. ),
  71365. (this.matrix = e.matrixWorld),
  71366. (this.matrixAutoUpdate = !1);
  71367. }),
  71368. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  71369. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  71370. (n.FaceNormalsHelper = function (e, t, i, r) {
  71371. (this.object = e), (this.size = void 0 !== t ? t : 1);
  71372. var o = void 0 !== i ? i : 16776960,
  71373. a = void 0 !== r ? r : 1,
  71374. s = 0,
  71375. l = this.object.geometry;
  71376. l instanceof n.Geometry
  71377. ? (s = l.faces.length)
  71378. : console.warn(
  71379. "THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."
  71380. );
  71381. var c = new n.BufferGeometry(),
  71382. h = new n.Float32Attribute(2 * s * 3, 3);
  71383. c.addAttribute("position", h),
  71384. n.LineSegments.call(
  71385. this,
  71386. c,
  71387. new n.LineBasicMaterial({
  71388. color: o,
  71389. linewidth: a,
  71390. })
  71391. ),
  71392. (this.matrixAutoUpdate = !1),
  71393. this.update();
  71394. }),
  71395. (n.FaceNormalsHelper.prototype = Object.create(
  71396. n.LineSegments.prototype
  71397. )),
  71398. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  71399. (n.FaceNormalsHelper.prototype.update = (function () {
  71400. var e = new n.Vector3(),
  71401. t = new n.Vector3(),
  71402. i = new n.Matrix3();
  71403. return function () {
  71404. this.object.updateMatrixWorld(!0),
  71405. i.getNormalMatrix(this.object.matrixWorld);
  71406. for (
  71407. var n = this.object.matrixWorld,
  71408. r = this.geometry.attributes.position,
  71409. o = this.object.geometry,
  71410. a = o.vertices,
  71411. s = o.faces,
  71412. l = 0,
  71413. c = 0,
  71414. h = s.length;
  71415. c < h;
  71416. c++
  71417. ) {
  71418. var u = s[c],
  71419. d = u.normal;
  71420. e
  71421. .copy(a[u.a])
  71422. .add(a[u.b])
  71423. .add(a[u.c])
  71424. .divideScalar(3)
  71425. .applyMatrix4(n),
  71426. t
  71427. .copy(d)
  71428. .applyMatrix3(i)
  71429. .normalize()
  71430. .multiplyScalar(this.size)
  71431. .add(e),
  71432. r.setXYZ(l, e.x, e.y, e.z),
  71433. (l += 1),
  71434. r.setXYZ(l, t.x, t.y, t.z),
  71435. (l += 1);
  71436. }
  71437. return (r.needsUpdate = !0), this;
  71438. };
  71439. })()),
  71440. (n.GridHelper = function (e, t) {
  71441. var i = new n.Geometry(),
  71442. r = new n.LineBasicMaterial({
  71443. vertexColors: n.VertexColors,
  71444. });
  71445. (this.color1 = new n.Color(4473924)),
  71446. (this.color2 = new n.Color(8947848));
  71447. for (var o = -e; o <= e; o += t) {
  71448. i.vertices.push(
  71449. new n.Vector3(-e, 0, o),
  71450. new n.Vector3(e, 0, o),
  71451. new n.Vector3(o, 0, -e),
  71452. new n.Vector3(o, 0, e)
  71453. );
  71454. var a = 0 === o ? this.color1 : this.color2;
  71455. i.colors.push(a, a, a, a);
  71456. }
  71457. n.LineSegments.call(this, i, r);
  71458. }),
  71459. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  71460. (n.GridHelper.prototype.constructor = n.GridHelper),
  71461. (n.GridHelper.prototype.setColors = function (e, t) {
  71462. this.color1.set(e),
  71463. this.color2.set(t),
  71464. (this.geometry.colorsNeedUpdate = !0);
  71465. }),
  71466. (n.HemisphereLightHelper = function (e, t) {
  71467. n.Object3D.call(this),
  71468. (this.light = e),
  71469. this.light.updateMatrixWorld(),
  71470. (this.matrix = e.matrixWorld),
  71471. (this.matrixAutoUpdate = !1),
  71472. (this.colors = [new n.Color(), new n.Color()]);
  71473. var i = new n.SphereGeometry(t, 4, 2);
  71474. i.rotateX(-Math.PI / 2);
  71475. for (var r = 0, o = 8; r < o; r++)
  71476. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  71477. var a = new n.MeshBasicMaterial({
  71478. vertexColors: n.FaceColors,
  71479. wireframe: !0,
  71480. });
  71481. (this.lightSphere = new n.Mesh(i, a)),
  71482. this.add(this.lightSphere),
  71483. this.update();
  71484. }),
  71485. (n.HemisphereLightHelper.prototype = Object.create(
  71486. n.Object3D.prototype
  71487. )),
  71488. (n.HemisphereLightHelper.prototype.constructor =
  71489. n.HemisphereLightHelper),
  71490. (n.HemisphereLightHelper.prototype.dispose = function () {
  71491. this.lightSphere.geometry.dispose(),
  71492. this.lightSphere.material.dispose();
  71493. }),
  71494. (n.HemisphereLightHelper.prototype.update = (function () {
  71495. var e = new n.Vector3();
  71496. return function () {
  71497. this.colors[0]
  71498. .copy(this.light.color)
  71499. .multiplyScalar(this.light.intensity),
  71500. this.colors[1]
  71501. .copy(this.light.groundColor)
  71502. .multiplyScalar(this.light.intensity),
  71503. this.lightSphere.lookAt(
  71504. e.setFromMatrixPosition(this.light.matrixWorld).negate()
  71505. ),
  71506. (this.lightSphere.geometry.colorsNeedUpdate = !0);
  71507. };
  71508. })()),
  71509. (n.PointLightHelper = function (e, t) {
  71510. (this.light = e), this.light.updateMatrixWorld();
  71511. var i = new n.SphereGeometry(t, 4, 2),
  71512. r = new n.MeshBasicMaterial({
  71513. wireframe: !0,
  71514. fog: !1,
  71515. });
  71516. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  71517. n.Mesh.call(this, i, r),
  71518. (this.matrix = this.light.matrixWorld),
  71519. (this.matrixAutoUpdate = !1);
  71520. }),
  71521. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  71522. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  71523. (n.PointLightHelper.prototype.dispose = function () {
  71524. this.geometry.dispose(), this.material.dispose();
  71525. }),
  71526. (n.PointLightHelper.prototype.update = function () {
  71527. this.material.color
  71528. .copy(this.light.color)
  71529. .multiplyScalar(this.light.intensity);
  71530. }),
  71531. (n.SkeletonHelper = function (e) {
  71532. this.bones = this.getBoneList(e);
  71533. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  71534. var r = this.bones[i];
  71535. r.parent instanceof n.Bone &&
  71536. (t.vertices.push(new n.Vector3()),
  71537. t.vertices.push(new n.Vector3()),
  71538. t.colors.push(new n.Color(0, 0, 1)),
  71539. t.colors.push(new n.Color(0, 1, 0)));
  71540. }
  71541. t.dynamic = !0;
  71542. var o = new n.LineBasicMaterial({
  71543. vertexColors: n.VertexColors,
  71544. depthTest: !1,
  71545. depthWrite: !1,
  71546. transparent: !0,
  71547. });
  71548. n.LineSegments.call(this, t, o),
  71549. (this.root = e),
  71550. (this.matrix = e.matrixWorld),
  71551. (this.matrixAutoUpdate = !1),
  71552. this.update();
  71553. }),
  71554. (n.SkeletonHelper.prototype = Object.create(
  71555. n.LineSegments.prototype
  71556. )),
  71557. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  71558. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  71559. var t = [];
  71560. e instanceof n.Bone && t.push(e);
  71561. for (var i = 0; i < e.children.length; i++)
  71562. t.push.apply(t, this.getBoneList(e.children[i]));
  71563. return t;
  71564. }),
  71565. (n.SkeletonHelper.prototype.update = function () {
  71566. for (
  71567. var e = this.geometry,
  71568. t = new n.Matrix4().getInverse(this.root.matrixWorld),
  71569. i = new n.Matrix4(),
  71570. r = 0,
  71571. o = 0;
  71572. o < this.bones.length;
  71573. o++
  71574. ) {
  71575. var a = this.bones[o];
  71576. a.parent instanceof n.Bone &&
  71577. (i.multiplyMatrices(t, a.matrixWorld),
  71578. e.vertices[r].setFromMatrixPosition(i),
  71579. i.multiplyMatrices(t, a.parent.matrixWorld),
  71580. e.vertices[r + 1].setFromMatrixPosition(i),
  71581. (r += 2));
  71582. }
  71583. (e.verticesNeedUpdate = !0), e.computeBoundingSphere();
  71584. }),
  71585. (n.SpotLightHelper = function (e) {
  71586. n.Object3D.call(this),
  71587. (this.light = e),
  71588. this.light.updateMatrixWorld(),
  71589. (this.matrix = e.matrixWorld),
  71590. (this.matrixAutoUpdate = !1);
  71591. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0);
  71592. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2);
  71593. var i = new n.MeshBasicMaterial({
  71594. wireframe: !0,
  71595. fog: !1,
  71596. });
  71597. (this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update();
  71598. }),
  71599. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  71600. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  71601. (n.SpotLightHelper.prototype.dispose = function () {
  71602. this.cone.geometry.dispose(), this.cone.material.dispose();
  71603. }),
  71604. (n.SpotLightHelper.prototype.update = (function () {
  71605. var e = new n.Vector3(),
  71606. t = new n.Vector3();
  71607. return function () {
  71608. var i = this.light.distance ? this.light.distance : 1e4,
  71609. n = i * Math.tan(this.light.angle);
  71610. this.cone.scale.set(n, n, i),
  71611. e.setFromMatrixPosition(this.light.matrixWorld),
  71612. t.setFromMatrixPosition(this.light.target.matrixWorld),
  71613. this.cone.lookAt(t.sub(e)),
  71614. this.cone.material.color
  71615. .copy(this.light.color)
  71616. .multiplyScalar(this.light.intensity);
  71617. };
  71618. })()),
  71619. (n.VertexNormalsHelper = function (e, t, i, r) {
  71620. (this.object = e), (this.size = void 0 !== t ? t : 1);
  71621. var o = void 0 !== i ? i : 16711680,
  71622. a = void 0 !== r ? r : 1,
  71623. s = 0,
  71624. l = this.object.geometry;
  71625. l instanceof n.Geometry
  71626. ? (s = 3 * l.faces.length)
  71627. : l instanceof n.BufferGeometry &&
  71628. (s = l.attributes.normal.count);
  71629. var c = new n.BufferGeometry(),
  71630. h = new n.Float32Attribute(2 * s * 3, 3);
  71631. c.addAttribute("position", h),
  71632. n.LineSegments.call(
  71633. this,
  71634. c,
  71635. new n.LineBasicMaterial({
  71636. color: o,
  71637. linewidth: a,
  71638. })
  71639. ),
  71640. (this.matrixAutoUpdate = !1),
  71641. this.update();
  71642. }),
  71643. (n.VertexNormalsHelper.prototype = Object.create(
  71644. n.LineSegments.prototype
  71645. )),
  71646. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  71647. (n.VertexNormalsHelper.prototype.update = (function () {
  71648. var e = new n.Vector3(),
  71649. t = new n.Vector3(),
  71650. i = new n.Matrix3();
  71651. return function () {
  71652. var r = ["a", "b", "c"];
  71653. this.object.updateMatrixWorld(!0),
  71654. i.getNormalMatrix(this.object.matrixWorld);
  71655. var o = this.object.matrixWorld,
  71656. a = this.geometry.attributes.position,
  71657. s = this.object.geometry;
  71658. if (s instanceof n.Geometry)
  71659. for (
  71660. var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length;
  71661. u < d;
  71662. u++
  71663. )
  71664. for (
  71665. var p = c[u], f = 0, g = p.vertexNormals.length;
  71666. f < g;
  71667. f++
  71668. ) {
  71669. var m = l[p[r[f]]],
  71670. v = p.vertexNormals[f];
  71671. e.copy(m).applyMatrix4(o),
  71672. t
  71673. .copy(v)
  71674. .applyMatrix3(i)
  71675. .normalize()
  71676. .multiplyScalar(this.size)
  71677. .add(e),
  71678. a.setXYZ(h, e.x, e.y, e.z),
  71679. (h += 1),
  71680. a.setXYZ(h, t.x, t.y, t.z),
  71681. (h += 1);
  71682. }
  71683. else if (s instanceof n.BufferGeometry)
  71684. for (
  71685. var A = s.attributes.position,
  71686. y = s.attributes.normal,
  71687. h = 0,
  71688. f = 0,
  71689. g = A.count;
  71690. f < g;
  71691. f++
  71692. )
  71693. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  71694. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  71695. t
  71696. .applyMatrix3(i)
  71697. .normalize()
  71698. .multiplyScalar(this.size)
  71699. .add(e),
  71700. a.setXYZ(h, e.x, e.y, e.z),
  71701. (h += 1),
  71702. a.setXYZ(h, t.x, t.y, t.z),
  71703. (h += 1);
  71704. return (a.needsUpdate = !0), this;
  71705. };
  71706. })()),
  71707. (n.WireframeHelper = function (e, t) {
  71708. var i = void 0 !== t ? t : 16777215;
  71709. n.LineSegments.call(
  71710. this,
  71711. new n.WireframeGeometry(e.geometry),
  71712. new n.LineBasicMaterial({
  71713. color: i,
  71714. })
  71715. ),
  71716. (this.matrix = e.matrixWorld),
  71717. (this.matrixAutoUpdate = !1);
  71718. }),
  71719. (n.WireframeHelper.prototype = Object.create(
  71720. n.LineSegments.prototype
  71721. )),
  71722. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  71723. (n.ImmediateRenderObject = function (e) {
  71724. n.Object3D.call(this),
  71725. (this.material = e),
  71726. (this.render = function (e) {});
  71727. }),
  71728. (n.ImmediateRenderObject.prototype = Object.create(
  71729. n.Object3D.prototype
  71730. )),
  71731. (n.ImmediateRenderObject.prototype.constructor =
  71732. n.ImmediateRenderObject),
  71733. (n.MorphBlendMesh = function (e, t) {
  71734. n.Mesh.call(this, e, t),
  71735. (this.animationsMap = {}),
  71736. (this.animationsList = []);
  71737. var i = this.geometry.morphTargets.length,
  71738. r = "__default",
  71739. o = 0,
  71740. a = i - 1,
  71741. s = i / 1;
  71742. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1);
  71743. }),
  71744. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  71745. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  71746. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  71747. var r = {
  71748. start: t,
  71749. end: i,
  71750. length: i - t + 1,
  71751. fps: n,
  71752. duration: (i - t) / n,
  71753. lastFrame: 0,
  71754. currentFrame: 0,
  71755. active: !1,
  71756. time: 0,
  71757. direction: 1,
  71758. weight: 1,
  71759. directionBackwards: !1,
  71760. mirroredLoop: !1,
  71761. };
  71762. (this.animationsMap[e] = r), this.animationsList.push(r);
  71763. }),
  71764. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  71765. for (
  71766. var t,
  71767. i = /([a-z]+)_?(\d+)/i,
  71768. n = {},
  71769. r = this.geometry,
  71770. o = 0,
  71771. a = r.morphTargets.length;
  71772. o < a;
  71773. o++
  71774. ) {
  71775. var s = r.morphTargets[o],
  71776. l = s.name.match(i);
  71777. if (l && l.length > 1) {
  71778. var c = l[1];
  71779. n[c] ||
  71780. (n[c] = {
  71781. start: 1 / 0,
  71782. end: -(1 / 0),
  71783. });
  71784. var h = n[c];
  71785. o < h.start && (h.start = o),
  71786. o > h.end && (h.end = o),
  71787. t || (t = c);
  71788. }
  71789. }
  71790. for (var c in n) {
  71791. var h = n[c];
  71792. this.createAnimation(c, h.start, h.end, e);
  71793. }
  71794. this.firstAnimation = t;
  71795. }),
  71796. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (
  71797. e
  71798. ) {
  71799. var t = this.animationsMap[e];
  71800. t && ((t.direction = 1), (t.directionBackwards = !1));
  71801. }),
  71802. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (
  71803. e
  71804. ) {
  71805. var t = this.animationsMap[e];
  71806. t && ((t.direction = -1), (t.directionBackwards = !0));
  71807. }),
  71808. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  71809. var i = this.animationsMap[e];
  71810. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps));
  71811. }),
  71812. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  71813. var i = this.animationsMap[e];
  71814. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration));
  71815. }),
  71816. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  71817. var i = this.animationsMap[e];
  71818. i && (i.weight = t);
  71819. }),
  71820. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  71821. var i = this.animationsMap[e];
  71822. i && (i.time = t);
  71823. }),
  71824. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  71825. var t = 0,
  71826. i = this.animationsMap[e];
  71827. return i && (t = i.time), t;
  71828. }),
  71829. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  71830. var t = -1,
  71831. i = this.animationsMap[e];
  71832. return i && (t = i.duration), t;
  71833. }),
  71834. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  71835. var t = this.animationsMap[e];
  71836. t
  71837. ? ((t.time = 0), (t.active = !0))
  71838. : console.warn(
  71839. "THREE.MorphBlendMesh: animation[" +
  71840. e +
  71841. "] undefined in .playAnimation()"
  71842. );
  71843. }),
  71844. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  71845. var t = this.animationsMap[e];
  71846. t && (t.active = !1);
  71847. }),
  71848. (n.MorphBlendMesh.prototype.update = function (e) {
  71849. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  71850. var r = this.animationsList[t];
  71851. if (r.active) {
  71852. var o = r.duration / r.length;
  71853. (r.time += r.direction * e),
  71854. r.mirroredLoop
  71855. ? (r.time > r.duration || r.time < 0) &&
  71856. ((r.direction *= -1),
  71857. r.time > r.duration &&
  71858. ((r.time = r.duration), (r.directionBackwards = !0)),
  71859. r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  71860. : ((r.time = r.time % r.duration),
  71861. r.time < 0 && (r.time += r.duration));
  71862. var a =
  71863. r.start +
  71864. n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  71865. s = r.weight;
  71866. a !== r.currentFrame &&
  71867. ((this.morphTargetInfluences[r.lastFrame] = 0),
  71868. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  71869. (this.morphTargetInfluences[a] = 0),
  71870. (r.lastFrame = r.currentFrame),
  71871. (r.currentFrame = a));
  71872. var l = (r.time % o) / o;
  71873. r.directionBackwards && (l = 1 - l),
  71874. r.currentFrame !== r.lastFrame
  71875. ? ((this.morphTargetInfluences[r.currentFrame] = l * s),
  71876. (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  71877. : (this.morphTargetInfluences[r.currentFrame] = s);
  71878. }
  71879. }
  71880. }),
  71881. "undefined" != typeof i
  71882. ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  71883. (i.THREE = n))
  71884. : (this.THREE = n);
  71885. window.THREE = n;
  71886. getObjLoader();
  71887. initByTHREE(THREE);
  71888. //getWebXRManager()
  71889. },
  71890. {},
  71891. ],
  71892. },
  71893. {},
  71894. [116]
  71895. );
  71896. /*
  71897. function getWebXRManager(){
  71898. class ArrayCamera extends THREE.PerspectiveCamera {
  71899. constructor(array = []) {
  71900. super();
  71901. this.isArrayCamera = true;
  71902. this.cameras = array;
  71903. }
  71904. }
  71905. function WebGLAnimation() {
  71906. let context = null;
  71907. let isAnimating = false;
  71908. let animationLoop = null;
  71909. let requestId = null;
  71910. function onAnimationFrame(time, frame) {
  71911. animationLoop(time, frame);
  71912. requestId = context.requestAnimationFrame(onAnimationFrame);
  71913. }
  71914. return {
  71915. start: function () {
  71916. if (isAnimating === true) return;
  71917. if (animationLoop === null) return;
  71918. requestId = context.requestAnimationFrame(onAnimationFrame);
  71919. isAnimating = true;
  71920. },
  71921. stop: function () {
  71922. context.cancelAnimationFrame(requestId);
  71923. isAnimating = false;
  71924. },
  71925. setAnimationLoop: function (callback) {
  71926. animationLoop = callback;
  71927. },
  71928. setContext: function (value) {
  71929. context = value;
  71930. }
  71931. };
  71932. }
  71933. function WebXRManager( renderer, gl ) {
  71934. var scope = this;
  71935. var session = null;
  71936. // var framebufferScaleFactor = 1.0;
  71937. var referenceSpace = null;
  71938. var referenceSpaceType = 'local-floor';
  71939. var pose = null;
  71940. var controllers = [];
  71941. var sortedInputSources = [];
  71942. function isPresenting() {
  71943. return session !== null && referenceSpace !== null;
  71944. }
  71945. //
  71946. var cameraL = new THREE.PerspectiveCamera();
  71947. cameraL.layers.enable( 1 );
  71948. cameraL.viewport = new THREE.Vector4();
  71949. var cameraR = new THREE.PerspectiveCamera();
  71950. cameraR.layers.enable( 2 );
  71951. cameraR.viewport = new THREE.Vector4();
  71952. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  71953. cameraVR.layers.enable( 1 );
  71954. cameraVR.layers.enable( 2 );
  71955. //
  71956. this.enabled = false;
  71957. this.getController = function ( id ) {
  71958. var controller = controllers[ id ];
  71959. if ( controller === undefined ) {
  71960. controller = new THREE.Group();
  71961. controller.matrixAutoUpdate = false;
  71962. controller.visible = false;
  71963. controllers[ id ] = controller;
  71964. }
  71965. return controller;
  71966. };
  71967. //
  71968. function onSessionEvent( event ) {
  71969. for ( var i = 0; i < controllers.length; i ++ ) {
  71970. if ( sortedInputSources[ i ] === event.inputSource ) {
  71971. controllers[ i ].dispatchEvent( { type: event.type } );
  71972. }
  71973. }
  71974. }
  71975. function onSessionEnd() {
  71976. renderer.setFramebuffer( null );
  71977. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  71978. animation.stop();
  71979. scope.dispatchEvent( { type: 'sessionend' } );
  71980. }
  71981. function onRequestReferenceSpace( value ) {
  71982. referenceSpace = value;
  71983. animation.setContext( session );
  71984. animation.start();
  71985. scope.dispatchEvent( { type: 'sessionstart' } );
  71986. }
  71987. this.setFramebufferScaleFactor = function ( ) {
  71988. // framebufferScaleFactor = value;
  71989. };
  71990. this.setReferenceSpaceType = function ( value ) {
  71991. referenceSpaceType = value;
  71992. };
  71993. this.getSession = function () {
  71994. return session;
  71995. };
  71996. this.setSession = function ( value ) {
  71997. session = value;
  71998. if ( session !== null ) {
  71999. session.addEventListener( 'select', onSessionEvent );
  72000. session.addEventListener( 'selectstart', onSessionEvent );
  72001. session.addEventListener( 'selectend', onSessionEvent );
  72002. session.addEventListener( 'end', onSessionEnd );
  72003. // eslint-disable-next-line no-undef
  72004. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  72005. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  72006. //
  72007. session.addEventListener( 'inputsourceschange', updateInputSources );
  72008. updateInputSources();
  72009. }
  72010. };
  72011. function updateInputSources() {
  72012. for ( var i = 0; i < controllers.length; i ++ ) {
  72013. sortedInputSources[ i ] = findInputSource( i );
  72014. }
  72015. }
  72016. function findInputSource( id ) {
  72017. var inputSources = session.inputSources;
  72018. for ( var i = 0; i < inputSources.length; i ++ ) {
  72019. var inputSource = inputSources[ i ];
  72020. var handedness = inputSource.handedness;
  72021. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  72022. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  72023. }
  72024. }
  72025. //
  72026. function updateCamera( camera, parent ) {
  72027. if ( parent === null ) {
  72028. camera.matrixWorld.copy( camera.matrix );
  72029. } else {
  72030. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  72031. }
  72032. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  72033. }
  72034. this.getCamera = function ( camera ) {
  72035. if ( isPresenting() ) {
  72036. var parent = camera.parent;
  72037. var cameras = cameraVR.cameras;
  72038. updateCamera( cameraVR, parent );
  72039. for ( var i = 0; i < cameras.length; i ++ ) {
  72040. updateCamera( cameras[ i ], parent );
  72041. }
  72042. // update camera and its children
  72043. camera.matrixWorld.copy( cameraVR.matrixWorld );
  72044. var children = camera.children;
  72045. for ( var i = 0, l = children.length; i < l; i ++ ) {
  72046. children[ i ].updateMatrixWorld( true );
  72047. }
  72048. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  72049. return cameraVR;
  72050. }
  72051. return camera;
  72052. };
  72053. this.isPresenting = isPresenting;
  72054. // Animation Loop
  72055. var onAnimationFrameCallback = null;
  72056. function onAnimationFrame( time, frame ) {
  72057. pose = frame.getViewerPose( referenceSpace );
  72058. if ( pose !== null ) {
  72059. var views = pose.views;
  72060. var baseLayer = session.renderState.baseLayer;
  72061. renderer.setFramebuffer( baseLayer.framebuffer );
  72062. for ( var i = 0; i < views.length; i ++ ) {
  72063. var view = views[ i ];
  72064. var viewport = baseLayer.getViewport( view );
  72065. var viewMatrix = view.transform.inverse.matrix;
  72066. var camera = cameraVR.cameras[ i ];
  72067. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  72068. camera.projectionMatrix.fromArray( view.projectionMatrix );
  72069. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  72070. if ( i === 0 ) {
  72071. cameraVR.matrix.copy( camera.matrix );
  72072. }
  72073. }
  72074. }
  72075. //
  72076. for ( var i = 0; i < controllers.length; i ++ ) {
  72077. var controller = controllers[ i ];
  72078. var inputSource = sortedInputSources[ i ];
  72079. if ( inputSource ) {
  72080. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  72081. if ( inputPose !== null ) {
  72082. controller.matrix.fromArray( inputPose.transform.matrix );
  72083. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  72084. controller.visible = true;
  72085. continue;
  72086. }
  72087. }
  72088. controller.visible = false;
  72089. }
  72090. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  72091. }
  72092. var animation = new WebGLAnimation();
  72093. animation.setAnimationLoop( onAnimationFrame );
  72094. this.setAnimationLoop = function ( callback ) {
  72095. onAnimationFrameCallback = callback;
  72096. };
  72097. this.dispose = function () {};
  72098. // DEPRECATED
  72099. this.getStandingMatrix = function () {
  72100. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  72101. return new THREE.Matrix4();
  72102. };
  72103. this.getDevice = function () {
  72104. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  72105. };
  72106. this.setDevice = function () {
  72107. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  72108. };
  72109. this.setFrameOfReferenceType = function () {
  72110. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  72111. };
  72112. this.submitFrame = function () {};
  72113. }
  72114. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  72115. THREE.WebXRManager = WebXRManager
  72116. }
  72117. function getWebXRManager(){
  72118. class ArrayCamera extends THREE.PerspectiveCamera {
  72119. constructor(array = []) {
  72120. super();
  72121. this.isArrayCamera = true;
  72122. this.cameras = array;
  72123. }
  72124. }
  72125. class WebXRController {
  72126. constructor() {
  72127. this._targetRay = null;
  72128. this._grip = null;
  72129. this._hand = null;
  72130. }
  72131. getHandSpace() {
  72132. if (this._hand === null) {
  72133. this._hand = new THREE.Group();
  72134. this._hand.matrixAutoUpdate = false;
  72135. this._hand.visible = false;
  72136. this._hand.joints = {};
  72137. this._hand.inputState = {
  72138. pinching: false
  72139. };
  72140. }
  72141. return this._hand;
  72142. }
  72143. getTargetRaySpace() {
  72144. if (this._targetRay === null) {
  72145. this._targetRay = new THREE.Group();
  72146. this._targetRay.matrixAutoUpdate = false;
  72147. this._targetRay.visible = false;
  72148. this._targetRay.hasLinearVelocity = false;
  72149. this._targetRay.linearVelocity = new THREE.Vector3();
  72150. this._targetRay.hasAngularVelocity = false;
  72151. this._targetRay.angularVelocity = new THREE.Vector3();
  72152. }
  72153. return this._targetRay;
  72154. }
  72155. getGripSpace() {
  72156. if (this._grip === null) {
  72157. this._grip = new THREE.Group();
  72158. this._grip.matrixAutoUpdate = false;
  72159. this._grip.visible = false;
  72160. this._grip.hasLinearVelocity = false;
  72161. this._grip.linearVelocity = new THREE.Vector3();
  72162. this._grip.hasAngularVelocity = false;
  72163. this._grip.angularVelocity = new THREE.Vector3();
  72164. }
  72165. return this._grip;
  72166. }
  72167. dispatchEvent(event) {
  72168. if (this._targetRay !== null) {
  72169. this._targetRay.dispatchEvent(event);
  72170. }
  72171. if (this._grip !== null) {
  72172. this._grip.dispatchEvent(event);
  72173. }
  72174. if (this._hand !== null) {
  72175. this._hand.dispatchEvent(event);
  72176. }
  72177. return this;
  72178. }
  72179. disconnect(inputSource) {
  72180. this.dispatchEvent({
  72181. type: 'disconnected',
  72182. data: inputSource
  72183. });
  72184. if (this._targetRay !== null) {
  72185. this._targetRay.visible = false;
  72186. }
  72187. if (this._grip !== null) {
  72188. this._grip.visible = false;
  72189. }
  72190. if (this._hand !== null) {
  72191. this._hand.visible = false;
  72192. }
  72193. return this;
  72194. }
  72195. update(inputSource, frame, referenceSpace) {
  72196. let inputPose = null;
  72197. let gripPose = null;
  72198. let handPose = null;
  72199. const targetRay = this._targetRay;
  72200. const grip = this._grip;
  72201. const hand = this._hand;
  72202. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  72203. if (hand && inputSource.hand) {
  72204. handPose = true;
  72205. for (const inputjoint of inputSource.hand.values()) {
  72206. // Update the joints groups with the XRJoint poses
  72207. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  72208. if (hand.joints[inputjoint.jointName] === undefined) {
  72209. // The transform of this joint will be updated with the joint pose on each frame
  72210. const joint = new THREE.Group();
  72211. joint.matrixAutoUpdate = false;
  72212. joint.visible = false;
  72213. hand.joints[inputjoint.jointName] = joint; // ??
  72214. hand.add(joint);
  72215. }
  72216. const joint = hand.joints[inputjoint.jointName];
  72217. if (jointPose !== null) {
  72218. joint.matrix.fromArray(jointPose.transform.matrix);
  72219. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  72220. joint.jointRadius = jointPose.radius;
  72221. }
  72222. joint.visible = jointPose !== null;
  72223. } // Custom events
  72224. // Check pinchz
  72225. const indexTip = hand.joints['index-finger-tip'];
  72226. const thumbTip = hand.joints['thumb-tip'];
  72227. const distance = indexTip.position.distanceTo(thumbTip.position);
  72228. const distanceToPinch = 0.02;
  72229. const threshold = 0.005;
  72230. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  72231. hand.inputState.pinching = false;
  72232. this.dispatchEvent({
  72233. type: 'pinchend',
  72234. handedness: inputSource.handedness,
  72235. target: this
  72236. });
  72237. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  72238. hand.inputState.pinching = true;
  72239. this.dispatchEvent({
  72240. type: 'pinchstart',
  72241. handedness: inputSource.handedness,
  72242. target: this
  72243. });
  72244. }
  72245. } else {
  72246. if (grip !== null && inputSource.gripSpace) {
  72247. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  72248. if (gripPose !== null) {
  72249. grip.matrix.fromArray(gripPose.transform.matrix);
  72250. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  72251. if (gripPose.linearVelocity) {
  72252. grip.hasLinearVelocity = true;
  72253. grip.linearVelocity.copy(gripPose.linearVelocity);
  72254. } else {
  72255. grip.hasLinearVelocity = false;
  72256. }
  72257. if (gripPose.angularVelocity) {
  72258. grip.hasAngularVelocity = true;
  72259. grip.angularVelocity.copy(gripPose.angularVelocity);
  72260. } else {
  72261. grip.hasAngularVelocity = false;
  72262. }
  72263. }
  72264. }
  72265. }
  72266. if (targetRay !== null) {
  72267. inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
  72268. if (inputPose === null && gripPose !== null) {
  72269. inputPose = gripPose;
  72270. }
  72271. if (inputPose !== null) {
  72272. targetRay.matrix.fromArray(inputPose.transform.matrix);
  72273. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  72274. if (inputPose.linearVelocity) {
  72275. targetRay.hasLinearVelocity = true;
  72276. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  72277. } else {
  72278. targetRay.hasLinearVelocity = false;
  72279. }
  72280. if (inputPose.angularVelocity) {
  72281. targetRay.hasAngularVelocity = true;
  72282. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  72283. } else {
  72284. targetRay.hasAngularVelocity = false;
  72285. }
  72286. this.dispatchEvent(_moveEvent);
  72287. }
  72288. }
  72289. }
  72290. if (targetRay !== null) {
  72291. targetRay.visible = inputPose !== null;
  72292. }
  72293. if (grip !== null) {
  72294. grip.visible = gripPose !== null;
  72295. }
  72296. if (hand !== null) {
  72297. hand.visible = handPose !== null;
  72298. }
  72299. return this;
  72300. }
  72301. }
  72302. function WebGLAnimation() {
  72303. let context = null;
  72304. let isAnimating = false;
  72305. let animationLoop = null;
  72306. let requestId = null;
  72307. function onAnimationFrame(time, frame) {
  72308. animationLoop(time, frame);
  72309. requestId = context.requestAnimationFrame(onAnimationFrame);
  72310. }
  72311. return {
  72312. start: function () {
  72313. if (isAnimating === true) return;
  72314. if (animationLoop === null) return;
  72315. requestId = context.requestAnimationFrame(onAnimationFrame);
  72316. isAnimating = true;
  72317. },
  72318. stop: function () {
  72319. context.cancelAnimationFrame(requestId);
  72320. isAnimating = false;
  72321. },
  72322. setAnimationLoop: function (callback) {
  72323. animationLoop = callback;
  72324. },
  72325. setContext: function (value) {
  72326. context = value;
  72327. }
  72328. };
  72329. }
  72330. class WebXRManager extends THREE.EventDispatcher {
  72331. constructor(renderer, gl) {
  72332. super();
  72333. const scope = this;
  72334. let session = null;
  72335. let framebufferScaleFactor = 1.0;
  72336. let referenceSpace = null;
  72337. let referenceSpaceType = 'local-floor';
  72338. let customReferenceSpace = null;
  72339. let pose = null;
  72340. let glBinding = null;
  72341. let glProjLayer = null;
  72342. let glBaseLayer = null;
  72343. let xrFrame = null;
  72344. const attributes = gl.getContextAttributes();
  72345. let initialRenderTarget = null;
  72346. let newRenderTarget = null;
  72347. const controllers = [];
  72348. const controllerInputSources = []; //
  72349. const cameraL = new THREE.PerspectiveCamera();
  72350. cameraL.layers.enable(1);
  72351. cameraL.viewport = new THREE.Vector4();
  72352. const cameraR = new THREE.PerspectiveCamera();
  72353. cameraR.layers.enable(2);
  72354. cameraR.viewport = new THREE.Vector4();
  72355. const cameras = [cameraL, cameraR];
  72356. const cameraVR = new ArrayCamera();
  72357. cameraVR.layers.enable(1);
  72358. cameraVR.layers.enable(2);
  72359. let _currentDepthNear = null;
  72360. let _currentDepthFar = null; //
  72361. this.cameraAutoUpdate = true;
  72362. this.enabled = false;
  72363. this.isPresenting = false;
  72364. this.getController = function (index) {
  72365. let controller = controllers[index];
  72366. if (controller === undefined) {
  72367. controller = new WebXRController();
  72368. controllers[index] = controller;
  72369. }
  72370. return controller.getTargetRaySpace();
  72371. };
  72372. this.getControllerGrip = function (index) {
  72373. let controller = controllers[index];
  72374. if (controller === undefined) {
  72375. controller = new WebXRController();
  72376. controllers[index] = controller;
  72377. }
  72378. return controller.getGripSpace();
  72379. };
  72380. this.getHand = function (index) {
  72381. let controller = controllers[index];
  72382. if (controller === undefined) {
  72383. controller = new WebXRController();
  72384. controllers[index] = controller;
  72385. }
  72386. return controller.getHandSpace();
  72387. }; //
  72388. function onSessionEvent(event) {
  72389. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  72390. if (controllerIndex === -1) {
  72391. return;
  72392. }
  72393. const controller = controllers[controllerIndex];
  72394. if (controller !== undefined) {
  72395. controller.dispatchEvent({
  72396. type: event.type,
  72397. data: event.inputSource
  72398. });
  72399. }
  72400. }
  72401. function onSessionEnd() {
  72402. session.removeEventListener('select', onSessionEvent);
  72403. session.removeEventListener('selectstart', onSessionEvent);
  72404. session.removeEventListener('selectend', onSessionEvent);
  72405. session.removeEventListener('squeeze', onSessionEvent);
  72406. session.removeEventListener('squeezestart', onSessionEvent);
  72407. session.removeEventListener('squeezeend', onSessionEvent);
  72408. session.removeEventListener('end', onSessionEnd);
  72409. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  72410. for (let i = 0; i < controllers.length; i++) {
  72411. const inputSource = controllerInputSources[i];
  72412. if (inputSource === null) continue;
  72413. controllerInputSources[i] = null;
  72414. controllers[i].disconnect(inputSource);
  72415. }
  72416. _currentDepthNear = null;
  72417. _currentDepthFar = null; // restore framebuffer/rendering state
  72418. renderer.setRenderTarget(initialRenderTarget);
  72419. glBaseLayer = null;
  72420. glProjLayer = null;
  72421. glBinding = null;
  72422. session = null;
  72423. newRenderTarget = null; //
  72424. animation.stop();
  72425. scope.isPresenting = false;
  72426. scope.dispatchEvent({
  72427. type: 'sessionend'
  72428. });
  72429. }
  72430. this.setFramebufferScaleFactor = function (value) {
  72431. framebufferScaleFactor = value;
  72432. if (scope.isPresenting === true) {
  72433. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  72434. }
  72435. };
  72436. this.setReferenceSpaceType = function (value) {
  72437. referenceSpaceType = value;
  72438. if (scope.isPresenting === true) {
  72439. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  72440. }
  72441. };
  72442. this.getReferenceSpace = function () {
  72443. return customReferenceSpace || referenceSpace;
  72444. };
  72445. this.setReferenceSpace = function (space) {
  72446. customReferenceSpace = space;
  72447. };
  72448. this.getBaseLayer = function () {
  72449. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  72450. };
  72451. this.getBinding = function () {
  72452. return glBinding;
  72453. };
  72454. this.getFrame = function () {
  72455. return xrFrame;
  72456. };
  72457. this.getSession = function () {
  72458. return session;
  72459. };
  72460. this.setSession = async function (value) {
  72461. session = value;
  72462. if (session !== null) {
  72463. initialRenderTarget = renderer.getCurrentRenderTarget();
  72464. session.addEventListener('select', onSessionEvent);
  72465. session.addEventListener('selectstart', onSessionEvent);
  72466. session.addEventListener('selectend', onSessionEvent);
  72467. session.addEventListener('squeeze', onSessionEvent);
  72468. session.addEventListener('squeezestart', onSessionEvent);
  72469. session.addEventListener('squeezeend', onSessionEvent);
  72470. session.addEventListener('end', onSessionEnd);
  72471. session.addEventListener('inputsourceschange', onInputSourcesChange);
  72472. if (attributes.xrCompatible !== true) {
  72473. await gl.makeXRCompatible();
  72474. }
  72475. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  72476. const layerInit = {
  72477. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  72478. alpha: attributes.alpha,
  72479. depth: attributes.depth,
  72480. stencil: attributes.stencil,
  72481. framebufferScaleFactor: framebufferScaleFactor
  72482. };
  72483. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  72484. session.updateRenderState({
  72485. baseLayer: glBaseLayer
  72486. });
  72487. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  72488. format: THREE.RGBAFormat,
  72489. type: THREE.UnsignedByteType,
  72490. encoding: renderer.outputEncoding
  72491. });
  72492. } else {
  72493. let depthFormat = null;
  72494. let depthType = null;
  72495. let glDepthFormat = null;
  72496. if (attributes.depth) {
  72497. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  72498. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  72499. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  72500. }
  72501. const projectionlayerInit = {
  72502. colorFormat: gl.RGBA8,
  72503. depthFormat: glDepthFormat,
  72504. scaleFactor: framebufferScaleFactor
  72505. };
  72506. glBinding = new XRWebGLBinding(session, gl);
  72507. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  72508. session.updateRenderState({
  72509. layers: [glProjLayer]
  72510. });
  72511. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  72512. format: THREE.RGBAFormat,
  72513. type: THREE.UnsignedByteType,
  72514. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  72515. stencilBuffer: attributes.stencil,
  72516. encoding: renderer.outputEncoding,
  72517. samples: attributes.antialias ? 4 : 0
  72518. });
  72519. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  72520. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  72521. }
  72522. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  72523. // Set foveation to maximum.
  72524. this.setFoveation(1.0);
  72525. customReferenceSpace = null;
  72526. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  72527. animation.setContext(session);
  72528. animation.start();
  72529. scope.isPresenting = true;
  72530. scope.dispatchEvent({
  72531. type: 'sessionstart'
  72532. });
  72533. }
  72534. };
  72535. function onInputSourcesChange(event) {
  72536. // Notify disconnected
  72537. for (let i = 0; i < event.removed.length; i++) {
  72538. const inputSource = event.removed[i];
  72539. const index = controllerInputSources.indexOf(inputSource);
  72540. if (index >= 0) {
  72541. controllerInputSources[index] = null;
  72542. controllers[index].dispatchEvent({
  72543. type: 'disconnected',
  72544. data: inputSource
  72545. });
  72546. }
  72547. } // Notify connected
  72548. for (let i = 0; i < event.added.length; i++) {
  72549. const inputSource = event.added[i];
  72550. let controllerIndex = controllerInputSources.indexOf(inputSource);
  72551. if (controllerIndex === -1) {
  72552. // Assign input source a controller that currently has no input source
  72553. for (let i = 0; i < controllers.length; i++) {
  72554. if (i >= controllerInputSources.length) {
  72555. controllerInputSources.push(inputSource);
  72556. controllerIndex = i;
  72557. break;
  72558. } else if (controllerInputSources[i] === null) {
  72559. controllerInputSources[i] = inputSource;
  72560. controllerIndex = i;
  72561. break;
  72562. }
  72563. } // If all controllers do currently receive input we ignore new ones
  72564. if (controllerIndex === -1) break;
  72565. }
  72566. const controller = controllers[controllerIndex];
  72567. if (controller) {
  72568. controller.dispatchEvent({
  72569. type: 'connected',
  72570. data: inputSource
  72571. });
  72572. }
  72573. }
  72574. } //
  72575. const cameraLPos = new THREE.Vector3();
  72576. const cameraRPos = new THREE.Vector3();
  72577. function setProjectionFromUnion(camera, cameraL, cameraR) {
  72578. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  72579. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  72580. const ipd = cameraLPos.distanceTo(cameraRPos);
  72581. const projL = cameraL.projectionMatrix.elements;
  72582. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  72583. // most likely identical top and bottom frustum extents.
  72584. // Use the left camera for these values.
  72585. const near = projL[14] / (projL[10] - 1);
  72586. const far = projL[14] / (projL[10] + 1);
  72587. const topFov = (projL[9] + 1) / projL[5];
  72588. const bottomFov = (projL[9] - 1) / projL[5];
  72589. const leftFov = (projL[8] - 1) / projL[0];
  72590. const rightFov = (projR[8] + 1) / projR[0];
  72591. const left = near * leftFov;
  72592. const right = near * rightFov; // Calculate the new camera's position offset from the
  72593. // left camera. xOffset should be roughly half `ipd`.
  72594. const zOffset = ipd / (-leftFov + rightFov);
  72595. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  72596. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  72597. camera.translateX(xOffset);
  72598. camera.translateZ(zOffset);
  72599. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  72600. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  72601. // the values so that the near plane's position does not change in world space,
  72602. // although must now be relative to the new union camera.
  72603. const near2 = near + zOffset;
  72604. const far2 = far + zOffset;
  72605. const left2 = left - xOffset;
  72606. const right2 = right + (ipd - xOffset);
  72607. const top2 = topFov * far / far2 * near2;
  72608. const bottom2 = bottomFov * far / far2 * near2;
  72609. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  72610. }
  72611. function updateCamera(camera, parent) {
  72612. if (parent === null) {
  72613. camera.matrixWorld.copy(camera.matrix);
  72614. } else {
  72615. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  72616. }
  72617. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  72618. }
  72619. this.updateCamera = function (camera) {
  72620. if (session === null) return;
  72621. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  72622. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  72623. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  72624. // Note that the new renderState won't apply until the next frame. See #18320
  72625. session.updateRenderState({
  72626. depthNear: cameraVR.near,
  72627. depthFar: cameraVR.far
  72628. });
  72629. _currentDepthNear = cameraVR.near;
  72630. _currentDepthFar = cameraVR.far;
  72631. }
  72632. const parent = camera.parent;
  72633. const cameras = cameraVR.cameras;
  72634. updateCamera(cameraVR, parent);
  72635. for (let i = 0; i < cameras.length; i++) {
  72636. updateCamera(cameras[i], parent);
  72637. }
  72638. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  72639. camera.position.copy(cameraVR.position);
  72640. camera.quaternion.copy(cameraVR.quaternion);
  72641. camera.scale.copy(cameraVR.scale);
  72642. camera.matrix.copy(cameraVR.matrix);
  72643. camera.matrixWorld.copy(cameraVR.matrixWorld);
  72644. const children = camera.children;
  72645. for (let i = 0, l = children.length; i < l; i++) {
  72646. children[i].updateMatrixWorld(true);
  72647. } // update projection matrix for proper view frustum culling
  72648. if (cameras.length === 2) {
  72649. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  72650. } else {
  72651. // assume single camera setup (AR)
  72652. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  72653. }
  72654. };
  72655. this.getCamera = function () {
  72656. return cameraVR;
  72657. };
  72658. this.getFoveation = function () {
  72659. if (glProjLayer !== null) {
  72660. return glProjLayer.fixedFoveation;
  72661. }
  72662. if (glBaseLayer !== null) {
  72663. return glBaseLayer.fixedFoveation;
  72664. }
  72665. return undefined;
  72666. };
  72667. this.setFoveation = function (foveation) {
  72668. // 0 = no foveation = full resolution
  72669. // 1 = maximum foveation = the edges render at lower resolution
  72670. if (glProjLayer !== null) {
  72671. glProjLayer.fixedFoveation = foveation;
  72672. }
  72673. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  72674. glBaseLayer.fixedFoveation = foveation;
  72675. }
  72676. }; // Animation Loop
  72677. let onAnimationFrameCallback = null;
  72678. function onAnimationFrame(time, frame) {
  72679. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  72680. xrFrame = frame;
  72681. if (pose !== null) {
  72682. const views = pose.views;
  72683. if (glBaseLayer !== null) {
  72684. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  72685. renderer.setRenderTarget(newRenderTarget);
  72686. }
  72687. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  72688. if (views.length !== cameraVR.cameras.length) {
  72689. cameraVR.cameras.length = 0;
  72690. cameraVRNeedsUpdate = true;
  72691. }
  72692. for (let i = 0; i < views.length; i++) {
  72693. const view = views[i];
  72694. let viewport = null;
  72695. if (glBaseLayer !== null) {
  72696. viewport = glBaseLayer.getViewport(view);
  72697. } else {
  72698. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  72699. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  72700. if (i === 0) {
  72701. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  72702. renderer.setRenderTarget(newRenderTarget);
  72703. }
  72704. }
  72705. let camera = cameras[i];
  72706. if (camera === undefined) {
  72707. camera = new THREE.PerspectiveCamera();
  72708. camera.layers.enable(i);
  72709. camera.viewport = new THREE.Vector4();
  72710. cameras[i] = camera;
  72711. }
  72712. camera.matrix.fromArray(view.transform.matrix);
  72713. camera.projectionMatrix.fromArray(view.projectionMatrix);
  72714. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  72715. if (i === 0) {
  72716. cameraVR.matrix.copy(camera.matrix);
  72717. }
  72718. if (cameraVRNeedsUpdate === true) {
  72719. cameraVR.cameras.push(camera);
  72720. }
  72721. }
  72722. } //
  72723. for (let i = 0; i < controllers.length; i++) {
  72724. const inputSource = controllerInputSources[i];
  72725. const controller = controllers[i];
  72726. if (inputSource !== null && controller !== undefined) {
  72727. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  72728. }
  72729. }
  72730. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  72731. xrFrame = null;
  72732. }
  72733. const animation = new WebGLAnimation();
  72734. animation.setAnimationLoop(onAnimationFrame);
  72735. this.setAnimationLoop = function (callback) {
  72736. onAnimationFrameCallback = callback;
  72737. };
  72738. this.dispose = function () {};
  72739. }
  72740. }
  72741. THREE.WebXRManager = WebXRManager
  72742. } */
  72743. /*
  72744. var addMagnifier = function(){
  72745. class Magnifier extends THREE.Object3D {
  72746. constructor () {
  72747. super()
  72748. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  72749. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  72750. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  72751. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  72752. format: THREE.RGBAFormat ,
  72753. //type: THREE.FloatType,
  72754. //minFilter: THREE.NearestFilter,
  72755. //magFilter: THREE.NearestFilter,
  72756. } )
  72757. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  72758. side: THREE.DoubleSide ,
  72759. map: this.renderTarget.texture ,
  72760. transparent:true,
  72761. depthTest: !1,
  72762. depthWrite: !1,
  72763. }))
  72764. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  72765. side: THREE.DoubleSide ,
  72766. map: Texture.load('images/crosshair.png') ,
  72767. transparent:true,
  72768. depthTest: !1,
  72769. depthWrite: !1,
  72770. }))
  72771. this.add(this.mesh)
  72772. this.add(this.overlayMesh)
  72773. player.model.add(this);
  72774. player.magnifier = this;
  72775. }
  72776. update(aimPos){
  72777. const magDistance_ = 0.3;
  72778. var playerPos = player.position
  72779. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  72780. this.camera.position.copy(aimPos.clone().add(vec))
  72781. this.camera.lookAt(aimPos)
  72782. var playerCamera = player.camera
  72783. this.quaternion.copy(playerCamera.quaternion);
  72784. var pos2d = player.mouse.clone();
  72785. var shift = 400;
  72786. var clientHeight = player.domElement.clientHeight
  72787. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  72788. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  72789. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  72790. this.position.copy(newPos)
  72791. var renderer = player.sceneRenderer.renderer
  72792. var oldAutoClear = renderer.autoClear
  72793. renderer.autoClear = false
  72794. //renderer.clear( true, true, true );
  72795. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  72796. renderer.autoClear = oldAutoClear
  72797. }
  72798. }
  72799. new Magnifier()
  72800. }
  72801. */
  72802. /*
  72803. 笔记:
  72804. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  72805. {
  72806. //到导览中某个点位(假设点位不重复)
  72807. var id = 73
  72808. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  72809. var i = player.model.heroLocations.indexOf(p)
  72810. var p1 = p.heroLocations.find(e=>e.panoId == id)
  72811. var j = p.heroLocations.indexOf(p1)
  72812. player.director.goToHighlight([i,j])
  72813. }
  72814. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  72815. 关于pc-nav 4k
  72816. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  72817. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  72818. */