main_2020_show.js 2.6 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor; // = 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 ? (e = s.ofElement(t)) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  58. e ? e[n] : 0
  59. );
  60. }
  61. function u(t, i) {
  62. return t.val - i.val;
  63. }
  64. function a(t, i) {
  65. return i.val - t.val;
  66. }
  67. function f(t) {
  68. var i = s.ofContent(t, !0),
  69. n = s.ofViewport(t, !0),
  70. e = i.width - n.width,
  71. o = i.height - n.height;
  72. (this.content = i),
  73. (this.viewport = n),
  74. (this.width = 0 >= e ? null : n.left / e),
  75. (this.height = 0 >= o ? null : n.top / o),
  76. (this.left = n.left),
  77. (this.top = n.top),
  78. (this.right = i.right - n.right),
  79. (this.bottom = i.bottom - n.bottom);
  80. }
  81. function p(t) {
  82. this.el = t || window;
  83. }
  84. function d(t, i) {
  85. (this.context = t), (this.viewport = i), this.init();
  86. }
  87. function v(t, i, n, e) {
  88. (this.context = new l(t, i)), (this.property = n), (this.descending = e), this.init();
  89. }
  90. function w(t) {
  91. t && t !== window && t !== document
  92. ? ((this.context = t), (this.$autoTarget = g(t)))
  93. : (this.context = window),
  94. this.init();
  95. }
  96. var g = jQuery,
  97. m = g(window),
  98. b = g(document),
  99. T = g.extend,
  100. y = g.isFunction,
  101. k = Math.max,
  102. V = Math.min,
  103. E = Math.round,
  104. x = (function () {
  105. var t = {},
  106. i = 1;
  107. return function (n) {
  108. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0;
  109. };
  110. })();
  111. T(s.prototype, {
  112. equals: function (t) {
  113. return r(this, t, ['left', 'top', 'width', 'height']);
  114. },
  115. area: function () {
  116. return this.width * this.height;
  117. },
  118. relativeTo: function (t) {
  119. return new s(this.left - t.left, this.top - t.top, this.width, this.height);
  120. },
  121. intersection: function (t) {
  122. if (!i(t, s)) return null;
  123. var n = k(this.left, t.left),
  124. e = V(this.right, t.right),
  125. o = k(this.top, t.top),
  126. r = V(this.bottom, t.bottom),
  127. h = e - n,
  128. l = r - o;
  129. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null;
  130. },
  131. envelope: function (t) {
  132. if (!i(t, s)) return this;
  133. var n = V(this.left, t.left),
  134. e = k(this.right, t.right),
  135. o = V(this.top, t.top),
  136. r = k(this.bottom, t.bottom),
  137. h = e - n,
  138. l = r - o;
  139. return new s(n, o, h, l);
  140. },
  141. }),
  142. T(s, {
  143. ofContent: function (t, i) {
  144. return t && t !== document && t !== window
  145. ? i
  146. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  147. : new s(
  148. t.offsetLeft - t.scrollLeft,
  149. t.offsetTop - t.scrollTop,
  150. t.scrollWidth,
  151. t.scrollHeight
  152. )
  153. : new s(0, 0, b.width(), b.height());
  154. },
  155. ofViewport: function (t, i) {
  156. return t && t !== document && t !== window
  157. ? i
  158. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  159. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  160. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height());
  161. },
  162. ofElement: function (t) {
  163. var i = g(t);
  164. if (!i.is(':visible')) return null;
  165. var n = i.offset();
  166. return new s(n.left, n.top, i.outerWidth(), i.outerHeight());
  167. },
  168. }),
  169. T(h.prototype, {
  170. equals: function (t) {
  171. return this.fracsEqual(t) && this.rectsEqual(t);
  172. },
  173. fracsEqual: function (t) {
  174. return r(this, t, ['visible', 'viewport', 'possible']);
  175. },
  176. rectsEqual: function (t) {
  177. return r(this.rects, t.rects, ['document', 'element', 'viewport']);
  178. },
  179. }),
  180. T(h, {
  181. of: function (t, i) {
  182. var e, o, r;
  183. return (
  184. (t = (n(t) && s.ofElement(t)) || t),
  185. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  186. t instanceof s && (e = t.intersection(i))
  187. ? ((o = e.area()),
  188. (r = V(t.width, i.width) * V(t.height, i.height)),
  189. new h(o / t.area(), o / i.area(), o / r, {
  190. document: e,
  191. element: e.relativeTo(t),
  192. viewport: e.relativeTo(i),
  193. }))
  194. : new h()
  195. );
  196. },
  197. });
  198. var q = ['width', 'height', 'left', 'right', 'top', 'bottom'],
  199. S = ['possible', 'visible', 'viewport'];
  200. T(l.prototype, {
  201. sorted: function (t, i) {
  202. var n = this.viewport;
  203. return g
  204. .map(this.els, function (i) {
  205. return {
  206. el: i,
  207. val: c(i, n, t),
  208. };
  209. })
  210. .sort(i ? a : u);
  211. },
  212. best: function (t, i) {
  213. return this.els.length ? this.sorted(t, i)[0] : null;
  214. },
  215. }),
  216. T(f.prototype, {
  217. equals: function (t) {
  218. return r(this, t, [
  219. 'width',
  220. 'height',
  221. 'left',
  222. 'top',
  223. 'right',
  224. 'bottom',
  225. 'content',
  226. 'viewport',
  227. ]);
  228. },
  229. }),
  230. T(p.prototype, {
  231. equals: function (t) {
  232. return r(this, t, ['el']);
  233. },
  234. scrollState: function () {
  235. return new f(this.el);
  236. },
  237. scrollTo: function (t, i, n) {
  238. var e = g(this.el === window ? 'html,body' : this.el);
  239. (t = t || 0),
  240. (i = i || 0),
  241. (n = isNaN(n) ? 1e3 : n),
  242. e.stop(!0).animate(
  243. {
  244. scrollLeft: t,
  245. scrollTop: i,
  246. },
  247. n
  248. );
  249. },
  250. scroll: function (t, i, n) {
  251. var e = this.el === window ? m : g(this.el);
  252. (t = t || 0), (i = i || 0), this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n);
  253. },
  254. scrollToRect: function (t, i, n, e) {
  255. (i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e);
  256. },
  257. scrollToElement: function (t, i, n, e) {
  258. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  259. this.scrollToRect(o, i, n, e);
  260. },
  261. });
  262. var C = {
  263. init: function () {
  264. (this.callbacks = g.Callbacks('memory unique')),
  265. (this.currVal = null),
  266. (this.prevVal = null),
  267. (this.checkProxy = g.proxy(this.check, this)),
  268. this.autoCheck();
  269. },
  270. bind: function (t) {
  271. this.callbacks.add(t);
  272. },
  273. unbind: function (t) {
  274. t ? this.callbacks.remove(t) : this.callbacks.empty();
  275. },
  276. trigger: function () {
  277. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal]);
  278. },
  279. check: function (t) {
  280. var i = this.updatedValue(t);
  281. return (
  282. void 0 !== i && ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  283. );
  284. },
  285. $autoTarget: m,
  286. autoEvents: 'load resize scroll',
  287. autoCheck: function (t) {
  288. this.$autoTarget[t === !1 ? 'off' : 'on'](this.autoEvents, this.checkProxy);
  289. },
  290. };
  291. T(d.prototype, C, {
  292. updatedValue: function () {
  293. var t = h.of(this.context, this.viewport);
  294. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  295. },
  296. }),
  297. T(v.prototype, C, {
  298. updatedValue: function () {
  299. var t = this.context.best(this.property, this.descending);
  300. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t) ? t : void 0;
  301. },
  302. }),
  303. T(w.prototype, C, {
  304. updatedValue: function () {
  305. var t = new f(this.context);
  306. return this.currVal && this.currVal.equals(t) ? void 0 : t;
  307. },
  308. });
  309. var L = function (t, i) {
  310. var n = [].slice,
  311. e = jQuery,
  312. o = e.extend,
  313. r = e.isFunction,
  314. s = o({}, i),
  315. h = function (i, n, o, s) {
  316. return (
  317. (o = r(o) ? o.apply(i, n) : o),
  318. r(s[o])
  319. ? s[o].apply(i, n)
  320. : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  321. );
  322. },
  323. l = function () {
  324. return h(this, n.call(arguments), s.defaultStatic, l);
  325. },
  326. c = function (t) {
  327. return r(c[t])
  328. ? c[t].apply(this, n.call(arguments, 1))
  329. : h(this, n.call(arguments), s.defaultMethod, c);
  330. },
  331. u = function (t) {
  332. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u);
  333. };
  334. (u.prev = {
  335. statics: e[t],
  336. methods: e.fn[t],
  337. }),
  338. u(i),
  339. (e[t] = l),
  340. (e.fn[t] = c);
  341. },
  342. M = 'fracs';
  343. L(M, {
  344. statics: {
  345. version: '0.15.0',
  346. Rect: s,
  347. Fractions: h,
  348. Group: l,
  349. ScrollState: f,
  350. Viewport: p,
  351. FracsCallbacks: d,
  352. GroupCallbacks: v,
  353. ScrollStateCallbacks: w,
  354. fracs: function (t, i) {
  355. return h.of(t, i);
  356. },
  357. },
  358. methods: {
  359. content: function (t) {
  360. return this.length ? s.ofContent(this[0], t) : null;
  361. },
  362. envelope: function () {
  363. return o(this, function (t) {
  364. var i = s.ofElement(this);
  365. return t ? t.envelope(i) : i;
  366. });
  367. },
  368. fracs: function (i, n, o) {
  369. t(i, 'string') || ((o = n), (n = i), (i = null)), y(n) || ((o = n), (n = null)), (o = e(o));
  370. var r = M + '.fracs.' + x(o);
  371. return 'unbind' === i
  372. ? this.each(function () {
  373. var t = g(this).data(r);
  374. t && t.unbind(n);
  375. })
  376. : 'check' === i
  377. ? this.each(function () {
  378. var t = g(this).data(r);
  379. t && t.check();
  380. })
  381. : y(n)
  382. ? this.each(function () {
  383. var t = g(this),
  384. i = t.data(r);
  385. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n);
  386. })
  387. : this.length
  388. ? h.of(this[0], o)
  389. : null;
  390. },
  391. intersection: function () {
  392. return o(this, function (t) {
  393. var i = s.ofElement(this);
  394. return t ? t.intersection(i) : i;
  395. });
  396. },
  397. max: function (t, i, n) {
  398. return (
  399. y(i) || ((n = i), (i = null)),
  400. (n = e(n)),
  401. i ? (new v(this, n, t, !0).bind(i), this) : this.pushStack(new l(this, n).best(t, !0).el)
  402. );
  403. },
  404. min: function (t, i, n) {
  405. return (
  406. y(i) || ((n = i), (i = null)),
  407. (n = e(n)),
  408. i ? (new v(this, n, t).bind(i), this) : this.pushStack(new l(this, n).best(t).el)
  409. );
  410. },
  411. rect: function () {
  412. return this.length ? s.ofElement(this[0]) : null;
  413. },
  414. scrollState: function (i, n) {
  415. var e = M + '.scrollState';
  416. return (
  417. t(i, 'string') || ((n = i), (i = null)),
  418. 'unbind' === i
  419. ? this.each(function () {
  420. var t = g(this).data(e);
  421. t && t.unbind(n);
  422. })
  423. : 'check' === i
  424. ? this.each(function () {
  425. var t = g(this).data(e);
  426. t && t.check();
  427. })
  428. : y(n)
  429. ? this.each(function () {
  430. var t = g(this),
  431. i = t.data(e);
  432. i || ((i = new w(this)), t.data(e, i)), i.bind(n);
  433. })
  434. : this.length
  435. ? new f(this[0])
  436. : null
  437. );
  438. },
  439. scroll: function (t, i, n) {
  440. return this.each(function () {
  441. new p(this).scroll(t, i, n);
  442. });
  443. },
  444. scrollTo: function (t, i, n, o) {
  445. return (
  446. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  447. (t = e(t)),
  448. this.each(function () {
  449. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o);
  450. })
  451. );
  452. },
  453. scrollToThis: function (t, i, n, o) {
  454. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this;
  455. },
  456. softLink: function (t, i, n, o) {
  457. return (
  458. (o = new p(e(o))),
  459. this.filter('a[href^=#]').each(function () {
  460. var e = g(this);
  461. e.on('click', function () {
  462. o.scrollToElement(g(e.attr('href'))[0], t, i, n);
  463. });
  464. })
  465. );
  466. },
  467. sort: function (i, n, o) {
  468. return (
  469. t(n, 'boolean') || ((o = n), (n = null)),
  470. (o = e(o)),
  471. this.pushStack(
  472. g.map(new l(this, o).sorted(i, !n), function (t) {
  473. return t.el;
  474. })
  475. )
  476. );
  477. },
  478. viewport: function (t) {
  479. return this.length ? s.ofViewport(this[0], t) : null;
  480. },
  481. },
  482. defaultStatic: 'fracs',
  483. defaultMethod: 'fracs',
  484. });
  485. })();
  486. if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery");
  487. +(function (t) {
  488. 'use strict';
  489. function e(e) {
  490. return this.each(function () {
  491. var o = t(this),
  492. s = o.data('bs.tooltip'),
  493. n = 'object' == typeof e && e;
  494. (s || 'destroy' != e) &&
  495. (s || o.data('bs.tooltip', (s = new i(this, n))), 'string' == typeof e && s[e]());
  496. });
  497. }
  498. var i = function (t, e) {
  499. (this.type =
  500. this.options =
  501. this.enabled =
  502. this.timeout =
  503. this.hoverState =
  504. this.$element =
  505. null),
  506. this.init('tooltip', t, e);
  507. };
  508. (i.VERSION = '3.2.0'),
  509. (i.DEFAULTS = {
  510. animation: !0,
  511. placement: 'top',
  512. selector: !1,
  513. template:
  514. '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  515. trigger: 'hover focus',
  516. title: '',
  517. delay: 0,
  518. html: !1,
  519. container: !1,
  520. viewport: {
  521. selector: 'body',
  522. padding: 0,
  523. },
  524. }),
  525. (i.prototype.init = function (e, i, o) {
  526. (this.enabled = !0),
  527. (this.type = e),
  528. (this.$element = t(i)),
  529. (this.options = this.getOptions(o)),
  530. (this.$viewport =
  531. this.options.viewport && t(this.options.viewport.selector || this.options.viewport));
  532. for (var s = this.options.trigger.split(' '), n = s.length; n--; ) {
  533. var r = s[n];
  534. if ('click' == r)
  535. this.$element.on('click.' + this.type, this.options.selector, t.proxy(this.toggle, this));
  536. else if ('manual' != r) {
  537. var a = 'hover' == r ? 'mouseenter' : 'focusin',
  538. l = 'hover' == r ? 'mouseleave' : 'focusout';
  539. this.$element.on(a + '.' + this.type, this.options.selector, t.proxy(this.enter, this)),
  540. this.$element.on(l + '.' + this.type, this.options.selector, t.proxy(this.leave, this));
  541. }
  542. }
  543. this.options.selector
  544. ? (this._options = t.extend({}, this.options, {
  545. trigger: 'manual',
  546. selector: '',
  547. }))
  548. : this.fixTitle();
  549. }),
  550. (i.prototype.getDefaults = function () {
  551. return i.DEFAULTS;
  552. }),
  553. (i.prototype.getOptions = function (e) {
  554. return (
  555. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  556. e.delay &&
  557. 'number' == typeof e.delay &&
  558. (e.delay = {
  559. show: e.delay,
  560. hide: e.delay,
  561. }),
  562. e
  563. );
  564. }),
  565. (i.prototype.getDelegateOptions = function () {
  566. var e = {},
  567. i = this.getDefaults();
  568. return (
  569. this._options &&
  570. t.each(this._options, function (t, o) {
  571. i[t] != o && (e[t] = o);
  572. }),
  573. e
  574. );
  575. }),
  576. (i.prototype.enter = function (e) {
  577. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type);
  578. return (
  579. i ||
  580. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  581. t(e.currentTarget).data('bs.' + this.type, i)),
  582. clearTimeout(i.timeout),
  583. (i.hoverState = 'in'),
  584. i.options.delay && i.options.delay.show
  585. ? void (i.timeout = setTimeout(function () {
  586. // "in" == i.hoverState && i.show()
  587. }, i.options.delay.show))
  588. : i.show()
  589. );
  590. }),
  591. (i.prototype.leave = function (e) {
  592. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type);
  593. return (
  594. i ||
  595. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  596. t(e.currentTarget).data('bs.' + this.type, i)),
  597. clearTimeout(i.timeout),
  598. (i.hoverState = 'out'),
  599. i.options.delay && i.options.delay.hide
  600. ? void (i.timeout = setTimeout(function () {
  601. 'out' == i.hoverState && i.hide();
  602. }, i.options.delay.hide))
  603. : i.hide()
  604. );
  605. }),
  606. (i.prototype.show = function () {
  607. var e = t.Event('show.bs.' + this.type);
  608. if (this.hasContent() && this.enabled) {
  609. this.$element.trigger(e);
  610. var i = t.contains(document.documentElement, this.$element[0]);
  611. if (e.isDefaultPrevented() || !i) return;
  612. var o = this,
  613. s = this.tip(),
  614. n = this.getUID(this.type);
  615. this.setContent(),
  616. s.attr('id', n),
  617. this.$element.attr('aria-describedby', n),
  618. this.options.animation && s.addClass('fade');
  619. var r =
  620. 'function' == typeof this.options.placement
  621. ? this.options.placement.call(this, s[0], this.$element[0])
  622. : this.options.placement,
  623. a = /\s?auto?\s?/i,
  624. l = a.test(r);
  625. l && (r = r.replace(a, '') || 'top'),
  626. s
  627. .detach()
  628. .css({
  629. top: 0,
  630. left: 0,
  631. display: 'block',
  632. })
  633. .addClass(r)
  634. .data('bs.' + this.type, this),
  635. this.options.container
  636. ? s.appendTo(this.options.container)
  637. : s.insertAfter(this.$element);
  638. var p = this.getPosition(),
  639. h = s[0].offsetWidth,
  640. f = s[0].offsetHeight;
  641. if (l) {
  642. var u = r,
  643. c = this.$element.parent(),
  644. d = this.getPosition(c);
  645. (r =
  646. 'bottom' == r && p.top + p.height + f - d.scroll > d.height
  647. ? 'top'
  648. : 'top' == r && p.top - d.scroll - f < 0
  649. ? 'bottom'
  650. : 'right' == r && p.right + h > d.width
  651. ? 'left'
  652. : 'left' == r && p.left - h < d.left
  653. ? 'right'
  654. : r),
  655. s.removeClass(u).addClass(r);
  656. }
  657. var g = this.getCalculatedOffset(r, p, h, f);
  658. this.applyPlacement(g, r);
  659. var y = function () {
  660. o.$element.trigger('shown.bs.' + o.type), (o.hoverState = null);
  661. };
  662. t.support.transition && this.$tip.hasClass('fade')
  663. ? s.one('bsTransitionEnd', y).emulateTransitionEnd(150)
  664. : y();
  665. }
  666. }),
  667. (i.prototype.applyPlacement = function (e, i) {
  668. var o = this.tip(),
  669. s = o[0].offsetWidth,
  670. n = o[0].offsetHeight,
  671. r = parseInt(o.css('margin-top'), 10),
  672. a = parseInt(o.css('margin-left'), 10);
  673. isNaN(r) && (r = 0),
  674. isNaN(a) && (a = 0),
  675. (e.top = e.top + r),
  676. (e.left = e.left + a),
  677. t.offset.setOffset(
  678. o[0],
  679. t.extend(
  680. {
  681. using: function (t) {
  682. o.css({
  683. top: Math.round(t.top),
  684. left: Math.round(t.left),
  685. });
  686. },
  687. },
  688. e
  689. ),
  690. 0
  691. ),
  692. o.addClass('in');
  693. var l = o[0].offsetWidth,
  694. p = o[0].offsetHeight;
  695. 'top' == i && p != n && (e.top = e.top + n - p);
  696. var h = this.getViewportAdjustedDelta(i, e, l, p);
  697. h.left ? (e.left += h.left) : (e.top += h.top);
  698. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  699. u = h.left ? 'left' : 'top',
  700. c = h.left ? 'offsetWidth' : 'offsetHeight';
  701. o.offset(e), this.replaceArrow(f, o[0][c], u);
  702. }),
  703. (i.prototype.replaceArrow = function (t, e, i) {
  704. this.arrow().css(i, t ? 50 * (1 - t / e) + '%' : '');
  705. }),
  706. (i.prototype.setContent = function () {
  707. var t = this.tip(),
  708. e = this.getTitle();
  709. t.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](e),
  710. t.removeClass('fade in top bottom left right');
  711. }),
  712. (i.prototype.hide = function () {
  713. function e() {
  714. 'in' != i.hoverState && o.detach(), i.$element.trigger('hidden.bs.' + i.type);
  715. }
  716. var i = this,
  717. o = this.tip(),
  718. s = t.Event('hide.bs.' + this.type);
  719. if (
  720. (this.$element.removeAttr('aria-describedby'),
  721. this.$element.trigger(s),
  722. !s.isDefaultPrevented())
  723. )
  724. return (
  725. o.removeClass('in'),
  726. t.support.transition && this.$tip.hasClass('fade')
  727. ? o.one('bsTransitionEnd', e).emulateTransitionEnd(150)
  728. : e(),
  729. (this.hoverState = null),
  730. this
  731. );
  732. }),
  733. (i.prototype.fixTitle = function () {
  734. var t = this.$element;
  735. (t.attr('title') || 'string' != typeof t.attr('data-original-title')) &&
  736. t.attr('data-original-title', t.attr('title') || '').attr('title', '');
  737. }),
  738. (i.prototype.hasContent = function () {
  739. return this.getTitle();
  740. }),
  741. (i.prototype.getPosition = function (e) {
  742. e = e || this.$element;
  743. var i = e[0],
  744. o = 'BODY' == i.tagName;
  745. return t.extend(
  746. {},
  747. 'function' == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null,
  748. {
  749. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  750. width: o ? t(window).width() : e.outerWidth(),
  751. height: o ? t(window).height() : e.outerHeight(),
  752. },
  753. o
  754. ? {
  755. top: 0,
  756. left: 0,
  757. }
  758. : e.offset()
  759. );
  760. }),
  761. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  762. return 'bottom' == t
  763. ? {
  764. top: e.top + e.height,
  765. left: e.left + e.width / 2 - i / 2,
  766. }
  767. : 'top' == t
  768. ? {
  769. top: e.top - o,
  770. left: e.left + e.width / 2 - i / 2,
  771. }
  772. : 'left' == t
  773. ? {
  774. top: e.top + e.height / 2 - o / 2,
  775. left: e.left - i,
  776. }
  777. : {
  778. top: e.top + e.height / 2 - o / 2,
  779. left: e.left + e.width,
  780. };
  781. }),
  782. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  783. var s = {
  784. top: 0,
  785. left: 0,
  786. };
  787. if (!this.$viewport) return s;
  788. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  789. r = this.getPosition(this.$viewport);
  790. if (/right|left/.test(t)) {
  791. var a = e.top - n - r.scroll,
  792. l = e.top + n - r.scroll + o;
  793. a < r.top ? (s.top = r.top - a) : l > r.top + r.height && (s.top = r.top + r.height - l);
  794. } else {
  795. var p = e.left - n,
  796. h = e.left + n + i;
  797. p < r.left ? (s.left = r.left - p) : h > r.width && (s.left = r.left + r.width - h);
  798. }
  799. return s;
  800. }),
  801. (i.prototype.getTitle = function () {
  802. var t,
  803. e = this.$element,
  804. i = this.options;
  805. return (t =
  806. e.attr('data-original-title') ||
  807. ('function' == typeof i.title ? i.title.call(e[0]) : i.title));
  808. }),
  809. (i.prototype.getUID = function (t) {
  810. do t += ~~(1e6 * Math.random());
  811. while (document.getElementById(t));
  812. return t;
  813. }),
  814. (i.prototype.tip = function () {
  815. return (this.$tip = this.$tip || t(this.options.template));
  816. }),
  817. (i.prototype.arrow = function () {
  818. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'));
  819. }),
  820. (i.prototype.validate = function () {
  821. this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null));
  822. }),
  823. (i.prototype.enable = function () {
  824. this.enabled = !0;
  825. }),
  826. (i.prototype.disable = function () {
  827. this.enabled = !1;
  828. }),
  829. (i.prototype.toggleEnabled = function () {
  830. this.enabled = !this.enabled;
  831. }),
  832. (i.prototype.toggle = function (e) {
  833. var i = this;
  834. e &&
  835. ((i = t(e.currentTarget).data('bs.' + this.type)),
  836. i ||
  837. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  838. t(e.currentTarget).data('bs.' + this.type, i))),
  839. i.tip().hasClass('in') ? i.leave(i) : i.enter(i);
  840. }),
  841. (i.prototype.destroy = function () {
  842. clearTimeout(this.timeout),
  843. this.hide()
  844. .$element.off('.' + this.type)
  845. .removeData('bs.' + this.type);
  846. });
  847. var o = t.fn.tooltip;
  848. (t.fn.tooltip = e),
  849. (t.fn.tooltip.Constructor = i),
  850. (t.fn.tooltip.noConflict = function () {
  851. return (t.fn.tooltip = o), this;
  852. });
  853. })(jQuery);
  854. !(function (e, t, n) {
  855. 'undefined' != typeof module && module.exports
  856. ? (module.exports = n())
  857. : 'function' == typeof define && define.amd
  858. ? define(n)
  859. : (t[e] = n());
  860. })('Keen', this, function () {
  861. 'use strict';
  862. function Keen() {
  863. return _init.apply(this, arguments);
  864. }
  865. function _init(e) {
  866. if (_isUndefined(e))
  867. throw new Error(
  868. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  869. );
  870. if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1)
  871. throw new Error('Please provide a projectId');
  872. this.configure(e);
  873. }
  874. function _extend(e) {
  875. for (var t = 1; t < arguments.length; t++) for (var n in arguments[t]) e[n] = arguments[t][n];
  876. return e;
  877. }
  878. function _isUndefined(e) {
  879. return void 0 === e;
  880. }
  881. function _type(e) {
  882. var t = e && e.constructor ? e.constructor.toString() : void 0;
  883. return t ? t.match(/function (.*)\(/)[1] : 'Null';
  884. }
  885. function _each(e, t, n) {
  886. var r;
  887. if (!e) return 0;
  888. if (((n = n ? n : e), 'array' === _type(e))) {
  889. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0;
  890. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0;
  891. return 1;
  892. }
  893. function _parse_params(e) {
  894. for (
  895. var t,
  896. n = {},
  897. r = /\+/g,
  898. i = /([^&=]+)=?([^&]*)/g,
  899. o = function (e) {
  900. return decodeURIComponent(e.replace(r, ' '));
  901. },
  902. a = e.split('?')[1];
  903. (t = i.exec(a));
  904. )
  905. n[o(t[1])] = o(t[2]);
  906. return n;
  907. }
  908. function _set_protocol(e) {
  909. switch (e) {
  910. case 'http':
  911. return 'http';
  912. case 'auto':
  913. return location.protocol.replace(/:/g, '');
  914. case 'https':
  915. case void 0:
  916. default:
  917. return 'https';
  918. }
  919. }
  920. function _set_request_type(e) {
  921. var t = e || 'jsonp',
  922. n = !1;
  923. return (
  924. ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) &&
  925. 'withCredentials' in new XMLHttpRequest() &&
  926. (n = !0),
  927. null == t || 'xhr' == t ? (n ? 'xhr' : 'jsonp') : t
  928. );
  929. }
  930. function _build_url(e) {
  931. return this.client.endpoint + '/projects/' + this.client.projectId + e;
  932. }
  933. function _uploadEvent(e, t, n, r, i) {
  934. var o = _build_url.apply(this, ['/events/' + e]),
  935. a = {};
  936. (n = n !== !1), this.client.globalProperties && (a = this.client.globalProperties(e));
  937. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c]);
  938. switch (this.client.requestType) {
  939. case 'xhr':
  940. _request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, n, r, i]);
  941. break;
  942. case 'jsonp':
  943. var s = JSON.stringify(a),
  944. l = Keen.Base64.encode(s);
  945. (o = o + '?api_key=' + this.client.writeKey),
  946. (o = o + '&data=' + l),
  947. (o = o + '&modified=' + new Date().getTime()),
  948. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  949. break;
  950. case 'beacon':
  951. var s = JSON.stringify(a),
  952. l = Keen.Base64.encode(s);
  953. (o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)),
  954. (o = o + '&data=' + encodeURIComponent(l)),
  955. (o = o + '&modified=' + encodeURIComponent(new Date().getTime())),
  956. (o += '&c=clv1'),
  957. _request.beacon.apply(this, [o, null, r, i]);
  958. }
  959. }
  960. Keen.prototype.configure = function (e) {
  961. return (
  962. (e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
  963. (e.protocol = _set_protocol(e.protocol)),
  964. (e.requestType = _set_request_type(e.requestType)),
  965. (this.client = {
  966. projectId: e.projectId,
  967. writeKey: e.writeKey,
  968. readKey: e.readKey,
  969. globalProperties: null,
  970. endpoint: e.protocol + '://' + e.host,
  971. requestType: e.requestType,
  972. }),
  973. Keen.trigger('client', this, e),
  974. this.trigger('ready'),
  975. this
  976. );
  977. };
  978. var _request = {
  979. xhr: function (e, t, n, r, i, o, a, c) {
  980. if (!i)
  981. return Keen.log(
  982. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  983. );
  984. var s = new XMLHttpRequest();
  985. if (
  986. ((s.onreadystatechange = function () {
  987. if (4 == s.readyState)
  988. if (s.status >= 200 && s.status < 300) {
  989. var e;
  990. try {
  991. e = JSON.parse(s.responseText);
  992. } catch (e) {
  993. Keen.log('Could not JSON parse HTTP response: ' + s.responseText), c && c(s, e);
  994. }
  995. a && e && a(e);
  996. } else Keen.log('HTTP request failed.'), c && c(s, null);
  997. }),
  998. s.open(e, t, o),
  999. i && s.setRequestHeader('Authorization', i),
  1000. r && s.setRequestHeader('Content-Type', 'application/json'),
  1001. n)
  1002. )
  1003. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  1004. var u = r ? JSON.stringify(r) : null;
  1005. s.send(u);
  1006. },
  1007. jsonp: function (e, t, n, r) {
  1008. if (!t)
  1009. return Keen.log(
  1010. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  1011. );
  1012. if (t && e.indexOf('api_key') < 0) {
  1013. var i = e.indexOf('?') > 0 ? '&' : '?';
  1014. e = e + i + 'api_key=' + t;
  1015. }
  1016. for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a';
  1017. var a = !1;
  1018. (window[o] = function (e) {
  1019. (a = !0), n && e && n(e), (window[o] = void 0);
  1020. }),
  1021. (e = e + '&jsonp=' + o);
  1022. var c = document.createElement('script');
  1023. (c.id = 'keen-jsonp'),
  1024. (c.src = e),
  1025. document.getElementsByTagName('head')[0].appendChild(c),
  1026. (c.onreadystatechange = function () {
  1027. a === !1 && 'loaded' === this.readyState && ((a = !0), r && r());
  1028. }),
  1029. (c.onerror = function () {
  1030. a === !1 && ((a = !0), r && r());
  1031. });
  1032. },
  1033. beacon: function (e, t, n, r) {
  1034. if (t && e.indexOf('api_key') < 0) {
  1035. var i = e.indexOf('?') > 0 ? '&' : '?';
  1036. e = e + i + 'api_key=' + t;
  1037. }
  1038. var o = !1,
  1039. a = document.createElement('img');
  1040. (a.onload = function () {
  1041. if (((o = !0), 'naturalHeight' in this)) {
  1042. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror();
  1043. } else if (this.width + this.height === 0) return void this.onerror();
  1044. n &&
  1045. n({
  1046. created: !0,
  1047. });
  1048. }),
  1049. (a.onerror = function () {
  1050. (o = !0), r && r();
  1051. }),
  1052. (a.src = e);
  1053. },
  1054. },
  1055. Events = (Keen.Events = {
  1056. on: function (e, t) {
  1057. this.listeners || (this.listeners = {});
  1058. var n = this.listeners[e] || (this.listeners[e] = []);
  1059. return (
  1060. n.push({
  1061. callback: t,
  1062. }),
  1063. this
  1064. );
  1065. },
  1066. off: function (e, t) {
  1067. if (!e && !t) return (this.listeners = void 0), delete this.listeners, this;
  1068. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1069. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1070. (t && 0 != n.length) || ((this.listeners[e] = void 0), delete this.listeners[e]);
  1071. return this;
  1072. },
  1073. trigger: function (e) {
  1074. if (!this.listeners) return this;
  1075. for (
  1076. var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0;
  1077. r < n.length;
  1078. r++
  1079. )
  1080. n[r].callback.apply(this, t);
  1081. return this;
  1082. },
  1083. });
  1084. _extend(Keen.prototype, Events),
  1085. _extend(Keen, Events),
  1086. (Keen.loaded = !0),
  1087. (Keen.utils = {
  1088. each: _each,
  1089. extend: _extend,
  1090. parseParams: _parse_params,
  1091. }),
  1092. (Keen.ready = function (e) {
  1093. Keen.loaded ? e() : Keen.on('ready', e);
  1094. }),
  1095. (Keen.log = function (e) {
  1096. 'object' == typeof console && console.log('[Keen IO]', e);
  1097. });
  1098. var Plugins = (Keen.Plugins = {});
  1099. (Keen.prototype.addEvent = function () {
  1100. _uploadEvent.apply(this, arguments);
  1101. }),
  1102. (Keen.prototype.addEventSync = function (e, t, n, r) {
  1103. _uploadEvent.apply(this, [e, t, !1, n, r]);
  1104. }),
  1105. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  1106. var o = e,
  1107. a = o.metaKey,
  1108. c = o.target,
  1109. s = !1,
  1110. l = function () {};
  1111. return (
  1112. void 0 === r && (r = 500),
  1113. 'A' === c.nodeName
  1114. ? (l = function () {
  1115. a || s || ((s = !0), (window.location = c.href));
  1116. })
  1117. : 'FORM' === c.nodeName &&
  1118. (l = function () {
  1119. s || ((s = !0), c.submit());
  1120. }),
  1121. i &&
  1122. (l = function () {
  1123. s || ((s = !0), i());
  1124. }),
  1125. _uploadEvent.call(this, t, n, l, l),
  1126. setTimeout(function () {
  1127. l();
  1128. }, r),
  1129. !!a && void 0
  1130. );
  1131. }),
  1132. (Keen.prototype.setGlobalProperties = function (e) {
  1133. if (!this.client)
  1134. return Keen.log(
  1135. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  1136. );
  1137. if (!e || 'function' != typeof e)
  1138. throw new Error('Invalid value for global properties: ' + e);
  1139. this.client.globalProperties = e;
  1140. }),
  1141. (Keen.Base64 = {
  1142. map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1143. encode: function (e) {
  1144. var t,
  1145. n,
  1146. r,
  1147. i,
  1148. o,
  1149. a,
  1150. c,
  1151. s = '',
  1152. l = 0,
  1153. u = this.map;
  1154. for (e = this.utf8.encode(e); l < e.length; )
  1155. (t = e.charCodeAt(l++)),
  1156. (n = e.charCodeAt(l++)),
  1157. (r = e.charCodeAt(l++)),
  1158. (i = t >> 2),
  1159. (o = ((3 & t) << 4) | (n >> 4)),
  1160. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1161. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1162. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c));
  1163. return s;
  1164. },
  1165. decode: function (e) {
  1166. var t,
  1167. n,
  1168. r,
  1169. i,
  1170. o,
  1171. a,
  1172. c,
  1173. s = '',
  1174. l = 0,
  1175. u = this.map,
  1176. f = String.fromCharCode;
  1177. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
  1178. (t = u.indexOf(e.charAt(l++))),
  1179. (n = u.indexOf(e.charAt(l++))),
  1180. (r = u.indexOf(e.charAt(l++))),
  1181. (i = u.indexOf(e.charAt(l++))),
  1182. (o = (t << 2) | (n >> 4)),
  1183. (a = ((15 & n) << 4) | (r >> 2)),
  1184. (c = ((3 & r) << 6) | i),
  1185. (s = s + (f(o) + (64 != r ? f(a) : '')) + (64 != i ? f(c) : ''));
  1186. return this.utf8.decode(s);
  1187. },
  1188. utf8: {
  1189. encode: function (e) {
  1190. for (var t, n = '', r = 0, i = String.fromCharCode; r < e.length; )
  1191. (t = e.charCodeAt(r++)),
  1192. (n +=
  1193. 128 > t
  1194. ? i(t)
  1195. : t > 127 && 2048 > t
  1196. ? i((t >> 6) | 192) + i((63 & t) | 128)
  1197. : i((t >> 12) | 224) + i(((t >> 6) & 63) | 128) + i((63 & t) | 128));
  1198. return n;
  1199. },
  1200. decode: function (e) {
  1201. for (var t, n, r = '', i = 0, o = String.fromCharCode; i < e.length; )
  1202. (n = e.charCodeAt(i)),
  1203. (r +=
  1204. 128 > n
  1205. ? [o(n), i++][0]
  1206. : n > 191 && 224 > n
  1207. ? [o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))), (i += 2)][0]
  1208. : [
  1209. o(
  1210. ((15 & n) << 12) |
  1211. ((63 & (t = e.charCodeAt(i + 1))) << 6) |
  1212. (63 & (c3 = e.charCodeAt(i + 2)))
  1213. ),
  1214. (i += 3),
  1215. ][0]);
  1216. return r;
  1217. },
  1218. },
  1219. }),
  1220. 'object' != typeof JSON && (JSON = {}),
  1221. (function () {
  1222. function f(e) {
  1223. return 10 > e ? '0' + e : e;
  1224. }
  1225. function quote(e) {
  1226. return (
  1227. (escapable.lastIndex = 0),
  1228. escapable.test(e)
  1229. ? '"' +
  1230. e.replace(escapable, function (e) {
  1231. var t = meta[e];
  1232. return 'string' == typeof t
  1233. ? t
  1234. : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4);
  1235. }) +
  1236. '"'
  1237. : '"' + e + '"'
  1238. );
  1239. }
  1240. function str(e, t) {
  1241. var n,
  1242. r,
  1243. i,
  1244. o,
  1245. a,
  1246. c = gap,
  1247. s = t[e];
  1248. switch (
  1249. (s && 'object' == typeof s && 'function' == typeof s.toJSON && (s = s.toJSON(e)),
  1250. 'function' == typeof rep && (s = rep.call(t, e, s)),
  1251. typeof s)
  1252. ) {
  1253. case 'string':
  1254. return quote(s);
  1255. case 'number':
  1256. return isFinite(s) ? String(s) : 'null';
  1257. case 'boolean':
  1258. case 'null':
  1259. return String(s);
  1260. case 'object':
  1261. if (!s) return 'null';
  1262. if (
  1263. ((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(s))
  1264. ) {
  1265. for (o = s.length, n = 0; o > n; n += 1) a[n] = str(n, s) || 'null';
  1266. return (
  1267. (i =
  1268. 0 === a.length
  1269. ? '[]'
  1270. : gap
  1271. ? '[\n' + gap + a.join(',\n' + gap) + '\n' + c + ']'
  1272. : '[' + a.join(',') + ']'),
  1273. (gap = c),
  1274. i
  1275. );
  1276. }
  1277. if (rep && 'object' == typeof rep)
  1278. for (o = rep.length, n = 0; o > n; n += 1)
  1279. 'string' == typeof rep[n] &&
  1280. ((r = rep[n]), (i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i));
  1281. else
  1282. for (r in s)
  1283. Object.prototype.hasOwnProperty.call(s, r) &&
  1284. ((i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i));
  1285. return (
  1286. (i =
  1287. 0 === a.length
  1288. ? '{}'
  1289. : gap
  1290. ? '{\n' + gap + a.join(',\n' + gap) + '\n' + c + '}'
  1291. : '{' + a.join(',') + '}'),
  1292. (gap = c),
  1293. i
  1294. );
  1295. }
  1296. }
  1297. 'function' != typeof Date.prototype.toJSON &&
  1298. ((Date.prototype.toJSON = function () {
  1299. return isFinite(this.valueOf())
  1300. ? this.getUTCFullYear() +
  1301. '-' +
  1302. f(this.getUTCMonth() + 1) +
  1303. '-' +
  1304. f(this.getUTCDate()) +
  1305. 'T' +
  1306. f(this.getUTCHours()) +
  1307. ':' +
  1308. f(this.getUTCMinutes()) +
  1309. ':' +
  1310. f(this.getUTCSeconds()) +
  1311. 'Z'
  1312. : null;
  1313. }),
  1314. (String.prototype.toJSON =
  1315. Number.prototype.toJSON =
  1316. Boolean.prototype.toJSON =
  1317. function () {
  1318. return this.valueOf();
  1319. }));
  1320. var cx =
  1321. /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1322. escapable =
  1323. /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1324. gap,
  1325. indent,
  1326. meta = {
  1327. '\b': '\\b',
  1328. '\t': '\\t',
  1329. '\n': '\\n',
  1330. '\f': '\\f',
  1331. '\r': '\\r',
  1332. '"': '\\"',
  1333. '\\': '\\\\',
  1334. },
  1335. rep;
  1336. 'function' != typeof JSON.stringify &&
  1337. (JSON.stringify = function (e, t, n) {
  1338. var r;
  1339. if (((gap = ''), (indent = ''), 'number' == typeof n))
  1340. for (r = 0; n > r; r += 1) indent += ' ';
  1341. else 'string' == typeof n && (indent = n);
  1342. if (
  1343. ((rep = t),
  1344. t && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length))
  1345. )
  1346. throw new Error('JSON.stringify');
  1347. return str('', {
  1348. '': e,
  1349. });
  1350. }),
  1351. 'function' != typeof JSON.parse &&
  1352. (JSON.parse = function (text, reviver) {
  1353. function walk(e, t) {
  1354. var n,
  1355. r,
  1356. i = e[t];
  1357. if (i && 'object' == typeof i)
  1358. for (n in i)
  1359. Object.prototype.hasOwnProperty.call(i, n) &&
  1360. ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n]);
  1361. return reviver.call(e, t, i);
  1362. }
  1363. var j;
  1364. if (
  1365. ((text = String(text)),
  1366. (cx.lastIndex = 0),
  1367. cx.test(text) &&
  1368. (text = text.replace(cx, function (e) {
  1369. return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4);
  1370. })),
  1371. /^[\],:{}\s]*$/.test(
  1372. text
  1373. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  1374. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
  1375. .replace(/(?:^|:|,)(?:\s*\[)+/g, '')
  1376. ))
  1377. )
  1378. return (
  1379. (j = eval('(' + text + ')')),
  1380. 'function' == typeof reviver
  1381. ? walk(
  1382. {
  1383. '': j,
  1384. },
  1385. ''
  1386. )
  1387. : j
  1388. );
  1389. throw new SyntaxError('JSON.parse');
  1390. });
  1391. })(),
  1392. !(function (e, t, n) {
  1393. 'undefined' != typeof module && module.exports
  1394. ? (module.exports = n())
  1395. : 'function' == typeof define && define.amd
  1396. ? define(n)
  1397. : (t[e] = n());
  1398. })('domready', Keen.utils, function (e) {
  1399. function t(e) {
  1400. for (d = 1; (e = r.shift()); ) e();
  1401. }
  1402. var n,
  1403. r = [],
  1404. i = !1,
  1405. o = document,
  1406. a = o.documentElement,
  1407. c = a.doScroll,
  1408. s = 'DOMContentLoaded',
  1409. l = 'addEventListener',
  1410. u = 'onreadystatechange',
  1411. f = 'readyState',
  1412. p = c ? /^loaded|^c/ : /^loaded|c/,
  1413. d = p.test(o[f]);
  1414. return (
  1415. o[l] &&
  1416. o[l](
  1417. s,
  1418. (n = function () {
  1419. o.removeEventListener(s, n, i), t();
  1420. }),
  1421. i
  1422. ),
  1423. c &&
  1424. o.attachEvent(
  1425. u,
  1426. (n = function () {
  1427. /^c/.test(o[f]) && (o.detachEvent(u, n), t());
  1428. })
  1429. ),
  1430. (e = c
  1431. ? function (t) {
  1432. self != top
  1433. ? d
  1434. ? t()
  1435. : r.push(t)
  1436. : (function () {
  1437. try {
  1438. a.doScroll('left');
  1439. } catch (n) {
  1440. return setTimeout(function () {
  1441. e(t);
  1442. }, 50);
  1443. }
  1444. t();
  1445. })();
  1446. }
  1447. : function (e) {
  1448. d ? e() : r.push(e);
  1449. })
  1450. );
  1451. });
  1452. var loaded = window.Keen,
  1453. cached = window._Keen || {},
  1454. clients,
  1455. ready;
  1456. if (loaded && cached) {
  1457. (clients = cached.clients || {}), (ready = cached.ready || []);
  1458. for (var instance in clients)
  1459. if (clients.hasOwnProperty(instance)) {
  1460. var client = clients[instance];
  1461. for (var method in Keen.prototype)
  1462. Keen.prototype.hasOwnProperty(method) &&
  1463. (loaded.prototype[method] = Keen.prototype[method]);
  1464. if (
  1465. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1466. (loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
  1467. client._config && (client.configure.call(client, client._config), delete client._config),
  1468. client._setGlobalProperties)
  1469. ) {
  1470. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1471. client.setGlobalProperties.apply(client, globals[i]);
  1472. delete client._setGlobalProperties;
  1473. }
  1474. if (client._addEvent) {
  1475. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1476. client.addEvent.apply(client, queue[i]);
  1477. delete client._addEvent;
  1478. }
  1479. var callback = client._on || [];
  1480. if (client._on) {
  1481. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i]);
  1482. client.trigger('ready'), delete client._on;
  1483. }
  1484. }
  1485. for (var i = 0; i < ready.length; i++) {
  1486. var callback = ready[i];
  1487. Keen.on('ready', function () {
  1488. callback();
  1489. });
  1490. }
  1491. }
  1492. return (
  1493. Keen.loaded &&
  1494. setTimeout(function () {
  1495. Keen.utils.domready(function () {
  1496. Keen.trigger('ready');
  1497. });
  1498. }, 0),
  1499. Keen
  1500. );
  1501. });
  1502. !(function () {
  1503. var t = (window.analytics = window.analytics || []);
  1504. if (!t.initialize) {
  1505. if (t.invoked)
  1506. return void (
  1507. window.console &&
  1508. console.error &&
  1509. console.error('Segment snippet included twice.')
  1510. );
  1511. (t.invoked = !0),
  1512. (t.methods = [
  1513. 'trackSubmit',
  1514. 'trackClick',
  1515. 'trackLink',
  1516. 'trackForm',
  1517. 'pageview',
  1518. 'identify',
  1519. 'reset',
  1520. 'group',
  1521. 'track',
  1522. 'ready',
  1523. 'alias',
  1524. 'debug',
  1525. 'page',
  1526. 'once',
  1527. 'off',
  1528. 'on',
  1529. ]),
  1530. (t.factory = function (e) {
  1531. return function () {
  1532. var n = Array.prototype.slice.call(arguments);
  1533. return n.unshift(e), t.push(n), t;
  1534. };
  1535. });
  1536. for (var e = 0; e < t.methods.length; e++) {
  1537. var n = t.methods[e];
  1538. t[n] = t.factory(n);
  1539. }
  1540. (t.load = function (t) {
  1541. var e = document.createElement('script');
  1542. (e.type = 'text/javascript'),
  1543. (e.async = !0),
  1544. (e.src =
  1545. ('https:' === document.location.protocol ? 'https://' : 'http://') +
  1546. 'cdn.segment.com/analytics.js/v1/' +
  1547. t +
  1548. '/analytics.min.js');
  1549. var n = document.getElementsByTagName('script')[0];
  1550. n.parentNode.insertBefore(e, n);
  1551. }),
  1552. (t.SNIPPET_VERSION = '4.0.0');
  1553. }
  1554. })();
  1555. !(function (i, e) {
  1556. 'use strict';
  1557. var s = '',
  1558. r = '?',
  1559. o = 'function',
  1560. a = 'undefined',
  1561. n = 'object',
  1562. t = 'major',
  1563. d = 'model',
  1564. w = 'name',
  1565. l = 'type',
  1566. p = 'vendor',
  1567. m = 'version',
  1568. c = 'architecture',
  1569. u = 'console',
  1570. g = 'mobile',
  1571. f = 'tablet',
  1572. h = 'smarttv',
  1573. b = {
  1574. has: function (i, e) {
  1575. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1;
  1576. },
  1577. lowerize: function (i) {
  1578. return i.toLowerCase();
  1579. },
  1580. },
  1581. y = {
  1582. rgx: function () {
  1583. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1584. var c = m[p],
  1585. u = m[p + 1];
  1586. if (typeof i === a) {
  1587. i = {};
  1588. for (t in u) (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e);
  1589. }
  1590. for (s = r = 0; s < c.length; s++)
  1591. if ((w = c[s].exec(this.getUA()))) {
  1592. for (t = 0; t < u.length; t++)
  1593. (l = w[++r]),
  1594. (d = u[t]),
  1595. typeof d === n && d.length > 0
  1596. ? 2 == d.length
  1597. ? typeof d[1] == o
  1598. ? (i[d[0]] = d[1].call(this, l))
  1599. : (i[d[0]] = d[1])
  1600. : 3 == d.length
  1601. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1602. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1603. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1604. : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e)
  1605. : (i[d] = l ? l : e);
  1606. break;
  1607. }
  1608. if (w) break;
  1609. }
  1610. return i;
  1611. },
  1612. str: function (i, s) {
  1613. for (var o in s)
  1614. if (typeof s[o] === n && s[o].length > 0) {
  1615. for (var a = 0; a < s[o].length; a++) if (b.has(s[o][a], i)) return o === r ? e : o;
  1616. } else if (b.has(s[o], i)) return o === r ? e : o;
  1617. return i;
  1618. },
  1619. },
  1620. v = {
  1621. browser: {
  1622. oldsafari: {
  1623. major: {
  1624. 1: ['/8', '/1', '/3'],
  1625. 2: '/4',
  1626. '?': '/',
  1627. },
  1628. version: {
  1629. '1.0': '/8',
  1630. 1.2: '/1',
  1631. 1.3: '/3',
  1632. '2.0': '/412',
  1633. '2.0.2': '/416',
  1634. '2.0.3': '/417',
  1635. '2.0.4': '/419',
  1636. '?': '/',
  1637. },
  1638. },
  1639. },
  1640. device: {
  1641. sprint: {
  1642. model: {
  1643. 'Evo Shift 4G': '7373KT',
  1644. },
  1645. vendor: {
  1646. HTC: 'APA',
  1647. Sprint: 'Sprint',
  1648. },
  1649. },
  1650. },
  1651. os: {
  1652. windows: {
  1653. version: {
  1654. ME: '4.90',
  1655. 'NT 3.11': 'NT3.51',
  1656. 'NT 4.0': 'NT4.0',
  1657. 2e3: 'NT 5.0',
  1658. XP: ['NT 5.1', 'NT 5.2'],
  1659. Vista: 'NT 6.0',
  1660. 7: 'NT 6.1',
  1661. 8: 'NT 6.2',
  1662. 8.1: 'NT 6.3',
  1663. RT: 'ARM',
  1664. },
  1665. },
  1666. },
  1667. },
  1668. k = {
  1669. browser: [
  1670. [
  1671. /(opera\smini)\/((\d+)?[\w\.-]+)/i,
  1672. /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,
  1673. /(opera).+version\/((\d+)?[\w\.]+)/i,
  1674. /(opera)[\/\s]+((\d+)?[\w\.]+)/i,
  1675. ],
  1676. [w, m, t],
  1677. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1678. [[w, 'Opera'], m, t],
  1679. [
  1680. /(kindle)\/((\d+)?[\w\.]+)/i,
  1681. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1682. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1683. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1684. /(rekonq)((?:\/)[\w\.]+)*/i,
  1685. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i,
  1686. ],
  1687. [w, m, t],
  1688. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1689. [[w, 'IE'], m, t],
  1690. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1691. [[w, 'Yandex'], m, t],
  1692. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1693. [[w, /_/g, ' '], m, t],
  1694. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1695. [w, m, t],
  1696. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1697. [[w, 'Dolphin'], m, t],
  1698. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1699. [[w, 'Chrome'], m, t],
  1700. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1701. [m, t, [w, 'Mobile Safari']],
  1702. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1703. [m, t, w],
  1704. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1705. [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]],
  1706. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1707. [w, m, t],
  1708. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1709. [[w, 'Netscape'], m, t],
  1710. [
  1711. /(swiftfox)/i,
  1712. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1713. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1714. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1715. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1716. /(links)\s\(((\d+)?[\w\.]+)/i,
  1717. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1718. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1719. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i,
  1720. ],
  1721. [w, m, t],
  1722. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1723. [w, m, t],
  1724. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1725. [w, m],
  1726. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1727. [w, m, t],
  1728. [
  1729. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1730. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1731. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1732. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i,
  1733. ],
  1734. [w, m, t],
  1735. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1736. [w, m, t],
  1737. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1738. [[w, 'Flip Player'], m, t],
  1739. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1740. [w],
  1741. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1742. [w, m, t],
  1743. [
  1744. /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i,
  1745. /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
  1746. /(lavf)((\d+)[\d\.]+)/i,
  1747. ],
  1748. [w, m, t],
  1749. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1750. [[w, /_/g, ' '], m, t],
  1751. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1752. [w, m],
  1753. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1754. [w, m, t],
  1755. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1756. [w],
  1757. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1758. [w, m, t],
  1759. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1760. [w, m, t],
  1761. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1762. [w, m, t],
  1763. [
  1764. /(winamp)3 version ((\d+)[\w\.-]+)/i,
  1765. /(winamp)\s((\d+)[\w\.-]+)/i,
  1766. /(winamp)mpeg\/((\d+)[\w\.-]+)/i,
  1767. ],
  1768. [w, m, t],
  1769. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1770. [w],
  1771. [
  1772. /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i,
  1773. ],
  1774. [w, m, t],
  1775. [/(smp)((\d+)[\d\.]+)/i],
  1776. [w, m, t],
  1777. [
  1778. /(vlc) media player - version ((\d+)[\w\.]+)/i,
  1779. /(vlc)\/((\d+)[\w\.-]+)/i,
  1780. /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i,
  1781. /(foobar2000)\/((\d+)[\d\.]+)/i,
  1782. /(itunes)\/((\d+)[\d\.]+)/i,
  1783. ],
  1784. [w, m, t],
  1785. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1786. [[w, /-/g, ' '], m, t],
  1787. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1788. [m, t, [w, 'Windows']],
  1789. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1790. [w, m, t],
  1791. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1792. [[w, 'rad.io'], m, t],
  1793. ],
  1794. cpu: [
  1795. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1796. [[c, 'amd64']],
  1797. [/(ia32(?=;))/i],
  1798. [[c, b.lowerize]],
  1799. [/((?:i[346]|x)86)[;\)]/i],
  1800. [[c, 'ia32']],
  1801. [/windows\s(ce|mobile);\sppc;/i],
  1802. [[c, 'arm']],
  1803. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1804. [[c, /ower/, '', b.lowerize]],
  1805. [/(sun4\w)[;\)]/i],
  1806. [[c, 'sparc']],
  1807. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1808. [c, b.lowerize],
  1809. ],
  1810. device: [
  1811. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1812. [d, p, [l, f]],
  1813. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1814. [d, [p, 'Apple'], [l, f]],
  1815. [/(apple\s{0,1}tv)/i],
  1816. [
  1817. [d, 'Apple TV'],
  1818. [p, 'Apple'],
  1819. ],
  1820. [
  1821. /(hp).+(touchpad)/i,
  1822. /(kindle)\/([\w\.]+)/i,
  1823. /\s(nook)[\w\s]+build\/(\w+)/i,
  1824. /(dell)\s(strea[kpr\s\d]*[\dko])/i,
  1825. ],
  1826. [p, d, [l, f]],
  1827. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1828. [d, p, [l, g]],
  1829. [/\((ip[honed|\s\w*]+);/i],
  1830. [d, [p, 'Apple'], [l, g]],
  1831. [
  1832. /(blackberry)[\s-]?(\w+)/i,
  1833. /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,
  1834. /(hp)\s([\w\s]+\w)/i,
  1835. /(asus)-?(\w+)/i,
  1836. ],
  1837. [p, d, [l, g]],
  1838. [/\((bb10);\s(\w+)/i],
  1839. [[p, 'BlackBerry'], d, [l, g]],
  1840. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1841. [[p, 'Asus'], d, [l, f]],
  1842. [/(sony)\s(tablet\s[ps])/i],
  1843. [p, d, [l, f]],
  1844. [/(nintendo)\s([wids3u]+)/i],
  1845. [p, d, [l, u]],
  1846. [/((playstation)\s[3portablevi]+)/i],
  1847. [[p, 'Sony'], d, [l, u]],
  1848. [/(sprint\s(\w+))/i],
  1849. [
  1850. [p, y.str, v.device.sprint.vendor],
  1851. [d, y.str, v.device.sprint.model],
  1852. [l, g],
  1853. ],
  1854. [
  1855. /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,
  1856. /(zte)-(\w+)*/i,
  1857. /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i,
  1858. ],
  1859. [p, [d, /_/g, ' '], [l, g]],
  1860. [
  1861. /\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
  1862. /(mot)[\s-]?(\w+)*/i,
  1863. ],
  1864. [[p, 'Motorola'], d, [l, g]],
  1865. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1866. [[p, 'Motorola'], d, [l, f]],
  1867. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1868. [[p, 'Samsung'], d, [l, f]],
  1869. [
  1870. /((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,
  1871. /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
  1872. /sec-((sgh\w+))/i,
  1873. ],
  1874. [[p, 'Samsung'], d, [l, g]],
  1875. [/(sie)-(\w+)*/i],
  1876. [[p, 'Siemens'], d, [l, g]],
  1877. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1878. [[p, 'Nokia'], d, [l, g]],
  1879. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1880. [[p, 'Acer'], d, [l, f]],
  1881. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1882. [[p, 'LG'], d, [l, f]],
  1883. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1884. [[p, 'LG'], d, [l, g]],
  1885. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1886. [[p, 'Lenovo'], d, [l, f]],
  1887. [/(lg) netcast\.tv/i],
  1888. [p, [l, h]],
  1889. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1890. [l, p, d],
  1891. ],
  1892. engine: [
  1893. [
  1894. /(presto)\/([\w\.]+)/i,
  1895. /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,
  1896. /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,
  1897. /(icab)[\/\s]([23]\.[\d\.]+)/i,
  1898. ],
  1899. [w, m],
  1900. [/rv\:([\w\.]+).*(gecko)/i],
  1901. [m, w],
  1902. ],
  1903. os: [
  1904. [/microsoft\s(windows)\s(vista|xp)/i],
  1905. [w, m],
  1906. [
  1907. /(windows)\snt\s6\.2;\s(arm)/i,
  1908. /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i,
  1909. ],
  1910. [w, [m, y.str, v.os.windows.version]],
  1911. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1912. [
  1913. [w, 'Windows'],
  1914. [m, y.str, v.os.windows.version],
  1915. ],
  1916. [/\((bb)(10);/i],
  1917. [[w, 'BlackBerry'], m],
  1918. [
  1919. /(blackberry)\w*\/?([\w\.]+)*/i,
  1920. /(tizen)\/([\w\.]+)/i,
  1921. /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i,
  1922. ],
  1923. [w, m],
  1924. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1925. [[w, 'Symbian'], m],
  1926. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1927. [[w, 'Firefox OS'], m],
  1928. [
  1929. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  1930. /(mint)[\/\s\(]?(\w+)*/i,
  1931. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  1932. /(hurd|linux)\s?([\w\.]+)*/i,
  1933. /(gnu)\s?([\w\.]+)*/i,
  1934. ],
  1935. [w, m],
  1936. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1937. [[w, 'Chromium OS'], m],
  1938. [/(sunos)\s?([\w\.]+\d)*/i],
  1939. [[w, 'Solaris'], m],
  1940. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1941. [w, m],
  1942. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1943. [
  1944. [w, 'iOS'],
  1945. [m, /_/g, '.'],
  1946. ],
  1947. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1948. [w, [m, /_/g, '.']],
  1949. [
  1950. /(haiku)\s(\w+)/i,
  1951. /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,
  1952. /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
  1953. /(unix)\s?([\w\.]+)*/i,
  1954. ],
  1955. [w, m],
  1956. ],
  1957. },
  1958. x = function (e) {
  1959. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1960. return this instanceof x
  1961. ? ((this.getBrowser = function () {
  1962. return y.rgx.apply(this, k.browser);
  1963. }),
  1964. (this.getCPU = function () {
  1965. return y.rgx.apply(this, k.cpu);
  1966. }),
  1967. (this.getDevice = function () {
  1968. return y.rgx.apply(this, k.device);
  1969. }),
  1970. (this.getEngine = function () {
  1971. return y.rgx.apply(this, k.engine);
  1972. }),
  1973. (this.getOS = function () {
  1974. return y.rgx.apply(this, k.os);
  1975. }),
  1976. (this.getResult = function () {
  1977. return {
  1978. ua: this.getUA(),
  1979. browser: this.getBrowser(),
  1980. engine: this.getEngine(),
  1981. os: this.getOS(),
  1982. device: this.getDevice(),
  1983. cpu: this.getCPU(),
  1984. };
  1985. }),
  1986. (this.getUA = function () {
  1987. return r;
  1988. }),
  1989. (this.setUA = function (i) {
  1990. return (r = i), this;
  1991. }),
  1992. void this.setUA(r))
  1993. : new x(e).getResult();
  1994. };
  1995. if (typeof exports !== a)
  1996. typeof module !== a && module.exports && (exports = module.exports = x), (exports.UAParser = x);
  1997. else if (
  1998. ((i.UAParser = x),
  1999. typeof define === o &&
  2000. define.amd &&
  2001. define(function () {
  2002. return x;
  2003. }),
  2004. typeof i.jQuery !== a)
  2005. ) {
  2006. var A = i.jQuery,
  2007. _ = new x();
  2008. (A.ua = _.getResult()),
  2009. (A.ua.get = function () {
  2010. return _.getUA();
  2011. }),
  2012. (A.ua.set = function (i) {
  2013. _.setUA(i);
  2014. var e = _.getResult();
  2015. for (var s in e) A.ua[s] = e[s];
  2016. });
  2017. }
  2018. })(this);
  2019. window.Modernizr = (function (n, e, t) {
  2020. function o(n) {
  2021. d.cssText = n;
  2022. }
  2023. function r(n, e) {
  2024. return typeof n === e;
  2025. }
  2026. var i,
  2027. c,
  2028. u,
  2029. a = '2.8.2',
  2030. f = {},
  2031. s = e.documentElement,
  2032. l = 'modernizr',
  2033. p = e.createElement(l),
  2034. d = p.style,
  2035. y = ({}.toString, {}),
  2036. w = [],
  2037. b = w.slice,
  2038. v = {}.hasOwnProperty;
  2039. (u =
  2040. r(v, 'undefined') || r(v.call, 'undefined')
  2041. ? function (n, e) {
  2042. return e in n && r(n.constructor.prototype[e], 'undefined');
  2043. }
  2044. : function (n, e) {
  2045. return v.call(n, e);
  2046. }),
  2047. Function.prototype.bind ||
  2048. (Function.prototype.bind = function (n) {
  2049. var e = this;
  2050. if ('function' != typeof e) throw new TypeError();
  2051. var t = b.call(arguments, 1),
  2052. o = function () {
  2053. if (this instanceof o) {
  2054. var r = function () {};
  2055. r.prototype = e.prototype;
  2056. var i = new r(),
  2057. c = e.apply(i, t.concat(b.call(arguments)));
  2058. return Object(c) === c ? c : i;
  2059. }
  2060. return e.apply(n, t.concat(b.call(arguments)));
  2061. };
  2062. return o;
  2063. }),
  2064. (y.webgl = function () {
  2065. return !!n.WebGLRenderingContext;
  2066. });
  2067. for (var h in y)
  2068. u(y, h) && ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? '' : 'no-') + c));
  2069. return (
  2070. (f.addTest = function (n, e) {
  2071. if ('object' == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o]);
  2072. else {
  2073. if (((n = n.toLowerCase()), f[n] !== t)) return f;
  2074. (e = 'function' == typeof e ? e() : e),
  2075. 'undefined' != typeof enableClasses &&
  2076. enableClasses &&
  2077. (s.className += ' ' + (e ? '' : 'no-') + n),
  2078. (f[n] = e);
  2079. }
  2080. return f;
  2081. }),
  2082. o(''),
  2083. (p = i = null),
  2084. (f._version = a),
  2085. f
  2086. );
  2087. })(this, this.document);
  2088. !(function (e, t, a) {
  2089. 'use strict';
  2090. function n(t, h, m) {
  2091. function H(a) {
  2092. var n = 0,
  2093. i = Ee.length;
  2094. if (
  2095. ((Ce.old = e.extend({}, Ce)),
  2096. (Ie = we ? 0 : be[ge.horizontal ? 'width' : 'height']()),
  2097. (ke = Be[ge.horizontal ? 'width' : 'height']()),
  2098. (ze = we ? t : Pe[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2099. (Ee.length = 0),
  2100. (Ce.start = 0),
  2101. (Ce.end = q(ze - Ie, 0)),
  2102. Re)
  2103. ) {
  2104. (n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0);
  2105. var r,
  2106. s = c(Pe, ge.horizontal ? 'paddingLeft' : 'paddingTop'),
  2107. o = c(Pe, ge.horizontal ? 'paddingRight' : 'paddingBottom'),
  2108. l = 'border-box' === e(qe).css('boxSizing'),
  2109. u = 'none' !== qe.css('float'),
  2110. f = 0,
  2111. v = qe.length - 1;
  2112. (ze = 0),
  2113. qe.each(function (t, a) {
  2114. var n = e(a),
  2115. i = a.getBoundingClientRect(),
  2116. l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top),
  2117. d = c(n, ge.horizontal ? 'marginLeft' : 'marginTop'),
  2118. p = c(n, ge.horizontal ? 'marginRight' : 'marginBottom'),
  2119. h = l + d + p,
  2120. m = !d || !p,
  2121. g = {};
  2122. (g.el = a),
  2123. (g.size = m ? l : h),
  2124. (g.half = g.size / 2),
  2125. (g.start = ze + (m ? d : 0)),
  2126. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  2127. (g.end = g.start - Ie + g.size),
  2128. t || (ze += s),
  2129. (ze += h),
  2130. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  2131. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  2132. Ne.push(g),
  2133. (r = g);
  2134. }),
  2135. (Pe[0].style[ge.horizontal ? 'width' : 'height'] = (l ? ze : ze - s - o) + 'px'),
  2136. (ze -= f),
  2137. Ne.length
  2138. ? ((Ce.start = Ne[0][Me ? 'center' : 'start']),
  2139. (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start))
  2140. : (Ce.start = Ce.end = 0);
  2141. }
  2142. if (
  2143. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  2144. Q(),
  2145. Se.length &&
  2146. ke > 0 &&
  2147. (ge.dynamicHandle
  2148. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)),
  2149. (Te = d(Te, ge.minHandleSize, ke)),
  2150. (Se[0].style[ge.horizontal ? 'width' : 'height'] = Te + 'px'))
  2151. : (Te = Se[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2152. (xe.end = ke - Te),
  2153. it || j()),
  2154. !we && Ie > 0)
  2155. ) {
  2156. var p = Ce.start,
  2157. h = '';
  2158. if (Re)
  2159. e.each(Ne, function (e, t) {
  2160. Me
  2161. ? Ee.push(t.center)
  2162. : t.start + t.size > p &&
  2163. p <= Ce.end &&
  2164. ((p = t.start),
  2165. Ee.push(p),
  2166. (p += Ie),
  2167. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end));
  2168. });
  2169. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie);
  2170. if (De[0] && i !== Ee.length) {
  2171. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m);
  2172. (Ae = De.html(h).children()), Ae.eq(Oe.activePage).addClass(ge.activeClass);
  2173. }
  2174. }
  2175. if (((Oe.slideeSize = ze), (Oe.frameSize = Ie), (Oe.sbSize = ke), (Oe.handleSize = Te), Re)) {
  2176. a && null != ge.startAt && (W(ge.startAt), ye[Le ? 'toCenter' : 'toStart'](ge.startAt));
  2177. var g = Ne[Oe.activeItem];
  2178. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end));
  2179. } else a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  2180. pe('load');
  2181. }
  2182. function X(e, t, a) {
  2183. if (Re && at.released && !a) {
  2184. var n = $(e),
  2185. i = e > Ce.start && e < Ce.end;
  2186. Le
  2187. ? (i && (e = Ne[n.centerItem].center), Me && ge.activateMiddle && W(n.centerItem))
  2188. : i && (e = Ne[n.firstItem].start);
  2189. }
  2190. at.init && at.slidee && ge.elasticBounds
  2191. ? e > Ce.end
  2192. ? (e = Ce.end + (e - Ce.end) / 6)
  2193. : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)
  2194. : (e = d(e, Ce.start, Ce.end)),
  2195. (et.start = +new Date()),
  2196. (et.time = 0),
  2197. (et.from = Ce.cur),
  2198. (et.to = e),
  2199. (et.delta = e - Ce.cur),
  2200. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  2201. (et.immediate = !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  2202. (at.tweese = 0),
  2203. e !== Ce.dest && ((Ce.dest = e), pe('change'), it || Y()),
  2204. K(),
  2205. Q(),
  2206. Z(),
  2207. F();
  2208. }
  2209. function Y() {
  2210. if (ye.initialized) {
  2211. if (!it) return (it = w(Y)), void (at.released && pe('moveStart'));
  2212. et.immediate
  2213. ? (Ce.cur = et.to)
  2214. : et.tweesing
  2215. ? ((et.tweeseDelta = et.to - Ce.cur),
  2216. x(et.tweeseDelta) < 0.1
  2217. ? (Ce.cur = et.to)
  2218. : (Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)))
  2219. : ((et.time = N(+new Date() - et.start, ge.speed)),
  2220. (Ce.cur =
  2221. et.from +
  2222. et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed))),
  2223. et.to === Ce.cur ? ((Ce.cur = et.to), (at.tweese = it = 0)) : (it = w(Y)),
  2224. pe('move'),
  2225. we ||
  2226. (f
  2227. ? (Pe[0].style[f] =
  2228. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + -Ce.cur + 'px)')
  2229. : (Pe[0].style[ge.horizontal ? 'left' : 'top'] = -E(Ce.cur) + 'px')),
  2230. !it && at.released && pe('moveEnd'),
  2231. j();
  2232. }
  2233. }
  2234. function j() {
  2235. Se.length &&
  2236. ((xe.cur =
  2237. Ce.start === Ce.end
  2238. ? 0
  2239. : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start)) *
  2240. xe.end),
  2241. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  2242. _e.hPos !== xe.cur &&
  2243. ((_e.hPos = xe.cur),
  2244. f
  2245. ? (Se[0].style[f] =
  2246. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + xe.cur + 'px)')
  2247. : (Se[0].style[ge.horizontal ? 'left' : 'top'] = xe.cur + 'px')));
  2248. }
  2249. function F() {
  2250. Ae[0] &&
  2251. _e.page !== Oe.activePage &&
  2252. ((_e.page = Oe.activePage),
  2253. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  2254. pe('activePage', _e.page));
  2255. }
  2256. function M() {
  2257. (tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  2258. (ot = at.init ? w(M) : 0),
  2259. (tt.now = +new Date()),
  2260. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  2261. X(at.init ? tt.pos : E(tt.pos)),
  2262. at.init || Ce.cur !== Ce.dest || pe('moveEnd'),
  2263. (tt.lastTime = tt.now);
  2264. }
  2265. function L(e, t, n) {
  2266. if (('boolean' === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n);
  2267. else {
  2268. if (Le && 'center' !== e) return;
  2269. var r = ye.getPos(t);
  2270. r && X(r[e], n, !Le);
  2271. }
  2272. }
  2273. function R(e) {
  2274. return null != e ? (l(e) ? (e >= 0 && e < Ne.length ? e : -1) : qe.index(e)) : -1;
  2275. }
  2276. function U(e) {
  2277. return R(l(e) && 0 > e ? e + Ne.length : e);
  2278. }
  2279. function W(e, t) {
  2280. var a = R(e);
  2281. return (
  2282. !(!Re || 0 > a) &&
  2283. ((_e.active !== a || t) &&
  2284. (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2285. qe.eq(a).addClass(ge.activeClass),
  2286. (_e.active = Oe.activeItem = a),
  2287. Z(),
  2288. pe('active', a)),
  2289. a)
  2290. );
  2291. }
  2292. function $(e) {
  2293. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  2294. var t = {},
  2295. a = Me ? 0 : Ie / 2;
  2296. if (!we)
  2297. for (var n = 0, i = Ee.length; i > n; n++) {
  2298. if (e >= Ce.end || n === Ee.length - 1) {
  2299. t.activePage = Ee.length - 1;
  2300. break;
  2301. }
  2302. if (e <= Ee[n] + a) {
  2303. t.activePage = n;
  2304. break;
  2305. }
  2306. }
  2307. if (Re) {
  2308. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2309. if (
  2310. (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2311. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2312. c === u - 1 || e <= Ne[c].end + Ne[c].half)
  2313. ) {
  2314. s = c;
  2315. break;
  2316. }
  2317. (t.firstItem = l(r) ? r : 0),
  2318. (t.centerItem = l(o) ? o : t.firstItem),
  2319. (t.lastItem = l(s) ? s : t.centerItem);
  2320. }
  2321. return t;
  2322. }
  2323. function Q(t) {
  2324. e.extend(Oe, $(t));
  2325. }
  2326. function Z() {
  2327. var e = Ce.dest <= Ce.start,
  2328. t = Ce.dest >= Ce.end,
  2329. a = (e ? 1 : 0) | (t ? 2 : 0);
  2330. if (
  2331. (_e.slideePosState !== a &&
  2332. ((_e.slideePosState = a),
  2333. Je.is('button,input') && Je.prop('disabled', e),
  2334. Ke.is('button,input') && Ke.prop('disabled', t),
  2335. Je.add(Qe)[e ? 'addClass' : 'removeClass'](ge.disabledClass),
  2336. Ke.add($e)[t ? 'addClass' : 'removeClass'](ge.disabledClass)),
  2337. _e.fwdbwdState !== a &&
  2338. at.released &&
  2339. ((_e.fwdbwdState = a),
  2340. Qe.is('button,input') && Qe.prop('disabled', e),
  2341. $e.is('button,input') && $e.prop('disabled', t)),
  2342. Re && null != Oe.activeItem)
  2343. ) {
  2344. var n = 0 === Oe.activeItem,
  2345. i = Oe.activeItem >= Ne.length - 1,
  2346. r = (n ? 1 : 0) | (i ? 2 : 0);
  2347. _e.itemsButtonState !== r &&
  2348. ((_e.itemsButtonState = r),
  2349. Ze.is('button,input') && Ze.prop('disabled', n),
  2350. Ge.is('button,input') && Ge.prop('disabled', i),
  2351. Ze[n ? 'addClass' : 'removeClass'](ge.disabledClass),
  2352. Ge[i ? 'addClass' : 'removeClass'](ge.disabledClass));
  2353. }
  2354. }
  2355. function G(e, t, a) {
  2356. if (
  2357. ((e = U(e)),
  2358. (t = U(t)),
  2359. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1))
  2360. ) {
  2361. qe.eq(e)[a ? 'insertAfter' : 'insertBefore'](Ne[t].el);
  2362. var n = t > e ? e : a ? t : t - 1,
  2363. i = e > t ? e : a ? t + 1 : t,
  2364. r = e > t;
  2365. null != Oe.activeItem &&
  2366. (e === Oe.activeItem
  2367. ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1)
  2368. : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  2369. H();
  2370. }
  2371. }
  2372. function J(e, t) {
  2373. for (var a = 0, n = Ve[e].length; n > a; a++) if (Ve[e][a] === t) return a;
  2374. return -1;
  2375. }
  2376. function K() {
  2377. at.released && !ye.isPaused && ye.resume();
  2378. }
  2379. function V(e) {
  2380. return E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start;
  2381. }
  2382. function _() {
  2383. (at.history[0] = at.history[1]),
  2384. (at.history[1] = at.history[2]),
  2385. (at.history[2] = at.history[3]),
  2386. (at.history[3] = at.delta);
  2387. }
  2388. function ee(e) {
  2389. (at.released = 0), (at.source = e), (at.slidee = 'slidee' === e);
  2390. }
  2391. function te(t) {
  2392. var a = 'touchstart' === t.type,
  2393. n = t.data.source,
  2394. i = 'slidee' === n;
  2395. at.init ||
  2396. (!a && ie(t.target)) ||
  2397. (('handle' !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2398. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2399. (a || r(t),
  2400. ee(n),
  2401. (at.init = 0),
  2402. (at.$source = e(t.target)),
  2403. (at.touch = a),
  2404. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2405. (at.initX = at.pointer.pageX),
  2406. (at.initY = at.pointer.pageY),
  2407. (at.initPos = i ? Ce.cur : xe.cur),
  2408. (at.start = +new Date()),
  2409. (at.time = 0),
  2410. (at.path = 0),
  2411. (at.delta = 0),
  2412. (at.locked = 0),
  2413. (at.history = [0, 0, 0, 0]),
  2414. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2415. b.on(a ? z : I, ae),
  2416. ye.pause(1),
  2417. (i ? Pe : Se).addClass(ge.draggedClass),
  2418. pe('moveStart'),
  2419. i && (rt = setInterval(_, 10))));
  2420. }
  2421. function ae(e) {
  2422. if (
  2423. ((at.released = 'mouseup' === e.type || 'touchend' === e.type),
  2424. (at.pointer = at.touch
  2425. ? e.originalEvent[at.released ? 'changedTouches' : 'touches'][0]
  2426. : e),
  2427. (at.pathX = at.pointer.pageX - at.initX),
  2428. (at.pathY = at.pointer.pageY - at.initY),
  2429. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2430. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2431. at.released || !(at.path < 1))
  2432. ) {
  2433. if (!at.init) {
  2434. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY))) return ne();
  2435. at.init = 1;
  2436. }
  2437. r(e),
  2438. !at.locked &&
  2439. at.path > at.pathToLock &&
  2440. at.slidee &&
  2441. ((at.locked = 1), at.$source.on(B, s)),
  2442. at.released &&
  2443. (ne(),
  2444. ge.releaseSwing &&
  2445. at.slidee &&
  2446. ((at.swing = ((at.delta - at.history[0]) / 40) * 300),
  2447. (at.delta += at.swing),
  2448. (at.tweese = x(at.swing) > 10))),
  2449. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta));
  2450. }
  2451. }
  2452. function ne() {
  2453. clearInterval(rt),
  2454. (at.released = !0),
  2455. b.off(at.touch ? z : I, ae),
  2456. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2457. setTimeout(function () {
  2458. at.$source.off(B, s);
  2459. }),
  2460. Ce.cur === Ce.dest && at.init && pe('moveEnd'),
  2461. ye.resume(1),
  2462. (at.init = 0);
  2463. }
  2464. function ie(t) {
  2465. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive);
  2466. }
  2467. function re() {
  2468. ye.stop(), b.off('mouseup', re);
  2469. }
  2470. function se(e) {
  2471. switch ((r(e), this)) {
  2472. case $e[0]:
  2473. case Qe[0]:
  2474. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on('mouseup', re);
  2475. break;
  2476. case Ze[0]:
  2477. ye.prev();
  2478. break;
  2479. case Ge[0]:
  2480. ye.next();
  2481. break;
  2482. case Je[0]:
  2483. ye.prevPage();
  2484. break;
  2485. case Ke[0]:
  2486. ye.nextPage();
  2487. }
  2488. }
  2489. function oe(e) {
  2490. return (
  2491. (nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2492. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2493. Re
  2494. ? ((p = +new Date()),
  2495. nt.last < p - nt.resetTime && (nt.delta = 0),
  2496. (nt.last = p),
  2497. (nt.delta += nt.curDelta),
  2498. x(nt.delta) < 1
  2499. ? (nt.finalDelta = 0)
  2500. : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2501. nt.finalDelta)
  2502. : nt.curDelta
  2503. );
  2504. }
  2505. function le(e) {
  2506. e.originalEvent[g] = ye;
  2507. var t = +new Date();
  2508. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window) return void (O = t);
  2509. if (ge.scrollBy && Ce.start !== Ce.end) {
  2510. var a = oe(e.originalEvent);
  2511. (ge.scrollTrap || (a > 0 && Ce.dest < Ce.end) || (0 > a && Ce.dest > Ce.start)) && r(e, 1),
  2512. ye.slideBy(ge.scrollBy * a);
  2513. }
  2514. }
  2515. function ce(e) {
  2516. ge.clickBar &&
  2517. e.target === Be[0] &&
  2518. (r(e),
  2519. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)));
  2520. }
  2521. function de(e) {
  2522. if (ge.keyboardNavBy)
  2523. switch (e.which) {
  2524. case ge.horizontal ? 37 : 38:
  2525. r(e), ye['pages' === ge.keyboardNavBy ? 'prevPage' : 'prev']();
  2526. break;
  2527. case ge.horizontal ? 39 : 40:
  2528. r(e), ye['pages' === ge.keyboardNavBy ? 'nextPage' : 'next']();
  2529. }
  2530. }
  2531. function ue(e) {
  2532. return ie(this)
  2533. ? void (e.originalEvent[g + 'ignore'] = !0)
  2534. : void (this.parentNode !== Pe[0] || e.originalEvent[g + 'ignore'] || ye.activate(this));
  2535. }
  2536. function fe() {
  2537. this.parentNode === De[0] && ye.activatePage(Ae.index(this));
  2538. }
  2539. function ve(e) {
  2540. ge.pauseOnHover && ye['mouseenter' === e.type ? 'pause' : 'resume'](2);
  2541. }
  2542. function pe(e, t) {
  2543. if (Ve[e]) {
  2544. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++) T.push(Ve[e][he]);
  2545. for (he = 0; me > he; he++) T[he].call(ye, e, t);
  2546. }
  2547. }
  2548. var he,
  2549. me,
  2550. ge = e.extend({}, n.defaults, h),
  2551. ye = this,
  2552. we = l(t),
  2553. be = e(t),
  2554. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2555. Ie = 0,
  2556. ze = 0,
  2557. Ce = {
  2558. start: 0,
  2559. center: 0,
  2560. end: 0,
  2561. cur: 0,
  2562. dest: 0,
  2563. },
  2564. Be = e(ge.scrollBar).eq(0),
  2565. Se = Be.children().eq(0),
  2566. ke = 0,
  2567. Te = 0,
  2568. xe = {
  2569. start: 0,
  2570. end: 0,
  2571. cur: 0,
  2572. },
  2573. De = e(ge.pagesBar),
  2574. Ae = 0,
  2575. Ee = [],
  2576. qe = 0,
  2577. Ne = [],
  2578. Oe = {
  2579. firstItem: 0,
  2580. lastItem: 0,
  2581. centerItem: 0,
  2582. activeItem: null,
  2583. activePage: 0,
  2584. },
  2585. He = new u(be[0]),
  2586. Xe = new u(Pe[0]),
  2587. Ye = new u(Be[0]),
  2588. je = new u(Se[0]),
  2589. Fe = 'basic' === ge.itemNav,
  2590. Me = 'forceCentered' === ge.itemNav,
  2591. Le = 'centered' === ge.itemNav || Me,
  2592. Re = !we && (Fe || Le || Me),
  2593. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2594. We = ge.dragSource ? e(ge.dragSource) : be,
  2595. $e = e(ge.forward),
  2596. Qe = e(ge.backward),
  2597. Ze = e(ge.prev),
  2598. Ge = e(ge.next),
  2599. Je = e(ge.prevPage),
  2600. Ke = e(ge.nextPage),
  2601. Ve = {},
  2602. _e = {},
  2603. et = {},
  2604. tt = {},
  2605. at = {
  2606. released: 1,
  2607. },
  2608. nt = {
  2609. last: 0,
  2610. delta: 0,
  2611. resetTime: 200,
  2612. },
  2613. it = 0,
  2614. rt = 0,
  2615. st = 0,
  2616. ot = 0;
  2617. we || (t = be[0]),
  2618. (ye.initialized = 0),
  2619. (ye.frame = t),
  2620. (ye.slidee = Pe[0]),
  2621. (ye.pos = Ce),
  2622. (ye.rel = Oe),
  2623. (ye.items = Ne),
  2624. (ye.pages = Ee),
  2625. (ye.isPaused = 0),
  2626. (ye.options = ge),
  2627. (ye.dragging = at),
  2628. (ye.reload = function () {
  2629. H();
  2630. }),
  2631. (ye.getPos = function (e) {
  2632. if (Re) {
  2633. var t = R(e);
  2634. return -1 !== t && Ne[t];
  2635. }
  2636. var a = Pe.find(e).eq(0);
  2637. if (a[0]) {
  2638. var n = ge.horizontal
  2639. ? a.offset().left - Pe.offset().left
  2640. : a.offset().top - Pe.offset().top,
  2641. i = a[ge.horizontal ? 'outerWidth' : 'outerHeight']();
  2642. return {
  2643. start: n,
  2644. center: n - Ie / 2 + i / 2,
  2645. end: n - Ie + i,
  2646. size: i,
  2647. };
  2648. }
  2649. return !1;
  2650. }),
  2651. (ye.moveBy = function (e) {
  2652. (tt.speed = e),
  2653. !at.init &&
  2654. tt.speed &&
  2655. Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) &&
  2656. ((tt.lastTime = +new Date()),
  2657. (tt.startPos = Ce.cur),
  2658. ee('button'),
  2659. (at.init = 1),
  2660. pe('moveStart'),
  2661. y(ot),
  2662. M());
  2663. }),
  2664. (ye.stop = function () {
  2665. 'button' === at.source && ((at.init = 0), (at.released = 1));
  2666. }),
  2667. (ye.prev = function () {
  2668. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1);
  2669. }),
  2670. (ye.next = function () {
  2671. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1);
  2672. }),
  2673. (ye.prevPage = function () {
  2674. ye.activatePage(Oe.activePage - 1);
  2675. }),
  2676. (ye.nextPage = function () {
  2677. ye.activatePage(Oe.activePage + 1);
  2678. }),
  2679. (ye.slideBy = function (e, t) {
  2680. e &&
  2681. (Re
  2682. ? ye[Le ? 'toCenter' : 'toStart'](
  2683. d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)
  2684. )
  2685. : X(Ce.dest + e, t));
  2686. }),
  2687. (ye.slideTo = function (e, t) {
  2688. X(e, t);
  2689. }),
  2690. (ye.toStart = function (e, t) {
  2691. L('start', e, t);
  2692. }),
  2693. (ye.toEnd = function (e, t) {
  2694. L('end', e, t);
  2695. }),
  2696. (ye.toCenter = function (e, t) {
  2697. L('center', e, t);
  2698. }),
  2699. (ye.getIndex = R),
  2700. (ye.activate = function (e, t) {
  2701. var a = W(e);
  2702. ge.smart &&
  2703. a !== !1 &&
  2704. (Le
  2705. ? ye.toCenter(a, t)
  2706. : a >= Oe.lastItem
  2707. ? ye.toStart(a, t)
  2708. : a <= Oe.firstItem
  2709. ? ye.toEnd(a, t)
  2710. : K());
  2711. }),
  2712. (ye.activatePage = function (e, t) {
  2713. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t);
  2714. }),
  2715. (ye.resume = function (e) {
  2716. ge.cycleBy &&
  2717. ge.cycleInterval &&
  2718. ('items' !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2719. !(e < ye.isPaused) &&
  2720. ((ye.isPaused = 0),
  2721. st ? (st = clearTimeout(st)) : pe('resume'),
  2722. (st = setTimeout(function () {
  2723. switch ((pe('cycle'), ge.cycleBy)) {
  2724. case 'items':
  2725. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2726. break;
  2727. case 'pages':
  2728. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1);
  2729. }
  2730. }, ge.cycleInterval)));
  2731. }),
  2732. (ye.pause = function (e) {
  2733. e < ye.isPaused || ((ye.isPaused = e || 100), st && ((st = clearTimeout(st)), pe('pause')));
  2734. }),
  2735. (ye.toggle = function () {
  2736. ye[st ? 'pause' : 'resume']();
  2737. }),
  2738. (ye.set = function (t, a) {
  2739. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a);
  2740. }),
  2741. (ye.add = function (t, a) {
  2742. var n = e(t);
  2743. Re
  2744. ? (null == a || !Ne[0] || a >= Ne.length
  2745. ? n.appendTo(Pe)
  2746. : Ne.length && n.insertBefore(Ne[a].el),
  2747. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length))
  2748. : Pe.append(n),
  2749. H();
  2750. }),
  2751. (ye.remove = function (t) {
  2752. if (Re) {
  2753. var a = U(t);
  2754. if (a > -1) {
  2755. qe.eq(a).remove();
  2756. var n = a === Oe.activeItem;
  2757. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2758. H(),
  2759. n && ((_e.active = null), ye.activate(Oe.activeItem));
  2760. }
  2761. } else e(t).remove(), H();
  2762. }),
  2763. (ye.moveAfter = function (e, t) {
  2764. G(e, t, 1);
  2765. }),
  2766. (ye.moveBefore = function (e, t) {
  2767. G(e, t);
  2768. }),
  2769. (ye.on = function (e, t) {
  2770. if ('object' === i(e)) for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a]);
  2771. else if ('function' === i(t))
  2772. for (var n = e.split(' '), r = 0, s = n.length; s > r; r++)
  2773. (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t);
  2774. else if ('array' === i(t)) for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o]);
  2775. }),
  2776. (ye.one = function (e, t) {
  2777. function a() {
  2778. t.apply(ye, arguments), ye.off(e, a);
  2779. }
  2780. ye.on(e, a);
  2781. }),
  2782. (ye.off = function (e, t) {
  2783. if (t instanceof Array) for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a]);
  2784. else
  2785. for (var i = e.split(' '), r = 0, s = i.length; s > r; r++)
  2786. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0;
  2787. else {
  2788. var o = J(i[r], t);
  2789. -1 !== o && Ve[i[r]].splice(o, 1);
  2790. }
  2791. }),
  2792. (ye.destroy = function () {
  2793. return (
  2794. Ue.add(Se)
  2795. .add(Be)
  2796. .add(De)
  2797. .add($e)
  2798. .add(Qe)
  2799. .add(Ze)
  2800. .add(Ge)
  2801. .add(Je)
  2802. .add(Ke)
  2803. .off('.' + g),
  2804. b.off('keydown', de),
  2805. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2806. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2807. De.empty(),
  2808. we ||
  2809. (be.off('.' + g),
  2810. He.restore(),
  2811. Xe.restore(),
  2812. Ye.restore(),
  2813. je.restore(),
  2814. e.removeData(t, g)),
  2815. (Ne.length = Ee.length = 0),
  2816. (_e = {}),
  2817. (ye.initialized = 0),
  2818. ye
  2819. );
  2820. }),
  2821. (ye.init = function () {
  2822. if (!ye.initialized) {
  2823. ye.on(m);
  2824. var e = ['overflow', 'position'],
  2825. t = [
  2826. 'position',
  2827. 'webkitTransform',
  2828. 'msTransform',
  2829. 'transform',
  2830. 'left',
  2831. 'top',
  2832. 'width',
  2833. 'height',
  2834. ];
  2835. He.save.apply(He, e), Ye.save.apply(Ye, e), Xe.save.apply(Xe, t), je.save.apply(je, t);
  2836. var a = Se;
  2837. return (
  2838. we ||
  2839. ((a = a.add(Pe)),
  2840. be.css('overflow', 'hidden'),
  2841. f || 'static' !== be.css('position') || be.css('position', 'relative')),
  2842. f
  2843. ? v && a.css(f, v)
  2844. : ('static' === Be.css('position') && Be.css('position', 'relative'),
  2845. a.css({
  2846. position: 'absolute',
  2847. })),
  2848. ge.forward && $e.on(S, se),
  2849. ge.backward && Qe.on(S, se),
  2850. ge.prev && Ze.on(B, se),
  2851. ge.next && Ge.on(B, se),
  2852. ge.prevPage && Je.on(B, se),
  2853. ge.nextPage && Ke.on(B, se),
  2854. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  2855. Be[0] && Be.on(B, ce),
  2856. Re && ge.activateOn && be.on(ge.activateOn + '.' + g, '*', ue),
  2857. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + '.' + g, '*', fe),
  2858. We.on(
  2859. P,
  2860. {
  2861. source: 'slidee',
  2862. },
  2863. te
  2864. ),
  2865. Se &&
  2866. Se.on(
  2867. P,
  2868. {
  2869. source: 'handle',
  2870. },
  2871. te
  2872. ),
  2873. b.on('keydown', de),
  2874. we || (be.on('mouseenter.' + g + ' mouseleave.' + g, ve), be.on('scroll.' + g, o)),
  2875. (ye.initialized = 1),
  2876. H(!0),
  2877. ge.cycleBy && !we && ye[ge.startPaused ? 'pause' : 'resume'](),
  2878. ye
  2879. );
  2880. }
  2881. });
  2882. }
  2883. function i(e) {
  2884. return null == e
  2885. ? String(e)
  2886. : 'object' == typeof e || 'function' == typeof e
  2887. ? Object.prototype.toString
  2888. .call(e)
  2889. .match(/\s([a-z]+)/i)[1]
  2890. .toLowerCase() || 'object'
  2891. : typeof e;
  2892. }
  2893. function r(e, t) {
  2894. e.preventDefault(), t && e.stopPropagation();
  2895. }
  2896. function s(t) {
  2897. r(t, 1), e(this).off(t.type, s);
  2898. }
  2899. function o() {
  2900. (this.scrollLeft = 0), (this.scrollTop = 0);
  2901. }
  2902. function l(e) {
  2903. return !isNaN(parseFloat(e)) && isFinite(e);
  2904. }
  2905. function c(e, t) {
  2906. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ''));
  2907. }
  2908. function d(e, t, a) {
  2909. return t > e ? t : e > a ? a : e;
  2910. }
  2911. function u(e) {
  2912. var t = {};
  2913. return (
  2914. (t.style = {}),
  2915. (t.save = function () {
  2916. if (e && e.nodeType) {
  2917. for (var a = 0; a < arguments.length; a++) t.style[arguments[a]] = e.style[arguments[a]];
  2918. return t;
  2919. }
  2920. }),
  2921. (t.restore = function () {
  2922. if (e && e.nodeType) {
  2923. for (var a in t.style) t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2924. return t;
  2925. }
  2926. }),
  2927. t
  2928. );
  2929. }
  2930. var f,
  2931. v,
  2932. p,
  2933. h = 'sly',
  2934. m = 'Sly',
  2935. g = h,
  2936. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  2937. w = t.requestAnimationFrame,
  2938. b = e(document),
  2939. P = 'touchstart.' + g + ' mousedown.' + g,
  2940. I = 'mousemove.' + g + ' mouseup.' + g,
  2941. z = 'touchmove.' + g + ' touchend.' + g,
  2942. C = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + g,
  2943. B = 'click.' + g,
  2944. S = 'mousedown.' + g,
  2945. k = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
  2946. T = [],
  2947. x = Math.abs,
  2948. D = Math.sqrt,
  2949. A = Math.pow,
  2950. E = Math.round,
  2951. q = Math.max,
  2952. N = Math.min,
  2953. O = 0;
  2954. b.on(C, function (e) {
  2955. var t = e.originalEvent[g],
  2956. a = +new Date();
  2957. (!t || t.options.scrollHijack < a - O) && (O = a);
  2958. }),
  2959. (function (e) {
  2960. function t(e) {
  2961. var t = new Date().getTime(),
  2962. n = Math.max(0, 16 - (t - a)),
  2963. i = setTimeout(e, n);
  2964. return (a = t), i;
  2965. }
  2966. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2967. var a = new Date().getTime(),
  2968. n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2969. y = function (t) {
  2970. n.call(e, t);
  2971. };
  2972. })(window),
  2973. (function () {
  2974. function e(e) {
  2975. for (var n = 0, i = t.length; i > n; n++) {
  2976. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2977. if (null != a.style[r]) return r;
  2978. }
  2979. }
  2980. var t = ['', 'webkit', 'moz', 'ms', 'o'],
  2981. a = document.createElement('div');
  2982. (f = e('transform')), (v = e('perspective') ? 'translateZ(0) ' : '');
  2983. })(),
  2984. (t[m] = n),
  2985. (e.fn[h] = function (t, a) {
  2986. var r, s;
  2987. return (
  2988. e.isPlainObject(t) ||
  2989. (('string' === i(t) || t === !1) &&
  2990. ((r = t === !1 ? 'destroy' : t), (s = Array.prototype.slice.call(arguments, 1))),
  2991. (t = {})),
  2992. this.each(function (i, o) {
  2993. var l = e.data(o, g);
  2994. l || r ? l && r && l[r] && l[r].apply(l, s) : (l = e.data(o, g, new n(o, t, a).init()));
  2995. })
  2996. );
  2997. }),
  2998. (n.defaults = {
  2999. slidee: null,
  3000. horizontal: !1,
  3001. itemNav: null,
  3002. itemSelector: null,
  3003. smart: !1,
  3004. activateOn: null,
  3005. activateMiddle: !1,
  3006. scrollSource: null,
  3007. scrollBy: 0,
  3008. scrollHijack: 300,
  3009. scrollTrap: !1,
  3010. dragSource: null,
  3011. mouseDragging: !1,
  3012. touchDragging: !1,
  3013. releaseSwing: !1,
  3014. swingSpeed: 0.2,
  3015. elasticBounds: !1,
  3016. interactive: null,
  3017. scrollBar: null,
  3018. dragHandle: !1,
  3019. dynamicHandle: !1,
  3020. minHandleSize: 50,
  3021. clickBar: !1,
  3022. syncSpeed: 0.5,
  3023. pagesBar: null,
  3024. activatePageOn: null,
  3025. pageBuilder: function (e) {
  3026. return '<li>' + (e + 1) + '</li>';
  3027. },
  3028. forward: null,
  3029. backward: null,
  3030. prev: null,
  3031. next: null,
  3032. prevPage: null,
  3033. nextPage: null,
  3034. cycleBy: null,
  3035. cycleInterval: 5e3,
  3036. pauseOnHover: !1,
  3037. startPaused: !1,
  3038. moveBy: 300,
  3039. speed: 0,
  3040. easing: 'swing',
  3041. startAt: null,
  3042. keyboardNavBy: null,
  3043. draggedClass: 'dragged',
  3044. activeClass: 'active',
  3045. disabledClass: 'disabled',
  3046. });
  3047. })(jQuery, window);
  3048. !(function e(t, i, n) {
  3049. function r(a, s) {
  3050. if (!i[a]) {
  3051. if (!t[a]) {
  3052. var l = 'function' == typeof require && require;
  3053. if (!s && l) return l(a, !0);
  3054. if (o) return o(a, !0);
  3055. var c = new Error("Cannot find module '" + a + "'");
  3056. throw ((c.code = 'MODULE_NOT_FOUND'), c);
  3057. }
  3058. var h = (i[a] = {
  3059. exports: {},
  3060. });
  3061. t[a][0].call(
  3062. h.exports,
  3063. function (e) {
  3064. var i = t[a][1][e];
  3065. return r(i ? i : e);
  3066. },
  3067. h,
  3068. h.exports,
  3069. e,
  3070. t,
  3071. i,
  3072. n
  3073. );
  3074. }
  3075. return i[a].exports;
  3076. }
  3077. for (var o = 'function' == typeof require && require, a = 0; a < n.length; a++) r(n[a]);
  3078. return r;
  3079. })(
  3080. {
  3081. 1: [
  3082. function (e, t, i) {
  3083. (function (i) {
  3084. 'use strict';
  3085. function n(e) {
  3086. (this.player = null),
  3087. (this.director = null),
  3088. (this.modelManager = null),
  3089. (this.container = null),
  3090. (this.tagManager = null),
  3091. (this.fadeInSpeed = e),
  3092. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0);
  3093. }
  3094. var r = e('three'),
  3095. o = e('./util/logger'),
  3096. a = (e('./util/common'), e('./enum/PlayerEvents')),
  3097. s = e('./enum/DirectorEvents'),
  3098. l = e('./settings'),
  3099. c = e('./enum/Viewmode'),
  3100. h = (e('./enum/WarpStyle'), e('./enum/BlackoutStyle'), e('./enum/ModelManagerEvents')),
  3101. u = e('./enum/tagEvents'),
  3102. d = e('./util/transitions'),
  3103. p = e('./util/lerp'),
  3104. f = new o(i);
  3105. //window.THREE = r;
  3106. (n.prototype.init = function (e, t, i, n, r) {
  3107. window.app = this;
  3108. (this.player = t),
  3109. (this.director = e),
  3110. (this.modelManager = i),
  3111. (this.tagManager = n),
  3112. (this.container = r),
  3113. this.updateModel(),
  3114. this.bindEvents();
  3115. }),
  3116. (n.prototype.bindEvents = function () {
  3117. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  3118. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  3119. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  3120. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  3121. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  3122. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  3123. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  3124. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  3125. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  3126. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this));
  3127. }),
  3128. (n.prototype.updateModel = function () {
  3129. //模型this.model
  3130. this.model = this.modelManager.getActiveModel();
  3131. }),
  3132. (n.prototype.handleWarpStarted = function () {
  3133. this.hidePlayerReticule();
  3134. }),
  3135. (n.prototype.ontagActivated = function () {
  3136. this.hidePlayerReticule();
  3137. }),
  3138. (n.prototype.onNavigationTotag = function () {
  3139. this.hidePlayerReticule();
  3140. }),
  3141. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  3142. var n = this.modelManager.getActiveModel(),
  3143. r =
  3144. this.player.is360View(t, i) || this.director.tourIsPlaying
  3145. ? 0
  3146. : l[t].markerOpacity;
  3147. n.fadePanoMarkers(r), n.setMode(t);
  3148. }),
  3149. (n.prototype.handlePlayerModeChanged = function (e, t) {
  3150. var i = this.modelManager.getActiveModel(),
  3151. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  3152. i.setSide(n), i.setMode(t);
  3153. }),
  3154. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  3155. i !== c.TRANSITIONING &&
  3156. (e && !this.director.tourIsPlaying && e.hoverOff(i),
  3157. t && !this.director.tourIsPlaying && t.hoverOn(i));
  3158. }),
  3159. (n.prototype.handleActionInterruption = function () {}),
  3160. (n.prototype.handleStartInside = function (e) {
  3161. var t = l[this.player.mode],
  3162. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  3163. this.fadeIn(this.fadeInSpeed),
  3164. (this.model.alpha = 0),
  3165. (this.model.skybox.material.uniforms.opacity.value = 1),
  3166. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  3167. var n = this.player.reticule;
  3168. d.start(p.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac');
  3169. }),
  3170. (n.prototype.handleStartOutside = function (e) {
  3171. this.fadeIn(e);
  3172. }),
  3173. (n.prototype.fadeIn = function (e) {
  3174. (null !== e && void 0 !== e) ||
  3175. ((e = 2e3),
  3176. f.warn(
  3177. 'DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.'
  3178. )),
  3179. $(this.container).fadeIn(e);
  3180. }),
  3181. (n.prototype.hidePlayerReticule = function () {
  3182. this.player.reticule.hide();
  3183. }),
  3184. (t.exports = n);
  3185. }.call(this, '/js/DisplayController.js'));
  3186. },
  3187. {
  3188. './enum/BlackoutStyle': 18,
  3189. './enum/DirectorEvents': 23,
  3190. './enum/tagEvents': 32,
  3191. './enum/ModelManagerEvents': 33,
  3192. './enum/PlayerEvents': 40,
  3193. './enum/Viewmode': 51,
  3194. './enum/WarpStyle': 52,
  3195. './settings': 166,
  3196. './util/common': 185,
  3197. './util/lerp': 188,
  3198. './util/logger': 189,
  3199. './util/transitions': 195,
  3200. three: 217,
  3201. },
  3202. ],
  3203. 2: [
  3204. function (e, t, i) {
  3205. 'use strict';
  3206. function n() {
  3207. (this.baseStartTime = performance.timing.navigationStart),
  3208. (this.loadingStartTime = null),
  3209. (this.waitingStartTime = null),
  3210. (this.appReadyTime = null);
  3211. }
  3212. (n.prototype.setBaseStartTime = function (e) {
  3213. this.baseStartTime = e || Date.now();
  3214. }),
  3215. (n.prototype.setWaitingStartTime = function (e) {
  3216. this.waitingStartTime = e || Date.now();
  3217. }),
  3218. (n.prototype.setLoadingStartTime = function (e) {
  3219. this.loadingStartTime = e || Date.now();
  3220. }),
  3221. (n.prototype.setAppReadyTime = function (e) {
  3222. this.appReadyTime = e || Date.now();
  3223. }),
  3224. (n.prototype.calcFullLoadingTime = function () {
  3225. var e = this.appReadyTime - this.baseStartTime;
  3226. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e;
  3227. }),
  3228. (t.exports = n);
  3229. },
  3230. {},
  3231. ],
  3232. 3: [
  3233. function (e, t, i) {
  3234. (function (i) {
  3235. 'use strict';
  3236. function n() {
  3237. return 100 * Math.random();
  3238. }
  3239. var r = e('./util/logger'),
  3240. o = e('./util/browser'),
  3241. a = new r(i),
  3242. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3243. initialized: !1,
  3244. init: function (e, t) {
  3245. if (((t = t || {}), !this.initialized)) {
  3246. (this.initialized = !0),
  3247. o.valueFromHash('tilegen') && (t.tilegen = 1 === o.valueFromHash('tilegen', 0)),
  3248. o.valueFromHash('imgopt') && (t.imgopt = 1 === o.valueFromHash('imgopt', 0));
  3249. for (var i in e) {
  3250. var r = i.match('^sc_tilegen_([0-9]+)$');
  3251. r && (s.tilegen = n() < parseInt(r[1]));
  3252. var l = i.match('^sc_imgopt_([0-9]+)$');
  3253. l && (s.imgopt = n() < parseInt(l[1]));
  3254. }
  3255. for (var c in t) (s[c] = t[c]), a.debug('A/B override:', c, s[c]);
  3256. }
  3257. },
  3258. changeIfTileGenerating: function (e) {
  3259. return s.tilegen && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e;
  3260. },
  3261. changeIfImageOptimzing: function (e) {
  3262. return (
  3263. s.imgopt &&
  3264. e.indexOf('imgopt=1') === -1 &&
  3265. ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')),
  3266. e
  3267. );
  3268. },
  3269. tilegen: !1,
  3270. imgopt: !1,
  3271. });
  3272. t.exports = s;
  3273. }.call(this, '/js/ab.js'));
  3274. },
  3275. {
  3276. './util/browser': 182,
  3277. './util/logger': 189,
  3278. },
  3279. ],
  3280. 4: [
  3281. function (e, t, i) {
  3282. (function (i) {
  3283. 'use strict';
  3284. function n() {
  3285. return {
  3286. addons: [
  3287. {
  3288. name: 'keen:ua_parser',
  3289. input: {
  3290. ua_string: 'user_agent',
  3291. },
  3292. output: 'parsed_user_agent',
  3293. },
  3294. ],
  3295. };
  3296. }
  3297. function r(e, t, i, n) {
  3298. function r(t) {
  3299. l[t.sid] = !0;
  3300. var i = t.billboard.media && t.billboard.media.type,
  3301. n = {
  3302. tag_id: t.sid,
  3303. tags_visited: Object.keys(l).length,
  3304. tag_count: Object.keys(e.tags).length,
  3305. tag_view_count: ++E,
  3306. has_media: !!i,
  3307. };
  3308. i && (n.media_type = i), u('tag_opened', n);
  3309. }
  3310. var l = {},
  3311. h = Date.now() - N,
  3312. f = null;
  3313. n && (f = Date.now() - window.navigationStart);
  3314. var g;
  3315. try {
  3316. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0;
  3317. } catch (e) {
  3318. g = !1;
  3319. }
  3320. var v,
  3321. A = e.supportsVR;
  3322. A ||
  3323. ((v = 'VR disabled at the model/account level'),
  3324. m.valueFromHash('vr') === _.NONE
  3325. ? (v = 'VR disabled, using &vr=0')
  3326. : m.detectAndroid()
  3327. ? b.isDeviceSupported(w.Android) || (v = 'VR disabled, unsupported Android version')
  3328. : m.detectIOS() &&
  3329. (b.isDeviceSupported(w.IOS) || (v = 'VR disabled, unsupported iOS version'))),
  3330. u('model_loaded', {
  3331. duration: h,
  3332. duration_from_navigation_start: f,
  3333. has_hlr: g,
  3334. has_vr: A,
  3335. vr_reason: v,
  3336. });
  3337. var I = 0;
  3338. e.panos.forEach(function (e) {
  3339. e.on('enter', function () {
  3340. c('pano_viewed', {
  3341. pano_id: e.id,
  3342. pano_view_count: ++I,
  3343. alignment_type: e.alignmentType,
  3344. interaction_source: O,
  3345. navigation_source: p,
  3346. });
  3347. });
  3348. });
  3349. var E = 0;
  3350. for (var T in e.tags) e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  3351. t.on('tour_auto', function (e) {
  3352. p = 'tour_' + e;
  3353. }),
  3354. t.on('tour_manual', function (e) {
  3355. (O = 'gui-' + e), (p = 'tour_manual');
  3356. }),
  3357. i.on(C.InteractionKey, function () {
  3358. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey);
  3359. }),
  3360. i.on(C.InteractionDirect, function () {
  3361. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect);
  3362. }),
  3363. o(t),
  3364. a(),
  3365. s();
  3366. }
  3367. function o(e) {
  3368. I.on(T.OPENED, function () {
  3369. c('showcase_share_intent', {
  3370. pano_id: e.currentPano && e.currentPano.id,
  3371. });
  3372. }),
  3373. I.on(T.LINK_CLICKED, function (t) {
  3374. c('showcase_share_action', {
  3375. channel: t.channel,
  3376. pano_id: e.currentPano && e.currentPano.id,
  3377. });
  3378. }),
  3379. E.on(x.ORIGIN_LINK_CLICKED, function () {
  3380. c('showcase_share_origin_link_clicked');
  3381. });
  3382. }
  3383. function a() {}
  3384. function s() {
  3385. b.on(
  3386. S.OPENED,
  3387. c.bind(this, 'showcase_gui', {
  3388. gui_action: 'click_vr_button',
  3389. })
  3390. ),
  3391. b.on(S.LAUNCH, function (e) {
  3392. c('showcase_gui', {
  3393. gui_action: 'launch_vr',
  3394. vr_platform: e.vr_platform,
  3395. vr_app: e.vr_app,
  3396. });
  3397. }),
  3398. b.on(
  3399. S.PREV,
  3400. c.bind(this, 'showcase_gui', {
  3401. gui_action: 'vr_modal_prev',
  3402. })
  3403. ),
  3404. b.on(S.NEXT, function (e) {
  3405. c('showcase_gui', {
  3406. gui_action: e.nextAction,
  3407. });
  3408. }),
  3409. b.on(
  3410. S.CLOSED,
  3411. c.bind(this, 'showcase_gui', {
  3412. gui_action: 'vr_modal_close',
  3413. })
  3414. ),
  3415. b.on(S.falseICECHOSEN, function (e) {
  3416. c('showcase_gui', {
  3417. gui_action: e.name + ' ',
  3418. });
  3419. }),
  3420. b.on(S.STORE, function (e) {
  3421. c('showcase_gui', {
  3422. gui_action: 'launch_store',
  3423. store: e,
  3424. });
  3425. });
  3426. }
  3427. function l(e, t) {
  3428. if (f)
  3429. try {
  3430. f.addEvent(
  3431. e,
  3432. v.extendObject(
  3433. {
  3434. host: window.location.host,
  3435. keen: n(),
  3436. user_agent: '${keen.user_agent}',
  3437. referrer: {
  3438. url: v.normalizeUrl(document.referrer),
  3439. domain: v.domainFromUrl(document.referrer),
  3440. url_original: document.referrer,
  3441. },
  3442. embedded: m.inIframe(),
  3443. is_mobile: m.isMobile(),
  3444. version: '2.25.6-0-gd87e5b1',
  3445. },
  3446. t
  3447. )
  3448. );
  3449. } catch (e) {
  3450. P.warn(
  3451. 'analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' +
  3452. e
  3453. );
  3454. }
  3455. }
  3456. function c(e, t) {
  3457. if (((t = t || {}), L))
  3458. try {
  3459. window.analytics.track(e, v.extendObject(t, B), {
  3460. context: {
  3461. app: {
  3462. name: 'showcase',
  3463. version: '2.25.6-0-gd87e5b1',
  3464. },
  3465. screen: {
  3466. width: window.screen.width,
  3467. height: window.screen.height,
  3468. density: window.devicePixelRatio,
  3469. },
  3470. },
  3471. });
  3472. } catch (t) {
  3473. console.warn('Failed to send data to segment for ' + e);
  3474. }
  3475. }
  3476. function h(e, t) {
  3477. if (((t = t || {}), navigator.sendBeacon && L))
  3478. try {
  3479. navigator.sendBeacon(
  3480. 'https://api.segment.io/v1/t',
  3481. JSON.stringify({
  3482. event: e,
  3483. anonymousId: window.analytics.user().anonymousId(),
  3484. properties: v.extendObject(t, B),
  3485. writeKey: L,
  3486. sentAt: Date.now(),
  3487. type: 'track',
  3488. context: {
  3489. userAgent: m.userAgent(),
  3490. library: {
  3491. name: 'showcase-beacon',
  3492. version: '2.25.6-0-gd87e5b1',
  3493. },
  3494. app: {
  3495. name: 'showcase',
  3496. version: '2.25.6-0-gd87e5b1',
  3497. },
  3498. },
  3499. })
  3500. );
  3501. } catch (e) {
  3502. console.warn('Failed to send async segment request');
  3503. }
  3504. }
  3505. function u(e, t) {
  3506. (t = t || {}), c(e, t);
  3507. }
  3508. function d(e, t) {
  3509. (O = e === C.InteractionGui ? 'gui-' + t : e), (p = 'self_guided');
  3510. }
  3511. var p,
  3512. f,
  3513. g = (e('three'), e('./util/ajax'), e('./ab')),
  3514. m = e('./util/browser'),
  3515. v = e('./util/common'),
  3516. A = e('./settings'),
  3517. y = (e('./localization/localize'), e('./enum/Viewmode')),
  3518. C = e('./enum/ControlEvents'),
  3519. I = e('./gui/sharing/modal'),
  3520. E = e('./gui/title/titleBar'),
  3521. b = e('./gui/vr/vrModal'),
  3522. w = e('./enum/VRPlatforms'),
  3523. _ = e('./enum/VROption'),
  3524. T = e('./gui/sharing/ShareEvents'),
  3525. x = e('./gui/title/TitleEvents'),
  3526. S = e('./gui/vr/vrEvent'),
  3527. M = e('./tag/Billboard/BillboardEvent'),
  3528. R = e('./util/logger'),
  3529. P = new R(i),
  3530. O = (e('./enum/PlayerEvents'), 'direct'),
  3531. L = null,
  3532. D = !1,
  3533. N = null,
  3534. B = null,
  3535. F = v.uuid4();
  3536. t.exports = {
  3537. report: function (e, t, i, n) {
  3538. l('Session starts', {
  3539. model: e,
  3540. status: t,
  3541. loadtime: Date.now() - (N || Date.now()),
  3542. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3543. autoplay: i,
  3544. quickstart: n,
  3545. ab_tilegen: g.tilegen,
  3546. ab_imgopt: g.imgopt,
  3547. });
  3548. },
  3549. impression: function (e) {
  3550. e = e || {};
  3551. var t = void 0 === e.isVisible || e.isVisible,
  3552. i =
  3553. (void 0 !== e.immediate && e.immediate,
  3554. window.location.search.substr(1).split('&'));
  3555. u('impression', {
  3556. visible: t,
  3557. url_params: i,
  3558. });
  3559. },
  3560. initKeen: function (e) {
  3561. return e.token && e.appId
  3562. ? void (f = new Keen({
  3563. projectId: e.appId,
  3564. writeKey: e.token,
  3565. readKey: '',
  3566. requestType: 'xhr',
  3567. }))
  3568. : void P.warn('no keen token/appId');
  3569. },
  3570. initSegment: function (e) {
  3571. return e.token
  3572. ? ((L = e.token),
  3573. window.analytics.load(e.token),
  3574. (B = {
  3575. model_id: e.model,
  3576. start_source: e.startSource,
  3577. autoplay: e.autoplay,
  3578. quickstart: e.quickstart,
  3579. language_tag: A.languageTag,
  3580. is_mobile: m.isMobile(),
  3581. iframe: m.inIframe(),
  3582. aspect_ratio: m.aspectRatio(),
  3583. session_id: F,
  3584. window: {
  3585. width: $('#player').width(),
  3586. height: $('#player').height(),
  3587. },
  3588. platform: {
  3589. browser: {
  3590. name: $.ua.browser.name,
  3591. major: $.ua.browser.major,
  3592. version: $.ua.browser.version,
  3593. },
  3594. os: {
  3595. name: $.ua.os.name,
  3596. version: $.ua.os.version,
  3597. },
  3598. device: {
  3599. vendor: $.ua.device.vendor,
  3600. model: $.ua.device.model,
  3601. type: $.ua.device.type,
  3602. },
  3603. },
  3604. }),
  3605. (D = Math.random() < A.analytics.sessionTrackingRate),
  3606. P.debug('tracking sample rate = ' + A.analytics.sessionTrackingRate),
  3607. void P.debug('tracking this session = ' + D))
  3608. : void P.warn('no segment token');
  3609. },
  3610. sessionStart: function (e) {
  3611. P.debug('analytics user_session_start'),
  3612. c('session_started'),
  3613. (N = Date.now()),
  3614. window.addEventListener('unload', function () {
  3615. h('session_ended', {
  3616. duration: Date.now() - N,
  3617. });
  3618. });
  3619. },
  3620. modelLoaded: function (e, t, i, n) {
  3621. r(e, t, i, n);
  3622. },
  3623. loadComplete: function (e) {
  3624. var t = {
  3625. time_to_app_start: e,
  3626. };
  3627. c('load_times', t);
  3628. },
  3629. track: function (e, t) {
  3630. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t));
  3631. },
  3632. trackAlways: function (e, t) {
  3633. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t);
  3634. },
  3635. getSessionId: function () {
  3636. return F;
  3637. },
  3638. updateInteraction: d,
  3639. };
  3640. }.call(this, '/js/analytics.js'));
  3641. },
  3642. {
  3643. './ab': 3,
  3644. './enum/ControlEvents': 21,
  3645. './enum/PlayerEvents': 40,
  3646. './enum/VROption': 47,
  3647. './enum/VRPlatforms': 49,
  3648. './enum/Viewmode': 51,
  3649. './gui/sharing/ShareEvents': 76,
  3650. './gui/sharing/modal': 77,
  3651. './gui/title/TitleEvents': 80,
  3652. './gui/title/titleBar': 82,
  3653. './gui/vr/vrEvent': 85,
  3654. './gui/vr/vrModal': 87,
  3655. './localization/localize': 108,
  3656. './tag/Billboard/BillboardEvent': 120,
  3657. './settings': 166,
  3658. './util/ajax': 181,
  3659. './util/browser': 182,
  3660. './util/common': 185,
  3661. './util/logger': 189,
  3662. three: 217,
  3663. },
  3664. ],
  3665. 5: [
  3666. function (e, t, i) {
  3667. 'use strict';
  3668. function n() {
  3669. r.PerspectiveCamera.call(
  3670. this,
  3671. a.clampVFOV(o.dollhouseFOV),
  3672. $('#player').width() / $('#player').height(),
  3673. o.dollhouseNear,
  3674. o.dollhouseFar
  3675. ),
  3676. (this.controls = null);
  3677. }
  3678. var r = e('three'),
  3679. o = e('../constants'),
  3680. a = e('../util/cameraLight');
  3681. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3682. (n.prototype.updateAspect = function (e) {
  3683. (this.aspect = e), this.updateProjectionMatrix();
  3684. }),
  3685. (t.exports = n);
  3686. },
  3687. {
  3688. '../constants': 8,
  3689. '../util/cameraLight': 184,
  3690. three: 217,
  3691. },
  3692. ],
  3693. 6: [
  3694. function (e, t, i) {
  3695. 'use strict';
  3696. function n() {
  3697. var e = $('#player').width() / $('#player').height();
  3698. r.OrthographicCamera.call(
  3699. this,
  3700. -o.orthoBase,
  3701. o.orthoBase,
  3702. o.orthoBase / e,
  3703. -o.orthoBase / e,
  3704. o.orthoNear,
  3705. o.orthoFar
  3706. ),
  3707. (this.controls = null),
  3708. this.updateAspect(e);
  3709. }
  3710. var r = e('three'),
  3711. o = e('../constants');
  3712. (n.prototype = Object.create(r.OrthographicCamera.prototype)),
  3713. (n.prototype.updateAspect = function (e) {
  3714. (this.aspect = e),
  3715. (this.top = o.orthoBase / e),
  3716. (this.bottom = -o.orthoBase / e),
  3717. this.updateProjectionMatrix();
  3718. }),
  3719. (t.exports = n);
  3720. },
  3721. {
  3722. '../constants': 8,
  3723. three: 217,
  3724. },
  3725. ],
  3726. 7: [
  3727. function (e, t, i) {
  3728. 'use strict';
  3729. function n() {
  3730. r.PerspectiveCamera.call(
  3731. this,
  3732. a.clampVFOV(o.insideFOV),
  3733. $('#player').width() / $('#player').height(),
  3734. o.insideNear,
  3735. o.insideFar
  3736. ),
  3737. (this.controls = null);
  3738. }
  3739. var r = e('three'),
  3740. o = e('../settings'),
  3741. a = e('../util/cameraLight');
  3742. (n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3743. (n.prototype.updateAspect = function (e) {
  3744. (this.aspect = e), this.updateProjectionMatrix();
  3745. }),
  3746. (t.exports = n);
  3747. },
  3748. {
  3749. '../settings': 166,
  3750. '../util/cameraLight': 184,
  3751. three: 217,
  3752. },
  3753. ],
  3754. 8: [
  3755. function (e, t, i) {
  3756. 'use strict';
  3757. t.exports = {
  3758. signedUrlDefaultExpireTime: 24e4,
  3759. signedUrlCheckInterval: 1e4,
  3760. signedUrlRefreshBuffer: 15e3,
  3761. dollhouseFOV: 70,
  3762. dollhouseNear: 1,
  3763. dollhouseFar: 5e3,
  3764. insideFOV: 70,
  3765. insideFOVMax: 120,
  3766. insideNear: 0.1,
  3767. insideFar: 5e3,
  3768. insideLookSpeed: 0.12,
  3769. insideLookLimitUp: 40, //视角
  3770. insideLookLimitDown: -40,
  3771. orthoNear: 1,
  3772. orthoFar: 5e3,
  3773. orthoBase: 10,
  3774. narrowLandscapeHeight: 290,
  3775. reallyNarrowLandscapeHeight: 250,
  3776. visionTilingStartDate: new Date('8/26/2016'),
  3777. visionTilingStartVersion: '1.1.407.13667',
  3778. windowHeightHighQualityThreshold: 900,
  3779. tourStepDelayDefault: 3500,
  3780. tourStepDelaySlideShow: 5e3,
  3781. workshopApsect: 9 / 16,
  3782. highQualityMaxZoom: 2,
  3783. ultraHighQualityMaxZoom: 3,
  3784. };
  3785. },
  3786. {},
  3787. ],
  3788. 9: [
  3789. function (e, t, i) {
  3790. 'use strict';
  3791. function n() {
  3792. (this.activeControl = null), (this.controls = {}), (this.cameras = {});
  3793. }
  3794. var r = e('./PanoramaControls'),
  3795. o = e('./DollhouseControls'),
  3796. a = e('./FloorplanControls'),
  3797. s = e('../cameras/PanoramaCamera'),
  3798. l = e('../cameras/DollhouseCamera'),
  3799. c = e('../cameras/FloorplanCamera'),
  3800. h = e('events').EventEmitter,
  3801. u = e('../enum/ControlEvents'),
  3802. d = e('../enum/ModelManagerEvents'),
  3803. p = e('../enum/Viewmode'),
  3804. f = e('../settings');
  3805. (n.prototype = Object.create(h.prototype)),
  3806. (n.prototype.init = function (e, t) {
  3807. this.setUpControls(), this.bindEvents(e, t);
  3808. }),
  3809. (n.prototype.activateControls = function (e) {
  3810. this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)),
  3811. this.controls[e] && (this.controls[e].enabled = !0),
  3812. (this.activeControl = this.controls[e]);
  3813. }),
  3814. (n.prototype.setUpControls = function () {
  3815. var e = {},
  3816. t = {},
  3817. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  3818. n = [s, l, c],
  3819. h = [r, o, a];
  3820. i.forEach(
  3821. function (i, r) {
  3822. (e[i] = new n[r]()),
  3823. (t[i] = new h[r](e[i])),
  3824. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3825. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3826. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3827. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3828. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3829. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll));
  3830. }.bind(this)
  3831. ),
  3832. (this.controls = t),
  3833. (this.cameras = e);
  3834. }),
  3835. (n.prototype.bindEvents = function (e, t) {
  3836. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  3837. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  3838. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  3839. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  3840. f.useWheel &&
  3841. (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), { passive: false }),
  3842. e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
  3843. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  3844. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  3845. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  3846. e.addEventListener('contextmenu', function (e) {
  3847. e.preventDefault();
  3848. }),
  3849. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  3850. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  3851. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  3852. e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
  3853. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  3854. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  3855. document.addEventListener('keyup', this.onKeyUp.bind(this)),
  3856. t.on(
  3857. d.ActiveModelChanged,
  3858. function (e) {
  3859. this.setModelForControls(e.model);
  3860. }.bind(this)
  3861. );
  3862. }),
  3863. (n.prototype.setModelForControls = function (e) {
  3864. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3865. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3866. [p.DOLLHOUSE, p.FLOORPLAN].forEach(
  3867. function (e) {
  3868. this.controls[e].setBounds(t);
  3869. }.bind(this)
  3870. );
  3871. }),
  3872. (n.prototype.onMouseDown = function (e) {
  3873. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e);
  3874. }),
  3875. (n.prototype.onMouseMove = function (e) {
  3876. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e);
  3877. }),
  3878. (n.prototype.onMouseUp = function (e) {
  3879. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e);
  3880. }),
  3881. (n.prototype.onMouseOver = function (e) {
  3882. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e);
  3883. }),
  3884. (n.prototype.onMouseWheel = function (e) {
  3885. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e);
  3886. }),
  3887. (n.prototype.onTouchStart = function (e) {
  3888. e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e);
  3889. var hotList = $('#hotListWrap')[0];
  3890. hotList.classList.remove('hotListActive');
  3891. $('#hotListContent ul .active').removeClass('active');
  3892. $('#hotList')[0].classList.remove('active');
  3893. }),
  3894. (n.prototype.onTouchMove = function (e) {
  3895. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e);
  3896. }),
  3897. (n.prototype.onTouchEnd = function (e) {
  3898. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e);
  3899. }),
  3900. (n.prototype.onPointerDown = function (e) {
  3901. if ((e.preventDefault(), this.activeControl))
  3902. switch (e.pointerType) {
  3903. case 'mouse':
  3904. this.activeControl.onMouseDown(e);
  3905. break;
  3906. default:
  3907. this.activeControl.onPointerDown(e);
  3908. }
  3909. }),
  3910. (n.prototype.onPointerMove = function (e) {
  3911. if ((e.preventDefault(), this.activeControl))
  3912. switch (e.pointerType) {
  3913. case 'mouse':
  3914. this.activeControl.onMouseMove(e);
  3915. break;
  3916. default:
  3917. this.activeControl.onPointerMove(e);
  3918. }
  3919. }),
  3920. (n.prototype.onPointerUp = function (e) {
  3921. if ((e.preventDefault(), this.activeControl))
  3922. switch (e.pointerType) {
  3923. case 'mouse':
  3924. this.activeControl.onMouseUp(e);
  3925. break;
  3926. default:
  3927. this.activeControl.onPointerUp(e);
  3928. }
  3929. }),
  3930. (n.prototype.onPointerCancel = function (e) {
  3931. e.preventDefault(),
  3932. this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e);
  3933. }),
  3934. (n.prototype.onKeyDown = function (e) {
  3935. e.metaKey ||
  3936. e.ctrlKey ||
  3937. (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e));
  3938. }),
  3939. (n.prototype.onKeyUp = function (e) {
  3940. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e);
  3941. }),
  3942. (t.exports = n);
  3943. },
  3944. {
  3945. '../cameras/DollhouseCamera': 5,
  3946. '../cameras/FloorplanCamera': 6,
  3947. '../cameras/PanoramaCamera': 7,
  3948. '../enum/ControlEvents': 21,
  3949. '../enum/ModelManagerEvents': 33,
  3950. '../enum/Viewmode': 51,
  3951. '../settings': 166,
  3952. './DollhouseControls': 10,
  3953. './FloorplanControls': 11,
  3954. './PanoramaControls': 13,
  3955. events: 202,
  3956. },
  3957. ],
  3958. 10: [
  3959. function (e, t, i) {
  3960. 'use strict';
  3961. function n(e) {
  3962. a.call(this, e),
  3963. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  3964. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  3965. (this.minDistance = o.dollhouseDefault.minDistance),
  3966. (this.maxDistance = o.dollhouseDefault.maxDistance),
  3967. (this.adjustedMinDistance = this.minDistance),
  3968. (this.adjustedMaxDistance = this.maxDistance);
  3969. }
  3970. var r = e('three'),
  3971. o = e('../settings'),
  3972. a = e('./OutsideControls');
  3973. (n.prototype = Object.create(a.prototype)),
  3974. (n.prototype.pan = function (e, t) {
  3975. this.camera.updateMatrix();
  3976. var i = this.camera.position.clone().sub(this.target).length();
  3977. (i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)),
  3978. this.panLeft((2 * e * i) / $('#player').height()),
  3979. this.panUp((-2 * t * i) / $('#player').height());
  3980. }),
  3981. (n.prototype.updateZoom = function () {
  3982. var e = this.offset.length();
  3983. return e * this.scale;
  3984. }),
  3985. (n.prototype.setZoomBounds = function (e) {
  3986. var t = e.min.distanceTo(e.max);
  3987. (this.adjustedMinDistance = Math.max(
  3988. Math.min(t / 2, o.dollhouseDefault.minDistance),
  3989. 0
  3990. )),
  3991. (this.adjustedMaxDistance = Math.min(
  3992. Math.max(t, o.dollhouseDefault.maxDistance),
  3993. o.skyboxRadius
  3994. )),
  3995. (this.minDistance = this.adjustedMinDistance),
  3996. (this.maxDistance = this.adjustedMaxDistance);
  3997. }),
  3998. (n.prototype.resetRanges = function (e, t) {
  3999. e
  4000. ? ((this.minDistance = Math.min(e, this.minDistance)),
  4001. (this.maxDistance = Math.max(e, this.maxDistance)))
  4002. : ((this.minDistance = this.adjustedMinDistance),
  4003. (this.maxDistance = this.adjustedMaxDistance)),
  4004. t
  4005. ? ((this.minPolarAngle = r.Math.degToRad(-15)),
  4006. (this.maxPolarAngle = r.Math.degToRad(89.9)))
  4007. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4008. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle));
  4009. }),
  4010. (n.prototype.toJSON = function () {
  4011. return a.prototype.toJSON.call(this);
  4012. }),
  4013. (t.exports = n);
  4014. },
  4015. {
  4016. '../settings': 166,
  4017. './OutsideControls': 12,
  4018. three: 217,
  4019. },
  4020. ],
  4021. 11: [
  4022. function (e, t, i) {
  4023. 'use strict';
  4024. function n(e) {
  4025. a.call(this, e),
  4026. (this.minDistance = 15),
  4027. (this.maxDistance = 50),
  4028. (this.noRotateUpDown = !0),
  4029. (this.minPolarAngle = 0),
  4030. (this.maxPolarAngle = 0),
  4031. (this.mouseActions[l.LEFT] = s.PAN),
  4032. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  4033. (this.mouseActions[l.RIGHT] = s.ROTATE),
  4034. (this.touchActions[1] = s.PAN),
  4035. (this.touchActions[2] = s.ROTATE_DOLLY),
  4036. (this.absoluteScale = 1),
  4037. (this.currentScale = 1);
  4038. }
  4039. var r = e('three'),
  4040. o = e('../settings'),
  4041. a = e('./OutsideControls'),
  4042. s = e('../enum/ControlActions'),
  4043. l = e('../enum/MouseButton'),
  4044. c = e('../util/math'),
  4045. h = e('../util/browser');
  4046. (n.prototype = Object.create(a.prototype)),
  4047. (n.prototype.zoomToContain = function (e) {
  4048. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  4049. this.currentScale = this.absoluteScale;
  4050. }),
  4051. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  4052. let defaultRatio = 1.2,
  4053. absoluteScale;
  4054. if (_settings.floorPlanAngle) {
  4055. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  4056. var angle = parseFloat(_settings.floorPlanAngle);
  4057. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0));
  4058. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect); //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  4059. var screenSize = Math.min($('#player').width(), $('#player').height());
  4060. var maxSize = 800; //模型最大占据像素
  4061. ratio =
  4062. ratio != void 0
  4063. ? ratio
  4064. : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio);
  4065. absoluteScale = (n / 2 / o.orthoBase) * ratio; //根据模型所占最大视口尺寸调整缩放
  4066. } else {
  4067. var t = Math.max(modelSize.x, modelSize.z),
  4068. i = Math.min(modelSize.x, modelSize.z),
  4069. n = Math.max(t, i * this.camera.aspect),
  4070. r = Math.max(i, t * this.camera.aspect);
  4071. absoluteScale = ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) * defaultRatio;
  4072. }
  4073. return absoluteScale;
  4074. }),
  4075. /* n.prototype.rotateToView = function(e, t) {
  4076. var i = 0
  4077. , n = h.aspectRatio() < 1
  4078. , r = e.x < e.z;
  4079. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  4080. this.rotateLeft(i),
  4081. this.update(0)
  4082. },
  4083. */
  4084. (n.prototype.rotateToView = function (modelSize, direction) {
  4085. let i = 0,
  4086. n = h.aspectRatio() < 1; //是否模型尺寸显“细长”
  4087. if (_settings.floorPlanAngle) {
  4088. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  4089. i = parseFloat(_settings.floorPlanAngle);
  4090. } else {
  4091. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  4092. if (n === r) {
  4093. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  4094. if (direction.z > 0) {
  4095. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  4096. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  4097. }
  4098. //(第二种情况) 不做处理
  4099. } else if (direction.x > 0) {
  4100. i = Math.PI / 2;
  4101. } else {
  4102. i = -Math.PI / 2;
  4103. }
  4104. }
  4105. this.rotateLeft(i);
  4106. this.update(0);
  4107. }),
  4108. (n.prototype.rotateToAngle = function (angle) {
  4109. //add 旋转到特定角度
  4110. this.rotateLeft(angle + this.lon);
  4111. this.update(0);
  4112. }),
  4113. (n.prototype.pan = function (e, t) {
  4114. this.camera.updateMatrix(),
  4115. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  4116. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height());
  4117. }),
  4118. (n.prototype.updateZoom = function () {
  4119. return (
  4120. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  4121. (this.absoluteScale = Math.max(
  4122. o.zoomNearLimit,
  4123. Math.min(this.absoluteScale, o.zoomFarLimit)
  4124. )),
  4125. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  4126. (this.camera.left = -o.orthoBase * this.currentScale),
  4127. (this.camera.right = o.orthoBase * this.currentScale),
  4128. (this.camera.top = (o.orthoBase * this.currentScale) / this.camera.aspect),
  4129. (this.camera.bottom = (-o.orthoBase * this.currentScale) / this.camera.aspect),
  4130. this.camera.updateProjectionMatrix(),
  4131. this.offset.length()
  4132. );
  4133. }),
  4134. (n.prototype.toJSON = (function () {
  4135. var e = new r.Quaternion(),
  4136. t = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90)),
  4137. i = new r.Quaternion();
  4138. return function () {
  4139. var n = a.prototype.toJSON.call(this);
  4140. return (
  4141. e.copy(n.camera_quaternion),
  4142. i.copy(t),
  4143. i.multiply(e),
  4144. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  4145. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  4146. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  4147. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  4148. (n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4)),
  4149. n
  4150. );
  4151. };
  4152. })()),
  4153. (t.exports = n);
  4154. },
  4155. {
  4156. '../enum/ControlActions': 20,
  4157. '../enum/MouseButton': 34,
  4158. '../settings': 166,
  4159. '../util/browser': 182,
  4160. '../util/math': 190,
  4161. './OutsideControls': 12,
  4162. three: 217,
  4163. },
  4164. ],
  4165. 12: [
  4166. function (e, t, i) {
  4167. 'use strict';
  4168. function n(e) {
  4169. (this.camera = e),
  4170. (this.camera.controls = this),
  4171. (this.enabled = !1),
  4172. (this.target = new r.Vector3()),
  4173. (this.targetBounds = new r.Box3()),
  4174. (this.zoomSpeed = 1),
  4175. (this.minDistance = 0),
  4176. (this.maxDistance = 1 / 0),
  4177. (this.noRotateUpDown = !1),
  4178. (this.rotateSpeed = 1),
  4179. (this.keyboardZoomSpeed = 0),
  4180. (this.keyPanSpeed = 7),
  4181. (this.autoRotate = !1),
  4182. (this.autoRotateSpeed = 2),
  4183. (this.autoPan = !1),
  4184. (this.autoPanPosition = new r.Vector3()),
  4185. (this.minPolarAngle = r.Math.degToRad(25)),
  4186. (this.maxPolarAngle = r.Math.degToRad(65)),
  4187. (this.rotationAcceleration = new r.Vector2()),
  4188. (this.rotationSpeed = new r.Vector2()),
  4189. (this.panAcceleration = new r.Vector2()),
  4190. (this.panSpeed = new r.Vector2()),
  4191. (this.rotateStart = new r.Vector2()),
  4192. (this.rotateEnd = new r.Vector2()),
  4193. (this.rotateDelta = new r.Vector2()),
  4194. (this.panStart = new r.Vector2()),
  4195. (this.panEnd = new r.Vector2()),
  4196. (this.panDelta = new r.Vector2()),
  4197. (this.panOffset = new r.Vector3()),
  4198. (this.offset = new r.Vector3()),
  4199. (this.dollyStart = new r.Vector2()),
  4200. (this.dollyEnd = new r.Vector2()),
  4201. (this.dollyDelta = new r.Vector2()),
  4202. (this.phiDelta = 0),
  4203. (this.thetaDelta = 0),
  4204. (this.scale = 1),
  4205. (this.panVector = new r.Vector3()),
  4206. (this.lastPosition = new r.Vector3()),
  4207. (this.state = c.NONE),
  4208. (this.mouseActions = {}),
  4209. (this.mouseActions[h.LEFT] = c.ROTATE),
  4210. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  4211. (this.mouseActions[h.RIGHT] = c.PAN),
  4212. (this.touchActions = {}),
  4213. (this.touchActions[1] = c.ROTATE),
  4214. (this.touchActions[2] = c.PAN_DOLLY),
  4215. (this.lastMoveTime = 0),
  4216. (this.pointersLimit = 2),
  4217. (this.pointers = []);
  4218. }
  4219. var r = e('three'),
  4220. o = e('../settings'),
  4221. a = e('../util/common'),
  4222. s = e('../util/math'),
  4223. l = e('../enum/Vectors'),
  4224. c = e('../enum/ControlActions'),
  4225. h = e('../enum/MouseButton'),
  4226. u = e('../enum/Keys'),
  4227. d = e('../enum/ControlEvents'),
  4228. p = e('events').EventEmitter,
  4229. f = 1e-6;
  4230. (n.prototype = Object.create(p.prototype)),
  4231. (n.prototype.setBounds = function (e) {
  4232. this.targetBounds = e;
  4233. }),
  4234. (n.prototype.isEngaged = function () {
  4235. return this.state !== c.NONE;
  4236. }),
  4237. (n.prototype.rotateLeft = function (e) {
  4238. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e);
  4239. }),
  4240. (n.prototype.rotateUp = function (e) {
  4241. this.noRotateUpDown ||
  4242. (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e));
  4243. }),
  4244. (n.prototype.panLeft = function (e) {
  4245. var t = this.camera.matrix.elements;
  4246. this.panOffset.set(t[0], 0, t[2]).normalize(),
  4247. this.panOffset.multiplyScalar(-e),
  4248. this.panVector.add(this.panOffset);
  4249. }),
  4250. (n.prototype.panUp = function (e) {
  4251. var t = this.camera.matrix.elements;
  4252. this.panOffset.set(t[4], 0, t[6]).normalize(),
  4253. this.panOffset.multiplyScalar(-e),
  4254. this.panVector.add(this.panOffset);
  4255. }),
  4256. (n.prototype.startRotating = function (e, t) {
  4257. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t);
  4258. }),
  4259. (n.prototype.stopRotating = function (e) {
  4260. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4261. this.navRotationAcc('x', 0),
  4262. this.navRotationAcc('y', 0);
  4263. }),
  4264. (n.prototype.setAutoPanPosition = (function (e, t) {
  4265. var i = new r.Vector3(),
  4266. n = new r.Vector3();
  4267. return function (e, t) {
  4268. i.copy(this.camera.position),
  4269. (void 0 === e && null === e) || i.setX(e),
  4270. (void 0 === t && null === t) || i.setZ(t);
  4271. var r = this.camera.position.distanceTo(this.target),
  4272. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  4273. (this.targetClamped = !1),
  4274. n.copy(i).addScaledVector(o, r),
  4275. this.targetBounds.containsPoint(n) ||
  4276. (this.targetBounds.clampPoint(n, n),
  4277. i.copy(n).addScaledVector(o, -r),
  4278. (this.targetClamped = !0)),
  4279. (this.autoPanPosition.x = i.x),
  4280. (this.autoPanPosition.z = i.z),
  4281. this.autoPan && this.stopAutoPanning();
  4282. };
  4283. })()),
  4284. (n.prototype.stopAutoPanning = function () {
  4285. var e = this.autoPan;
  4286. (this.autoPan = !1),
  4287. this.emit(
  4288. this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete
  4289. );
  4290. }),
  4291. (n.prototype.dollyIn = function (e) {
  4292. void 0 === e && (e = this.getZoomScale()), (this.scale /= e);
  4293. }),
  4294. (n.prototype.dollyOut = function (e) {
  4295. void 0 === e && (e = this.getZoomScale()), (this.scale *= e);
  4296. }),
  4297. (n.prototype.updatePan = function (e) {
  4298. if (
  4299. (this.panSpeed
  4300. .multiplyScalar(1 - o.panFriction)
  4301. .addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  4302. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4303. this.autoPan)
  4304. ) {
  4305. var t = new r.Vector3().copy(this.autoPanPosition).sub(this.camera.position);
  4306. t.setY(0).clampLength(0, 50 * e),
  4307. this.target.add(t),
  4308. this.camera.position.add(t),
  4309. this.autoPanPosition.x === this.camera.position.x &&
  4310. this.autoPanPosition.z === this.camera.position.z &&
  4311. ((this.autoPan = !1), this.stopAutoPanning());
  4312. }
  4313. }),
  4314. (n.prototype.update = function (e) {
  4315. e || (e = 1 / 60);
  4316. var friction = Math.min(1, o.rotationFriction * e * 60); //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4317. this.rotationSpeed
  4318. .multiplyScalar(1 - friction)
  4319. .addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  4320. this.rotateLeft(-this.rotationSpeed.x),
  4321. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4322. this.updatePan(e);
  4323. var t = this.camera.position;
  4324. this.offset.copy(t).sub(this.target);
  4325. var i = Math.atan2(this.offset.x, this.offset.z),
  4326. n = Math.atan2(
  4327. Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z),
  4328. this.offset.y
  4329. );
  4330. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4331. (i += this.thetaDelta),
  4332. (n += this.phiDelta),
  4333. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  4334. (n = Math.max(f, Math.min(Math.PI - f, n)));
  4335. (this.lon = i), (this.lat = n); //add
  4336. var r = this.updateZoom();
  4337. (r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  4338. this.target.add(this.panVector),
  4339. this.targetBounds.clampPoint(this.target, this.target),
  4340. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  4341. (this.offset.y = r * Math.cos(n)),
  4342. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  4343. t.copy(this.target).add(this.offset),
  4344. this.camera.lookAt(this.target),
  4345. (this.thetaDelta = 0),
  4346. (this.phiDelta = 0),
  4347. (this.scale = 1),
  4348. this.panVector.set(0, 0, 0),
  4349. this.lastPosition.distanceTo(this.camera.position) > 0 &&
  4350. this.lastPosition.copy(this.camera.position);
  4351. }),
  4352. (n.prototype.getAutoRotationAngle = function () {
  4353. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed;
  4354. }),
  4355. (n.prototype.getZoomScale = function () {
  4356. return Math.pow(0.95, this.zoomSpeed);
  4357. }),
  4358. (n.prototype.onMouseDown = function (e) {
  4359. if (this.enabled) {
  4360. switch (
  4361. (e.preventDefault(),
  4362. this.stopAutoPanning(),
  4363. (this.mouseDown = !0),
  4364. (this.state = this.mouseActions[e.button]),
  4365. this.state)
  4366. ) {
  4367. case c.ROTATE:
  4368. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4369. this.rotationSpeed.set(0, 0);
  4370. break;
  4371. case c.DOLLY:
  4372. this.dollyStart.set(e.clientX, e.clientY);
  4373. break;
  4374. case c.PAN:
  4375. this.panStart.set(e.clientX, e.clientY);
  4376. }
  4377. this.emit(d.InputStart, 'mouse');
  4378. }
  4379. }),
  4380. (n.prototype.onMouseMove = function (e) {
  4381. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4382. switch ((e.preventDefault(), this.state)) {
  4383. case c.ROTATE:
  4384. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4385. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4386. this.rotateLeft(
  4387. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4388. ),
  4389. this.rotateUp(
  4390. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4391. this.rotateSpeed
  4392. ),
  4393. this.rotateStart.copy(this.rotateEnd);
  4394. break;
  4395. case c.DOLLY:
  4396. this.dollyEnd.set(e.clientX, e.clientY),
  4397. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  4398. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  4399. t.call(this), this.dollyStart.copy(this.dollyEnd);
  4400. break;
  4401. case c.PAN:
  4402. this.panEnd.set(e.clientX, e.clientY),
  4403. this.panDelta.subVectors(this.panEnd, this.panStart),
  4404. this.pan(this.panDelta.x, this.panDelta.y),
  4405. this.panStart.copy(this.panEnd);
  4406. }
  4407. this.emit(d.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update();
  4408. }
  4409. }),
  4410. (n.prototype.onMouseUp = function (e) {
  4411. this.enabled &&
  4412. ((this.mouseDown = !1),
  4413. (this.state = c.NONE),
  4414. 'mouseover' !== e.type &&
  4415. (e.timeStamp > this.lastMoveTime + 100
  4416. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4417. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  4418. this.update(),
  4419. this.rotationAcceleration.set(0, 0),
  4420. this.rotateDelta.set(0, 0)));
  4421. }),
  4422. (n.prototype.onMouseOver = function (e) {
  4423. (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e);
  4424. }),
  4425. (n.prototype.onMouseWheel = function (e) {
  4426. if (this.enabled && o.useWheel) {
  4427. this.emit(d.Move, 'wheel');
  4428. var t = e.wheelDelta || -e.detail,
  4429. i = t > 0 ? this.dollyOut : this.dollyIn;
  4430. i.call(this), this.update();
  4431. }
  4432. }),
  4433. (n.prototype.onKeyDown = function (e) {
  4434. this.enabled &&
  4435. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)));
  4436. }),
  4437. (n.prototype.navRotationAcc = function (e, t) {
  4438. 'y' === e
  4439. ? this.noRotateUpDown
  4440. ? (this.keyboardZoomSpeed = t)
  4441. : (this.rotationAcceleration.y = t)
  4442. : (this.rotationAcceleration.x = t);
  4443. }),
  4444. (n.prototype.navPanAcc = function (e, t) {
  4445. this.stopAutoPanning(), (this.panAcceleration[e] = t);
  4446. }),
  4447. (n.prototype.handleKeyDown = function (e) {
  4448. var t = !0;
  4449. switch (e) {
  4450. case u.UPARROW:
  4451. case u.I:
  4452. this.navRotationAcc('y', 1);
  4453. break;
  4454. case u.DOWNARROW:
  4455. case u.K:
  4456. this.navRotationAcc('y', -1);
  4457. break;
  4458. case u.LEFTARROW:
  4459. case u.J:
  4460. this.navRotationAcc('x', -1);
  4461. break;
  4462. case u.RIGHTARROW:
  4463. case u.L:
  4464. this.navRotationAcc('x', 1);
  4465. break;
  4466. case u.W:
  4467. this.navPanAcc('y', 1);
  4468. break;
  4469. case u.S:
  4470. this.navPanAcc('y', -1);
  4471. break;
  4472. case u.A:
  4473. this.navPanAcc('x', -1);
  4474. break;
  4475. case u.D:
  4476. this.navPanAcc('x', 1);
  4477. break;
  4478. default:
  4479. t = !1;
  4480. }
  4481. t && this.emit(d.Move, 'key');
  4482. }),
  4483. (n.prototype.onKeyUp = function (e) {
  4484. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which));
  4485. }),
  4486. (n.prototype.handleKeyUp = function (e) {
  4487. switch (e) {
  4488. case u.I:
  4489. case u.K:
  4490. case u.UPARROW:
  4491. case u.DOWNARROW:
  4492. (this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0);
  4493. break;
  4494. case u.J:
  4495. case u.L:
  4496. case u.LEFTARROW:
  4497. case u.RIGHTARROW:
  4498. this.rotationAcceleration.x = 0;
  4499. break;
  4500. case u.S:
  4501. case u.W:
  4502. this.panAcceleration.y = 0;
  4503. break;
  4504. case u.A:
  4505. case u.D:
  4506. this.panAcceleration.x = 0;
  4507. }
  4508. }),
  4509. (n.prototype.onTouchStart = function (e) {
  4510. if (this.enabled || this.state === c.NONE) {
  4511. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning();
  4512. var t = function () {
  4513. if (2 === e.touches.length) {
  4514. var t = e.touches[0].pageX - e.touches[1].pageX,
  4515. i = e.touches[0].pageY - e.touches[1].pageY;
  4516. this.dollyStart.set(t, i);
  4517. }
  4518. }.bind(this),
  4519. i = function () {
  4520. this.panStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'));
  4521. }.bind(this),
  4522. n = function () {
  4523. this.rotateStart.set(
  4524. a.average(e.touches, 'pageX'),
  4525. a.average(e.touches, 'pageY')
  4526. );
  4527. }.bind(this);
  4528. switch (((this.state = this.touchActions[e.touches.length]), this.state)) {
  4529. case c.PAN_DOLLY:
  4530. t();
  4531. case c.PAN:
  4532. i();
  4533. break;
  4534. case c.ROTATE_DOLLY:
  4535. t();
  4536. case c.ROTATE:
  4537. n();
  4538. }
  4539. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, 'touch');
  4540. }
  4541. }),
  4542. (n.prototype.onTouchMove = function (e) {
  4543. if (this.enabled && this.state !== c.NONE) {
  4544. e.preventDefault(), e.stopPropagation();
  4545. var t = function () {
  4546. var t = e.touches[0].pageX - e.touches[1].pageX,
  4547. i = e.touches[0].pageY - e.touches[1].pageY;
  4548. this.dollyEnd.set(t, i);
  4549. var n = this.dollyStart.length() - this.dollyEnd.length();
  4550. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  4551. this.dollyStart.copy(this.dollyEnd);
  4552. }.bind(this),
  4553. i = function () {
  4554. this.panEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4555. this.panDelta.subVectors(this.panEnd, this.panStart),
  4556. this.pan(this.panDelta.x, this.panDelta.y),
  4557. this.panStart.copy(this.panEnd),
  4558. this.rotateDelta.set(0, 0);
  4559. }.bind(this),
  4560. n = function () {
  4561. this.rotateEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4562. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4563. this.rotateLeft(
  4564. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4565. ),
  4566. this.rotateUp(
  4567. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4568. this.rotateSpeed
  4569. ),
  4570. this.rotateStart.copy(this.rotateEnd);
  4571. }.bind(this),
  4572. r = function () {
  4573. if (2 === e.touches.length) {
  4574. var i = window.devicePixelRatio || 1,
  4575. r = e.touches[1].pageX - e.touches[0].pageX,
  4576. s = e.touches[1].pageY - e.touches[0].pageY,
  4577. l = Math.sqrt(r * r + s * s),
  4578. h = Math.abs(this.dollyStart.length() - l);
  4579. if (h > o.input.touchMoveThreshold * i) (this.state = c.DOLLY), t();
  4580. else {
  4581. var u = a.average(e.touches, 'pageX'),
  4582. d = a.average(e.touches, 'pageY'),
  4583. p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  4584. p > o.input.touchMoveThreshold &&
  4585. ((this.state = c.ROTATE), this.rotateStart.set(u, d), n());
  4586. }
  4587. }
  4588. }.bind(this);
  4589. switch (this.state) {
  4590. case c.PAN_DOLLY:
  4591. t();
  4592. case c.PAN:
  4593. i();
  4594. break;
  4595. case c.ROTATE_DOLLY:
  4596. r();
  4597. break;
  4598. case c.DOLLY:
  4599. t();
  4600. break;
  4601. case c.ROTATE:
  4602. n();
  4603. break;
  4604. default:
  4605. this.state = c.NONE;
  4606. }
  4607. (this.lastMoveTime = e.timeStamp), this.emit(d.Move, 'touch');
  4608. }
  4609. }),
  4610. (n.prototype.onTouchEnd = function (e) {
  4611. this.enabled &&
  4612. (this.state === c.ROTATE &&
  4613. (e.timeStamp > this.lastMoveTime + 100
  4614. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4615. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4616. (this.state = c.NONE),
  4617. this.update(),
  4618. this.rotationAcceleration.set(0, 0),
  4619. this.rotateDelta.set(0, 0));
  4620. }),
  4621. (n.prototype.onPointerDown = function (e) {
  4622. this.enabled &&
  4623. ('touch' === e.pointerType &&
  4624. (this.pointers.length < this.pointersLimit &&
  4625. this.pointers.push({
  4626. id: e.pointerId,
  4627. pageX: e.pageX,
  4628. pageY: e.pageY,
  4629. }),
  4630. (e.touches = this.pointers),
  4631. this.onTouchStart(e)),
  4632. this.emit(d.InputStart, 'pointer'));
  4633. }),
  4634. (n.prototype.onPointerMove = function (e) {
  4635. this.enabled &&
  4636. 'touch' === e.pointerType &&
  4637. (this.pointers.forEach(function (t) {
  4638. e.pointerId === t.id && ((t.pageX = e.pageX), (t.pageY = e.pageY));
  4639. }),
  4640. (e.touches = this.pointers),
  4641. this.onTouchMove(e));
  4642. }),
  4643. (n.prototype.onPointerUp = function (e) {
  4644. this.enabled &&
  4645. 'touch' === e.pointerType &&
  4646. (this.pointers.forEach(
  4647. function (t, i) {
  4648. e.pointerId === t.id && this.pointers.splice(i, 1);
  4649. }.bind(this)
  4650. ),
  4651. (e.touches = this.pointers),
  4652. this.onTouchEnd(e));
  4653. }),
  4654. (n.prototype.reset = function () {
  4655. (this.state = c.NONE),
  4656. this.stopAutoPanning(),
  4657. this.rotationSpeed.set(0, 0),
  4658. this.rotationAcceleration.set(0, 0),
  4659. this.panSpeed.set(0, 0),
  4660. this.panAcceleration.set(0, 0);
  4661. }),
  4662. (n.prototype.toJSON = function () {
  4663. var e = {
  4664. camera_position: {
  4665. x: s.toPrecision(this.camera.position.x, 4),
  4666. y: s.toPrecision(this.camera.position.y, 4),
  4667. z: s.toPrecision(this.camera.position.z, 4),
  4668. },
  4669. camera_quaternion: {
  4670. x: s.toPrecision(this.camera.quaternion.x, 4),
  4671. y: s.toPrecision(this.camera.quaternion.y, 4),
  4672. z: s.toPrecision(this.camera.quaternion.z, 4),
  4673. w: s.toPrecision(this.camera.quaternion.w, 4),
  4674. },
  4675. };
  4676. return e;
  4677. }),
  4678. (t.exports = n);
  4679. },
  4680. {
  4681. '../enum/ControlActions': 20,
  4682. '../enum/ControlEvents': 21,
  4683. '../enum/Keys': 30,
  4684. '../enum/MouseButton': 34,
  4685. '../enum/Vectors': 50,
  4686. '../settings': 166,
  4687. '../util/common': 185,
  4688. '../util/math': 190,
  4689. events: 202,
  4690. three: 217,
  4691. },
  4692. ],
  4693. 13: [
  4694. function (e, t, i) {
  4695. (function (i) {
  4696. 'use strict';
  4697. function n(e) {
  4698. (this.camera = e),
  4699. (this.camera.controls = this),
  4700. (this.target = new r.Vector3(0, 0, 0)),
  4701. (this.lookVector = new r.Vector3()),
  4702. (this.lookSpeed = 0.05),
  4703. (this.rotationAcc = new r.Vector2()),
  4704. (this.rotationSpeed = new r.Vector2()),
  4705. (this.lat = 0),
  4706. (this.lon = 0),
  4707. (this.phi = 0),
  4708. (this.theta = 0),
  4709. (this.enabled = !1),
  4710. (this.locked = !1),
  4711. (this.pointer = new r.Vector2(0, 0)),
  4712. (this.rotationHistory = []),
  4713. (this.rotationDifference = new r.Vector2()),
  4714. (this.pointerDragOn = !1),
  4715. (this.pointerDragStart = new r.Vector2(0, 0)),
  4716. (this.pinchDistance = 0),
  4717. (this.moveStart = new r.Vector2()),
  4718. (this.moveTolerance = 0.01),
  4719. (this.pointersLimit = 2),
  4720. (this.pointers = []);
  4721. }
  4722. var r = e('three'),
  4723. o = e('../util/logger'),
  4724. a = e('../settings'),
  4725. s = e('../util/common'),
  4726. l = e('../util/math'),
  4727. c = (e('../enum/Vectors'), e('../enum/MouseButton')),
  4728. h = e('../enum/Keys'),
  4729. u = e('../enum/ControlEvents'),
  4730. d = e('events').EventEmitter;
  4731. new o(i);
  4732. (n.prototype = Object.create(d.prototype)),
  4733. (n.prototype.usable = function () {
  4734. return this.enabled && !this.locked;
  4735. }),
  4736. /* n.prototype.lookAt = function(e) {
  4737. var t = this.camera.position.clone().sub(e)
  4738. , i = Math.atan(t.z / t.x);
  4739. i += t.x < 0 ? Math.PI : 0,
  4740. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4741. this.lon = r.Math.radToDeg(i) + 180;
  4742. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4743. , o = Math.atan(t.y / n);
  4744. this.lat = -r.Math.radToDeg(o)
  4745. }
  4746. */
  4747. (n.prototype.lookAt = function (aim, dir) {
  4748. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4749. var i = Math.atan(t.z / t.x);
  4750. i += t.x < 0 ? Math.PI : 0;
  4751. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4752. this.lon = r.Math.radToDeg(i) + 180;
  4753. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4754. o = Math.atan(t.y / n);
  4755. this.lat = -r.Math.radToDeg(o);
  4756. }),
  4757. (n.prototype.startRotationFrom = function (e, t) {
  4758. l.convertScreenPositionToNDC(e, t, this.pointer),
  4759. (this.pointerDragOn = !0),
  4760. this.pointerDragStart.copy(this.pointer),
  4761. this.moveStart.copy(this.pointer),
  4762. (this.rotationHistory = []),
  4763. this.rotationSpeed.set(0, 0);
  4764. }),
  4765. (n.prototype.onMouseOver = function (e) {
  4766. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e);
  4767. }),
  4768. (n.prototype.onTouchStart = function (e) {
  4769. if (this.usable()) {
  4770. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4771. case 1:
  4772. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4773. break;
  4774. case 2:
  4775. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4776. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height();
  4777. this.pinchDistance = Math.sqrt(t * t + i * i);
  4778. }
  4779. this.emit(u.InputStart, 'touch');
  4780. }
  4781. }),
  4782. (n.prototype.onPointerDown = function (e) {
  4783. this.usable() &&
  4784. 'touch' === e.pointerType &&
  4785. (this.pointers.length < this.pointersLimit &&
  4786. this.pointers.push({
  4787. id: e.pointerId,
  4788. clientX: e.clientX,
  4789. clientY: e.clientY,
  4790. }),
  4791. (e.touches = this.pointers),
  4792. this.onTouchStart(e),
  4793. this.emit(u.InputStart, 'pointer'));
  4794. }),
  4795. (n.prototype.onMouseDown = function (e) {
  4796. if (this.usable()) {
  4797. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4798. case c.LEFT:
  4799. this.startRotationFrom(e.clientX, e.clientY);
  4800. }
  4801. SoundManager.pause('tour'); // zeg 点击场景时停止语音
  4802. this.emit(u.InputStart, 'mouse');
  4803. }
  4804. }),
  4805. (n.prototype.updateRotation = function () {
  4806. if (this.usable() && this.pointerDragOn) {
  4807. var e = new r.Vector3(
  4808. this.pointerDragStart.x,
  4809. this.pointerDragStart.y,
  4810. -1
  4811. ).unproject(this.camera),
  4812. t = new r.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4813. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4814. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4815. o = Math.atan2(e.y, i),
  4816. a = Math.atan2(t.y, n);
  4817. (this.rotationDifference.y = r.Math.radToDeg(o - a)), (e.y = 0), (t.y = 0);
  4818. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4819. isNaN(s) ||
  4820. ((this.rotationDifference.x = r.Math.radToDeg(s)),
  4821. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4822. this.pointerDragStart.copy(this.pointer);
  4823. }
  4824. }),
  4825. (n.prototype.onMouseMove = function (e) {
  4826. this.usable() &&
  4827. (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4828. this.pointerDragOn &&
  4829. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance ||
  4830. Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4831. this.emit(u.Move, 'mouse'));
  4832. }),
  4833. (n.prototype.onTouchMove = function (e) {
  4834. if (this.usable())
  4835. switch ((this.emit(u.Move, 'touch'), e.touches.length)) {
  4836. case 1:
  4837. l.convertScreenPositionToNDC(
  4838. e.touches[0].clientX,
  4839. e.touches[0].clientY,
  4840. this.pointer
  4841. );
  4842. break;
  4843. case 2:
  4844. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4845. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4846. n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4847. Math.abs(n) > 0.01 &&
  4848. (this.emit(u.InteractionDirect),
  4849. this.emit(u.Pinch, n),
  4850. (this.pinchDistance -= n));
  4851. }
  4852. }),
  4853. (n.prototype.onPointerMove = function (e) {
  4854. this.usable() &&
  4855. 'touch' === e.pointerType &&
  4856. (this.pointers.forEach(function (t) {
  4857. e.pointerId === t.id && ((t.clientX = e.clientX), (t.clientY = e.clientY));
  4858. }),
  4859. (e.touches = this.pointers),
  4860. this.onTouchMove(e));
  4861. }),
  4862. (n.prototype.endRotation = function () {
  4863. this.pointerDragOn = !1;
  4864. var e = s.averageVectors(this.rotationHistory);
  4865. this.rotationSpeed.set(
  4866. e.x * a.rotationAfterMoveMultiplier,
  4867. e.y * a.rotationAfterMoveMultiplier
  4868. );
  4869. }),
  4870. (n.prototype.onTouchEnd = function (e) {
  4871. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation());
  4872. }),
  4873. (n.prototype.onMouseUp = function (e) {
  4874. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation());
  4875. }),
  4876. (n.prototype.onPointerUp = function (e) {
  4877. this.usable() &&
  4878. 'touch' === e.pointerType &&
  4879. (this.pointers.forEach(
  4880. function (t, i) {
  4881. e.pointerId === t.id && this.pointers.splice(i, 1);
  4882. }.bind(this)
  4883. ),
  4884. (e.touches = this.pointers),
  4885. this.onTouchEnd(e));
  4886. }),
  4887. (n.prototype.update = function (e) {
  4888. this.lon, this.lat;
  4889. for (
  4890. this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone());
  4891. this.rotationHistory.length > a.rotationAfterMoveHistoryCount;
  4892. )
  4893. this.rotationHistory.shift();
  4894. (this.lon += this.rotationDifference.x),
  4895. (this.lat += this.rotationDifference.y),
  4896. this.rotationDifference.set(0, 0);
  4897. //改
  4898. var friction = Math.min(1, a.rotationFriction * e * 60); //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4899. (this.rotationSpeed.x =
  4900. this.rotationSpeed.x * (1 - friction) +
  4901. this.rotationAcc.x * a.rotationAccelerationInside),
  4902. (this.rotationSpeed.y =
  4903. this.rotationSpeed.y * (1 - friction) +
  4904. this.rotationAcc.y * a.rotationAccelerationInside),
  4905. (this.lon += this.rotationSpeed.x * e),
  4906. (this.lat += this.rotationSpeed.y * e);
  4907. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4908. var insideLookLimitDown =
  4909. a.insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2;
  4910. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2;
  4911. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)); //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4912. (this.phi = r.Math.degToRad(90 - this.lat)),
  4913. (this.theta = r.Math.degToRad(this.lon)),
  4914. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4915. (this.lookVector.y = Math.cos(this.phi)),
  4916. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4917. this.target.copy(this.lookVector).add(this.camera.position),
  4918. this.camera.lookAt(this.target);
  4919. }),
  4920. (n.prototype.onMouseWheel = function (e) {
  4921. if (this.usable()) {
  4922. var t = e.wheelDelta || -e.detail;
  4923. this.emit(u.InteractionDirect), this.emit(u.Scroll, t);
  4924. }
  4925. }),
  4926. (n.prototype.onKeyDown = function (e) {
  4927. this.usable() &&
  4928. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)));
  4929. }),
  4930. (n.prototype.handleKeyDown = function (e) {
  4931. var t = function (e, t) {
  4932. this.rotationAcc[e] = t;
  4933. }.bind(this);
  4934. this.emit(u.InteractionKey);
  4935. var i = !0;
  4936. switch (e) {
  4937. case h.LEFTARROW:
  4938. case h.J:
  4939. t('x', -1);
  4940. break;
  4941. case h.RIGHTARROW:
  4942. case h.L:
  4943. t('x', 1);
  4944. break;
  4945. case h.I:
  4946. t('y', 1);
  4947. break;
  4948. case h.K:
  4949. t('y', -1);
  4950. break;
  4951. default:
  4952. i = !1;
  4953. }
  4954. i && this.emit(u.Move, 'key');
  4955. }),
  4956. (n.prototype.onKeyUp = function (e) {
  4957. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which));
  4958. }),
  4959. (n.prototype.handleKeyUp = function (e) {
  4960. switch (e) {
  4961. case h.LEFTARROW:
  4962. case h.J:
  4963. case h.RIGHTARROW:
  4964. case h.L:
  4965. this.rotationAcc.x = 0;
  4966. break;
  4967. case h.I:
  4968. case h.K:
  4969. this.rotationAcc.y = 0;
  4970. }
  4971. }),
  4972. (n.prototype.startRotating = function (e, t) {
  4973. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t);
  4974. }),
  4975. (n.prototype.stopRotating = function (e) {
  4976. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0);
  4977. }),
  4978. (n.prototype.reset = function () {
  4979. (this.pointerDragOn = !1),
  4980. this.rotationAcc.set(0, 0),
  4981. this.rotationSpeed.set(0, 0),
  4982. (this.pointers = []);
  4983. }),
  4984. (n.prototype.toJSON = function () {
  4985. var e = {
  4986. camera_position: {
  4987. x: l.toPrecision(this.camera.position.x, 4),
  4988. y: l.toPrecision(this.camera.position.y, 4),
  4989. z: l.toPrecision(this.camera.position.z, 4),
  4990. },
  4991. camera_quaternion: {
  4992. x: l.toPrecision(this.camera.quaternion.x, 4),
  4993. y: l.toPrecision(this.camera.quaternion.y, 4),
  4994. z: l.toPrecision(this.camera.quaternion.z, 4),
  4995. w: l.toPrecision(this.camera.quaternion.w, 4),
  4996. },
  4997. };
  4998. return e;
  4999. }),
  5000. (n.prototype.setStateFromJSON = function (e) {
  5001. this.camera.position.copy(e.camera_position),
  5002. this.camera.quaternion.copy(e.camera_quaternion);
  5003. }),
  5004. (t.exports = n);
  5005. }.call(this, '/js/controls/PanoramaControls.js'));
  5006. },
  5007. {
  5008. '../enum/ControlEvents': 21,
  5009. '../enum/Keys': 30,
  5010. '../enum/MouseButton': 34,
  5011. '../enum/Vectors': 50,
  5012. '../settings': 166,
  5013. '../util/common': 185,
  5014. '../util/logger': 189,
  5015. '../util/math': 190,
  5016. events: 202,
  5017. three: 217,
  5018. },
  5019. ],
  5020. 14: [
  5021. function (e, t, i) {
  5022. (function (i) {
  5023. 'use strict';
  5024. var n = e('three'),
  5025. r = e('../enum/Viewmode'),
  5026. o = e('../util/logger'),
  5027. a = new o(i);
  5028. t.exports = {
  5029. serialize: function (e) {
  5030. return encodeURI(JSON.stringify(e));
  5031. },
  5032. deserialize: function (e) {
  5033. function t(e) {
  5034. function t(e, t) {
  5035. return e && 'number' == typeof t && !isNaN(t);
  5036. }
  5037. return e.reduce(t, !0);
  5038. }
  5039. try {
  5040. var i = JSON.parse(decodeURI(e)),
  5041. o = {
  5042. mode: r.fromInt(i.camera_mode),
  5043. panoId: i.scan_id,
  5044. position: new n.Vector3().copy(i.camera_position),
  5045. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  5046. zoom: i.ortho_zoom,
  5047. floorVisibility: i.floor_visibility,
  5048. },
  5049. s = o.position;
  5050. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  5051. var l = o.quaternion;
  5052. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o;
  5053. } catch (i) {
  5054. a.debug(
  5055. 'Not able to parse start location as JSON; falling back to old array style parsing'
  5056. );
  5057. try {
  5058. var c = e.split(','),
  5059. h = {
  5060. x: parseFloat(c[2]),
  5061. y: parseFloat(c[3]),
  5062. z: parseFloat(c[4]),
  5063. },
  5064. u = {
  5065. x: parseFloat(c[5]),
  5066. y: parseFloat(c[6]),
  5067. z: parseFloat(c[7]),
  5068. w: parseFloat(c[8]),
  5069. };
  5070. return (
  5071. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  5072. t([u.x, u.y, u.z, u.w]) || ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  5073. {
  5074. mode: r.fromInt(c[0]),
  5075. panoId: c[1],
  5076. position: new n.Vector3().copy(h),
  5077. quaternion: new n.Quaternion().copy(u),
  5078. }
  5079. );
  5080. } catch (t) {
  5081. a.warn('Invalid start override, ignoring: "' + e + '"', t.message);
  5082. }
  5083. }
  5084. return null;
  5085. },
  5086. };
  5087. }.call(this, '/js/controls/serializer.js'));
  5088. },
  5089. {
  5090. '../enum/Viewmode': 51,
  5091. '../util/logger': 189,
  5092. three: 217,
  5093. },
  5094. ],
  5095. 15: [
  5096. function (e, t, i) {
  5097. (function (i) {
  5098. 'use strict';
  5099. function n() {
  5100. (this.endlessLoop = a.warp.loop),
  5101. (this.clock = new r.Clock(!0)),
  5102. (this.model = null),
  5103. (this.player = null),
  5104. (this.currentItem = null),
  5105. (this.destinationItem = null),
  5106. (this.tourIsPlaying = !1),
  5107. (this.transitionStage = y.None),
  5108. (this.nextFunc = null),
  5109. (this.onTheBus = !1),
  5110. (this.tourInProgress = !1),
  5111. (this.reachSource = null),
  5112. (this.interrupted = !1),
  5113. (this.nItems = 0),
  5114. (this.walkingSectionPaused = !1);
  5115. }
  5116. var r = e('three'),
  5117. o = e('./util/logger'),
  5118. a = e('./settings'),
  5119. s = e('./util/transitions'),
  5120. l = e('events').EventEmitter,
  5121. c = e('./enum/Viewmode'),
  5122. h = e('./analytics'),
  5123. u = e('./enum/WarpStyle'),
  5124. s = e('./util/transitions'),
  5125. d = (e('./model/ModelManager'), e('./enum/ModelManagerEvents')),
  5126. p = e('./enum/DirectorEvents'),
  5127. f = e('./enum/PlayerEvents'),
  5128. g = (e('./enum/ControlEvents'), e('./enum/BlackoutStyle')),
  5129. m = e('./enum/PathDiscardMode'),
  5130. v = e('./enum/PathDisplayMode'),
  5131. A = (e('./player'), new o(i)),
  5132. y = Object.freeze({
  5133. None: 0,
  5134. Moving: 1,
  5135. Aiming: 2,
  5136. Interlude: 3,
  5137. }),
  5138. C = Object.freeze({
  5139. Forward: 1,
  5140. NoChange: 0,
  5141. Backwards: -1,
  5142. }),
  5143. I = s.getUniqueId();
  5144. (n.prototype = Object.create(l.prototype)),
  5145. (n.prototype.init = function (e, t) {
  5146. (this.player = e),
  5147. (this.modelManager = t),
  5148. this.updateModel(),
  5149. this.resetAll(),
  5150. this.bindEvents();
  5151. // // zeg 查询pano对应的导览片段
  5152. // if(!this.panoIdMap) {
  5153. // this.panoIdMap = new Map()
  5154. // this.model.heroLocations.forEach( (value, index) => {
  5155. // // value.heroLocations.forEach( hl => {
  5156. // if(!value.heroLocations) return
  5157. // let hl = value.heroLocations[0]
  5158. // let arr = this.panoIdMap.get(hl.panoId)
  5159. // if(arr){
  5160. // this.panoIdMap.set(hl.panoId, [...arr, index])
  5161. // } else {
  5162. // this.panoIdMap.set(hl.panoId, [index])
  5163. // }
  5164. // // })
  5165. // })
  5166. // }
  5167. }),
  5168. (n.prototype.resetAll = function () {
  5169. if (
  5170. ((this.currentItem = null),
  5171. (this.destinationItem = null),
  5172. (this.tourIsPlaying = !1),
  5173. // this.bgmReplay(),//xzw
  5174. (this.transitionStage = y.None),
  5175. (this.nextFunc = null),
  5176. (this.onTheBus = !1),
  5177. (this.reachSource = null),
  5178. (this.interrupted = !1),
  5179. this.model)
  5180. ) {
  5181. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  5182. this.defaultWarpStyle =
  5183. this.model.data.hasOwnProperty('player_options') &&
  5184. this.model.data.player_options &&
  5185. this.model.data.player_options.fast_transitions === !1
  5186. ? e
  5187. : u.BLACK;
  5188. } else
  5189. (this.defaultWarpStyle = u.BLACK),
  5190. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  5191. this.resetSpecialTransition();
  5192. }),
  5193. (n.prototype.updateModel = function () {
  5194. (this.model = this.modelManager.getActiveModel()),
  5195. (this.nItems = this.model.heroLocations.length);
  5196. }),
  5197. (n.prototype.bindEvents = function () {
  5198. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  5199. this.player.on(
  5200. f.WarpInterruptedWithFlyTo,
  5201. this.checkAndHandleWalkingtourInterruption.bind(this)
  5202. ),
  5203. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  5204. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  5205. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  5206. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  5207. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  5208. this.player.once(f.Move, function () {
  5209. s.cancelById(I);
  5210. });
  5211. }),
  5212. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  5213. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  5214. return (
  5215. /* e === u.WALK && ( */ this.interrupt(g.NONE),
  5216. this.pauseWalkingSection(),
  5217. this.player.fastForwardActivePanoFlight(),
  5218. !0
  5219. ); /* ) */
  5220. }),
  5221. (n.prototype.handlePlayerMove = function (e) {
  5222. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  5223. this.emit('update.controls');
  5224. }),
  5225. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  5226. this.intermediateState() ||
  5227. e.id === t.id ||
  5228. ((this.onTheBus = !1), this.emit('update.controls'));
  5229. }),
  5230. (n.prototype.handlePlayerModeChanged = function (e, t) {
  5231. this.intermediateState() ||
  5232. e === t ||
  5233. ((this.onTheBus = !1), this.emit('update.controls'));
  5234. }),
  5235. (n.prototype.handlePlayerInputStart = function (e) {
  5236. this.transitionStage === y.Interlude && this.interrupt(g.NONE);
  5237. }),
  5238. (n.prototype.handlePlayerFlyingStarted = function () {
  5239. this.clearWalkingSectionPaused();
  5240. }),
  5241. (n.prototype.describe = function () {
  5242. return {
  5243. nItems: this.nItems,
  5244. currentItem: this.currentItem,
  5245. destinationItem: this.destinationItem,
  5246. tourIsPlaying: this.tourIsPlaying,
  5247. onTheBus: this.onTheBus,
  5248. endlessLoop: this.endlessLoop,
  5249. viewMode: this.player.mode,
  5250. inTransition: this._inTransition(),
  5251. transitionStage: this.transitionStage,
  5252. tourInProgress: this.tourInProgress,
  5253. };
  5254. }),
  5255. (n.prototype._inTransition = function () {
  5256. return (
  5257. this.player.flying ||
  5258. this.player.isWarping() ||
  5259. this.player.isWaitingToWarp() ||
  5260. this.player.mode === c.TRANSITIONING ||
  5261. this.tourIsPlaying
  5262. );
  5263. }),
  5264. (n.prototype.bounceable = function () {
  5265. var e = this.clock.getDelta();
  5266. return (
  5267. this.isInterrupted() ||
  5268. (e < 0.9 && e > 0.01) ||
  5269. (this.player.flying && !this.player.isWarping())
  5270. );
  5271. }),
  5272. (n.prototype.itemCompare = function (item1, item2, type) {
  5273. //add
  5274. if (type == 'equal') {
  5275. //==
  5276. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1];
  5277. } else if (type == 'less') {
  5278. //<
  5279. return (
  5280. (item1 && item2 && item1[0] < item2[0]) ||
  5281. (item1[0] == item2[0] && item1[1] < item2[1])
  5282. );
  5283. }
  5284. });
  5285. (n.prototype.currentMoveDirection = function () {
  5286. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  5287. return null === this.currentItem || void 0 === this.currentItem
  5288. ? y.Forward
  5289. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  5290. ? y.NoChange
  5291. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  5292. ? y.Forward
  5293. : y.Backwards;
  5294. }),
  5295. (n.prototype.clearPath = function () {
  5296. this._inTransition() || this.player.path.discardPathObject();
  5297. }),
  5298. (n.prototype.allFloors = function () {
  5299. this.model.toggleAllFloors();
  5300. }),
  5301. (n.prototype.actionComplete = function (e) {
  5302. if (
  5303. ((this.interrupted = !1),
  5304. (this.transitionStage = y.None),
  5305. this.resetSpecialTransition(),
  5306. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  5307. this.tourIsPlaying ||
  5308. (this.player.disablePreRendering(),
  5309. this.player.mode === c.PANORAMA &&
  5310. this.player.currentPano.isAligned() &&
  5311. this.model.fadePanoMarkers()),
  5312. this.emit('update.controls'),
  5313. this.nextFunc)
  5314. ) {
  5315. var t = this.nextFunc;
  5316. (this.nextFunc = null), t();
  5317. }
  5318. }),
  5319. (n.prototype.awaitCompletion = function (e, t) {
  5320. (this.nextFunc = t), e();
  5321. }),
  5322. (n.prototype.updateSuccessFunction = function (e) {
  5323. this.nextFunc = e;
  5324. }),
  5325. (n.prototype.interrupt = function (e, t) {
  5326. return (
  5327. !!this.wouldInterrupt() &&
  5328. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5329. (this.tourIsPlaying = !1),
  5330. //this.bgmReplay(),//xzw
  5331. (this.interrupted = !0),
  5332. (this.nextFunc = null),
  5333. this.emit(p.ActionInterrupted),
  5334. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  5335. this.player.interruptAndFastForward(e, t),
  5336. !0)
  5337. );
  5338. }),
  5339. (n.prototype.wouldInterrupt = function () {
  5340. return this.transitionStage !== y.None;
  5341. }),
  5342. (n.prototype.intermediateState = function () {
  5343. return this.transitionStage !== y.None;
  5344. }),
  5345. (n.prototype.isInterrupted = function () {
  5346. return this.interrupted;
  5347. }),
  5348. (n.prototype.pauseWalkingSection = function () {
  5349. this.walkingSectionPaused = !0;
  5350. }),
  5351. (n.prototype.clearWalkingSectionPaused = function () {
  5352. this.walkingSectionPaused = !1;
  5353. }),
  5354. (n.prototype.autoTour = function () {
  5355. var e = Date.now();
  5356. this.model.auxDataPromise.then(
  5357. function () {
  5358. e = Date.now() - e;
  5359. var t = a.warp.auto,
  5360. i =
  5361. this.model.data &&
  5362. this.model.data
  5363. .player_options; /* && this.model.data.player_options.highlight_reel */
  5364. t >= 0 &&
  5365. this.model.heroCount() > 1 &&
  5366. i &&
  5367. s.trigger({
  5368. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5369. done: function () {
  5370. this.playTour();
  5371. }.bind(this),
  5372. name: '_atr',
  5373. id: I,
  5374. });
  5375. }.bind(this)
  5376. );
  5377. }),
  5378. (n.prototype.atDestinationPano = function (pano) {
  5379. if (null === this.destinationItem) return !1;
  5380. pano = pano || this.player.currentPano;
  5381. if (!pano) {
  5382. return !1;
  5383. }
  5384. var destination =
  5385. this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem);
  5386. return destination && destination.panoId == pano.id;
  5387. }),
  5388. (n.prototype.redirectToItem = function (e, t) {
  5389. if (null === e || void 0 === e)
  5390. return void A.warn('Director.redirectToItem() -> Redirecting to null item.');
  5391. if (!this.wouldInterrupt())
  5392. return void A.warn(
  5393. 'Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.'
  5394. );
  5395. if (this.player.mode === c.TRANSITIONING)
  5396. return void A.debug(
  5397. 'Director.redirectToItem() -> Cannot redirect while transitioning.'
  5398. );
  5399. A.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t);
  5400. var i = function () {
  5401. s.setTimeout(
  5402. function () {
  5403. this.setDestinationItem(e),
  5404. this.goToDestination(
  5405. !0,
  5406. g.BEGINNING,
  5407. a.warp.warpInterruptionRedirectTime,
  5408. !1
  5409. );
  5410. }.bind(this),
  5411. 0
  5412. );
  5413. }.bind(this);
  5414. this.interrupt(g.END, 0), this.updateSuccessFunction(i);
  5415. }),
  5416. (n.prototype.useSpecialTransition = function (e) {
  5417. void 0 !== e &&
  5418. this.defaultWarpStyle !== u.BLACK &&
  5419. A.debug('useSpecialTransition(): ' + e),
  5420. (this.nextWarpStyle = u.BLACK);
  5421. }),
  5422. (n.prototype.resetSpecialTransition = function () {
  5423. this.nextWarpStyle = this.defaultWarpStyle;
  5424. }),
  5425. (n.prototype.arrivedAtDestination = function (e) {
  5426. if (this.player.flying || this.player.isWarping())
  5427. A.warn('Cannot advance to interlude or aiming while player is flying or warping.');
  5428. else {
  5429. this.transitionStage = y.Aiming;
  5430. var t = this.tourIsPlaying
  5431. ? this.tourInterlude.bind(this, this.nextItem(this.currentItem))
  5432. : null;
  5433. this.player.model.fadePanoMarkers(0),
  5434. this.awaitCompletion(
  5435. function () {
  5436. this.resetSpecialTransition(),
  5437. e
  5438. ? this.player.aimTourCamera(
  5439. this.destinationItem,
  5440. v.Retain,
  5441. v.Slow,
  5442. this.actionComplete.bind(this)
  5443. )
  5444. : this.actionComplete();
  5445. }.bind(this),
  5446. t
  5447. );
  5448. }
  5449. }),
  5450. (n.prototype.goToDestination = function (e, t, i, n) {
  5451. //音频
  5452. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo;
  5453. // zeg 手动导览不播放音频
  5454. if (musicInfo && musicInfo.music && !e) {
  5455. let musicType = localStorage.getItem('xunirole') || 'male';
  5456. let isMale = musicType.indexOf('female') < 0;
  5457. let fixMusic = isMale ? musicInfo.music : musicInfo.fmusic || musicInfo.music;
  5458. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  5459. let src = fixMusic;
  5460. let audioObj = SoundManager.list.find((e) => e.name == 'tour');
  5461. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  5462. let audioSrc2 = common.getFileNameFromUrl(src);
  5463. if (audioSrc1 == audioSrc2) {
  5464. //应该是继续播放该folder
  5465. if (this.destinationItem[1] == 0) {
  5466. //从头开始播放 因为可能暂停后然后再点该缩略图播
  5467. SoundManager.play('tour', null, 0); // currentTime = 0;
  5468. } else if (
  5469. audioObj.audio.paused &&
  5470. audioObj.audio.currentTime < audioObj.audio.duration
  5471. ) {
  5472. //未播完
  5473. SoundManager.play('tour'); //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  5474. }
  5475. } else {
  5476. //很可能是该folder的起始
  5477. SoundManager.play('tour', manage.dealURL(src));
  5478. }
  5479. }
  5480. let oldPos = this.player.position.clone();
  5481. let oldPano = this.player.currentPano;
  5482. if (
  5483. ((this.onTheBus = !0),
  5484. this.emit('update.controls'),
  5485. this.player.updateLastView(),
  5486. !n && this.atDestinationPano())
  5487. ) {
  5488. /*
  5489. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  5490. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5491. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  5492. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5493. } */
  5494. return void this.arrivedAtDestination(!0);
  5495. }
  5496. if (this.player.flying || this.player.isWarping())
  5497. A.warn('Cannot go to new destination while player is flying or warping.');
  5498. else {
  5499. var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
  5500. o = null,
  5501. a1 = null;
  5502. if (r.isPano()) {
  5503. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  5504. //var walk = window.DATA.black ? 'black' : 'walk';
  5505. //若是点击item,直接瞬间过渡。
  5506. var s = e ? 'black' : this.getMomentTour(this.destinationItem); //window.DATA.momentTour || "walk";
  5507. if (this.destinationItem[0] == 0 && this.destinationItem[1] == 0) s = 'black'; // 周恩光加 返回最初导览点是瞬间过渡
  5508. (a1 = this.player.warpToPanoByHeroIndex.bind(
  5509. this.player,
  5510. this.destinationItem,
  5511. v.Show,
  5512. m.Slow,
  5513. s,
  5514. true,
  5515. i,
  5516. this.actionComplete.bind(this)
  5517. )),
  5518. (o = this.arrivedAtDestination.bind(this, !0));
  5519. if (s == 'black' && r.zoom && r.zoom != this.player.zoomLevel) {
  5520. //add
  5521. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime); //瞬间过渡的时间
  5522. }
  5523. } else {
  5524. (a1 = this.player.warpToNonPanoByHeroIndex.bind(
  5525. this.player,
  5526. this.destinationItem,
  5527. this.actionComplete.bind(this)
  5528. )),
  5529. (o = this.arrivedAtDestination.bind(this, !1));
  5530. }
  5531. (this.transitionStage = y.Moving),
  5532. this.model.fadePanoMarkers(0),
  5533. this.awaitCompletion(
  5534. function () {
  5535. a1();
  5536. }.bind(this),
  5537. o
  5538. ),
  5539. this.emit('update.controls');
  5540. }
  5541. }),
  5542. (n.prototype.tourInterlude = function () {
  5543. if (
  5544. (h.trackAlways('reach_highlight', {
  5545. reach_source: this.reachSource,
  5546. }),
  5547. this.model.fadePanoMarkers(0),
  5548. this.emit('update.controls'),
  5549. this.tourIsPlaying)
  5550. )
  5551. return this.atEndOfTour() && !this.endlessLoop
  5552. ? ((this.tourInProgress = !1),
  5553. void this.awaitCompletion(
  5554. function () {
  5555. (this.transitionStage = y.Interlude),
  5556. this.player.tourInterlude(
  5557. this.nextItem(this.currentItem),
  5558. this.actionComplete.bind(this)
  5559. );
  5560. }.bind(this),
  5561. function () {
  5562. (this.currentItem = [0, 0]), this.stopTour(true), this.emit(p.TourEnd);
  5563. }.bind(this)
  5564. ),
  5565. void (
  5566. this.player.mode === c.PANORAMA &&
  5567. this.model.fadePanoMarkers(a.panorama.markerOpacity)
  5568. ))
  5569. : void this.awaitCompletion(
  5570. function () {
  5571. (this.transitionStage = y.Interlude),
  5572. this.player.tourInterlude(
  5573. this.nextItem(this.currentItem),
  5574. this.actionComplete.bind(this)
  5575. );
  5576. }.bind(this),
  5577. this.goNext.bind(this)
  5578. );
  5579. }),
  5580. (n.prototype.findNearestItem = function (endToStart = true) {
  5581. //找到离currentPano最近的导览
  5582. if (this.atDestinationPano(this.player.currentPano)) {
  5583. //在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  5584. return [0, 0];
  5585. }
  5586. //注:没有判断此刻是否在panorama模式,就使用currentPano
  5587. var result = { item: [0, 0], dis: Infinity };
  5588. var compare = (location, item) => {
  5589. if (location.panoId != void 0 && location.panoId != 'outside') {
  5590. var pano = this.model.panos.index[location.panoId];
  5591. var dis = pano.position.distanceTo(this.player.currentPano.position);
  5592. if (dis < result.dis) {
  5593. (result.item = item), (result.dis = dis);
  5594. } else if (dis == result.dis) {
  5595. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  5596. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  5597. result.item = item, result.dis = dis
  5598. } */
  5599. if (
  5600. this.currentItem &&
  5601. Math.abs(item[0] - this.currentItem[0]) <
  5602. Math.abs(result.item[0] - this.currentItem[0])
  5603. ) {
  5604. (result.item = item), (result.dis = dis);
  5605. }
  5606. }
  5607. }
  5608. };
  5609. this.model.heroLocations.forEach((e, i) => {
  5610. if (e.heroLocations) {
  5611. /* e.heroLocations.forEach((a,j)=>{
  5612. compare(a, [i,j])
  5613. }) */
  5614. var location = e.heroLocations.find((e) => e.panoId != void 0);
  5615. location && compare(location, [i, 0]); //跳到此区域开头
  5616. } else {
  5617. compare(e, [i, 0]);
  5618. }
  5619. });
  5620. if (endToStart && this.atEndOfTour(result.item)) {
  5621. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  5622. return [0, 0]; //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  5623. }
  5624. return result.item;
  5625. });
  5626. n.prototype.playTour = function () {
  5627. if (!this.bounceable() && this.model.heroLocations.length) {
  5628. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  5629. // if(!this.currentItem) this.currentItem = []
  5630. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  5631. // // zeg 从当前pano进行自动导览
  5632. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  5633. // // this.model.heroLocations.forEach( (value, index) => {
  5634. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  5635. // // currentPanoDestinations.push(index)
  5636. // // }
  5637. // // })
  5638. // if(!currentPanoDestinations) {
  5639. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  5640. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  5641. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  5642. // for(var i = 0; i < neighbourIndex.length; i++) {
  5643. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  5644. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  5645. // }
  5646. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  5647. // }
  5648. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  5649. // this.currentItem[0] = currentPanoDestinations[0]
  5650. // }
  5651. // }
  5652. return this.tourIsPlaying
  5653. ? void A.info('tour is already playing')
  5654. : void (
  5655. this.wouldInterrupt() ||
  5656. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5657. (this.tourInProgress = !0),
  5658. (this.reachSource = 'play'),
  5659. (this.tourIsPlaying = !0),
  5660. (this.wasZoomEnabled = this.player.zoomEnabled),
  5661. (this.player.zoomEnabled = !1),
  5662. this.resetSpecialTransition(),
  5663. this.emit('update.controls'),
  5664. this.emit(p.TourStart),
  5665. this.player.enablePreRendering(),
  5666. // this.currentItem[1] = null,
  5667. this.walkingSectionPaused
  5668. ? (this.clearWalkingSectionPaused(), this.goToDestination())
  5669. : this.goNext())
  5670. );
  5671. }
  5672. };
  5673. (n.prototype.playTourNearBy = function () {
  5674. //就近导览
  5675. if (!this.bounceable()) {
  5676. return this.tourIsPlaying
  5677. ? void A.info('tour is already playing')
  5678. : void (
  5679. this.wouldInterrupt() ||
  5680. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5681. (this.tourInProgress = !0),
  5682. (this.reachSource = 'play'),
  5683. (this.tourIsPlaying = !0),
  5684. (this.wasZoomEnabled = this.player.zoomEnabled),
  5685. (this.player.zoomEnabled = !1),
  5686. this.resetSpecialTransition(),
  5687. this.emit('update.controls'),
  5688. this.emit(p.TourStart),
  5689. this.player.enablePreRendering(),
  5690. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  5691. this.goToDestination()) : this.goNext())
  5692. // this.setDestinationItem(this.findNearestItem()),
  5693. // this.goToDestination())
  5694. );
  5695. }
  5696. }),
  5697. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5698. } */
  5699. (n.prototype.stopTour = function (isAutoStop) {
  5700. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5701. SoundManager.pause('tour'), // zeg 自动导览暂停时同时停止语音
  5702. this.isInterrupted() ||
  5703. (this.transitionStage === y.Moving &&
  5704. this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  5705. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5706. (this.tourIsPlaying = !1),
  5707. this.interrupt(),
  5708. this.clearWalkingSectionPaused(),
  5709. this.resetSpecialTransition(),
  5710. this.emit('update.controls'));
  5711. }),
  5712. (n.prototype.endTourProgress = function () {
  5713. (this.tourInProgress = !1), this.emit('update.controls'), this.emit(p.TourEnd);
  5714. }),
  5715. (n.prototype.goToHighlight = function (e) {
  5716. if (this.wouldInterrupt())
  5717. this.itemCompare(this.destinationItem, e, 'equal')
  5718. ? this.interrupt()
  5719. : this.redirectToItem(e, 'goToHighlight');
  5720. else {
  5721. if ((A.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return;
  5722. this.clearWalkingSectionPaused(),
  5723. this.setDestinationItem(e),
  5724. this.useSpecialTransition('Hilight');
  5725. this.goToDestination(true), //add true
  5726. h.trackAlways('reach_highlight', {
  5727. reach_source: 'thumb',
  5728. });
  5729. }
  5730. }),
  5731. (n.prototype.prevHighlight = function () {
  5732. this.bounceable() ||
  5733. (this.player.emit('tour_manual', 'prev'),
  5734. this.interrupt(g.BEGINNING) ||
  5735. this.isInterrupted() ||
  5736. (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()));
  5737. }),
  5738. (n.prototype.nextHighlight = function () {
  5739. this.bounceable() ||
  5740. (this.player.emit('tour_manual', 'next'),
  5741. this.interrupt(g.BEGINNING) ||
  5742. this.isInterrupted() ||
  5743. (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()));
  5744. }),
  5745. (n.prototype.changeMode = function (e) {
  5746. var t = $.Deferred(),
  5747. i = t.resolve.bind(t),
  5748. n = t.reject.bind(t);
  5749. this.emit(p.StartModeChange);
  5750. var r = function () {
  5751. return (
  5752. this.clearWalkingSectionPaused(),
  5753. !!this.wouldInterrupt() && (this.interrupt(), !0)
  5754. );
  5755. }.bind(this);
  5756. if (!r()) {
  5757. switch (e) {
  5758. case c.PANORAMA:
  5759. this.player.mode === c.PANORAMA
  5760. ? this.player.currentPano.isAligned() ||
  5761. this.player.goToLastView(!0).done(i).fail(n)
  5762. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  5763. break;
  5764. case c.DOLLHOUSE:
  5765. case c.FLOORPLAN:
  5766. this.player
  5767. .flyToNewMode({
  5768. mode: e,
  5769. })
  5770. .done(i)
  5771. .fail(n);
  5772. break;
  5773. case c.OUTDOOR:
  5774. this.player.model.has360Views &&
  5775. (this.player.mode !== c.PANORAMA ||
  5776. (this.player.mode === c.PANORAMA && this.player.currentPano.isAligned())) &&
  5777. this.player.goToLastView(!1).done(i).fail(n);
  5778. }
  5779. return t.promise();
  5780. }
  5781. }),
  5782. (n.prototype.atEndOfTour = function (currentItem = this.currentItem) {
  5783. var end = currentItem && currentItem[0] >= this.nItems - 1;
  5784. if (end) {
  5785. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations;
  5786. if (heroLocations) {
  5787. end = currentItem[1] >= heroLocations.length - 1;
  5788. }
  5789. }
  5790. return end;
  5791. }),
  5792. (n.prototype.firstDestination = function () {
  5793. //return 0 < this.nItems ? 0 : null
  5794. return 0 < this.nItems ? [0, 0] : null;
  5795. }),
  5796. (n.prototype.finalDestination = function () {
  5797. //return 0 < this.nItems ? this.nItems - 1 : null
  5798. return 0 < this.nItems ? [this.nItems - 1, 0] : null;
  5799. }),
  5800. (n.prototype.goPrev = function () {
  5801. this.tourAdvance(-1);
  5802. }),
  5803. (n.prototype.goNext = function () {
  5804. this.tourAdvance(1);
  5805. }),
  5806. (n.prototype.setDestinationItem = function (e) {
  5807. (this.destinationItem = e), this.emit('update.controls');
  5808. }),
  5809. (n.prototype.setCurrentItem = function (e) {
  5810. (this.currentItem = e), this.emit('update.controls');
  5811. }),
  5812. (n.prototype.nextItem = function (currentItem) {
  5813. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5814. if (currentItem == void 0) return this.firstDestination();
  5815. var currentLocation = this.model.heroLocations[currentItem[0]];
  5816. var currentChildNum = currentLocation.heroLocations
  5817. ? currentLocation.heroLocations.length
  5818. : 1;
  5819. var item;
  5820. if (this.currentItem[1] >= currentChildNum - 1) {
  5821. //子目录中最后一个
  5822. item = [currentItem[0] + 1, 0]; //结果可能超出nItems
  5823. } else {
  5824. item = [currentItem[0], currentItem[1] + 1];
  5825. }
  5826. if (item[0] >= this.nItems) {
  5827. item = this.firstDestination();
  5828. }
  5829. return item;
  5830. //暂时不理会endlessLoop,默认为false
  5831. }),
  5832. (n.prototype.prevItem = function (currentItem) {
  5833. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5834. if (currentItem == void 0) return this.firstDestination();
  5835. var item;
  5836. var lastLocation = this.model.heroLocations[currentItem[0] - 1];
  5837. if (!lastLocation)
  5838. return this.finalDestination(); //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5839. else {
  5840. var lastChildNum = lastLocation.heroLocations
  5841. ? lastLocation.heroLocations.length
  5842. : 1;
  5843. if (this.currentItem[1] == 0) {
  5844. //子目录中第一个
  5845. return [currentItem[0] - 1, lastChildNum - 1];
  5846. } else {
  5847. return [currentItem[0], currentItem[1] - 1];
  5848. }
  5849. }
  5850. }),
  5851. (n.prototype.tourAdvance = function (e) {
  5852. //e是1或-1
  5853. A.debug('tourAdvance(' + e + ')');
  5854. // // zeg改
  5855. if (null === this.currentItem || void 0 === this.currentItem) {
  5856. this.setDestinationItem(this.firstDestination())
  5857. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5858. // this.setDestinationItem([this.currentItem[0], 0]);
  5859. }
  5860. // else if(this.currentItem[1] == null) {
  5861. // this.setDestinationItem([this.currentItem[0], 0])
  5862. // }
  5863. else {
  5864. var item;
  5865. if (e == 1) {
  5866. item = this.nextItem(this.currentItem);
  5867. } else if (e == -1) {
  5868. item = this.prevItem(this.currentItem);
  5869. }
  5870. this.setDestinationItem(item);
  5871. }
  5872. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')) {
  5873. this.useSpecialTransition('reverse-looping to end');
  5874. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  5875. this.useSpecialTransition('looping back to start');
  5876. }
  5877. /* var momentTour = this.getMomentTour(this.destinationItem);
  5878. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5879. var zoomLevel = this.player.zoomLevel;
  5880. this.player.zoomEnabled = true;
  5881. var zoom = function(e, d) {
  5882. this.player.zoomTo((1-e)*zoomLevel, true)
  5883. }.bind(this)
  5884. s.start(zoom, 1500, function(){
  5885. }, 0, d.easeOutQuad, "zoom")
  5886. } */
  5887. this.goToDestination();
  5888. }),
  5889. (n.prototype.getMomentTour = function (destinationItem) {
  5890. //add
  5891. var wholeMomentTour = window.DATA.momentTour || 'walk'; //最外层 还有一种是'std'
  5892. if (!destinationItem) return wholeMomentTour;
  5893. else {
  5894. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem); //最内层。 如果有使用最内层
  5895. if (currentLocation.momentTour) return currentLocation.momentTour;
  5896. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5897. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5898. }
  5899. }),
  5900. (t.exports = n);
  5901. }.call(this, '/js/director.js'));
  5902. },
  5903. {
  5904. './analytics': 4,
  5905. './enum/BlackoutStyle': 18,
  5906. './enum/ControlEvents': 21,
  5907. './enum/DirectorEvents': 23,
  5908. './enum/ModelManagerEvents': 33,
  5909. './enum/PathDiscardMode': 38,
  5910. './enum/PathDisplayMode': 39,
  5911. './enum/PlayerEvents': 40,
  5912. './enum/Viewmode': 51,
  5913. './enum/WarpStyle': 52,
  5914. './model/ModelManager': 140,
  5915. './player': 155,
  5916. './settings': 166,
  5917. './util/logger': 189,
  5918. './util/transitions': 195,
  5919. events: 202,
  5920. three: 217,
  5921. },
  5922. ],
  5923. 16: [
  5924. function (e, t, i) {
  5925. 'use strict';
  5926. var n = e('three'),
  5927. r = e('./enum/Viewmode'),
  5928. o = (e('./settings'), e('./util/transitions')),
  5929. a = e('./enum/PlayerEvents'),
  5930. s = new n.ShaderPass(n.HorizontalBlurShader),
  5931. l = new n.ShaderPass(n.VerticalBlurShader);
  5932. l.renderToScreen = !0;
  5933. var c = $('#player').width() / $('#player').height();
  5934. isNaN(c) && (c = 1);
  5935. //initTransitionPass(n)
  5936. var h = {
  5937. currentBlur: 0,
  5938. aspect: c,
  5939. blurStrength: 1,
  5940. hblurPass: s,
  5941. vblurPass: l,
  5942. transitionMaskPass: new n.TransitionPass(),
  5943. bindEvents: function (e) {
  5944. e.on(a.ModeChanged, function (e, t) {
  5945. e === r.PANORAMA &&
  5946. (o.cancel(h.blur),
  5947. o.cancel(h.addBlur),
  5948. o.start(h.removeBlur, 500, null, 0, null, 'deblur'));
  5949. });
  5950. },
  5951. blur: function (e) {
  5952. h.currentBlur = e;
  5953. var t = e * h.blurStrength;
  5954. (l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512);
  5955. },
  5956. addBlur: function (e) {
  5957. (e = Math.max(e, h.currentBlur)), h.blur(e);
  5958. },
  5959. removeBlur: function (e) {
  5960. (e = Math.min(1 - e, h.currentBlur)), h.blur(e);
  5961. },
  5962. };
  5963. h.blur(0), (t.exports = h);
  5964. },
  5965. {
  5966. './enum/PlayerEvents': 40,
  5967. './enum/Viewmode': 51,
  5968. './settings': 166,
  5969. './util/transitions': 195,
  5970. three: 217,
  5971. },
  5972. ],
  5973. 17: [
  5974. function (e, t, i) {
  5975. 'use strict';
  5976. t.exports = {
  5977. UNKNOWN: 0,
  5978. ALIGNED: 1,
  5979. UNALIGNED: 2,
  5980. PLACED: 3,
  5981. };
  5982. },
  5983. {},
  5984. ],
  5985. 18: [
  5986. function (e, t, i) {
  5987. 'use strict';
  5988. t.exports = {
  5989. NONE: 0,
  5990. MIDDLE: 1,
  5991. END: 2,
  5992. BEGINNING: 3,
  5993. FADEIN: 4,
  5994. };
  5995. },
  5996. {},
  5997. ],
  5998. 19: [
  5999. function (e, t, i) {
  6000. 'use strict';
  6001. var n = e('three');
  6002. t.exports = {
  6003. newBlue: new n.Color(4967932),
  6004. altBlue: new n.Color(47355),
  6005. tagDefault: new n.Color(223357),
  6006. classicBlue: new n.Color(53759),
  6007. mpYellow: new n.Color(16502016),
  6008. mpOrange: new n.Color(16428055),
  6009. mpBlue: new n.Color(12096),
  6010. mpLtGrey: new n.Color(13751252),
  6011. mpDkGrey: new n.Color(10000019),
  6012. mpRed: new n.Color(12525854),
  6013. mpOrangeDesat: new n.Color(16764529),
  6014. mpBlueDesat: new n.Color(4034734),
  6015. mpRedDesat: new n.Color(14705505),
  6016. white: new n.Color(16777215),
  6017. black: new n.Color(0),
  6018. _desat: function (e, t) {
  6019. var i = t || 0.3,
  6020. r = new n.Color().copy(e).getHSL();
  6021. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l);
  6022. },
  6023. _darken: function (e, t) {
  6024. var i = t || 0.2,
  6025. r = e.getHSL();
  6026. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i));
  6027. },
  6028. };
  6029. },
  6030. {
  6031. three: 217,
  6032. },
  6033. ],
  6034. 20: [
  6035. function (e, t, i) {
  6036. 'use strict';
  6037. t.exports = {
  6038. NONE: -1,
  6039. ROTATE: 0,
  6040. DOLLY: 1,
  6041. PAN: 2,
  6042. ROTATE_DOLLY: 3,
  6043. PAN_DOLLY: 4,
  6044. };
  6045. },
  6046. {},
  6047. ],
  6048. 21: [
  6049. function (e, t, i) {
  6050. 'use strict';
  6051. t.exports = {
  6052. Move: 'move',
  6053. InteractionDirect: 'interaction.direct',
  6054. InteractionKey: 'interaction.key',
  6055. InteractionGui: 'interaction.gui',
  6056. FlyInDirection: 'fly.direction',
  6057. InputStart: 'input.start',
  6058. Pinch: 'input.pinch',
  6059. Scroll: 'input.scroll',
  6060. AutoPanInterrupt: 'autopan.interrupt',
  6061. AutoPanComplete: 'autopan.complete',
  6062. AutoPanClamped: 'autopan.clamped',
  6063. LongTap: 'longtap',
  6064. };
  6065. },
  6066. {},
  6067. ],
  6068. 22: [
  6069. function (e, t, i) {
  6070. 'use strict';
  6071. t.exports = Object.freeze({
  6072. FORWARD: 'FORWARD',
  6073. LEFT: 'LEFT',
  6074. RIGHT: 'RIGHT',
  6075. BACK: 'BACK',
  6076. UP: 'UP',
  6077. DOWN: 'DOWN',
  6078. });
  6079. },
  6080. {},
  6081. ],
  6082. 23: [
  6083. function (e, t, i) {
  6084. 'use strict';
  6085. t.exports = {
  6086. ActionInterrupted: 'action.interrupted',
  6087. TourStart: 'tour.start',
  6088. TourEnd: 'tour.end',
  6089. StartModeChange: 'mode.startChange',
  6090. };
  6091. },
  6092. {},
  6093. ],
  6094. 24: [
  6095. function (e, t, i) {
  6096. 'use strict';
  6097. t.exports = Object.freeze({
  6098. None: 0,
  6099. Queued: 1,
  6100. ForceQueued: 2,
  6101. Downloading: 3,
  6102. Downloaded: 4,
  6103. DownloadFailed: 5,
  6104. });
  6105. },
  6106. {},
  6107. ],
  6108. 25: [
  6109. function (e, t, i) {
  6110. 'use strict';
  6111. t.exports = {
  6112. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  6113. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  6114. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  6115. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  6116. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  6117. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5,
  6118. };
  6119. },
  6120. {},
  6121. ],
  6122. 26: [
  6123. function (e, t, i) {
  6124. 'use strict';
  6125. t.exports = {
  6126. Texture2D: 0,
  6127. TextureCube: 1,
  6128. };
  6129. },
  6130. {},
  6131. ],
  6132. 27: [
  6133. function (e, t, i) {
  6134. 'use strict';
  6135. t.exports = {
  6136. SMALL: 'small',
  6137. LARGE: 'large',
  6138. };
  6139. },
  6140. {},
  6141. ],
  6142. 28: [
  6143. function (e, t, i) {
  6144. 'use strict';
  6145. var n = e('./Viewmode'),
  6146. r = {
  6147. LANDING: {},
  6148. NAVIGATION: 'navigation',
  6149. MORE_HELP: 'moreHelp',
  6150. TOUR_INTERACTION: {},
  6151. };
  6152. (r.LANDING[n.PANORAMA] = 'panorama.landing'),
  6153. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  6154. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  6155. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  6156. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  6157. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  6158. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  6159. (t.exports = r);
  6160. },
  6161. {
  6162. './Viewmode': 51,
  6163. },
  6164. ],
  6165. 29: [
  6166. function (e, t, i) {
  6167. 'use strict';
  6168. var n = {
  6169. UP: 1,
  6170. DOWN: -1,
  6171. LEFT: 'L',
  6172. RIGHT: 'R',
  6173. FORWARD: 'F',
  6174. BACK: 'B',
  6175. reverse: {},
  6176. opposite: function (e) {
  6177. return this.reverse[e.toString()];
  6178. },
  6179. };
  6180. !(function () {
  6181. (n.reverse[n.UP] = n.DOWN),
  6182. (n.reverse[n.DOWN] = n.UP),
  6183. (n.reverse[n.LEFT] = n.RIGHT),
  6184. (n.reverse[n.RIGHT] = n.LEFT),
  6185. (n.reverse[n.FORWARD] = n.BACK),
  6186. (n.reverse[n.BACK] = n.FORWARD);
  6187. })(),
  6188. (t.exports = n);
  6189. },
  6190. {},
  6191. ],
  6192. 30: [
  6193. function (e, t, i) {
  6194. 'use strict';
  6195. var n = e('../util/browser'),
  6196. r = {
  6197. ZERO: 48,
  6198. ONE: 49,
  6199. TWO: 50,
  6200. THREE: 51,
  6201. FOUR: 52,
  6202. FIVE: 53,
  6203. SIX: 54,
  6204. SEVEN: 55,
  6205. EIGHT: 56,
  6206. NINE: 57,
  6207. LEFTARROW: 37,
  6208. UPARROW: 38,
  6209. RIGHTARROW: 39,
  6210. DOWNARROW: 40,
  6211. A: 65,
  6212. B: 66,
  6213. C: 67,
  6214. D: 68,
  6215. E: 69,
  6216. F: 70,
  6217. G: 71,
  6218. H: 72,
  6219. I: 73,
  6220. J: 74,
  6221. K: 75,
  6222. L: 76,
  6223. M: 77,
  6224. N: 78,
  6225. O: 79,
  6226. P: 80,
  6227. Q: 81,
  6228. R: 82,
  6229. S: 83,
  6230. T: 84,
  6231. U: 85,
  6232. V: 86,
  6233. W: 87,
  6234. X: 88,
  6235. Y: 89,
  6236. Z: 90,
  6237. SPACE: 32,
  6238. RETURN: 13,
  6239. SEMICOLON: 186,
  6240. PLUSEQUALS: 187,
  6241. DASHUNDERSCORE: 189,
  6242. OPENBRACKET: 219,
  6243. };
  6244. n.detectFirefox() && ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)),
  6245. (t.exports = r);
  6246. },
  6247. {
  6248. '../util/browser': 182,
  6249. },
  6250. ],
  6251. 31: [
  6252. function (e, t, i) {
  6253. 'use strict';
  6254. t.exports = {
  6255. EN_US: 'en-US',
  6256. ES_MX: 'es-MX',
  6257. FR_FR: 'fr-FR',
  6258. DE_DE: 'de-DE',
  6259. RU_RU: 'ru-RU',
  6260. CN_CN: 'cn-CN',
  6261. JP_JP: 'jp-JP',
  6262. };
  6263. },
  6264. {},
  6265. ],
  6266. 32: [
  6267. function (e, t, i) {
  6268. 'use strict';
  6269. t.exports = {
  6270. TagActivated: 'tag.activated',
  6271. TagDismissed: 'tag.dismissed',
  6272. TagNavigation: 'tag.navigation',
  6273. };
  6274. },
  6275. {},
  6276. ],
  6277. 33: [
  6278. function (e, t, i) {
  6279. 'use strict';
  6280. t.exports = {
  6281. ModelAdded: 'model-added',
  6282. ActiveModelChanged: 'active-model-changed',
  6283. };
  6284. },
  6285. {},
  6286. ],
  6287. 34: [
  6288. function (e, t, i) {
  6289. 'use strict';
  6290. t.exports = {
  6291. LEFT: 0,
  6292. MIDDLE: 1,
  6293. RIGHT: 2,
  6294. };
  6295. },
  6296. {},
  6297. ],
  6298. 35: [
  6299. function (e, t, i) {
  6300. 'use strict';
  6301. t.exports = {
  6302. PanoRenderComplete: 'panorama.render.complete',
  6303. TileRenderFailure: 'panorama.tile.render.failed',
  6304. TileRenderSuccess: 'panorama.tile.render.success',
  6305. TileUploadAttempted: 'panorama.tile.upload.attempted',
  6306. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  6307. ZoomLevelRenderStarted: 'panorama.zoom.render.started',
  6308. };
  6309. },
  6310. {},
  6311. ],
  6312. 36: [
  6313. function (e, t, i) {
  6314. 'use strict';
  6315. t.exports = {
  6316. BASE: 1,
  6317. STANDARD: 2,
  6318. HIGH: 3,
  6319. ULTRAHIGH: 4,
  6320. };
  6321. },
  6322. {},
  6323. ],
  6324. 37: [
  6325. function (e, t, i) {
  6326. 'use strict';
  6327. t.exports = {
  6328. LoadComplete: 'panorama.load.complete',
  6329. LoadFailed: 'panorama.load.failed',
  6330. TileLoaded: 'panorama.tile.loaded',
  6331. };
  6332. },
  6333. {},
  6334. ],
  6335. 38: [
  6336. function (e, t, i) {
  6337. 'use strict';
  6338. t.exports = Object.freeze({
  6339. Standard: 0,
  6340. Slow: 1,
  6341. Retain: 2,
  6342. });
  6343. },
  6344. {},
  6345. ],
  6346. 39: [
  6347. function (e, t, i) {
  6348. 'use strict';
  6349. t.exports = Object.freeze({
  6350. Show: 0,
  6351. Hide: 1,
  6352. Retain: 2,
  6353. });
  6354. },
  6355. {},
  6356. ],
  6357. 40: [
  6358. function (e, t, i) {
  6359. 'use strict';
  6360. t.exports = {
  6361. Move: 'move',
  6362. MoveComplete: 'move.complete',
  6363. ModeChanged: 'mode.changed',
  6364. ModeChanging: 'mode.changing',
  6365. PanoChosen: 'pano.chosen',
  6366. ClosestPanoChanging: 'closest.pano.changing',
  6367. WarpStarted: 'warp.started',
  6368. WarpInterrupted: 'warp.interrupted',
  6369. WarpEnded: 'warp.ended',
  6370. FlyinFinished: 'flyin.finished',
  6371. FlyingStarted: 'flying.started',
  6372. FlyingInterrupted: 'flying.interrupted',
  6373. FlyingEnded: 'flying.ended',
  6374. Ready: 'ready',
  6375. StartInside: 'start.inside',
  6376. StartOutside: 'start.outside',
  6377. ViewChanged: 'view.changed',
  6378. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  6379. InputStart: 'input.start',
  6380. };
  6381. },
  6382. {},
  6383. ],
  6384. 41: [
  6385. function (e, t, i) {
  6386. 'use strict';
  6387. t.exports = Object.freeze({
  6388. DEFAULT: 0,
  6389. PANOMARKERS: 1,
  6390. RETICULE: 2,
  6391. TAG: 3,
  6392. });
  6393. },
  6394. {},
  6395. ],
  6396. 42: [
  6397. function (e, t, i) {
  6398. 'use strict';
  6399. t.exports = {
  6400. visibleFloor: 1,
  6401. ghostFloor: 3,
  6402. boundingSkybox: 1,
  6403. panoMarker: 2,
  6404. reticule: 3,
  6405. tagStem: 4,
  6406. tagDisc: 5,
  6407. ribbon: 100,
  6408. };
  6409. },
  6410. {},
  6411. ],
  6412. 43: [
  6413. function (e, t, i) {
  6414. 'use strict';
  6415. t.exports = {
  6416. ContextCreated: 'scene-renderer-context-created',
  6417. AfterRender: 'after-render',
  6418. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated',
  6419. };
  6420. },
  6421. {},
  6422. ],
  6423. 44: [
  6424. function (e, t, i) {
  6425. 'use strict';
  6426. t.exports = {
  6427. IDLE: 'idle',
  6428. BROWSE: 'browse',
  6429. EXAMINE: 'examine',
  6430. };
  6431. },
  6432. {},
  6433. ],
  6434. 45: [
  6435. function (e, t, i) {
  6436. 'use strict';
  6437. t.exports = {
  6438. TileDownloadSuccess: 'tiledownloader.download.success',
  6439. TileDownloadFailure: 'tiledownloader.download.failure',
  6440. PanoDownloadComplete: 'tiledownloader.pano.download.complete',
  6441. };
  6442. },
  6443. {},
  6444. ],
  6445. 46: [
  6446. function (e, t, i) {
  6447. 'use strict';
  6448. t.exports = {
  6449. CardboardAndroid: 'googlevr',
  6450. GearVR: 'gearvr',
  6451. CardboardIOS: 'googlevrios',
  6452. Cardboard: 'googlevr',
  6453. };
  6454. },
  6455. {},
  6456. ],
  6457. 47: [
  6458. function (e, t, i) {
  6459. 'use strict';
  6460. t.exports = {
  6461. NONE: 0,
  6462. CONTEXTUAL: 1,
  6463. ANDROID: 2,
  6464. };
  6465. },
  6466. {},
  6467. ],
  6468. 48: [
  6469. function (e, t, i) {
  6470. 'use strict';
  6471. var n = {
  6472. Title: 0,
  6473. Cardboard: 1,
  6474. },
  6475. r = {
  6476. Title: 0,
  6477. Cardboard: 1,
  6478. Gear: 2,
  6479. };
  6480. !(function () {
  6481. [n, r].forEach(function (e) {
  6482. e.pageCount = Object.keys(e).length;
  6483. });
  6484. })(),
  6485. (t.exports.ios = n),
  6486. (t.exports.standard = r);
  6487. },
  6488. {},
  6489. ],
  6490. 49: [
  6491. function (e, t, i) {
  6492. 'use strict';
  6493. t.exports = {
  6494. Android: 'android',
  6495. IOS: 'ios',
  6496. Desktop: 'desktop',
  6497. UnsupportedAndroid: 'android-unsupported',
  6498. };
  6499. },
  6500. {},
  6501. ],
  6502. 50: [
  6503. function (e, t, i) {
  6504. 'use strict';
  6505. var n = e('three');
  6506. t.exports = {
  6507. UP: new n.Vector3(0, 1, 0),
  6508. DOWN: new n.Vector3(0, -1, 0),
  6509. LEFT: new n.Vector3(-1, 0, 0),
  6510. RIGHT: new n.Vector3(1, 0, 0),
  6511. FORWARD: new n.Vector3(0, 0, -1),
  6512. BACK: new n.Vector3(0, 0, 1),
  6513. };
  6514. },
  6515. {
  6516. three: 217,
  6517. },
  6518. ],
  6519. 51: [
  6520. function (e, t, i) {
  6521. 'use strict';
  6522. var n = e('../exception/ViewmodeConvertException'),
  6523. r = e('./coreViewmodes'),
  6524. o = e('../util/common'),
  6525. a = {
  6526. MESH: 'mesh',
  6527. OUTDOOR: 'outdoor',
  6528. TRANSITIONING: 'transitioning',
  6529. toInt: function (e) {
  6530. switch (e) {
  6531. case this.PANORAMA:
  6532. return 1;
  6533. case this.DOLLHOUSE:
  6534. return 2;
  6535. case this.FLOORPLAN:
  6536. return 3;
  6537. case this.OUTDOOR:
  6538. return 4;
  6539. case this.TRANSITIONING:
  6540. return -1;
  6541. }
  6542. throw new n('No known conversion for Viewmode to int for mode: ' + e);
  6543. },
  6544. fromInt: function (e) {
  6545. switch (e) {
  6546. case '1':
  6547. case 1:
  6548. return this.PANORAMA;
  6549. case '2':
  6550. case 2:
  6551. return this.DOLLHOUSE;
  6552. case '3':
  6553. case 3:
  6554. return this.FLOORPLAN;
  6555. case '4':
  6556. case 4:
  6557. return this.OUTDOOR;
  6558. }
  6559. throw new n('No known conversion for int to viewmode for int: ' + e);
  6560. },
  6561. convertWorkshopModeInt: function (e) {
  6562. switch (e) {
  6563. case '0':
  6564. case 0:
  6565. case undefined: //xzw add
  6566. return this.PANORAMA;
  6567. case '1':
  6568. case 1:
  6569. return this.FLOORPLAN;
  6570. case '2':
  6571. case 2:
  6572. return this.DOLLHOUSE;
  6573. case '3':
  6574. case 3:
  6575. return this.MESH;
  6576. }
  6577. throw new n('No known conversion for Workshop int to viewmode for int: ' + e);
  6578. },
  6579. };
  6580. o.extendObject(a, r), (t.exports = a);
  6581. },
  6582. {
  6583. '../exception/ViewmodeConvertException': 58,
  6584. '../util/common': 185,
  6585. './coreViewmodes': 54,
  6586. },
  6587. ],
  6588. 52: [
  6589. function (e, t, i) {
  6590. 'use strict';
  6591. t.exports = {
  6592. BLACK: 'black',
  6593. STD: 'std',
  6594. WALK: 'walk',
  6595. };
  6596. },
  6597. {},
  6598. ],
  6599. 53: [
  6600. function (e, t, i) {
  6601. 'use strict';
  6602. t.exports = {
  6603. ZoomIn: 'zoom.in',
  6604. ZoomOut: 'zoom.out',
  6605. ZoomMax: 'zoom.max',
  6606. ZoomMin: 'zoom.min',
  6607. };
  6608. },
  6609. {},
  6610. ],
  6611. 54: [
  6612. function (e, t, i) {
  6613. 'use strict';
  6614. t.exports = {
  6615. PANORAMA: 'panorama',
  6616. DOLLHOUSE: 'dollhouse',
  6617. FLOORPLAN: 'floorplan',
  6618. };
  6619. },
  6620. {},
  6621. ],
  6622. 55: [
  6623. function (e, t, i) {
  6624. 'use strict';
  6625. function n(e) {
  6626. this.message = e;
  6627. }
  6628. t.exports = n;
  6629. },
  6630. {},
  6631. ],
  6632. 56: [
  6633. function (e, t, i) {
  6634. 'use strict';
  6635. function n(e) {
  6636. r.call(this, e);
  6637. }
  6638. var r = e('./BasicException');
  6639. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  6640. },
  6641. {
  6642. './BasicException': 55,
  6643. },
  6644. ],
  6645. 57: [
  6646. function (e, t, i) {
  6647. 'use strict';
  6648. function n(e) {
  6649. r.call(this, e);
  6650. }
  6651. var r = e('./BasicException');
  6652. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  6653. },
  6654. {
  6655. './BasicException': 55,
  6656. },
  6657. ],
  6658. 58: [
  6659. function (e, t, i) {
  6660. 'use strict';
  6661. function n(e) {
  6662. r.call(this, e);
  6663. }
  6664. var r = e('./BasicException');
  6665. (n.prototype = Object.create(r.prototype)), (t.exports = n);
  6666. },
  6667. {
  6668. './BasicException': 55,
  6669. },
  6670. ],
  6671. 59: [
  6672. function (e, t, i) {
  6673. (function (i) {
  6674. 'use strict';
  6675. function n(e) {
  6676. var t = {};
  6677. if (e) {
  6678. var i = e.flags;
  6679. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0);
  6680. return t;
  6681. }
  6682. return l.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null;
  6683. }
  6684. var r = e('./util/ajax'),
  6685. o = e('./util/showcase'),
  6686. a = e('./util/logger'),
  6687. s = '',
  6688. l = new a(i),
  6689. c = {};
  6690. t.exports = {
  6691. loadFeatureFlags: function (e) {
  6692. var t = $.Deferred();
  6693. return (
  6694. r
  6695. .get(e.urlBase + s, {
  6696. responseType: 'json',
  6697. prefetchFrom: 'user',
  6698. auth: o.getAuthorizationHeader(),
  6699. })
  6700. .done(function (e) {
  6701. (c = n(e)), c ? t.resolve(c) : t.reject('loading-failed');
  6702. })
  6703. .fail(function () {
  6704. l.debug('Retrieval of feature flags failed.'), t.reject('loading-failed');
  6705. }),
  6706. t.promise()
  6707. );
  6708. },
  6709. getFlags: function () {
  6710. return c;
  6711. },
  6712. updateDependentSettings: function (e, t) {
  6713. (e = e || c),
  6714. e.labels && (t.labels.enabled = !0),
  6715. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  6716. e.showcase_sdk && (t.sdkInit = !0),
  6717. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  6718. e.showcase_webvr && (t.vr.allowWebVR = !0),
  6719. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  6720. e.hide_sc_sharing && (t.share.enabled = !1);
  6721. },
  6722. };
  6723. }.call(this, '/js/featureflags.js'));
  6724. },
  6725. {
  6726. './util/ajax': 181,
  6727. './util/logger': 189,
  6728. './util/showcase': 193,
  6729. },
  6730. ],
  6731. 60: [
  6732. function (e, t, i) {
  6733. 'use strict';
  6734. var n =
  6735. (e('../util/common'),
  6736. {
  6737. status: 0,
  6738. set: function (e) {
  6739. if (isNaN(e)) return !1;
  6740. var t = $('.progressbar');
  6741. 0 > e && (e = 0);
  6742. e > 100 && (e = 100);
  6743. var width = parseInt(t.css('width').replace('px', '')) / 100; //获取进度条总长度除以100
  6744. var barperc = e * width;
  6745. var perc = Math.round(e);
  6746. var labelpos = parseInt(barperc) - 15;
  6747. t.find('.bar').css('width', barperc); //已经再跑颜色的百分比
  6748. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  6749. t.find('.perc').text(perc + '%'); //具体数字的百分比
  6750. this.status = e;
  6751. },
  6752. done: function (e) {
  6753. return e || this.status ? ((this.status = null), this.set(100)) : this;
  6754. },
  6755. });
  6756. t.exports.circleLoader = n;
  6757. },
  6758. {
  6759. '../util/common': 185,
  6760. },
  6761. ],
  6762. 61: [
  6763. function (e, t, i) {
  6764. 'use strict';
  6765. t.exports = Object.freeze({
  6766. CLOSE: 'modal.closer.close',
  6767. });
  6768. },
  6769. {},
  6770. ],
  6771. 62: [
  6772. function (e, t, i) {
  6773. 'use strict';
  6774. function n(e, t) {
  6775. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(l.CLOSE, e), g.reset();
  6776. }
  6777. function r(e, t) {
  6778. function i() {
  6779. var t =
  6780. e.offsetHeight >= $('#player').height() && e.offsetWidth >= $('#player').width();
  6781. t !== f &&
  6782. ((f = t),
  6783. t
  6784. ? (e.classList.add('closeByFooter'), h.classList.add('closeByFooter'))
  6785. : (e.classList.remove('closeByFooter'), h.classList.remove('closeByFooter')));
  6786. }
  6787. t ? setTimeout(i, o.guiAnimationSpeed) : i();
  6788. }
  6789. var o = e('../../settings'),
  6790. a = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  6791. s = e('../../util/common'),
  6792. l = e('./ModalCloserEvent'),
  6793. c = e('events').EventEmitter,
  6794. h = document.getElementsByClassName('footer')[0],
  6795. u = h.querySelectorAll('.close')[0],
  6796. d = null,
  6797. p = null,
  6798. f = null,
  6799. g =
  6800. (a.isMobile(),
  6801. {
  6802. open: function (e) {
  6803. e &&
  6804. (r(e),
  6805. d && u.removeEventListener('click', d, !0),
  6806. (d = n.bind(this, e.id)),
  6807. u.addEventListener('click', d, !0),
  6808. p && window.removeEventListener('resize', p, !0),
  6809. (p = r.bind(this, e)),
  6810. window.addEventListener('resize', p, !0));
  6811. },
  6812. reset: function () {
  6813. h.classList.remove('closeByFooter'),
  6814. u.removeEventListener('click', d, !0),
  6815. window.removeEventListener('resize', p, !0),
  6816. (d = p = f = null);
  6817. },
  6818. });
  6819. s.extendObject(g, c.prototype), (t.exports = g);
  6820. },
  6821. {
  6822. '../../tag/Media/MediaEvent': 131,
  6823. '../../settings': 166,
  6824. '../../util/browser': 182,
  6825. '../../util/common': 185,
  6826. './ModalCloserEvent': 61,
  6827. events: 202,
  6828. },
  6829. ],
  6830. 63: [
  6831. function (e, t, i) {
  6832. 'use strict';
  6833. function n(e, t, i) {
  6834. var n = new r.GUI({
  6835. width: 400,
  6836. }),
  6837. u = n.addFolder('Flydown from Dollhouse');
  6838. u.add(h.flydown, 'movementEasing', Object.keys(a)),
  6839. u.add(h.flydown, 'movementDelay', 0, 1).step(0.01),
  6840. u.add(h.flydown, 'rotationEasing', Object.keys(a)),
  6841. u.add(h.flydown, 'rotationDelay', 0, 1).step(0.01),
  6842. u.add(h.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  6843. u.add(h.flydown, 'skyboxDelay', 0, 1).step(0.01),
  6844. u.add(h.dollhouseDefault, 'minPolarAngle', 0, o.Math.degToRad(50)),
  6845. u.add(h.dollhouseDefault, 'maxPolarAngle', o.Math.degToRad(50), o.Math.degToRad(170));
  6846. var d = n.addFolder('Transition between panos');
  6847. d.add(h.transition, 'blur', 0, 10).onFinishChange(function () {}),
  6848. d
  6849. .add(h.transition, 'flySpeed', 0, 10)
  6850. .step(0.01)
  6851. .onFinishChange(function () {
  6852. (h.transition.flyTime = 0),
  6853. d.__controllers.forEach(function (e) {
  6854. e.updateDisplay();
  6855. });
  6856. }),
  6857. d.add(h.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  6858. (h.transition.flySpeed = 0),
  6859. d.__controllers.forEach(function (e) {
  6860. e.updateDisplay();
  6861. });
  6862. }),
  6863. d.add(h.transition, 'aimTime', 500, 2500).step(50),
  6864. d.add(h.transition, 'aimSlowFactor', 1, 3).step(0.1),
  6865. d.add(h.transition, 'movementEasing', Object.keys(a));
  6866. var p = n.addFolder('Path Display');
  6867. p
  6868. .add(h.path, 'opacity', 0, 1)
  6869. .step(0.01)
  6870. .onFinishChange(function () {}),
  6871. p
  6872. .add(h.path, 'height', 0, 0.2)
  6873. .step(0.01)
  6874. .onFinishChange(function () {}),
  6875. p
  6876. .add(h.path, 'outsideHeight', 0, 2)
  6877. .step(0.01)
  6878. .onFinishChange(function () {}),
  6879. p
  6880. .add(h.path, 'ribbonWidth', 0.01, 0.35)
  6881. .step(0.01)
  6882. .onFinishChange(function () {}),
  6883. p
  6884. .add(h.path, 'waypointRadius', 0.01, 1.2)
  6885. .step(0.01)
  6886. .onFinishChange(function () {}),
  6887. p
  6888. .add(h.path, 'waypointPulse', 0, 3600)
  6889. .step(20)
  6890. .onFinishChange(function () {}),
  6891. p
  6892. .add(h.path, 'waypointIndoorRadius', 0.01, 1.2)
  6893. .step(0.01)
  6894. .onFinishChange(function () {}),
  6895. p
  6896. .add(h.path, 'fadeInTime', 0, 1200)
  6897. .step(10)
  6898. .onFinishChange(function () {}),
  6899. p
  6900. .add(h.path, 'fadeOutTime', 0, 1200)
  6901. .step(10)
  6902. .onFinishChange(function () {}),
  6903. p.add(h.path, 'color', Object.keys(l)).onFinishChange(function () {
  6904. (h.path.color = l[h.path.color]),
  6905. (h.path.colorUp = l._desat(h.path.color)),
  6906. (h.path.colorDown = l.darken(h.path.color));
  6907. }),
  6908. p.add(h, 'reticuleColor', Object.keys(l)).onFinishChange(function () {
  6909. h.reticuleColor = l[h.reticuleColor];
  6910. });
  6911. var f = n.addFolder('Warping'),
  6912. g = f.addFolder('Warp/Teleport');
  6913. g.add(h.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  6914. g
  6915. .add(h.warp, 'softPushEnd', 0, 1)
  6916. .step(0.01)
  6917. .onFinishChange(function () {}),
  6918. g.add(h.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  6919. g.add(h.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  6920. g
  6921. .add(h.warp, 'softBendEnd', 0, 1)
  6922. .step(0.01)
  6923. .onFinishChange(function () {}),
  6924. g.add(h.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  6925. g.add(h.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  6926. g.add(h.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  6927. g
  6928. .add(h.warp, 'minBrakeAngle', 0, 5)
  6929. .step(0.01)
  6930. .onFinishChange(function () {}),
  6931. g
  6932. .add(h.warp, 'maxBrakeAngle', 0, 5)
  6933. .step(0.01)
  6934. .onFinishChange(function () {}),
  6935. g.add(h.path, 'mapGuides').onFinishChange(function () {}),
  6936. g
  6937. .add(h.warp, 'teleportTime', 0, 5e3)
  6938. .step(10)
  6939. .onFinishChange(function () {}),
  6940. g
  6941. .add(h.warp, 'outsideTime', 0, 5e3)
  6942. .step(10)
  6943. .onFinishChange(function () {}),
  6944. g.add(h.path, 'typ', Object.keys(c)).onFinishChange(function () {
  6945. h.path.typ = c[h.path.typ];
  6946. }),
  6947. g
  6948. .add(h.warp, 'loop')
  6949. .onChange(function () {})
  6950. .onFinishChange(function () {
  6951. t.endlessLoop = h.warp.loop;
  6952. }),
  6953. g
  6954. .add(h.warp, 'walkSlideShowThreshhold', 1, 1e4)
  6955. .step(1)
  6956. .onFinishChange(function () {}),
  6957. g
  6958. .add(h.warp, 'walkExtraPanosDistance', 0, 3)
  6959. .step(0.1)
  6960. .onFinishChange(function () {}),
  6961. g
  6962. .add(h.transition, 'fastForwardFactor', 1, 10)
  6963. .step(1)
  6964. .onFinishChange(function () {});
  6965. var m = f.addFolder('Long Warp Only');
  6966. m
  6967. .add(h.warp, 'minWarpTime', 0, 5e3)
  6968. .step(10)
  6969. .onFinishChange(function () {
  6970. (h.warp.flySpeed = 0),
  6971. m.__controllers.forEach(function (e) {
  6972. e.updateDisplay();
  6973. });
  6974. }),
  6975. m
  6976. .add(h.warp, 'timePerMeter', 0, 5e3)
  6977. .step(10)
  6978. .onFinishChange(function () {}),
  6979. m
  6980. .add(h.warp, 'lookAheadMax', 0.01, 1)
  6981. .step(0.01)
  6982. .onFinishChange(function () {}),
  6983. m
  6984. .add(h.warp, 'lookAheadDist', 0.01, 4)
  6985. .step(0.01)
  6986. .onFinishChange(function () {}),
  6987. m
  6988. .add(h.warp, 'maxTurnPerSec', 0, 720)
  6989. .step(1)
  6990. .onFinishChange(function () {}),
  6991. m
  6992. .add(h.warp, 'maxAimPerSec', 0, 720)
  6993. .step(1)
  6994. .onFinishChange(function () {}),
  6995. m
  6996. .add(h.warp, 'turnFriction', 0, 1)
  6997. .step(0.01)
  6998. .onFinishChange(function () {}),
  6999. m
  7000. .add(h.warp, 'walkDelay', 0, 2e3)
  7001. .step(10)
  7002. .onFinishChange(function () {}),
  7003. m
  7004. .add(h.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  7005. .step(10)
  7006. .onFinishChange(function () {}),
  7007. m
  7008. .add(h.warp, 'walkMaxDist', 0, 100)
  7009. .step(1)
  7010. .onFinishChange(function () {});
  7011. var v = n.addFolder('Warp Esoterica');
  7012. v
  7013. .add(h.warp, 'nearPanoDist', 0.01, 12)
  7014. .step(0)
  7015. .onFinishChange(function () {}),
  7016. v.add(h.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  7017. v
  7018. .add(h.warp, 'flySpeed', 0, 10)
  7019. .step(0.01)
  7020. .onFinishChange(function () {
  7021. (h.warp.minWarpTime = 0),
  7022. v.__controllers.forEach(function (e) {
  7023. e.updateDisplay();
  7024. });
  7025. }),
  7026. v.add(h.warp, 'showBunny').onFinishChange(function () {}),
  7027. v
  7028. .add(h.warp, 'fastTime', 0, 2500)
  7029. .step(10)
  7030. .onFinishChange(function () {}),
  7031. v.add(h.warp, 'movementEasing', Object.keys(a));
  7032. var A = n.addFolder('Misc');
  7033. A.add(h, 'dollhouseFOV', 10, 180).onChange(function () {
  7034. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV;
  7035. }),
  7036. A.add(h, 'insideFOV', 10, 180).onChange(function () {
  7037. i.cameras[s.PANORAMA].fov = h.insideFOV;
  7038. }),
  7039. A.add(h, 'insideLookSpeed', 0.01, 0.3)
  7040. .step(0.01)
  7041. .onChange(function () {}),
  7042. A.add(h, 'rotationAccelerationInside', 0.1, 10)
  7043. .step(0.1)
  7044. .onChange(function () {}),
  7045. A.add(h, 'rotationAccelerationOutside', 0.1, 10)
  7046. .step(0.1)
  7047. .onChange(function () {});
  7048. var y = n.addFolder('Navigation');
  7049. y.add(h.navigation, 'panoScores').onFinishChange(function () {
  7050. h.navigation.panoScores ||
  7051. e.panos.forEach(function (e) {
  7052. e.floor.remove(e.text3d), (e.text3d = null);
  7053. });
  7054. }),
  7055. y.add(h.navigation, 'mouseDirection'),
  7056. y.add(h.navigation, 'filterStrictness', 0, 1),
  7057. y.add(h.navigation, 'angleFactor', -60, 0),
  7058. y.add(h.navigation, 'directionFactor', 1, 20),
  7059. y.add(h.navigation, 'distanceFactor', -5, 5),
  7060. y.add(h.navigation, 'optionalityFactor', 0.1, 10);
  7061. var C = n.addFolder('tags'),
  7062. I = C.addFolder('Tag Creation');
  7063. I.add(h.tags.pole, 'enabled').name('poleEnabled'),
  7064. I.add(h.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  7065. I.add(h.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  7066. I.add(h.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity');
  7067. var E = C.addFolder('Visibility');
  7068. E.add(h.tags.visibility, 'anyDistance'),
  7069. E.add(h.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  7070. E.add(h.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  7071. E.add(h.tags.visibility, 'hideViaFloor'),
  7072. E.add(h.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  7073. E.add(h.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject');
  7074. var b = C.addFolder('Disc Parameters');
  7075. b.add(h.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  7076. b.add(h.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  7077. b.add(h.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  7078. e &&
  7079. (h.tags.disc.scale.farBound =
  7080. h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100));
  7081. }),
  7082. b
  7083. .add(h.tags.disc.scale, 'linkPercent', 0, 100)
  7084. .step(1)
  7085. .onChange(function (e) {
  7086. h.tags.disc.scale.linkFarBound &&
  7087. (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100));
  7088. }),
  7089. b.add(h.tags.disc.scale, 'maxSize', 40, 200).step(1),
  7090. b.add(h.tags.disc.scale, 'minSize', 20, 100).step(1),
  7091. b.add(h.tags.disc.scale, 'responsiveness', 0, 100).step(1);
  7092. var w = C.addFolder('Navigate');
  7093. w.add(h.tags.navigate, 'nearestPano').name('nearestPano'),
  7094. w.add(h.tags.navigate, 'lineOfSight').name('lineOfSight'),
  7095. w.add(h.tags.navigate, 'reactivate').name('reactivate'),
  7096. w.add(h.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  7097. w.add(h.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  7098. w.add(h.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1);
  7099. var _ = n.addFolder('Debug');
  7100. _.add(h, 'wireframe').onFinishChange(function () {
  7101. e.chunks.forEach(function (t) {
  7102. t.material &&
  7103. (t.wireframeTwin ||
  7104. ((t.wireframeTwin = new o.WireframeHelper(t)),
  7105. (t.wireframeTwin.material.depthWrite = !1),
  7106. (t.wireframeTwin.material.depthTest = !1),
  7107. (t.wireframeTwin.material.opacity = 0.5),
  7108. (t.wireframeTwin.material.transparent = !0)),
  7109. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin));
  7110. });
  7111. }),
  7112. _.add(h, 'skyboxWireframe').onFinishChange(function () {
  7113. h.skyboxWireframe
  7114. ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)),
  7115. e.add(e.skybox.wireframe))
  7116. : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null));
  7117. }),
  7118. _.add(h, 'showSweeps').onFinishChange(function () {
  7119. e.setSweepVisibility(h.showSweeps);
  7120. }),
  7121. _.add(h, 'showMesh').onFinishChange(function () {
  7122. e.chunks.forEach(function (e) {
  7123. e.visible = h.showMesh;
  7124. });
  7125. }),
  7126. _.add(h, 'showFloors').onFinishChange(function () {
  7127. e.floors.forEach(function (e) {
  7128. e.collider.children.forEach(function (e) {
  7129. e.material.visible = h.showFloors;
  7130. });
  7131. });
  7132. }),
  7133. _.add(h, 'showSkyboxes').onFinishChange(function () {
  7134. e.panos.forEach(function (e) {
  7135. e.skyboxMesh.visible = h.showSkyboxes;
  7136. });
  7137. }),
  7138. _.add(h, 'showNeighbors').onChange(function () {}),
  7139. _.add(e, 'alpha', 0, 1);
  7140. }
  7141. var r = e('../lib/dat.gui'),
  7142. o = e('three'),
  7143. a = e('../util/easing'),
  7144. s = e('../enum/Viewmode'),
  7145. l = e('../enum/Colors'),
  7146. c = e('../enum/WarpStyle'),
  7147. h = e('../settings');
  7148. e('../tag/tag');
  7149. (r.GUI.prototype.removeFolder = function (e) {
  7150. var t = this.__folders[e];
  7151. t &&
  7152. (t.close(),
  7153. this.__ul.removeChild(t.domElement.parentNode),
  7154. delete this.__folders[e],
  7155. this.onResize());
  7156. }),
  7157. (t.exports.toggle = n);
  7158. },
  7159. {
  7160. '../enum/Colors': 19,
  7161. '../enum/Viewmode': 51,
  7162. '../enum/WarpStyle': 52,
  7163. '../lib/dat.gui': 93,
  7164. '../tag/tag': 123,
  7165. '../settings': 166,
  7166. '../util/easing': 186,
  7167. three: 217,
  7168. },
  7169. ],
  7170. 64: [
  7171. function (e, t, i) {
  7172. (function (i) {
  7173. 'use strict';
  7174. function n(e, t, i, n) {
  7175. $('.gui-error .error-problem-text').text(e),
  7176. $('.gui-error .error-solution-text').text(t),
  7177. $('.gui-error .error-explanation').text(i),
  7178. $('.gui-error .error-actions').html(n),
  7179. $(window).resize(),
  7180. $('.gui-error').fadeIn(),
  7181. $('#bottom-logo').fadeIn();
  7182. }
  7183. function r(e) {
  7184. var t = [
  7185. '<div class="browser-tiles">',
  7186. '<div class="tile">',
  7187. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  7188. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  7189. 'rel="tiletip" title="Chrome"></a>',
  7190. '</div>',
  7191. '<div class="tile">',
  7192. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  7193. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  7194. 'rel="tiletip" title="Firefox"></a>',
  7195. '</div>',
  7196. '<div class="tile">',
  7197. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  7198. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  7199. 'rel="tiletip" title="Internet Explorer"></a>',
  7200. '</div>',
  7201. '<div class="tile">',
  7202. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  7203. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  7204. 'rel="tiletip" title="Safari"></a>',
  7205. '</div>',
  7206. '</div>',
  7207. ].join('');
  7208. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  7209. s.isMobile() ||
  7210. $('[rel=tiletip]').tooltip({
  7211. placement: 'bottom',
  7212. delay: {
  7213. show: 50,
  7214. hide: 0,
  7215. },
  7216. trigger: 'hover',
  7217. viewport: {
  7218. selector: 'body',
  7219. padding: 10,
  7220. },
  7221. });
  7222. }
  7223. function o() {
  7224. var e = s.isMobile()
  7225. ? ''
  7226. : '<span class="link install-browser">' +
  7227. h.ERROR_GENERIC_ACTIONS_2 +
  7228. '</span>' +
  7229. h.ERROR_GENERIC_ACTIONS_3,
  7230. t = [h.ERROR_GENERIC_ACTIONS_1, e].join('');
  7231. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
  7232. s.isMobile() ||
  7233. $('.install-browser').on('click touchstart', function (e) {
  7234. e.preventDefault(), e.stopPropagation(), r(' ');
  7235. });
  7236. }
  7237. function a(e) {
  7238. if (
  7239. ($('head title').text(c.pageTitle),
  7240. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  7241. $('#gui-loading').fadeOut(250),
  7242. $('#quick-blackout').hide(),
  7243. l.track('showcase_error', {
  7244. error_key: e,
  7245. }),
  7246. h.locale || h.init(),
  7247. 'webgl-unsupported' === e)
  7248. )
  7249. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  7250. else if ('webgl-ios' === e)
  7251. n(
  7252. h.ERROR_WEBGL_IOS_PROBLEM,
  7253. h.ERROR_WEBGL_IOS_SOLUTION,
  7254. '',
  7255. h.ERROR_WEBGL_IOS_ACTIONS_1 +
  7256. '<strong>' +
  7257. h.ERROR_WEBGL_IOS_ACTIONS_2 +
  7258. '</strong>.'
  7259. );
  7260. else if ('webgl-safari' === e)
  7261. n(
  7262. h.ERROR_WEBGL_SAFARI_PROBLEM,
  7263. '',
  7264. '',
  7265. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  7266. '<strong>' +
  7267. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  7268. '</strong>. ' +
  7269. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  7270. '<strong>' +
  7271. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  7272. '</strong>.'
  7273. );
  7274. else if ('webgl-generic' === e) o();
  7275. else if ('missing-urls' === e)
  7276. n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION);
  7277. else if ('loading-failed' === e)
  7278. n(
  7279. h.ERROR_LOADING_FAILED_PROBLEM,
  7280. '',
  7281. '',
  7282. h.ERROR_LOADING_FAILED_ACTIONS_1 +
  7283. '<a class="link" target="_blank" href=' +
  7284. p +
  7285. '>' +
  7286. h.ERROR_LOADING_FAILED_ACTIONS_2 +
  7287. '</a>.'
  7288. );
  7289. else {
  7290. if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e);
  7291. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION);
  7292. }
  7293. }
  7294. var s = e('./../util/browser'),
  7295. l = e('./../analytics'),
  7296. c = e('./../settings'),
  7297. h = e('../localization/localize'),
  7298. u = e('./../util/logger'),
  7299. d = new u(i),
  7300. p = '"https://support.port.com/hc/articles/208220058"';
  7301. t.exports.error = a;
  7302. }.call(this, '/js/gui/error.js'));
  7303. },
  7304. {
  7305. '../localization/localize': 108,
  7306. './../analytics': 4,
  7307. './../settings': 166,
  7308. './../util/browser': 182,
  7309. './../util/logger': 189,
  7310. },
  7311. ],
  7312. 65: [
  7313. function (e, t, i) {
  7314. (function (i) {
  7315. 'use strict';
  7316. function n() {
  7317. (Ue = []),
  7318. je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'),
  7319. Ue.push('.hideTarget', '.pinTop.right');
  7320. }
  7321. function r() {
  7322. for (var e in je)
  7323. if (je.hasOwnProperty(e)) {
  7324. var t = je[e];
  7325. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide();
  7326. }
  7327. je.highlight.visible && $('.pinBottom').addClass('highlightExists'),
  7328. je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'),
  7329. n();
  7330. }
  7331. function o(e, t) {
  7332. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  7333. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i);
  7334. }
  7335. function a() {
  7336. c(),
  7337. $('.pinBottom').toggleClass('open'),
  7338. $('#drawer').toggleClass('open'),
  7339. $('.footer').toggleClass('open'),
  7340. $('#drawer').hasClass('open')
  7341. ? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS),
  7342. Ze('highlights'))
  7343. : ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS),
  7344. ie.resetDrawer()),
  7345. setTimeout(
  7346. function () {
  7347. $('#pullTab').toggleClass('opened');
  7348. },
  7349. $('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
  7350. ),
  7351. $('.pinBottom').hasClass('open') &&
  7352. s($('.vr-popup')) &&
  7353. $('.vr-popup').is(':visible') &&
  7354. Ae.dismiss();
  7355. }
  7356. function s(e) {
  7357. var t;
  7358. 'none' !== e.css('display')
  7359. ? (t = e.position().top + e.outerHeight())
  7360. : (e.attr('style', 'visibility: hidden'),
  7361. (t = e.position().top + e.outerHeight()),
  7362. e.attr('style', 'display: none'));
  7363. var i = $('#player').outerHeight(),
  7364. n = i - 130;
  7365. return n < t + 25;
  7366. }
  7367. function l(e) {
  7368. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation();
  7369. }
  7370. function c() {
  7371. W && (W.reload(), W.init());
  7372. }
  7373. function h(e) {
  7374. ne.show(e), r();
  7375. }
  7376. function u(e) {
  7377. ne.progress(e);
  7378. }
  7379. function d(e, t, i) {
  7380. var n = t.player;
  7381. $('#gui-thumb').fadeOut(2500),
  7382. ne.hide(function () {
  7383. Ge = !1;
  7384. }),
  7385. me.init(e, i),
  7386. de.finishSetup(Object.keys(e.tags).length),
  7387. i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'));
  7388. var s = function () {
  7389. i.dismissExaminedTag(), i.disableHovering();
  7390. };
  7391. Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s);
  7392. var l = i.enableHovering.bind(i);
  7393. if (
  7394. (Ae.on(ye.CLOSED, l),
  7395. Ce.on(Me.CLOSED, l),
  7396. he.on(ue.CLOSED, l),
  7397. fe.on(ge.CLOSED, l),
  7398. Q.labels.enabled && Object.keys(e.labels).length,
  7399. e.floors.length <= 1 || !je.floors.visible
  7400. ? (je.floors.visible = !1)
  7401. : (y(e, t), C(e.currentFloor, n.mode)),
  7402. getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
  7403. r(),
  7404. o(t, t.player),
  7405. $('#gui').fadeIn(1500),
  7406. je.highlight.visible &&
  7407. (2 !== Q.startHighlights || e.has360Views) &&
  7408. setTimeout(function () {
  7409. a(),
  7410. ((!e.has360Views && 1 !== Q.startHighlights) ||
  7411. (e.has360Views && 0 === Q.startHighlights)) &&
  7412. setTimeout(a, 2e3);
  7413. }, 2e3),
  7414. !K.isMobile())
  7415. )
  7416. for (
  7417. var c = [
  7418. 'a',
  7419. '#title-toggle',
  7420. '.next-button',
  7421. '.prev-button',
  7422. '.gui-floor',
  7423. '.meta-toggle',
  7424. '.thumbImg',
  7425. 'logo-button',
  7426. ],
  7427. h = 0;
  7428. h < c.length;
  7429. h++
  7430. )
  7431. $(c[h]).addClass('hasHover');
  7432. O(e), de.setupToggling();
  7433. //xzw:
  7434. window.editHotPanel && editHotPanel();
  7435. //czj
  7436. navBorderRadius(e);
  7437. //czj 编辑界面
  7438. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  7439. window.EditTools && new EditTools(n.sceneRenderer);
  7440. }
  7441. function navBorderRadius(e) {
  7442. var pullTab = $('#pullTab'),
  7443. mobileRadius = {
  7444. bottom: {
  7445. 'border-bottom-left-radius': '10px',
  7446. 'border-bottom-right-radius': '10px',
  7447. },
  7448. top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' },
  7449. },
  7450. topRadius = {
  7451. bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
  7452. top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' },
  7453. };
  7454. function BorderRadius(bottom, top) {
  7455. $('#gui-modes-map > div:visible:last').css(bottom);
  7456. if (pullTab.is(':visible')) {
  7457. $('.viewContainer > div:visible:first').css(top);
  7458. } else {
  7459. $('#gui-modes-map > div:visible:first').css(top);
  7460. }
  7461. }
  7462. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  7463. BorderRadius(mobileRadius.bottom, mobileRadius.top);
  7464. } else {
  7465. BorderRadius(topRadius.bottom, topRadius.top);
  7466. }
  7467. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  7468. if (window.DATA.model.special || window.DATA.special) {
  7469. window.specialScene && specialScene.special().afterImplement();
  7470. }
  7471. }
  7472. function p(e) {
  7473. e || (e = 0),
  7474. (We = !1),
  7475. window.setTimeout(
  7476. function () {
  7477. We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show());
  7478. }.bind(this),
  7479. e
  7480. );
  7481. }
  7482. function f() {
  7483. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1);
  7484. }
  7485. function g(e, t) {
  7486. var i = e.mode,
  7487. n = t || e.currentPano;
  7488. $('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
  7489. $('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
  7490. $('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
  7491. i === _e.PANORAMA
  7492. ? ($('#view-controllers').slideUp(500),
  7493. Q.show360Views.enabled && !n.isAligned()
  7494. ? ($('.gui-floor').addClass('hidden'),
  7495. $('#gui-modes-outside').addClass('desktop-only'))
  7496. : ($('.gui-floor').removeClass('hidden'),
  7497. $('#gui-modes-outside').removeClass('desktop-only')),
  7498. $('#gui-modes-outside').removeClass('hidden'))
  7499. : i !== _e.TRANSITIONING &&
  7500. (f(),
  7501. (Be = i),
  7502. $('#gui-modes-outside').addClass('hidden'),
  7503. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  7504. $('#view-controllers').is(':visible') ||
  7505. $('#view-controllers').slideDown(Q.guiAnimationSpeed));
  7506. }
  7507. function m(e, t) {
  7508. var i = t.player;
  7509. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  7510. l(e),
  7511. J.updateInteraction(Se.InteractionGui, 'inside-button'),
  7512. J.track('USER', {
  7513. event_type: 'showcase_gui',
  7514. gui_action: 'click_inside_mode_button',
  7515. }),
  7516. t.changeMode(_e.PANORAMA);
  7517. }),
  7518. $('#gui-modes-outside')
  7519. .find('a')
  7520. .on('click', function (e) {
  7521. l(e),
  7522. J.track('showcase_gui', {
  7523. gui_action: 'click_outside_mode_button',
  7524. }),
  7525. t.changeMode(Be);
  7526. }),
  7527. $('#gui-modes-floorplan').on('click', function (e) {
  7528. l(e),
  7529. i.mode !== _e.FLOORPLAN &&
  7530. (J.track('showcase_gui', {
  7531. gui_action: 'click_floorplan_mode_button',
  7532. }),
  7533. t.changeMode(_e.FLOORPLAN));
  7534. }),
  7535. $('#gui-modes-dollhouse').on('click', function (e) {
  7536. l(e),
  7537. i.mode !== _e.DOLLHOUSE &&
  7538. (J.track('showcase_gui', {
  7539. gui_action: 'click_dollhouse_mode_button',
  7540. }),
  7541. t.changeMode(_e.DOLLHOUSE));
  7542. });
  7543. }
  7544. function v(e, t) {
  7545. function i() {
  7546. document.getElementById('vr').classList.remove('hidden'),
  7547. Q.vr.allowWebVR
  7548. ? K.getVRDisplay().then(
  7549. function (e) {
  7550. K.supportsFullscreen()
  7551. ? n(e)
  7552. : (De.warn('Unable to use WebVR when full screen is not supported'),
  7553. $('.improper-embed').toggleClass('hidden', !1),
  7554. r());
  7555. },
  7556. function (e) {
  7557. r();
  7558. }
  7559. )
  7560. : r();
  7561. }
  7562. function n(i) {
  7563. De.info(i.displayName + ' detected, VR button activates WebVR experience'),
  7564. Ie.init(e.data, t, i, q),
  7565. Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')),
  7566. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe));
  7567. }
  7568. function r() {
  7569. De.info('WebVR support not found, VR button activates native app VR modal'),
  7570. Ae.init(e.data, q),
  7571. Ae.on(
  7572. ye.OPENED,
  7573. (function () {
  7574. var e = document.getElementById('vr-modal');
  7575. return function () {
  7576. Ze('vr'), le.open(e);
  7577. };
  7578. })()
  7579. ),
  7580. Ae.on(ye.CLOSED, le.reset);
  7581. }
  7582. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
  7583. /*********************** 方奕卓 VR功能事件监听 ********************/
  7584. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  7585. switch (Q.vr.option) {
  7586. case Pe.CONTEXTUAL:
  7587. i();
  7588. break;
  7589. case Pe.ANDROID:
  7590. K.detectAndroid() && i();
  7591. break;
  7592. case Pe.NONE:
  7593. }
  7594. }
  7595. }
  7596. function A(e, t) {
  7597. $('#play').on('mousedown touchstart', function (e) {
  7598. l(e);
  7599. Ze('tour');
  7600. ve.play();
  7601. J.trackAlways('showcase_gui', {
  7602. gui_action: 'play_highlights',
  7603. });
  7604. }),
  7605. (window.startAndPlay = function (e) {
  7606. // l(e);
  7607. Ze('tour');
  7608. ve.play();
  7609. J.trackAlways('showcase_gui', {
  7610. gui_action: 'play_highlights',
  7611. });
  7612. });
  7613. $('#pause').on('mousedown touchstart', function (e) {
  7614. l(e),
  7615. ve.pause(),
  7616. J.trackAlways('showcase_gui', {
  7617. gui_action: 'pause_highlights',
  7618. });
  7619. }),
  7620. $('#gui-zoomin')
  7621. .find('a')
  7622. .on('click', function (e) {
  7623. l(e), t.player.zoomInIncrementally();
  7624. }),
  7625. $('#gui-zoomout')
  7626. .find('a')
  7627. .on('click', function (e) {
  7628. l(e), t.player.zoomOutIncrementally();
  7629. });
  7630. }
  7631. function y(e, t) {
  7632. for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
  7633. if (getQueryVariable('m') === '372') continue;
  7634. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(
  7635. e.floors.get(n).name
  7636. );
  7637. $('.gui-floor').find('.container').prepend(r);
  7638. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  7639. }
  7640. i
  7641. .find('.container')
  7642. .prepend(
  7643. '<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' +
  7644. Re.FLOOR_ALL +
  7645. '</div>'
  7646. ),
  7647. i.on('click', function (e) {
  7648. l(e), Ze('floor'), i.toggleClass('open');
  7649. }),
  7650. $('.floorChoice').on('click', function (e) {
  7651. l(e);
  7652. var n = $(this).data('index');
  7653. 'all' !== n
  7654. ? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7655. t.player.gotoFloor(n),
  7656. J.track('showcase_gui', {
  7657. gui_action: 'click_floor_select_button',
  7658. interaction_source: 'gui',
  7659. }))
  7660. : (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7661. Ze('move'),
  7662. t.allFloors(),
  7663. J.track('showcase_gui', {
  7664. gui_action: 'click_toggle_all_floors_button',
  7665. interaction_source: 'gui',
  7666. })),
  7667. i.removeClass('open');
  7668. });
  7669. }
  7670. function C(e, t) {
  7671. e &&
  7672. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  7673. ? ($('.allFloorBtn').show(),
  7674. $('.gui-floor-icon').hide(),
  7675. $('.gui-floor-title').show())
  7676. : ($('.allFloorBtn').hide(),
  7677. $('.gui-floor-icon').show(),
  7678. $('.gui-floor-title').hide()),
  7679. e.model.allFloorsVisible
  7680. ? ($('.gui-floor-title').text(Re.FLOOR_ALL),
  7681. $('.gui-floor-number').text(Re.FLOOR_ALL),
  7682. $('.floorChoice').removeClass('active'),
  7683. $('.floorChoice[data-index="all"]').addClass('active'))
  7684. : ($('.gui-floor-title').text(e.name),
  7685. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  7686. $('.floorChoice').removeClass('active'),
  7687. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')));
  7688. }
  7689. function I(e) {
  7690. return e.describe().inTransition;
  7691. }
  7692. function b(e, t, i) {
  7693. Fe = e.heroLocations.length;
  7694. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  7695. r = 100 / Fe + '%',
  7696. o = $('#thumb-container'),
  7697. a = $('#progressBar');
  7698. $('#status').find('.totalSteps').text(Fe);
  7699. for (var s = 0; s < Fe; s++) {
  7700. var c = e.heroLocations[s],
  7701. h = $(n);
  7702. var thumbUrl;
  7703. if (c.heroLocations) {
  7704. //有子项,选第一张截图
  7705. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl); //.replace('https://','').replace('http://','')
  7706. } else {
  7707. thumbUrl = manage.dealURL(c.thumbUrl); //.replace('https://','').replace('http://','')
  7708. }
  7709. h.attr('data-index', s);
  7710. je.highlight.visible && h.find('img').attr('src', thumbUrl);
  7711. if (c.name) {
  7712. var u = $('<div class="overlay"></div>').text(c.name);
  7713. h.prepend(u);
  7714. }
  7715. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  7716. var d = e.panos.get(c.panoId),
  7717. p = d && !d.isAligned(),
  7718. f = p
  7719. ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>'
  7720. : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  7721. h.prepend(f);
  7722. }
  7723. o.append(h),
  7724. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>');
  7725. }
  7726. (j = 144 * Fe),
  7727. (Y = 111 * Fe),
  7728. $('.thumbImg').on('mouseover', function () {
  7729. I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]); //改
  7730. }),
  7731. $('.thumbImg').on('mouseout', function () {
  7732. t.clearPath();
  7733. }),
  7734. $('.thumbImg').on('click', function (e) {
  7735. l(e);
  7736. var i = $(this);
  7737. J.updateInteraction(Se.InteractionGui, 'thumbnail'),
  7738. J.trackAlways('showcase_gui', {
  7739. gui_action: 'click_highlight',
  7740. }),
  7741. t.goToHighlight([i.data('index'), 0]); //改
  7742. }),
  7743. $('.previous')
  7744. .find('a')
  7745. .on('click', function (e) {
  7746. l(e),
  7747. J.trackAlways('showcase_gui', {
  7748. gui_action: 'prev_highlight',
  7749. }),
  7750. t.prevHighlight();
  7751. }),
  7752. $('.next')
  7753. .find('a')
  7754. .on('click', function (e) {
  7755. l(e),
  7756. J.trackAlways('showcase_gui', {
  7757. gui_action: 'next_highlight',
  7758. }),
  7759. t.nextHighlight();
  7760. }),
  7761. $('#drawer').on('mouseleave', function (e) {
  7762. l(e);
  7763. var t;
  7764. try {
  7765. t = new MouseEvent('mouseup', {
  7766. clientX: e.clientX,
  7767. clientY: e.clientY,
  7768. screenX: e.screenX,
  7769. screenY: e.screenY,
  7770. });
  7771. } catch (i) {
  7772. (t = document.createEvent('MouseEvents')),
  7773. t.initMouseEvent(
  7774. 'mouseup',
  7775. e.bubbles,
  7776. e.cancelable,
  7777. e.view,
  7778. e.detail,
  7779. e.screenX,
  7780. e.screenY,
  7781. e.clientX,
  7782. e.clientY,
  7783. e.ctrlKey,
  7784. e.altKey,
  7785. e.shiftKey,
  7786. e.metaKey,
  7787. e.button,
  7788. e.relatedTarget
  7789. );
  7790. }
  7791. document.dispatchEvent(t);
  7792. }),
  7793. (W = new Sly($('#scrollFrame'), {
  7794. horizontal: !0,
  7795. itemNav: 'centered',
  7796. smart: !0,
  7797. scrollTrap: !0,
  7798. scrollBy: 1,
  7799. mouseDragging: !0,
  7800. touchDragging: !0,
  7801. speed: 300,
  7802. dragHandle: !0,
  7803. dynamicHandle: !0,
  7804. clickBar: !0,
  7805. scrollBar: $('#scroller'),
  7806. activateOn: null,
  7807. }).init()),
  7808. W.on('active', function (e, t) {
  7809. (Ve = t),
  7810. Ze('tour'),
  7811. $('.step').removeClass('active'),
  7812. $('#status')
  7813. .find('.curIdx')
  7814. .text(t + 1);
  7815. for (var i = 0; i <= t; i++)
  7816. $('#progressBar')
  7817. .find("[data-idx='" + i + "']")
  7818. .addClass('active');
  7819. }),
  7820. w();
  7821. //add :
  7822. let scrollFrame = $(W.frame);
  7823. scrollFrame.on('wheel.sly', function () {
  7824. lastMoveScrollTime = Date.now();
  7825. });
  7826. let dragstart;
  7827. /* scrollFrame.on("pointerdown", function() {
  7828. dragstart = true
  7829. })
  7830. scrollFrame.on("pointerup", function() {
  7831. dragstart = false
  7832. }) */
  7833. scrollFrame.on('pointermove', function () {
  7834. //if(dragstart){
  7835. lastMoveScrollTime = Date.now();
  7836. //}
  7837. });
  7838. }
  7839. function w() {
  7840. var e = $('#player').width() - 20,
  7841. t = $('#scroller'),
  7842. i = $('#drawer'),
  7843. n = $('.pinBottom');
  7844. if ($('#player').width() < 488 || $('#player').height() < 488)
  7845. t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll');
  7846. else {
  7847. var r = j > e,
  7848. o = !i.hasClass('noScroll'),
  7849. a = r !== o;
  7850. a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'));
  7851. }
  7852. }
  7853. function _(e) {
  7854. je.tourControls.visible = true; //e.tour_buttons && K.valueFromHash("gt", 1),
  7855. (je.coBrand.visible =
  7856. e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
  7857. (je.highlight.visible =
  7858. /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights);
  7859. }
  7860. function T(e) {
  7861. function t(t, i) {
  7862. return !!e.player_options[t] && e[i || t];
  7863. }
  7864. $('.model-title').text(e.name);
  7865. var i = Q.pageTitle;
  7866. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7867. 2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
  7868. (document.title = i),
  7869. K.isMobile()
  7870. ? $('#gui-fullscreen').css('display', 'none')
  7871. : ($('[rel=tooltip]').tooltip({
  7872. delay: {
  7873. show: 50,
  7874. hide: 0,
  7875. },
  7876. trigger: 'hover',
  7877. html: !1,
  7878. viewport: {
  7879. selector: 'body',
  7880. padding: 10,
  7881. },
  7882. }),
  7883. K.inIframe() &&
  7884. document
  7885. .getElementsByClassName('pinBottom-container')[0]
  7886. .classList.add('embed')),
  7887. // 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"),
  7888. de.populate({
  7889. name: t('model_name', 'name'),
  7890. coBrand: t('presented_by'),
  7891. description: t('model_summary', 'summary') || '暂无内容',
  7892. contactName: t('contact_name'),
  7893. address: t('address'),
  7894. phone: t('contact_phone'),
  7895. formattedPhone: e.formatted_contact_phone,
  7896. email: t('contact_email'),
  7897. url: t('external_url'),
  7898. socialSharing: e.enable_social_sharing && e.is_public,
  7899. });
  7900. }
  7901. function x(e, t, i, n, r, o) {
  7902. function a() {
  7903. o.setLoadingStartTime(),
  7904. H(),
  7905. r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l);
  7906. }
  7907. var s = $.Deferred(),
  7908. l = s.resolve.bind(s);
  7909. return (
  7910. (Ge = !0),
  7911. O(e),
  7912. e.data.player_options && _(e.data.player_options),
  7913. 1 === Q.specialEdition && $('body').addClass('specialEdition'),
  7914. Re.localizeGUI(),
  7915. T(e.data),
  7916. r || $('.quick').addClass('hidden'),
  7917. //e.data.image && !r && E(e.data.image),
  7918. n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
  7919. s
  7920. );
  7921. }
  7922. function S(e, t, i, n, r, a, s) {
  7923. (q = s),
  7924. e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  7925. e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  7926. ae.init(),
  7927. re.init(e, a),
  7928. Oe.init(e, t, n),
  7929. $('.icon').on('mouseover', function () {
  7930. t.player && t.player.reticule.hide();
  7931. }),
  7932. m(e, t),
  7933. A(e, t),
  7934. e.data.enable_social_sharing &&
  7935. e.data.is_public &&
  7936. Q.share.enabled &&
  7937. (Ce.init(window.DATA.name /* e.data.name */),
  7938. Ce.on(
  7939. Me.OPENED,
  7940. (function () {
  7941. var e = document.getElementById('share-modal');
  7942. return function () {
  7943. Ze('share'), le.open(e);
  7944. };
  7945. })()
  7946. ),
  7947. Ce.on(Me.CLOSED, le.reset)),
  7948. e.heroLocations.length > 0
  7949. ? b(e, t, i)
  7950. : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  7951. de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
  7952. z(),
  7953. g(i),
  7954. v(e, r),
  7955. e.on('floor.changed', C),
  7956. e.on('waiting', R.bind(this, e)),
  7957. e.on('waiting-done', P.bind(this, e)),
  7958. i.on(xe.ModeChanged, function (e, n) {
  7959. g(i),
  7960. o(t, i),
  7961. n === _e.PANORAMA &&
  7962. i.currentPano &&
  7963. !i.currentPano.isAligned() &&
  7964. (n = _e.OUTDOOR),
  7965. he.updateMode(n);
  7966. }),
  7967. n.on(Se.Move, Ze.bind(this, 'move')),
  7968. i.on(xe.Ready, function () {
  7969. ie.init(n, i, i.tagManager, t),
  7970. i.on(xe.ModeChanged, function (e, t) {
  7971. e !== t && $('.vr-popup').is(':visible') && Ae.dismiss();
  7972. });
  7973. }),
  7974. i.on(xe.PanoChosen, function (e, t) {
  7975. g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA);
  7976. }),
  7977. le.on(ce.CLOSE, function (e) {
  7978. switch (e) {
  7979. case 'vr-modal':
  7980. Ae.dismiss();
  7981. break;
  7982. case 'share-modal':
  7983. Ce.hide();
  7984. break;
  7985. case 'terms-modal':
  7986. fe.hide();
  7987. }
  7988. });
  7989. var l = $('#play').eq(0),
  7990. c = $('#pause').eq(0),
  7991. h = $('.pinBottom').toArray(),
  7992. u = $('#drawer').eq(0),
  7993. d = $('#playHead').eq(0),
  7994. p = $('#progressBar').eq(0),
  7995. f = $('#thumb-container').eq(0),
  7996. y = f.children(),
  7997. I = p.children();
  7998. t.on('update.controls', function () {
  7999. //导览控制
  8000. var n = t.describe();
  8001. n.tourIsPlaying || i.isWarping()
  8002. ? (je.tourControls.visible && (l.hide(), c.show()),
  8003. n.tourInProgress &&
  8004. (h.forEach(function (e) {
  8005. e.classList.add('playing');
  8006. }),
  8007. u.addClass('playing'),
  8008. d.addClass('playing')))
  8009. : (je.tourControls.visible && (l.show(), c.hide()),
  8010. n.tourInProgress ||
  8011. (ve.stopTour(),
  8012. h.forEach(function (e) {
  8013. e.classList.remove('playing');
  8014. }),
  8015. u.removeClass('playing'),
  8016. d.removeClass('playing')));
  8017. var r, a, s;
  8018. if (null !== n.currentItem) {
  8019. var p, f;
  8020. $('#status')
  8021. .find('.curIdx')
  8022. .text(n.currentItem[0] + 1),
  8023. n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'));
  8024. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  8025. /* for (r = 0; r < e.heroLocations.length; r += 1)
  8026. s = y.eq(r),
  8027. a = I.eq(r),
  8028. s.removeClass(f),
  8029. a.removeClass(f),
  8030. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  8031. a.addClass(p),
  8032. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  8033. a.addClass(p)) : (s.removeClass(p),
  8034. a.removeClass(p)) */
  8035. for (r = 0; r < e.heroLocations.length; r += 1) {
  8036. (s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f);
  8037. if (n.onTheBus && r === n.destinationItem[0]) {
  8038. s.addClass(p);
  8039. a.addClass(p);
  8040. if (Date.now() - lastMoveScrollTime > 2000) {
  8041. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  8042. W.activate(r); // scrollbar slide to this
  8043. }
  8044. } else {
  8045. n.onTheBus && g && r === n.currentItem[0]
  8046. ? (s.addClass(p), a.addClass(p))
  8047. : (s.removeClass(p), a.removeClass(p));
  8048. }
  8049. }
  8050. } 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');
  8051. o(t, i);
  8052. }),
  8053. document.addEventListener(
  8054. 'keydown',
  8055. function (n) {
  8056. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  8057. case we.ZERO:
  8058. Q.debug && e.toggleAlpha();
  8059. break;
  8060. case we.NINE:
  8061. Q.debug && se.toggle();
  8062. break;
  8063. case we.ONE:
  8064. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  8065. break;
  8066. case we.TWO:
  8067. e.outsideAllowed() &&
  8068. !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) &&
  8069. t.changeMode(_e.DOLLHOUSE);
  8070. break;
  8071. case we.THREE:
  8072. e.outsideAllowed() &&
  8073. !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) &&
  8074. t.changeMode(_e.FLOORPLAN);
  8075. break;
  8076. case we.FOUR:
  8077. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  8078. break;
  8079. case we.SPACE:
  8080. je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'));
  8081. break;
  8082. case we.RETURN:
  8083. Q.debug && e.toggleExplodeUp();
  8084. break;
  8085. case we.P:
  8086. k();
  8087. break;
  8088. case we.U:
  8089. B();
  8090. break;
  8091. case we.X:
  8092. Q.debug && e.toggleExplode();
  8093. break;
  8094. case we.PLUSEQUALS:
  8095. t.player.activatePersistentZooming(!0), ie.hideUi();
  8096. break;
  8097. case we.DASHUNDERSCORE:
  8098. t.player.activatePersistentZooming(!1), ie.hideUi();
  8099. break;
  8100. case we.SEVEN:
  8101. De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov);
  8102. break;
  8103. case we.EIGHT:
  8104. t.player.decreaseZoomSpeed();
  8105. break;
  8106. case we.NINE:
  8107. t.player.increaseZoomSpeed();
  8108. }
  8109. return i && i.reticule.hide(), !0;
  8110. }.bind(this)
  8111. ),
  8112. document.addEventListener(
  8113. 'keyup',
  8114. function (e) {
  8115. switch (e.which) {
  8116. case we.PLUSEQUALS:
  8117. t.player.deactivatePersistentZooming();
  8118. break;
  8119. case we.DASHUNDERSCORE:
  8120. t.player.deactivatePersistentZooming();
  8121. }
  8122. }.bind(this)
  8123. ),
  8124. F(e),
  8125. L(e, t.player),
  8126. M(i),
  8127. te.setAutoPlay(e.heroCount()),
  8128. he.init(i, a.mode),
  8129. he.on(ue.OPENED, Ze.bind(this, 'help')),
  8130. fe.init(),
  8131. fe.on(
  8132. ge.OPENED,
  8133. (function () {
  8134. var e = document.getElementById('terms-modal');
  8135. return function () {
  8136. Ze('terms'), le.open(e);
  8137. };
  8138. })()
  8139. ),
  8140. fe.on(ge.CLOSED, le.reset),
  8141. Q.quickstart.enabled ||
  8142. re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  8143. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  8144. Q.profiling.enabled && se.show(),
  8145. ve.init(t);
  8146. }
  8147. function M(e) {
  8148. var t = function (e, t) {
  8149. $(e)
  8150. .find('a')
  8151. .each(function (e, i) {
  8152. t
  8153. ? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled')
  8154. : $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  8155. (i.style.pointerEvents = t ? 'auto' : 'none');
  8156. });
  8157. },
  8158. i = function () {
  8159. e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0),
  8160. e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0);
  8161. };
  8162. e.on(Ne.ZoomMax, function () {
  8163. t('#gui-zoomin', !1), t('#gui-zoomout', !0);
  8164. }),
  8165. e.on(Ne.ZoomMin, function () {
  8166. t('#gui-zoomin', !0), t('#gui-zoomout', !1);
  8167. }),
  8168. e.on(Ne.ZoomIn, function () {
  8169. t('#gui-zoomout', !0);
  8170. }),
  8171. e.on(Ne.ZoomOut, function () {
  8172. t('#gui-zoomin', !0);
  8173. }),
  8174. i();
  8175. }
  8176. function R(e) {
  8177. O(e);
  8178. }
  8179. function P(e) {
  8180. O(e);
  8181. }
  8182. function O(e) {
  8183. var t = e.waitQueue.length;
  8184. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay);
  8185. }
  8186. function L(e, t) {
  8187. He = {
  8188. gui: null,
  8189. visible: !1,
  8190. model: e,
  8191. player: t,
  8192. };
  8193. }
  8194. function D(e, t) {
  8195. function i() {
  8196. var i = t.toJSON();
  8197. (n.linkToLocation =
  8198. window.location.protocol +
  8199. '//' +
  8200. window.location.host +
  8201. window.location.pathname +
  8202. '?m=' +
  8203. e.sid +
  8204. '&start=' +
  8205. be.serialize(i)),
  8206. t.tagManager.activeTag &&
  8207. (n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid);
  8208. }
  8209. var n = {},
  8210. r = new Le.GUI({
  8211. autoPlace: !0,
  8212. width: '60%',
  8213. });
  8214. i(),
  8215. t.on(xe.ViewChanged, i),
  8216. r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(),
  8217. (r.domElement.id = 'datLinks');
  8218. var o = [].slice.call(r.domElement.querySelectorAll('.property-name'));
  8219. return (
  8220. o.forEach(function (e) {
  8221. if (!K.detectSafari()) {
  8222. var t = document.createElement('button');
  8223. t.classList.add('btn-deep-link'),
  8224. (t.innerText = Re.MENU_COPY),
  8225. e.nextSibling.appendChild(t);
  8226. var i = function () {
  8227. alert(Re.LINK_ALERT_COPY), t.hide();
  8228. };
  8229. t.addEventListener('click', function (e) {
  8230. try {
  8231. var t = e.target.parentNode.childNodes[0];
  8232. t.select();
  8233. var n = document.execCommand('copy');
  8234. t.blur(), n || i();
  8235. } catch (e) {
  8236. i();
  8237. }
  8238. });
  8239. }
  8240. }),
  8241. $(r.__closeButton).hide(),
  8242. r
  8243. );
  8244. }
  8245. function N(e) {
  8246. He.gui || (He.gui = D(He.model, He.player)),
  8247. (He.visible = e),
  8248. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide();
  8249. }
  8250. function B() {
  8251. N(!He.visible);
  8252. }
  8253. function F(e) {
  8254. ke = {
  8255. gui: null,
  8256. visible: !1,
  8257. model: e,
  8258. };
  8259. }
  8260. function V(e) {
  8261. var t = new Le.GUI();
  8262. return (
  8263. t
  8264. .add(Q, 'showSweeps')
  8265. .name('Show sweeps')
  8266. .onFinishChange(function () {
  8267. e.setSweepVisibility(Q.showSweeps);
  8268. }),
  8269. t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  8270. t
  8271. .add(Q.transition, 'flyTime', 0, 5e3)
  8272. .name('Transition time')
  8273. .onFinishChange(function () {
  8274. (Q.transition.flySpeed = 0),
  8275. t.__controllers.forEach(function (e) {
  8276. e.updateDisplay();
  8277. });
  8278. }),
  8279. t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
  8280. $(t.__closeButton).hide(),
  8281. t
  8282. );
  8283. }
  8284. function U(e) {
  8285. ke.gui || (ke.gui = V(ke.model)),
  8286. (ke.visible = e),
  8287. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide();
  8288. }
  8289. function k() {
  8290. U(!ke.visible);
  8291. }
  8292. function H() {
  8293. function e(e) {
  8294. e.target === t ||
  8295. $.contains(t, e.target) ||
  8296. e.target === i ||
  8297. $.contains(i, e.target) ||
  8298. e.target === n ||
  8299. $.contains(n, e.target); /* || e.preventDefault()*/
  8300. }
  8301. $('body').css('touch-action', 'none'),
  8302. $('#gui-parent')
  8303. .find('*:not(#tag-billboards)')
  8304. .on('touchmove', function (e) {
  8305. // e.preventDefault()
  8306. });
  8307. var t = document.getElementById('terms-text'),
  8308. i = document.getElementById('more-help-wrapper'),
  8309. n =
  8310. (document.getElementById('navigation-help-wrapper'),
  8311. document.getElementById('help-dialog'),
  8312. document.getElementById('tag-billboards'));
  8313. Q.useWheel &&
  8314. (document.body.addEventListener('mousewheel', e, { passive: false }),
  8315. document.body.addEventListener('DOMMouseScroll', e)),
  8316. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  8317. .off('touchmove')
  8318. .on('touchmove', function (e) {
  8319. e.stopPropagation();
  8320. });
  8321. }
  8322. function G(e, t) {
  8323. for (var i = []; e; ) i.push(e), (e = e.parentNode);
  8324. for (; t && i.indexOf(t) === -1; ) t = t.parentNode;
  8325. return t;
  8326. }
  8327. function z() {
  8328. var e,
  8329. t = function (t) {
  8330. e = 0 === t.button || 1 === t.which ? t.target : null;
  8331. },
  8332. i = function (t) {
  8333. e !== t.target && (e = G(e, t.target));
  8334. var i = document.getElementById('gui-parent');
  8335. if ((G(i, e) !== i && (e = null), e)) {
  8336. var n;
  8337. try {
  8338. n = new MouseEvent('click', t);
  8339. } catch (e) {
  8340. (n = document.createEvent('MouseEvents')),
  8341. n.initMouseEvent(
  8342. 'click',
  8343. t.bubbles,
  8344. t.cancelable,
  8345. t.view,
  8346. t.detail,
  8347. t.screenX,
  8348. t.screenY,
  8349. t.clientX,
  8350. t.clientY,
  8351. t.ctrlKey,
  8352. t.altKey,
  8353. t.shiftKey,
  8354. t.metaKey,
  8355. t.button,
  8356. t.relatedTarget
  8357. );
  8358. }
  8359. (n.syntheticClick = !0), e.dispatchEvent(n), (e = null);
  8360. }
  8361. };
  8362. document.body.addEventListener('mousedown', t, !0),
  8363. document.body.addEventListener('mouseup', i, !0),
  8364. document.getElementById('gui-parent').addEventListener(
  8365. 'click',
  8366. function (e) {
  8367. e.syntheticClick ||
  8368. (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault());
  8369. },
  8370. !0
  8371. );
  8372. }
  8373. var lastMoveScrollTime = 0; //add
  8374. var W,
  8375. j,
  8376. Y,
  8377. X,
  8378. Z,
  8379. q,
  8380. K = (e('three'), e('../util/ajax'), e('../util/browser')),
  8381. Q = e('../settings'),
  8382. J = e('../analytics'),
  8383. ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
  8384. te = (e('../objects/Snapshot'), e('./helpManager')),
  8385. ie = e('./immersiveMode'),
  8386. ne = e('./loadingScreen'),
  8387. re = e('./landingScreen'),
  8388. oe = e('./playButton'),
  8389. ae = e('./populateModal'),
  8390. se = e('./memoryUsage'),
  8391. le = e('./closer/modalCloser'),
  8392. ce = e('./closer/ModalCloserEvent'),
  8393. he = e('./help/help'),
  8394. ue = e('./help/HelpEvent'),
  8395. de = e('./title/titleBar'),
  8396. pe = e('./title/TitleEvents'),
  8397. fe = e('./terms/terms'),
  8398. ge = e('./terms/TermsEvent'),
  8399. me = e('./title/tagToggle'),
  8400. ve = e('./tourInteraction'),
  8401. Ae = e('./vr/vrModal'),
  8402. ye = e('./vr/vrEvent'),
  8403. Ce = e('./sharing/modal'),
  8404. Ie = e('./webvr/webVRgui'),
  8405. Ee = e('./webvr/WebVrEvent'),
  8406. be = e('../controls/serializer'),
  8407. we = e('../enum/Keys'),
  8408. _e = e('../enum/Viewmode'),
  8409. Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
  8410. xe =
  8411. (e('../enum/PathDiscardMode'),
  8412. e('../enum/PathDisplayMode'),
  8413. e('../enum/DirectorEvents'),
  8414. e('../enum/PlayerEvents')),
  8415. Se = e('../enum/ControlEvents'),
  8416. Me = e('./sharing/ShareEvents'),
  8417. Re = e('../localization/localize'),
  8418. Pe =
  8419. (e('../enum/Vectors'),
  8420. e('../enum/WarpStyle'),
  8421. e('../enum/AlignmentType'),
  8422. e('../enum/VROption')),
  8423. Oe = e('./konami'),
  8424. Le = e('../lib/dat.gui'),
  8425. De = new ee(i),
  8426. Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
  8427. Be = _e.DOLLHOUSE,
  8428. Fe = 0,
  8429. Ve = 0,
  8430. Ue = ['.hideTarget'],
  8431. ke = null,
  8432. He = null,
  8433. Ge = !1,
  8434. ze = !1,
  8435. We = !1,
  8436. je = {
  8437. coBrand: {
  8438. visible: !0,
  8439. elements: ['.co-brand', '#loaderCoBrand'],
  8440. },
  8441. help: {
  8442. visible: !0,
  8443. elements: ['.nav-help', '#nav-help'],
  8444. },
  8445. tourControls: {
  8446. visible: !0,
  8447. elements: ['.next', '.previous', '#play'],
  8448. },
  8449. highlight: {
  8450. visible: !0,
  8451. elements: ['#drawer', '#pullTab'],
  8452. },
  8453. share: {
  8454. visible: !0,
  8455. elements: ['.socialButton', '#share'],
  8456. },
  8457. fullScreen: {
  8458. visible: !0,
  8459. elements: ['#gui-fullscreen'],
  8460. },
  8461. floors: {
  8462. visible: !0,
  8463. elements: ['.gui-floor'],
  8464. },
  8465. },
  8466. Ye = (function () {
  8467. var e = document.getElementById('drawer');
  8468. return function () {
  8469. $('#player').height() < 400 && e.classList.contains('open') && a();
  8470. };
  8471. })(),
  8472. Xe = (function () {
  8473. var e = document.getElementById('meta-info');
  8474. return function () {
  8475. $('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0);
  8476. };
  8477. })(),
  8478. Ze = (function (e) {
  8479. function t() {
  8480. u.classList.contains('expand') && de.toggleMeta(!0);
  8481. }
  8482. function i() {
  8483. fe.hide();
  8484. }
  8485. function n() {
  8486. he.close();
  8487. }
  8488. function r() {
  8489. Ae.dismiss();
  8490. }
  8491. function o() {
  8492. p.hasClass('open') && a(!0);
  8493. }
  8494. function l() {
  8495. Ce.hide();
  8496. }
  8497. function c() {
  8498. f.hasClass('open') && f.removeClass('open');
  8499. }
  8500. function h() {
  8501. d.classList.contains('fadeIn') &&
  8502. (d.classList.contains('landing')
  8503. ? re.dismissModal()
  8504. : d.classList.contains('tour') && ve.dismissModal());
  8505. }
  8506. var u = document.getElementById('meta-info'),
  8507. d = document.getElementById('interaction-modal'),
  8508. p = $('#drawer').eq(0),
  8509. f = $('.gui-floor').eq(0),
  8510. g = $('.vr-popup').eq(0);
  8511. return function (e) {
  8512. switch (e) {
  8513. case 'info':
  8514. i(), n(), Ye(), l(), c(), r(), h();
  8515. break;
  8516. case 'terms':
  8517. t(), n(), o(), l(), c(), r(), h();
  8518. break;
  8519. case 'help':
  8520. t(), i(), l(), c(), r(), h();
  8521. break;
  8522. case 'vr':
  8523. t(), i(), l(), c(), n(), h(), s(g) && o();
  8524. break;
  8525. case 'highlights':
  8526. Xe(), i(), l(), c();
  8527. break;
  8528. case 'share':
  8529. t(), i(), n(), c(), r(), h();
  8530. break;
  8531. case 'floor':
  8532. i(), l(), r();
  8533. break;
  8534. case 'view':
  8535. c(), l(), i(), r();
  8536. break;
  8537. case 'tour':
  8538. i(), l(), c(), r();
  8539. break;
  8540. case 'move':
  8541. i(), l(), c(), r();
  8542. break;
  8543. case 'resize':
  8544. t(), Ye(), c();
  8545. break;
  8546. case 'tag':
  8547. i(), n(), l(), c(), r();
  8548. }
  8549. };
  8550. })();
  8551. $(document).on(
  8552. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  8553. function (e) {
  8554. $('#gui-fullscreen').toggle(!K.isFullscreen()),
  8555. $('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
  8556. setTimeout(function () {
  8557. $('.icon:visible').hide().show(0);
  8558. }, 100);
  8559. }
  8560. ),
  8561. $('#gui-fullscreen')
  8562. .find('a')
  8563. .on('click', function (e) {
  8564. l(e),
  8565. K.requestFullscreen($('body')[0]),
  8566. J.track('showcase_gui', {
  8567. gui_action: 'click_enter_fullscreen',
  8568. interaction_source: 'gui',
  8569. });
  8570. //czj
  8571. //W.reload()
  8572. }),
  8573. $('#gui-fullscreen-exit')
  8574. .find('a')
  8575. .on('click', function (e) {
  8576. l(e),
  8577. K.exitFullscreen(),
  8578. J.track('showcase_gui', {
  8579. gui_action: 'click_exit_fullscreen',
  8580. interaction_source: 'gui',
  8581. });
  8582. });
  8583. $(window)
  8584. .on('resize', function (e) {
  8585. var t = e.target.innerHeight,
  8586. i = e.target.innerWidth;
  8587. (t === X && i === Z) ||
  8588. (je.highlight.visible && w(),
  8589. Ze('resize'),
  8590. $('.pinTop.right').removeClass('hideUnderMeta'),
  8591. c(),
  8592. (X = t),
  8593. (Z = i));
  8594. })
  8595. .resize(),
  8596. K.supportsFullscreen() || $('#gui-fullscreen').hide(),
  8597. $('#pullTab').on('click', function (e) {
  8598. l(e),
  8599. $('#drawer').hasClass('open')
  8600. ? (J.trackAlways('showcase_gui', {
  8601. gui_action: 'hide_highlight_reel',
  8602. }),
  8603. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  8604. : (J.trackAlways('showcase_gui', {
  8605. gui_action: 'show_highlight_reel',
  8606. }),
  8607. $(this)
  8608. .removeClass('open')
  8609. .children('img')
  8610. .attr('src', 'images/auto-suspend.png'));
  8611. a();
  8612. });
  8613. /***********************方奕卓 热点列表事件监听 ************************/
  8614. if (window.DATA.showHotListSta) {
  8615. $('#hotList').css('display', '');
  8616. $('#hotList').on('click', function (e) {
  8617. l(e);
  8618. var hotList = $('#hotListWrap')[0];
  8619. var isActive = hotList.classList.contains('hotListActive');
  8620. if (isActive) {
  8621. hotList.classList.remove('hotListActive');
  8622. this.classList.remove('active');
  8623. } else {
  8624. hotList.classList.add('hotListActive');
  8625. this.classList.add('active');
  8626. }
  8627. }),
  8628. // $('#hotListContent ul').on('mouseover', function (e) {
  8629. // l(e);
  8630. // var target = e.target;
  8631. // var hotList = document.getElementById('hotListWrap');
  8632. // if (target.tagName === 'SPAN') {
  8633. // var targetParent = target.parentElement.parentElement;
  8634. // if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  8635. // hotList.style.width = target.offsetWidth + 116 + 'px';
  8636. // } else {
  8637. // hotList.style.width = '';
  8638. // }
  8639. // } else if (target.tagName === 'LI') {
  8640. // var targetParent = target.parentElement;
  8641. // if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
  8642. // hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  8643. // } else {
  8644. // hotList.style.width = '';
  8645. // }
  8646. // } else {
  8647. // hotList.style.width = '';
  8648. // }
  8649. // });
  8650. $('#hotListContent ul').on('click', function (e) {
  8651. l(e);
  8652. this.preElem && this.preElem.classList.remove('active');
  8653. if (e.target.tagName === 'SPAN') {
  8654. e.target.parentElement.classList.add('active');
  8655. e.target.parentElement.hot &&
  8656. e.target.parentElement.hot.examine(window.player, true); // 打开热点
  8657. this.preElem = e.target.parentElement;
  8658. } else {
  8659. e.target.classList.add('active');
  8660. e.target.hot && e.target.hot.examine(window.player, true); // 打开热点
  8661. this.preElem = e.target;
  8662. }
  8663. });
  8664. $('#hotListClose').on('click', function (e) {
  8665. l(e);
  8666. var hotList = $('#hotListWrap')[0];
  8667. hotList.classList.remove('hotListActive');
  8668. $('#hotListContent ul .active').removeClass('active');
  8669. $('#hotList')[0].classList.remove('active');
  8670. });
  8671. }
  8672. /*****************************************************************/
  8673. $('#more-menu-button').on('click', function (e) {
  8674. l(e);
  8675. var t = $('#more-menu');
  8676. t.toggleClass('open');
  8677. }),
  8678. (t.exports.init = S),
  8679. (t.exports.startLoading = x),
  8680. (t.exports.endLoading = d),
  8681. (t.exports.onProgress = u);
  8682. }.call(this, '/js/gui/gui.js'));
  8683. },
  8684. {
  8685. '../analytics': 4,
  8686. '../controls/serializer': 14,
  8687. '../enum/AlignmentType': 17,
  8688. '../enum/BlackoutStyle': 18,
  8689. '../enum/ControlEvents': 21,
  8690. '../enum/DirectorEvents': 23,
  8691. '../enum/Keys': 30,
  8692. '../enum/PathDiscardMode': 38,
  8693. '../enum/PathDisplayMode': 39,
  8694. '../enum/PlayerEvents': 40,
  8695. '../enum/VROption': 47,
  8696. '../enum/Vectors': 50,
  8697. '../enum/Viewmode': 51,
  8698. '../enum/WarpStyle': 52,
  8699. '../enum/ZoomEvents': 53,
  8700. '../lib/dat.gui': 93,
  8701. '../localization/localize': 108,
  8702. '../tag/Media/MediaEvent': 131,
  8703. '../objects/Snapshot': 153,
  8704. '../settings': 166,
  8705. '../util/ajax': 181,
  8706. '../util/browser': 182,
  8707. '../util/camera': 183,
  8708. '../util/logger': 189,
  8709. '../util/showcase': 193,
  8710. '../util/transitions': 195,
  8711. './closer/ModalCloserEvent': 61,
  8712. './closer/modalCloser': 62,
  8713. './help/HelpEvent': 66,
  8714. './help/help': 67,
  8715. './helpManager': 68,
  8716. './immersiveMode': 69,
  8717. './konami': 70,
  8718. './landingScreen': 71,
  8719. './loadingScreen': 72,
  8720. './memoryUsage': 73,
  8721. './playButton': 74,
  8722. './populateModal': 75,
  8723. './sharing/ShareEvents': 76,
  8724. './sharing/modal': 77,
  8725. './terms/TermsEvent': 78,
  8726. './terms/terms': 79,
  8727. './title/TitleEvents': 80,
  8728. './title/tagToggle': 81,
  8729. './title/titleBar': 82,
  8730. './tourInteraction': 84,
  8731. './vr/vrEvent': 85,
  8732. './vr/vrModal': 87,
  8733. './webvr/WebVrEvent': 88,
  8734. './webvr/webVRgui': 89,
  8735. three: 217,
  8736. },
  8737. ],
  8738. 66: [
  8739. function (e, t, i) {
  8740. 'use strict';
  8741. t.exports = Object.freeze({
  8742. OPENED: 'help.opened',
  8743. CLOSED: 'help.closed',
  8744. });
  8745. },
  8746. {},
  8747. ],
  8748. 67: [
  8749. function (e, t, i) {
  8750. 'use strict';
  8751. function n() {
  8752. g.on('click', function (e) {
  8753. if (S && S !== l.TRANSITIONING) {
  8754. var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0;
  8755. t && !M ? R.close() : r();
  8756. }
  8757. }),
  8758. w.on('click', function (e) {
  8759. R.close();
  8760. }),
  8761. E.on('click', function (e) {
  8762. S && S !== l.TRANSITIONING && (s(), o());
  8763. }),
  8764. b.on('click', function (e) {
  8765. s(), a();
  8766. });
  8767. }
  8768. function r() {
  8769. S &&
  8770. S !== l.TRANSITIONING &&
  8771. ((M = !0),
  8772. setTimeout(function () {
  8773. M = !1;
  8774. }, d.help.modalStayDuration),
  8775. R.emit(h.OPENED),
  8776. m.addClass('open ' + S),
  8777. g.addClass('open'),
  8778. s(),
  8779. o(),
  8780. y.style.removeProperty
  8781. ? y.style.removeProperty('display')
  8782. : y.style.removeAttribute('display'),
  8783. y.classList.add('fadeIn'));
  8784. }
  8785. function o() {
  8786. E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S);
  8787. }
  8788. function a() {
  8789. b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help');
  8790. }
  8791. function s(e, t) {
  8792. m.removeClass(
  8793. 'more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR
  8794. ),
  8795. I.forEach(function (e) {
  8796. e.classList.remove('underline-tab');
  8797. });
  8798. }
  8799. var l = e('../../enum/Viewmode'),
  8800. c = e('../../enum/HelpModalType'),
  8801. h = e('./HelpEvent'),
  8802. u = (e('../helpManager'), e('./../populateModal')),
  8803. d = e('../../settings'),
  8804. p = e('../../util/common'),
  8805. f = e('events').EventEmitter,
  8806. g = $('.footer-help').eq(0),
  8807. m = $('#help-dialog').eq(0),
  8808. v = document.querySelector('#quick-logo'),
  8809. A = document.querySelector('#loaderCoBrand'),
  8810. y = document.querySelector('#help-dialog'),
  8811. C = document.querySelector('.footer'),
  8812. I = $('.help-tabs').children().toArray(),
  8813. E = $('.navigation-tab').eq(0),
  8814. b = $('.more-help-tab').eq(0),
  8815. w =
  8816. ($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
  8817. _ = m.find('.interactions').toArray(),
  8818. T = m.find('.ui-instructions').toArray(),
  8819. x = l.PANORAMA,
  8820. S = l.PANORAMA,
  8821. M = !1,
  8822. R = {
  8823. init: function (e, t) {
  8824. (S = t),
  8825. (x = t),
  8826. [y, A, v, C].forEach(function (e) {
  8827. e.classList.add(u.deviceType);
  8828. }),
  8829. n();
  8830. },
  8831. close: function () {
  8832. if (
  8833. m.hasClass('open') &&
  8834. (this.emit(h.CLOSED),
  8835. g.removeClass('open'),
  8836. m.removeClass('open'),
  8837. y.classList.contains('fadeIn'))
  8838. ) {
  8839. y.classList.remove('fadeIn');
  8840. var e = S === l.TRANSITIONING ? x : S;
  8841. u.clear(_, c.NAVIGATION, e);
  8842. }
  8843. },
  8844. updateMode: function (e) {
  8845. (x = S), (S = e);
  8846. },
  8847. };
  8848. p.extendObject(R, f.prototype), (t.exports = R);
  8849. },
  8850. {
  8851. '../../enum/HelpModalType': 28,
  8852. '../../enum/Viewmode': 51,
  8853. '../../settings': 166,
  8854. '../../util/common': 185,
  8855. '../helpManager': 68,
  8856. './../populateModal': 75,
  8857. './HelpEvent': 66,
  8858. events: 202,
  8859. },
  8860. ],
  8861. 68: [
  8862. function (e, t, i) {
  8863. (function (i) {
  8864. 'use strict';
  8865. var n = e('../util/browser'),
  8866. r = e('./../util/logger'),
  8867. o = e('./../settings'),
  8868. a = new r(i),
  8869. s = (function () {
  8870. var e;
  8871. try {
  8872. return (
  8873. (e = window.localStorage.getItem('visitCount') || '0'),
  8874. (e = (parseFloat(e) + 1).toString()),
  8875. window.localStorage.setItem('visitCount', e),
  8876. a.debug('visitCount = ' + e),
  8877. e
  8878. );
  8879. } catch (t) {
  8880. (e = '1'), a.debug("couldn't set local storage");
  8881. }
  8882. })(),
  8883. l = !1;
  8884. t.exports = {
  8885. isHelpDisabled: function () {
  8886. return '0' === n.valueFromHash('help', null) || l;
  8887. },
  8888. isLargeHelpEnabled: function () {
  8889. return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled();
  8890. },
  8891. isSmallHelpEnabled: function () {
  8892. return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled();
  8893. },
  8894. isHelpEnabled: function () {
  8895. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled();
  8896. },
  8897. setAutoPlay: function (e) {
  8898. l = o.warp.auto >= 0 && e > 1;
  8899. },
  8900. };
  8901. }.call(this, '/js/gui/helpManager.js'));
  8902. },
  8903. {
  8904. '../util/browser': 182,
  8905. './../settings': 166,
  8906. './../util/logger': 189,
  8907. },
  8908. ],
  8909. 69: [
  8910. function (e, t, i) {
  8911. 'use strict';
  8912. function n(e, t, i, n) {
  8913. (F = n), r(e, t, i, F), o(), (N = t.mode);
  8914. }
  8915. function r(e, t, i, n) {
  8916. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  8917. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c);
  8918. }),
  8919. M.on('mousewheel DOMMouseScroll', a),
  8920. i.on(m.TagActivated, a),
  8921. i.on(m.TagNavigation, a),
  8922. t.on(A.FlyingEnded, s),
  8923. t.on(A.ModeChanging, function (e, t) {
  8924. B = t !== C.PANORAMA && e !== C.PANORAMA;
  8925. }),
  8926. t.on(A.ModeChanged, function (e, i) {
  8927. (N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange');
  8928. }),
  8929. n.on(y.TourStart, function () {
  8930. (L = !0), a();
  8931. }),
  8932. n.on(y.TourEnd, function () {
  8933. (L = !1), l();
  8934. }),
  8935. n.on(y.ActionInterrupted, function () {
  8936. L = !1;
  8937. }),
  8938. R.addEventListener(
  8939. 'touchend',
  8940. function () {
  8941. $('#pullTab').hasClass('opened') && !L && l();
  8942. },
  8943. !0
  8944. );
  8945. }
  8946. function o() {
  8947. p.isMobile()
  8948. ? (b.forEach(function (e) {
  8949. e.classList.add('mobile');
  8950. }),
  8951. w.click(l))
  8952. : (b.forEach(function (e) {
  8953. e.addEventListener(
  8954. 'mouseleave',
  8955. function () {
  8956. !M.is(':hover') && b[0].classList.contains('detectHover') && l();
  8957. },
  8958. !0
  8959. );
  8960. }),
  8961. M.mouseleave(function () {
  8962. b[0].classList.contains('detectHover') && l();
  8963. }));
  8964. }
  8965. function a(e) {
  8966. D ||
  8967. (d(e) && _.hasClass('playing')) ||
  8968. (clearTimeout(O),
  8969. (P = !0),
  8970. g.close(),
  8971. h(e),
  8972. N !== C.DOLLHOUSE &&
  8973. N !== C.FLOORPLAN &&
  8974. ((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
  8975. _.hasClass('playing') ||
  8976. (b.forEach(function (e) {
  8977. e.classList.add('detectHover');
  8978. }),
  8979. (O = setTimeout(l, f.immersive.timeToShowAgain)))));
  8980. }
  8981. function s() {
  8982. _.hasClass('playing') ||
  8983. (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)));
  8984. }
  8985. function l() {
  8986. clearTimeout(O),
  8987. (P = !1),
  8988. I.forEach(function (e) {
  8989. e.classList.remove('drawerOpen');
  8990. }),
  8991. L ||
  8992. E.forEach(function (e) {
  8993. e.classList.remove('duringTour');
  8994. }),
  8995. b.forEach(function (e) {
  8996. e.classList.remove('detectHover');
  8997. });
  8998. }
  8999. function c() {
  9000. P ? l() : a(),
  9001. (D = !0),
  9002. setTimeout(function () {
  9003. D = !1;
  9004. }, f.immersive.uiStayDuration);
  9005. }
  9006. function h(e) {
  9007. !d(e) && L
  9008. ? E.forEach(function (e) {
  9009. e.classList.remove('drawerOpen'), e.classList.add('duringTour');
  9010. })
  9011. : _.hasClass('open')
  9012. ? E.forEach(function (e) {
  9013. e.classList.remove('duringTour'), e.classList.add('drawerOpen');
  9014. })
  9015. : B ||
  9016. N === C.FLOORPLAN ||
  9017. N === C.DOLLHOUSE ||
  9018. E.forEach(function (e) {
  9019. e.classList.add('fadeOut');
  9020. });
  9021. }
  9022. function u() {
  9023. T.hasClass('duringTour') || ((L = !1), a('gui'), l());
  9024. }
  9025. function d(e) {
  9026. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e;
  9027. }
  9028. var p = e('../util/browser'),
  9029. f = e('../settings'),
  9030. g = e('./help/help'),
  9031. m = e('../enum/tagEvents'),
  9032. v = e('../enum/ControlEvents'),
  9033. A = e('../enum/PlayerEvents'),
  9034. y = e('../enum/DirectorEvents'),
  9035. A = e('../enum/PlayerEvents'),
  9036. C = e('../enum/Viewmode'),
  9037. I = $(
  9038. '.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer'
  9039. ).toArray(),
  9040. E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  9041. b = $('#hover-bottom, #hover-top').toArray(),
  9042. w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  9043. _ = $('#drawer').eq(0),
  9044. T = $('#drawer-container').eq(0),
  9045. x = $('#meta-info').eq(0),
  9046. S = $('.pinTop.left').eq(0),
  9047. M = $('#player').eq(0),
  9048. R = document.getElementById('pullTab'),
  9049. P = !1,
  9050. O = null,
  9051. L = !1,
  9052. D = !1,
  9053. N = null,
  9054. B = !1,
  9055. F = null;
  9056. (t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u);
  9057. },
  9058. {
  9059. '../enum/ControlEvents': 21,
  9060. '../enum/DirectorEvents': 23,
  9061. '../enum/tagEvents': 32,
  9062. '../enum/PlayerEvents': 40,
  9063. '../enum/Viewmode': 51,
  9064. '../settings': 166,
  9065. '../util/browser': 182,
  9066. './help/help': 67,
  9067. },
  9068. ],
  9069. 70: [
  9070. function (e, t, i) {
  9071. (function (i) {
  9072. 'use strict';
  9073. function n(e, t, i) {
  9074. l.debug('konami has the modelInstance');
  9075. var n = [];
  9076. $(window).on('keydown', function (e) {
  9077. n.push(e.which),
  9078. n.length > o.secretPanelWord.length && n.shift(),
  9079. s.equalLists(n, o.secretPanelWord) &&
  9080. (l.debug('Developer mode active.'), (o.debug = !0));
  9081. }),
  9082. $(window).on('keydown', function n(r) {
  9083. o.debug &&
  9084. 72 === r.which &&
  9085. (e && i
  9086. ? (a.toggle(e, t, i), $(window).off('keydown', n))
  9087. : console.warn("sorry we're not ready yet"));
  9088. });
  9089. }
  9090. var r = e('./../util/logger'),
  9091. o = e('./../settings'),
  9092. a = e('./debug'),
  9093. s = e('./../util/common'),
  9094. l = (e('./gui'), new r(i));
  9095. o.console && $('body').append('<div id="debug-console"></div>'), (t.exports.init = n);
  9096. }.call(this, '/js/gui/konami.js'));
  9097. },
  9098. {
  9099. './../settings': 166,
  9100. './../util/common': 185,
  9101. './../util/logger': 189,
  9102. './debug': 63,
  9103. './gui': 65,
  9104. },
  9105. ],
  9106. 71: [
  9107. function (e, t, i) {
  9108. 'use strict';
  9109. function n(e, t) {
  9110. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode;
  9111. }
  9112. function r(e) {
  9113. var t = $.Deferred();
  9114. e || t.resolve();
  9115. var i = c.startupFlyinDelay;
  9116. return (
  9117. e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  9118. setTimeout(t.resolve.bind(t), i),
  9119. t
  9120. );
  9121. }
  9122. function o(e, t, i) {
  9123. var n = 0;
  9124. c.quickstart.enabled &&
  9125. (a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay));
  9126. var r = function () {
  9127. e.once(g.Move, l), t.once(f.TourStart, l);
  9128. };
  9129. s(n, r);
  9130. }
  9131. function a(e) {
  9132. return; /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  9133. v.before(y),
  9134. A = $(".quick-brand").toArray()),*/
  9135. m.addClass('fadeOut'),
  9136. setTimeout(function () {
  9137. A.forEach(function (e) {
  9138. e.classList.add('fadeIn');
  9139. });
  9140. }, c.quickstart.showTextDelay),
  9141. setTimeout(function () {
  9142. A.forEach(function (e) {
  9143. e.classList.add('fadeOut');
  9144. });
  9145. }, c.quickstart.fadeOutDelay),
  9146. !0;
  9147. }
  9148. function s(e, t) {
  9149. setTimeout(function () {
  9150. if (h.isHelpEnabled()) {
  9151. if (
  9152. (t(),
  9153. u.init(),
  9154. C.addClass('fadeIn landing ' + u.deviceType),
  9155. h.isSmallHelpEnabled())
  9156. )
  9157. return void C.addClass('small');
  9158. u.fill(I, d.LANDING[E]), C.addClass(E);
  9159. }
  9160. }, e);
  9161. //csz 用户引导界面
  9162. var helpData = {
  9163. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  9164. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png'],
  9165. };
  9166. var navIcon = $('.nav-icon .icon');
  9167. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
  9168. navIcon.attr('src', helpData.mobile[0]);
  9169. function paging(id) {
  9170. id.on('click', function () {
  9171. var navPage = null;
  9172. $(this).attr('data-id') == 'plus'
  9173. ? (navPage = +navIcon.attr('data-page') + 1)
  9174. : (navPage = +navIcon.attr('data-page') - 1);
  9175. if (navPage > helpData.length || navPage < 1) return false;
  9176. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  9177. navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] });
  9178. } else {
  9179. navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] });
  9180. }
  9181. });
  9182. }
  9183. paging($('.next-button'));
  9184. paging($('.prev-button'));
  9185. }
  9186. function l() {
  9187. u.clear(I, d.LANDING[E]), C.removeClass('fadeIn');
  9188. }
  9189. var c = e('../settings'),
  9190. h = (e('./help/help'), e('./helpManager')),
  9191. u = e('./populateModal'),
  9192. d = e('../enum/HelpModalType'),
  9193. p = e('../enum/Viewmode'),
  9194. f = e('../enum/DirectorEvents'),
  9195. g = e('../enum/PlayerEvents'),
  9196. m = $('#quick-blackout').eq(0),
  9197. v = $('#quick-logo').eq(0),
  9198. A = $('.quick-brand').toArray(),
  9199. y = $('#loaderCoBrand').eq(0),
  9200. C = $('#interaction-modal').eq(0),
  9201. I = C.find('.interaction').toArray(),
  9202. E =
  9203. ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  9204. '');
  9205. (t.exports.delayLanding = r),
  9206. (t.exports.showMessage = o),
  9207. (t.exports.init = n),
  9208. (t.exports.dismissModal = l);
  9209. },
  9210. {
  9211. '../enum/DirectorEvents': 23,
  9212. '../enum/HelpModalType': 28,
  9213. '../enum/PlayerEvents': 40,
  9214. '../enum/Viewmode': 51,
  9215. '../settings': 166,
  9216. './help/help': 67,
  9217. './helpManager': 68,
  9218. './populateModal': 75,
  9219. },
  9220. ],
  9221. 72: [
  9222. function (e, t, i) {
  9223. 'use strict';
  9224. var n = e('./circleLoader').circleLoader;
  9225. t.exports = {
  9226. element: $('#gui-loading'),
  9227. hide: function (e) {
  9228. n.done(), this.element.fadeOut(1500, e);
  9229. },
  9230. show: function (e) {
  9231. this.element.fadeIn(
  9232. 500,
  9233. function () {
  9234. this.element.css('display', 'table'), e && e();
  9235. }.bind(this)
  9236. );
  9237. },
  9238. progress: function (e) {
  9239. n.set(e);
  9240. },
  9241. };
  9242. },
  9243. {
  9244. './circleLoader': 60,
  9245. },
  9246. ],
  9247. 73: [
  9248. function (e, t, i) {
  9249. 'use strict';
  9250. var n = e('../settings'),
  9251. r = $('#memory-info'),
  9252. o = r.find('#memory-gpu'),
  9253. a = !1;
  9254. t.exports = {
  9255. show: function () {
  9256. n.profiling.enabled && (r.show(), (a = !0));
  9257. },
  9258. hide: function () {
  9259. r.hide(), (a = !1);
  9260. },
  9261. toggle: function () {
  9262. a ? this.hide() : this.show();
  9263. },
  9264. update: function (e) {
  9265. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB');
  9266. },
  9267. };
  9268. },
  9269. {
  9270. '../settings': 166,
  9271. },
  9272. ],
  9273. 74: [
  9274. function (e, t, i) {
  9275. 'use strict';
  9276. var n = e('../util/browser'),
  9277. r = e('../analytics');
  9278. e('../settings');
  9279. t.exports = {
  9280. show: function (e, t) {
  9281. $('#gui-message').fadeOut(500, function () {
  9282. t();
  9283. });
  9284. },
  9285. };
  9286. },
  9287. {
  9288. '../analytics': 4,
  9289. '../settings': 166,
  9290. '../util/browser': 182,
  9291. },
  9292. ],
  9293. 75: [
  9294. function (e, t, i) {
  9295. 'use strict';
  9296. function n(e, t, i, n) {
  9297. function r(e) {
  9298. return e.classList.contains(a);
  9299. }
  9300. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  9301. //for (var a in o) {
  9302. //var s = e.find(r);
  9303. //for (var l in o[a]) {
  9304. //var c = o[a][l];
  9305. //if ("top-info" === l || "bottom-info" === l) {
  9306. //var h = n ? c : "";
  9307. //czj 注释掉第一次打开的用户引导
  9308. //s.querySelector("." + l).textContent = h
  9309. //} else {
  9310. //var u = n ? c : "";
  9311. //, d = s.querySelector("." + l);
  9312. //d.src = u,
  9313. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  9314. //}
  9315. //}
  9316. //}
  9317. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  9318. // p.forEach(function(e) {
  9319. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  9320. // })
  9321. }
  9322. var r = e('../util/browser'),
  9323. o = e('../localization/localize'),
  9324. a = e('../enum/HelpModalType'),
  9325. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'));
  9326. t.exports = {
  9327. init: function () {
  9328. if (!this.hasInitialized) {
  9329. (this.hasInitialized = !0),
  9330. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  9331. (this.assets = {}),
  9332. (this.assets[a.LANDING[s.PANORAMA]] = {
  9333. desktop: {
  9334. left: {
  9335. 'top-info': o.ROTATE,
  9336. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9337. keyboard: 'images/nav_help_keyboard_left_right.png',
  9338. },
  9339. middle: {
  9340. 'top-info': o.MOVE,
  9341. 'big-image': 'images/nav_help_mouse_click.png',
  9342. keyboard: 'images/nav_help_keyboard_up_down.png',
  9343. },
  9344. right: {
  9345. 'top-info': o.ZOOM,
  9346. 'big-image': 'images/nav_help_mouse_zoom.png',
  9347. keyboard: 'images/nav_help_zoom_keys.png',
  9348. },
  9349. },
  9350. mobile: {
  9351. left: {
  9352. 'top-info': o.ROTATE,
  9353. 'big-image': 'images/nav_help_gesture_drag.png',
  9354. },
  9355. middle: {
  9356. 'top-info': o.MOVE,
  9357. 'big-image': 'images/nav_help_gesture_tap.png',
  9358. },
  9359. right: {
  9360. 'top-info': o.ZOOM,
  9361. 'big-image': 'images/nav_help_gesture_pinch.png',
  9362. },
  9363. },
  9364. }),
  9365. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(
  9366. JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])
  9367. )),
  9368. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  9369. desktop: {
  9370. left: {
  9371. 'top-info': o.ROTATE,
  9372. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9373. keyboard: 'images/nav_help_keyboard_left_right.png',
  9374. },
  9375. middle: {
  9376. 'top-info': o.MOVE,
  9377. 'big-image': 'images/nav_help_mouse_position_right.png',
  9378. },
  9379. },
  9380. mobile: {
  9381. left: {
  9382. 'top-info': o.ROTATE,
  9383. 'big-image': 'images/nav_help_gesture_drag.png',
  9384. },
  9385. middle: {
  9386. 'top-info': o.MOVE,
  9387. 'big-image': 'images/nav_help_gesture_position_two_finger.png',
  9388. },
  9389. },
  9390. }),
  9391. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  9392. desktop: {
  9393. left: {
  9394. 'top-info': o.MOVE,
  9395. 'big-image': 'images/nav_help_mouse_position_left.png',
  9396. },
  9397. middle: {
  9398. 'top-info': o.ROTATE,
  9399. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9400. keyboard: 'images/nav_help_keyboard_left_right.png',
  9401. },
  9402. },
  9403. mobile: {
  9404. left: {
  9405. 'top-info': o.MOVE,
  9406. 'big-image': 'images/nav_help_gesture_position.png',
  9407. },
  9408. middle: {
  9409. 'top-info': o.ROTATE,
  9410. 'big-image': 'images/nav_help_gesture_drag_two_finger.png',
  9411. },
  9412. },
  9413. });
  9414. var e = {
  9415. 'top-info': o.INSIDE,
  9416. 'big-image': 'images/nav_help_click_inside.png',
  9417. keyboard: 'images/nav_help_inside_key.png',
  9418. };
  9419. (this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e),
  9420. (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e),
  9421. (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e);
  9422. var t = {
  9423. 'top-info': o.INSIDE,
  9424. 'big-image': 'images/nav_help_tap_inside.png',
  9425. };
  9426. (this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  9427. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  9428. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  9429. (this.assets[a.NAVIGATION] = {}),
  9430. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  9431. desktop: {
  9432. left: {
  9433. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  9434. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  9435. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9436. keyboard: 'images/nav_help_keyboard_left_right.png',
  9437. },
  9438. middle: {
  9439. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  9440. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  9441. 'big-image': 'images/nav_help_mouse_click.png',
  9442. keyboard: 'images/nav_help_keyboard_up_down.png',
  9443. },
  9444. right: {
  9445. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  9446. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  9447. 'big-image': 'images/nav_help_mouse_zoom.png',
  9448. keyboard: 'images/nav_help_zoom_keys.png',
  9449. },
  9450. },
  9451. mobile: {
  9452. left: {
  9453. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  9454. 'big-image': 'images/nav_help_gesture_drag.png',
  9455. },
  9456. middle: {
  9457. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  9458. 'big-image': 'images/nav_help_gesture_tap.png',
  9459. },
  9460. right: {
  9461. 'top-info': o.HELP_MOBILE_3,
  9462. 'big-image': 'images/nav_help_gesture_pinch.png',
  9463. },
  9464. },
  9465. }),
  9466. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  9467. desktop: {
  9468. left: {
  9469. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  9470. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  9471. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9472. keyboard: 'images/nav_help_keyboard_all.png',
  9473. },
  9474. middle: {
  9475. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  9476. 'big-image': 'images/nav_help_mouse_position_right.png',
  9477. },
  9478. right: {
  9479. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  9480. 'big-image': 'images/nav_help_mouse_zoom.png',
  9481. },
  9482. },
  9483. mobile: {
  9484. left: {
  9485. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  9486. 'big-image': 'images/nav_help_gesture_drag.png',
  9487. },
  9488. middle: {
  9489. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  9490. 'big-image': 'images/nav_help_gesture_position_two_finger.png',
  9491. },
  9492. right: {
  9493. 'top-info': o.HELP_MOBILE_3,
  9494. 'big-image': 'images/nav_help_gesture_pinch.png',
  9495. },
  9496. },
  9497. }),
  9498. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  9499. desktop: {
  9500. left: {
  9501. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  9502. 'big-image': 'images/nav_help_mouse_position_left.png',
  9503. },
  9504. middle: {
  9505. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  9506. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  9507. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9508. keyboard: 'images/nav_help_keyboard_left_right.png',
  9509. },
  9510. right: {
  9511. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  9512. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  9513. 'big-image': 'images/nav_help_mouse_zoom.png',
  9514. keyboard: 'images/nav_help_keyboard_up_down.png',
  9515. },
  9516. },
  9517. mobile: {
  9518. left: {
  9519. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  9520. 'big-image': 'images/nav_help_gesture_position.png',
  9521. },
  9522. middle: {
  9523. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  9524. 'big-image': 'images/nav_help_gesture_drag_two_finger.png',
  9525. },
  9526. right: {
  9527. 'top-info': o.HELP_MOBILE_3,
  9528. 'big-image': 'images/nav_help_gesture_pinch.png',
  9529. },
  9530. },
  9531. }),
  9532. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(
  9533. JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])
  9534. )),
  9535. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  9536. 'top-info': o.HELP_DESKTOP_360_2A,
  9537. 'bottom-info': o.HELP_DESKTOP_360_2B,
  9538. 'big-image': 'images/nav_help_click_inside.png',
  9539. keyboard: 'images/nav_help_inside_key.png',
  9540. }),
  9541. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  9542. 'top-info': o.HELP_MOBILE_360_2,
  9543. 'big-image': 'images/nav_help_tap_inside.png',
  9544. }),
  9545. (this.assets[a.MORE_HELP] = {
  9546. desktop: {
  9547. 'more-help-hlr': {
  9548. 'top-info': o.HELP_MORE_HLR_A,
  9549. 'big-image': 'images/nav_help_expand.svg',
  9550. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B,
  9551. },
  9552. 'more-help-dollhouse': {
  9553. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9554. 'big-image': 'images/nav_help_dollhouse.svg',
  9555. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B,
  9556. },
  9557. 'more-help-floors': {
  9558. 'top-info': o.HELP_MORE_FLOORS_A,
  9559. 'big-image': 'images/nav_help_floor picker.svg',
  9560. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B,
  9561. },
  9562. 'more-help-tag': {
  9563. 'top-info': o.HELP_MORE_TAG_A,
  9564. 'big-image': 'images/nav_help_tag.svg',
  9565. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B,
  9566. },
  9567. 'more-help-zoom': {
  9568. 'top-info': o.HELP_MORE_ZOOM_A,
  9569. 'big-image': 'images/nav_help_zoom.svg',
  9570. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B,
  9571. },
  9572. 'more-help-tour': {
  9573. 'top-info': o.HELP_MORE_TOUR_A,
  9574. 'big-image': 'images/nav_help_play.png',
  9575. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B,
  9576. },
  9577. 'more-help-inside': {
  9578. 'top-info': o.HELP_MORE_INSIDE_A,
  9579. 'big-image': 'images/nav_help_inside.svg',
  9580. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B,
  9581. },
  9582. 'more-help-vr': {
  9583. 'top-info': o.HELP_MORE_VR_A,
  9584. 'big-image': 'images/nav_help_vr.svg',
  9585. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B,
  9586. },
  9587. 'more-help-360': {
  9588. 'top-info': o.HELP_MORE_360_A,
  9589. 'big-image': 'images/nav_help_360.svg',
  9590. 'bottom-info': o.HELP_DESKTOP_MORE_360_B,
  9591. },
  9592. 'more-help-fullscreen': {
  9593. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  9594. 'big-image': 'images/nav_help_fullscreen.svg',
  9595. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B,
  9596. },
  9597. },
  9598. mobile: {
  9599. 'more-help-hlr': {
  9600. 'top-info': o.HELP_MORE_HLR_A,
  9601. 'big-image': 'images/nav_help_expand.svg',
  9602. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B,
  9603. },
  9604. 'more-help-dollhouse': {
  9605. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9606. 'big-image': 'images/nav_help_dollhouse.svg',
  9607. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B,
  9608. },
  9609. 'more-help-floors': {
  9610. 'top-info': o.HELP_MORE_FLOORS_A,
  9611. 'big-image': 'images/nav_help_floor picker.svg',
  9612. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B,
  9613. },
  9614. 'more-help-tag': {
  9615. 'top-info': o.HELP_MORE_TAG_A,
  9616. 'big-image': 'images/nav_help_tag.svg',
  9617. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B,
  9618. },
  9619. 'more-help-tour': {
  9620. 'top-info': o.HELP_MORE_TOUR_A,
  9621. 'big-image': 'images/nav_help_play.png',
  9622. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B,
  9623. },
  9624. 'more-help-inside': {
  9625. 'top-info': o.HELP_MORE_INSIDE_A,
  9626. 'big-image': 'images/nav_help_inside.svg',
  9627. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B,
  9628. },
  9629. 'more-help-vr': {
  9630. 'top-info': o.HELP_MORE_VR_A,
  9631. 'big-image': 'images/webvr.svg',
  9632. 'bottom-info': o.HELP_MOBILE_MORE_VR_B,
  9633. },
  9634. 'more-help-360': {
  9635. 'top-info': o.HELP_MORE_360_A,
  9636. 'big-image': 'images/nav_help_360.svg',
  9637. 'bottom-info': o.HELP_MOBILE_MORE_360_B,
  9638. },
  9639. },
  9640. }),
  9641. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  9642. desktop: {
  9643. left: {
  9644. 'top-info': o.ROTATE,
  9645. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9646. keyboard: 'images/nav_help_keyboard_left_right.png',
  9647. },
  9648. middle: {
  9649. 'top-info': o.MOVE,
  9650. 'big-image': 'images/nav_help_mouse_click.png',
  9651. keyboard: 'images/nav_help_keyboard_up_down.png',
  9652. },
  9653. right: {
  9654. 'top-info': o.PLAY,
  9655. 'big-image': 'images/Desktop-help-play-button.svg',
  9656. keyboard: 'images/Desktop-help-spacebar-2.svg',
  9657. },
  9658. },
  9659. mobile: {
  9660. left: {
  9661. 'top-info': o.ROTATE,
  9662. 'big-image': 'images/nav_help_gesture_drag.png',
  9663. },
  9664. middle: {
  9665. 'top-info': o.MOVE,
  9666. 'big-image': 'images/nav_help_gesture_tap.png',
  9667. },
  9668. right: {
  9669. 'top-info': o.PLAY,
  9670. 'big-image': 'images/mobile-help-play-button.svg',
  9671. },
  9672. },
  9673. }),
  9674. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(
  9675. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])
  9676. )),
  9677. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle =
  9678. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  9679. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle =
  9680. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  9681. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(
  9682. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])
  9683. )),
  9684. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left =
  9685. this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  9686. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left =
  9687. this.assets[a.LANDING[s.FLOORPLAN]].mobile.left);
  9688. }
  9689. },
  9690. fill: function (e, t, i) {
  9691. n.call(this, e, t, i, !0);
  9692. },
  9693. clear: function (e, t, i) {
  9694. n.call(this, e, t, i, !1);
  9695. },
  9696. };
  9697. },
  9698. {
  9699. '../enum/HelpModalSize': 27,
  9700. '../enum/HelpModalType': 28,
  9701. '../enum/Viewmode': 51,
  9702. '../localization/localize': 108,
  9703. '../util/browser': 182,
  9704. },
  9705. ],
  9706. 76: [
  9707. function (e, t, i) {
  9708. 'use strict';
  9709. t.exports = Object.freeze({
  9710. OPENED: 'share.open',
  9711. CLOSED: 'share.closed',
  9712. LINK_CLICKED: 'share.linked',
  9713. });
  9714. },
  9715. {},
  9716. ],
  9717. 77: [
  9718. function (e, t, i) {
  9719. 'use strict';
  9720. function n(e) {
  9721. function t(t, i) {
  9722. var n = window.screenY + ($('#player').height() - i) / 2,
  9723. r = window.screenX + ($('#player').width() - t) / 2,
  9724. o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i;
  9725. I.emit(l.LINK_CLICKED, {
  9726. channel: e,
  9727. }),
  9728. window.open(C[e], 'shareWindow', o);
  9729. }
  9730. switch (e) {
  9731. case y.FACEBOOK:
  9732. t(580, 420);
  9733. break;
  9734. case y.TWITTER:
  9735. t(550, 440);
  9736. break;
  9737. case y.MAIL:
  9738. I.emit(l.LINK_CLICKED, {
  9739. channel: 'email',
  9740. }),
  9741. window.open(C[e], '_blank');
  9742. break;
  9743. case y.LINKEDIN:
  9744. }
  9745. }
  9746. function r(e) {
  9747. I.emit(l.LINK_CLICKED, {
  9748. channel: 'copylink',
  9749. });
  9750. var t = document.createRange();
  9751. t.selectNodeContents(v);
  9752. var i = window.getSelection();
  9753. i.removeAllRanges(),
  9754. i.addRange(t),
  9755. document.execCommand('copy'),
  9756. A.classList.remove('hidden'),
  9757. v.classList.add('highlighted');
  9758. }
  9759. function o(e) {
  9760. (e && (e.stopPropagation(), e.target === v)) ||
  9761. (window.getSelection().removeAllRanges(),
  9762. v.classList.remove('highlighted'),
  9763. A.classList.add('hidden'));
  9764. }
  9765. var a = e('../../util/browser'),
  9766. s = e('../../localization/localize'),
  9767. l = e('./ShareEvents'),
  9768. c = e('../../util/common'),
  9769. h = e('events').EventEmitter,
  9770. u = document.getElementById('sharing'),
  9771. d = document.getElementById('share-modal'),
  9772. p = document.getElementById('share-close'),
  9773. f = document.getElementById('facebook-share'),
  9774. g = document.getElementById('twitter-share'),
  9775. m = document.getElementById('mail-share'),
  9776. v = document.getElementById('share-url-text'),
  9777. A = document.getElementById('copy-success'),
  9778. y = Object.freeze({
  9779. FACEBOOK: 'facebook',
  9780. TWITTER: 'twitter',
  9781. MAIL: 'mail',
  9782. LINKEDIN: 'linkedin',
  9783. }),
  9784. C = {};
  9785. (C[y.FACEBOOK] =
  9786. 'http://www.facebook.com/sharer.php?u=' +
  9787. encodeURIComponent(window.location.href + '&utm_source=1') +
  9788. '&t='),
  9789. (C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  9790. (C[y.MAIL] = 'mailto:?subject=');
  9791. var I = {
  9792. init: function (e) {
  9793. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ');
  9794. (C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  9795. (C[y.TWITTER] +=
  9796. t +
  9797. encodeURIComponent(
  9798. window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port'
  9799. )),
  9800. (C[y.MAIL] +=
  9801. encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) +
  9802. '&body=' +
  9803. t +
  9804. encodeURIComponent(window.location.href + '&utm_source=3')),
  9805. u.addEventListener('click', this.toggle.bind(this)),
  9806. p.addEventListener('click', this.hide.bind(this)),
  9807. v.addEventListener('click', r),
  9808. d.addEventListener('click', o),
  9809. f.addEventListener('click', n.bind(this, y.FACEBOOK)),
  9810. g.addEventListener('click', n.bind(this, y.TWITTER)),
  9811. m.addEventListener('click', n.bind(this, y.MAIL)),
  9812. (v.textContent = window.location.href + '&utm_source=4'),
  9813. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  9814. u.classList.remove('hidden');
  9815. },
  9816. show: function () {
  9817. this.emit(l.OPENED), d.classList.add('fadeIn');
  9818. },
  9819. hide: function () {
  9820. d.classList.contains('fadeIn') &&
  9821. (this.emit(l.CLOSED),
  9822. document.selection && document.selection.empty(),
  9823. window.getSelection().removeAllRanges(),
  9824. o(),
  9825. d.classList.remove('fadeIn'));
  9826. },
  9827. toggle: function () {
  9828. d.classList.contains('fadeIn') ? this.hide() : this.show();
  9829. },
  9830. };
  9831. c.extendObject(I, h.prototype), (t.exports = I);
  9832. },
  9833. {
  9834. '../../localization/localize': 108,
  9835. '../../util/browser': 182,
  9836. '../../util/common': 185,
  9837. './ShareEvents': 76,
  9838. events: 202,
  9839. },
  9840. ],
  9841. 78: [
  9842. function (e, t, i) {
  9843. 'use strict';
  9844. t.exports = Object.freeze({
  9845. OPENED: 'terms.opened',
  9846. CLOSED: 'terms.closed',
  9847. });
  9848. },
  9849. {},
  9850. ],
  9851. 79: [
  9852. function (e, t, i) {
  9853. 'use strict';
  9854. var n = e('./TermsEvent'),
  9855. r = e('../../localization/localize'),
  9856. o = e('../../analytics'),
  9857. a = e('../../util/ajax'),
  9858. s = e('../../util/common'),
  9859. l = e('events').EventEmitter,
  9860. c = document.getElementById('terms-modal'),
  9861. h = {
  9862. init: function () {
  9863. $('.footer-terms').on(
  9864. 'click',
  9865. function (e) {
  9866. e.preventDefault(), this.show();
  9867. }.bind(this)
  9868. ),
  9869. $('#terms-modal .close').on('click', this.hide.bind(this));
  9870. },
  9871. show: function () {
  9872. this.emit(n.OPENED),
  9873. a
  9874. .get('static/' + r.TERMS_TEXT_FILE)
  9875. .done(function (e) {
  9876. var t = $('#terms-text').html(e);
  9877. o.track('showcase_gui', {
  9878. gui_action: 'click_terms_button',
  9879. interaction_source: 'gui',
  9880. }),
  9881. t.find('a').attr('target', '_blank');
  9882. })
  9883. .fail(function () {
  9884. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL);
  9885. }),
  9886. c.classList.add('fadeIn');
  9887. },
  9888. hide: function (e) {
  9889. e && e.preventDefault(),
  9890. c.classList.contains('fadeIn') && this.emit(n.CLOSED),
  9891. c.classList.remove('fadeIn');
  9892. },
  9893. };
  9894. s.extendObject(h, l.prototype), (t.exports = h);
  9895. },
  9896. {
  9897. '../../analytics': 4,
  9898. '../../localization/localize': 108,
  9899. '../../util/ajax': 181,
  9900. '../../util/common': 185,
  9901. './TermsEvent': 78,
  9902. events: 202,
  9903. },
  9904. ],
  9905. 80: [
  9906. function (e, t, i) {
  9907. 'use strict';
  9908. t.exports = Object.freeze({
  9909. OPEN_INFO: 'title.open.info',
  9910. CLOSE_INFO: 'title.close.info',
  9911. SHOW_INFO: 'title.show.info',
  9912. HIDE_INFO: 'title.hide.info',
  9913. LINK_CLICKED: 'title.link.click',
  9914. CONTACT_LINK_CLICKED: 'title.contact.click',
  9915. ORIGIN_LINK_CLICKED: 'title.origin.click',
  9916. });
  9917. },
  9918. {},
  9919. ],
  9920. 81: [
  9921. function (e, t, i) {
  9922. 'use strict';
  9923. function n(e, t) {
  9924. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t);
  9925. }
  9926. function r(e, t) {
  9927. function i(i) {
  9928. (e.shouldShowtags = 'show' === this.value),
  9929. e.shouldShowtags
  9930. ? t.showAlltags(o.tags.startup.fadeInDuration)
  9931. : t.hideAlltags(o.tags.startup.fadeInDuration);
  9932. }
  9933. document.getElementById('tag-toggles').classList.remove('hidden'),
  9934. (document.getElementById('radio-tag-show').checked = !0);
  9935. for (
  9936. var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0;
  9937. r < n.length;
  9938. r++
  9939. )
  9940. n[r].addEventListener('change', i);
  9941. }
  9942. var o = e('../../settings');
  9943. t.exports.init = n;
  9944. },
  9945. {
  9946. '../../settings': 166,
  9947. },
  9948. ],
  9949. 82: [
  9950. function (e, t, i) {
  9951. (function (i) {
  9952. 'use strict';
  9953. function n(e, t) {
  9954. return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
  9955. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  9956. (g_weixinObj.title = e),
  9957. e.length > g.minTooltipCharacters &&
  9958. I.parentElement.setAttribute('data-original-title', e),
  9959. t && 1 !== m.specialEdition && m.brand && !m.mls
  9960. ? (document.getElementById('cobrandTitle').innerText = t)
  9961. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  9962. document.getElementById('gui-name').classList.add('noCoBrand'),
  9963. document.getElementById('cobrandTitle').classList.add('hidden')),
  9964. !0)
  9965. : (document.getElementById('model-title').classList.add('hidden'), !1);
  9966. }
  9967. function r(e) {
  9968. return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden');
  9969. }
  9970. function o(e, t, i, n) {
  9971. if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1))
  9972. return void T.classList.add('hidden');
  9973. L = !0;
  9974. var r = [],
  9975. o = c(r, '<br>');
  9976. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  9977. var a = n || t,
  9978. s = u.isMobile()
  9979. ? '<a id="phone" href="callto:' + t + '">' + a + '</a>'
  9980. : '<span>' + a + '</span>';
  9981. o(s);
  9982. }
  9983. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'),
  9984. (r[0] = ''),
  9985. (x.innerHTML = r.join(''));
  9986. }
  9987. function a(e) {
  9988. if ('string' == typeof e)
  9989. try {
  9990. e = JSON.parse(e);
  9991. } catch (e) {
  9992. return (
  9993. y.warn('Unable to parse address data'),
  9994. void S.parentElement.classList.add('hidden')
  9995. );
  9996. }
  9997. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  9998. return void S.parentElement.classList.add('hidden');
  9999. L = !0;
  10000. var t = [],
  10001. i = c(t, ' ');
  10002. e.address_1 && i(e.address_1),
  10003. e.address_2 && i(e.address_2),
  10004. e.city && i(e.city, ', '),
  10005. e.state && i(e.state, ', '),
  10006. e.zip && i(e.zip, e.state ? ' ' : ', '),
  10007. (t[0] = ''),
  10008. (S.innerText = t.join(''));
  10009. }
  10010. function s(e) {
  10011. var t = document.createElement('a');
  10012. return (
  10013. (t.id = 'url'),
  10014. (t.target = '_blank'),
  10015. (t.href = e),
  10016. (t.innerText = e),
  10017. t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  10018. t
  10019. );
  10020. }
  10021. function l(e) {
  10022. return (
  10023. !(!e || (u.inIframe() && document.referrer === e)) &&
  10024. (R.classList.remove('hidden'),
  10025. (P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
  10026. P.appendChild(s(e)),
  10027. O.forEach(function (e) {
  10028. e.classList.add('share-link');
  10029. }),
  10030. !0)
  10031. );
  10032. }
  10033. function c(e, t) {
  10034. var i = e,
  10035. n = t;
  10036. return function (e, t) {
  10037. i.push(t || n, e);
  10038. };
  10039. }
  10040. function h() {
  10041. document
  10042. .getElementById('title-toggle')
  10043. .addEventListener('click', N.toggleTitle.bind(N)),
  10044. L && I.addEventListener('click', N.toggleMeta.bind(N, !1));
  10045. var e = [].slice.call(_.querySelectorAll('a'));
  10046. e.forEach(function (e) {
  10047. e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED));
  10048. });
  10049. var t = [].slice.call(T.querySelectorAll('a'));
  10050. t.forEach(function (e) {
  10051. e.addEventListener(
  10052. 'click',
  10053. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  10054. contact_type: e.getAttribute('id'),
  10055. })
  10056. );
  10057. });
  10058. }
  10059. var u = e('../../util/browser'),
  10060. d = e('../../util/common'),
  10061. p = e('../../util/logger'),
  10062. f = e('../../localization/localize'),
  10063. g = e('./titleBarSettings'),
  10064. m = e('../../settings'),
  10065. v = e('./TitleEvents'),
  10066. A = e('events').EventEmitter,
  10067. y = new p(i),
  10068. C = document.querySelector('.pinTop.left'),
  10069. I = document.getElementsByClassName('title-container')[0],
  10070. E = document.getElementById('title-toggle').querySelector('i'),
  10071. b = document.getElementById('meta-info-wrapper'),
  10072. w = document.getElementById('meta-info'),
  10073. _ = document.getElementById('meta-description'),
  10074. T = document.getElementsByClassName('contact-info')[0],
  10075. x = document.getElementById('contact-data'),
  10076. S = document.getElementById('addressTxt'),
  10077. M = document.getElementById('tag-toggles'),
  10078. R = document.getElementById('share-origin'),
  10079. P = document.getElementById('share-link-wrapper'),
  10080. O = [w, b, I],
  10081. L = !1,
  10082. D = !1,
  10083. N = {
  10084. populate: function (e) {
  10085. if (n(window.DATA.name, e.coBrand)) {
  10086. if (
  10087. (r(e.description),
  10088. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  10089. a(e.address),
  10090. L)
  10091. ) {
  10092. var t = document.createElement('br');
  10093. M.insertBefore(t, M.firstElementChild);
  10094. }
  10095. e.socialSharing && m.share.enabled && (D = l(e.url));
  10096. }
  10097. },
  10098. finishSetup: function (e) {
  10099. (L = L || !!e),
  10100. h(),
  10101. L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'));
  10102. },
  10103. toggleMeta: function (e, t) {
  10104. var title = document.getElementById('model-title');
  10105. t && t.preventDefault();
  10106. var i = w.classList.contains('expand');
  10107. (e && !i) ||
  10108. (i
  10109. ? (O.forEach(function (e) {
  10110. e.classList.remove('expand');
  10111. }),
  10112. this.emit(v.CLOSE_INFO),
  10113. title.classList.remove('expand'))
  10114. : (O.forEach(function (e) {
  10115. e.classList.add('expand');
  10116. }),
  10117. title.classList.add('expand'),
  10118. this.emit(v.OPEN_INFO)));
  10119. },
  10120. setupToggling: function () {
  10121. (b.style.height = w.offsetHeight + 'px'),
  10122. w.addEventListener('transitionend', function () {
  10123. b.style.height = w.offsetHeight + 'px';
  10124. });
  10125. },
  10126. toggleTitle: function (e) {
  10127. e && e.preventDefault(),
  10128. C.classList.contains('closed')
  10129. ? (C.classList.add('open'),
  10130. E.classList.remove('icon-dpad-right'),
  10131. E.classList.add('icon-dpad-left'),
  10132. this.emit(v.SHOW_INFO),
  10133. setTimeout(function () {
  10134. C.classList.remove('closed'), C.classList.remove('open');
  10135. }, g.removeAnimationClasses))
  10136. : (C.classList.add('closed'),
  10137. E.classList.remove('icon-dpad-left'),
  10138. E.classList.add('icon-dpad-right'),
  10139. this.emit(v.HIDE_INFO));
  10140. },
  10141. };
  10142. d.extendObject(N, A.prototype), (t.exports = N);
  10143. }.call(this, '/js/gui/title/titleBar.js'));
  10144. },
  10145. {
  10146. '../../localization/localize': 108,
  10147. '../../settings': 166,
  10148. '../../util/browser': 182,
  10149. '../../util/common': 185,
  10150. '../../util/logger': 189,
  10151. './TitleEvents': 80,
  10152. './titleBarSettings': 83,
  10153. events: 202,
  10154. },
  10155. ],
  10156. 83: [
  10157. function (e, t, i) {
  10158. 'use strict';
  10159. t.exports = Object.freeze({
  10160. minTooltipCharacters: 19,
  10161. removeAnimationClasses: 500,
  10162. });
  10163. },
  10164. {},
  10165. ],
  10166. 84: [
  10167. function (e, t, i) {
  10168. 'use strict';
  10169. function n(e) {
  10170. (C = e),
  10171. P.forEach(function (e) {
  10172. b.addEventListener(e, u.bind(this, !1), !0),
  10173. w.addEventListener(e, u.bind(this, !0), !0),
  10174. E.addEventListener(e, o, !0);
  10175. S.forEach(function (t) {
  10176. //会触发导览停止
  10177. t.addEventListener(e, a, !0);
  10178. });
  10179. $('#drawer img').on(e, a);
  10180. });
  10181. document.addEventListener('keydown', u.bind(this, !1), !0);
  10182. C.on(v.TourStart, function () {
  10183. E.classList.add('playing');
  10184. });
  10185. }
  10186. function r() {
  10187. // C.playTour(),
  10188. C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn');
  10189. }
  10190. function o() {
  10191. E.classList.contains('playing') &&
  10192. (C.stopTour(),
  10193. _.addClass('fadeIn'),
  10194. setTimeout(function () {
  10195. _.removeClass('fadeIn');
  10196. }, p.tourInteraction.showPauseButton),
  10197. O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
  10198. setTimeout(function () {
  10199. E.classList.remove('playing');
  10200. }, p.tourInteraction.allowNextClick));
  10201. }
  10202. function a() {
  10203. C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'));
  10204. }
  10205. function s() {
  10206. T.is(':visible') ? r() : o();
  10207. }
  10208. function l() {
  10209. x.hasClass('playing') &&
  10210. (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'));
  10211. }
  10212. function c() {
  10213. E.classList.remove('playing'), h();
  10214. }
  10215. function h() {
  10216. //去掉导览结束时的提示
  10217. /* if (!p.tourInteraction.disabled) {
  10218. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  10219. M.addClass("fadeIn tour " + m.deviceType);
  10220. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  10221. if (!p.tourInteraction.smallModal) {
  10222. var t;
  10223. 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,
  10224. m.fill(R, A.TOUR_INTERACTION[t]),
  10225. M.addClass(t)
  10226. }
  10227. M.addClass(e)
  10228. } */
  10229. }
  10230. function u(e, t) {
  10231. if (t) {
  10232. var i = 'keydown' === t.type,
  10233. n = t.which === f.SPACE || C.tourIsPlaying;
  10234. (i && n) || e || (O = !0),
  10235. C.atEndOfTour() && d(),
  10236. !C.tourIsPlaying &&
  10237. C.tourInProgress &&
  10238. (_.removeClass('fadeIn'), d(), t.which !== f.SPACE && a()),
  10239. i && n && s();
  10240. }
  10241. }
  10242. function d() {
  10243. M.removeClass('fadeIn');
  10244. }
  10245. var p = (e('../util/browser'), e('../settings')),
  10246. f = e('../enum/Keys'),
  10247. g = e('../enum/Viewmode'),
  10248. m = (e('./helpManager'), e('./populateModal')),
  10249. v = e('../enum/DirectorEvents'),
  10250. A = e('../enum/HelpModalType'),
  10251. y = e('../enum/HelpModalSize'),
  10252. C = null,
  10253. I = null,
  10254. E = document.getElementById('pause-overlay'),
  10255. b = document.getElementById('player'),
  10256. w = document.getElementById('gui'),
  10257. _ = $('#pause-icon').eq(0),
  10258. T = $('#play').eq(0),
  10259. x = $('#playHead').eq(0),
  10260. S = $(
  10261. '.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan'
  10262. ).toArray(),
  10263. M = $('#interaction-modal').eq(0),
  10264. R = $('#interaction-modal .interaction').toArray(),
  10265. P = ['touchstart', 'mousedown', 'pointerdown'],
  10266. O = !1;
  10267. (t.exports.init = n),
  10268. (t.exports.play = r),
  10269. (t.exports.pause = o),
  10270. (t.exports.pauseWithoutCTA = a),
  10271. (t.exports.togglePlay = s),
  10272. (t.exports.stopTour = l),
  10273. (t.exports.dismissModal = d);
  10274. },
  10275. {
  10276. '../enum/DirectorEvents': 23,
  10277. '../enum/HelpModalSize': 27,
  10278. '../enum/HelpModalType': 28,
  10279. '../enum/Keys': 30,
  10280. '../enum/Viewmode': 51,
  10281. '../settings': 166,
  10282. '../util/browser': 182,
  10283. './helpManager': 68,
  10284. './populateModal': 75,
  10285. },
  10286. ],
  10287. 85: [
  10288. function (e, t, i) {
  10289. 'use strict';
  10290. t.exports = Object.freeze({
  10291. OPENED: 'vr.modal.opened',
  10292. LAUNCH: 'vr.modal.launch',
  10293. CLOSED: 'vr.modal.closed',
  10294. NEXT: 'vr.modal.next',
  10295. PREV: 'vr.modal.prev',
  10296. STORE: 'vr.modal.store',
  10297. falseICECHOSEN: 'vr.modal.device',
  10298. });
  10299. },
  10300. {},
  10301. ],
  10302. 86: [
  10303. function (e, t, i) {
  10304. 'use strict';
  10305. function n(e, t, i) {
  10306. function n(e, t, n, r) {
  10307. function o() {
  10308. return p + '&m=' + t + '&display=' + e;
  10309. }
  10310. function s() {
  10311. var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
  10312. t = '&utm_source=' + u,
  10313. n = '&utm_showcase_session_id=' + i;
  10314. return e + t + n;
  10315. }
  10316. function l() {
  10317. return (
  10318. d +
  10319. '&sids=' +
  10320. t +
  10321. '&lsid=' +
  10322. t +
  10323. '&ln=' +
  10324. encodeURIComponent(n) +
  10325. '&ld=' +
  10326. encodeURIComponent(r) +
  10327. '&display=' +
  10328. e
  10329. );
  10330. }
  10331. return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s();
  10332. }
  10333. function r(e, t, i, r) {
  10334. var o = 'https://api.branch.io/v1/url',
  10335. a = n(e, t, i, r),
  10336. s = {
  10337. responseType: 'json',
  10338. data: {
  10339. branch_key: h.appConfig.branch_key,
  10340. data: {
  10341. m: t,
  10342. full_url: a,
  10343. $desktop_url: m,
  10344. $og_app_id: '331853976762864119',
  10345. $og_title: i,
  10346. $og_description: r,
  10347. $og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
  10348. $canonical_url: window.location.href,
  10349. },
  10350. },
  10351. };
  10352. c.post(o, s)
  10353. .done(function (t) {
  10354. f[e] = t.url;
  10355. })
  10356. .fail(
  10357. function (t) {
  10358. f[e] = t;
  10359. }.bind(this, a)
  10360. );
  10361. }
  10362. function o(e, t, i) {
  10363. for (var r in s) {
  10364. var o = s[r],
  10365. a = n(o, e, t, i);
  10366. f[o] = a;
  10367. }
  10368. }
  10369. var u = a.inIframe()
  10370. ? encodeURIComponent(document.referrer)
  10371. : encodeURIComponent(window.location.href),
  10372. d = g + '/vr/dlist/?ret=' + u,
  10373. p = g + '/vr/show/?ret=' + u,
  10374. m = '';
  10375. switch (e) {
  10376. case l.IOS:
  10377. r(s.CardboardIOS, t.sid, t.name, t.summary);
  10378. break;
  10379. default:
  10380. o(t.sid, t.name, t.summary);
  10381. }
  10382. }
  10383. function r(e) {
  10384. var t = f[e];
  10385. window.open(t, '_blank');
  10386. }
  10387. function o(e) {
  10388. var t = u[e];
  10389. window.open(t, '_blank');
  10390. }
  10391. var a = e('../../util/browser'),
  10392. s = e('../../enum/VRApps'),
  10393. l = e('../../enum/VRPlatforms'),
  10394. c = e('../../util/ajax'),
  10395. h = e('../../settings'),
  10396. u = {};
  10397. (u[s.CardboardAndroid] =
  10398. 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  10399. (u[s.CardboardIOS] =
  10400. 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  10401. (u[s.GearVR] =
  10402. 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=');
  10403. for (var d in s) {
  10404. var p = s[d];
  10405. u[p] += encodeURIComponent(document.referrer + '&display=' + p);
  10406. }
  10407. var f = {},
  10408. g = (function () {
  10409. var e = window.location.host;
  10410. return (
  10411. e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'),
  10412. 'https://' + e
  10413. );
  10414. })();
  10415. (t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o);
  10416. },
  10417. {
  10418. '../../enum/VRApps': 46,
  10419. '../../enum/VRPlatforms': 49,
  10420. '../../settings': 166,
  10421. '../../util/ajax': 181,
  10422. '../../util/browser': 182,
  10423. },
  10424. ],
  10425. 87: [
  10426. function (e, t, i) {
  10427. 'use strict';
  10428. function n(e) {
  10429. var t;
  10430. switch (e) {
  10431. case m.IOS:
  10432. return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1);
  10433. case m.Android:
  10434. return (
  10435. (t = p.androidVersion()),
  10436. t.major > 4 ||
  10437. (4 === t.major && t.minor > 4) ||
  10438. (4 === t.major && 4 === t.minor && t.patch >= 4)
  10439. );
  10440. }
  10441. return !1;
  10442. }
  10443. function r(e, t) {
  10444. function i(e) {
  10445. K.emit(A.STORE, {
  10446. type: e,
  10447. }),
  10448. f.launchStore(e);
  10449. }
  10450. function r(e) {
  10451. switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
  10452. case _.Title:
  10453. O.css('display', 'none'), L.text(u[e]), o(s);
  10454. break;
  10455. case _.Cardboard:
  10456. O.css('display', 'block'),
  10457. L.text(u[e]),
  10458. M.filter('.cardboard').off(),
  10459. M.filter('.gearvr').off(),
  10460. c(e, s),
  10461. h(H, X, Z);
  10462. break;
  10463. case _.Gear:
  10464. L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z);
  10465. break;
  10466. case _.pageCount:
  10467. T.removeClass('fadeIn'), K.emit(A.CLOSED);
  10468. }
  10469. B.filter("[src='']").hide();
  10470. }
  10471. var s = (function () {
  10472. return p.detectAndroid()
  10473. ? p.detectAndroidMobile() && n(m.Android)
  10474. ? (T.addClass('supported'), (w = '.show-supported'), m.Android)
  10475. : (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
  10476. : p.detectIPhone() || p.detectIPod()
  10477. ? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
  10478. : (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop);
  10479. })();
  10480. f.init(s, e, t), s !== m.Desktop && T.addClass('mobile');
  10481. var l = function (e) {
  10482. K.emit(A.LAUNCH, {
  10483. vr_platform: s,
  10484. vr_app: e,
  10485. }),
  10486. f.launch(e);
  10487. };
  10488. (q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  10489. (q.gear = l.bind(this, g.GearVR)),
  10490. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  10491. d(),
  10492. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  10493. $(w).show();
  10494. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  10495. y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done'];
  10496. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  10497. $('#vr').on('click', function (e) {
  10498. e.preventDefault();
  10499. player.FlyToMode('panorama', () => {
  10500. if (!window.vrEnabled) {
  10501. // 开启VR
  10502. window.vrEnabled = true;
  10503. this.classList.add('active');
  10504. $('#gui div').not('#vrOff').addClass('vrHide');
  10505. $('#vrOffImg').css({ display: 'inline-block' });
  10506. } else {
  10507. }
  10508. });
  10509. });
  10510. let exitVR = function () {
  10511. $('#gui div').not('#vrOff').removeClass('vrHide');
  10512. $('#vrOffImg').css({ display: 'none' });
  10513. $('#player canvas').css({ width: '', height: '' }); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  10514. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  10515. };
  10516. $('#vrOff').on('click', function () {
  10517. window.vrEnabled = false;
  10518. exitVR();
  10519. });
  10520. window.bus.addEventListener('exitWebXR', (e) => {
  10521. exitVR();
  10522. });
  10523. var I = 'https://my.port.com/vr/show/?m=' + e.sid;
  10524. s === m.IOS
  10525. ? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS))
  10526. : $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
  10527. $('.gearLink').on('click', i.bind(this, g.GearVR)),
  10528. $('span.modelLink').text(I),
  10529. O.on('click', function (e) {
  10530. K.emit(A.PREV), b--, r(b);
  10531. }),
  10532. L.on('click', function (e) {
  10533. L.text();
  10534. K.emit(A.NEXT, {
  10535. nextAction: y[b],
  10536. }),
  10537. b++,
  10538. r(b);
  10539. }),
  10540. T.find('.close').on('click', K.dismiss);
  10541. }
  10542. function o(e) {
  10543. switch (e) {
  10544. case m.Android:
  10545. M.filter('.cardboard').off().on('click', q.cardboardAndroid),
  10546. M.filter('.gearvr').off().on('click', q.gear),
  10547. s(H, G, 'logo-button', 'same-line');
  10548. break;
  10549. case m.UnsupportedAndroid:
  10550. s('', z, '', '');
  10551. break;
  10552. case m.IOS:
  10553. M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '');
  10554. break;
  10555. case m.Desktop:
  10556. M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)),
  10557. M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)),
  10558. s(H, G, 'logo-button', 'same-line'),
  10559. Q.cardboard();
  10560. }
  10561. }
  10562. function a(e) {
  10563. $('.p1, .p2, .p3').hide(),
  10564. x.insertAfter(S),
  10565. T.removeClass('front-page'),
  10566. T.removeClass('details-page'),
  10567. T.removeClass('lastPage'),
  10568. M.removeClass('logo-button'),
  10569. M.removeClass('same-line'),
  10570. S.removeClass('headsetOptions'),
  10571. R.attr('src', ''),
  10572. R.filter('.second').removeClass('gear'),
  10573. R.css('display', 'inline-block'),
  10574. R.off(),
  10575. P.filter('.second').css('display', ''),
  10576. D.css('display', 'none'),
  10577. $('.p' + (e + 1) + w).show(),
  10578. R.filter('.third').insertBefore(P.filter('.third'));
  10579. }
  10580. function s(e, t, i, n) {
  10581. T.addClass('front-page'),
  10582. R.filter('.first').attr('src', e),
  10583. R.filter('.second').attr('src', t),
  10584. M.filter('.first').addClass(i),
  10585. M.filter('.second').addClass(i),
  10586. M.addClass(n),
  10587. '.show-desktop' === w && S.insertAfter(x);
  10588. }
  10589. function l(e, t, i) {
  10590. S.addClass('headsetOptions'),
  10591. M.off(),
  10592. R.filter('.second').attr('src', t),
  10593. D.css('display', 'block'),
  10594. P.filter('.second').css('display', 'none'),
  10595. D.on('click', function () {
  10596. a(_.Title), o(m.Desktop);
  10597. }),
  10598. e &&
  10599. (K.emit(A.falseICECHOSEN, {
  10600. name: g.GearVR,
  10601. }),
  10602. R.filter('.first').attr('src', e),
  10603. R.filter('.second').addClass('gear'),
  10604. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10605. Q.gearvr()),
  10606. i &&
  10607. (K.emit(A.falseICECHOSEN, {
  10608. name: g.Cardboard,
  10609. }),
  10610. R.filter('.third').attr('src', i),
  10611. R.filter('.third').show(),
  10612. R.filter('.third').insertAfter(R.filter('.second')),
  10613. R.filter('.third').addClass('link'),
  10614. R.filter('.second').addClass('link'),
  10615. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10616. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
  10617. Q.cardboard());
  10618. }
  10619. function c(e, t) {
  10620. switch (t) {
  10621. case m.IOS:
  10622. (X = Y), (Z = j);
  10623. break;
  10624. case m.Desktop:
  10625. e === _.Cardboard
  10626. ? ((X = F),
  10627. (Z = U),
  10628. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10629. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
  10630. : ((X = V),
  10631. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10632. (Z = ''));
  10633. break;
  10634. default:
  10635. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W));
  10636. }
  10637. }
  10638. function h(e, t, i) {
  10639. T.find('.inner').addClass('details-page'),
  10640. T.addClass('details-page'),
  10641. R.filter('.first').attr('src', e),
  10642. R.filter('.second').attr('src', t),
  10643. R.filter('.third').attr('src', i);
  10644. }
  10645. function u() {
  10646. T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED));
  10647. }
  10648. function d() {
  10649. var e = p.aspectRatio() > 1 && p.isMobile();
  10650. T.toggleClass('landscape', e).toggleClass('portrait', !e),
  10651. T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
  10652. T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight);
  10653. }
  10654. var p = e('../../util/browser'),
  10655. f = e('./vrLink'),
  10656. g = e('../../enum/VRApps'),
  10657. m = e('../../enum/VRPlatforms'),
  10658. v = e('../../enum/VRPages'),
  10659. A = e('./vrEvent'),
  10660. y = (e('../../settings'), e('../../constants')),
  10661. C = e('../../localization/localize'),
  10662. I = e('../../util/common'),
  10663. E = e('events').EventEmitter,
  10664. b = 0,
  10665. w = null,
  10666. _ = v.standard,
  10667. T = $('.vr-popup'),
  10668. x = T.find('.vr-popup-body'),
  10669. S = T.find('.vr-images'),
  10670. M = T.find('.img-container'),
  10671. R = T.find('.vr-sm-image'),
  10672. P = M.find('.vr-img-caption'),
  10673. O = $('.vr-buttons').find('.prev-button'),
  10674. L = $('.vr-buttons').find('.next-button'),
  10675. D = S.find('.front-close'),
  10676. N = $('.vr-page'),
  10677. B = T.find('img'),
  10678. F = 'images/apple-store.png',
  10679. V = 'images/badge-oculus.png',
  10680. U = 'images/badge-cardboard.png',
  10681. k = 'images/logo-samsung.png',
  10682. H = 'images/headset-cardboard.png',
  10683. G = 'images/headset-gearvr.png',
  10684. z = 'images/ico-android-robot.png',
  10685. W = 'images/ico-gearvr.png',
  10686. j = 'images/ico-vr.png',
  10687. Y = 'images/apple-logo-white.svg',
  10688. X = null,
  10689. Z = null,
  10690. q = {},
  10691. K = {
  10692. init: r,
  10693. dismiss: u,
  10694. isDeviceSupported: n,
  10695. };
  10696. I.extendObject(K, E.prototype), $(window).resize(d);
  10697. var Q = (function () {
  10698. var e = P.filter('.first').find('.cardboard'),
  10699. t = P.filter('.first').find('.gearvr');
  10700. return {
  10701. cardboard: function () {
  10702. t.addClass('hidden'), e.removeClass('hidden');
  10703. },
  10704. gearvr: function () {
  10705. e.addClass('hidden'), t.removeClass('hidden');
  10706. },
  10707. };
  10708. })();
  10709. t.exports = K;
  10710. },
  10711. {
  10712. '../../constants': 8,
  10713. '../../enum/VRApps': 46,
  10714. '../../enum/VRPages': 48,
  10715. '../../enum/VRPlatforms': 49,
  10716. '../../localization/localize': 108,
  10717. '../../settings': 166,
  10718. '../../util/browser': 182,
  10719. '../../util/common': 185,
  10720. './vrEvent': 85,
  10721. './vrLink': 86,
  10722. events: 202,
  10723. },
  10724. ],
  10725. 88: [
  10726. function (e, t, i) {
  10727. 'use strict';
  10728. t.exports = Object.freeze({
  10729. OPENED: 'webvr.modal.opened',
  10730. SHOW_TERMS: 'webvr.footer.show.terms',
  10731. });
  10732. },
  10733. {},
  10734. ],
  10735. 89: [
  10736. function (e, t, i) {
  10737. (function (i) {
  10738. 'use strict';
  10739. function n(e, t, i, n) {
  10740. function r(e) {
  10741. e.preventDefault(), a(e.currentTarget.id);
  10742. }
  10743. function a(e) {
  10744. ne[e](),
  10745. Object.keys(ne).map(function (t, i) {
  10746. $('#' + t).toggleClass('tabs-underlined', t === e);
  10747. });
  10748. }
  10749. (y = i), (v = t), w.init(E.Android, e, n), m();
  10750. var l = new RegExp('daydream', 'i'),
  10751. c = l.test(y.displayName);
  10752. c
  10753. ? (a('tabdaydream'),
  10754. B.filter('.device-headset-side').attr('src', H),
  10755. D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
  10756. : (a('tabcardboard'),
  10757. B.filter('.device-headset-side').attr('src', Y),
  10758. D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
  10759. $('#vr').on('click', function (e) {
  10760. e.preventDefault(),
  10761. g('click_webvr_button'),
  10762. L.is(':hidden') && (ie.emit(_.OPENED), o());
  10763. }),
  10764. $('.webvr-popup .close').on('click', function (e) {
  10765. e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s();
  10766. }),
  10767. $('#tabcardboard').on('click', r),
  10768. $('#tabdaydream').on('click', r),
  10769. $('#tabnative').on('click', r),
  10770. $('.webvr-popup .open-with-app').on('click', function (e) {
  10771. e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p();
  10772. }),
  10773. $('.webvr-popup .help').on('click', function (e) {
  10774. e.preventDefault(),
  10775. g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'),
  10776. p();
  10777. }),
  10778. $('.webvr-popup .terms').on('click', function (e) {
  10779. e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS);
  10780. }),
  10781. F.on('click', function (e) {
  10782. e.preventDefault(), g(ee), window.open(J, '_blank');
  10783. }),
  10784. V.on('click', function (e) {
  10785. e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank');
  10786. }),
  10787. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  10788. e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid);
  10789. }),
  10790. $('.webvr-popup .badge-oculus').on('click', function (e) {
  10791. e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR);
  10792. });
  10793. }
  10794. function r() {
  10795. function e() {
  10796. y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e));
  10797. }
  10798. R.info('Headset mounted'), v.suspend();
  10799. var t = document.createElement('canvas');
  10800. for (
  10801. t.getContext('webgl'),
  10802. t.className = 'webvr-canvas',
  10803. document.bgColor = '#000',
  10804. document.body.style.backgroundColor = '#000';
  10805. document.body.firstChild;
  10806. )
  10807. document.body.removeChild(document.body.firstChild);
  10808. document.body.appendChild(t),
  10809. g('webvr_enter_app'),
  10810. y
  10811. .requestPresent([
  10812. {
  10813. source: t,
  10814. predistorted: !0,
  10815. },
  10816. ])
  10817. .catch(function (t) {
  10818. R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e();
  10819. }),
  10820. A.then(function () {
  10821. window.dispatchEvent(new Event('vrapp-start'));
  10822. }),
  10823. window.addEventListener('vrdisplaypresentchange', e);
  10824. }
  10825. function o() {
  10826. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a();
  10827. }
  10828. function a() {
  10829. if (!A) {
  10830. var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
  10831. t = 'https://static.port.com/webvr/' + e + '/js/main.js';
  10832. A = new Promise(function (e, i) {
  10833. var n = document.createElement('script');
  10834. (n.type = 'text/javascript'),
  10835. (n.src = t),
  10836. (n.onload = e),
  10837. document.head.appendChild(n);
  10838. });
  10839. }
  10840. D.find('.enter-button').on('click', r);
  10841. }
  10842. function s() {
  10843. g('webvr_modal_close'),
  10844. D.find('.enter-button').off('click', r),
  10845. L.fadeOut(I.guiAnimationSpeed, function () {
  10846. D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen();
  10847. }),
  10848. O.fadeIn(I.guiAnimationSpeed);
  10849. }
  10850. function l() {
  10851. k.toggleClass('hidden', !1), U.toggleClass('hidden', !0);
  10852. }
  10853. function c() {
  10854. k.toggleClass('hidden', !0), U.toggleClass('hidden', !1);
  10855. }
  10856. function h() {
  10857. B.filter('.device-headset').attr('src', G),
  10858. B.filter('.device-phone').attr('src', z),
  10859. (J = Z),
  10860. (ee = K),
  10861. F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
  10862. V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
  10863. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  10864. c();
  10865. }
  10866. function u() {
  10867. B.filter('.badge-cardboard').attr('src', j),
  10868. B.filter('.badge-oculus').attr('src', X),
  10869. l();
  10870. }
  10871. function d() {
  10872. B.filter('.device-headset').attr('src', Y),
  10873. B.filter('.device-phone').attr('src', W),
  10874. (J = q),
  10875. (ee = Q),
  10876. F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
  10877. V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  10878. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  10879. c();
  10880. }
  10881. function p() {
  10882. D.toggleClass('hidden'), N.toggleClass('hidden');
  10883. }
  10884. function f() {
  10885. R.info('exiting webVR'),
  10886. g('webvr_exit_app'),
  10887. window.location.search.indexOf('&qs=1') === -1
  10888. ? (window.location = window.location + '&qs=1')
  10889. : (window.location = window.location);
  10890. }
  10891. function g(e) {
  10892. var t = C.isLandscape() ? 'landscape' : 'portrait';
  10893. T.trackAlways('showcase_gui', {
  10894. gui_action: e,
  10895. orientation: t,
  10896. });
  10897. }
  10898. function m() {
  10899. var e = C.isLandscape();
  10900. L.toggleClass('landscape', e).toggleClass('portrait', !e);
  10901. }
  10902. var v,
  10903. A,
  10904. y,
  10905. C = e('../../util/browser'),
  10906. I = e('../../settings'),
  10907. E = (e('./../gui'), e('../../enum/VRPlatforms')),
  10908. b = e('../../enum/VRApps'),
  10909. w = e('./../vr/vrLink'),
  10910. _ = e('./WebVrEvent'),
  10911. T = e('../../analytics'),
  10912. x = (e('../../constants'), e('../../localization/localize')),
  10913. S = e('../../util/common'),
  10914. M = e('../../util/logger'),
  10915. R = new M(i),
  10916. P = e('events').EventEmitter,
  10917. O = $('#gui'),
  10918. L = $('.webvr-popup'),
  10919. D = $('.webvr-popup .page.p1'),
  10920. N = $('.webvr-popup .page.p2'),
  10921. B = L.find('.image'),
  10922. F = $('.webvr-popup .detail.headset'),
  10923. V = $('.webvr-popup .detail.phone'),
  10924. U = $('.webvr-popup .tab-content.webvr'),
  10925. k = $('.webvr-popup .tab-content.native'),
  10926. H = 'images/device-daydream-side.png',
  10927. G = 'images/device-daydream.png',
  10928. z = 'images/device-pixel.png',
  10929. W = 'images/ico-android-robot.png',
  10930. j = 'images/badge-cardboard.png',
  10931. Y = 'images/headset-cardboard.png',
  10932. X = 'images/badge-oculus.png',
  10933. Z = 'https://madeby.google.com/vr/',
  10934. q = 'https://vr.google.com/cardboard/get-cardboard/',
  10935. K = 'webvr_daydream_link',
  10936. Q = 'webvr_cardboard_link',
  10937. J = Z,
  10938. ee = K,
  10939. te = 'https://vr.google.com/daydream/phones/',
  10940. ie = {
  10941. init: n,
  10942. },
  10943. ne = {
  10944. tabcardboard: d,
  10945. tabdaydream: h,
  10946. tabnative: u,
  10947. };
  10948. S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie);
  10949. }.call(this, '/js/gui/webvr/webVRgui.js'));
  10950. },
  10951. {
  10952. '../../analytics': 4,
  10953. '../../constants': 8,
  10954. '../../enum/VRApps': 46,
  10955. '../../enum/VRPlatforms': 49,
  10956. '../../localization/localize': 108,
  10957. '../../settings': 166,
  10958. '../../util/browser': 182,
  10959. '../../util/common': 185,
  10960. '../../util/logger': 189,
  10961. './../gui': 65,
  10962. './../vr/vrLink': 86,
  10963. './WebVrEvent': 88,
  10964. events: 202,
  10965. },
  10966. ],
  10967. 90: [
  10968. function (e, t, i) {
  10969. 'use strict';
  10970. function n(e, t, i, n, o) {
  10971. n || 0 === n ? (this.floorId = n) : (this.floorId = -1),
  10972. (this.roomId = o || ''),
  10973. (this.labelId = e),
  10974. (this.position = new r.Vector3().copy(t)),
  10975. (this.text = i);
  10976. }
  10977. var r = e('three'),
  10978. o = e('../util/browser');
  10979. (n.prototype.build = function () {
  10980. var e = window.document.createElement('div');
  10981. o.isMobile()
  10982. ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile')
  10983. : e.setAttribute('class', 'gui-floorplan-label');
  10984. var t = window.document.createElement('div');
  10985. t.setAttribute('class', 'gui-floorplan-label-text');
  10986. var i = window.document.createTextNode(this.text);
  10987. t.appendChild(i),
  10988. e.appendChild(t),
  10989. window.document.body.appendChild(e),
  10990. (this.labelGui = e),
  10991. (this.textBlock = t),
  10992. $(this.labelGui).hide();
  10993. var n = window.getComputedStyle(this.labelGui);
  10994. this.initialTransform = n.transform || n.webkitTransform;
  10995. }),
  10996. (t.exports = n);
  10997. },
  10998. {
  10999. '../util/browser': 182,
  11000. three: 217,
  11001. },
  11002. ],
  11003. 91: [
  11004. function (e, t, i) {
  11005. 'use strict';
  11006. function n() {
  11007. (this.player = null), (this.modelManager = null), (this.container = null);
  11008. }
  11009. var r = e('three'),
  11010. o = (e('../util/common'), e('../enum/PlayerEvents')),
  11011. a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  11012. s = e('../settings'),
  11013. l = e('../enum/Viewmode'),
  11014. c =
  11015. (e('../enum/WarpStyle'),
  11016. e('../util/transitions'),
  11017. e('../util/lerp'),
  11018. e('../util/browser'));
  11019. //场景初始化
  11020. (n.prototype.init = function (e, t, i) {
  11021. (this.player = e),
  11022. (this.modelManager = t),
  11023. (this.container = i),
  11024. this.updateModel(),
  11025. this.bindEvents();
  11026. }),
  11027. (n.prototype.bindEvents = function () {
  11028. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  11029. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  11030. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  11031. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  11032. this.player.on(o.StartOutside, this.handleStartOutside.bind(this));
  11033. }),
  11034. (n.prototype.updateModel = function () {
  11035. this.model = this.modelManager.getActiveModel();
  11036. }),
  11037. (n.prototype.handlePlayerViewChanged = function () {
  11038. this.updateLabelVisibility(), this.updateLabelDisplay();
  11039. }),
  11040. (n.prototype.getLabelsForFloor = function (e, t) {
  11041. return (
  11042. (t = t || []),
  11043. (t.length = 0),
  11044. this.model.labels.forEach(
  11045. function (i) {
  11046. this.labelVisibleForFloor(i, e) && t.push(i);
  11047. }.bind(this)
  11048. ),
  11049. t
  11050. );
  11051. }),
  11052. (n.prototype.getLabelsForCurrentFloor = function (e) {
  11053. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e);
  11054. }),
  11055. (n.prototype.labelVisibleForFloor = function (e, t) {
  11056. var i =
  11057. (c.isMobile() &&
  11058. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) ||
  11059. (!c.isMobile() &&
  11060. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop);
  11061. if (!this.model.showingLabels || !e.labelGui || !i) return !1;
  11062. var n = e.floorId === this.model.floors.size() - 1;
  11063. return this.model.allFloorsVisible ? n : e.floorId === t;
  11064. }),
  11065. (n.prototype.updateLabelVisibility = function (e) {
  11066. this.model.labels.forEach(
  11067. function (e) {
  11068. this.supportedMode() &&
  11069. this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  11070. ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
  11071. : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration);
  11072. }.bind(this)
  11073. );
  11074. }),
  11075. (n.prototype.showAllLabels = function (e, t) {
  11076. this.model.labels.forEach(
  11077. function (i) {
  11078. this.showLabel(i, e, t);
  11079. }.bind(this)
  11080. );
  11081. }),
  11082. (n.prototype.hideAllLabels = function (e, t) {
  11083. this.model.labels.forEach(
  11084. function (i) {
  11085. this.hideLabel(i, e, t);
  11086. }.bind(this)
  11087. );
  11088. }),
  11089. (n.prototype.showLabel = function (e, t, i) {
  11090. this.model.showingLabels &&
  11091. (e.visible ||
  11092. ((e.visible = !0),
  11093. (e.labelGui.style.display = 'block'),
  11094. (e.labelGui.style.opacity = 0),
  11095. $(e.labelGui).delay(t).fadeTo(i, 1)));
  11096. }),
  11097. (n.prototype.hideLabel = function (e, t, i) {
  11098. e.visible &&
  11099. ((e.visible = !1),
  11100. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i));
  11101. }),
  11102. (n.prototype.supportedMode = function () {
  11103. return this.player.mode === l.FLOORPLAN;
  11104. }),
  11105. (n.prototype.updateLabelDisplay = (function () {
  11106. var e = (new r.Vector3(), new r.Vector3(), []);
  11107. return function () {
  11108. var t = this.player.getLabelScaleFactor(),
  11109. i = 0.6,
  11110. n = 1.2,
  11111. r = (1 - t) * n + i,
  11112. o = c.isMobile()
  11113. ? s.labels.zoomTruncateThreshhold.mobile
  11114. : s.labels.zoomTruncateThreshhold.desktop;
  11115. this.getLabelsForCurrentFloor(e);
  11116. for (var a = 0; a < e.length; a++) {
  11117. var l = e[a];
  11118. this.supportedMode() &&
  11119. l.labelGui &&
  11120. (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  11121. t >= o && l.text.length >= s.labels.minLengthForTruncate
  11122. ? (l.textBlock.innerText =
  11123. l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
  11124. : (l.textBlock.innerText = l.text));
  11125. }
  11126. };
  11127. })()),
  11128. (n.prototype.updateProjectedGuiElement = (function () {
  11129. var e = new r.Vector3();
  11130. new r.Vector3();
  11131. return function (t, i, n, r, o) {
  11132. i.style.fontSize = 100 * o + '%';
  11133. var a = $('#player').width(),
  11134. s = $('#player').height(),
  11135. l = 0.5 * a,
  11136. c = 0.5 * s;
  11137. e.copy(n), e.project(this.player.camera);
  11138. var h = e.x * l + l,
  11139. u = -(e.y * c) + c;
  11140. (h -= t.offsetWidth / 2),
  11141. (u -= t.offsetHeight / 2),
  11142. (t.style.left = h + 'px'),
  11143. (t.style.top = u + 'px');
  11144. };
  11145. })()),
  11146. (n.prototype.handleStartInside = function (e) {
  11147. this.updateLabelVisibility();
  11148. }),
  11149. (n.prototype.handleStartOutside = function () {
  11150. this.updateLabelVisibility();
  11151. }),
  11152. (t.exports = n);
  11153. },
  11154. {
  11155. '../enum/DirectorEvents': 23,
  11156. '../enum/ModelManagerEvents': 33,
  11157. '../enum/PlayerEvents': 40,
  11158. '../enum/Viewmode': 51,
  11159. '../enum/WarpStyle': 52,
  11160. '../settings': 166,
  11161. '../util/browser': 182,
  11162. '../util/common': 185,
  11163. '../util/lerp': 188,
  11164. '../util/transitions': 195,
  11165. three: 217,
  11166. },
  11167. ],
  11168. 92: [
  11169. function (e, t, i) {
  11170. 'use strict';
  11171. Array.prototype.findIndex ||
  11172. (Array.prototype.findIndex = function (e) {
  11173. if (null == this)
  11174. throw new TypeError('Array.prototype.findIndex called on null or undefined');
  11175. if ('function' != typeof e) throw new TypeError('predicate must be a function');
  11176. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  11177. if (((t = i[o]), e.call(r, t, o, i))) return o;
  11178. return -1;
  11179. }),
  11180. Array.prototype.find ||
  11181. Object.defineProperty(Array.prototype, 'find', {
  11182. value: function (e) {
  11183. if (null == this) throw new TypeError('"this" is null or not defined');
  11184. var t = Object(this),
  11185. i = t.length >>> 0;
  11186. if ('function' != typeof e) throw new TypeError('predicate must be a function');
  11187. for (var n = arguments[1], r = 0; r < i; ) {
  11188. var o = t[r];
  11189. if (e.call(n, o, r, t)) return o;
  11190. r++;
  11191. }
  11192. },
  11193. });
  11194. },
  11195. {},
  11196. ],
  11197. 93: [
  11198. function (e, t, i) {
  11199. 'use strict';
  11200. var n = n || {};
  11201. (t.exports = n),
  11202. (n.gui = n.gui || {}),
  11203. (n.utils = n.utils || {}),
  11204. (n.controllers = n.controllers || {}),
  11205. (n.dom = n.dom || {}),
  11206. (n.color = n.color || {}),
  11207. (n.utils.css = (function () {
  11208. return {
  11209. load: function (e, t) {
  11210. t = t || document;
  11211. var i = t.createElement('link');
  11212. (i.type = 'text/css'),
  11213. (i.rel = 'stylesheet'),
  11214. (i.href = e),
  11215. t.getElementsByTagName('head')[0].appendChild(i);
  11216. },
  11217. inject: function (e, t) {
  11218. t = t || document;
  11219. var i = document.createElement('style');
  11220. (i.type = 'text/css'),
  11221. (i.innerHTML = e),
  11222. t.getElementsByTagName('head')[0].appendChild(i);
  11223. },
  11224. };
  11225. })()),
  11226. (n.utils.common = (function () {
  11227. var e = Array.prototype.forEach,
  11228. t = Array.prototype.slice;
  11229. return {
  11230. BREAK: {},
  11231. extend: function (e) {
  11232. return (
  11233. this.each(
  11234. t.call(arguments, 1),
  11235. function (t) {
  11236. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i]);
  11237. },
  11238. this
  11239. ),
  11240. e
  11241. );
  11242. },
  11243. defaults: function (e) {
  11244. return (
  11245. this.each(
  11246. t.call(arguments, 1),
  11247. function (t) {
  11248. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i]);
  11249. },
  11250. this
  11251. ),
  11252. e
  11253. );
  11254. },
  11255. compose: function () {
  11256. var e = t.call(arguments);
  11257. return function () {
  11258. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  11259. i = [e[n].apply(this, i)];
  11260. return i[0];
  11261. };
  11262. },
  11263. each: function (t, i, n) {
  11264. if (t)
  11265. if (e && t.forEach && t.forEach === e) t.forEach(i, n);
  11266. else if (t.length === t.length + 0) {
  11267. for (var r = 0, o = t.length; r < o; r++)
  11268. if (r in t && i.call(n, t[r], r) === this.BREAK) return;
  11269. } else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return;
  11270. },
  11271. defer: function (e) {
  11272. setTimeout(e, 0);
  11273. },
  11274. toArray: function (e) {
  11275. return e.toArray ? e.toArray() : t.call(e);
  11276. },
  11277. isUndefined: function (e) {
  11278. return void 0 === e;
  11279. },
  11280. isNull: function (e) {
  11281. return null === e;
  11282. },
  11283. isNaN: function (e) {
  11284. return e !== e;
  11285. },
  11286. isArray:
  11287. Array.isArray ||
  11288. function (e) {
  11289. return e.constructor === Array;
  11290. },
  11291. isObject: function (e) {
  11292. return e === Object(e);
  11293. },
  11294. isNumber: function (e) {
  11295. return e === e + 0;
  11296. },
  11297. isString: function (e) {
  11298. return e === e + '';
  11299. },
  11300. isBoolean: function (e) {
  11301. return e === !1 || e === !0;
  11302. },
  11303. isFunction: function (e) {
  11304. return '[object Function]' === Object.prototype.toString.call(e);
  11305. },
  11306. };
  11307. })()),
  11308. (n.controllers.Controller = (function (e) {
  11309. var t = function (e, t) {
  11310. (this.initialValue = e[t]),
  11311. (this.domElement = document.createElement('div')),
  11312. (this.object = e),
  11313. (this.property = t),
  11314. (this.__onChange = void 0),
  11315. (this.__onFinishChange = void 0);
  11316. };
  11317. return (
  11318. e.extend(t.prototype, {
  11319. onChange: function (e) {
  11320. return (this.__onChange = e), this;
  11321. },
  11322. onFinishChange: function (e) {
  11323. return (this.__onFinishChange = e), this;
  11324. },
  11325. setValue: function (e) {
  11326. return (
  11327. (this.object[this.property] = e),
  11328. this.__onChange && this.__onChange.call(this, e),
  11329. this.updateDisplay(),
  11330. this
  11331. );
  11332. },
  11333. getValue: function () {
  11334. return this.object[this.property];
  11335. },
  11336. updateDisplay: function () {
  11337. return this;
  11338. },
  11339. isModified: function () {
  11340. return this.initialValue !== this.getValue();
  11341. },
  11342. }),
  11343. t
  11344. );
  11345. })(n.utils.common)),
  11346. (n.dom.dom = (function (e) {
  11347. function t(t) {
  11348. if ('0' === t || e.isUndefined(t)) return 0;
  11349. var i = t.match(r);
  11350. return e.isNull(i) ? 0 : parseFloat(i[1]);
  11351. }
  11352. var i = {
  11353. HTMLEvents: ['change'],
  11354. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  11355. KeyboardEvents: ['keydown'],
  11356. },
  11357. n = {};
  11358. e.each(i, function (t, i) {
  11359. e.each(t, function (e) {
  11360. n[e] = i;
  11361. });
  11362. });
  11363. var r = /(\d+(\.\d+)?)px/,
  11364. o = {
  11365. makeSelectable: function (e, t) {
  11366. void 0 !== e &&
  11367. void 0 !== e.style &&
  11368. ((e.onselectstart = t
  11369. ? function () {
  11370. return !1;
  11371. }
  11372. : function () {}),
  11373. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  11374. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  11375. (e.unselectable = t ? 'on' : 'off'));
  11376. },
  11377. makeFullscreen: function (t, i, n) {
  11378. e.isUndefined(i) && (i = !0),
  11379. e.isUndefined(n) && (n = !0),
  11380. (t.style.position = 'absolute'),
  11381. i && ((t.style.left = 0), (t.style.right = 0)),
  11382. n && ((t.style.top = 0), (t.style.bottom = 0));
  11383. },
  11384. fakeEvent: function (t, i, r, o) {
  11385. r = r || {};
  11386. var a = n[i];
  11387. if (!a) throw new Error('Event type ' + i + ' not supported.');
  11388. var s = document.createEvent(a);
  11389. switch (a) {
  11390. case 'MouseEvents':
  11391. var l = r.x || r.clientX || 0,
  11392. c = r.y || r.clientY || 0;
  11393. s.initMouseEvent(
  11394. i,
  11395. r.bubbles || !1,
  11396. r.cancelable || !0,
  11397. window,
  11398. r.clickCount || 1,
  11399. 0,
  11400. 0,
  11401. l,
  11402. c,
  11403. !1,
  11404. !1,
  11405. !1,
  11406. !1,
  11407. 0,
  11408. null
  11409. );
  11410. break;
  11411. case 'KeyboardEvents':
  11412. var h = s.initKeyboardEvent || s.initKeyEvent;
  11413. e.defaults(r, {
  11414. cancelable: !0,
  11415. ctrlKey: !1,
  11416. altKey: !1,
  11417. shiftKey: !1,
  11418. metaKey: !1,
  11419. keyCode: void 0,
  11420. charCode: void 0,
  11421. }),
  11422. h(
  11423. i,
  11424. r.bubbles || !1,
  11425. r.cancelable,
  11426. window,
  11427. r.ctrlKey,
  11428. r.altKey,
  11429. r.shiftKey,
  11430. r.metaKey,
  11431. r.keyCode,
  11432. r.charCode
  11433. );
  11434. break;
  11435. default:
  11436. s.initEvent(i, r.bubbles || !1, r.cancelable || !0);
  11437. }
  11438. e.defaults(s, o), t.dispatchEvent(s);
  11439. },
  11440. bind: function (e, t, i, n) {
  11441. return (
  11442. (n = n || !1),
  11443. e.addEventListener
  11444. ? e.addEventListener(t, i, n)
  11445. : e.attachEvent && e.attachEvent('on' + t, i),
  11446. o
  11447. );
  11448. },
  11449. unbind: function (e, t, i, n) {
  11450. return (
  11451. (n = n || !1),
  11452. e.removeEventListener
  11453. ? e.removeEventListener(t, i, n)
  11454. : e.detachEvent && e.detachEvent('on' + t, i),
  11455. o
  11456. );
  11457. },
  11458. addClass: function (e, t) {
  11459. if (void 0 === e.className) e.className = t;
  11460. else if (e.className !== t) {
  11461. var i = e.className.split(/ +/);
  11462. i.indexOf(t) == -1 &&
  11463. (i.push(t),
  11464. (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')));
  11465. }
  11466. return o;
  11467. },
  11468. removeClass: function (e, t) {
  11469. if (t)
  11470. if (void 0 === e.className);
  11471. else if (e.className === t) e.removeAttribute('class');
  11472. else {
  11473. var i = e.className.split(/ +/),
  11474. n = i.indexOf(t);
  11475. n != -1 && (i.splice(n, 1), (e.className = i.join(' ')));
  11476. }
  11477. else e.className = void 0;
  11478. return o;
  11479. },
  11480. hasClass: function (e, t) {
  11481. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1;
  11482. },
  11483. getWidth: function (e) {
  11484. var i = getComputedStyle(e);
  11485. return (
  11486. t(i['border-left-width']) +
  11487. t(i['border-right-width']) +
  11488. t(i['padding-left']) +
  11489. t(i['padding-right']) +
  11490. t(i.width)
  11491. );
  11492. },
  11493. getHeight: function (e) {
  11494. var i = getComputedStyle(e);
  11495. return (
  11496. t(i['border-top-width']) +
  11497. t(i['border-bottom-width']) +
  11498. t(i['padding-top']) +
  11499. t(i['padding-bottom']) +
  11500. t(i.height)
  11501. );
  11502. },
  11503. getOffset: function (e) {
  11504. var t = {
  11505. left: 0,
  11506. top: 0,
  11507. };
  11508. if (e.offsetParent)
  11509. do (t.left += e.offsetLeft), (t.top += e.offsetTop);
  11510. while ((e = e.offsetParent));
  11511. return t;
  11512. },
  11513. isActive: function (e) {
  11514. return e === document.activeElement && (e.type || e.href);
  11515. },
  11516. };
  11517. return o;
  11518. })(n.utils.common)),
  11519. (n.controllers.OptionController = (function (e, t, i) {
  11520. var n = function (e, r, o) {
  11521. n.superclass.call(this, e, r);
  11522. var a = this;
  11523. if (((this.__select = document.createElement('select')), i.isArray(o))) {
  11524. var s = {};
  11525. i.each(o, function (e) {
  11526. s[e] = e;
  11527. }),
  11528. (o = s);
  11529. }
  11530. i.each(o, function (e, t) {
  11531. var i = document.createElement('option');
  11532. (i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i);
  11533. }),
  11534. this.updateDisplay(),
  11535. t.bind(this.__select, 'change', function () {
  11536. var e = this.options[this.selectedIndex].value;
  11537. a.setValue(e);
  11538. }),
  11539. this.domElement.appendChild(this.__select);
  11540. };
  11541. return (
  11542. (n.superclass = e),
  11543. i.extend(n.prototype, e.prototype, {
  11544. setValue: function (e) {
  11545. var t = n.superclass.prototype.setValue.call(this, e);
  11546. return (
  11547. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  11548. );
  11549. },
  11550. updateDisplay: function () {
  11551. return (
  11552. (this.__select.value = this.getValue()),
  11553. n.superclass.prototype.updateDisplay.call(this)
  11554. );
  11555. },
  11556. }),
  11557. n
  11558. );
  11559. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11560. (n.controllers.NumberController = (function (e, t) {
  11561. function i(e) {
  11562. return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0;
  11563. }
  11564. var n = function (e, r, o) {
  11565. n.superclass.call(this, e, r),
  11566. (o = o || {}),
  11567. (this.__min = o.min),
  11568. (this.__max = o.max),
  11569. (this.__step = o.step),
  11570. t.isUndefined(this.__step)
  11571. ? 0 == this.initialValue
  11572. ? (this.__impliedStep = 1)
  11573. : (this.__impliedStep =
  11574. Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  11575. : (this.__impliedStep = this.__step),
  11576. (this.__precision = i(this.__impliedStep));
  11577. };
  11578. return (
  11579. (n.superclass = e),
  11580. t.extend(n.prototype, e.prototype, {
  11581. setValue: function (e) {
  11582. return (
  11583. void 0 !== this.__min && e < this.__min
  11584. ? (e = this.__min)
  11585. : void 0 !== this.__max && e > this.__max && (e = this.__max),
  11586. void 0 !== this.__step &&
  11587. e % this.__step != 0 &&
  11588. (e = Math.round(e / this.__step) * this.__step),
  11589. n.superclass.prototype.setValue.call(this, e)
  11590. );
  11591. },
  11592. min: function (e) {
  11593. return (this.__min = e), this;
  11594. },
  11595. max: function (e) {
  11596. return (this.__max = e), this;
  11597. },
  11598. step: function (e) {
  11599. return (
  11600. (this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
  11601. );
  11602. },
  11603. }),
  11604. n
  11605. );
  11606. })(n.controllers.Controller, n.utils.common)),
  11607. (n.controllers.NumberControllerBox = (function (e, t, i) {
  11608. function n(e, t) {
  11609. var i = Math.pow(10, t);
  11610. return Math.round(e * i) / i;
  11611. }
  11612. var r = function (e, n, o) {
  11613. function a() {
  11614. var e = parseFloat(d.__input.value);
  11615. i.isNaN(e) || d.setValue(e);
  11616. }
  11617. function s() {
  11618. a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue());
  11619. }
  11620. function l(e) {
  11621. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY);
  11622. }
  11623. function c(e) {
  11624. var t = u - e.clientY;
  11625. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY);
  11626. }
  11627. function h() {
  11628. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h);
  11629. }
  11630. (this.__truncationSuspended = !1), r.superclass.call(this, e, n, o);
  11631. var u,
  11632. d = this;
  11633. (this.__input = document.createElement('input')),
  11634. this.__input.setAttribute('type', 'text'),
  11635. t.bind(this.__input, 'change', a),
  11636. t.bind(this.__input, 'blur', s),
  11637. t.bind(this.__input, 'mousedown', l),
  11638. t.bind(this.__input, 'keydown', function (e) {
  11639. 13 === e.keyCode &&
  11640. ((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1));
  11641. }),
  11642. this.updateDisplay(),
  11643. this.domElement.appendChild(this.__input);
  11644. };
  11645. return (
  11646. (r.superclass = e),
  11647. i.extend(r.prototype, e.prototype, {
  11648. updateDisplay: function () {
  11649. return (
  11650. (this.__input.value = this.__truncationSuspended
  11651. ? this.getValue()
  11652. : n(this.getValue(), this.__precision)),
  11653. r.superclass.prototype.updateDisplay.call(this)
  11654. );
  11655. },
  11656. }),
  11657. r
  11658. );
  11659. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  11660. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  11661. function o(e, t, i, n, r) {
  11662. return n + (r - n) * ((e - t) / (i - t));
  11663. }
  11664. var a = function (e, i, n, r, s) {
  11665. function l(e) {
  11666. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e);
  11667. }
  11668. function c(e) {
  11669. e.preventDefault();
  11670. var i = t.getOffset(u.__background),
  11671. n = t.getWidth(u.__background);
  11672. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1;
  11673. }
  11674. function h() {
  11675. t.unbind(window, 'mousemove', c),
  11676. t.unbind(window, 'mouseup', h),
  11677. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue());
  11678. }
  11679. a.superclass.call(this, e, i, {
  11680. min: n,
  11681. max: r,
  11682. step: s,
  11683. });
  11684. var u = this;
  11685. (this.__background = document.createElement('div')),
  11686. (this.__foreground = document.createElement('div')),
  11687. t.bind(this.__background, 'mousedown', l),
  11688. t.addClass(this.__background, 'slider'),
  11689. t.addClass(this.__foreground, 'slider-fg'),
  11690. this.updateDisplay(),
  11691. this.__background.appendChild(this.__foreground),
  11692. this.domElement.appendChild(this.__background);
  11693. };
  11694. return (
  11695. (a.superclass = e),
  11696. (a.useDefaultStyles = function () {
  11697. i.inject(r);
  11698. }),
  11699. n.extend(a.prototype, e.prototype, {
  11700. updateDisplay: function () {
  11701. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  11702. return (
  11703. (this.__foreground.style.width = 100 * e + '%'),
  11704. a.superclass.prototype.updateDisplay.call(this)
  11705. );
  11706. },
  11707. }),
  11708. a
  11709. );
  11710. })(
  11711. n.controllers.NumberController,
  11712. n.dom.dom,
  11713. n.utils.css,
  11714. n.utils.common,
  11715. '/**\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}'
  11716. )),
  11717. (n.controllers.FunctionController = (function (e, t, i) {
  11718. var n = function (e, i, r) {
  11719. n.superclass.call(this, e, i);
  11720. var o = this;
  11721. (this.__button = document.createElement('div')),
  11722. (this.__button.innerHTML = void 0 === r ? 'Fire' : r),
  11723. t.bind(this.__button, 'click', function (e) {
  11724. return e.preventDefault(), o.fire(), !1;
  11725. }),
  11726. t.addClass(this.__button, 'button'),
  11727. this.domElement.appendChild(this.__button);
  11728. };
  11729. return (
  11730. (n.superclass = e),
  11731. i.extend(n.prototype, e.prototype, {
  11732. fire: function () {
  11733. this.__onChange && this.__onChange.call(this),
  11734. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11735. this.getValue().call(this.object);
  11736. },
  11737. }),
  11738. n
  11739. );
  11740. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11741. (n.controllers.BooleanController = (function (e, t, i) {
  11742. var n = function (e, i) {
  11743. function r() {
  11744. o.setValue(!o.__prev);
  11745. }
  11746. n.superclass.call(this, e, i);
  11747. var o = this;
  11748. (this.__prev = this.getValue()),
  11749. (this.__checkbox = document.createElement('input')),
  11750. this.__checkbox.setAttribute('type', 'checkbox'),
  11751. t.bind(this.__checkbox, 'change', r, !1),
  11752. this.domElement.appendChild(this.__checkbox),
  11753. this.updateDisplay();
  11754. };
  11755. return (
  11756. (n.superclass = e),
  11757. i.extend(n.prototype, e.prototype, {
  11758. setValue: function (e) {
  11759. var t = n.superclass.prototype.setValue.call(this, e);
  11760. return (
  11761. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11762. (this.__prev = this.getValue()),
  11763. t
  11764. );
  11765. },
  11766. updateDisplay: function () {
  11767. return (
  11768. this.getValue() === !0
  11769. ? (this.__checkbox.setAttribute('checked', 'checked'),
  11770. (this.__checkbox.checked = !0))
  11771. : (this.__checkbox.checked = !1),
  11772. n.superclass.prototype.updateDisplay.call(this)
  11773. );
  11774. },
  11775. }),
  11776. n
  11777. );
  11778. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11779. (n.color.toString = (function (e) {
  11780. return function (t) {
  11781. if (1 == t.a || e.isUndefined(t.a)) {
  11782. for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i;
  11783. return '#' + i;
  11784. }
  11785. return (
  11786. 'rgba(' +
  11787. Math.round(t.r) +
  11788. ',' +
  11789. Math.round(t.g) +
  11790. ',' +
  11791. Math.round(t.b) +
  11792. ',' +
  11793. t.a +
  11794. ')'
  11795. );
  11796. };
  11797. })(n.utils.common)),
  11798. (n.color.interpret = (function (e, t) {
  11799. var i,
  11800. n,
  11801. r = function () {
  11802. n = !1;
  11803. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  11804. return (
  11805. t.each(o, function (r) {
  11806. if (r.litmus(e))
  11807. return (
  11808. t.each(r.conversions, function (r, o) {
  11809. if (((i = r.read(e)), n === !1 && i !== !1))
  11810. return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK;
  11811. }),
  11812. t.BREAK
  11813. );
  11814. }),
  11815. n
  11816. );
  11817. },
  11818. o = [
  11819. {
  11820. litmus: t.isString,
  11821. conversions: {
  11822. THREE_CHAR_HEX: {
  11823. read: function (e) {
  11824. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  11825. return (
  11826. null !== t && {
  11827. space: 'HEX',
  11828. hex: parseInt(
  11829. '0x' +
  11830. t[1].toString() +
  11831. t[1].toString() +
  11832. t[2].toString() +
  11833. t[2].toString() +
  11834. t[3].toString() +
  11835. t[3].toString()
  11836. ),
  11837. }
  11838. );
  11839. },
  11840. write: e,
  11841. },
  11842. SIX_CHAR_HEX: {
  11843. read: function (e) {
  11844. var t = e.match(/^#([A-F0-9]{6})$/i);
  11845. return (
  11846. null !== t && {
  11847. space: 'HEX',
  11848. hex: parseInt('0x' + t[1].toString()),
  11849. }
  11850. );
  11851. },
  11852. write: e,
  11853. },
  11854. CSS_RGB: {
  11855. read: function (e) {
  11856. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  11857. return (
  11858. null !== t && {
  11859. space: 'RGB',
  11860. r: parseFloat(t[1]),
  11861. g: parseFloat(t[2]),
  11862. b: parseFloat(t[3]),
  11863. }
  11864. );
  11865. },
  11866. write: e,
  11867. },
  11868. CSS_RGBA: {
  11869. read: function (e) {
  11870. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  11871. return (
  11872. null !== t && {
  11873. space: 'RGB',
  11874. r: parseFloat(t[1]),
  11875. g: parseFloat(t[2]),
  11876. b: parseFloat(t[3]),
  11877. a: parseFloat(t[4]),
  11878. }
  11879. );
  11880. },
  11881. write: e,
  11882. },
  11883. },
  11884. },
  11885. {
  11886. litmus: t.isNumber,
  11887. conversions: {
  11888. HEX: {
  11889. read: function (e) {
  11890. return {
  11891. space: 'HEX',
  11892. hex: e,
  11893. conversionName: 'HEX',
  11894. };
  11895. },
  11896. write: function (e) {
  11897. return e.hex;
  11898. },
  11899. },
  11900. },
  11901. },
  11902. {
  11903. litmus: t.isArray,
  11904. conversions: {
  11905. RGB_ARRAY: {
  11906. read: function (e) {
  11907. return (
  11908. 3 == e.length && {
  11909. space: 'RGB',
  11910. r: e[0],
  11911. g: e[1],
  11912. b: e[2],
  11913. }
  11914. );
  11915. },
  11916. write: function (e) {
  11917. return [e.r, e.g, e.b];
  11918. },
  11919. },
  11920. RGBA_ARRAY: {
  11921. read: function (e) {
  11922. return (
  11923. 4 == e.length && {
  11924. space: 'RGB',
  11925. r: e[0],
  11926. g: e[1],
  11927. b: e[2],
  11928. a: e[3],
  11929. }
  11930. );
  11931. },
  11932. write: function (e) {
  11933. return [e.r, e.g, e.b, e.a];
  11934. },
  11935. },
  11936. },
  11937. },
  11938. {
  11939. litmus: t.isObject,
  11940. conversions: {
  11941. RGBA_OBJ: {
  11942. read: function (e) {
  11943. return (
  11944. !!(
  11945. t.isNumber(e.r) &&
  11946. t.isNumber(e.g) &&
  11947. t.isNumber(e.b) &&
  11948. t.isNumber(e.a)
  11949. ) && {
  11950. space: 'RGB',
  11951. r: e.r,
  11952. g: e.g,
  11953. b: e.b,
  11954. a: e.a,
  11955. }
  11956. );
  11957. },
  11958. write: function (e) {
  11959. return {
  11960. r: e.r,
  11961. g: e.g,
  11962. b: e.b,
  11963. a: e.a,
  11964. };
  11965. },
  11966. },
  11967. RGB_OBJ: {
  11968. read: function (e) {
  11969. return (
  11970. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  11971. space: 'RGB',
  11972. r: e.r,
  11973. g: e.g,
  11974. b: e.b,
  11975. }
  11976. );
  11977. },
  11978. write: function (e) {
  11979. return {
  11980. r: e.r,
  11981. g: e.g,
  11982. b: e.b,
  11983. };
  11984. },
  11985. },
  11986. HSVA_OBJ: {
  11987. read: function (e) {
  11988. return (
  11989. !!(
  11990. t.isNumber(e.h) &&
  11991. t.isNumber(e.s) &&
  11992. t.isNumber(e.v) &&
  11993. t.isNumber(e.a)
  11994. ) && {
  11995. space: 'HSV',
  11996. h: e.h,
  11997. s: e.s,
  11998. v: e.v,
  11999. a: e.a,
  12000. }
  12001. );
  12002. },
  12003. write: function (e) {
  12004. return {
  12005. h: e.h,
  12006. s: e.s,
  12007. v: e.v,
  12008. a: e.a,
  12009. };
  12010. },
  12011. },
  12012. HSV_OBJ: {
  12013. read: function (e) {
  12014. return (
  12015. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  12016. space: 'HSV',
  12017. h: e.h,
  12018. s: e.s,
  12019. v: e.v,
  12020. }
  12021. );
  12022. },
  12023. write: function (e) {
  12024. return {
  12025. h: e.h,
  12026. s: e.s,
  12027. v: e.v,
  12028. };
  12029. },
  12030. },
  12031. },
  12032. },
  12033. ];
  12034. return r;
  12035. })(n.color.toString, n.utils.common)),
  12036. (n.GUI = n.gui.GUI =
  12037. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  12038. function g(e, t, i, o) {
  12039. if (void 0 === t[i])
  12040. throw new Error('Object ' + t + ' has no property "' + i + '"');
  12041. var a;
  12042. if (o.color) a = new h(t, i);
  12043. else {
  12044. var s = [t, i].concat(o.factoryArgs);
  12045. a = n.apply(e, s);
  12046. }
  12047. o.before instanceof r && (o.before = o.before.__li),
  12048. A(e, a),
  12049. p.addClass(a.domElement, 'c');
  12050. var l = document.createElement('span');
  12051. p.addClass(l, 'property-name'), (l.innerHTML = a.property);
  12052. var c = document.createElement('div');
  12053. c.appendChild(l), c.appendChild(a.domElement);
  12054. var u = m(e, c, o.before);
  12055. return (
  12056. p.addClass(u, V.CLASS_CONTROLLER_ROW),
  12057. p.addClass(u, typeof a.getValue()),
  12058. v(e, u, a),
  12059. e.__controllers.push(a),
  12060. a
  12061. );
  12062. }
  12063. function m(e, t, i) {
  12064. var n = document.createElement('li');
  12065. return (
  12066. t && n.appendChild(t),
  12067. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  12068. e.onResize(),
  12069. n
  12070. );
  12071. }
  12072. function v(e, t, i) {
  12073. if (
  12074. ((i.__li = t),
  12075. (i.__gui = e),
  12076. f.extend(i, {
  12077. options: function (t) {
  12078. return arguments.length > 1
  12079. ? (i.remove(),
  12080. g(e, i.object, i.property, {
  12081. before: i.__li.nextElementSibling,
  12082. factoryArgs: [f.toArray(arguments)],
  12083. }))
  12084. : f.isArray(t) || f.isObject(t)
  12085. ? (i.remove(),
  12086. g(e, i.object, i.property, {
  12087. before: i.__li.nextElementSibling,
  12088. factoryArgs: [t],
  12089. }))
  12090. : void 0;
  12091. },
  12092. name: function (e) {
  12093. return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i;
  12094. },
  12095. listen: function () {
  12096. return i.__gui.listen(i), i;
  12097. },
  12098. remove: function () {
  12099. return i.__gui.remove(i), i;
  12100. },
  12101. }),
  12102. i instanceof l)
  12103. ) {
  12104. var n = new s(i.object, i.property, {
  12105. min: i.__min,
  12106. max: i.__max,
  12107. step: i.__step,
  12108. });
  12109. f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  12110. var t = i[e],
  12111. r = n[e];
  12112. i[e] = n[e] = function () {
  12113. var e = Array.prototype.slice.call(arguments);
  12114. return t.apply(i, e), r.apply(n, e);
  12115. };
  12116. }),
  12117. p.addClass(t, 'has-slider'),
  12118. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild);
  12119. } else if (i instanceof s) {
  12120. var r = function (t) {
  12121. return f.isNumber(i.__min) && f.isNumber(i.__max)
  12122. ? (i.remove(),
  12123. g(e, i.object, i.property, {
  12124. before: i.__li.nextElementSibling,
  12125. factoryArgs: [i.__min, i.__max, i.__step],
  12126. }))
  12127. : t;
  12128. };
  12129. (i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max));
  12130. } else
  12131. i instanceof o
  12132. ? (p.bind(t, 'click', function () {
  12133. p.fakeEvent(i.__checkbox, 'click');
  12134. }),
  12135. p.bind(i.__checkbox, 'click', function (e) {
  12136. e.stopPropagation();
  12137. }))
  12138. : i instanceof a
  12139. ? (p.bind(t, 'click', function () {
  12140. p.fakeEvent(i.__button, 'click');
  12141. }),
  12142. p.bind(t, 'mouseover', function () {
  12143. p.addClass(i.__button, 'hover');
  12144. }),
  12145. p.bind(t, 'mouseout', function () {
  12146. p.removeClass(i.__button, 'hover');
  12147. }))
  12148. : i instanceof h &&
  12149. (p.addClass(t, 'color'),
  12150. (i.updateDisplay = f.compose(function (e) {
  12151. return (t.style.borderLeftColor = i.__color.toString()), e;
  12152. }, i.updateDisplay)),
  12153. i.updateDisplay());
  12154. i.setValue = f.compose(function (t) {
  12155. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t;
  12156. }, i.setValue);
  12157. }
  12158. function A(e, t) {
  12159. var i = e.getRoot(),
  12160. n = i.__rememberedObjects.indexOf(t.object);
  12161. if (n != -1) {
  12162. var r = i.__rememberedObjectIndecesToControllers[n];
  12163. if (
  12164. (void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)),
  12165. (r[t.property] = t),
  12166. i.load && i.load.remembered)
  12167. ) {
  12168. var o,
  12169. a = i.load.remembered;
  12170. if (a[e.preset]) o = a[e.preset];
  12171. else {
  12172. if (!a[L]) return;
  12173. o = a[L];
  12174. }
  12175. if (o[n] && void 0 !== o[n][t.property]) {
  12176. var s = o[n][t.property];
  12177. (t.initialValue = s), t.setValue(s);
  12178. }
  12179. }
  12180. }
  12181. }
  12182. function y(e, t) {
  12183. return document.location.href + '.' + t;
  12184. }
  12185. function C(e) {
  12186. var t = (e.__save_row = document.createElement('li'));
  12187. p.addClass(e.domElement, 'has-save'),
  12188. e.__ul.insertBefore(t, e.__ul.firstChild),
  12189. p.addClass(t, 'save-row');
  12190. var i = document.createElement('span');
  12191. (i.innerHTML = '&nbsp;'), p.addClass(i, 'button gears');
  12192. var n = document.createElement('span');
  12193. (n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save');
  12194. var r = document.createElement('span');
  12195. (r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as');
  12196. var o = document.createElement('span');
  12197. (o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert');
  12198. var a = (e.__preset_select = document.createElement('select'));
  12199. if (
  12200. (e.load && e.load.remembered
  12201. ? f.each(e.load.remembered, function (t, i) {
  12202. w(e, i, i == e.preset);
  12203. })
  12204. : w(e, L, !1),
  12205. p.bind(a, 'change', function () {
  12206. for (var t = 0; t < e.__preset_select.length; t++)
  12207. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  12208. e.preset = this.value;
  12209. }),
  12210. t.appendChild(a),
  12211. t.appendChild(i),
  12212. t.appendChild(n),
  12213. t.appendChild(r),
  12214. t.appendChild(o),
  12215. D)
  12216. ) {
  12217. var s = document.getElementById('dg-save-locally'),
  12218. l = document.getElementById('dg-local-explain');
  12219. s.style.display = 'block';
  12220. var c = document.getElementById('dg-local-storage');
  12221. 'true' === localStorage.getItem(y(e, 'isLocal')) &&
  12222. c.setAttribute('checked', 'checked');
  12223. var h = function () {
  12224. l.style.display = e.useLocalStorage ? 'block' : 'none';
  12225. };
  12226. h(),
  12227. p.bind(c, 'change', function () {
  12228. (e.useLocalStorage = !e.useLocalStorage), h();
  12229. });
  12230. }
  12231. var u = document.getElementById('dg-new-constructor');
  12232. p.bind(u, 'keydown', function (e) {
  12233. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide();
  12234. }),
  12235. p.bind(i, 'click', function () {
  12236. (u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)),
  12237. S.show(),
  12238. u.focus(),
  12239. u.select();
  12240. }),
  12241. p.bind(n, 'click', function () {
  12242. e.save();
  12243. }),
  12244. p.bind(r, 'click', function () {
  12245. var t = prompt('Enter a new preset name.');
  12246. t && e.saveAs(t);
  12247. }),
  12248. p.bind(o, 'click', function () {
  12249. e.revert();
  12250. });
  12251. }
  12252. function I(e) {
  12253. function t(t) {
  12254. return (
  12255. t.preventDefault(),
  12256. (r = t.clientX),
  12257. p.addClass(e.__closeButton, V.CLASS_DRAG),
  12258. p.bind(window, 'mousemove', i),
  12259. p.bind(window, 'mouseup', n),
  12260. !1
  12261. );
  12262. }
  12263. function i(t) {
  12264. return (
  12265. t.preventDefault(),
  12266. (e.width += r - t.clientX),
  12267. e.onResize(),
  12268. (r = t.clientX),
  12269. !1
  12270. );
  12271. }
  12272. function n() {
  12273. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  12274. p.unbind(window, 'mousemove', i),
  12275. p.unbind(window, 'mouseup', n);
  12276. }
  12277. (e.__resize_handle = document.createElement('div')),
  12278. f.extend(e.__resize_handle.style, {
  12279. width: '6px',
  12280. marginLeft: '-3px',
  12281. height: '200px',
  12282. cursor: 'ew-resize',
  12283. position: 'absolute',
  12284. });
  12285. var r;
  12286. p.bind(e.__resize_handle, 'mousedown', t),
  12287. p.bind(e.__closeButton, 'mousedown', t),
  12288. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild);
  12289. }
  12290. function E(e, t) {
  12291. (e.domElement.style.width = t + 'px'),
  12292. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'),
  12293. e.__closeButton && (e.__closeButton.style.width = t + 'px');
  12294. }
  12295. function b(e, t) {
  12296. var i = {};
  12297. return (
  12298. f.each(e.__rememberedObjects, function (n, r) {
  12299. var o = {},
  12300. a = e.__rememberedObjectIndecesToControllers[r];
  12301. f.each(a, function (e, i) {
  12302. o[i] = t ? e.initialValue : e.getValue();
  12303. }),
  12304. (i[r] = o);
  12305. }),
  12306. i
  12307. );
  12308. }
  12309. function w(e, t, i) {
  12310. var n = document.createElement('option');
  12311. (n.innerHTML = t),
  12312. (n.value = t),
  12313. e.__preset_select.appendChild(n),
  12314. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1);
  12315. }
  12316. function _(e) {
  12317. for (var t = 0; t < e.__preset_select.length; t++)
  12318. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t);
  12319. }
  12320. function T(e, t) {
  12321. var i = e.__preset_select[e.__preset_select.selectedIndex];
  12322. t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value);
  12323. }
  12324. function x(e) {
  12325. 0 != e.length &&
  12326. u(function () {
  12327. x(e);
  12328. }),
  12329. f.each(e, function (e) {
  12330. e.updateDisplay();
  12331. });
  12332. }
  12333. e.inject(i);
  12334. var S,
  12335. M,
  12336. R = 'dg',
  12337. P = 72,
  12338. O = 20,
  12339. L = 'Default',
  12340. D = (function () {
  12341. try {
  12342. return 'localStorage' in window && null !== window.localStorage;
  12343. } catch (e) {
  12344. return !1;
  12345. }
  12346. })(),
  12347. N = !0,
  12348. B = !1,
  12349. F = [],
  12350. V = function (e) {
  12351. function t() {
  12352. var e = i.getRoot();
  12353. (e.width += 1),
  12354. f.defer(function () {
  12355. e.width -= 1;
  12356. });
  12357. }
  12358. var i = this;
  12359. (this.domElement = document.createElement('div')),
  12360. (this.__ul = document.createElement('ul')),
  12361. this.domElement.appendChild(this.__ul),
  12362. p.addClass(this.domElement, R),
  12363. (this.__folders = {}),
  12364. (this.__controllers = []),
  12365. (this.__rememberedObjects = []),
  12366. (this.__rememberedObjectIndecesToControllers = []),
  12367. (this.__listening = []),
  12368. (e = e || {}),
  12369. (e = f.defaults(e, {
  12370. autoPlace: !0,
  12371. width: V.DEFAULT_WIDTH,
  12372. })),
  12373. (e = f.defaults(e, {
  12374. resizable: e.autoPlace,
  12375. hideable: e.autoPlace,
  12376. })),
  12377. f.isUndefined(e.load)
  12378. ? (e.load = {
  12379. preset: L,
  12380. })
  12381. : e.preset && (e.load.preset = e.preset),
  12382. f.isUndefined(e.parent) && e.hideable && F.push(this),
  12383. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  12384. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  12385. var n,
  12386. r = D && 'true' === localStorage.getItem(y(this, 'isLocal'));
  12387. if (
  12388. (Object.defineProperties(this, {
  12389. parent: {
  12390. get: function () {
  12391. return e.parent;
  12392. },
  12393. },
  12394. scrollable: {
  12395. get: function () {
  12396. return e.scrollable;
  12397. },
  12398. },
  12399. autoPlace: {
  12400. get: function () {
  12401. return e.autoPlace;
  12402. },
  12403. },
  12404. preset: {
  12405. get: function () {
  12406. return i.parent ? i.getRoot().preset : e.load.preset;
  12407. },
  12408. set: function (t) {
  12409. i.parent ? (i.getRoot().preset = t) : (e.load.preset = t),
  12410. _(this),
  12411. i.revert();
  12412. },
  12413. },
  12414. width: {
  12415. get: function () {
  12416. return e.width;
  12417. },
  12418. set: function (t) {
  12419. (e.width = t), E(i, t);
  12420. },
  12421. },
  12422. name: {
  12423. get: function () {
  12424. return e.name;
  12425. },
  12426. set: function (t) {
  12427. (e.name = t), a && (a.innerHTML = e.name);
  12428. },
  12429. },
  12430. closed: {
  12431. get: function () {
  12432. return e.closed;
  12433. },
  12434. set: function (t) {
  12435. (e.closed = t),
  12436. e.closed
  12437. ? p.addClass(i.__ul, V.CLASS_CLOSED)
  12438. : p.removeClass(i.__ul, V.CLASS_CLOSED),
  12439. this.onResize(),
  12440. i.__closeButton &&
  12441. (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED);
  12442. },
  12443. },
  12444. load: {
  12445. get: function () {
  12446. return e.load;
  12447. },
  12448. },
  12449. useLocalStorage: {
  12450. get: function () {
  12451. return r;
  12452. },
  12453. set: function (e) {
  12454. D &&
  12455. ((r = e),
  12456. e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n),
  12457. localStorage.setItem(y(i, 'isLocal'), e));
  12458. },
  12459. },
  12460. }),
  12461. f.isUndefined(e.parent))
  12462. ) {
  12463. if (
  12464. ((e.closed = !1),
  12465. p.addClass(this.domElement, V.CLASS_MAIN),
  12466. p.makeSelectable(this.domElement, !1),
  12467. D && r)
  12468. ) {
  12469. i.useLocalStorage = !0;
  12470. var o = localStorage.getItem(y(this, 'gui'));
  12471. o && (e.load = JSON.parse(o));
  12472. }
  12473. (this.__closeButton = document.createElement('div')),
  12474. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  12475. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  12476. this.domElement.appendChild(this.__closeButton),
  12477. p.bind(this.__closeButton, 'click', function () {
  12478. i.closed = !i.closed;
  12479. });
  12480. } else {
  12481. void 0 === e.closed && (e.closed = !0);
  12482. var a = document.createTextNode(e.name);
  12483. p.addClass(a, 'controller-name');
  12484. var s = m(i, a),
  12485. l = function (e) {
  12486. return e.preventDefault(), (i.closed = !i.closed), !1;
  12487. };
  12488. p.addClass(this.__ul, V.CLASS_CLOSED),
  12489. p.addClass(s, 'title'),
  12490. p.bind(s, 'click', l),
  12491. e.closed || (this.closed = !1);
  12492. }
  12493. e.autoPlace &&
  12494. (f.isUndefined(e.parent) &&
  12495. (N &&
  12496. ((M = document.createElement('div')),
  12497. p.addClass(M, R),
  12498. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  12499. document.body.appendChild(M),
  12500. (N = !1)),
  12501. M.appendChild(this.domElement),
  12502. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  12503. this.parent || E(i, e.width)),
  12504. p.bind(window, 'resize', function () {
  12505. i.onResize();
  12506. }),
  12507. p.bind(this.__ul, 'webkitTransitionEnd', function () {
  12508. i.onResize();
  12509. }),
  12510. p.bind(this.__ul, 'transitionend', function () {
  12511. i.onResize();
  12512. }),
  12513. p.bind(this.__ul, 'oTransitionEnd', function () {
  12514. i.onResize();
  12515. }),
  12516. this.onResize(),
  12517. e.resizable && I(this),
  12518. (n = function () {
  12519. D &&
  12520. 'true' === localStorage.getItem(y(i, 'isLocal')) &&
  12521. localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()));
  12522. }),
  12523. (this.saveToLocalStorageIfPossible = n);
  12524. i.getRoot();
  12525. e.parent || t();
  12526. };
  12527. return (
  12528. (V.toggleHide = function () {
  12529. (B = !B),
  12530. f.each(F, function (e) {
  12531. (e.domElement.style.zIndex = B ? -999 : 999),
  12532. (e.domElement.style.opacity = B ? 0 : 1);
  12533. });
  12534. }),
  12535. (V.CLASS_AUTO_PLACE = 'a'),
  12536. (V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  12537. (V.CLASS_MAIN = 'main'),
  12538. (V.CLASS_CONTROLLER_ROW = 'cr'),
  12539. (V.CLASS_TOO_TALL = 'taller-than-window'),
  12540. (V.CLASS_CLOSED = 'closed'),
  12541. (V.CLASS_CLOSE_BUTTON = 'close-button'),
  12542. (V.CLASS_DRAG = 'drag'),
  12543. (V.DEFAULT_WIDTH = 245),
  12544. (V.TEXT_CLOSED = 'Close Controls'),
  12545. (V.TEXT_OPEN = 'Open Controls'),
  12546. p.bind(
  12547. window,
  12548. 'keydown',
  12549. function (e) {
  12550. 'text' === document.activeElement.type ||
  12551. (e.which !== P && e.keyCode != P) ||
  12552. V.toggleHide();
  12553. },
  12554. !1
  12555. ),
  12556. f.extend(V.prototype, {
  12557. add: function (e, t) {
  12558. return g(this, e, t, {
  12559. factoryArgs: Array.prototype.slice.call(arguments, 2),
  12560. });
  12561. },
  12562. addColor: function (e, t) {
  12563. return g(this, e, t, {
  12564. color: !0,
  12565. });
  12566. },
  12567. remove: function (e) {
  12568. this.__ul.removeChild(e.__li),
  12569. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  12570. var t = this;
  12571. f.defer(function () {
  12572. t.onResize();
  12573. });
  12574. },
  12575. destroy: function () {
  12576. this.autoPlace && M.removeChild(this.domElement);
  12577. },
  12578. addFolder: function (e) {
  12579. if (void 0 !== this.__folders[e])
  12580. throw new Error(
  12581. 'You already have a folder in this GUI by the name "' + e + '"'
  12582. );
  12583. var t = {
  12584. name: e,
  12585. parent: this,
  12586. };
  12587. (t.autoPlace = this.autoPlace),
  12588. this.load &&
  12589. this.load.folders &&
  12590. this.load.folders[e] &&
  12591. ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]));
  12592. var i = new V(t);
  12593. this.__folders[e] = i;
  12594. var n = m(this, i.domElement);
  12595. return p.addClass(n, 'folder'), i;
  12596. },
  12597. open: function () {
  12598. this.closed = !1;
  12599. },
  12600. close: function () {
  12601. this.closed = !0;
  12602. },
  12603. onResize: function () {
  12604. var e = this.getRoot();
  12605. if (e.scrollable) {
  12606. var t = p.getOffset(e.__ul).top,
  12607. i = 0;
  12608. f.each(e.__ul.childNodes, function (t) {
  12609. (e.autoPlace && t === e.__save_row) || (i += p.getHeight(t));
  12610. }),
  12611. $('#player').height() - t - O < i
  12612. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  12613. (e.__ul.style.height = $('#player').height() - t - O + 'px'))
  12614. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  12615. (e.__ul.style.height = 'auto'));
  12616. }
  12617. e.__resize_handle &&
  12618. f.defer(function () {
  12619. e.__resize_handle.style.height = e.__ul.offsetHeight + 'px';
  12620. }),
  12621. e.__closeButton && (e.__closeButton.style.width = e.width + 'px');
  12622. },
  12623. remember: function () {
  12624. if (
  12625. (f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)),
  12626. this.parent)
  12627. )
  12628. throw new Error('You can only call remember on a top level GUI.');
  12629. var e = this;
  12630. f.each(Array.prototype.slice.call(arguments), function (t) {
  12631. 0 == e.__rememberedObjects.length && C(e),
  12632. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t);
  12633. }),
  12634. this.autoPlace && E(this, this.width);
  12635. },
  12636. getRoot: function () {
  12637. for (var e = this; e.parent; ) e = e.parent;
  12638. return e;
  12639. },
  12640. getSaveObject: function () {
  12641. var e = this.load;
  12642. return (
  12643. (e.closed = this.closed),
  12644. this.__rememberedObjects.length > 0 &&
  12645. ((e.preset = this.preset),
  12646. e.remembered || (e.remembered = {}),
  12647. (e.remembered[this.preset] = b(this))),
  12648. (e.folders = {}),
  12649. f.each(this.__folders, function (t, i) {
  12650. e.folders[i] = t.getSaveObject();
  12651. }),
  12652. e
  12653. );
  12654. },
  12655. save: function () {
  12656. this.load.remembered || (this.load.remembered = {}),
  12657. (this.load.remembered[this.preset] = b(this)),
  12658. T(this, !1),
  12659. this.saveToLocalStorageIfPossible();
  12660. },
  12661. saveAs: function (e) {
  12662. this.load.remembered ||
  12663. ((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
  12664. (this.load.remembered[e] = b(this)),
  12665. (this.preset = e),
  12666. w(this, e, !0),
  12667. this.saveToLocalStorageIfPossible();
  12668. },
  12669. revert: function (e) {
  12670. f.each(
  12671. this.__controllers,
  12672. function (t) {
  12673. this.getRoot().load.remembered
  12674. ? A(e || this.getRoot(), t)
  12675. : t.setValue(t.initialValue);
  12676. },
  12677. this
  12678. ),
  12679. f.each(this.__folders, function (e) {
  12680. e.revert(e);
  12681. }),
  12682. e || T(this.getRoot(), !1);
  12683. },
  12684. listen: function (e) {
  12685. var t = 0 == this.__listening.length;
  12686. this.__listening.push(e), t && x(this.__listening);
  12687. },
  12688. }),
  12689. V
  12690. );
  12691. })(
  12692. n.utils.css,
  12693. '<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>',
  12694. ".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",
  12695. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  12696. return function (s, l) {
  12697. var c = s[l];
  12698. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  12699. ? new e(s, l, arguments[2])
  12700. : a.isNumber(c)
  12701. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  12702. ? new i(s, l, arguments[2], arguments[3])
  12703. : new t(s, l, {
  12704. min: arguments[2],
  12705. max: arguments[3],
  12706. })
  12707. : a.isString(c)
  12708. ? new n(s, l)
  12709. : a.isFunction(c)
  12710. ? new r(s, l, '')
  12711. : a.isBoolean(c)
  12712. ? new o(s, l)
  12713. : void 0;
  12714. };
  12715. })(
  12716. n.controllers.OptionController,
  12717. n.controllers.NumberControllerBox,
  12718. n.controllers.NumberControllerSlider,
  12719. (n.controllers.StringController = (function (e, t, i) {
  12720. var n = function (e, i) {
  12721. function r() {
  12722. a.setValue(a.__input.value);
  12723. }
  12724. function o() {
  12725. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue());
  12726. }
  12727. n.superclass.call(this, e, i);
  12728. var a = this;
  12729. (this.__input = document.createElement('input')),
  12730. this.__input.setAttribute('type', 'text'),
  12731. t.bind(this.__input, 'keyup', r),
  12732. t.bind(this.__input, 'change', r),
  12733. t.bind(this.__input, 'blur', o),
  12734. t.bind(this.__input, 'keydown', function (e) {
  12735. 13 === e.keyCode && this.blur();
  12736. }),
  12737. this.updateDisplay(),
  12738. this.domElement.appendChild(this.__input);
  12739. };
  12740. return (
  12741. (n.superclass = e),
  12742. i.extend(n.prototype, e.prototype, {
  12743. updateDisplay: function () {
  12744. return (
  12745. t.isActive(this.__input) || (this.__input.value = this.getValue()),
  12746. n.superclass.prototype.updateDisplay.call(this)
  12747. );
  12748. },
  12749. }),
  12750. n
  12751. );
  12752. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12753. n.controllers.FunctionController,
  12754. n.controllers.BooleanController,
  12755. n.utils.common
  12756. )),
  12757. n.controllers.Controller,
  12758. n.controllers.BooleanController,
  12759. n.controllers.FunctionController,
  12760. n.controllers.NumberControllerBox,
  12761. n.controllers.NumberControllerSlider,
  12762. n.controllers.OptionController,
  12763. (n.controllers.ColorController = (function (e, t, i, n, r) {
  12764. function o(e, t, i, n) {
  12765. (e.style.background = ''),
  12766. r.each(l, function (r) {
  12767. e.style.cssText +=
  12768. 'background: ' +
  12769. r +
  12770. 'linear-gradient(' +
  12771. t +
  12772. ', ' +
  12773. i +
  12774. ' 0%, ' +
  12775. n +
  12776. ' 100%); ';
  12777. });
  12778. }
  12779. function a(e) {
  12780. (e.style.background = ''),
  12781. (e.style.cssText +=
  12782. 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  12783. (e.style.cssText +=
  12784. 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12785. (e.style.cssText +=
  12786. 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12787. (e.style.cssText +=
  12788. 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12789. (e.style.cssText +=
  12790. 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);');
  12791. }
  12792. var s = function (e, l) {
  12793. function c(e) {
  12794. p(e), t.bind(window, 'mousemove', p), t.bind(window, 'mouseup', h);
  12795. }
  12796. function h() {
  12797. t.unbind(window, 'mousemove', p), t.unbind(window, 'mouseup', h);
  12798. }
  12799. function u() {
  12800. var e = n(this.value);
  12801. e !== !1
  12802. ? ((g.__color.__state = e), g.setValue(g.__color.toOriginal()))
  12803. : (this.value = g.__color.toString());
  12804. }
  12805. function d() {
  12806. t.unbind(window, 'mousemove', f), t.unbind(window, 'mouseup', d);
  12807. }
  12808. function p(e) {
  12809. e.preventDefault();
  12810. var i = t.getWidth(g.__saturation_field),
  12811. n = t.getOffset(g.__saturation_field),
  12812. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  12813. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  12814. return (
  12815. o > 1 ? (o = 1) : o < 0 && (o = 0),
  12816. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12817. (g.__color.v = o),
  12818. (g.__color.s = r),
  12819. g.setValue(g.__color.toOriginal()),
  12820. !1
  12821. );
  12822. }
  12823. function f(e) {
  12824. e.preventDefault();
  12825. var i = t.getHeight(g.__hue_field),
  12826. n = t.getOffset(g.__hue_field),
  12827. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  12828. return (
  12829. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12830. (g.__color.h = 360 * r),
  12831. g.setValue(g.__color.toOriginal()),
  12832. !1
  12833. );
  12834. }
  12835. s.superclass.call(this, e, l),
  12836. (this.__color = new i(this.getValue())),
  12837. (this.__temp = new i(0));
  12838. var g = this;
  12839. (this.domElement = document.createElement('div')),
  12840. t.makeSelectable(this.domElement, !1),
  12841. (this.__selector = document.createElement('div')),
  12842. (this.__selector.className = 'selector'),
  12843. (this.__saturation_field = document.createElement('div')),
  12844. (this.__saturation_field.className = 'saturation-field'),
  12845. (this.__field_knob = document.createElement('div')),
  12846. (this.__field_knob.className = 'field-knob'),
  12847. (this.__field_knob_border = '2px solid '),
  12848. (this.__hue_knob = document.createElement('div')),
  12849. (this.__hue_knob.className = 'hue-knob'),
  12850. (this.__hue_field = document.createElement('div')),
  12851. (this.__hue_field.className = 'hue-field'),
  12852. (this.__input = document.createElement('input')),
  12853. (this.__input.type = 'text'),
  12854. (this.__input_textShadow = '0 1px 1px '),
  12855. t.bind(this.__input, 'keydown', function (e) {
  12856. 13 === e.keyCode && u.call(this);
  12857. }),
  12858. t.bind(this.__input, 'blur', u),
  12859. t.bind(this.__selector, 'mousedown', function (e) {
  12860. t.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  12861. t.removeClass(g.__selector, 'drag');
  12862. });
  12863. });
  12864. var m = document.createElement('div');
  12865. r.extend(this.__selector.style, {
  12866. width: '122px',
  12867. height: '102px',
  12868. padding: '3px',
  12869. backgroundColor: '#222',
  12870. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)',
  12871. }),
  12872. r.extend(this.__field_knob.style, {
  12873. position: 'absolute',
  12874. width: '12px',
  12875. height: '12px',
  12876. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  12877. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  12878. borderRadius: '12px',
  12879. zIndex: 1,
  12880. }),
  12881. r.extend(this.__hue_knob.style, {
  12882. position: 'absolute',
  12883. width: '15px',
  12884. height: '2px',
  12885. borderRight: '4px solid #fff',
  12886. zIndex: 1,
  12887. }),
  12888. r.extend(this.__saturation_field.style, {
  12889. width: '100px',
  12890. height: '100px',
  12891. border: '1px solid #555',
  12892. marginRight: '3px',
  12893. display: 'inline-block',
  12894. cursor: 'pointer',
  12895. }),
  12896. r.extend(m.style, {
  12897. width: '100%',
  12898. height: '100%',
  12899. background: 'none',
  12900. }),
  12901. o(m, 'top', 'rgba(0,0,0,0)', '#000'),
  12902. r.extend(this.__hue_field.style, {
  12903. width: '15px',
  12904. height: '100px',
  12905. display: 'inline-block',
  12906. border: '1px solid #555',
  12907. cursor: 'ns-resize',
  12908. }),
  12909. a(this.__hue_field),
  12910. r.extend(this.__input.style, {
  12911. outline: 'none',
  12912. textAlign: 'center',
  12913. color: '#fff',
  12914. border: 0,
  12915. fontWeight: 'bold',
  12916. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)',
  12917. }),
  12918. t.bind(this.__saturation_field, 'mousedown', c),
  12919. t.bind(this.__field_knob, 'mousedown', c),
  12920. t.bind(this.__hue_field, 'mousedown', function (e) {
  12921. f(e), t.bind(window, 'mousemove', f), t.bind(window, 'mouseup', d);
  12922. }),
  12923. this.__saturation_field.appendChild(m),
  12924. this.__selector.appendChild(this.__field_knob),
  12925. this.__selector.appendChild(this.__saturation_field),
  12926. this.__selector.appendChild(this.__hue_field),
  12927. this.__hue_field.appendChild(this.__hue_knob),
  12928. this.domElement.appendChild(this.__input),
  12929. this.domElement.appendChild(this.__selector),
  12930. this.updateDisplay();
  12931. };
  12932. (s.superclass = e),
  12933. r.extend(s.prototype, e.prototype, {
  12934. updateDisplay: function () {
  12935. var e = n(this.getValue());
  12936. if (e !== !1) {
  12937. var t = !1;
  12938. r.each(
  12939. i.COMPONENTS,
  12940. function (i) {
  12941. if (
  12942. !r.isUndefined(e[i]) &&
  12943. !r.isUndefined(this.__color.__state[i]) &&
  12944. e[i] !== this.__color.__state[i]
  12945. )
  12946. return (t = !0), {};
  12947. },
  12948. this
  12949. ),
  12950. t && r.extend(this.__color.__state, e);
  12951. }
  12952. r.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1);
  12953. var a = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0,
  12954. s = 255 - a;
  12955. r.extend(this.__field_knob.style, {
  12956. marginLeft: 100 * this.__color.s - 7 + 'px',
  12957. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  12958. backgroundColor: this.__temp.toString(),
  12959. border: this.__field_knob_border + 'rgb(' + a + ',' + a + ',' + a + ')',
  12960. }),
  12961. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  12962. (this.__temp.s = 1),
  12963. (this.__temp.v = 1),
  12964. o(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  12965. r.extend(this.__input.style, {
  12966. backgroundColor: (this.__input.value = this.__color.toString()),
  12967. color: 'rgb(' + a + ',' + a + ',' + a + ')',
  12968. textShadow:
  12969. this.__input_textShadow + 'rgba(' + s + ',' + s + ',' + s + ',.7)',
  12970. });
  12971. },
  12972. });
  12973. var l = ['-moz-', '-o-', '-webkit-', '-ms-', ''];
  12974. return s;
  12975. })(
  12976. n.controllers.Controller,
  12977. n.dom.dom,
  12978. (n.color.Color = (function (e, t, i, n) {
  12979. function r(e, t, i) {
  12980. Object.defineProperty(e, t, {
  12981. get: function () {
  12982. return 'RGB' === this.__state.space
  12983. ? this.__state[t]
  12984. : (a(this, t, i), this.__state[t]);
  12985. },
  12986. set: function (e) {
  12987. 'RGB' !== this.__state.space &&
  12988. (a(this, t, i), (this.__state.space = 'RGB')),
  12989. (this.__state[t] = e);
  12990. },
  12991. });
  12992. }
  12993. function o(e, t) {
  12994. Object.defineProperty(e, t, {
  12995. get: function () {
  12996. return 'HSV' === this.__state.space
  12997. ? this.__state[t]
  12998. : (s(this), this.__state[t]);
  12999. },
  13000. set: function (e) {
  13001. 'HSV' !== this.__state.space && (s(this), (this.__state.space = 'HSV')),
  13002. (this.__state[t] = e);
  13003. },
  13004. });
  13005. }
  13006. function a(e, i, r) {
  13007. if ('HEX' === e.__state.space)
  13008. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  13009. else {
  13010. if ('HSV' !== e.__state.space) throw 'Corrupted color state';
  13011. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v));
  13012. }
  13013. }
  13014. function s(e) {
  13015. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  13016. n.extend(e.__state, {
  13017. s: i.s,
  13018. v: i.v,
  13019. }),
  13020. n.isNaN(i.h)
  13021. ? n.isUndefined(e.__state.h) && (e.__state.h = 0)
  13022. : (e.__state.h = i.h);
  13023. }
  13024. var l = function () {
  13025. if (((this.__state = e.apply(this, arguments)), this.__state === !1))
  13026. throw 'Failed to interpret color arguments';
  13027. this.__state.a = this.__state.a || 1;
  13028. };
  13029. return (
  13030. (l.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  13031. n.extend(l.prototype, {
  13032. toString: function () {
  13033. return i(this);
  13034. },
  13035. toOriginal: function () {
  13036. return this.__state.conversion.write(this);
  13037. },
  13038. }),
  13039. r(l.prototype, 'r', 2),
  13040. r(l.prototype, 'g', 1),
  13041. r(l.prototype, 'b', 0),
  13042. o(l.prototype, 'h'),
  13043. o(l.prototype, 's'),
  13044. o(l.prototype, 'v'),
  13045. Object.defineProperty(l.prototype, 'a', {
  13046. get: function () {
  13047. return this.__state.a;
  13048. },
  13049. set: function (e) {
  13050. this.__state.a = e;
  13051. },
  13052. }),
  13053. Object.defineProperty(l.prototype, 'hex', {
  13054. get: function () {
  13055. return (
  13056. 'HEX' !== !this.__state.space &&
  13057. (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  13058. this.__state.hex
  13059. );
  13060. },
  13061. set: function (e) {
  13062. (this.__state.space = 'HEX'), (this.__state.hex = e);
  13063. },
  13064. }),
  13065. l
  13066. );
  13067. })(
  13068. n.color.interpret,
  13069. (n.color.math = (function () {
  13070. var e;
  13071. return {
  13072. hsv_to_rgb: function (e, t, i) {
  13073. var n = Math.floor(e / 60) % 6,
  13074. r = e / 60 - Math.floor(e / 60),
  13075. o = i * (1 - t),
  13076. a = i * (1 - r * t),
  13077. s = i * (1 - (1 - r) * t),
  13078. l = [
  13079. [i, s, o],
  13080. [a, i, o],
  13081. [o, i, s],
  13082. [o, a, i],
  13083. [s, o, i],
  13084. [i, o, a],
  13085. ][n];
  13086. return {
  13087. r: 255 * l[0],
  13088. g: 255 * l[1],
  13089. b: 255 * l[2],
  13090. };
  13091. },
  13092. rgb_to_hsv: function (e, t, i) {
  13093. var n,
  13094. r,
  13095. o = Math.min(e, t, i),
  13096. a = Math.max(e, t, i),
  13097. s = a - o;
  13098. return 0 == a
  13099. ? {
  13100. h: NaN,
  13101. s: 0,
  13102. v: 0,
  13103. }
  13104. : ((r = s / a),
  13105. (n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s),
  13106. (n /= 6),
  13107. n < 0 && (n += 1),
  13108. {
  13109. h: 360 * n,
  13110. s: r,
  13111. v: a / 255,
  13112. });
  13113. },
  13114. rgb_to_hex: function (e, t, i) {
  13115. var n = this.hex_with_component(0, 2, e);
  13116. return (
  13117. (n = this.hex_with_component(n, 1, t)),
  13118. (n = this.hex_with_component(n, 0, i))
  13119. );
  13120. },
  13121. component_from_hex: function (e, t) {
  13122. return (e >> (8 * t)) & 255;
  13123. },
  13124. hex_with_component: function (t, i, n) {
  13125. return (n << (e = 8 * i)) | (t & ~(255 << e));
  13126. },
  13127. };
  13128. })()),
  13129. n.color.toString,
  13130. n.utils.common
  13131. )),
  13132. n.color.interpret,
  13133. n.utils.common
  13134. )),
  13135. (n.utils.requestAnimationFrame = (function () {
  13136. return (
  13137. window.requestAnimationFrame ||
  13138. window.webkitRequestAnimationFrame ||
  13139. window.mozRequestAnimationFrame ||
  13140. window.oRequestAnimationFrame ||
  13141. window.msRequestAnimationFrame ||
  13142. function (e, t) {
  13143. window.setTimeout(e, 1e3 / 60);
  13144. }
  13145. );
  13146. })()),
  13147. (n.dom.CenteredDiv = (function (e, t) {
  13148. var i = function () {
  13149. (this.backgroundElement = document.createElement('div')),
  13150. t.extend(this.backgroundElement.style, {
  13151. backgroundColor: 'rgba(0,0,0,0.8)',
  13152. top: 0,
  13153. left: 0,
  13154. display: 'none',
  13155. zIndex: '1000',
  13156. opacity: 0,
  13157. WebkitTransition: 'opacity 0.2s linear',
  13158. }),
  13159. e.makeFullscreen(this.backgroundElement),
  13160. (this.backgroundElement.style.position = 'fixed'),
  13161. (this.domElement = document.createElement('div')),
  13162. t.extend(this.domElement.style, {
  13163. position: 'fixed',
  13164. display: 'none',
  13165. zIndex: '1001',
  13166. opacity: 0,
  13167. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',
  13168. }),
  13169. document.body.appendChild(this.backgroundElement),
  13170. document.body.appendChild(this.domElement);
  13171. var i = this;
  13172. e.bind(this.backgroundElement, 'click', function () {
  13173. i.hide();
  13174. });
  13175. };
  13176. return (
  13177. (i.prototype.show = function () {
  13178. var e = this;
  13179. (this.backgroundElement.style.display = 'block'),
  13180. (this.domElement.style.display = 'block'),
  13181. (this.domElement.style.opacity = 0),
  13182. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  13183. this.layout(),
  13184. t.defer(function () {
  13185. (e.backgroundElement.style.opacity = 1),
  13186. (e.domElement.style.opacity = 1),
  13187. (e.domElement.style.webkitTransform = 'scale(1)');
  13188. });
  13189. }),
  13190. (i.prototype.hide = function () {
  13191. var t = this,
  13192. i = function () {
  13193. (t.domElement.style.display = 'none'),
  13194. (t.backgroundElement.style.display = 'none'),
  13195. e.unbind(t.domElement, 'webkitTransitionEnd', i),
  13196. e.unbind(t.domElement, 'transitionend', i),
  13197. e.unbind(t.domElement, 'oTransitionEnd', i);
  13198. };
  13199. e.bind(this.domElement, 'webkitTransitionEnd', i),
  13200. e.bind(this.domElement, 'transitionend', i),
  13201. e.bind(this.domElement, 'oTransitionEnd', i),
  13202. (this.backgroundElement.style.opacity = 0),
  13203. (this.domElement.style.opacity = 0),
  13204. (this.domElement.style.webkitTransform = 'scale(1.1)');
  13205. }),
  13206. (i.prototype.layout = function () {
  13207. (this.domElement.style.left =
  13208. $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + 'px'),
  13209. (this.domElement.style.top =
  13210. $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + 'px');
  13211. }),
  13212. i
  13213. );
  13214. })(n.dom.dom, n.utils.common)),
  13215. n.dom.dom,
  13216. n.utils.common
  13217. ));
  13218. },
  13219. {},
  13220. ],
  13221. 94: [
  13222. function (e, t, i) {
  13223. (function (e) {
  13224. 'use strict';
  13225. function i(t) {
  13226. function i(e) {
  13227. for (
  13228. var t = [
  13229. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24,
  13230. 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103,
  13231. 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72,
  13232. 92, 95, 98, 112, 100, 103, 99,
  13233. ],
  13234. i = 0;
  13235. i < 64;
  13236. i++
  13237. ) {
  13238. var n = _((t[i] * e + 50) / 100);
  13239. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n);
  13240. }
  13241. for (
  13242. var r = [
  13243. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99,
  13244. 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13245. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13246. 99, 99, 99, 99,
  13247. ],
  13248. o = 0;
  13249. o < 64;
  13250. o++
  13251. ) {
  13252. var a = _((r[o] * e + 50) / 100);
  13253. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a);
  13254. }
  13255. for (
  13256. var s = [
  13257. 1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961,
  13258. 0.275899379,
  13259. ],
  13260. l = 0,
  13261. c = 0;
  13262. c < 8;
  13263. c++
  13264. )
  13265. for (var h = 0; h < 8; h++)
  13266. (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)),
  13267. (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)),
  13268. l++;
  13269. }
  13270. function n(e, t) {
  13271. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  13272. for (var a = 1; a <= e[o]; a++)
  13273. (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++;
  13274. i *= 2;
  13275. }
  13276. return r;
  13277. }
  13278. function r() {
  13279. (C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K));
  13280. }
  13281. function o() {
  13282. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  13283. for (var n = e; n < t; n++)
  13284. (P[32767 + n] = i),
  13285. (R[32767 + n] = []),
  13286. (R[32767 + n][1] = i),
  13287. (R[32767 + n][0] = n);
  13288. for (var r = -(t - 1); r <= -e; r++)
  13289. (P[32767 + r] = i),
  13290. (R[32767 + r] = []),
  13291. (R[32767 + r][1] = i),
  13292. (R[32767 + r][0] = t - 1 + r);
  13293. (e <<= 1), (t <<= 1);
  13294. }
  13295. }
  13296. function a() {
  13297. for (var e = 0; e < 256; e++)
  13298. (H[e] = 19595 * e),
  13299. (H[(e + 256) >> 0] = 38470 * e),
  13300. (H[(e + 512) >> 0] = 7471 * e + 32768),
  13301. (H[(e + 768) >> 0] = -11059 * e),
  13302. (H[(e + 1024) >> 0] = -21709 * e),
  13303. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  13304. (H[(e + 1536) >> 0] = -27439 * e),
  13305. (H[(e + 1792) >> 0] = -5329 * e);
  13306. }
  13307. function s(e) {
  13308. for (var t = e[0], i = e[1] - 1; i >= 0; )
  13309. t & (1 << i) && (N |= 1 << B),
  13310. i--,
  13311. B--,
  13312. B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0));
  13313. }
  13314. function l(e) {
  13315. D.push(e);
  13316. }
  13317. function c(e) {
  13318. l((e >> 8) & 255), l(255 & e);
  13319. }
  13320. function h(e, t) {
  13321. var i,
  13322. n,
  13323. r,
  13324. o,
  13325. a,
  13326. s,
  13327. l,
  13328. c,
  13329. h,
  13330. u = 0,
  13331. d = 8,
  13332. p = 64;
  13333. for (h = 0; h < d; ++h) {
  13334. (i = e[u]),
  13335. (n = e[u + 1]),
  13336. (r = e[u + 2]),
  13337. (o = e[u + 3]),
  13338. (a = e[u + 4]),
  13339. (s = e[u + 5]),
  13340. (l = e[u + 6]),
  13341. (c = e[u + 7]);
  13342. var f = i + c,
  13343. g = i - c,
  13344. m = n + l,
  13345. v = n - l,
  13346. A = r + s,
  13347. y = r - s,
  13348. C = o + a,
  13349. I = o - a,
  13350. E = f + C,
  13351. b = f - C,
  13352. w = m + A,
  13353. _ = m - A;
  13354. (e[u] = E + w), (e[u + 4] = E - w);
  13355. var T = 0.707106781 * (_ + b);
  13356. (e[u + 2] = b + T), (e[u + 6] = b - T), (E = I + y), (w = y + v), (_ = v + g);
  13357. var x = 0.382683433 * (E - _),
  13358. S = 0.5411961 * E + x,
  13359. M = 1.306562965 * _ + x,
  13360. R = 0.707106781 * w,
  13361. P = g + R,
  13362. L = g - R;
  13363. (e[u + 5] = L + S),
  13364. (e[u + 3] = L - S),
  13365. (e[u + 1] = P + M),
  13366. (e[u + 7] = P - M),
  13367. (u += 8);
  13368. }
  13369. for (u = 0, h = 0; h < d; ++h) {
  13370. (i = e[u]),
  13371. (n = e[u + 8]),
  13372. (r = e[u + 16]),
  13373. (o = e[u + 24]),
  13374. (a = e[u + 32]),
  13375. (s = e[u + 40]),
  13376. (l = e[u + 48]),
  13377. (c = e[u + 56]);
  13378. var D = i + c,
  13379. N = i - c,
  13380. B = n + l,
  13381. F = n - l,
  13382. V = r + s,
  13383. U = r - s,
  13384. k = o + a,
  13385. H = o - a,
  13386. G = D + k,
  13387. z = D - k,
  13388. W = B + V,
  13389. j = B - V;
  13390. (e[u] = G + W), (e[u + 32] = G - W);
  13391. var Y = 0.707106781 * (j + z);
  13392. (e[u + 16] = z + Y), (e[u + 48] = z - Y), (G = H + U), (W = U + F), (j = F + N);
  13393. var X = 0.382683433 * (G - j),
  13394. Z = 0.5411961 * G + X,
  13395. q = 1.306562965 * j + X,
  13396. K = 0.707106781 * W,
  13397. Q = N + K,
  13398. J = N - K;
  13399. (e[u + 40] = J + Z),
  13400. (e[u + 24] = J - Z),
  13401. (e[u + 8] = Q + q),
  13402. (e[u + 56] = Q - q),
  13403. u++;
  13404. }
  13405. var $;
  13406. for (h = 0; h < p; ++h)
  13407. ($ = e[h] * t[h]), (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0);
  13408. return O;
  13409. }
  13410. function u() {
  13411. c(65504),
  13412. c(16),
  13413. l(74),
  13414. l(70),
  13415. l(73),
  13416. l(70),
  13417. l(0),
  13418. l(1),
  13419. l(1),
  13420. l(0),
  13421. c(1),
  13422. c(1),
  13423. l(0),
  13424. l(0);
  13425. }
  13426. function d(e, t) {
  13427. c(65472),
  13428. c(17),
  13429. l(8),
  13430. c(t),
  13431. c(e),
  13432. l(3),
  13433. l(1),
  13434. l(17),
  13435. l(0),
  13436. l(2),
  13437. l(17),
  13438. l(1),
  13439. l(3),
  13440. l(17),
  13441. l(1);
  13442. }
  13443. function p() {
  13444. c(65499), c(132), l(0);
  13445. for (var e = 0; e < 64; e++) l(T[e]);
  13446. l(1);
  13447. for (var t = 0; t < 64; t++) l(x[t]);
  13448. }
  13449. function f() {
  13450. c(65476), c(418), l(0);
  13451. for (var e = 0; e < 16; e++) l(z[e + 1]);
  13452. for (var t = 0; t <= 11; t++) l(W[t]);
  13453. l(16);
  13454. for (var i = 0; i < 16; i++) l(j[i + 1]);
  13455. for (var n = 0; n <= 161; n++) l(Y[n]);
  13456. l(1);
  13457. for (var r = 0; r < 16; r++) l(X[r + 1]);
  13458. for (var o = 0; o <= 11; o++) l(Z[o]);
  13459. l(17);
  13460. for (var a = 0; a < 16; a++) l(q[a + 1]);
  13461. for (var s = 0; s <= 161; s++) l(K[s]);
  13462. }
  13463. function g() {
  13464. c(65498), c(12), l(3), l(1), l(0), l(2), l(17), l(3), l(17), l(0), l(63), l(0);
  13465. }
  13466. function m(e, t, i, n, r) {
  13467. for (
  13468. var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0;
  13469. f < d;
  13470. ++f
  13471. )
  13472. L[G[f]] = p[f];
  13473. var g = L[0] - i;
  13474. (i = L[0]), 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]));
  13475. for (var m = 63; m > 0 && 0 == L[m]; m--);
  13476. if (0 == m) return s(a), i;
  13477. for (var v, A = 1; A <= m; ) {
  13478. for (var y = A; 0 == L[A] && A <= m; ++A);
  13479. var C = A - y;
  13480. if (C >= c) {
  13481. v = C >> 4;
  13482. for (var I = 1; I <= v; ++I) s(l);
  13483. C &= 15;
  13484. }
  13485. (o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++;
  13486. }
  13487. return m != u && s(a), i;
  13488. }
  13489. function v() {
  13490. for (var e = String.fromCharCode, t = 0; t < 256; t++) k[t] = e(t);
  13491. }
  13492. function A(e) {
  13493. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  13494. var t = 0;
  13495. (t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)), i(t), (w = e);
  13496. }
  13497. }
  13498. function y() {
  13499. var e = new Date().getTime();
  13500. t || (t = 50), v(), r(), o(), a(), A(t);
  13501. new Date().getTime() - e;
  13502. }
  13503. var C,
  13504. I,
  13505. E,
  13506. b,
  13507. w,
  13508. _ = (Math.round, Math.floor),
  13509. T = new Array(64),
  13510. x = new Array(64),
  13511. S = new Array(64),
  13512. M = new Array(64),
  13513. R = new Array(65535),
  13514. P = new Array(65535),
  13515. O = new Array(64),
  13516. L = new Array(64),
  13517. D = [],
  13518. N = 0,
  13519. B = 7,
  13520. F = new Array(64),
  13521. V = new Array(64),
  13522. U = new Array(64),
  13523. k = new Array(256),
  13524. H = new Array(2048),
  13525. G = [
  13526. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41,
  13527. 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38,
  13528. 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63,
  13529. ],
  13530. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  13531. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13532. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  13533. Y = [
  13534. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145,
  13535. 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24,
  13536. 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72,
  13537. 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115,
  13538. 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147,
  13539. 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178,
  13540. 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  13541. 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232,
  13542. 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250,
  13543. ],
  13544. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  13545. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13546. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  13547. K = [
  13548. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66,
  13549. 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37,
  13550. 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71,
  13551. 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106,
  13552. 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138,
  13553. 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169,
  13554. 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200,
  13555. 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231,
  13556. 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250,
  13557. ];
  13558. (this.encode = function (t, i) {
  13559. var n = (new Date().getTime(), i.quality);
  13560. n && A(n),
  13561. (D = new Array()),
  13562. (N = 0),
  13563. (B = 7),
  13564. c(65496),
  13565. u(),
  13566. p(),
  13567. d(t.width, t.height),
  13568. f(),
  13569. g();
  13570. var r = 0,
  13571. o = 0,
  13572. a = 0;
  13573. (N = 0), (B = 7), (this.encode.displayName = '_encode_');
  13574. for (
  13575. var l,
  13576. h,
  13577. v,
  13578. y,
  13579. w,
  13580. _,
  13581. T,
  13582. x,
  13583. R,
  13584. P = t.data,
  13585. O = t.width,
  13586. L = t.height,
  13587. k = i.flipY,
  13588. G = 4 * O,
  13589. z = k ? L : 0,
  13590. W = k ? -8 : 8;
  13591. (k && z > 0) || (!k && z < L);
  13592. ) {
  13593. for (l = 0; l < G; ) {
  13594. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  13595. (x = (k ? 63 - R : R) >> 3),
  13596. (T = 4 * (7 & R)),
  13597. (_ = w + x * G + T),
  13598. z + x >= L && (_ -= G * (z + 1 + x - L)),
  13599. l + T >= G && (_ -= l + T - G + 4),
  13600. (h = P[_++]),
  13601. (v = P[_++]),
  13602. (y = P[_++]),
  13603. (F[R] = ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) - 128),
  13604. (V[R] =
  13605. ((H[(h + 768) >> 0] + H[(v + 1024) >> 0] + H[(y + 1280) >> 0]) >> 16) -
  13606. 128),
  13607. (U[R] =
  13608. ((H[(h + 1280) >> 0] + H[(v + 1536) >> 0] + H[(y + 1792) >> 0]) >> 16) -
  13609. 128);
  13610. (r = m(F, S, r, C, E)), (o = m(V, M, o, I, b)), (a = m(U, M, a, I, b)), (l += 32);
  13611. }
  13612. z += W;
  13613. }
  13614. if (B >= 0) {
  13615. var j = [];
  13616. (j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j);
  13617. }
  13618. return c(65497), new e(D);
  13619. }),
  13620. y();
  13621. }
  13622. function n(e, t) {
  13623. (t = t || {}), (t.quality = t.quality || 50);
  13624. var n = t.quality,
  13625. r = new i(n),
  13626. o = r.encode(e, t);
  13627. return {
  13628. data: o,
  13629. width: e.width,
  13630. height: e.height,
  13631. };
  13632. }
  13633. t.exports.encode = n;
  13634. }.call(this, e('buffer').Buffer));
  13635. },
  13636. {
  13637. buffer: 198,
  13638. },
  13639. ],
  13640. 95: [
  13641. function (e, t, i) {
  13642. 'use strict';
  13643. !(function () {
  13644. if (
  13645. ('performance' in window == !1 && (window.performance = {}),
  13646. (Date.now =
  13647. Date.now ||
  13648. function () {
  13649. return new Date().getTime();
  13650. }),
  13651. 'now' in window.performance == !1)
  13652. ) {
  13653. var e = Date.now();
  13654. performance.timing &&
  13655. performance.timing.navigationStart &&
  13656. (e = performance.timing.navigationStart),
  13657. (window.performance.now = function () {
  13658. return Date.now() - e;
  13659. });
  13660. }
  13661. })();
  13662. },
  13663. {},
  13664. ],
  13665. 96: [
  13666. function (e, t, i) {
  13667. 'use strict';
  13668. var n = e('three');
  13669. (n.EffectComposer = function (e, t) {
  13670. if (((this.renderer = e), void 0 === t)) {
  13671. var i = {
  13672. minFilter: n.LinearFilter,
  13673. magFilter: n.LinearFilter,
  13674. format: n.RGBAFormat,
  13675. stencilBuffer: !1,
  13676. },
  13677. r = e.getSize();
  13678. t = new n.WebGLRenderTarget(r.width, r.height, i);
  13679. }
  13680. (this.renderTarget1 = t),
  13681. (this.renderTarget2 = t.clone()),
  13682. (this.writeBuffer = this.renderTarget1),
  13683. (this.readBuffer = this.renderTarget2),
  13684. (this.passes = []),
  13685. void 0 === n.CopyShader &&
  13686. console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  13687. (this.copyPass = new n.ShaderPass(n.CopyShader));
  13688. }),
  13689. (n.EffectComposer.prototype = {
  13690. swapBuffers: function () {
  13691. var e = this.readBuffer;
  13692. (this.readBuffer = this.writeBuffer), (this.writeBuffer = e);
  13693. },
  13694. addPass: function (e) {
  13695. this.passes.push(e);
  13696. },
  13697. insertPass: function (e, t) {
  13698. this.passes.splice(t, 0, e);
  13699. },
  13700. render: function (e) {
  13701. (this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2);
  13702. var t,
  13703. i,
  13704. r = !1,
  13705. o = this.passes.length;
  13706. for (i = 0; i < o; i++)
  13707. if (((t = this.passes[i]), t.enabled)) {
  13708. if (
  13709. (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r), t.needsSwap)
  13710. ) {
  13711. if (r) {
  13712. var a = this.renderer.context;
  13713. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  13714. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  13715. a.stencilFunc(a.EQUAL, 1, 4294967295);
  13716. }
  13717. this.swapBuffers();
  13718. }
  13719. t instanceof n.MaskPass ? (r = !0) : t instanceof n.ClearMaskPass && (r = !1);
  13720. }
  13721. },
  13722. reset: function (e) {
  13723. if (void 0 === e) {
  13724. var t = this.renderer.getSize();
  13725. (e = this.renderTarget1.clone()), e.setSize(t.width, t.height);
  13726. }
  13727. this.renderTarget1.dispose(),
  13728. this.renderTarget2.dispose(),
  13729. (this.renderTarget1 = e),
  13730. (this.renderTarget2 = e.clone()),
  13731. (this.writeBuffer = this.renderTarget1),
  13732. (this.readBuffer = this.renderTarget2);
  13733. },
  13734. setSize: function (e, t) {
  13735. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t);
  13736. this.passes.forEach((a) => {
  13737. //add for TransitionPass
  13738. a.setSize && a.setSize(e, t);
  13739. });
  13740. },
  13741. });
  13742. },
  13743. {
  13744. three: 217,
  13745. },
  13746. ],
  13747. 97: [
  13748. function (e, t, i) {
  13749. 'use strict';
  13750. var n = e('three');
  13751. (n.MaskPass = function (e, t) {
  13752. (this.scene = e),
  13753. (this.camera = t),
  13754. (this.enabled = !0),
  13755. (this.clear = !0),
  13756. (this.needsSwap = !1),
  13757. (this.inverse = !1);
  13758. }),
  13759. (n.MaskPass.prototype = {
  13760. render: function (e, t, i, n) {
  13761. var r = e.context;
  13762. r.colorMask(!1, !1, !1, !1), r.depthMask(!1);
  13763. var o, a;
  13764. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  13765. r.enable(r.STENCIL_TEST),
  13766. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  13767. r.stencilFunc(r.ALWAYS, o, 4294967295),
  13768. r.clearStencil(a),
  13769. e.render(this.scene, this.camera, i, this.clear),
  13770. e.render(this.scene, this.camera, t, this.clear),
  13771. r.colorMask(!0, !0, !0, !0),
  13772. r.depthMask(!0),
  13773. r.stencilFunc(r.EQUAL, 1, 4294967295),
  13774. r.stencilOp(r.KEEP, r.KEEP, r.KEEP);
  13775. },
  13776. }),
  13777. (n.ClearMaskPass = function () {
  13778. this.enabled = !0;
  13779. }),
  13780. (n.ClearMaskPass.prototype = {
  13781. render: function (e, t, i, n) {
  13782. var r = e.context;
  13783. r.disable(r.STENCIL_TEST);
  13784. },
  13785. });
  13786. },
  13787. {
  13788. three: 217,
  13789. },
  13790. ],
  13791. 98: [
  13792. function (e, t, i) {
  13793. 'use strict';
  13794. var n = e('three');
  13795. (n.RenderPass = function (e, t, i, r, o) {
  13796. (this.scene = e),
  13797. (this.camera = t),
  13798. (this.overrideMaterial = i),
  13799. (this.clearColor = r),
  13800. (this.clearAlpha = void 0 !== o ? o : 1),
  13801. (this.oldClearColor = new n.Color()),
  13802. (this.oldClearAlpha = 1),
  13803. (this.enabled = !0),
  13804. (this.clear = !0),
  13805. (this.needsSwap = !1);
  13806. }),
  13807. (n.RenderPass.prototype = {
  13808. render: function (e, t, i, n) {
  13809. (this.scene.overrideMaterial = this.overrideMaterial),
  13810. this.clearColor &&
  13811. (this.oldClearColor.copy(e.getClearColor()),
  13812. (this.oldClearAlpha = e.getClearAlpha()),
  13813. e.setClearColor(this.clearColor, this.clearAlpha)),
  13814. e.render(this.scene, this.camera, i, this.clear),
  13815. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  13816. (this.scene.overrideMaterial = null);
  13817. },
  13818. });
  13819. },
  13820. {
  13821. three: 217,
  13822. },
  13823. ],
  13824. 99: [
  13825. function (e, t, i) {
  13826. 'use strict';
  13827. var n = e('three');
  13828. (n.ShaderPass = function (e, t) {
  13829. (this.textureID = void 0 !== t ? t : 'tDiffuse'),
  13830. e instanceof n.ShaderMaterial
  13831. ? ((this.uniforms = e.uniforms), (this.material = e))
  13832. : e &&
  13833. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  13834. (this.material = new n.ShaderMaterial({
  13835. defines: e.defines || {},
  13836. uniforms: this.uniforms,
  13837. vertexShader: e.vertexShader,
  13838. fragmentShader: e.fragmentShader,
  13839. }))),
  13840. (this.renderToScreen = !1),
  13841. (this.enabled = !0),
  13842. (this.needsSwap = !0),
  13843. (this.clear = !1),
  13844. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  13845. (this.scene = new n.Scene()),
  13846. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  13847. this.scene.add(this.quad);
  13848. }),
  13849. (n.ShaderPass.prototype = {
  13850. render: function (e, t, i, n) {
  13851. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  13852. (this.quad.material = this.material),
  13853. this.renderToScreen
  13854. ? e.render(this.scene, this.camera)
  13855. : e.render(this.scene, this.camera, t, this.clear);
  13856. },
  13857. });
  13858. },
  13859. {
  13860. three: 217,
  13861. },
  13862. ],
  13863. 100: [
  13864. function (e, t, i) {
  13865. 'use strict';
  13866. var n = e('three');
  13867. n.CopyShader = {
  13868. uniforms: {
  13869. tDiffuse: {
  13870. type: 't',
  13871. value: null,
  13872. },
  13873. opacity: {
  13874. type: 'f',
  13875. value: 1,
  13876. },
  13877. },
  13878. vertexShader: [
  13879. 'varying vec2 vUv;',
  13880. 'void main() {',
  13881. 'vUv = uv;',
  13882. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13883. '}',
  13884. ].join('\n'),
  13885. fragmentShader: [
  13886. 'uniform float opacity;',
  13887. 'uniform sampler2D tDiffuse;',
  13888. 'varying vec2 vUv;',
  13889. 'void main() {',
  13890. 'vec4 texel = texture2D( tDiffuse, vUv );',
  13891. 'gl_FragColor = opacity * texel;',
  13892. '}',
  13893. ].join('\n'),
  13894. };
  13895. },
  13896. {
  13897. three: 217,
  13898. },
  13899. ],
  13900. 101: [
  13901. function (e, t, i) {
  13902. 'use strict';
  13903. var n = e('three');
  13904. n.HorizontalBlurShader = {
  13905. uniforms: {
  13906. tDiffuse: {
  13907. type: 't',
  13908. value: null,
  13909. },
  13910. h: {
  13911. type: 'f',
  13912. value: 1 / 512,
  13913. },
  13914. },
  13915. vertexShader: [
  13916. 'varying vec2 vUv;',
  13917. 'void main() {',
  13918. 'vUv = uv;',
  13919. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13920. '}',
  13921. ].join('\n'),
  13922. fragmentShader: [
  13923. 'uniform sampler2D tDiffuse;',
  13924. 'uniform float h;',
  13925. 'varying vec2 vUv;',
  13926. 'void main() {',
  13927. 'vec4 sum = vec4( 0.0 );',
  13928. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  13929. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  13930. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  13931. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  13932. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13933. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  13934. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  13935. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  13936. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  13937. 'gl_FragColor = sum;',
  13938. '}',
  13939. ].join('\n'),
  13940. };
  13941. },
  13942. {
  13943. three: 217,
  13944. },
  13945. ],
  13946. 102: [
  13947. function (e, t, i) {
  13948. 'use strict';
  13949. var n = e('three');
  13950. n.VerticalBlurShader = {
  13951. uniforms: {
  13952. tDiffuse: {
  13953. type: 't',
  13954. value: null,
  13955. },
  13956. v: {
  13957. type: 'f',
  13958. value: 1 / 512,
  13959. },
  13960. },
  13961. vertexShader: [
  13962. 'varying vec2 vUv;',
  13963. 'void main() {',
  13964. 'vUv = uv;',
  13965. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13966. '}',
  13967. ].join('\n'),
  13968. fragmentShader: [
  13969. 'uniform sampler2D tDiffuse;',
  13970. 'uniform float v;',
  13971. 'varying vec2 vUv;',
  13972. 'void main() {',
  13973. 'vec4 sum = vec4( 0.0 );',
  13974. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  13975. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  13976. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  13977. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  13978. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13979. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  13980. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  13981. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  13982. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  13983. 'gl_FragColor = sum;',
  13984. '}',
  13985. ].join('\n'),
  13986. };
  13987. },
  13988. {
  13989. three: 217,
  13990. },
  13991. ],
  13992. 103: [
  13993. function (e, t, i) {
  13994. 'use strict';
  13995. var n = e('three');
  13996. !(function () {
  13997. if (
  13998. ('performance' in window == 0 && (window.performance = {}),
  13999. 'now' in window.performance == 0)
  14000. ) {
  14001. var e = Date.now();
  14002. performance.timing &&
  14003. performance.timing.navigationStart &&
  14004. (e = performance.timing.navigationStart),
  14005. (window.performance.now = function () {
  14006. return Date.now() - e;
  14007. });
  14008. }
  14009. })(),
  14010. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  14011. var t,
  14012. i = this.extensions,
  14013. r = this.context;
  14014. if (e === n.RepeatWrapping) return r.REPEAT;
  14015. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE;
  14016. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT;
  14017. if (e === n.NearestFilter) return r.NEAREST;
  14018. if (e === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST;
  14019. if (e === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR;
  14020. if (e === n.LinearFilter) return r.LINEAR;
  14021. if (e === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST;
  14022. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR;
  14023. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE;
  14024. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4;
  14025. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1;
  14026. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5;
  14027. if (e === n.ByteType) return r.BYTE;
  14028. if (e === n.ShortType) return r.SHORT;
  14029. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT;
  14030. if (e === n.IntType) return r.INT;
  14031. if (e === n.UnsignedIntType) return r.UNSIGNED_INT;
  14032. if (e === n.FloatType) return r.FLOAT;
  14033. if (((t = i.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  14034. return t.HALF_FLOAT_OES;
  14035. if (e === n.AlphaFormat) return r.ALPHA;
  14036. if (e === n.RGBFormat) return r.RGB;
  14037. if (e === n.RGBAFormat) return r.RGBA;
  14038. if (e === n.LuminanceFormat) return r.LUMINANCE;
  14039. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA;
  14040. if (e === n.AddEquation) return r.FUNC_ADD;
  14041. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT;
  14042. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT;
  14043. if (e === n.ZeroFactor) return r.ZERO;
  14044. if (e === n.OneFactor) return r.ONE;
  14045. if (e === n.SrcColorFactor) return r.SRC_COLOR;
  14046. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR;
  14047. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA;
  14048. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA;
  14049. if (e === n.DstAlphaFactor) return r.DST_ALPHA;
  14050. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA;
  14051. if (e === n.DstColorFactor) return r.DST_COLOR;
  14052. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR;
  14053. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE;
  14054. if (((t = i.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  14055. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  14056. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  14057. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  14058. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  14059. }
  14060. if (((t = i.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  14061. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  14062. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  14063. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  14064. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  14065. }
  14066. if (
  14067. ((t = i.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)
  14068. )
  14069. return t.COMPRESSED_RGB_ETC1_WEBGL;
  14070. if (((t = i.get('EXT_blend_minmax')), null !== t)) {
  14071. if (e === n.MinEquation) return t.MIN_EXT;
  14072. if (e === n.MaxEquation) return t.MAX_EXT;
  14073. }
  14074. return 0;
  14075. }),
  14076. (n.WebGLState = function (e, t, i) {
  14077. var r = this,
  14078. o = new n.Vector4(),
  14079. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  14080. s = new Uint8Array(a),
  14081. l = new Uint8Array(a),
  14082. c = new Uint8Array(a),
  14083. h = {},
  14084. u = null,
  14085. d = null,
  14086. p = null,
  14087. f = null,
  14088. g = null,
  14089. m = null,
  14090. v = null,
  14091. A = null,
  14092. y = !1,
  14093. C = null,
  14094. I = null,
  14095. E = null,
  14096. b = null,
  14097. w = null,
  14098. _ = null,
  14099. T = null,
  14100. x = null,
  14101. S = null,
  14102. M = null,
  14103. R = null,
  14104. P = null,
  14105. O = null,
  14106. L = null,
  14107. D = null,
  14108. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  14109. B = void 0,
  14110. F = {},
  14111. V = new n.Vector4(),
  14112. U = null,
  14113. k = null,
  14114. H = new n.Vector4(),
  14115. G = new n.Vector4();
  14116. (this.init = function () {
  14117. this.clearColor(0, 0, 0, 1),
  14118. this.clearDepth(1),
  14119. this.clearStencil(0),
  14120. this.enable(e.DEPTH_TEST),
  14121. e.depthFunc(e.LEQUAL),
  14122. e.frontFace(e.CCW),
  14123. e.cullFace(e.BACK),
  14124. this.enable(e.CULL_FACE),
  14125. this.enable(e.BLEND),
  14126. e.blendEquation(e.FUNC_ADD),
  14127. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  14128. }),
  14129. (this.initAttributes = function () {
  14130. for (var e = 0, t = s.length; e < t; e++) s[e] = 0;
  14131. }),
  14132. (this.enableAttribute = function (i) {
  14133. if (
  14134. ((s[i] = 1), 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)), 0 !== c[i])
  14135. ) {
  14136. var n = t.get('ANGLE_instanced_arrays');
  14137. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0);
  14138. }
  14139. }),
  14140. (this.enableAttributeAndDivisor = function (t, i, n) {
  14141. (s[t] = 1),
  14142. 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)),
  14143. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i));
  14144. }),
  14145. (this.disableUnusedAttributes = function () {
  14146. for (var t = 0, i = l.length; t < i; t++)
  14147. l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  14148. }),
  14149. (this.enable = function (t) {
  14150. h[t] !== !0 && (e.enable(t), (h[t] = !0));
  14151. }),
  14152. (this.disable = function (t) {
  14153. h[t] !== !1 && (e.disable(t), (h[t] = !1));
  14154. }),
  14155. (this.getCompressedTextureFormats = function () {
  14156. if (
  14157. null === u &&
  14158. ((u = []),
  14159. t.get('WEBGL_compressed_texture_pvrtc') ||
  14160. t.get('WEBGL_compressed_texture_s3tc') ||
  14161. t.get('WEBGL_compressed_texture_etc1'))
  14162. )
  14163. for (
  14164. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  14165. n < i.length;
  14166. n++
  14167. )
  14168. u.push(i[n]);
  14169. return u;
  14170. }),
  14171. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  14172. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  14173. (t === d && h === y) ||
  14174. (t === n.AdditiveBlending
  14175. ? h
  14176. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14177. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  14178. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  14179. : t === n.SubtractiveBlending
  14180. ? h
  14181. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14182. e.blendFuncSeparate(
  14183. e.ZERO,
  14184. e.ZERO,
  14185. e.ONE_MINUS_SRC_COLOR,
  14186. e.ONE_MINUS_SRC_ALPHA
  14187. ))
  14188. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  14189. : t === n.MultiplyBlending
  14190. ? h
  14191. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14192. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  14193. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  14194. : h
  14195. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14196. e.blendFuncSeparate(
  14197. e.ONE,
  14198. e.ONE_MINUS_SRC_ALPHA,
  14199. e.ONE,
  14200. e.ONE_MINUS_SRC_ALPHA
  14201. ))
  14202. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14203. e.blendFuncSeparate(
  14204. e.SRC_ALPHA,
  14205. e.ONE_MINUS_SRC_ALPHA,
  14206. e.ONE,
  14207. e.ONE_MINUS_SRC_ALPHA
  14208. )),
  14209. (d = t),
  14210. (y = h)),
  14211. t === n.CustomBlending
  14212. ? ((s = s || r),
  14213. (l = l || o),
  14214. (c = c || a),
  14215. (r === p && s === m) ||
  14216. (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  14217. (o === f && a === g && l === v && c === A) ||
  14218. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  14219. (f = o),
  14220. (g = a),
  14221. (v = l),
  14222. (A = c)))
  14223. : ((p = null), (f = null), (g = null), (m = null), (v = null), (A = null));
  14224. }),
  14225. (this.setDepthFunc = function (t) {
  14226. if (C !== t) {
  14227. if (t)
  14228. switch (t) {
  14229. case n.NeverDepth:
  14230. e.depthFunc(e.NEVER);
  14231. break;
  14232. case n.AlwaysDepth:
  14233. e.depthFunc(e.ALWAYS);
  14234. break;
  14235. case n.LessDepth:
  14236. e.depthFunc(e.LESS);
  14237. break;
  14238. case n.LessEqualDepth:
  14239. e.depthFunc(e.LEQUAL);
  14240. break;
  14241. case n.EqualDepth:
  14242. e.depthFunc(e.EQUAL);
  14243. break;
  14244. case n.GreaterEqualDepth:
  14245. e.depthFunc(e.GEQUAL);
  14246. break;
  14247. case n.GreaterDepth:
  14248. e.depthFunc(e.GREATER);
  14249. break;
  14250. case n.NotEqualDepth:
  14251. e.depthFunc(e.NOTEQUAL);
  14252. break;
  14253. default:
  14254. e.depthFunc(e.LEQUAL);
  14255. }
  14256. else e.depthFunc(e.LEQUAL);
  14257. C = t;
  14258. }
  14259. }),
  14260. (this.setDepthTest = function (t) {
  14261. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  14262. }),
  14263. (this.setDepthWrite = function (t) {
  14264. I !== t && (e.depthMask(t), (I = t));
  14265. }),
  14266. (this.setColorWrite = function (t) {
  14267. E !== t && (e.colorMask(t, t, t, t), (E = t));
  14268. }),
  14269. (this.setStencilFunc = function (t, i, n) {
  14270. (w === t && _ === i && T === n) ||
  14271. (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n));
  14272. }),
  14273. (this.setStencilOp = function (t, i, n) {
  14274. (x === t && S === i && M === n) ||
  14275. (e.stencilOp(t, i, n), (x = t), (S = i), (M = n));
  14276. }),
  14277. (this.setStencilTest = function (t) {
  14278. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  14279. }),
  14280. (this.setStencilWrite = function (t) {
  14281. b !== t && (e.stencilMask(t), (b = t));
  14282. }),
  14283. (this.setFlipSided = function (t) {
  14284. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t));
  14285. }),
  14286. (this.setLineWidth = function (t) {
  14287. t !== P && (e.lineWidth(t), (P = t));
  14288. }),
  14289. (this.setPolygonOffset = function (t, i, n) {
  14290. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  14291. !t || (O === i && L === n) || (e.polygonOffset(i, n), (O = i), (L = n));
  14292. }),
  14293. (this.getScissorTest = function () {
  14294. return D;
  14295. }),
  14296. (this.setScissorTest = function (t) {
  14297. (D = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST);
  14298. }),
  14299. (this.activeTexture = function (t) {
  14300. void 0 === t && (t = e.TEXTURE0 + N - 1), B !== t && (e.activeTexture(t), (B = t));
  14301. }),
  14302. (this.bindTexture = function (t, i) {
  14303. void 0 === B && r.activeTexture();
  14304. var n = F[B];
  14305. void 0 === n &&
  14306. ((n = {
  14307. type: void 0,
  14308. texture: void 0,
  14309. }),
  14310. (F[B] = n)),
  14311. (n.type === t && n.texture === i) ||
  14312. (e.bindTexture(t, i), (n.type = t), (n.texture = i));
  14313. }),
  14314. (this.compressedTexImage2D = function () {
  14315. try {
  14316. e.compressedTexImage2D.apply(e, arguments);
  14317. } catch (e) {
  14318. console.error(e);
  14319. }
  14320. }),
  14321. (this.texImage2D = function () {
  14322. try {
  14323. e.texImage2D.apply(e, arguments);
  14324. } catch (e) {
  14325. console.error(e);
  14326. }
  14327. }),
  14328. (this.clearColor = function (t, i, n, r) {
  14329. o.set(t, i, n, r), V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o));
  14330. }),
  14331. (this.clearDepth = function (t) {
  14332. U !== t && (e.clearDepth(t), (U = t));
  14333. }),
  14334. (this.clearStencil = function (t) {
  14335. k !== t && (e.clearStencil(t), (k = t));
  14336. }),
  14337. (this.scissor = function (t) {
  14338. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), H.copy(t));
  14339. }),
  14340. (this.viewport = function (t) {
  14341. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), G.copy(t));
  14342. }),
  14343. (this.reset = function () {
  14344. for (var t = 0; t < l.length; t++)
  14345. 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0));
  14346. (h = {}),
  14347. (u = null),
  14348. (B = void 0),
  14349. (F = {}),
  14350. (d = null),
  14351. (E = null),
  14352. (I = null),
  14353. (b = null),
  14354. (R = null);
  14355. });
  14356. });
  14357. },
  14358. {
  14359. three: 217,
  14360. },
  14361. ],
  14362. 104: [
  14363. function (e, t, i) {
  14364. (function (i, n) {
  14365. 'use strict';
  14366. function r(e) {
  14367. this.urls = e;
  14368. var t = i(
  14369. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  14370. 'base64'
  14371. );
  14372. (this.builder = a.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'));
  14373. }
  14374. var o = e('three'),
  14375. a = e('protobufjs'),
  14376. s = e('../util/logger'),
  14377. l = (e('../util/common'), e('../util/ajax')),
  14378. c = e('../objects/Chunk'),
  14379. h = new s(n);
  14380. (r.prototype = {
  14381. constructor: r,
  14382. load: function (e, t, i, n) {
  14383. return (
  14384. h.time('download'),
  14385. l
  14386. .get(e, {
  14387. responseType: 'arraybuffer',
  14388. })
  14389. .done(
  14390. function (r) {
  14391. h.timeEnd('download'), this.parse(r, e, t, i, n);
  14392. }.bind(this)
  14393. )
  14394. .fail(n)
  14395. );
  14396. },
  14397. parse: function (e, t, i, n, r) {
  14398. var o = this.readProtobuf(e);
  14399. if (!o) return r();
  14400. try {
  14401. h.time('convert to webgl'),
  14402. this.convertProtobufToSceneObject(o, t, i, n, r),
  14403. h.timeEnd('convert to webgl');
  14404. } catch (e) {
  14405. return h.error('failed parsing .dam'), h.error(e.message), r();
  14406. }
  14407. },
  14408. readProtobuf: function (e) {
  14409. var t;
  14410. try {
  14411. h.time('parse proto'), (t = this.decoder.decode(e)), h.timeEnd('parse proto');
  14412. } catch (e) {
  14413. return h.error('failed parsing proto for .dam'), h.error(e.message), null;
  14414. }
  14415. return t;
  14416. },
  14417. convertProtobufToSceneObject: function (e, t, i, n, r) {
  14418. function a(e) {
  14419. var i = new o.BufferGeometry();
  14420. return (
  14421. i.addAttribute(
  14422. 'position',
  14423. new o.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)
  14424. ),
  14425. e.vertices.uv.length > 0 &&
  14426. i.addAttribute(
  14427. 'uv',
  14428. new o.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)
  14429. ),
  14430. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  14431. i.applyMatrix(s),
  14432. i.computeBoundingBox(),
  14433. new c({
  14434. geometry: i,
  14435. textureName: e.material_name,
  14436. name: e.chunk_name,
  14437. meshUrl: t,
  14438. })
  14439. );
  14440. }
  14441. if (0 === e.chunk.length) return h.warn('No chunks in damfile...'), i([]);
  14442. var s = new o.Matrix4();
  14443. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  14444. var l = e.chunk.map(a);
  14445. return l ? i(l) : (h.error('.dam protobuf came out with no chunks...'), r());
  14446. },
  14447. }),
  14448. (t.exports = r);
  14449. }.call(this, e('buffer').Buffer, '/js/loaders/DamLoader.js'));
  14450. },
  14451. {
  14452. '../objects/Chunk': 144,
  14453. '../util/ajax': 181,
  14454. '../util/common': 185,
  14455. '../util/logger': 189,
  14456. buffer: 198,
  14457. protobufjs: 214,
  14458. three: 217,
  14459. },
  14460. ],
  14461. 105: [
  14462. function (e, t, i) {
  14463. (function (i) {
  14464. 'use strict';
  14465. var n = (e('three'), e('../settings'), e('../util/browser'), e('./DamLoader')),
  14466. r = e('../util/logger'),
  14467. o = (e('../ab'), new r(i));
  14468. t.exports = {
  14469. getLoaders: function () {
  14470. return [
  14471. ['_50k', '.dam', n],
  14472. ['', '.dam', n],
  14473. ];
  14474. },
  14475. load: function (e, t, i, n, r, a) {
  14476. var s = this.getLoaders();
  14477. a = a || 0;
  14478. var l = s[a];
  14479. if (!l) return void (r && r('No suitable model file found...'));
  14480. var c = l[0],
  14481. h = l[1],
  14482. u = new l[2](t),
  14483. d = t.get(e + c + h);
  14484. d
  14485. ? (o.debug('Trying ' + c + h),
  14486. u.load(
  14487. d,
  14488. i,
  14489. n,
  14490. function () {
  14491. this.load(e, t, i, n, r, ++a);
  14492. }.bind(this)
  14493. ))
  14494. : (o.debug('Skipping ' + h + ', not available'), this.load(e, t, i, n, r, ++a));
  14495. },
  14496. };
  14497. }.call(this, '/js/loaders/ModelLoader.js'));
  14498. },
  14499. {
  14500. '../ab': 3,
  14501. '../settings': 166,
  14502. '../util/browser': 182,
  14503. '../util/logger': 189,
  14504. './DamLoader': 104,
  14505. three: 217,
  14506. },
  14507. ],
  14508. 106: [
  14509. function (e, t, i) {
  14510. (function (i) {
  14511. 'use strict';
  14512. var n = e('../util/common'),
  14513. r = e('../util/texture'),
  14514. o = e('../util/browser'),
  14515. a = e('../util/logger'),
  14516. s = e('../settings'),
  14517. l = new a(i);
  14518. t.exports = {
  14519. load: function (e, t) {
  14520. function i(e, i) {
  14521. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve());
  14522. }
  14523. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when();
  14524. var a = n.countUnique(
  14525. e.chunks.map(function (e) {
  14526. return e.textureName;
  14527. })
  14528. ),
  14529. c = e.chunks[0].meshUrl.indexOf('_50k') !== -1 ? '_50k' : '',
  14530. h = '_50k' === c ? 'high' : 'low';
  14531. s.minimalMemoryMode &&
  14532. 'high' === h &&
  14533. (o.detectSamsungS6()
  14534. ? (l.warn('Galaxy S6 cannot handle large textures, turning down quality.'),
  14535. (h = 'low'))
  14536. : a > s.maxMobileTextures &&
  14537. (l.warn('Model probably too large for mobile, turning down quality.'),
  14538. (h = 'low')));
  14539. var u = e.data.job.uuid + c + '_texture_jpg_' + h + '/',
  14540. d = $.Deferred(),
  14541. p = 0;
  14542. return (
  14543. e.chunks.forEach(function (t) {
  14544. if (!t.material.map && t.textureName) {
  14545. var n = e.urls.get(u + t.textureName);
  14546. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))));
  14547. }
  14548. }),
  14549. d.promise()
  14550. );
  14551. },
  14552. };
  14553. }.call(this, '/js/loaders/ModelTextureLoader.js'));
  14554. },
  14555. {
  14556. '../settings': 166,
  14557. '../util/browser': 182,
  14558. '../util/common': 185,
  14559. '../util/logger': 189,
  14560. '../util/texture': 194,
  14561. },
  14562. ],
  14563. 107: [
  14564. function (e, t, i) {
  14565. (function (i, n) {
  14566. 'use strict';
  14567. function r(e) {
  14568. (this.model = e),
  14569. (this.modelDataPath =
  14570. this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()),
  14571. (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'));
  14572. var t = i(
  14573. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  14574. 'base64'
  14575. ),
  14576. n = o.loadProto(t);
  14577. this.decoder = n.build('VisionModeldata');
  14578. }
  14579. var o = e('protobufjs'),
  14580. a = e('../util/ajax'),
  14581. s = (e('../util/common'), e('../util/math')),
  14582. l = e('../util/logger'),
  14583. c = new l(n);
  14584. (r.prototype.load = function () {
  14585. return this.modelDataPath
  14586. ? (c.info('Using vision.modeldata'), this.loadVisionModelData())
  14587. : this.sweepLocationsPath
  14588. ? (c.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  14589. : (c.warn('No sweep file found'), $.when([]));
  14590. }),
  14591. (r.prototype.loadVisionModelData = function () {
  14592. return a
  14593. .get(this.modelDataPath, {
  14594. responseType: 'arraybuffer',
  14595. })
  14596. .then(
  14597. function (e) {
  14598. var t;
  14599. try {
  14600. t = this.decoder.decode(e);
  14601. } catch (e) {
  14602. return (
  14603. c.warn('Could not decode vision.modeldata, trying sweep_locations.csv'),
  14604. this.loadSweepLocationsCSV()
  14605. );
  14606. }
  14607. var i = t.sweepLocations
  14608. .map(function (e) {
  14609. return {
  14610. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  14611. position: {
  14612. x: e.pose.translation.x,
  14613. y: e.pose.translation.y,
  14614. z: e.pose.translation.z,
  14615. },
  14616. quaternion: {
  14617. x: e.pose.rotation.x,
  14618. y: e.pose.rotation.y,
  14619. z: e.pose.rotation.z,
  14620. w: e.pose.rotation.w,
  14621. },
  14622. puck: {
  14623. x: e.puck.x,
  14624. y: e.puck.y,
  14625. z: e.puck.z,
  14626. },
  14627. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  14628. neighbours: e.visibles,
  14629. alignmentType: e.alignment_type,
  14630. };
  14631. })
  14632. .map(function (e) {
  14633. return (
  14634. (e.position = s.convertVisionVector(e.position)),
  14635. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14636. (e.puck = s.convertVisionVector(e.puck)),
  14637. e
  14638. );
  14639. });
  14640. return (
  14641. i.forEach(function (e) {
  14642. e.neighbours = e.neighbours.map(function (e) {
  14643. return i[e].uuid;
  14644. });
  14645. }),
  14646. i
  14647. );
  14648. }.bind(this),
  14649. function () {
  14650. return (
  14651. c.warn('Could not load vision.modeldata, trying sweep_locations.csv'),
  14652. this.loadSweepLocationsCSV()
  14653. );
  14654. }.bind(this)
  14655. );
  14656. }),
  14657. (r.prototype.loadSweepLocationsCSV = function () {
  14658. return a
  14659. .get(this.sweepLocationsPath)
  14660. .then(function (e) {
  14661. var t = e
  14662. .split('\n')
  14663. .map(function (e) {
  14664. return e.split(', ');
  14665. })
  14666. .filter(function (e) {
  14667. return e.length > 1;
  14668. })
  14669. .map(function (e) {
  14670. return {
  14671. uuid: e[0],
  14672. position: {
  14673. x: parseFloat(e[1]),
  14674. y: parseFloat(e[2]),
  14675. z: parseFloat(e[3]),
  14676. },
  14677. quaternion: {
  14678. x: parseFloat(e[4]),
  14679. y: parseFloat(e[5]),
  14680. z: parseFloat(e[6]),
  14681. w: parseFloat(e[7]),
  14682. },
  14683. };
  14684. })
  14685. .map(function (e) {
  14686. return (
  14687. (e.position = s.convertVisionVector(e.position)),
  14688. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14689. e
  14690. );
  14691. });
  14692. return t;
  14693. })
  14694. .fail(function () {
  14695. c.warn('Could not load sweep_locations.csv, no sweeps loaded.');
  14696. });
  14697. }),
  14698. (t.exports = r);
  14699. }.call(this, e('buffer').Buffer, '/js/loaders/SweepDataLoader.js'));
  14700. },
  14701. {
  14702. '../util/ajax': 181,
  14703. '../util/common': 185,
  14704. '../util/logger': 189,
  14705. '../util/math': 190,
  14706. buffer: 198,
  14707. protobufjs: 214,
  14708. },
  14709. ],
  14710. 108: [
  14711. function (e, t, i) {
  14712. (function (i) {
  14713. 'use strict';
  14714. function n() {
  14715. this.locale = null;
  14716. }
  14717. var r = e('../settings'),
  14718. o = e('../util/common'),
  14719. a = e('../util/logger'),
  14720. s = e('../enum/Locale'),
  14721. l = new a(i);
  14722. (n.prototype.init = function () {
  14723. var t;
  14724. switch (r.languageTag) {
  14725. case null:
  14726. case 'en':
  14727. case s.EN_US:
  14728. (this.locale = s.EN_US), (t = e('./strings-en-US'));
  14729. break;
  14730. case 'es':
  14731. case s.ES_MX:
  14732. (this.locale = s.ES_MX), (t = e('./strings-es-MX'));
  14733. break;
  14734. case 'fr':
  14735. case s.FR_FR:
  14736. (this.locale = s.FR_FR), (t = e('./strings-fr-FR'));
  14737. break;
  14738. case 'de':
  14739. case s.DE_DE:
  14740. (this.locale = s.DE_DE), (t = e('./strings-de-DE'));
  14741. break;
  14742. case 'ru':
  14743. case s.RU_RU:
  14744. (this.locale = s.RU_RU), (t = e('./strings-ru-RU'));
  14745. break;
  14746. case 'cn':
  14747. case s.CN_CN:
  14748. (this.locale = s.CN_CN), (t = e('./strings-cn-CN'));
  14749. break;
  14750. case 'jp':
  14751. case s.JP_JP:
  14752. (this.locale = s.JP_JP), (t = e('./strings-jp-JP'));
  14753. break;
  14754. default:
  14755. l.info("Unsupported language tag, defaulting to 'en-US'"),
  14756. (this.locale = s.EN_US),
  14757. (t = e('./strings-en-US'));
  14758. }
  14759. l.info("Using locale '" + this.locale + "'"), o.extendObject(this, t);
  14760. }),
  14761. (n.prototype.localizeGUI = function () {
  14762. var e = document.querySelector('#gui-parent');
  14763. this.localizeTree(e), this.localizeLoadingText();
  14764. }),
  14765. (n.prototype.localizeLoadingText = function () {
  14766. // var e = document.querySelector("#loader-cont")
  14767. // , t = e.getAttribute("title");
  14768. // e.removeAttribute("title"),
  14769. // e.setAttribute("data-status", t),
  14770. // e.classList.add(this.locale),
  14771. document.querySelector('#help-dialog').classList.add(this.locale),
  14772. document.querySelector('#interaction-modal').classList.add(this.locale),
  14773. document.querySelector('#gui').classList.add(this.locale);
  14774. }),
  14775. (n.prototype.localizeTree = function (e) {
  14776. var t,
  14777. i,
  14778. n = /{\[{ ?(\w+) ?}\]}/;
  14779. if (e.nodeType === Node.TEXT_NODE)
  14780. (t = e.data.match(n)), t && ((i = t[1]), (e.data = this.localizeText(i) || i));
  14781. else if (e.nodeType === Node.ELEMENT_NODE) {
  14782. var r = e.getAttribute('title');
  14783. r &&
  14784. ((t = r.match(n)),
  14785. t && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i)));
  14786. }
  14787. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling);
  14788. }),
  14789. (n.prototype.localizeText = function (t) {
  14790. var i = this[t];
  14791. return (
  14792. i ||
  14793. this.locale === s.EN_US ||
  14794. (l.warn(
  14795. "Localization key '" +
  14796. t +
  14797. "' not available for locale '" +
  14798. this.locale +
  14799. "', defaulting to English."
  14800. ),
  14801. (i = e('./strings-en-US')[t])),
  14802. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  14803. i
  14804. );
  14805. }),
  14806. (t.exports = new n());
  14807. }.call(this, '/js/localization/localize.js'));
  14808. },
  14809. {
  14810. '../enum/Locale': 31,
  14811. '../settings': 166,
  14812. '../util/common': 185,
  14813. '../util/logger': 189,
  14814. './strings-cn-CN': 109,
  14815. './strings-de-DE': 110,
  14816. './strings-en-US': 111,
  14817. './strings-es-MX': 112,
  14818. './strings-fr-FR': 113,
  14819. './strings-jp-JP': 114,
  14820. './strings-ru-RU': 115,
  14821. },
  14822. ],
  14823. 109: [
  14824. function (e, t, i) {
  14825. 'use strict';
  14826. t.exports = {
  14827. PAGE_TITLE: '',
  14828. LOADING: '正在加载',
  14829. PRESENTED_BY_CAPS: '呈现者:',
  14830. POWERED_BY: '技术支持:',
  14831. POWERED_BY_CAPS: '技术支持:',
  14832. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14833. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14834. PRESENTED_BY: '呈现者:',
  14835. MORE: '更多 ',
  14836. LESS: '更少 ',
  14837. TAG_CONTENT: 'tag™ 内容',
  14838. SHOW: '显示',
  14839. HIDE: '隐藏',
  14840. DOLLHOUSE: '场景屋',
  14841. FLOOR_PLAN: '楼层平面图',
  14842. OPEN_HIGHLIGHTS: '打开精彩片段',
  14843. CLOSE_HIGHLIGHTS: '关闭',
  14844. PREVIOUS: '上一个',
  14845. PLAY: '播放',
  14846. PAUSE: '暂停',
  14847. NEXT: '下一个',
  14848. EXPLORE_3D_SPACE: '探索 3D 空间',
  14849. VIEW_DOLLHOUSE: '观看场景屋',
  14850. SOCIAL_SHARING: '分享这个空间',
  14851. VIEW_IN_VR: '以 VR 观看',
  14852. VIEW_FULLSCREEN: '全屏观看',
  14853. EXIT_FULLSCREEN: ' 退出全屏',
  14854. ZOOM_IN: '放大',
  14855. ZOOM_OUT: '缩小',
  14856. FLOOR_NAME: '楼层',
  14857. FLOOR_ALL: 'ALL',
  14858. FLOOR_Lang: ['Floor', ''],
  14859. TERMS: '条款',
  14860. PORT_TERMS: 'port 条款',
  14861. TERMS_OF_USE: '使用条款',
  14862. CLOSE_TERMS: '关闭',
  14863. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  14864. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  14865. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  14866. WEBVR_ENTER_WEBVR: '进入 VR',
  14867. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  14868. WEBVR_LEARN_MORE: '了解更多',
  14869. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  14870. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  14871. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14872. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  14873. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  14874. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  14875. VR_LEARN_MORE_CAPS: '了解更多',
  14876. VR_PREVIOUS_CAPS: '上一个’,',
  14877. VR_NEXT_CAPS: '下一个',
  14878. VR_GOT_IT_CAPS: '明白了',
  14879. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  14880. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  14881. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  14882. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  14883. VR_WHAT_YOU_NEED: '关于...您需要什么',
  14884. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  14885. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  14886. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  14887. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14888. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14889. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14890. VR_APP: 'port VR 应用程序',
  14891. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14892. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14893. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  14894. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  14895. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  14896. VR_COMPATIBLE_ANDROID_LONG:
  14897. '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  14898. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  14899. VR_ANDROID_DVICES: 'Android 设备',
  14900. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  14901. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  14902. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  14903. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  14904. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  14905. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  14906. VR_DOWNLOAD_HERE: '在此下载',
  14907. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  14908. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  14909. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  14910. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  14911. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  14912. SHARE_TO: '分享到',
  14913. SHARE_LINK: '直接链接',
  14914. SHARE_EXPLORE: '探索',
  14915. SHARE_AT: '在',
  14916. SHARE_WITH: '使用',
  14917. SHARE_3D: '以 3D',
  14918. SHARE_COPIED: '已复制!',
  14919. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  14920. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  14921. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  14922. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  14923. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  14924. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  14925. ERROR_GENERIC_ACTIONS_3: ' 或',
  14926. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  14927. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  14928. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  14929. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  14930. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  14931. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  14932. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  14933. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  14934. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  14935. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  14936. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  14937. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  14938. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  14939. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  14940. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  14941. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  14942. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  14943. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  14944. LINK_TO_LOCATION: '地点链接',
  14945. MENU_COPY: '复制',
  14946. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  14947. ROTATE: '旋转',
  14948. MOVE: '移动',
  14949. INSIDE: '内部',
  14950. ZOOM: '缩放',
  14951. HELP: '小帮手',
  14952. HELP_NAVIGATION_TAB: '导航',
  14953. HELP_MORE_HELP_TAB: '更多帮助',
  14954. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  14955. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  14956. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  14957. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  14958. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  14959. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  14960. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  14961. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  14962. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  14963. HELP_DESKTOP_DOLLHOUSE_2A:
  14964. '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  14965. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  14966. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  14967. HELP_DESKTOP_FLOORPLAN_1A:
  14968. '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  14969. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  14970. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  14971. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  14972. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  14973. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  14974. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  14975. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  14976. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  14977. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  14978. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  14979. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  14980. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  14981. HELP_MORE_HLR_A: '精彩片段集锦',
  14982. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  14983. HELP_MORE_DOLLHOUSE_A: '场景屋',
  14984. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  14985. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  14986. HELP_MORE_FLOORS_A: '楼层选择器',
  14987. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  14988. HELP_MORE_TAG_A: 'tag™ 贴文',
  14989. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  14990. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  14991. HELP_MORE_ZOOM_A: '缩放控件',
  14992. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  14993. HELP_MORE_TOUR_A: '导览控件',
  14994. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  14995. HELP_MORE_INSIDE_A: '内部视图',
  14996. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  14997. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  14998. HELP_MORE_VR_A: 'VR 模式',
  14999. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  15000. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  15001. HELP_MORE_360_A: '360° 视图',
  15002. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  15003. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  15004. HELP_MORE_FULLSCREEN_A: '全屏',
  15005. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  15006. CLOSE: '关闭',
  15007. };
  15008. },
  15009. {},
  15010. ],
  15011. 110: [
  15012. function (e, t, i) {
  15013. 'use strict';
  15014. t.exports = {
  15015. PAGE_TITLE: '',
  15016. LOADING: 'Lädt',
  15017. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  15018. POWERED_BY: 'Angetrieben von',
  15019. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  15020. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15021. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15022. PRESENTED_BY: 'Präsentiert von ',
  15023. MORE: 'Mehr ',
  15024. LESS: 'Weniger ',
  15025. TAG_CONTENT: 'tag™ Inhalt',
  15026. SHOW: 'Anzeigen',
  15027. HIDE: 'Verbergen',
  15028. DOLLHOUSE: 'Puppenhaus',
  15029. FLOOR_PLAN: 'Grundriss',
  15030. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  15031. CLOSE_HIGHLIGHTS: 'Schließen',
  15032. PREVIOUS: 'Vorheriges',
  15033. PLAY: 'Abspielen',
  15034. PAUSE: 'Pausieren',
  15035. NEXT: 'Nächstes',
  15036. EXPLORE_3D_SPACE: 'Innenraum betreten',
  15037. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  15038. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  15039. VIEW_IN_VR: 'In VR ansehen',
  15040. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  15041. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  15042. ZOOM_IN: 'Vergrößern',
  15043. ZOOM_OUT: 'Verkleinern',
  15044. FLOOR_NAME: 'Etage ',
  15045. FLOOR_ALL: 'Alle',
  15046. TERMS: 'Bedingungen',
  15047. PORT_TERMS: 'port Bedingungen',
  15048. TERMS_OF_USE: 'Nutzungsbedingungen',
  15049. TERMS_TEXT_FILE: 'terms-de-DE.html',
  15050. CLOSE_TERMS: 'Schließen',
  15051. TERMS_FAIL:
  15052. 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  15053. HELP: 'Hilfe',
  15054. HELP_NAVIGATION_TAB: 'Navigation',
  15055. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  15056. CLOSE: 'Schließen',
  15057. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  15058. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  15059. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15060. HELP_DESKTOP_PANORAMA_1B:
  15061. 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  15062. HELP_DESKTOP_PANORAMA_2B:
  15063. 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  15064. HELP_DESKTOP_PANORAMA_3B:
  15065. 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  15066. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  15067. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  15068. HELP_DESKTOP_DOLLHOUSE_1A:
  15069. 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  15070. HELP_DESKTOP_DOLLHOUSE_2A:
  15071. 'Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.',
  15072. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15073. HELP_DESKTOP_DOLLHOUSE_1B:
  15074. 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  15075. HELP_DESKTOP_FLOORPLAN_1A:
  15076. 'Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.',
  15077. HELP_DESKTOP_FLOORPLAN_2A:
  15078. 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  15079. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15080. HELP_DESKTOP_FLOORPLAN_2B:
  15081. 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  15082. HELP_DESKTOP_FLOORPLAN_3B:
  15083. 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  15084. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  15085. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  15086. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  15087. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  15088. HELP_MOBILE_DOLLHOUSE_1:
  15089. 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  15090. HELP_MOBILE_DOLLHOUSE_2:
  15091. 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  15092. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  15093. HELP_MOBILE_FLOORPLAN_2:
  15094. 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  15095. HELP_MORE_HLR_A: 'Liste das Highlight',
  15096. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  15097. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  15098. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15099. 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15100. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15101. 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15102. HELP_MORE_FLOORS_A: 'Etage auswählen',
  15103. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  15104. HELP_MORE_TAG_A: 'tag™ Posts',
  15105. HELP_DESKTOP_MORE_TAG_B:
  15106. 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  15107. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  15108. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  15109. HELP_DESKTOP_MORE_ZOOM_B:
  15110. 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  15111. HELP_MORE_TOUR_A: 'Tour Steuerung',
  15112. HELP_DESKTOP_MORE_TOUR_B:
  15113. 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  15114. HELP_MORE_INSIDE_A: 'Innenansicht',
  15115. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  15116. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  15117. HELP_MORE_VR_A: 'VR Modus',
  15118. HELP_DESKTOP_MORE_VR_B:
  15119. 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  15120. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  15121. HELP_MORE_360_A: '360° Views Ansicht ',
  15122. HELP_DESKTOP_MORE_360_B:
  15123. 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15124. HELP_MOBILE_MORE_360_B:
  15125. 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15126. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  15127. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  15128. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  15129. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  15130. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  15131. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  15132. WEBVR_LEARN_MORE: 'Mehr Infos',
  15133. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15134. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15135. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15136. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  15137. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  15138. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15139. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15140. VR_APP: 'port VR App',
  15141. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  15142. VR_COMPATIBLE_ANDROID_LONG:
  15143. 'Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15144. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  15145. VR_APP_FOR_ANDROID: 'port VR app für Android',
  15146. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  15147. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15148. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  15149. VR_PREVIOUS_CAPS: 'ZURÜCK',
  15150. VR_NEXT_CAPS: 'WEITER',
  15151. VR_GOT_IT_CAPS: 'VERSTANDEN',
  15152. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  15153. VR_SHOW_UNSUPPORTED:
  15154. 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  15155. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  15156. VR_SHOW_IOS_2:
  15157. 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  15158. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  15159. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  15160. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15161. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15162. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15163. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  15164. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  15165. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  15166. VR_ANDROID_DETAIL:
  15167. 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15168. VR_ANDROID_DVICES: 'Android Geräte',
  15169. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  15170. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  15171. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  15172. VR_DOWNLOAD_HERE: 'Hier runterladen',
  15173. VR_REQUIRE_HEADSET:
  15174. 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  15175. VR_REDIRECT_TO_STORE:
  15176. 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  15177. VR_IMPROPER_EMBED:
  15178. 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  15179. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  15180. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  15181. SHARE_TO: 'Teilen auf',
  15182. SHARE_LINK: 'Direkter Link',
  15183. SHARE_EXPLORE: 'Umsehen',
  15184. SHARE_AT: 'auf',
  15185. SHARE_WITH: 'mit',
  15186. SHARE_3D: 'in 3D',
  15187. SHARE_COPIED: 'Kopiert!',
  15188. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  15189. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  15190. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  15191. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  15192. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15193. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  15194. ERROR_GENERIC_ACTIONS_3: ' oder ',
  15195. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15196. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  15197. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  15198. ERROR_WEBGL_IOS_SOLUTION:
  15199. 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  15200. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  15201. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  15202. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  15203. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  15204. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  15205. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  15206. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  15207. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  15208. ERROR_MISSING_URLS_EXPLANATION:
  15209. 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  15210. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  15211. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15212. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15213. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  15214. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  15215. LINK_TO_LOCATION: 'Link zu',
  15216. MENU_COPY: 'Kopieren',
  15217. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  15218. ROTATE: 'Drehen',
  15219. INSIDE: 'Drinnen',
  15220. MOVE: 'Bewegen',
  15221. ZOOM: 'Vergrößern',
  15222. };
  15223. },
  15224. {},
  15225. ],
  15226. 111: [
  15227. function (e, t, i) {
  15228. 'use strict';
  15229. t.exports = {
  15230. PAGE_TITLE: '',
  15231. LOADING: 'Loading',
  15232. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15233. POWERED_BY: 'powered by ',
  15234. POWERED_BY_CAPS: 'POWERED BY',
  15235. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  15236. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  15237. PRESENTED_BY: 'Presented by ',
  15238. MORE: 'More ',
  15239. LESS: 'Less ',
  15240. TAG_CONTENT: 'tag™ Content',
  15241. SHOW: 'Show',
  15242. HIDE: 'Hide',
  15243. DOLLHOUSE: 'Dollhouse',
  15244. FLOOR_PLAN: 'Floor plan',
  15245. OPEN_HIGHLIGHTS: 'Open Highlights',
  15246. CLOSE_HIGHLIGHTS: 'Close',
  15247. PREVIOUS: 'Previous',
  15248. PLAY: 'Play',
  15249. PAUSE: 'Pause',
  15250. NEXT: 'Next',
  15251. EXPLORE_3D_SPACE: 'Explore 3D Space',
  15252. VIEW_DOLLHOUSE: 'View dollhouse',
  15253. SOCIAL_SHARING: 'Share this Space',
  15254. VIEW_IN_VR: 'View in VR',
  15255. VIEW_FULLSCREEN: '全屏',
  15256. EXIT_FULLSCREEN: '退出全屏',
  15257. ZOOM_IN: 'Zoom in',
  15258. ZOOM_OUT: 'Zoom out',
  15259. FLOOR_NAME: 'Floor ',
  15260. FLOOR_ALL: '全部',
  15261. TERMS: 'Terms',
  15262. PORT_TERMS: 'port terms',
  15263. TERMS_OF_USE: 'Terms of Use',
  15264. TERMS_TEXT_FILE: 'terms-en-US.html',
  15265. CLOSE_TERMS: 'Close',
  15266. TERMS_FAIL:
  15267. 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  15268. HELP: 'Help',
  15269. HELP_NAVIGATION_TAB: 'Navigation',
  15270. HELP_MORE_HELP_TAB: 'More Help',
  15271. CLOSE: 'Close',
  15272. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  15273. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  15274. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  15275. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  15276. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  15277. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  15278. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  15279. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  15280. HELP_DESKTOP_DOLLHOUSE_1A:
  15281. 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  15282. HELP_DESKTOP_DOLLHOUSE_2A:
  15283. 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  15284. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  15285. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  15286. HELP_DESKTOP_FLOORPLAN_1A:
  15287. 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  15288. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  15289. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  15290. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  15291. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  15292. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  15293. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  15294. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  15295. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  15296. HELP_MOBILE_DOLLHOUSE_1:
  15297. 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  15298. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  15299. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  15300. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  15301. HELP_MORE_HLR_A: 'Highlight Reel',
  15302. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  15303. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  15304. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15305. 'Click to view and rotate a top-down view of the entire Space in 3D.',
  15306. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15307. 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  15308. HELP_MORE_FLOORS_A: 'Floor Selector',
  15309. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  15310. HELP_MORE_TAG_A: 'tag™ Posts',
  15311. HELP_DESKTOP_MORE_TAG_B:
  15312. 'Click or hover over for information about features in the Space.',
  15313. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  15314. HELP_MORE_ZOOM_A: 'Zoom Controls',
  15315. HELP_DESKTOP_MORE_ZOOM_B:
  15316. 'Use these controls to zoom in and out or use the scroll wheel.',
  15317. HELP_MORE_TOUR_A: 'Tour Controls',
  15318. HELP_DESKTOP_MORE_TOUR_B:
  15319. 'Play, pause, and navigate forward and backward through a Guided Tour.',
  15320. HELP_MORE_INSIDE_A: 'Inside View',
  15321. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  15322. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  15323. HELP_MORE_VR_A: 'VR Mode',
  15324. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  15325. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  15326. HELP_MORE_360_A: '360° Views',
  15327. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  15328. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  15329. HELP_MORE_FULLSCREEN_A: 'Full screen',
  15330. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  15331. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  15332. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  15333. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  15334. WEBVR_ENTER_WEBVR: 'ENTER VR',
  15335. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  15336. WEBVR_LEARN_MORE: 'Learn more',
  15337. WEBVR_VIEW_SPACE: 'View Space in VR',
  15338. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15339. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  15340. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  15341. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  15342. VR_PREVIOUS_CAPS: 'PREVIOUS',
  15343. VR_NEXT_CAPS: 'NEXT',
  15344. VR_GOT_IT_CAPS: 'GOT IT',
  15345. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  15346. VR_SHOW_UNSUPPORTED:
  15347. "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  15348. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  15349. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  15350. VR_WHAT_YOU_NEED: "What You'll Need For...",
  15351. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  15352. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  15353. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  15354. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  15355. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15356. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15357. VR_APP: 'port VR App',
  15358. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15359. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15360. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  15361. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  15362. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  15363. VR_COMPATIBLE_ANDROID_LONG:
  15364. 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15365. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15366. VR_ANDROID_DVICES: 'Android Devices',
  15367. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  15368. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  15369. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  15370. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  15371. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  15372. VR_APP_OPEN: 'Open with the port VR app instead',
  15373. VR_DOWNLOAD_HERE: 'Download here',
  15374. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  15375. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  15376. VR_IMPROPER_EMBED:
  15377. 'The port Space is not embedded properly to support VR in your web browser.',
  15378. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  15379. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  15380. SHARE_TO: 'Share to',
  15381. SHARE_LINK: 'Direct Link',
  15382. SHARE_EXPLORE: 'Explore ',
  15383. SHARE_AT: 'at',
  15384. SHARE_WITH: 'with',
  15385. SHARE_3D: ' in 3D',
  15386. SHARE_COPIED: 'Copied!',
  15387. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  15388. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  15389. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  15390. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  15391. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  15392. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  15393. ERROR_GENERIC_ACTIONS_3: ' or ',
  15394. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  15395. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  15396. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  15397. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  15398. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  15399. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  15400. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  15401. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  15402. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  15403. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  15404. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  15405. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  15406. ERROR_MISSING_URLS_EXPLANATION:
  15407. 'This is an older model. The website owner may have a new model on the way.',
  15408. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  15409. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  15410. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  15411. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  15412. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  15413. LINK_TO_LOCATION: 'Link to location',
  15414. MENU_COPY: 'Copy',
  15415. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  15416. ROTATE: 'Rotate',
  15417. INSIDE: 'Inside',
  15418. MOVE: 'Move',
  15419. ZOOM: 'Zoom',
  15420. };
  15421. },
  15422. {},
  15423. ],
  15424. 112: [
  15425. function (e, t, i) {
  15426. 'use strict';
  15427. t.exports = {
  15428. PAGE_TITLE: '',
  15429. LOADING: 'Cargando',
  15430. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  15431. POWERED_BY: 'potenciando por ',
  15432. POWERED_BY_CAPS: 'POTENCIADO POR ',
  15433. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  15434. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  15435. PRESENTED_BY: 'Presentado por ',
  15436. MORE: 'Más ',
  15437. LESS: 'Menos ',
  15438. TAG_CONTENT: 'Contenido de tag™',
  15439. SHOW: 'Mostrar',
  15440. HIDE: 'Ocultar',
  15441. DOLLHOUSE: 'Dollhouse',
  15442. FLOOR_PLAN: 'Planos',
  15443. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  15444. CLOSE_HIGHLIGHTS: 'Cerrar',
  15445. PREVIOUS: 'Anterior',
  15446. PLAY: 'Play',
  15447. PAUSE: 'Pausa',
  15448. NEXT: 'Siguiente',
  15449. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  15450. VIEW_DOLLHOUSE: 'Ver dollhouse',
  15451. SOCIAL_SHARING: 'Compartir este espacio',
  15452. VIEW_IN_VR: 'Ver en realidad virtual',
  15453. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  15454. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  15455. ZOOM_IN: 'Acercar',
  15456. ZOOM_OUT: 'Alejar',
  15457. FLOOR_NAME: 'Piso ',
  15458. FLOOR_ALL: 'Todas',
  15459. TERMS: 'Condiciones',
  15460. PORT_TERMS: 'port términos de uso',
  15461. TERMS_OF_USE: 'Términos de uso',
  15462. TERMS_TEXT_FILE: 'terms-es-MX.html',
  15463. CLOSE_TERMS: 'Cerrar',
  15464. TERMS_FAIL:
  15465. 'No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.',
  15466. HELP: 'Ayuda',
  15467. HELP_NAVIGATION_TAB: 'Navegación',
  15468. HELP_MORE_HELP_TAB: 'Más Ayuda',
  15469. CLOSE: 'Cerrar',
  15470. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  15471. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  15472. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15473. HELP_DESKTOP_PANORAMA_1B:
  15474. 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  15475. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  15476. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  15477. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  15478. HELP_DESKTOP_360_2B:
  15479. 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  15480. HELP_DESKTOP_DOLLHOUSE_1A:
  15481. 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  15482. HELP_DESKTOP_DOLLHOUSE_2A:
  15483. 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  15484. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15485. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  15486. HELP_DESKTOP_FLOORPLAN_1A:
  15487. 'Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.',
  15488. HELP_DESKTOP_FLOORPLAN_2A:
  15489. 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  15490. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15491. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  15492. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  15493. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  15494. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  15495. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  15496. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  15497. HELP_MOBILE_DOLLHOUSE_1:
  15498. 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  15499. HELP_MOBILE_DOLLHOUSE_2:
  15500. 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  15501. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  15502. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  15503. HELP_MORE_HLR_A: 'Galería destacada',
  15504. HELP_DESKTOP_MORE_HLR_B:
  15505. 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  15506. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  15507. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15508. 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  15509. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15510. 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  15511. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  15512. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  15513. HELP_MORE_TAG_A: 'tag™ Posts',
  15514. HELP_DESKTOP_MORE_TAG_B:
  15515. 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  15516. HELP_MOBILE_MORE_TAG_B:
  15517. 'Toque para obtener más información acerca de las características del espacio.',
  15518. HELP_MORE_ZOOM_A: 'Controles de zoom',
  15519. HELP_DESKTOP_MORE_ZOOM_B:
  15520. 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  15521. HELP_MORE_TOUR_A: 'Controles de recorrido',
  15522. HELP_DESKTOP_MORE_TOUR_B:
  15523. 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  15524. HELP_MORE_INSIDE_A: 'Vista interior',
  15525. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  15526. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  15527. HELP_MORE_VR_A: 'Modo de realidad virtual',
  15528. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15529. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15530. HELP_MORE_360_A: '360° Views',
  15531. HELP_DESKTOP_MORE_360_B:
  15532. 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  15533. HELP_MOBILE_MORE_360_B:
  15534. 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  15535. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  15536. HELP_DESKTOP_MORE_FULLSCREEN_B:
  15537. 'Expanda el escenario 3D para verlo en pantalla completa.',
  15538. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  15539. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  15540. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  15541. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  15542. WEBVR_LEARN_MORE: 'Más información',
  15543. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  15544. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15545. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  15546. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  15547. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  15548. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  15549. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  15550. VR_APP: 'port VR App',
  15551. VR_COMPATIBLE_ANDROID_LONG:
  15552. 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  15553. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  15554. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  15555. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  15556. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  15557. VR_PREVIOUS_CAPS: 'ANTERIOR',
  15558. VR_NEXT_CAPS: 'SIGUIENTE',
  15559. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  15560. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  15561. VR_SHOW_UNSUPPORTED:
  15562. 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  15563. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  15564. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  15565. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  15566. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  15567. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  15568. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15569. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15570. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15571. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  15572. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15573. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  15574. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  15575. VR_ANDROID_DVICES: 'Dispositivos Android',
  15576. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  15577. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  15578. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  15579. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  15580. VR_DOWNLOAD_HERE: 'Descargar aquí',
  15581. VR_REQUIRE_HEADSET:
  15582. 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  15583. VR_REDIRECT_TO_STORE:
  15584. 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  15585. VR_IMPROPER_EMBED:
  15586. 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  15587. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  15588. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  15589. SHARE_TO: 'Compartir en',
  15590. SHARE_LINK: 'Enlace directo',
  15591. SHARE_EXPLORE: 'Explorar ',
  15592. SHARE_AT: 'en',
  15593. SHARE_WITH: 'con',
  15594. SHARE_3D: ' en 3D',
  15595. SHARE_COPIED: '¡Copiado!',
  15596. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  15597. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  15598. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  15599. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  15600. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  15601. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  15602. ERROR_GENERIC_ACTIONS_3: ' o ',
  15603. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  15604. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  15605. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  15606. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  15607. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  15608. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  15609. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  15610. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  15611. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  15612. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  15613. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  15614. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  15615. ERROR_MISSING_URLS_EXPLANATION:
  15616. 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  15617. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  15618. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  15619. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  15620. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  15621. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  15622. LINK_TO_LOCATION: 'Enlace a la ubicación',
  15623. MENU_COPY: 'Copiar',
  15624. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  15625. ROTATE: 'Girar',
  15626. INSIDE: 'Interior',
  15627. MOVE: 'Moverse',
  15628. ZOOM: 'Acercar o alejar',
  15629. };
  15630. },
  15631. {},
  15632. ],
  15633. 113: [
  15634. function (e, t, i) {
  15635. 'use strict';
  15636. t.exports = {
  15637. PAGE_TITLE: '',
  15638. LOADING: 'Chargement',
  15639. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  15640. POWERED_BY: 'alimenté par ',
  15641. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  15642. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15643. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15644. PRESENTED_BY: 'Présenté par ',
  15645. MORE: 'Plus ',
  15646. LESS: 'Moins ',
  15647. TAG_CONTENT: 'Contenu tag™',
  15648. SHOW: 'Montrer',
  15649. HIDE: 'Cacher',
  15650. DOLLHOUSE: 'Dollhouse',
  15651. FLOOR_PLAN: 'Plan de sol',
  15652. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  15653. CLOSE_HIGHLIGHTS: 'Fermer',
  15654. PREVIOUS: 'Précédent',
  15655. PLAY: 'Lecture',
  15656. PAUSE: 'Pause',
  15657. NEXT: 'Suivant',
  15658. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  15659. VIEW_DOLLHOUSE: 'Voir dollhouse',
  15660. SOCIAL_SHARING: 'Partager cet espace',
  15661. VIEW_IN_VR: 'Voir en VR',
  15662. VIEW_FULLSCREEN: 'Plein écran',
  15663. EXIT_FULLSCREEN: 'Fermer plein écran',
  15664. ZOOM_IN: 'Zoom avant',
  15665. ZOOM_OUT: 'Zoom arrière',
  15666. FLOOR_NAME: 'Étage ',
  15667. FLOOR_ALL: 'Tous',
  15668. TERMS: 'Mentions légales',
  15669. PORT_TERMS: 'port mentions légales',
  15670. TERMS_OF_USE: "Conditions d'utilisation",
  15671. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  15672. CLOSE_TERMS: 'Fermer',
  15673. TERMS_FAIL:
  15674. "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  15675. HELP: 'Aide',
  15676. HELP_NAVIGATION_TAB: 'Navigation',
  15677. HELP_MORE_HELP_TAB: 'Aide',
  15678. CLOSE: 'Fermer',
  15679. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  15680. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  15681. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15682. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  15683. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  15684. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  15685. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15686. HELP_DESKTOP_360_2B:
  15687. 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  15688. HELP_DESKTOP_DOLLHOUSE_1A:
  15689. 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  15690. HELP_DESKTOP_DOLLHOUSE_2A:
  15691. 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  15692. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15693. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  15694. HELP_DESKTOP_FLOORPLAN_1A:
  15695. 'Faites un clic droit pour changer la position du plan sur l’écran.',
  15696. HELP_DESKTOP_FLOORPLAN_2A:
  15697. 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  15698. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15699. HELP_DESKTOP_FLOORPLAN_2B:
  15700. 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  15701. HELP_DESKTOP_FLOORPLAN_3B:
  15702. 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  15703. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  15704. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  15705. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  15706. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15707. HELP_MOBILE_DOLLHOUSE_1:
  15708. 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  15709. HELP_MOBILE_DOLLHOUSE_2:
  15710. 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  15711. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  15712. HELP_MOBILE_FLOORPLAN_2:
  15713. 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  15714. HELP_MORE_HLR_A: 'Carrousel',
  15715. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  15716. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  15717. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15718. 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  15719. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15720. 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  15721. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  15722. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  15723. HELP_MORE_TAG_A: 'tag™ Posts',
  15724. HELP_DESKTOP_MORE_TAG_B:
  15725. 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  15726. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  15727. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  15728. HELP_DESKTOP_MORE_ZOOM_B:
  15729. 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  15730. HELP_MORE_TOUR_A: 'Commandes de la visite',
  15731. HELP_DESKTOP_MORE_TOUR_B:
  15732. "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  15733. HELP_MORE_INSIDE_A: 'Vue intérieure',
  15734. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  15735. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  15736. HELP_MORE_VR_A: 'Mode RV',
  15737. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  15738. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  15739. HELP_MORE_360_A: 'Vues 360°',
  15740. HELP_DESKTOP_MORE_360_B:
  15741. 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15742. HELP_MOBILE_MORE_360_B:
  15743. 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15744. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  15745. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  15746. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  15747. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  15748. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  15749. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  15750. WEBVR_LEARN_MORE: 'En savoir plus',
  15751. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  15752. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15753. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  15754. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  15755. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  15756. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  15757. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  15758. VR_NEXT_CAPS: 'SUIVANT',
  15759. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  15760. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  15761. VR_SHOW_UNSUPPORTED:
  15762. 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  15763. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  15764. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  15765. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  15766. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  15767. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  15768. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  15769. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  15770. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15771. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15772. VR_APP: 'port VR App',
  15773. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15774. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15775. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  15776. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15777. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  15778. VR_COMPATIBLE_ANDROID_LONG:
  15779. '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',
  15780. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  15781. VR_ANDROID_DVICES: 'Appareils Android',
  15782. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  15783. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  15784. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  15785. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  15786. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  15787. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  15788. VR_DOWNLOAD_HERE: 'Télécharger ici',
  15789. VR_REQUIRE_HEADSET:
  15790. "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  15791. VR_REDIRECT_TO_STORE:
  15792. "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  15793. VR_IMPROPER_EMBED:
  15794. "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  15795. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  15796. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  15797. SHARE_TO: 'Partager sur',
  15798. SHARE_LINK: 'Lien direct',
  15799. SHARE_EXPLORE: 'Explorer ',
  15800. SHARE_AT: 'à',
  15801. SHARE_WITH: 'avec',
  15802. SHARE_3D: ' en 3D',
  15803. SHARE_COPIED: 'Copié!',
  15804. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  15805. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  15806. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  15807. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  15808. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  15809. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  15810. ERROR_GENERIC_ACTIONS_3: ' ou ',
  15811. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  15812. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  15813. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  15814. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  15815. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  15816. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  15817. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  15818. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  15819. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  15820. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  15821. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  15822. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  15823. ERROR_MISSING_URLS_EXPLANATION:
  15824. 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  15825. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  15826. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  15827. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  15828. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  15829. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  15830. LINK_TO_LOCATION: "Lien vers l'emplacement",
  15831. MENU_COPY: 'Copie',
  15832. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  15833. ROTATE: 'Faire pivoter',
  15834. INSIDE: 'Intérieure',
  15835. MOVE: 'Se déplacer',
  15836. ZOOM: 'Zoom',
  15837. };
  15838. },
  15839. {},
  15840. ],
  15841. 114: [
  15842. function (e, t, i) {
  15843. 'use strict';
  15844. t.exports = {
  15845. PAGE_TITLE: '',
  15846. LOADING: '読み込み中',
  15847. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15848. POWERED_BY: 'powered by',
  15849. POWERED_BY_CAPS: 'POWERED BY',
  15850. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  15851. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  15852. PRESENTED_BY: 'Presented by ',
  15853. MORE: '全て表示 ',
  15854. LESS: '閉じる ',
  15855. TAG_CONTENT: 'tag™コンテンツ ',
  15856. SHOW: '表示',
  15857. HIDE: '非表示',
  15858. DOLLHOUSE: 'ドールハウス',
  15859. FLOOR_PLAN: 'フロアプラン',
  15860. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  15861. CLOSE_HIGHLIGHTS: '閉じる',
  15862. PREVIOUS: '前へ',
  15863. PLAY: '再生',
  15864. PAUSE: '一時停止',
  15865. NEXT: '次へ',
  15866. EXPLORE_3D_SPACE: '3DSpaceの探索',
  15867. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  15868. SOCIAL_SHARING: 'このSpaceを共有する',
  15869. VIEW_IN_VR: 'VRで表示',
  15870. VIEW_FULLSCREEN: 'フルスクリーン表示',
  15871. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  15872. ZOOM_IN: 'ズームイン',
  15873. ZOOM_OUT: 'ズームアウト',
  15874. FLOOR_NAME: 'フロア ',
  15875. FLOOR_ALL: 'すべて',
  15876. TERMS: '規約',
  15877. PORT_TERMS: 'port規約',
  15878. TERMS_OF_USE: '利用規約',
  15879. CLOSE_TERMS: '閉じる',
  15880. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  15881. TERMS_FAIL:
  15882. '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  15883. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  15884. WEBVR_ENTER_WEBVR: 'VRに入る',
  15885. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  15886. WEBVR_LEARN_MORE: 'もっと詳しく',
  15887. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  15888. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15889. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15890. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  15891. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  15892. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  15893. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  15894. VR_PREVIOUS_CAPS: '前へ',
  15895. VR_NEXT_CAPS: '次へ',
  15896. VR_GOT_IT_CAPS: '了解',
  15897. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  15898. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  15899. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  15900. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  15901. VR_WHAT_YOU_NEED: '必要なもの',
  15902. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  15903. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  15904. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  15905. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15906. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15907. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15908. VR_APP: 'port VRアプリ',
  15909. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15910. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  15911. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  15912. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  15913. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  15914. VR_COMPATIBLE_ANDROID_LONG:
  15915. 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  15916. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  15917. VR_ANDROID_DVICES: 'Androidデバイス',
  15918. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  15919. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  15920. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  15921. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  15922. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  15923. VR_APP_OPEN: 'port VRアプリで開く',
  15924. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  15925. VR_REQUIRE_HEADSET:
  15926. 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  15927. VR_REDIRECT_TO_STORE:
  15928. 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  15929. VR_IMPROPER_EMBED:
  15930. 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  15931. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  15932. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  15933. SHARE_TO: '共有先',
  15934. SHARE_LINK: 'ダイレクトリンク',
  15935. SHARE_EXPLORE: '探索',
  15936. SHARE_AT: '場所',
  15937. SHARE_WITH: '使用アプリ',
  15938. SHARE_3D: '3Dで',
  15939. SHARE_COPIED: 'コピーされました!',
  15940. ERROR_BROWSER_SOLUTION:
  15941. '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  15942. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  15943. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  15944. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  15945. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  15946. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  15947. ERROR_GENERIC_ACTIONS_3: 'または',
  15948. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  15949. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  15950. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  15951. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  15952. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  15953. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  15954. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  15955. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  15956. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  15957. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  15958. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  15959. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  15960. ERROR_MISSING_URLS_EXPLANATION:
  15961. 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  15962. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  15963. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  15964. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  15965. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  15966. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  15967. LINK_TO_LOCATION: 'ロケーションへのリンク',
  15968. MENU_COPY: 'コピー',
  15969. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  15970. ROTATE: '回転',
  15971. MOVE: '移動',
  15972. INSIDE: '内側',
  15973. ZOOM: 'ズーム',
  15974. HELP: 'ヘルプ',
  15975. HELP_NAVIGATION_TAB: 'ナビゲーション',
  15976. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  15977. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  15978. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  15979. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15980. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  15981. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  15982. HELP_DESKTOP_PANORAMA_3B:
  15983. 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  15984. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  15985. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  15986. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  15987. HELP_DESKTOP_DOLLHOUSE_2A:
  15988. '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  15989. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15990. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  15991. HELP_DESKTOP_FLOORPLAN_1A:
  15992. '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  15993. HELP_DESKTOP_FLOORPLAN_2A:
  15994. '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  15995. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15996. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  15997. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  15998. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  15999. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  16000. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  16001. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  16002. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  16003. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  16004. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  16005. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  16006. HELP_MORE_HLR_A: 'ハイライト',
  16007. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  16008. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  16009. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16010. 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  16011. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16012. 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  16013. HELP_MORE_FLOORS_A: 'フロアセレクター',
  16014. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  16015. HELP_MORE_TAG_A: 'tag™ Posts',
  16016. HELP_DESKTOP_MORE_TAG_B:
  16017. 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  16018. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  16019. HELP_MORE_ZOOM_A: 'ズームコントロール',
  16020. HELP_DESKTOP_MORE_ZOOM_B:
  16021. 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  16022. HELP_MORE_TOUR_A: 'ツアーコントロール',
  16023. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  16024. HELP_MORE_INSIDE_A: '内側ビュー',
  16025. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  16026. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  16027. HELP_MORE_VR_A: 'VRモード',
  16028. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  16029. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  16030. HELP_MORE_360_A: '360° Views',
  16031. HELP_DESKTOP_MORE_360_B:
  16032. 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  16033. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  16034. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  16035. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  16036. CLOSE: '閉じる',
  16037. };
  16038. },
  16039. {},
  16040. ],
  16041. 115: [
  16042. function (e, t, i) {
  16043. 'use strict';
  16044. t.exports = {
  16045. PAGE_TITLE: '',
  16046. LOADING: 'Загрузка',
  16047. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  16048. POWERED_BY: 'разработано на платформе ',
  16049. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  16050. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  16051. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  16052. PRESENTED_BY: 'Представлено ',
  16053. MORE: 'Больше ',
  16054. LESS: 'Меньше ',
  16055. TAG_CONTENT: 'tag™ Контент',
  16056. SHOW: 'Показать',
  16057. HIDE: 'Скрыть',
  16058. DOLLHOUSE: 'Dollhouse',
  16059. FLOOR_PLAN: 'Планировка',
  16060. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  16061. CLOSE_HIGHLIGHTS: 'Закрыть',
  16062. PREVIOUS: 'Предыдущий',
  16063. PLAY: 'Воспроизвести',
  16064. PAUSE: 'Пауза',
  16065. NEXT: 'Следующий',
  16066. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  16067. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  16068. SOCIAL_SHARING: 'Поделиться этой моделью',
  16069. VIEW_IN_VR: 'Посмотреть в VR',
  16070. VIEW_FULLSCREEN: 'Полный экран',
  16071. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  16072. ZOOM_IN: 'Увеличить',
  16073. ZOOM_OUT: 'Уменьшить',
  16074. FLOOR_NAME: 'Этаж ',
  16075. FLOOR_ALL: 'Все',
  16076. TERMS: 'Условия',
  16077. PORT_TERMS: 'Правила пользования',
  16078. TERMS_OF_USE: 'Условия использования',
  16079. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  16080. CLOSE_TERMS: 'Закрыть',
  16081. TERMS_FAIL:
  16082. 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  16083. HELP: 'Помощь',
  16084. HELP_NAVIGATION_TAB: 'Навигация',
  16085. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  16086. CLOSE: 'Закрыть',
  16087. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  16088. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  16089. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  16090. HELP_DESKTOP_PANORAMA_1B:
  16091. 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  16092. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  16093. HELP_DESKTOP_PANORAMA_3B:
  16094. 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  16095. HELP_DESKTOP_360_2A:
  16096. 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16097. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  16098. HELP_DESKTOP_DOLLHOUSE_1A:
  16099. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  16100. HELP_DESKTOP_DOLLHOUSE_2A:
  16101. 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  16102. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16103. HELP_DESKTOP_DOLLHOUSE_1B:
  16104. 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  16105. HELP_DESKTOP_FLOORPLAN_1A:
  16106. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  16107. HELP_DESKTOP_FLOORPLAN_2A:
  16108. 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  16109. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16110. HELP_DESKTOP_FLOORPLAN_2B:
  16111. 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  16112. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  16113. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  16114. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  16115. HELP_MOBILE_3:
  16116. 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  16117. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16118. HELP_MOBILE_DOLLHOUSE_1:
  16119. 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  16120. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  16121. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  16122. HELP_MOBILE_FLOORPLAN_2:
  16123. 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  16124. HELP_MORE_HLR_A: 'Фотоколлаж',
  16125. HELP_DESKTOP_MORE_HLR_B:
  16126. 'Откройте для перемещения по модели, используя иконки изображений.',
  16127. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  16128. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16129. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16130. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16131. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16132. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  16133. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  16134. HELP_MORE_TAG_A: 'tag™ Posts',
  16135. HELP_DESKTOP_MORE_TAG_B:
  16136. 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  16137. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  16138. HELP_MORE_ZOOM_A: 'Масштаб',
  16139. HELP_DESKTOP_MORE_ZOOM_B:
  16140. 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  16141. HELP_MORE_TOUR_A: 'Управление Туром',
  16142. HELP_DESKTOP_MORE_TOUR_B:
  16143. 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  16144. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  16145. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16146. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16147. HELP_MORE_VR_A: 'Режим VR',
  16148. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16149. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16150. HELP_MORE_360_A: '360° Views',
  16151. HELP_DESKTOP_MORE_360_B:
  16152. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16153. HELP_MOBILE_MORE_360_B:
  16154. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16155. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  16156. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  16157. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  16158. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  16159. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  16160. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  16161. WEBVR_LEARN_MORE: 'Узнать больше',
  16162. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  16163. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  16164. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16165. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  16166. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  16167. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16168. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  16169. VR_APP: 'port VR App',
  16170. VR_APP_OPEN: 'Или открыть через приложение port VR',
  16171. VR_COMPATIBLE_ANDROID_LONG:
  16172. 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  16173. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  16174. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  16175. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  16176. VR_VIEW_SPACE: 'Запустить модель в VR',
  16177. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  16178. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  16179. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  16180. VR_GOT_IT_CAPS: 'ЯСНО',
  16181. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  16182. VR_SHOW_UNSUPPORTED:
  16183. 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  16184. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  16185. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  16186. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  16187. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  16188. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  16189. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  16190. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  16191. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  16192. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  16193. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  16194. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  16195. VR_ANDROID_DVICES: 'Android устройства',
  16196. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  16197. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  16198. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  16199. VR_DOWNLOAD_HERE: 'Скачать здесь',
  16200. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  16201. VR_REDIRECT_TO_STORE:
  16202. 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  16203. VR_IMPROPER_EMBED:
  16204. 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  16205. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  16206. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  16207. SHARE_TO: 'Поделиться',
  16208. SHARE_LINK: 'Прямая ссылка',
  16209. SHARE_EXPLORE: 'просмотреть',
  16210. SHARE_AT: 'на',
  16211. SHARE_WITH: 'с',
  16212. SHARE_3D: 'в 3D',
  16213. SHARE_COPIED: 'Скопировано!',
  16214. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  16215. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  16216. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  16217. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  16218. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  16219. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  16220. ERROR_GENERIC_ACTIONS_3: ' или ',
  16221. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  16222. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  16223. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  16224. ERROR_WEBGL_IOS_SOLUTION:
  16225. 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  16226. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  16227. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  16228. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  16229. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  16230. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16231. 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  16232. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  16233. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  16234. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  16235. ERROR_MISSING_URLS_EXPLANATION:
  16236. 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  16237. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  16238. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  16239. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  16240. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  16241. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  16242. LINK_TO_LOCATION: 'Ссылка на местоположение',
  16243. MENU_COPY: 'Копировать',
  16244. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  16245. ROTATE: 'Вращать',
  16246. MOVE: 'Передвигаться',
  16247. INSIDE: 'Вид изнутри',
  16248. ZOOM: 'Масштаб',
  16249. };
  16250. },
  16251. {},
  16252. ],
  16253. 116: [
  16254. function (e, t, i) {
  16255. //main.js
  16256. (function (t) {
  16257. 'use strict';
  16258. var modelProgressBase = 0.4;
  16259. var progressUpdate = function (e) {
  16260. // 0 <= e <= 1
  16261. console.log('e1:' + e);
  16262. e = Math.round(modelProgressBase * e * 100);
  16263. console.log('e2:' + e);
  16264. var t = $('.progressbar');
  16265. t.find('.bar').css('width', e + '%');
  16266. t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px'); //上面跟着的字的百分比
  16267. t.find('.perc').text(e + '%'); //具体数字的百分比
  16268. };
  16269. $('#gui-loading').fadeIn(200);
  16270. progressUpdate(0.1);
  16271. var fileName = g_version ? 'modeldata.js' : 'someData.json';
  16272. $.ajax(
  16273. g_Prefix + 'data/' + window.number + '/' + fileName + '?' + randomTime().getTime(),
  16274. { dataType: 'json' }
  16275. )
  16276. .done(function (e) {
  16277. //改
  16278. var data = matcher(e);
  16279. data.files.templates[0] =
  16280. g_Prefix + e.files.templates[0].replace('{{number}}', window.number);
  16281. data.user = {
  16282. is_authenticated: false,
  16283. flags: [
  16284. 'payment_show_past_due',
  16285. 'sc_imgopt_100',
  16286. 'mattertags',
  16287. 'labels',
  16288. 'fastly_v2_urls',
  16289. 'vr',
  16290. 'uhql',
  16291. 'sc_segment_100',
  16292. 'show_segment_metrics',
  16293. 'content_distribution',
  16294. 'workshop_webgl',
  16295. 'show360views',
  16296. 'showcase_vr',
  16297. 'ws_zooming',
  16298. 'model_settings',
  16299. 'ws_360snapshots',
  16300. 'img_multi_dl',
  16301. 'vrworkshop',
  16302. 'tag_links',
  16303. 'ws_img_multi_dl',
  16304. 'mattertag_links',
  16305. 'billing_tab_hidden',
  16306. 'static_cloud_ui',
  16307. 'metrics',
  16308. 'mattertag_media',
  16309. 'img_size_download',
  16310. 'show_360snapshots',
  16311. 'floorplan',
  16312. 'sc_tilegen_0',
  16313. 'showcase_webvr',
  16314. 'sc_mixpanel_0',
  16315. 'show_clickbait',
  16316. 'zooming',
  16317. 'showcase_tiling',
  16318. 'list_signed_urls_default_3',
  16319. 'fastly_image_opto',
  16320. ],
  16321. };
  16322. try {
  16323. //处理一下导览数据
  16324. data.model.images = data.model.images.filter((e) => {
  16325. if (!e.locations && !e.thumbnail_signed_src) return; //旧的曾有导览数据是错误的,将它删除
  16326. if (e.locations && e.locations.length == 0) return;
  16327. return e;
  16328. });
  16329. } catch (e) {
  16330. console.log(e);
  16331. }
  16332. window.DATA = data;
  16333. data.model.summary = data.summary;
  16334. data.model.name = data.name;
  16335. for (let i in data) {
  16336. data[i] == 'false' && (data[i] = false);
  16337. }
  16338. progressUpdate(0.7);
  16339. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  16340. if (data.weixinDesc) {
  16341. g_weixinObj.desc = data.weixinDesc;
  16342. }
  16343. if (data.shareImgUrl) {
  16344. g_weixinObj.imgUrl = data.shareImgUrl;
  16345. }
  16346. window.wx && manage.weixinShare();
  16347. //初始画面
  16348. data.camera_start &&
  16349. data.camera_start.thumbImg &&
  16350. E(manage.dealURL(data.camera_start.thumbImg));
  16351. function E(e) {
  16352. $('<img/>')
  16353. .attr('src', e)
  16354. .on('load', function () {
  16355. $('#gui-thumb')
  16356. .css('backgroundImage', 'url(' + e + ')')
  16357. .fadeIn(500),
  16358. $(this).remove();
  16359. });
  16360. }
  16361. //背景
  16362. (settings.transparentBg = settings.transparentBg || data.transparentBg || false),
  16363. (settings.bgImg = settings.bgImg || data.bgImg || null);
  16364. if (settings.bgImg) {
  16365. $('#player').css({
  16366. 'background-image': 'url(' + settings.bgImg + ')',
  16367. 'background-position': 'center center',
  16368. });
  16369. }
  16370. {
  16371. //初始化导览时间
  16372. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100;
  16373. window._settings.warp.teleportTime =
  16374. (settings.teleportTime / DATA.tourBlackSpeed) * 100;
  16375. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100;
  16376. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  16377. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  16378. }
  16379. }
  16380. {
  16381. //其他
  16382. _settings.floorPlanAngle = DATA.floorPlanAngle || 0;
  16383. }
  16384. })
  16385. .fail((e) => {
  16386. alert('缺少someData文件,请检查场景码是否正确。');
  16387. });
  16388. function StartLoad() {
  16389. //当加载完data后
  16390. function i() {
  16391. var e = window.number; //Y.getModelIDFromQueryString();
  16392. if (!e) return b(null, 'loading-failed');
  16393. var t = Y.parseSidUrl(e),
  16394. i = l(),
  16395. a = c(),
  16396. s = o(),
  16397. u = V.quickstart.enabled,
  16398. g = null,
  16399. m = null,
  16400. v = null,
  16401. w = null,
  16402. T = null,
  16403. x = null,
  16404. S = null,
  16405. M = null,
  16406. R = null,
  16407. P = null,
  16408. O = null,
  16409. L = null,
  16410. N = new ue();
  16411. r(s);
  16412. h({
  16413. //MP开头写法
  16414. urlBase: t.urlBase,
  16415. })
  16416. .then(function () {
  16417. return re.init(), d(t, e); //getModel and load
  16418. })
  16419. .then(function (e) {
  16420. progressUpdate(0.9);
  16421. return (
  16422. (P = e),
  16423. p(
  16424. P,
  16425. V.appConfig.segment_key,
  16426. V.appConfig.keen_write_key,
  16427. V.appConfig.keen_project_id,
  16428. {
  16429. startSource: i,
  16430. autoplay: V.autoplay,
  16431. quickstart: u,
  16432. }
  16433. ),
  16434. P.urls.init()
  16435. );
  16436. })
  16437. .then(function () {
  16438. return P.loadPanos();
  16439. })
  16440. .then(function () {
  16441. (m = X.getStartCameraOptions(P, P.panos)),
  16442. (S = A(P)),
  16443. (O = y(u, m.mode)),
  16444. (v = O.controls),
  16445. (w = O.player),
  16446. (T = O.director),
  16447. (x = O.tagManager),
  16448. (M = O.tileDownloader),
  16449. (R = O.qualityManager),
  16450. (L = O.panoRenderer),
  16451. C(P, S, O, s),
  16452. (w.director = T), //xzw add
  16453. P.supportsTiles && M.start(),
  16454. !u ||
  16455. (m.mode === D.PANORAMA && m.pano) ||
  16456. (de.warn(
  16457. 'Tried to quickstart, but failed as we are not starting in inside mode.'
  16458. ),
  16459. (u = !1));
  16460. var e = null;
  16461. if (u) {
  16462. de.warn('Quickstart engaged. Hold on to your knickers.');
  16463. var t = v.controls[D.PANORAMA];
  16464. (g = new ie(R, S.scene, S.camera, t, s)),
  16465. _(S, s, P),
  16466. (e = g.load(m).then(function () {
  16467. S.addComponent(g),
  16468. S.once(le.AfterRender, function () {
  16469. de.warn('First render after quickstart load finished.');
  16470. });
  16471. }));
  16472. }
  16473. window.flyToFirst = function () {
  16474. //xzw add
  16475. var pano = w.model.panos.get('8d778e19657f433fb9cf8947d823bb70');
  16476. var q = new _x.Quaternion(
  16477. 0.7099827027821568,
  16478. -0.07708150183830938,
  16479. 0.6958985789714591,
  16480. 0.07555241737970636
  16481. );
  16482. var lookAtPoint = new _x.Vector3(0, 0, -1)
  16483. .applyQuaternion(q)
  16484. .add(pano.position);
  16485. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint });
  16486. };
  16487. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N));
  16488. })
  16489. .then(function () {
  16490. return f(P, U.onProgress, i, !u, a);
  16491. })
  16492. .then(function () {
  16493. if (
  16494. ((m.quickstart = u),
  16495. I(P, S, O, s),
  16496. S.started || _(S, s, P),
  16497. H.modelLoaded(P, w, v, V.autoplay),
  16498. E(w, P, m, V.autoplay).done(function () {
  16499. T.autoTour();
  16500. }),
  16501. !P.supportsTiles)
  16502. ) {
  16503. var e = new Z(P, w);
  16504. e.start();
  16505. }
  16506. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  16507. U.init(P, T, w, v, S, m, H.getSessionId()),
  16508. U.endLoading(P, T, x),
  16509. S.once(le.AfterRender, function () {
  16510. N.setAppReadyTime();
  16511. var e = N.calcFullLoadingTime();
  16512. de.warn('Total load time: ' + e / 1e3),
  16513. H.loadComplete(e),
  16514. de.warn('First render after model load finished.');
  16515. try {
  16516. window.evt && window.dispatchEvent(window.evt);
  16517. parent.postMessage(
  16518. {
  16519. cmd: 'loaded',
  16520. },
  16521. '*'
  16522. );
  16523. } catch (err) {}
  16524. }),
  16525. S.on(le.MemoryUsageUpdated, n);
  16526. })
  16527. .fail(b.bind(this, e));
  16528. }
  16529. function n(e) {
  16530. ce.update(e);
  16531. }
  16532. function r(e) {
  16533. de.info('Version', '2.25.6-0-gd87e5b1'), (q.defaultMaxListeners = 1e3), a(e), s();
  16534. }
  16535. function o() {
  16536. return document.getElementById('player');
  16537. }
  16538. function a(e) {
  16539. e.addEventListener('dragenter', T, !1), e.addEventListener('dragover', T, !1);
  16540. }
  16541. function s() {
  16542. F.valueFromHash('title', !0) ||
  16543. $(document).ready(function () {
  16544. var e = $('.model-title');
  16545. e.hide();
  16546. });
  16547. }
  16548. function l() {
  16549. return F.valueFromHash('play', !1) ? 'autoplay' : F.inIframe() ? 'click' : 'fullpage';
  16550. }
  16551. function c() {
  16552. return {
  16553. panoElementsToLoad: 6,
  16554. modelElementsToLoad: 0,
  16555. totalElementsLoaded: 0,
  16556. totalElementsToLoad: 0,
  16557. totalPercentageLoaded: 0,
  16558. progressCallback: null,
  16559. };
  16560. }
  16561. function h(e) {
  16562. return K.loadFeatureFlags(e).done(function (e) {
  16563. K.updateDependentSettings(e, V);
  16564. });
  16565. }
  16566. // function u(e) {
  16567. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  16568. // responseType: "json",
  16569. // prefetchFrom: "config"
  16570. // }).then(function(e) {
  16571. // return e ? void j.extendObject(V.appConfig, e) : {}
  16572. // }, function(e) {
  16573. // return de.warn("Failed loading runtime config, using defaults."),
  16574. // $.when({})
  16575. // })
  16576. // }
  16577. function d(e, t) {
  16578. var i = B.getModel({
  16579. url: t,
  16580. floors: F.valueFromHash('f', !0),
  16581. autoload: !1,
  16582. });
  16583. return $.when(i, n).then(null, function (e) {
  16584. return this;
  16585. });
  16586. }
  16587. function p(e, t, i, n, r) {
  16588. de.info('Model data loaded'),
  16589. de.debug('UUID: ' + e.data.job.uuid),
  16590. J.init(K.getFlags()),
  16591. i &&
  16592. H.initKeen({
  16593. token: i,
  16594. appId: n,
  16595. }),
  16596. H.initSegment({
  16597. model: e.sid,
  16598. version: '2.25.6-0-gd87e5b1',
  16599. startSource: r.startSource,
  16600. token: t,
  16601. autoplay: r.autoplay,
  16602. quickstart: r.quickstart,
  16603. });
  16604. }
  16605. function f(e, t, i, n, r) {
  16606. return (
  16607. (r.progressCallback = t), H.sessionStart(), e.load(n).progress(g.bind(this, r))
  16608. );
  16609. }
  16610. function g(e, t) {
  16611. (e.modelElementsToLoad = t[1]), v(e), m(e);
  16612. }
  16613. function m(e) {
  16614. e.totalElementsLoaded++,
  16615. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  16616. //----许钟文-----------------模型进度条向后调整
  16617. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  16618. e.totalPercentageLoaded =
  16619. modelProgressBase + (1 - modelProgressBase) * e.totalPercentageLoaded;
  16620. console.log('pro:' + e.totalPercentageLoaded);
  16621. //---------------------------
  16622. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded);
  16623. }
  16624. function v(e) {
  16625. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad;
  16626. }
  16627. function A(e) {
  16628. var t = new x.PerspectiveCamera();
  16629. t.layers.enable(he.PANOMARKERS),
  16630. t.layers.enable(he.RETICULE),
  16631. t.layers.enable(he.TAG);
  16632. var i = new x.Scene(),
  16633. n = new x.AmbientLight(16777215);
  16634. i.add(n),
  16635. (i.plane = new x.Mesh(
  16636. new x.PlaneBufferGeometry(1e5, 1e5),
  16637. new x.RawShaderMaterial({
  16638. side: x.DoubleSide,
  16639. })
  16640. )),
  16641. (i.plane.position.y = 0),
  16642. i.plane.rotateX(-Math.PI / 2),
  16643. (i.plane.material.visible = !1),
  16644. i.add(i.plane),
  16645. i.updateMatrixWorld(),
  16646. V.showScreenshotLocations &&
  16647. e.data.images.forEach(function (e) {
  16648. if (e.metadata && e.metadata.camera_position) {
  16649. var t = e.metadata.camera_position,
  16650. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3));
  16651. (n.position = t.clone()), i.add(n);
  16652. var r = e.metadata.camera_quaternion,
  16653. o = new x.Vector3(0, 0, -1).applyQuaternion(r);
  16654. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680));
  16655. }
  16656. }),
  16657. V.showAxis &&
  16658. (i.add(new x.ArrowHelper(new x.Vector3(0, 1, 0), new x.Vector3(0, 0, 0), 1, 255)),
  16659. i.add(
  16660. new x.ArrowHelper(new x.Vector3(0, 0, 1), new x.Vector3(0, 0, 0), 1, 16711680)
  16661. ),
  16662. i.add(
  16663. new x.ArrowHelper(new x.Vector3(1, 0, 0), new x.Vector3(0, 0, 0), 1, 65280)
  16664. ));
  16665. //背景
  16666. if (!settings.transparentBg && !settings.bgImg) {
  16667. i.skybox = new W();
  16668. i.add(i.skybox);
  16669. }
  16670. var r = new te(i, t, z);
  16671. return r;
  16672. }
  16673. function y(e, t) {
  16674. var i = e ? 1 : 1e3,
  16675. n = J.tilegen || J.imgopt ? 6 : 2;
  16676. n = F.valueFromHash('tileconc', n);
  16677. var r = new ne(),
  16678. o = new ae({
  16679. concurrentDownloads: n,
  16680. }),
  16681. a = new se(),
  16682. s = new P(),
  16683. l = new M(),
  16684. c = new S(t),
  16685. h = new R(),
  16686. u = new O(i),
  16687. d = new L(),
  16688. p = new oe();
  16689. return {
  16690. qualityManager: r,
  16691. panoRenderer: a,
  16692. tileDownloader: o,
  16693. player: c,
  16694. director: l,
  16695. modelManager: s,
  16696. tagManager: p,
  16697. displayController: u,
  16698. labelDisplayController: d,
  16699. controls: h,
  16700. };
  16701. }
  16702. function C(e, t, i, n) {
  16703. var r = i.controls,
  16704. o = i.qualityManager,
  16705. a = i.panoRenderer,
  16706. s = i.tileDownloader,
  16707. l = i.modelManager;
  16708. r.init(n, l),
  16709. ee.init(i.director, r, i.player, l, t),
  16710. o.init(l),
  16711. s.init(o),
  16712. a.init(t, s, o),
  16713. l.init(s, a, o),
  16714. l.addModel(e),
  16715. t.addComponent(G);
  16716. }
  16717. function I(e, t, i, n) {
  16718. var r = i.qualityManager,
  16719. o = i.panoRenderer,
  16720. a = i.tileDownloader,
  16721. s = i.modelManager,
  16722. l = i.player,
  16723. c = i.director,
  16724. h = i.tagManager,
  16725. u = i.displayController,
  16726. d = i.labelDisplayController,
  16727. p = i.controls;
  16728. t.scene.add(e), (t.qualityManager = r);
  16729. var f = {
  16730. camera: t.camera,
  16731. director: c,
  16732. modelManager: s,
  16733. tileDownloader: a,
  16734. panoRenderer: o,
  16735. qualityManager: r,
  16736. tagManager: h,
  16737. container: n,
  16738. controls: p,
  16739. };
  16740. l.init(f),
  16741. l.setScene(t.scene),
  16742. h.init(s, l),
  16743. c.init(l, s),
  16744. u.init(c, l, s, h, n),
  16745. d.init(l, s, n),
  16746. z.bindEvents(l),
  16747. t.addComponent(h),
  16748. t.addComponent(l),
  16749. t.addComponent(o),
  16750. (l.sceneRenderer = t); //xzw add 方便resize
  16751. }
  16752. function E(e, t, i, n) {
  16753. return (
  16754. de.info('Starting player in ' + i.mode),
  16755. H.report(t.sid, 'started-playing', n, i.quickstart),
  16756. e.start(i)
  16757. );
  16758. }
  16759. function b(e, t) {
  16760. de.error(t), k.error(t), H.report(e, 'error-' + t);
  16761. }
  16762. function w(e) {
  16763. var t = F.details();
  16764. t && 'Safari' === t.name && t.version > 500 && t.version < 600
  16765. ? (k.error('webgl-safari'), H.report(e, 'error-webgl-safari'))
  16766. : (k.error('webgl-generic'), H.report(e, 'error-webgl-generic'));
  16767. }
  16768. function _(e, t, i) {
  16769. try {
  16770. e.start(t);
  16771. } catch (e) {
  16772. throw (de.warn(e.message), w(i.sid), e);
  16773. }
  16774. }
  16775. function T(e) {
  16776. e.stopPropagation(), e.preventDefault();
  16777. }
  16778. //czj 判断someData 有没有hoticon字段 修改热点的样式
  16779. if (window.hoticon) {
  16780. g_HotImage = {
  16781. point: window.hoticon.default,
  16782. point2: window.hoticon.higt
  16783. }
  16784. } else if (window.DATA.hoticon) {
  16785. g_HotImage = {
  16786. point:
  16787. window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  16788. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png',
  16789. };
  16790. }
  16791. //czj 判断someData 有没有backgroundMusic 添加音乐
  16792. if (window.DATA.backgroundMusic) {
  16793. if (window.isLocal) {
  16794. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic));
  16795. } else {
  16796. SoundManager.setSrc('bgm', window.DATA.backgroundMusic);
  16797. }
  16798. $('#volume').show();
  16799. } else if (g_version === 'one') {
  16800. SoundManager.setSrc(
  16801. 'bgm',
  16802. manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3')
  16803. );
  16804. $('#volume').show();
  16805. }
  16806. //隐藏公司logo
  16807. if (window.DATA.loadlogo) {
  16808. showLogo();
  16809. }
  16810. e('./lib/three75-shim'),
  16811. e('./lib/array-polyfill'),
  16812. e('./lib/performance-polyfill'),
  16813. e('./lib/shaders/CopyShader.js'),
  16814. e('./lib/shaders/HorizontalBlurShader.js'),
  16815. e('./lib/shaders/VerticalBlurShader.js'),
  16816. e('./lib/postprocessing/EffectComposer.js'),
  16817. e('./lib/postprocessing/RenderPass.js'),
  16818. e('./lib/postprocessing/MaskPass.js'),
  16819. e('./lib/postprocessing/ShaderPass.js'),
  16820. window.Promise || (window.Promise = e('promise-polyfill'));
  16821. var x = e('three'),
  16822. _x = e('three'),
  16823. S = (e('./util/sentry'), e('./player')),
  16824. M = e('./director'),
  16825. R = e('./controls/CameraControls'),
  16826. P = e('./model/ModelManager'),
  16827. O = e('./DisplayController'),
  16828. L = e('./label/LabelDisplayController'),
  16829. D = e('./enum/Viewmode'),
  16830. N = e('./util/logger'),
  16831. B = e('./showcase'),
  16832. F = e('./util/browser'),
  16833. V = e('./settings'),
  16834. U = e('./gui/gui'),
  16835. k = e('./gui/error'),
  16836. H = e('./analytics'),
  16837. G = e('./util/transitions'),
  16838. z = e('./effects'),
  16839. W = e('./objects/Skybox'),
  16840. j = e('./util/common'),
  16841. Y = (e('./util/PanoramaCollection'), e('./util/math'), e('./util/showcase')),
  16842. X = e('./util/camera'),
  16843. Z = (e('./objects/Panorama'), e('./cameras/PanoramaCamera'), e('./preloaders')),
  16844. q = e('events').EventEmitter,
  16845. K = e('./featureflags'),
  16846. Q = (e('./util/lerp'), e('./util/ajax')),
  16847. J = e('./ab'),
  16848. ee = e('./sdk/automation.js'),
  16849. te = e('./scene/SceneRenderer'),
  16850. ie = e('./scene/QuickstartManager'),
  16851. ne = e('./tile/QualityManager.js'),
  16852. re = e('./localization/localize'),
  16853. oe = e('./tag/tagManager'),
  16854. ae = e('./tile/TileDownloader'),
  16855. se = e('./tile/PanoRenderer'),
  16856. le =
  16857. (e('./enum/PanoSizeClass'),
  16858. e('./enum/PanoramaEvents'),
  16859. e('./enum/SceneRendererEvents')),
  16860. ce = e('./gui/memoryUsage'),
  16861. he = e('./enum/RenderLayers'),
  16862. ue = e('./TimingData'),
  16863. de = new N(t);
  16864. (N.level = V.logLevel), (N.consoleEnabled = V.console), i();
  16865. }
  16866. }.call(this, '/js/main.js'));
  16867. },
  16868. {
  16869. './DisplayController': 1,
  16870. './TimingData': 2,
  16871. './ab': 3,
  16872. './analytics': 4,
  16873. './cameras/PanoramaCamera': 7,
  16874. './controls/CameraControls': 9,
  16875. './director': 15,
  16876. './effects': 16,
  16877. './enum/PanoSizeClass': 36,
  16878. './enum/PanoramaEvents': 37,
  16879. './enum/RenderLayers': 41,
  16880. './enum/SceneRendererEvents': 43,
  16881. './enum/Viewmode': 51,
  16882. './featureflags': 59,
  16883. './gui/error': 64,
  16884. './gui/gui': 65,
  16885. './gui/memoryUsage': 73,
  16886. './label/LabelDisplayController': 91,
  16887. './lib/array-polyfill': 92,
  16888. './lib/performance-polyfill': 95,
  16889. './lib/postprocessing/EffectComposer.js': 96,
  16890. './lib/postprocessing/MaskPass.js': 97,
  16891. './lib/postprocessing/RenderPass.js': 98,
  16892. './lib/postprocessing/ShaderPass.js': 99,
  16893. './lib/shaders/CopyShader.js': 100,
  16894. './lib/shaders/HorizontalBlurShader.js': 101,
  16895. './lib/shaders/VerticalBlurShader.js': 102,
  16896. './lib/three75-shim': 103,
  16897. './localization/localize': 108,
  16898. './tag/tagManager': 124,
  16899. './model/ModelManager': 140,
  16900. './objects/Panorama': 148,
  16901. './objects/Skybox': 152,
  16902. './player': 155,
  16903. './preloaders': 156,
  16904. './scene/QuickstartManager': 157,
  16905. './scene/SceneRenderer': 158,
  16906. './sdk/automation.js': 164,
  16907. './settings': 166,
  16908. './showcase': 168,
  16909. './tile/PanoRenderer': 169,
  16910. './tile/QualityManager.js': 170,
  16911. './tile/TileDownloader': 171,
  16912. './util/PanoramaCollection': 178,
  16913. './util/ajax': 181,
  16914. './util/browser': 182,
  16915. './util/camera': 183,
  16916. './util/common': 185,
  16917. './util/lerp': 188,
  16918. './util/logger': 189,
  16919. './util/math': 190,
  16920. './util/sentry': 192,
  16921. './util/showcase': 193,
  16922. './util/transitions': 195,
  16923. events: 202,
  16924. 'promise-polyfill': 213,
  16925. three: 217,
  16926. },
  16927. ],
  16928. 117: [
  16929. function (e, t, i) {
  16930. 'use strict';
  16931. function n(e) {
  16932. e = e || {};
  16933. r.RawShaderMaterial.call(
  16934. this,
  16935. a.extendObject(
  16936. {
  16937. fragmentShader: o.cube.fragmentShader,
  16938. vertexShader: o.cube.vertexShader,
  16939. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  16940. name: 'CubemapMaterial',
  16941. },
  16942. e
  16943. )
  16944. );
  16945. }
  16946. var r = e('three'),
  16947. o = e('../shaders'),
  16948. a = e('../util/common');
  16949. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16950. (n.prototype.constructor = n),
  16951. (t.exports = n);
  16952. },
  16953. {
  16954. '../shaders': 167,
  16955. '../util/common': 185,
  16956. three: 217,
  16957. },
  16958. ],
  16959. 118: [
  16960. function (e, t, i) {
  16961. 'use strict';
  16962. function n(e) {
  16963. e = e || {};
  16964. r.RawShaderMaterial.call(
  16965. this,
  16966. a.extendObject(
  16967. {
  16968. fragmentShader: o.model.fragmentShader,
  16969. vertexShader: o.model.vertexShader,
  16970. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  16971. name: 'ModelTextureMaterial',
  16972. },
  16973. e
  16974. )
  16975. );
  16976. }
  16977. var r = e('three'),
  16978. o = e('../shaders'),
  16979. a = e('../util/common');
  16980. (n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16981. (n.prototype.constructor = n),
  16982. (n.prototype.setProjectedPanos = function (e, t, i) {
  16983. i && (this.uniforms.progress.value = 0),
  16984. e.ensureSkyboxReadyForRender(),
  16985. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  16986. this.uniforms.pano0Position.value.copy(e.position),
  16987. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  16988. t.ensureSkyboxReadyForRender(),
  16989. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  16990. this.uniforms.pano1Position.value.copy(t.position),
  16991. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld);
  16992. }),
  16993. /* n.prototype.setEyeDir = function(dir, pos) {//加
  16994. this.uniforms.eyeDir.value.copy(dir)
  16995. this.uniforms.eyePos.value.copy(pos)
  16996. }
  16997. n.prototype.setBendCameraQua = function(matrix) {//加
  16998. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  16999. } */
  17000. (t.exports = n);
  17001. },
  17002. {
  17003. '../shaders': 167,
  17004. '../util/common': 185,
  17005. three: 217,
  17006. },
  17007. ],
  17008. 119: [
  17009. function (e, t, i) {
  17010. (function (i) {
  17011. 'use strict';
  17012. function n(e, t, i, n) {
  17013. (this.div = null),
  17014. (this.body = null),
  17015. (this.label = e),
  17016. (this.description = t),
  17017. (this.parsedDescription = []),
  17018. (this.media = i || {
  17019. type: null,
  17020. }),
  17021. (this.loadingSpinner = null),
  17022. (this.parser = new r({
  17023. supportLinks: !u.valueFromHash('mls'),
  17024. keepLinkLabels: !0,
  17025. })),
  17026. (this.state = I.CLOSED),
  17027. (this.orientation = ''),
  17028. (this.initialTransform = ''),
  17029. (this.hovering = !1),
  17030. (this.openTransition = null),
  17031. (this.closeTransition = null),
  17032. (this.openPromise = null),
  17033. (this.closePromise = null),
  17034. (this.animationTransition = null),
  17035. (this.animationScale = 0);
  17036. }
  17037. var r = e('../Parser/DescriptionParser'),
  17038. o = e('../Media/Link'),
  17039. a = e('../Media/Image'),
  17040. s = e('../Media/EmbedlyPlayer'),
  17041. l = e('../Media/EmbedlyEmbed'),
  17042. c = e('../../util/transitions'),
  17043. h = e('../../util/lerp'),
  17044. u = e('../../util/browser'),
  17045. d = e('./BillboardEvent'),
  17046. p = e('../Media/MediaEvent'),
  17047. f = e('../Parser/DescriptionChunkType'),
  17048. g = e('events').EventEmitter,
  17049. m = e('./billboardSettings'),
  17050. v = e('./overlaySettings'),
  17051. A = e('../../util/logger'),
  17052. y = new A(i),
  17053. C = document.getElementById('tag-billboards');
  17054. C.addEventListener('touchend', function (e) {
  17055. C.style.pointerEvents = 'none';
  17056. }),
  17057. C.addEventListener('touchcancel', function (e) {
  17058. C.style.pointerEvents = 'none';
  17059. });
  17060. var I = {
  17061. CLOSED: 'closed',
  17062. OPENING: 'opening',
  17063. OPEN: 'open',
  17064. CLOSING: 'closing',
  17065. ACTIVE: 'active',
  17066. };
  17067. (n.prototype = Object.create(g.prototype)),
  17068. (n.prototype.build = function (e) {
  17069. this.parsedDescription = this.parser.parse(this.description);
  17070. var t = document.createElement('div');
  17071. (t.className = 'tag-container has-hotzone'),
  17072. (this.div = t),
  17073. (this.body = document.createElement('div')),
  17074. (this.body.className = 'tag-body');
  17075. var i = document.createElement('div');
  17076. i.classList.add('tag-content');
  17077. var n = document.createElement('div');
  17078. n.classList.add('tag-text-content');
  17079. var r = document.createElement('div');
  17080. (r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r);
  17081. var o = document.createElement('div');
  17082. (o.className = 'tag-desc'),
  17083. n.appendChild(o),
  17084. i.appendChild(n),
  17085. this.body.appendChild(i),
  17086. this.appendDescriptionElements(this.parsedDescription, o),
  17087. this.appendMedia(),
  17088. t.appendChild(this.body),
  17089. C.appendChild(t),
  17090. this.bindEvents(t, this.body);
  17091. }),
  17092. (n.prototype.bindEvents = function (e, t) {
  17093. var i = function (e) {
  17094. return function (t) {
  17095. if (!this.div.classList.contains('overlay')) {
  17096. var i,
  17097. n = document.getElementById('player');
  17098. try {
  17099. i = new MouseEvent(e, t);
  17100. } catch (n) {
  17101. (i = document.createEvent('MouseEvents')),
  17102. i.initMouseEvent(
  17103. e,
  17104. t.bubbles,
  17105. t.cancelable,
  17106. t.view,
  17107. t.detail,
  17108. t.screenX,
  17109. t.screenY,
  17110. t.clientX,
  17111. t.clientY,
  17112. t.ctrlKey,
  17113. t.altKey,
  17114. t.shiftKey,
  17115. t.metaKey,
  17116. t.button,
  17117. t.relatedTarget
  17118. );
  17119. }
  17120. n.dispatchEvent(i);
  17121. }
  17122. };
  17123. };
  17124. t.addEventListener('mousedown', function (e) {
  17125. e.stopPropagation();
  17126. }),
  17127. t.addEventListener('mouseup', function (e) {
  17128. e.stopPropagation();
  17129. }),
  17130. e.addEventListener('touchstart', function (e) {
  17131. C.style.pointerEvents = 'auto';
  17132. }),
  17133. e.addEventListener('mousedown', i('mousedown').bind(this)),
  17134. e.addEventListener('mouseup', i('mouseup').bind(this)),
  17135. t.addEventListener(
  17136. 'mouseover',
  17137. function (t) {
  17138. this.state === I.OPEN && e.classList.remove('has-hotzone');
  17139. }.bind(this)
  17140. ),
  17141. e.addEventListener(
  17142. 'mouseenter',
  17143. function (e) {
  17144. this.state !== I.CLOSING && ((this.hovering = !0), this.emit(d.ENTER));
  17145. }.bind(this)
  17146. ),
  17147. e.addEventListener(
  17148. 'mouseleave',
  17149. function (e) {
  17150. (this.hovering = !1), this.emit(d.LEAVE);
  17151. }.bind(this)
  17152. ),
  17153. e.addEventListener('gesturestart', function (e) {
  17154. e.preventDefault();
  17155. });
  17156. var n = e.querySelector('.tag-text-content'),
  17157. r = 0;
  17158. n.addEventListener('touchstart', function (e) {
  17159. r = e.changedTouches[0].clientY;
  17160. }),
  17161. n.addEventListener('touchmove', function (t) {
  17162. function i(e) {
  17163. e &&
  17164. ((0 === e.scrollTop && t.changedTouches[0].clientY > r) ||
  17165. (e.scrollTop + e.clientHeight - e.scrollHeight === 0 &&
  17166. t.changedTouches[0].clientY < r)) &&
  17167. t.preventDefault();
  17168. }
  17169. return e.classList.contains('overlay')
  17170. ? i(this.querySelector('.tag-desc'))
  17171. : void i(this);
  17172. }),
  17173. e.addEventListener('touchmove', function (e) {
  17174. 0 ===
  17175. (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) &&
  17176. e.preventDefault();
  17177. });
  17178. }),
  17179. (n.prototype.appendDescriptionElements = function (e, t) {
  17180. e.length > 0 && this.div.classList.add('has-text'),
  17181. e.forEach(
  17182. function (e, i) {
  17183. switch (e.type) {
  17184. case f.TEXT:
  17185. t.appendChild(this.createTextElement(e.text));
  17186. break;
  17187. case f.LINK:
  17188. t.appendChild(this.createLinkElement(e.link));
  17189. }
  17190. }.bind(this)
  17191. );
  17192. }),
  17193. (n.prototype.appendLoadingSpinner = function () {
  17194. (this.loadingSpinner = document.createElement('div')),
  17195. this.loadingSpinner.classList.add('loading-spinner');
  17196. var e = document.createElement('div');
  17197. e.classList.add('gui-spinner-icon'),
  17198. this.loadingSpinner.appendChild(e),
  17199. this.body.appendChild(this.loadingSpinner);
  17200. }),
  17201. (n.prototype.onMediaLoadFinished = function () {
  17202. this.loadingSpinner &&
  17203. (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  17204. this.applyOrientation(this.orientation),
  17205. (this.loadingSpinner = null));
  17206. }),
  17207. (n.prototype.appendMedia = function () {
  17208. if (
  17209. this.media &&
  17210. this.media.type &&
  17211. 'error' !== this.media.type &&
  17212. (!u.valueFromHash('mls', 0) || this.media.type === f.IMAGE)
  17213. ) {
  17214. this.appendLoadingSpinner();
  17215. var e = document.createElement('div');
  17216. e.classList.add('tag-media-content');
  17217. var t = document.createElement('i');
  17218. switch (
  17219. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  17220. t.classList.add(e);
  17221. }),
  17222. this.body.appendChild(t),
  17223. this.body.appendChild(e),
  17224. this.media.type)
  17225. ) {
  17226. case f.IMAGE:
  17227. e.appendChild(this.createImageElement(this.media, this.body));
  17228. break;
  17229. case f.VIDEO:
  17230. e.appendChild(this.createVideoElement(this.media, this.body));
  17231. break;
  17232. case f.RICH:
  17233. e.appendChild(this.createEmbedElement(this.media, this.body));
  17234. }
  17235. }
  17236. }),
  17237. (n.prototype.createTextElement = function (e) {
  17238. var t = document.createElement('span');
  17239. return (t.textContent = e), t;
  17240. });
  17241. (n.prototype.createLinkElement = function (e) {
  17242. var t = new o(e);
  17243. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)), t.createDomElement();
  17244. }),
  17245. (n.prototype.createImageElement = function (e, t) {
  17246. function i() {
  17247. function e() {
  17248. m ||
  17249. (r.classList.remove('view-image'),
  17250. c.classList.add('overlay'),
  17251. i(),
  17252. window.addEventListener('resize', b),
  17253. c.addEventListener('click', a),
  17254. g.addEventListener('click', l),
  17255. f.addEventListener('click', s),
  17256. (m = !0),
  17257. o.emit(p.IMAGE_OPENED));
  17258. }
  17259. function i() {
  17260. t.classList.add('show-info'),
  17261. h.classList.remove('collapsible'),
  17262. (h.style.height = '');
  17263. var e = parseFloat(getComputedStyle(I).lineHeight),
  17264. i = y + e,
  17265. r = c.clientWidth - 2 * v.boundaryWidth - C,
  17266. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  17267. s = a,
  17268. l = s * n.aspect;
  17269. l > r && ((l = r), (s = l / n.aspect)),
  17270. s > a && ((s = a), (l = s * n.aspect)),
  17271. (l += C),
  17272. (s += C + i),
  17273. (t.style.width = l + 'px'),
  17274. (t.style.height = s + 'px'),
  17275. (u.style.paddingTop = e + C + 'px'),
  17276. o.description.length > 0 &&
  17277. (h.classList.add('collapsible'),
  17278. (h.style.height = h.clientHeight + 12 + 'px'),
  17279. (E.style.height = 'calc(100% - ' + I.clientHeight + 'px)'));
  17280. }
  17281. function a(e) {
  17282. e.target === c && s();
  17283. }
  17284. function s() {
  17285. m &&
  17286. ((m = !1),
  17287. r.classList.add('view-image'),
  17288. c.classList.remove('overlay'),
  17289. (h.style.height = ''),
  17290. (u.style.paddingTop = ''),
  17291. (t.style.width = ''),
  17292. (t.style.height = ''),
  17293. window.removeEventListener('resize', b),
  17294. c.removeEventListener('click', a),
  17295. g.removeEventListener('click', l),
  17296. f.removeEventListener('click', s),
  17297. o.emit(p.IMAGE_CLOSED),
  17298. o.close(!0));
  17299. }
  17300. function l(e) {
  17301. t.classList.toggle('show-info');
  17302. }
  17303. var c = o.div,
  17304. h = c.getElementsByClassName('tag-content')[0],
  17305. u = c.getElementsByClassName('tag-media-content')[0],
  17306. f = t.getElementsByClassName('close')[0],
  17307. g = h.getElementsByClassName('tag-label')[0];
  17308. c.classList.add('has-image'),
  17309. r.classList.add('view-image'),
  17310. c.classList.add(n.aspect >= 1 ? 'image-landscape' : 'image-portrait'),
  17311. o.applyOrientation(o.orientation);
  17312. var m = !1,
  17313. A = getComputedStyle(h),
  17314. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  17315. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  17316. I = h.querySelector('.tag-label'),
  17317. E = h.querySelector('.tag-desc'),
  17318. b = (function () {
  17319. var e,
  17320. t,
  17321. n = 0;
  17322. return function () {
  17323. clearInterval(e),
  17324. clearTimeout(t),
  17325. (e = setInterval(function () {
  17326. var e = c.clientHeight;
  17327. n !== e && (i(), (n = e));
  17328. }, 100)),
  17329. (t = setTimeout(clearInterval.bind(this, e), 1e3));
  17330. };
  17331. })();
  17332. n.on(p.IMAGE_OPENING, e),
  17333. o.on(d.ACTIVATE, e),
  17334. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  17335. o.on(d.CLOSING, s);
  17336. }
  17337. var n = new a(),
  17338. r = n.createDomElement();
  17339. this.once(d.OPENED, function () {
  17340. n.load(e.src)
  17341. .then(i)
  17342. .catch(function (t) {
  17343. y.warn('Failed to load image:', e.src), y.warn('with error:', t);
  17344. })
  17345. .then(this.onMediaLoadFinished.bind(this));
  17346. });
  17347. var o = this;
  17348. return r;
  17349. }),
  17350. (n.prototype.createVideoElement = function (e, t) {
  17351. var i = new s({
  17352. autoPlay: !0,
  17353. autoResume: !0,
  17354. startMuted: !1,
  17355. loop: !1,
  17356. }),
  17357. n = i.createDomElement();
  17358. return (
  17359. this.once(
  17360. d.OPENED,
  17361. function () {
  17362. i.load(e.src)
  17363. .then(
  17364. function () {
  17365. this.div.classList.add('has-video'),
  17366. (this.state !== I.OPEN && this.state !== I.ACTIVE) ||
  17367. (i.show(), i.play()),
  17368. this.on(d.OPENING, i.show.bind(i)),
  17369. this.on(d.OPENED, i.play.bind(i)),
  17370. this.on(d.CLOSING, i.pause.bind(i)),
  17371. this.on(d.CLOSED, i.hide.bind(i));
  17372. }.bind(this)
  17373. )
  17374. .catch(function (t) {
  17375. y.warn('Failed to embed video:', e.src), y.warn('with error:', t);
  17376. })
  17377. .then(this.onMediaLoadFinished.bind(this));
  17378. }.bind(this)
  17379. ),
  17380. n
  17381. );
  17382. }),
  17383. (n.prototype.createEmbedElement = function (e, t) {
  17384. var i = new l(),
  17385. n = i.createDomElement();
  17386. return (
  17387. this.once(
  17388. d.OPENED,
  17389. function () {
  17390. i.load(e.src)
  17391. .then(
  17392. function () {
  17393. this.div.classList.add('has-embed'),
  17394. (this.state !== I.OPEN && this.state !== I.ACTIVE) || i.show(),
  17395. this.applyOrientation(this.orientation),
  17396. this.on(d.OPENING, i.show.bind(i)),
  17397. this.on(d.CLOSED, i.hide.bind(i));
  17398. }.bind(this)
  17399. )
  17400. .catch(function (t) {
  17401. y.warn('Failed to embed:', e.src), y.warn('with error:', t);
  17402. })
  17403. .then(this.onMediaLoadFinished.bind(this));
  17404. }.bind(this)
  17405. ),
  17406. n
  17407. );
  17408. }),
  17409. (n.prototype.open = function (e) {
  17410. return (
  17411. (this.openPromise = $.Deferred()),
  17412. this.state === I.ACTIVE
  17413. ? this.openPromise.resolve().promise()
  17414. : (this.hovering || this.div.classList.add('has-hotzone'),
  17415. this.openTransition
  17416. ? e && this.setActiveState()
  17417. : (this.openTransition = c.setTimeout(
  17418. function () {
  17419. this.state !== I.OPEN &&
  17420. (this.emit(d.OPENING),
  17421. e && this.emit(d.ACTIVATING),
  17422. (this.state = I.OPENING),
  17423. this.animateOpen(
  17424. function () {
  17425. e && this.setActiveState(), this.openPromise.resolve();
  17426. }.bind(this)
  17427. ));
  17428. }.bind(this),
  17429. m.animation.openDelay
  17430. )),
  17431. c.cancel(this.closeTransition),
  17432. this.closePromise && this.closePromise.reject(),
  17433. (this.closeTransition = void 0),
  17434. this.openPromise.promise())
  17435. );
  17436. }),
  17437. (n.prototype.close = function (e) {
  17438. return (
  17439. (this.closePromise = $.Deferred()),
  17440. !e && this.hovering
  17441. ? this.closePromise.reject().promise()
  17442. : (this.closeTransition ||
  17443. (this.closeTransition = c.setTimeout(
  17444. function () {
  17445. this.state !== I.CLOSED &&
  17446. (this.emit(d.CLOSING), (this.state = I.CLOSING), this.animateClose());
  17447. }.bind(this),
  17448. m.animation.closeDelay
  17449. )),
  17450. c.cancel(this.openTransition),
  17451. this.openPromise && this.openPromise.reject(),
  17452. (this.openTransition = void 0),
  17453. this.closePromise.resolve(),
  17454. this.closePromise.promise())
  17455. );
  17456. }),
  17457. (n.prototype.setActiveState = function () {
  17458. this.state !== I.CLOSED &&
  17459. ((this.state = I.ACTIVE),
  17460. this.emit(d.ACTIVATE),
  17461. this.div.classList.remove('has-hotzone'));
  17462. }),
  17463. (n.prototype.animateOpen = function (e) {
  17464. if (this.state === I.OPENING) {
  17465. if ((c.cancel(this.animationTransition), u.detectSamsungNative()))
  17466. return (
  17467. (this.boardOrientation = null),
  17468. (this.div.style.visibility = 'visible'),
  17469. this.emit(d.OPENED),
  17470. (this.state = I.OPEN),
  17471. void (e && e())
  17472. );
  17473. (this.div.style.webkitTransform = 'scale(0)'),
  17474. (this.div.style.transform = 'scale(0)'),
  17475. (this.div.style.visibility = 'visible'),
  17476. (this.animationTransition = c.start(
  17477. h.property(this, 'animationScale', 1),
  17478. m.animation.openDuration,
  17479. function () {
  17480. this.emit(d.OPENED), (this.state = I.OPEN), e && e();
  17481. }.bind(this)
  17482. ));
  17483. }
  17484. }),
  17485. (n.prototype.animateClose = function (e) {
  17486. this.state === I.CLOSING &&
  17487. (c.cancel(this.animationTransition),
  17488. (this.animationTransition = c.start(
  17489. h.property(this, 'animationScale', 0),
  17490. m.animation.closeDuration,
  17491. function () {
  17492. this.emit(d.CLOSED),
  17493. (this.state = I.CLOSED),
  17494. (this.div.style.visibility = 'hidden'),
  17495. this.div.classList.contains('has-hotzone') ||
  17496. this.div.classList.add('has-hotzone'),
  17497. e && e();
  17498. }.bind(this)
  17499. )));
  17500. }),
  17501. (n.prototype.needsUpdate = function () {
  17502. return this.state !== I.CLOSED;
  17503. }),
  17504. (n.prototype.update = function (e, t) {
  17505. if (this.needsUpdate()) {
  17506. var i = (this.updateOrientation(e), this.calcScale(t)),
  17507. n = {
  17508. x: ((e.x + 1) * $('#player').width()) / 2,
  17509. y: ((e.y + 1) * $('#player').height()) / 2,
  17510. };
  17511. (this.div.screenTransform =
  17512. this.initialTransform +
  17513. ' translate(' +
  17514. n.x +
  17515. 'px, ' +
  17516. n.y +
  17517. 'px) scale(' +
  17518. i * this.animationScale +
  17519. ')'),
  17520. (this.div.style.webkitTransform = this.div.screenTransform),
  17521. (this.div.style.transform = this.div.screenTransform);
  17522. }
  17523. }),
  17524. (n.prototype.getDimensions = function () {
  17525. return this.div.getBoundingClientRect();
  17526. }),
  17527. (n.prototype.calcScale = function (e) {
  17528. return Math.sqrt(e / 40) * m.boardToDiscRatio;
  17529. }),
  17530. (n.prototype.updateOrientation = function (e) {
  17531. if (this.state !== I.ACTIVE) {
  17532. var t = 1 / 3,
  17533. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  17534. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  17535. r = '';
  17536. (r += 0 === n ? 'right' : 2 === n ? 'left' : ''),
  17537. (r += 0 === i ? '-down' : 2 === i ? '-up' : ''),
  17538. 1 === n &&
  17539. ((r = 0 === i ? 'bottom' : 2 === i ? 'top' : ''),
  17540. 1 === i &&
  17541. (r =
  17542. $('#player').width() > $('#player').height()
  17543. ? e.x < 0
  17544. ? 'right'
  17545. : 'left'
  17546. : e.y < 0
  17547. ? 'bottom'
  17548. : 'top')),
  17549. (1 === n && 1 === i && r === this.orientation) || this.applyOrientation(r);
  17550. }
  17551. }),
  17552. (n.prototype.applyOrientation = function (e) {
  17553. (this.div.style.transform = this.div.style.webkitTransform = ''),
  17554. this.div.classList.remove('tag-container-' + this.orientation),
  17555. this.div.classList.add('tag-container-' + e);
  17556. var t = window.getComputedStyle(this.div);
  17557. (this.initialTransform = t.transform || t.webkitTransform),
  17558. 'none' === this.initialTransform && (this.initialTransform = '');
  17559. var i = t.transform.slice(7, -1).split(','),
  17560. n = -i[4],
  17561. r = -i[5];
  17562. (this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'),
  17563. (this.div.style.transformOrigin = n + 'px ' + r + 'px'),
  17564. (this.orientation = e);
  17565. }),
  17566. (t.exports = n);
  17567. }.call(this, '/js/tag/Billboard/Billboard.js'));
  17568. },
  17569. {
  17570. '../../util/browser': 182,
  17571. '../../util/lerp': 188,
  17572. '../../util/logger': 189,
  17573. '../../util/transitions': 195,
  17574. '../Media/EmbedlyEmbed': 125,
  17575. '../Media/EmbedlyPlayer': 126,
  17576. '../Media/Image': 128,
  17577. '../Media/Link': 129,
  17578. '../Media/MediaEvent': 131,
  17579. '../Parser/DescriptionChunkType': 133,
  17580. '../Parser/DescriptionParser': 134,
  17581. './BillboardEvent': 120,
  17582. './billboardSettings': 121,
  17583. './overlaySettings': 122,
  17584. events: 202,
  17585. },
  17586. ],
  17587. 120: [
  17588. function (e, t, i) {
  17589. 'use strict';
  17590. t.exports = Object.freeze({
  17591. ENTER: 'billboard.enter',
  17592. LEAVE: 'billboard.leave',
  17593. OPENING: 'billboard.opening',
  17594. OPENED: 'billboard.open',
  17595. CLOSING: 'billboard.closing',
  17596. CLOSED: 'billboard.closed',
  17597. ACTIVATING: 'billboard.activating',
  17598. ACTIVATE: 'billboard.activate',
  17599. });
  17600. },
  17601. {},
  17602. ],
  17603. 121: [
  17604. function (e, t, i) {
  17605. 'use strict';
  17606. t.exports = Object.freeze({
  17607. animation: Object.freeze({
  17608. hoverOnClosing: !1,
  17609. openDelay: 100,
  17610. closeDelay: 50,
  17611. openDuration: 200,
  17612. closeDuration: 100,
  17613. }),
  17614. boardToDiscRatio: 1.2,
  17615. });
  17616. },
  17617. {},
  17618. ],
  17619. 122: [
  17620. function (e, t, i) {
  17621. 'use strict';
  17622. t.exports = Object.freeze({
  17623. boundaryWidth: 30,
  17624. boundaryHeight: 0,
  17625. });
  17626. },
  17627. {},
  17628. ],
  17629. 123: [
  17630. function (e, t, i) {
  17631. //tag
  17632. (function (i) {
  17633. 'use strict';
  17634. function n(e, t, i) {
  17635. var n = i.version || '0';
  17636. '0' !== n && I.info('tag defined using version ' + n),
  17637. (this.model = e),
  17638. (this.sid = t),
  17639. (this.color = new r.Color().set(i.color || l.tagDefault)),
  17640. (this.hoverColor = l._darken(this.color, 0.2)),
  17641. (this.floor = null),
  17642. (this.floorIndex = i.floor),
  17643. (this.mode = s.PANORAMA),
  17644. i.preferred_camera &&
  17645. i.preferred_camera.mode &&
  17646. (this.mode = i.preferred_camera.mode),
  17647. (this.obj3d = null),
  17648. (this.disc = null),
  17649. (this.materials = {
  17650. disc: null,
  17651. pole: null,
  17652. }),
  17653. (this.position = new r.Vector3().copy(i.position)),
  17654. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  17655. (this.discWorldPosition = null),
  17656. (this.discScale = 0.05),
  17657. (this.poleEnabled = i.stem.enabled),
  17658. (this.billboard = new o(i.label, i.description, i.media, this)),
  17659. (this.visibleTransition = null),
  17660. (this.hoveringDisc = !1);
  17661. }
  17662. var r = e('three'),
  17663. o = e('./Billboard/Billboard'),
  17664. a = e('../settings'),
  17665. s = e('../enum/Viewmode'),
  17666. l = e('../enum/Colors'),
  17667. c = e('../enum/RenderLayers'),
  17668. h = e('../enum/RenderOrder'),
  17669. u = (e('../util/common'), e('../util/math')),
  17670. d = e('../util/texture'),
  17671. p = e('../objects/Panorama'),
  17672. f = e('../shaders'),
  17673. g = e('../util/transitions'),
  17674. m = e('../util/lerp'),
  17675. v = e('../util/easing'),
  17676. A = e('./Billboard/BillboardEvent'),
  17677. y = e('events').EventEmitter,
  17678. C = e('../util/logger'),
  17679. I = new C(i),
  17680. E = d.loadBase64(
  17681. '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=='
  17682. ),
  17683. b = d.loadBase64(
  17684. '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'
  17685. ),
  17686. w = new r.PlaneBufferGeometry(1, 1);
  17687. (n.prototype = Object.create(y.prototype)),
  17688. (n.raycaster = new r.Raycaster()),
  17689. (n.prototype.bindEvents = function () {
  17690. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  17691. this.billboard.on(A.LEAVE, this.setFreeState.bind(this));
  17692. }),
  17693. (n.prototype.build = function () {
  17694. return (
  17695. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  17696. this.floor &&
  17697. (this.billboard.build(this.model.sid),
  17698. (this.obj3d = this.buildObject3D()),
  17699. this.floor.add(this.obj3d)),
  17700. this
  17701. );
  17702. }),
  17703. (n.prototype.buildObject3D = function () {
  17704. var e = new r.Object3D();
  17705. e.position.copy(this.position);
  17706. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  17707. (t.bg.value = b),
  17708. (t.mask.value = E),
  17709. t.color.value.copy(this.color),
  17710. (this.materials.disc = new r.RawShaderMaterial({
  17711. transparent: !0,
  17712. vertexShader: f.tagDisc.vertexShader,
  17713. fragmentShader: f.tagDisc.fragmentShader,
  17714. uniforms: t,
  17715. })),
  17716. (this.disc = new r.Mesh(w, this.materials.disc)),
  17717. this.disc.layers.set(c.TAG),
  17718. this.disc.position.copy(this.discPosition),
  17719. (this.disc.renderOrder = h.tagDisc),
  17720. (this.disc.tag = this);
  17721. var i = this.buildPole();
  17722. return (
  17723. i.layers.set(c.TAG),
  17724. (i.renderOrder = h.tagStem),
  17725. e.add(i),
  17726. e.layers.set(c.TAG),
  17727. e.add(this.disc)
  17728. );
  17729. }),
  17730. (n.prototype.buildPole = function () {
  17731. var e = new r.BufferGeometry(),
  17732. t = new Float32Array(6);
  17733. return (
  17734. (t[0] = t[1] = t[2] = 0),
  17735. (t[3] = this.discPosition.x),
  17736. (t[4] = this.discPosition.y),
  17737. (t[5] = this.discPosition.z),
  17738. e.addAttribute('position', new r.BufferAttribute(t, 3)),
  17739. (this.materials.pole = new r.LineBasicMaterial({
  17740. linewidth: a.tags.pole.width,
  17741. color: a.tags.pole.color,
  17742. opacity: 0,
  17743. visible: this.poleEnabled,
  17744. transparent: !0,
  17745. depthWrite: !1,
  17746. })),
  17747. new r.Line(e, this.materials.pole)
  17748. );
  17749. }),
  17750. (n.prototype.setFreeState = function (e) {
  17751. (!e && this.hoveringDisc) ||
  17752. this.billboard.close(e).then(
  17753. function () {
  17754. this.materials.disc.uniforms.color.value = this.color;
  17755. }.bind(this)
  17756. );
  17757. }),
  17758. (n.prototype.setHoverState = function (e) {
  17759. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor);
  17760. }),
  17761. (n.prototype.hide = function (e, t) {
  17762. var i = $.Deferred();
  17763. if (
  17764. 0 === this.materials.disc.uniforms.opacity.value &&
  17765. !g.isRunning(this.visibleTransition)
  17766. )
  17767. return i.resolve().promise();
  17768. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  17769. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity,
  17770. r = t + e,
  17771. o = t / r;
  17772. return (
  17773. (this.visibleTransition = g.start(
  17774. (function (e) {
  17775. var t = m.property(e.materials.disc.uniforms.opacity, 'value', 0),
  17776. i = m.property(e.materials.pole, 'opacity', 0);
  17777. return function (n) {
  17778. t(n), e.materials.pole && i(n);
  17779. };
  17780. })(this),
  17781. r * n,
  17782. function () {
  17783. i.resolve();
  17784. },
  17785. o,
  17786. v[a.warp.blendEasing]
  17787. )),
  17788. i.promise()
  17789. );
  17790. }),
  17791. (n.prototype.show = function (e, t) {
  17792. var i = $.Deferred();
  17793. if (
  17794. this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity &&
  17795. !g.isRunning(this.visibleTransition)
  17796. )
  17797. return i.resolve().promise();
  17798. (e = e || 0), (t = t || 0), g.cancel(this.visibleTransition);
  17799. var n =
  17800. (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) /
  17801. a.tags.disc.opacity,
  17802. r = t + e,
  17803. o = t / r;
  17804. return (
  17805. (this.visibleTransition = g.start(
  17806. (function (e) {
  17807. var t = m.property(
  17808. e.materials.disc.uniforms.opacity,
  17809. 'value',
  17810. a.tags.disc.opacity
  17811. ),
  17812. i = m.property(e.materials.pole, 'opacity', a.tags.pole.opacity);
  17813. return function (n) {
  17814. t(n), e.materials.pole && i(n);
  17815. };
  17816. })(this),
  17817. r * n,
  17818. function () {
  17819. i.resolve();
  17820. },
  17821. o,
  17822. v[a.warp.blendEasing]
  17823. )),
  17824. i.promise()
  17825. );
  17826. }),
  17827. (n.prototype.closestPanoTowardTag = function (e, t) {
  17828. var i = [],
  17829. o = [],
  17830. l = this.disc.getWorldPosition();
  17831. if (e === s.PANORAMA) {
  17832. var c = 0.5,
  17833. h = t.position.clone().sub(l).normalize();
  17834. i.push(p.filters.isPanoAligned()),
  17835. i.push(p.filters.isNeighbourPanoTo(t)),
  17836. i.push(p.filters.inPanoDirection(l, h, c)),
  17837. o.push(p.scoreFunctions.direction(l, h));
  17838. }
  17839. var u = new r.Vector3(),
  17840. d = function (e) {
  17841. u.copy(l).sub(e.position);
  17842. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))),
  17843. i = a.tags.navigate.tiltTolerance;
  17844. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i;
  17845. },
  17846. f = function (e) {
  17847. return (
  17848. Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance ||
  17849. Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  17850. );
  17851. };
  17852. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2));
  17853. var g = this.model.panos.sortByScore(i, o);
  17854. if (a.tags.navigate.lineOfSight) {
  17855. for (var m = 0; m < g.length; m++) {
  17856. var v = g[m].item,
  17857. A = v.position.distanceTo(l);
  17858. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  17859. return null;
  17860. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  17861. var y = n.raycaster.intersectObjects(this.model.colliders);
  17862. if (0 === y.length || y[0].distance > A) return v;
  17863. }
  17864. return null;
  17865. }
  17866. return g.length > 0 && g[0].item;
  17867. }),
  17868. (n.prototype.examine = function (e) {
  17869. var t = e.mode,
  17870. i =
  17871. (a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano)) ||
  17872. e.currentPano,
  17873. n = this.disc.getWorldPosition();
  17874. this.billboard.setActiveState();
  17875. var o = function () {
  17876. var t = this.billboard.getDimensions(),
  17877. n = new r.Vector3();
  17878. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  17879. n.unproject(e.camera),
  17880. e.flyToPano({
  17881. pano: i,
  17882. lookAtPoint: n,
  17883. });
  17884. }.bind(this);
  17885. if (t === s.PANORAMA)
  17886. if (i !== e.currentPano) {
  17887. var l = {
  17888. pano: i,
  17889. lookAtPoint: n,
  17890. duration: null,
  17891. maxDistanceOverride: null,
  17892. skipWarpingCheck: !1,
  17893. };
  17894. e.flyToPano(l, o);
  17895. } else
  17896. setTimeout(
  17897. function () {
  17898. this.billboard.open().then(function () {
  17899. o();
  17900. });
  17901. }.bind(this),
  17902. 0
  17903. );
  17904. else {
  17905. var c = {
  17906. pano: i,
  17907. };
  17908. if (n) {
  17909. var h = new r.Matrix4().lookAt(i.position, n, new r.Vector3(0, 1, 0));
  17910. c.quaternion = new r.Quaternion().setFromRotationMatrix(h);
  17911. }
  17912. (c.callback = o), (c.duration = 1500), (c.mode = s.PANORAMA), e.flyToNewMode(c);
  17913. }
  17914. }),
  17915. (n.prototype.update = (function (e, t) {
  17916. var i = new r.Vector3();
  17917. return function (e, t) {
  17918. (this.discWorldPosition = this.disc.getWorldPosition()),
  17919. this.updateDisc(e, t),
  17920. this.billboard.needsUpdate() &&
  17921. (i.copy(this.discWorldPosition).project(t),
  17922. i.z < 1 && ((i.y *= -1), this.billboard.update(i, this.getDiscRadius(i, t))));
  17923. };
  17924. })()),
  17925. (n.prototype.updateDisc = (function (e, t) {
  17926. var i = new r.Vector3(),
  17927. o = new r.Vector3(),
  17928. l = new r.Vector3(),
  17929. c = new r.Vector3(),
  17930. h = new r.Vector3();
  17931. return function (e, t) {
  17932. var u = a.tags.visibility,
  17933. d = a.tags.disc.scale,
  17934. p =
  17935. e === s.DOLLHOUSE || e === s.FLOORPLAN
  17936. ? a.tags.visibility.visibleDistance
  17937. : t.position.distanceTo(this.discWorldPosition);
  17938. if (
  17939. ((this.obj3d.visible =
  17940. 0 !== this.disc.material.opacity &&
  17941. (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) &&
  17942. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  17943. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  17944. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  17945. this.obj3d.visible)
  17946. ) {
  17947. this.disc.quaternion.copy(t.quaternion);
  17948. var f =
  17949. d.maxSize -
  17950. (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  17951. i.copy(this.discWorldPosition).project(t),
  17952. o.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(i),
  17953. l.set(f / 2, 0, 0).add(o),
  17954. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  17955. h.copy(c).unproject(t);
  17956. var g = h.distanceTo(this.discWorldPosition),
  17957. m = 1 + (a.tags.disc.scale.responsiveness / 100) * (n.viewportScale() - 1);
  17958. (this.discScale = g * m),
  17959. this.disc.scale.set(this.discScale, this.discScale, this.discScale);
  17960. }
  17961. };
  17962. })()),
  17963. (n.prototype.getDiscRadius = (function (e, t) {
  17964. var i = new r.Vector3();
  17965. return function (e, t) {
  17966. return (
  17967. i
  17968. .set(-this.discScale / 2, 0, 0)
  17969. .applyQuaternion(t.quaternion)
  17970. .add(this.discWorldPosition)
  17971. .project(t),
  17972. Math.abs(e.x - i.x) * $('#player').width()
  17973. );
  17974. };
  17975. })()),
  17976. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  17977. return (
  17978. !(e === s.DOLLHOUSE || e === s.FLOORPLAN) ||
  17979. this.model.allFloorsVisible ||
  17980. !this.floor.hidden
  17981. );
  17982. }),
  17983. (n.prototype.offScreen = function (e, t) {
  17984. var i = e.getWorldPosition().project(t);
  17985. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1);
  17986. }),
  17987. (n.viewportScale = function () {
  17988. return (
  17989. (n.viewportWidth === $('#player').width() &&
  17990. n.viewportHeight === $('#player').height()) ||
  17991. ((n.viewportWidth = $('#player').width()),
  17992. (n.viewportHeight = $('#player').height()),
  17993. (n.currentViewportScale = Math.sqrt(
  17994. Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize
  17995. ))),
  17996. n.currentViewportScale
  17997. );
  17998. }),
  17999. (t.exports = n);
  18000. }.call(this, '/js/tag/tag.js'));
  18001. },
  18002. {
  18003. '../enum/Colors': 19,
  18004. '../enum/RenderLayers': 41,
  18005. '../enum/RenderOrder': 42,
  18006. '../enum/Viewmode': 51,
  18007. '../objects/Panorama': 148,
  18008. '../settings': 166,
  18009. '../shaders': 167,
  18010. '../util/common': 185,
  18011. '../util/easing': 186,
  18012. '../util/lerp': 188,
  18013. '../util/logger': 189,
  18014. '../util/math': 190,
  18015. '../util/texture': 194,
  18016. '../util/transitions': 195,
  18017. './Billboard/Billboard': 119,
  18018. './Billboard/BillboardEvent': 120,
  18019. events: 202,
  18020. three: 217,
  18021. },
  18022. ],
  18023. 124: [
  18024. function (e, t, i) {
  18025. (function (i) {
  18026. 'use strict';
  18027. function n() {
  18028. (this.tagState = y.IDLE),
  18029. (this.intersectTag = null),
  18030. (this.hoveredTag = null),
  18031. (this.activeTag = null),
  18032. (this.tagDiscs = []),
  18033. (this.raycaster = new r.Raycaster()),
  18034. (this.modelManager = null),
  18035. (this.player = null),
  18036. (this.totaltags = 0),
  18037. (this.navigatingViaTag = !1),
  18038. (this.enabled = !1);
  18039. }
  18040. var r = e('three'),
  18041. o = e('../util/logger'),
  18042. a = e('../util/common'),
  18043. s = e('../controls/serializer'),
  18044. l = e('../objects/Snapshot'),
  18045. c = e('../settings'),
  18046. h = e('./Billboard/BillboardEvent'),
  18047. u = e('./Media/MediaEvent'),
  18048. d = e('./Media/LinkType'),
  18049. p = e('../enum/Viewmode'),
  18050. f = e('../enum/WarpStyle'),
  18051. g = e('../enum/BlackoutStyle'),
  18052. m = e('../enum/ModelManagerEvents'),
  18053. v = e('../enum/tagEvents'),
  18054. A = e('../enum/PlayerEvents'),
  18055. y = (e('../util/lerp'), e('../enum/TagStates')),
  18056. C = e('events').EventEmitter,
  18057. I = new o(i);
  18058. a.extend(n, C),
  18059. (n.prototype.init = function (e, t) {
  18060. (this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents();
  18061. }),
  18062. (n.prototype.update = function (e) {
  18063. this.updateTags(
  18064. this.player.mode,
  18065. this.player.camera,
  18066. this.player.currentPano,
  18067. this.player.flying
  18068. );
  18069. }),
  18070. (n.prototype.updateTags = function (e, t, i, n) {
  18071. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n);
  18072. }),
  18073. (n.prototype.updateModel = function () {
  18074. (this.model = this.modelManager.getActiveModel()),
  18075. this.gettagsFromModel(),
  18076. (this.totaltags = Object.keys(this.model.tags).length);
  18077. }),
  18078. (n.prototype.gettagsFromModel = function () {
  18079. this.tagDiscs = [];
  18080. for (var e in this.model.tags) {
  18081. var t = this.model.tags[e].disc;
  18082. t && this.tagDiscs.push(t);
  18083. }
  18084. }),
  18085. (n.prototype.bindEvents = function () {
  18086. function e() {
  18087. Object.keys(this.model.tags).forEach(
  18088. function (e) {
  18089. var t = this.model.tags[e];
  18090. t.bindEvents(),
  18091. t.billboard.on(
  18092. u.LINK_CLICK,
  18093. function (e) {
  18094. e.type === d.NAVIGATION && this.navigateViaLink(e.url);
  18095. }.bind(this)
  18096. ),
  18097. t.billboard.on(
  18098. u.IMAGE_OPENED,
  18099. function () {
  18100. (this.tagState = y.EXAMINE), this.emit(u.IMAGE_OPENED);
  18101. }.bind(this)
  18102. ),
  18103. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this));
  18104. }.bind(this)
  18105. );
  18106. }
  18107. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  18108. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  18109. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  18110. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  18111. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  18112. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  18113. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  18114. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  18115. e.call(this);
  18116. }),
  18117. (n.prototype.navigateViaLink = function (e) {
  18118. var t = s.deserialize(e);
  18119. if (t)
  18120. if (t.mode === p.PANORAMA) {
  18121. try {
  18122. this.player.model.panos.get(t.panoId);
  18123. } catch (e) {
  18124. return void I.warn('Unable to find panorama location', t.panoId);
  18125. }
  18126. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK);
  18127. } else {
  18128. var i = {
  18129. cameraMode: t.mode,
  18130. position: t.position,
  18131. quaternion: t.quaternion,
  18132. scanId: t.panoId,
  18133. orthoZoom: t.zoom,
  18134. floorVisibility: t.floorVisibility,
  18135. thumbUrl: null,
  18136. name: null,
  18137. };
  18138. this.player.flyToNewMode({
  18139. mode: t.mode,
  18140. duration: c.warp.outsideTime,
  18141. warpDest: new l(i),
  18142. force: !0,
  18143. });
  18144. }
  18145. }),
  18146. (n.prototype.handleWarpStart = function (e, t, i, n) {
  18147. this.dismissExaminedTag(),
  18148. t === f.BLACK &&
  18149. ((null !== n && void 0 !== n) || (n = c.warp.teleportTime),
  18150. e && (i = g.END),
  18151. this.hideShowTagsForBlackoutStyle(i, n));
  18152. }),
  18153. (n.prototype.handleWarpInterruption = function (e, t, i) {
  18154. (null !== i && void 0 !== i) || (i = c.warp.teleportTime),
  18155. this.hideShowTagsForBlackoutStyle(t, i);
  18156. }),
  18157. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  18158. var i = 0,
  18159. n = 0,
  18160. r = t / 2;
  18161. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  18162. case g.END:
  18163. this.hideAlltags(r);
  18164. break;
  18165. case g.BEGINNING:
  18166. this.hideAlltags().done(this.showAlltags.bind(this, r));
  18167. break;
  18168. case g.NONE:
  18169. break;
  18170. case g.MIDDLE:
  18171. (i = r),
  18172. (n = r),
  18173. this.hideAlltags(n),
  18174. setTimeout(
  18175. function () {
  18176. this.showAlltags(i);
  18177. }.bind(this),
  18178. n
  18179. );
  18180. break;
  18181. case g.FADEIN:
  18182. setTimeout(
  18183. function () {
  18184. this.showAlltags(r);
  18185. }.bind(this),
  18186. r
  18187. );
  18188. }
  18189. }),
  18190. (n.prototype.onPlayerModeChanging = function (e, t) {
  18191. t !== p.PANORAMA && this.dismissExaminedTag(),
  18192. t === p.PANORAMA &&
  18193. player.currentPano &&
  18194. !player.currentPano.isAligned() &&
  18195. (t = p.OUTDOOR);
  18196. var i = t !== p.OUTDOOR;
  18197. i !== this.model.tagsShown &&
  18198. (i
  18199. ? this.showAlltags(c.tags.startup.fadeInDuration)
  18200. : this.hideAlltags(c.tags.startup.fadeInDuration));
  18201. }),
  18202. (n.prototype.onPanoChange = function (e, t) {
  18203. var i = this.navigatingViaTag;
  18204. if (((this.navigatingViaTag = !1), !i)) {
  18205. this.dismissExaminedTag();
  18206. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  18207. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  18208. n !== r &&
  18209. (r === p.PANORAMA
  18210. ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0)
  18211. : this.hideAlltags(c.tags.startup.fadeInDuration));
  18212. }
  18213. }),
  18214. (n.prototype.onPlayerReady = function (e, t, i) {
  18215. this.startAlltags(e, t ? i : null);
  18216. }),
  18217. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  18218. this.updateClosestTags(e);
  18219. }),
  18220. (n.prototype.dismissExaminedTag = function () {
  18221. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  18222. this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null));
  18223. }),
  18224. (n.prototype.startAlltags = function (e, t) {
  18225. (this.model.shouldShowtags = c.tags.enabled),
  18226. (this.enabled = !0),
  18227. e ||
  18228. (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  18229. t &&
  18230. setTimeout(
  18231. function () {
  18232. this.activateTag(this.model.getTagBySid(t));
  18233. }.bind(this),
  18234. c.tags.startup.fadeInDuration / 2
  18235. ));
  18236. }),
  18237. (n.prototype.showAlltags = function (e, t, i) {
  18238. function n() {
  18239. o++, o === this.totaltags && ((this.model.tagsShown = !0), r.resolve());
  18240. }
  18241. var r = $.Deferred();
  18242. if (
  18243. (!i &&
  18244. this.player.mode === p.PANORAMA &&
  18245. this.player.currentPano &&
  18246. !this.player.currentPano.isAligned()) ||
  18247. !this.model.shouldShowtags
  18248. )
  18249. return r.resolve().promise();
  18250. var o = 0;
  18251. for (var a in this.model.tags) {
  18252. var s = this.model.tags[a];
  18253. s.show(e, t).done(n.bind(this));
  18254. }
  18255. return r.promise();
  18256. }),
  18257. (n.prototype.hideAlltags = function (e, t) {
  18258. function i() {
  18259. r++, r === this.totaltags && ((this.model.tagsShown = !1), n.resolve());
  18260. }
  18261. var n = $.Deferred(),
  18262. r = 0;
  18263. for (var o in this.model.tags) {
  18264. var a = this.model.tags[o];
  18265. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag();
  18266. }
  18267. return n.promise();
  18268. }),
  18269. (n.prototype.enableHovering = function () {
  18270. this.enabled = !0;
  18271. }),
  18272. (n.prototype.disableHovering = function () {
  18273. this.enabled = !1;
  18274. }),
  18275. (n.prototype.activateTag = function (e, t) {
  18276. (t = t || y.EXAMINE),
  18277. (this.activeTag = e),
  18278. (this.activeTag.hoveringDisc = !0),
  18279. this.activeTag.setHoverState(t === y.EXAMINE),
  18280. (this.tagState = t),
  18281. this.emit(v.TagActivated, e);
  18282. }),
  18283. (n.prototype.dismissActiveTag = function () {
  18284. (this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0);
  18285. var e = this.activeTag;
  18286. (this.activeTag = null), (this.tagState = y.IDLE), this.emit(v.TagDismissed, e);
  18287. }),
  18288. (n.prototype.clickedOnTag = function (e) {
  18289. var t = function () {
  18290. (this.navigatingViaTag = !0),
  18291. this.activeTag.examine(this.player),
  18292. this.emit(v.TagNavigation, this.activeTag);
  18293. }.bind(this);
  18294. return this.tagState !== y.EXAMINE
  18295. ? (this.activateTag(this.intersectTag, y.EXAMINE),
  18296. (this.activeTag = this.intersectTag),
  18297. t(),
  18298. !0)
  18299. : (this.dismissActiveTag(), !1);
  18300. }),
  18301. (n.prototype.intersecttag = (function () {
  18302. var e = new r.Vector3(),
  18303. t = new r.Vector3(),
  18304. i = new r.Vector3();
  18305. return function (n, r, o) {
  18306. if (!this.enabled) return null;
  18307. var a = null,
  18308. s = this.tagDiscs.filter(function (e) {
  18309. return e.parent.visible;
  18310. });
  18311. if (s.length > 0) {
  18312. var l = this.model.floors.reduce(function (e, t) {
  18313. return t.hidden ? e : e.concat(t.collider.children);
  18314. }, s);
  18315. e.set(n.x, n.y, -1).unproject(o),
  18316. t.set(n.x, n.y, 1).unproject(o),
  18317. i.copy(t).sub(e).normalize(),
  18318. this.raycaster.set(e, i);
  18319. var c = this.raycaster.intersectObjects(l);
  18320. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag);
  18321. }
  18322. return (
  18323. (this.intersectTag = a),
  18324. r &&
  18325. (this.activeTag &&
  18326. a !== this.activeTag &&
  18327. (this.tagState === y.BROWSE || (this.tagState === y.EXAMINE && a)) &&
  18328. this.dismissActiveTag(),
  18329. a &&
  18330. a !== this.activeTag &&
  18331. (a.listeners(h.ENTER).length < 1 &&
  18332. (a.billboard.on(
  18333. h.ENTER,
  18334. function () {
  18335. this.hoveredTag = a;
  18336. }.bind(this)
  18337. ),
  18338. a.billboard.on(
  18339. h.LEAVE,
  18340. function () {
  18341. this.hoveredTag = null;
  18342. }.bind(this)
  18343. )),
  18344. this.activateTag(a, y.BROWSE))),
  18345. a
  18346. );
  18347. };
  18348. })()),
  18349. (n.prototype.rankedtagInDirection = (function () {
  18350. var e = [],
  18351. t = [],
  18352. i = new r.Vector3(),
  18353. n = new r.Vector3(),
  18354. o = new r.Vector3();
  18355. return function (r, a, s, l) {
  18356. var c = 0;
  18357. t.length = 0;
  18358. for (var h = 0; h < this.closesttags.length; h++) {
  18359. var u = this.closesttags[h];
  18360. n.copy(u.position),
  18361. n.add(u.discPosition),
  18362. i.copy(a),
  18363. i.sub(n).negate(),
  18364. i.normalize();
  18365. var d = i.dot(l);
  18366. if (d >= 0) {
  18367. o.copy(n), o.project(s);
  18368. var p = this.intersecttag(o, !1, s);
  18369. if (p) {
  18370. if (c >= e.length)
  18371. for (var f = 0; f < 64; f++)
  18372. e.push({
  18373. tag: u,
  18374. dot: d,
  18375. });
  18376. var g = e[c];
  18377. (g.tag = u),
  18378. (g.dot = d),
  18379. (g.position = math.projectPositionToCanvas(n, s)),
  18380. t.push(g),
  18381. c++;
  18382. }
  18383. }
  18384. }
  18385. return (
  18386. t.sort(function (e, t) {
  18387. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0;
  18388. }),
  18389. r < t.length ? t[r].tag : null
  18390. );
  18391. };
  18392. })()),
  18393. (n.prototype.updateClosestTags = (function () {
  18394. var e = new r.Vector3(),
  18395. t = 30;
  18396. return function (i) {
  18397. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0);
  18398. var n = this.model.tags;
  18399. if (n)
  18400. for (var r in n)
  18401. if (n.hasOwnProperty(r)) {
  18402. var o = n[r],
  18403. a = o.position;
  18404. e.copy(i), e.sub(a).negate();
  18405. var s = e.lengthSq();
  18406. s < t && this.closesttags.push(o);
  18407. }
  18408. };
  18409. })()),
  18410. (t.exports = n);
  18411. }.call(this, '/js/tag/tagManager.js'));
  18412. },
  18413. {
  18414. '../controls/serializer': 14,
  18415. '../enum/BlackoutStyle': 18,
  18416. '../enum/tagEvents': 32,
  18417. '../enum/ModelManagerEvents': 33,
  18418. '../enum/PlayerEvents': 40,
  18419. '../enum/TagStates': 44,
  18420. '../enum/Viewmode': 51,
  18421. '../enum/WarpStyle': 52,
  18422. '../objects/Snapshot': 153,
  18423. '../settings': 166,
  18424. '../util/common': 185,
  18425. '../util/lerp': 188,
  18426. '../util/logger': 189,
  18427. './Billboard/BillboardEvent': 120,
  18428. './Media/LinkType': 130,
  18429. './Media/MediaEvent': 131,
  18430. events: 202,
  18431. three: 217,
  18432. },
  18433. ],
  18434. 125: [
  18435. function (e, t, i) {
  18436. (function (i) {
  18437. 'use strict';
  18438. function n() {
  18439. (this.embedWrapper = null), (this.embedElement = null);
  18440. }
  18441. var r = e('../../util/ajax'),
  18442. o = e('./mediaSettings'),
  18443. a = e('../../settings'),
  18444. s = e('../../util/logger'),
  18445. l = new s(i);
  18446. (n.prototype.createDomElement = function () {
  18447. return (
  18448. (this.embedWrapper = document.createElement('div')),
  18449. this.embedWrapper.classList.add('tag-embed'),
  18450. this.embedWrapper.classList.add('hidden'),
  18451. this.embedWrapper
  18452. );
  18453. }),
  18454. (n.prototype.load = function (e) {
  18455. var t =
  18456. 'https://api.embedly.com/1/oembed?key=' +
  18457. a.appConfig.embedly_key +
  18458. '&url=' +
  18459. encodeURIComponent(e) +
  18460. '&maxwidth=' +
  18461. o.maxEmbedWidth;
  18462. return new Promise(
  18463. function (e, i) {
  18464. r.get(t).then(
  18465. function (t) {
  18466. if (((t = JSON.parse(t)), t.html && t.html.indexOf('<script') === -1)) {
  18467. this.embedWrapper.innerHTML = t.html;
  18468. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  18469. if (((this.embedWrapper.style.width = n + 'px'), t.height)) {
  18470. var r = t.height / t.width;
  18471. this.embedWrapper.style.height = n * r + 'px';
  18472. }
  18473. this.embedElement = this.embedWrapper.firstChild;
  18474. var a = [];
  18475. try {
  18476. a = [].slice.call(this.embedElement.querySelectorAll('a'));
  18477. } catch (e) {
  18478. l.debug('Error getting `a` elements for embed; was it an iframe?');
  18479. }
  18480. a.forEach(function (e) {
  18481. e.setAttribute('target', '_blank');
  18482. }),
  18483. this.embedElement.classList.add('hidden'),
  18484. this.embedWrapper.classList.remove('hidden'),
  18485. e();
  18486. } else i('Not a valid embed');
  18487. }.bind(this),
  18488. function (e) {
  18489. i(e.response);
  18490. }
  18491. );
  18492. }.bind(this)
  18493. );
  18494. }),
  18495. (n.prototype.show = function () {
  18496. this.embedElement && this.embedElement.classList.remove('hidden');
  18497. }),
  18498. (n.prototype.hide = function () {
  18499. this.embedElement && this.embedElement.classList.add('hidden');
  18500. }),
  18501. (t.exports = n);
  18502. }.call(this, '/js/tag/Media/EmbedlyEmbed.js'));
  18503. },
  18504. {
  18505. '../../settings': 166,
  18506. '../../util/ajax': 181,
  18507. '../../util/logger': 189,
  18508. './mediaSettings': 132,
  18509. },
  18510. ],
  18511. 126: [
  18512. function (e, t, i) {
  18513. (function (i) {
  18514. 'use strict';
  18515. function n(e) {
  18516. o.call(this),
  18517. (this.options = e),
  18518. (this.playerControls = null),
  18519. (this.state = s.NOT_READY);
  18520. }
  18521. var r = e('../../util/browser'),
  18522. o = e('./EmbedlyEmbed'),
  18523. a = e('../../util/logger'),
  18524. s =
  18525. (new a(i),
  18526. Object.freeze({
  18527. NOT_READY: 'player.not.ready',
  18528. CUED: 'player.cued',
  18529. PLAYING: 'player.playing',
  18530. PAUSED: 'player.paused',
  18531. }));
  18532. (n.prototype = Object.create(o.prototype)),
  18533. (n.prototype.createDomElement = function () {
  18534. return (
  18535. (this.embedWrapper = document.createElement('div')),
  18536. this.embedWrapper.classList.add('tag-video'),
  18537. this.embedWrapper.classList.add('hidden'),
  18538. this.embedWrapper
  18539. );
  18540. }),
  18541. (n.prototype.load = function (e) {
  18542. var t = function () {
  18543. function e(e) {
  18544. (this.playerState = s.CUED),
  18545. this.options.startMuted && this.playerControls.mute();
  18546. }
  18547. function t(e) {
  18548. this.playerState = e;
  18549. }
  18550. function i(e) {
  18551. this.playerControls.setCurrentTime(0),
  18552. this.options.loop ? this.playerControls.play() : this.playerControls.pause();
  18553. }
  18554. (this.playerControls = new playerjs.Player(this.embedElement)),
  18555. this.playerControls.on('ready', e.bind(this)),
  18556. this.playerControls.on('play', t.bind(this, s.PLAYING)),
  18557. this.playerControls.on('pause', t.bind(this, s.PAUSED)),
  18558. this.playerControls.on('ended', i.bind(this));
  18559. }.bind(this);
  18560. return o.prototype.load.call(this, e).then(t.bind(this));
  18561. }),
  18562. (n.prototype.play = (function () {
  18563. var e = r.isMobile();
  18564. return function () {
  18565. this.playerState !== s.NOT_READY &&
  18566. this.playerControls &&
  18567. !e &&
  18568. ((this.state === s.CUED && this.options.autoPlay) || this.options.autoResume) &&
  18569. this.playerControls.play();
  18570. };
  18571. })()),
  18572. (n.prototype.pause = function () {
  18573. this.playerState !== s.NOT_READY &&
  18574. this.playerControls &&
  18575. this.playerControls.pause();
  18576. }),
  18577. (t.exports = n);
  18578. }.call(this, '/js/tag/Media/EmbedlyPlayer.js'));
  18579. },
  18580. {
  18581. '../../util/browser': 182,
  18582. '../../util/logger': 189,
  18583. './EmbedlyEmbed': 125,
  18584. },
  18585. ],
  18586. 127: [
  18587. function (e, t, i) {
  18588. (function (i) {
  18589. 'use strict';
  18590. function n(e) {
  18591. function t() {
  18592. return (
  18593. a.debug('requesting file from embedly:', e.href),
  18594. r
  18595. .get(e.href, {
  18596. responseType: e.responseType,
  18597. })
  18598. .then(function (t) {
  18599. return a.debug('requesting file finished:', e.href), t;
  18600. })
  18601. );
  18602. }
  18603. function i() {}
  18604. return (s = new Promise(function (e, n) {
  18605. s.catch(i).then(function () {
  18606. t().then(e, n);
  18607. });
  18608. }));
  18609. }
  18610. var r = e('../../util/ajax'),
  18611. o = (e('./mediaSettings'), e('../../util/logger')),
  18612. a = new o(i),
  18613. s = Promise.resolve();
  18614. t.exports.enqueue = n;
  18615. }.call(this, '/js/tag/Media/EmbedlyQueue.js'));
  18616. },
  18617. {
  18618. '../../util/ajax': 181,
  18619. '../../util/logger': 189,
  18620. './mediaSettings': 132,
  18621. },
  18622. ],
  18623. 128: [
  18624. function (e, t, i) {
  18625. (function (i) {
  18626. 'use strict';
  18627. function n() {
  18628. (this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1);
  18629. }
  18630. var r = e('./MediaEvent'),
  18631. o = e('./EmbedlyQueue'),
  18632. a = e('events').EventEmitter,
  18633. s = e('../../util/logger'),
  18634. l = e('../../settings');
  18635. new s(i);
  18636. (n.prototype = Object.create(a.prototype)),
  18637. (n.prototype.createDomElement = function () {
  18638. return (
  18639. (this.imageWrapper = document.createElement('div')),
  18640. this.imageWrapper.classList.add('tag-image'),
  18641. this.imageWrapper.classList.add('hidden'),
  18642. this.imageWrapper.addEventListener(
  18643. 'click',
  18644. function (e) {
  18645. e.stopPropagation(),
  18646. this.emit(r.IMAGE_OPENING),
  18647. (this.imageWrapper.style.pointerEvents = 'none');
  18648. }.bind(this)
  18649. ),
  18650. this.imageWrapper
  18651. );
  18652. }),
  18653. (n.prototype.onClosed = function () {
  18654. this.imageWrapper.style.pointerEvents = 'auto';
  18655. }),
  18656. (n.prototype.load = function (e) {
  18657. var t = Math.max(window.screen.height, window.screen.width),
  18658. i =
  18659. 'https://i.embed.ly/1/display/resize?key=' +
  18660. l.appConfig.embedly_key +
  18661. '&url=' +
  18662. encodeURIComponent(e) +
  18663. '&width=' +
  18664. t +
  18665. '&height=' +
  18666. t;
  18667. return new Promise(
  18668. function (e, t) {
  18669. function n(t) {
  18670. var i = t.target;
  18671. (this.width = i.naturalWidth),
  18672. (this.height = i.naturalHeight),
  18673. (this.aspect = this.width / this.height);
  18674. var n = t.target.src;
  18675. (this.imageWrapper.style.backgroundImage = 'url("' + n + '")'),
  18676. (this.imageWrapper.style.width = this.width + 'px'),
  18677. (this.imageWrapper.style.height = this.height + 'px'),
  18678. this.imageWrapper.classList.remove('hidden'),
  18679. e();
  18680. }
  18681. o.enqueue({
  18682. href: i,
  18683. responseType: 'arraybuffer',
  18684. }).then(
  18685. function (e) {
  18686. var t = new Uint8Array(e),
  18687. i = new Blob([t]),
  18688. r = new window.Image();
  18689. r.addEventListener('load', n.bind(this));
  18690. var o = URL.createObjectURL(i);
  18691. r.src = o;
  18692. }.bind(this),
  18693. t
  18694. );
  18695. }.bind(this)
  18696. );
  18697. }),
  18698. (t.exports = n);
  18699. }.call(this, '/js/tag/Media/Image.js'));
  18700. },
  18701. {
  18702. '../../settings': 166,
  18703. '../../util/logger': 189,
  18704. './EmbedlyQueue': 127,
  18705. './MediaEvent': 131,
  18706. events: 202,
  18707. },
  18708. ],
  18709. 129: [
  18710. function (e, t, i) {
  18711. 'use strict';
  18712. function n(e) {
  18713. (this.label = e.label),
  18714. (this.href = e.url),
  18715. (this.type = this.updateLinkForType()),
  18716. (this.domElement = null),
  18717. (this.id = c++);
  18718. }
  18719. var r = e('./LinkType'),
  18720. o = e('./MediaEvent'),
  18721. a = e('../../util/browser'),
  18722. s = e('../../analytics'),
  18723. l = e('events').EventEmitter,
  18724. c = 0;
  18725. (n.prototype = Object.create(l.prototype)),
  18726. (n.prototype.updateLinkForType = function () {
  18727. function e(e) {
  18728. var t = new RegExp('[#&?]start=([^#&?]*)'),
  18729. i = t.exec(e);
  18730. return i[1];
  18731. }
  18732. function t(e) {
  18733. return e + '&play=1';
  18734. }
  18735. var i = a.valueFromHash('m') || a.valueFromHash('model');
  18736. return this.href.indexOf('port.com/show') !== -1 ||
  18737. this.href.indexOf(window.location.host + '/show') !== -1
  18738. ? this.href.indexOf(i) !== -1 && this.href.indexOf('start=') !== -1
  18739. ? ((this.href = e(this.href)), r.NAVIGATION)
  18740. : ((this.href = t(this.href)), r.MODEL)
  18741. : r.EXT_LINK;
  18742. });
  18743. var h = {};
  18744. (n.prototype.createDomElement = function () {
  18745. function e(e) {
  18746. switch (
  18747. (e.stopPropagation(),
  18748. (h[this.id] = !0),
  18749. s.trackAlways('click_tag_link', {
  18750. link_type: this.type,
  18751. link_count: c,
  18752. links_clicked: Object.keys(h).length,
  18753. }),
  18754. this.type)
  18755. ) {
  18756. case r.MODEL:
  18757. window.location.replace(this.href);
  18758. break;
  18759. case r.EXT_LINK:
  18760. window.open(this.href, '_blank');
  18761. }
  18762. this.emit(o.LINK_CLICK, {
  18763. type: this.type,
  18764. url: this.href,
  18765. });
  18766. }
  18767. if (
  18768. ((this.domElement = document.createElement('a')),
  18769. this.domElement.classList.add('tag-link'),
  18770. (this.domElement.textContent = this.label),
  18771. this.type === r.EXT_LINK)
  18772. ) {
  18773. this.domElement.textContent += ' ';
  18774. var t = document.createElement('i');
  18775. t.classList.add('icon-ext-link'),
  18776. (t.title = 'Link to external web site'),
  18777. this.domElement.appendChild(t);
  18778. }
  18779. return this.domElement.addEventListener('click', e.bind(this)), this.domElement;
  18780. }),
  18781. (t.exports = n);
  18782. },
  18783. {
  18784. '../../analytics': 4,
  18785. '../../util/browser': 182,
  18786. './LinkType': 130,
  18787. './MediaEvent': 131,
  18788. events: 202,
  18789. },
  18790. ],
  18791. 130: [
  18792. function (e, t, i) {
  18793. 'use strict';
  18794. t.exports = {
  18795. NAVIGATION: 'navigation',
  18796. MODEL: 'model',
  18797. EXT_LINK: 'ext-link',
  18798. };
  18799. },
  18800. {},
  18801. ],
  18802. 131: [
  18803. function (e, t, i) {
  18804. 'use strict';
  18805. t.exports = Object.freeze({
  18806. LINK_CLICK: 'mtmedia.link',
  18807. IMAGE_LOADED: 'mtmedia.image.loaded',
  18808. IMAGE_OPENING: 'mtmedia.image.opening',
  18809. IMAGE_OPENED: 'mtmedia.image.opened',
  18810. IMAGE_CLOSING: 'mtmedia.image.closing',
  18811. IMAGE_CLOSED: 'mtmedia.image.closed',
  18812. VIDEO_START: 'mtmedia.video.start',
  18813. VIDEO_PAUSE: 'mtmedia.video.pause',
  18814. VIDEO_ENDED: 'mtmedia.video.end',
  18815. });
  18816. },
  18817. {},
  18818. ],
  18819. 132: [
  18820. function (e, t, i) {
  18821. 'use strict';
  18822. t.exports = Object.freeze({
  18823. maxEmbedWidth: 350,
  18824. defaultAspectRatio: 0.75,
  18825. });
  18826. },
  18827. {},
  18828. ],
  18829. 133: [
  18830. function (e, t, i) {
  18831. 'use strict';
  18832. t.exports = Object.freeze({
  18833. TEXT: 'text',
  18834. LINK: 'link',
  18835. IMAGE: 'photo',
  18836. VIDEO: 'video',
  18837. RICH: 'rich',
  18838. });
  18839. },
  18840. {},
  18841. ],
  18842. 134: [
  18843. function (e, t, i) {
  18844. 'use strict';
  18845. function n(e) {
  18846. this.capabilities = {
  18847. links: {
  18848. enable: e.supportLinks,
  18849. keepLabels: e.keepLinkLabels,
  18850. },
  18851. };
  18852. }
  18853. var r = e('./DescriptionChunkType');
  18854. (n.prototype.parse = function (e, t) {
  18855. var i = [],
  18856. n = e.split('[').map(function (e, t) {
  18857. return 0 === t ? e : '[' + e;
  18858. });
  18859. return (
  18860. n.forEach(
  18861. function (e) {
  18862. var n = this.findMarkdown(e);
  18863. if (n) {
  18864. if (n.url.indexOf('javascript:') !== -1) return;
  18865. this.addLinkChunk(i, n, t), this.addTextChunk(i, e.slice(n.markdown.length));
  18866. } else this.addTextChunk(i, e);
  18867. }.bind(this)
  18868. ),
  18869. i
  18870. );
  18871. }),
  18872. (n.prototype.findMarkdown = function (e) {
  18873. var t = /\[([^\]]*)\]\((.*)\)/,
  18874. i = e.match(t);
  18875. if (i) {
  18876. for (
  18877. var n = i[2], r = 1, o = 0;
  18878. o < n.length && ('(' === n[o] ? r++ : ')' === n[o] && r--, 0 !== r);
  18879. )
  18880. o++;
  18881. var a = n.length - o;
  18882. return {
  18883. markdown: i[0].substring(0, i[0].length - a),
  18884. label: i[1],
  18885. url: i[2].substring(0, o),
  18886. };
  18887. }
  18888. }),
  18889. (n.prototype.addTextChunk = function (e, t) {
  18890. 0 !== t.length &&
  18891. e.push({
  18892. type: r.TEXT,
  18893. text: t,
  18894. });
  18895. }),
  18896. (n.prototype.addLinkChunk = function (e, t) {
  18897. if (!this.capabilities.links.enable)
  18898. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  18899. var i = {
  18900. label: t.label,
  18901. url: t.url,
  18902. };
  18903. i.url.indexOf('://') === -1 && (i.url = 'http://' + i.url),
  18904. e.push({
  18905. type: r.LINK,
  18906. link: i,
  18907. });
  18908. }),
  18909. (t.exports = n);
  18910. },
  18911. {
  18912. './DescriptionChunkType': 133,
  18913. },
  18914. ],
  18915. 135: [
  18916. function (e, t, i) {
  18917. (function (i) {
  18918. 'use strict';
  18919. var n = e('../util/logger'),
  18920. r = new n(i),
  18921. o = {
  18922. parseIdsFromChunkName: function (e, t) {
  18923. (t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e));
  18924. },
  18925. parseFloor: function (e) {
  18926. var t = e.match(/_group([0-9]+)/);
  18927. if (!t) return 0;
  18928. try {
  18929. return parseInt(t[1], 10);
  18930. } catch (e) {
  18931. return (
  18932. r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  18933. );
  18934. }
  18935. },
  18936. parseRoom: function (e) {
  18937. var t = e.match(/_sub([0-9]+)/);
  18938. if (!t) return -1;
  18939. try {
  18940. return parseInt(t[1], 10);
  18941. } catch (e) {
  18942. return (
  18943. r.warn(
  18944. 'Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'
  18945. ),
  18946. 0
  18947. );
  18948. }
  18949. },
  18950. };
  18951. t.exports = o;
  18952. }.call(this, '/js/model/Chunks.js'));
  18953. },
  18954. {
  18955. '../util/logger': 189,
  18956. },
  18957. ],
  18958. 136: [
  18959. function (e, t, i) {
  18960. (function (i) {
  18961. 'use strict';
  18962. function n(e) {
  18963. s.call(this), (this.model = e), (this.exploded = !1);
  18964. }
  18965. var r = e('../objects/Floor'),
  18966. o = (e('../settings'), e('../util/logger')),
  18967. a = e('../util/transitions'),
  18968. s = e('../util/IndexedCollection'),
  18969. l = e('../util/common'),
  18970. c = e('../util/easing');
  18971. new o(i);
  18972. l.inherit(n, s),
  18973. (n.prototype.add = function (e) {
  18974. s.prototype.add.call(this, e), this.model.add(e);
  18975. }),
  18976. (n.prototype.getIndex = function (e) {
  18977. return e.floorIndex;
  18978. }),
  18979. (n.prototype.build = function () {
  18980. this.list.forEach(function (e) {
  18981. e.build();
  18982. });
  18983. }),
  18984. (n.prototype.size = function () {
  18985. return this.length;
  18986. }),
  18987. (n.prototype.sort = function () {
  18988. s.prototype.sort.call(this, function (e, t) {
  18989. return e.floorIndex - t.floorIndex;
  18990. });
  18991. }),
  18992. (n.prototype.nextFloor = function (e, t) {
  18993. return this.index[e.floorIndex + t] || null;
  18994. }),
  18995. (n.prototype.getFloorAtPoint = function (e) {
  18996. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  18997. var r = this.list[n],
  18998. o = r.distanceToPoint(e);
  18999. (!t || i > o) && ((i = o), (t = r));
  19000. }
  19001. return t;
  19002. }),
  19003. (n.prototype.getOrMakeFloor = function (e) {
  19004. var t = this.index[e];
  19005. return t || ((t = new r(this.model, e)), this.add(t)), t;
  19006. }),
  19007. (n.prototype.hide = function () {
  19008. this.list.forEach(function (e) {
  19009. e.hide();
  19010. });
  19011. }),
  19012. (n.prototype.show = function () {
  19013. this.list.forEach(function (e) {
  19014. e.show();
  19015. });
  19016. }),
  19017. (n.prototype.names = function () {
  19018. return this.list.reduce(function (e, t) {
  19019. return e.concat(t.name);
  19020. }, []);
  19021. }),
  19022. (n.prototype.toggleExplodeHorizontal = function () {
  19023. function e(e, t) {
  19024. r.copy(e.position),
  19025. (e.position.x = i[e.floorIndex] * t),
  19026. (e.position.y = 1 * e.floorIndex * t),
  19027. r.sub(e.position).multiplyScalar(-1),
  19028. e.panos.forEach(function (e) {
  19029. e.translate(r);
  19030. });
  19031. }
  19032. var t,
  19033. i = [],
  19034. n = 0;
  19035. this.list.forEach(function (e, r, o) {
  19036. (t =
  19037. r > 0
  19038. ? Math.max(
  19039. o[r - 1].boundingBox.max.x - e.boundingBox.min.x,
  19040. e.boundingBox.size().x / 2
  19041. )
  19042. : 0),
  19043. (n += t),
  19044. (i[r] = n);
  19045. }),
  19046. (i = i.map(function (e) {
  19047. return e - n / 2;
  19048. }));
  19049. var r = this.list[0].position.clone();
  19050. this.exploded
  19051. ? this.list.forEach(function (t) {
  19052. a.start(
  19053. function (i) {
  19054. e(t, 1 - i);
  19055. },
  19056. 1500,
  19057. null,
  19058. 0,
  19059. c.easeOutExpo
  19060. );
  19061. })
  19062. : this.list.forEach(function (t) {
  19063. a.start(
  19064. function (i) {
  19065. e(t, i);
  19066. },
  19067. 1500,
  19068. null,
  19069. 0,
  19070. c.easeOutExpo
  19071. );
  19072. }),
  19073. (this.exploded = !this.exploded);
  19074. }),
  19075. (n.prototype.toggleExplodeVertical = function () {
  19076. function e(e, i) {
  19077. var n = n.copy(e.position);
  19078. (e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  19079. n.sub(e.position).multiplyScalar(-1),
  19080. e.panos.forEach(function (e) {
  19081. e.translate(n);
  19082. });
  19083. }
  19084. var t = this.model.size;
  19085. this.list[0].position.clone();
  19086. this.exploded
  19087. ? this.list.forEach(function (t) {
  19088. a.start(
  19089. function (i) {
  19090. e(t, 1 - i);
  19091. },
  19092. 1500,
  19093. null,
  19094. 0,
  19095. c.easeOutExpo
  19096. );
  19097. })
  19098. : this.list.forEach(function (t) {
  19099. a.start(
  19100. function (i) {
  19101. e(t, i);
  19102. },
  19103. 1500,
  19104. null,
  19105. 0,
  19106. c.easeOutExpo
  19107. );
  19108. }),
  19109. (this.exploded = !this.exploded);
  19110. }),
  19111. (t.exports = n);
  19112. }.call(this, '/js/model/FloorCollection.js'));
  19113. },
  19114. {
  19115. '../objects/Floor': 146,
  19116. '../settings': 166,
  19117. '../util/IndexedCollection': 175,
  19118. '../util/common': 185,
  19119. '../util/easing': 186,
  19120. '../util/logger': 189,
  19121. '../util/transitions': 195,
  19122. },
  19123. ],
  19124. 137: [
  19125. function (e, t, i) {
  19126. (function (i) {
  19127. 'use strict';
  19128. function n() {
  19129. c.call(this);
  19130. }
  19131. var r = e('../settings'),
  19132. o = e('../util/logger'),
  19133. a = e('../enum/Viewmode'),
  19134. s = e('../objects/Snapshot'),
  19135. l = (e('../util/math'), e('../util/common')),
  19136. c = e('../util/IndexedCollection'),
  19137. h = new o(i);
  19138. l.inherit(n, c),
  19139. (n.prototype.getImage = function (e) {
  19140. return e && this.index.hasOwnProperty(e) ? this.index[e] : null;
  19141. }),
  19142. (n.prototype.filterByModesAndReel = function (e, t) {
  19143. for (var i = [], n = 0; n < t.length; n += 1) {
  19144. var r = t[n],
  19145. o = this.index[r.sid];
  19146. o && i.push(o);
  19147. }
  19148. var s = e[a.DOLLHOUSE],
  19149. l = e[a.FLOORPLAN];
  19150. (i = i.filter(function (e) {
  19151. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0;
  19152. var t;
  19153. try {
  19154. t = a.convertWorkshopModeInt(e.metadata.camera_mode);
  19155. } catch (e) {
  19156. return h.debug(e.message), !1;
  19157. }
  19158. return t === a.PANORAMA || (t === a.FLOORPLAN && l) || (t === a.DOLLHOUSE && s);
  19159. })),
  19160. i.length !== this.list.length &&
  19161. h.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  19162. (this.list = i),
  19163. this.reIndex();
  19164. }),
  19165. (n.prototype.getHeroLocations = function (panos) {
  19166. //改 增加二级location
  19167. if (0 === this.list.length) return [];
  19168. var locations = [];
  19169. var deal = (info, container) => {
  19170. var src = info.thumbnail_signed_src,
  19171. o = info.name || '';
  19172. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  19173. if (!r.show360Views.enabled && info.metadata.scan_id) {
  19174. let a = panos.get(info.metadata.scan_id);
  19175. if (a && !a.isAligned()) return;
  19176. }
  19177. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  19178. if (cameraMode === a.MESH) return;
  19179. if (window.isLocal) src = manage.dealURL(src);
  19180. else
  19181. src =
  19182. 'one' === g_version
  19183. ? g_Prefix + src + '?' + randomTime().getTime()
  19184. : src + '?' + randomTime().getTime();
  19185. var l = {
  19186. cameraMode: cameraMode,
  19187. position: info.metadata.camera_position,
  19188. quaternion: info.metadata.camera_quaternion,
  19189. zoom: info.metadata.zoom,
  19190. panoId: info.metadata.scan_id,
  19191. orthoZoom: info.metadata.ortho_zoom,
  19192. floorVisibility:
  19193. void 0 !== info.metadata.floor_visibility
  19194. ? info.metadata.floor_visibility.slice(0)
  19195. : [],
  19196. thumbUrl: src,
  19197. name: n.filterImageName(o),
  19198. sid: info.sid,
  19199. };
  19200. var item = new s(l);
  19201. item.momentTour = info.momentTour;
  19202. item.dontRot = info.dontRot;
  19203. item.rotTime = info.rotTime;
  19204. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}; //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  19205. container.push(item);
  19206. return item;
  19207. }
  19208. };
  19209. this.list.forEach((image) => {
  19210. if (image.images) {
  19211. var folder = $.extend({}, image);
  19212. folder.heroLocations = [];
  19213. image.images.list.forEach((child) => {
  19214. deal(child, folder.heroLocations);
  19215. });
  19216. folder.musicInfo = folder.musicInfo || {};
  19217. locations.push(folder);
  19218. delete folder.images;
  19219. delete folder.locations;
  19220. } else {
  19221. var item = deal(image, locations);
  19222. }
  19223. });
  19224. return locations;
  19225. }),
  19226. (n.prototype.getIndex = function (e) {
  19227. return e.sid;
  19228. }),
  19229. (n.filterImageName = function (e) {
  19230. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e;
  19231. }),
  19232. (t.exports = n);
  19233. }.call(this, '/js/model/ImageCollection.js'));
  19234. },
  19235. {
  19236. '../enum/Viewmode': 51,
  19237. '../objects/Snapshot': 153,
  19238. '../settings': 166,
  19239. '../util/IndexedCollection': 175,
  19240. '../util/common': 185,
  19241. '../util/logger': 189,
  19242. '../util/math': 190,
  19243. },
  19244. ],
  19245. 138: [
  19246. function (e, t, i) {
  19247. (function (i) {
  19248. 'use strict';
  19249. function n() {
  19250. u.call(this);
  19251. }
  19252. var r = e('../label/Label'),
  19253. o = e('../settings'),
  19254. a = e('../util/logger'),
  19255. s = e('../util/math'),
  19256. l = e('../util/ajax'),
  19257. c = e('./RoomCollection'),
  19258. h = e('../util/common'),
  19259. u = e('../util/IndexedCollection');
  19260. new a(i);
  19261. h.inherit(n, u),
  19262. (n.prototype.getIndex = function (e) {
  19263. return e.labelId;
  19264. }),
  19265. (n.prototype.associateWithRooms = function (e) {
  19266. this.forEach(function (t) {
  19267. e.forEach(function (e) {
  19268. e.roomId === t.roomId && (t.room = e);
  19269. });
  19270. });
  19271. }),
  19272. (n.prototype.createFromLabelData = function (e) {
  19273. e.forEach(
  19274. function (e) {
  19275. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  19276. t = c.generateRoomId(e.floorId, t);
  19277. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t);
  19278. (i.position = s.convertWorkshopVector(i.position)), this.add(i), i.build();
  19279. }.bind(this)
  19280. );
  19281. }),
  19282. (n.prototype.load = function (e, t) {
  19283. return l
  19284. .get(e, {
  19285. responseType: 'json',
  19286. auth: t ? o.authorizationHeader : null,
  19287. })
  19288. .done(
  19289. function (e) {
  19290. var t = [];
  19291. for (var i in e) {
  19292. var n = e[i];
  19293. t.push(n);
  19294. }
  19295. this.createFromLabelData(t);
  19296. }.bind(this)
  19297. );
  19298. }),
  19299. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  19300. var t = -1;
  19301. if (e) {
  19302. if (typeof e == 'number') {
  19303. //add
  19304. t = parseInt(e);
  19305. } else {
  19306. var i = e.split('_');
  19307. t = parseInt(i[0]);
  19308. }
  19309. }
  19310. return t;
  19311. }),
  19312. (t.exports = n);
  19313. }.call(this, '/js/model/LabelCollection.js'));
  19314. },
  19315. {
  19316. '../label/Label': 90,
  19317. '../settings': 166,
  19318. '../util/IndexedCollection': 175,
  19319. '../util/ajax': 181,
  19320. '../util/common': 185,
  19321. '../util/logger': 189,
  19322. '../util/math': 190,
  19323. './RoomCollection': 141,
  19324. },
  19325. ],
  19326. 139: [
  19327. function (e, t, i) {
  19328. (function (i) {
  19329. 'use strict';
  19330. function n(e, t) {
  19331. o.Object3D.call(this);
  19332. this.sid = window.number; //t.sid,
  19333. (this.data = t),
  19334. (this.options = e),
  19335. (this.urls = new s(e.urlFiles)),
  19336. (this.isPublic = void 0 !== t.is_public && t.is_public),
  19337. //创建heroLocations
  19338. (this.images = new _(this)),
  19339. this.images.extend(t.images),
  19340. this.images.forEach((info) => {
  19341. if (info.locations) {
  19342. info.images = new _(this);
  19343. info.images.extend(info.locations);
  19344. }
  19345. });
  19346. this.heroLocations = [];
  19347. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  19348. (this.outdoorPanoLocations = []),
  19349. (this.floors = new d(this)),
  19350. (this.floorsEnabled = void 0 === e.floors || e.floors),
  19351. (this.changingFloor = !1),
  19352. (this.chunks = []),
  19353. (this.panos = new A()),
  19354. (this.colliders = []),
  19355. (this.loadPanosPromise = null),
  19356. (this.loadMeshTexturesPromise = null),
  19357. (this.auxDataPromise = null),
  19358. (this.meshTexturesLoaded = !1),
  19359. (this.meshTextures = []),
  19360. (this.tags = {}),
  19361. (this.tagsShown = !1),
  19362. (this.shouldShowtags = !1),
  19363. (this.has360Views = !1),
  19364. (this.showingLabels = f.labels.enabled && t.player_options.labels),
  19365. (this.supportedModes = {}),
  19366. (this.supportedModes[c.PANORAMA] = !0),
  19367. (this.supportedModes[c.DOLLHOUSE] =
  19368. !t.player_options || (t.player_options.dollhouse && w.valueFromHash('dh', 1))),
  19369. (this.supportedModes[c.FLOORPLAN] =
  19370. !t.player_options || (t.player_options.floor_plan && w.valueFromHash('dh', 1))),
  19371. (this.supportedModes[c.TRANSITIONING] = !0),
  19372. (this.supportsTiles = this.configureTiling()),
  19373. // this.supportsVR = t.is_vr,
  19374. (this.supportsVR = window.DATA.supportsVR || false); //true; // 方奕卓 VR功能可配置
  19375. (this.mode = c.DOLLHOUSE),
  19376. (this.size = null),
  19377. (this.center = null),
  19378. (this.boundingBox = new o.Box3()),
  19379. (this.currentFloor = null),
  19380. (this.allFloorsVisible = !0),
  19381. (this.projectedPano0 = null),
  19382. (this.projectedPano1 = null),
  19383. this.floorsEnabled &&
  19384. t.floors &&
  19385. t.floors.indexOf(',') !== -1 &&
  19386. t.floors.split(',').forEach(
  19387. function (e, t) {
  19388. this.addFloor(new u(this, t, e.trim()));
  19389. }.bind(this)
  19390. ),
  19391. (this.waitQueue = []),
  19392. this.on(
  19393. 'load',
  19394. function (e) {
  19395. 0 !== this.waitQueue.length &&
  19396. ((this.waitQueue = this.waitQueue.filter(function (e) {
  19397. return !e.isLoadedCallback();
  19398. })),
  19399. 0 === this.waitQueue.length && this.emit('waiting-done'));
  19400. }.bind(this)
  19401. ),
  19402. this.setupCustomProperties();
  19403. this.hots = {};
  19404. }
  19405. function r() {
  19406. try {
  19407. var e = document.createElement('canvas'),
  19408. t = e.getContext('webgl');
  19409. t || (t = e.getContext('experimental-webgl'));
  19410. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  19411. return i;
  19412. } catch (e) {
  19413. return 0;
  19414. }
  19415. }
  19416. var o = e('three'),
  19417. a = e('../util/ajax'),
  19418. s = e('../util/ModelUrls'),
  19419. l = e('../objects/BoundingTextureSkybox'),
  19420. c = e('../enum/Viewmode'),
  19421. h = e('../enum/RenderOrder'),
  19422. u = (e('../enum/AlignmentType'), e('../objects/Floor')),
  19423. d = e('./FloorCollection'),
  19424. p = e('../objects/Chunk'),
  19425. f =
  19426. (e('../objects/Room'),
  19427. e('../objects/Snapshot'),
  19428. e('../label/Label'),
  19429. e('../util/math'),
  19430. e('../settings')),
  19431. ss = e('../shaders'),
  19432. g = e('../util/logger'),
  19433. m = e('../tag/tag'),
  19434. v = (e('../tag/tagManager'), e('../objects/Panorama')),
  19435. A = e('../util/PanoramaCollection'),
  19436. y = e('../loaders/ModelLoader'),
  19437. C = e('../loaders/ModelTextureLoader'),
  19438. I = e('../loaders/SweepDataLoader'),
  19439. E = e('../util/transitions'),
  19440. b = e('../util/common'),
  19441. es = e('../util/easing'),
  19442. lerp = e('../util/lerp'),
  19443. tex = e('../util/texture'),
  19444. w = e('./../util/browser'),
  19445. _ = e('./ImageCollection'),
  19446. T = e('./RoomCollection'),
  19447. x = e('./LabelCollection'),
  19448. S = e('./Chunks'),
  19449. M = e('./../util/showcase'),
  19450. R = e('../exception/BasicException'),
  19451. P = (e('../constants'), e('events').EventEmitter),
  19452. GLCubeFaces = e('../enum/GLCubeFaces'),
  19453. //,Hot = e("hot")
  19454. O = new g(i);
  19455. (n.prototype = Object.create(o.Object3D.prototype)),
  19456. b.extend(n, P),
  19457. (n.prototype.setupCustomProperties = function () {
  19458. var e = f.modelAlpha;
  19459. Object.defineProperty(this, 'alpha', {
  19460. get: function () {
  19461. return e;
  19462. },
  19463. set: function (t) {
  19464. e = t;
  19465. //console.log(t)
  19466. this.chunks.forEach(function (chunk) {
  19467. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  19468. chunk.material.uniforms.modelAlpha.value = e;
  19469. //修改一下defines,为了在不需要map时不加载map。 by xzw
  19470. /* if (e>0) {
  19471. if (!('useModelMap' in chunk.material.defines)) {
  19472. chunk.material.defines.useModelMap = ''
  19473. chunk.material.needsUpdate = true
  19474. console.log('add useModelMap')
  19475. }
  19476. } else {
  19477. if ('useModelMap' in chunk.material.defines) {
  19478. delete chunk.material.defines.useModelMap
  19479. chunk.material.needsUpdate = true
  19480. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  19481. console.log('delete useModelMap')
  19482. }
  19483. } */
  19484. }
  19485. });
  19486. },
  19487. });
  19488. }),
  19489. (n.prototype.configureTiling = function () {
  19490. var e = r();
  19491. if (e < 2048) return !1;
  19492. O.warn('Max cube texture size: ' + e);
  19493. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  19494. var i = f.tiling.tilingFlagNames[t];
  19495. if ('1' === w.valueFromHash(i, null)) return !0;
  19496. if ('0' === w.valueFromHash(i, null)) return !1;
  19497. }
  19498. //--------------------------------------------许钟文-------------------------------------------
  19499. //return true;
  19500. return !!M.modelDataPromisesTiles(this.data); //免去访问mdoeldata.json的vision_version,不明白这是什么
  19501. //--------------------------------------------e n d -------------------------------------------
  19502. }),
  19503. (n.prototype.toggleAlpha = function () {
  19504. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0);
  19505. }),
  19506. (n.prototype.load = function (e) {
  19507. var t = function () {
  19508. return $.when(this.loadPanos(), this.loadMesh());
  19509. },
  19510. i = this.urls.init().then(t.bind(this));
  19511. return (
  19512. e
  19513. ? (i = i.then(this.loadMeshTextures.bind(this)))
  19514. : i.then(this.loadMeshTextures.bind(this)),
  19515. (this.auxDataPromise = $.when(
  19516. /*this.loadHighlightReel(), this.loadtags() */ this.loadhots(),
  19517. this.loadLabels()
  19518. )),
  19519. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  19520. ); //不要另外使用active_reel文件
  19521. }),
  19522. (n.prototype.loadMesh = function () {
  19523. function e(e) {
  19524. O.error(e), n.reject('loading-failed');
  19525. }
  19526. function t(e, t) {
  19527. n.notify(e, t);
  19528. }
  19529. function i(e, t) {
  19530. if (0 === e.length) {
  19531. O.warn(
  19532. 'No geometry found for model, loading faux geometry, disabling outside mode'
  19533. ),
  19534. (r.supportedModes[c.DOLLHOUSE] = !1),
  19535. (r.supportedModes[c.FLOORPLAN] = !1);
  19536. var i = new p({
  19537. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1),
  19538. });
  19539. (i.material.visible = !1),
  19540. i.rotateX(-Math.PI / 2),
  19541. i.geometry.computeBoundingBox(),
  19542. (e = [i]);
  19543. }
  19544. e.forEach(function (e) {
  19545. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  19546. r.addChunk(t, e);
  19547. }),
  19548. r.floors.sort(),
  19549. n.resolve(r);
  19550. }
  19551. var n = $.Deferred(),
  19552. r = this;
  19553. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise();
  19554. }),
  19555. (n.prototype.loadMeshTextures = function () {
  19556. return this.loadTexturesPromise
  19557. ? this.loadTexturesPromise
  19558. : ((this.loadTexturesPromise = C.load(this, this.meshTextures).then(
  19559. function () {
  19560. this.meshTexturesLoaded = !0;
  19561. }.bind(this)
  19562. )),
  19563. this.loadTexturesPromise);
  19564. }),
  19565. /* n.prototype.loadtags = function() {//xzw改
  19566. var e = $.Deferred();
  19567. if (!f.tags.enabled)
  19568. return e.resolve();
  19569. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  19570. t = "data/" + this.sid + "/tags.json"
  19571. return a.get(t, {
  19572. responseType: "json",
  19573. auth: this.isPublic ? null : f.authorizationHeader
  19574. }).done(function(t) {
  19575. var i = 0
  19576. , n = 0;
  19577. for (var r in t) {
  19578. var o = t[r];
  19579. o.enabled && (n++,
  19580. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  19581. i++))
  19582. }
  19583. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  19584. e.resolve()
  19585. }
  19586. .bind(this)).fail(function() {
  19587. O.warn("Getting tags failed, not displaying tags."),
  19588. e.resolve()
  19589. }),
  19590. e
  19591. } */
  19592. (n.prototype.shineHots = function () {
  19593. //xzw
  19594. E.trigger({
  19595. func: function (e) {
  19596. var opa = e <= 0.5 ? 2 * e : -2 * e + 2;
  19597. for (var i in this.hots) {
  19598. this.hots[i].mesh.material.uniforms.opac.value = opa;
  19599. }
  19600. }.bind(this),
  19601. cycling: true,
  19602. duration: 3000,
  19603. //easing: "easeInOutQuad",
  19604. name: 'hotShine',
  19605. });
  19606. }),
  19607. /* n.prototype.loadOverlays = function(overlays){
  19608. var overlays = window.data2 && window.data2.overlays
  19609. overlays && overlays.forEach((info)=>{
  19610. new Overlay(info)
  19611. })
  19612. Overlay.load()
  19613. }
  19614. */
  19615. (n.prototype.loadhots = function () {
  19616. //xzw
  19617. initHot(this);
  19618. var r = $.Deferred();
  19619. var t = g_Prefix + 'data/' + this.sid + '/data2.js' + '?' + randomTime().getTime();
  19620. return (
  19621. a
  19622. .get(t, {
  19623. responseType: 'json',
  19624. auth: this.isPublic ? null : f.authorizationHeader,
  19625. })
  19626. .done(
  19627. function (e) {
  19628. window.data2 = e;
  19629. this.roomLabels = [];
  19630. if (!e) {
  19631. console.error('data2 is null');
  19632. } else {
  19633. g_data2 = hotMatcher(e);
  19634. this.hotsCount = 0;
  19635. let create = () => {
  19636. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  19637. if (e.hots) {
  19638. var sids = Object.keys(e.hots).sort((a, b) => {
  19639. return e.hots[a].order - e.hots[b].order;
  19640. });
  19641. sids.forEach((sid) => {
  19642. e.hots[sid].sid = sid;
  19643. //if(e.hots[sid].texType == "shine" || e.hots[sid].texType == "photo" ){
  19644. //e.hots[sid].styleImg = []
  19645. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot');
  19646. //}
  19647. });
  19648. }
  19649. if (e.overlays) {
  19650. e.overlays.forEach((info) => {
  19651. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  19652. new Hot(info, 'byOverlay');
  19653. });
  19654. }
  19655. Hot.createHotList();
  19656. Hot.startLoad();
  19657. if (DATA.roomLabels) {
  19658. DATA.roomLabels.forEach((data) => {
  19659. this.roomLabels.push(new RoomLabel(data));
  19660. });
  19661. }
  19662. };
  19663. if (player.currentPano) {
  19664. create();
  19665. } else {
  19666. let f = () => {
  19667. window.bus.removeEventListener('playerAndModelReady', f);
  19668. create();
  19669. };
  19670. window.bus.addEventListener('playerAndModelReady', f);
  19671. }
  19672. g_index = w.valueFromHash('m');
  19673. }
  19674. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  19675. /* var dataJsPromise = $.Deferred();
  19676. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  19677. a.get(dataJsUrl,{
  19678. responseType: "json",
  19679. auth: this.isPublic ? null : f.authorizationHeader
  19680. }).done(function(data) {
  19681. window.hotData = data;
  19682. this.createHotItem(data, this.hots);
  19683. for(let i in this.hots){//add
  19684. data[i] && this.hots[i].initStyleImg(data[i]);
  19685. }
  19686. dataJsPromise.resolve();
  19687. }.bind(this)).fail(function(){
  19688. console.log('Data.js is empty');
  19689. dataJsPromise.resolve();
  19690. }) */
  19691. r.resolve();
  19692. }.bind(this)
  19693. )
  19694. .fail(function () {
  19695. console.log('没有热点');
  19696. r.resolve();
  19697. }),
  19698. r
  19699. );
  19700. }),
  19701. (n.prototype.loadPanos = function () {
  19702. if (this.loadPanosPromise) return this.loadPanosPromise;
  19703. var e = new I(this);
  19704. return (
  19705. (this.loadPanosPromise = e.load().then(
  19706. function (e) {
  19707. return (
  19708. this.data.sweeps &&
  19709. Object.keys(this.data.sweeps).length > 0 &&
  19710. (e = e.filter(
  19711. function (e) {
  19712. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled;
  19713. else console.log(e.uuid);
  19714. }.bind(this)
  19715. )),
  19716. this.panos.extend(
  19717. e.map(
  19718. function (e) {
  19719. return new v(this, e.uuid, e, this.supportsTiles);
  19720. }.bind(this)
  19721. )
  19722. ),
  19723. this.panos.forEach(
  19724. function (e) {
  19725. e.neighbourUUIDs &&
  19726. (e.neighbourUUIDs.forEach(
  19727. function (t) {
  19728. var i = this.panos.get(t);
  19729. i && this.panos.setNeighbour(e, i, !0);
  19730. }.bind(this)
  19731. ),
  19732. (e.neighbourPanos =
  19733. this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0)));
  19734. }.bind(this)
  19735. ),
  19736. 0 === this.panos.length &&
  19737. (O.warn('Model has no panos, turning off inside mode'),
  19738. (this.supportedModes[c.PANORAMA] = !1)),
  19739. $.when(this)
  19740. );
  19741. }.bind(this)
  19742. )),
  19743. this.loadPanosPromise
  19744. );
  19745. }),
  19746. (n.prototype.loadHighlightReel = function () {
  19747. //xzw
  19748. var e = $.Deferred(),
  19749. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  19750. t = this.options.urlBase + 'data/' + this.sid + '/active_reel.json';
  19751. return (
  19752. a
  19753. .get(t, {
  19754. responseType: 'json',
  19755. auth: this.isPublic ? null : f.authorizationHeader,
  19756. })
  19757. .done(
  19758. function (t) {
  19759. t.reel
  19760. ? (O.info('Got highlight reel with ' + t.reel.length + ' items'),
  19761. this.images.filterByModesAndReel(this.supportedModes, t.reel))
  19762. : O.info('No highlight reel found'),
  19763. e.resolve();
  19764. }.bind(this)
  19765. )
  19766. .fail(function () {
  19767. O.warn('Getting highlight reel failed, no highlights available'), e.resolve();
  19768. }),
  19769. e
  19770. );
  19771. }),
  19772. (n.prototype.waitForLoad = function (e, t) {
  19773. t() ||
  19774. (this.waitQueue.push({
  19775. object: e,
  19776. isLoadedCallback: t,
  19777. }),
  19778. 1 === this.waitQueue.length && this.emit('waiting'));
  19779. }),
  19780. (n.prototype.hide = function () {
  19781. this.floors.hide();
  19782. }),
  19783. (n.prototype.show = function () {
  19784. this.floors.show();
  19785. }),
  19786. (n.prototype.floorNames = function () {
  19787. return this.floors.names();
  19788. }),
  19789. (n.prototype.warpDestFloors = function (e, t) {
  19790. if (!e || this.floors.length !== e.length) return void this.toggleAllFloors(!0);
  19791. var i = e.findIndex(
  19792. function (e) {
  19793. return e;
  19794. }.bind(this)
  19795. );
  19796. i !== -1 && this.setFloor(this.floors.list[i], null, t);
  19797. }),
  19798. (n.prototype.setFloor = function (e, t, i) {
  19799. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor),
  19800. (this.allFloorsVisible = !1),
  19801. this._setFloor(e, t, i);
  19802. }),
  19803. (n.prototype.toggleAllFloors = function (e) {
  19804. (this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible),
  19805. this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor),
  19806. this._setFloor(this.currentFloor);
  19807. }),
  19808. (n.prototype._setFloor = function (e, t, i) {
  19809. (t = t || this.mode),
  19810. this.emit('floor.changed', e, t, this.currentFloor),
  19811. (this.currentFloor = e);
  19812. var n;
  19813. if (t === c.PANORAMA) {
  19814. if ((this.show(), this.shouldShowtags && this.tagsShown))
  19815. for (n in this.tags) this.tags[n].show(f.showFloorDuration);
  19816. } else if (
  19817. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  19818. (this.floors.list.forEach(
  19819. function (e, t) {
  19820. e.toggle(
  19821. e === this.currentFloor || this.allFloorsVisible,
  19822. i || this.allFloorsVisible
  19823. );
  19824. }.bind(this)
  19825. ),
  19826. this.shouldShowtags && this.tagsShown)
  19827. )
  19828. for (n in this.tags) {
  19829. var r = this.tags[n];
  19830. this.allFloorsVisible
  19831. ? r.show(f.showFloorDuration)
  19832. : r.floor === this.currentFloor
  19833. ? r.show(f.showFloorDuration, f.showFloorDelay)
  19834. : r.hide(f.hideFloorDuration, f.hideFloorDelay);
  19835. }
  19836. var o = this,
  19837. a = e;
  19838. E.start(
  19839. function () {},
  19840. f.showFloorDelay,
  19841. function () {
  19842. o.floors.forEach(function (e) {
  19843. e.chunks.forEach(function (t) {
  19844. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor;
  19845. });
  19846. });
  19847. }.bind(this)
  19848. );
  19849. }),
  19850. (n.prototype.toggleExplode = function () {
  19851. this.floors.toggleExplodeHorizontal();
  19852. }),
  19853. (n.prototype.toggleExplodeUp = function () {
  19854. this.floors.toggleExplodeVertical();
  19855. }),
  19856. (n.prototype.nextFloor = function (e) {
  19857. return this.floors.nextFloor(this.currentFloor, e);
  19858. }),
  19859. (n.prototype.addFloor = function (e) {
  19860. this.floors.add(e);
  19861. }),
  19862. (n.prototype.getFloorAtPoint = function (e) {
  19863. return this.floors.getFloorAtPoint(e);
  19864. }),
  19865. (n.prototype.getTagBySid = function (e) {
  19866. return this.tags[e];
  19867. }),
  19868. (n.prototype.addChunk = function (e, t) {
  19869. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t);
  19870. }),
  19871. (n.prototype.setMode = function (e) {
  19872. if (!this.supportedModes[e]) throw new R('Mode not supported for this model: ' + e);
  19873. this.mode = e;
  19874. this.skybox.material.transparent = e == 'panorama' ? false : true; //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  19875. this.chunks.forEach(function (t) {
  19876. t.setMode(e);
  19877. });
  19878. }),
  19879. (n.prototype.build = function () {
  19880. this.heroLocations = this.images.getHeroLocations(this.panos);
  19881. var e = function () {
  19882. return (
  19883. !!(
  19884. this.heroImage &&
  19885. this.heroImage.metadata &&
  19886. this.heroImage.metadata.scan_id &&
  19887. this.panos.get(this.heroImage.metadata.scan_id)
  19888. ) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  19889. );
  19890. }.bind(this)();
  19891. (this.has360Views =
  19892. (f.show360Views.enabled &&
  19893. this.heroLocations.some(
  19894. function (e) {
  19895. return (
  19896. e.cameraMode === c.PANORAMA &&
  19897. this.panos.get(e.panoId) &&
  19898. !this.panos.get(e.panoId).isAligned()
  19899. );
  19900. }.bind(this)
  19901. )) ||
  19902. e),
  19903. null === this.heroImage && O.warn('No hero image defined.'),
  19904. (this.currentFloor = this.floors.last()),
  19905. this.floors.build(),
  19906. (this.colliders = this.floors.reduce(function (e, t) {
  19907. return e.concat(t.collider.children);
  19908. }, [])),
  19909. this.panos.forEach(
  19910. function (e) {
  19911. e.build1(),
  19912. e.on(
  19913. 'enter',
  19914. function () {
  19915. e.floor !== this.currentFloor && this.setFloor(e.floor);
  19916. }.bind(this)
  19917. );
  19918. }.bind(this)
  19919. ),
  19920. this.panos.forEach(function (e) {
  19921. e.build2();
  19922. }),
  19923. this.floors.forEach(
  19924. function (e) {
  19925. this.boundingBox.union(e.boundingBox);
  19926. }.bind(this)
  19927. ),
  19928. (this.size = this.boundingBox.size()),
  19929. (this.center = this.boundingBox.center()),
  19930. this.floors.forEach(
  19931. function (e) {
  19932. O.info(
  19933. 'Floor ' +
  19934. e +
  19935. ': ' +
  19936. e.children.length +
  19937. ' chunks, ' +
  19938. e.panos.length +
  19939. ' panos.'
  19940. );
  19941. }.bind(this)
  19942. ),
  19943. this.panos.populate_path_graph(),
  19944. (this.skybox = new l(this.boundingBox)),
  19945. (this.skybox.matrixWorldNeedsUpdate = !0),
  19946. this.add(this.skybox);
  19947. /* setTimeout(function() {
  19948. //this.hotsCount && this.shineHots()
  19949. Hot.beginShineHot()
  19950. }
  19951. .bind(this), 1300) */
  19952. //add-----
  19953. {
  19954. let maxCount = browser.isMobile() ? 200000 : 400000;
  19955. let noVisiHots = this.hotGroup.children.filter(
  19956. (e) => !e.info.visiblePanos && e.info.texType != 'shine'
  19957. ); //只看非热点的,否则数据太多
  19958. let visiHots = this.hotGroup.children.filter((e) => e.info.visiblePanos);
  19959. let c = this.panos.list.length * this.colliders.length * noVisiHots.length;
  19960. if (c > maxCount) {
  19961. //防止加载时间过长,分批计算
  19962. console.log('hot分批setVisiblePanos');
  19963. Hot.visiPanosCountSlice = Math.ceil(
  19964. maxCount / this.colliders.length / noVisiHots.length
  19965. );
  19966. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  19967. let dur =
  19968. Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) *
  19969. Hot.visiEveryDurSlice;
  19970. console.log(
  19971. Hot.visiPanosCountSlice,
  19972. Hot.visiEveryDurSlice,
  19973. dur,
  19974. Math.round(dur * noVisiHots.length)
  19975. );
  19976. if (noVisiHots.length) {
  19977. let i = 0;
  19978. let hotVisiInterval = setInterval(() => {
  19979. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos);
  19980. i++;
  19981. if (i >= noVisiHots.length) {
  19982. clearInterval(hotVisiInterval);
  19983. }
  19984. }, dur);
  19985. }
  19986. }
  19987. }
  19988. //---------
  19989. this.createFloorLogo();
  19990. return (
  19991. O.debug('Done building model'),
  19992. v.raycastsDone > 0 &&
  19993. (O.warn('raycasts: ' + v.raycastsDone),
  19994. O.warn('raycasts skipped: ' + v.raycastsSkipped)),
  19995. this.buildRooms(),
  19996. this.labels.associateWithRooms(this.rooms),
  19997. $.when(this)
  19998. );
  19999. }),
  20000. (n.prototype.createFloorLogo = function () {
  20001. console.log('createFloorLogo');
  20002. if (this.floorLogos || !settings.floorlogoURL) return;
  20003. var url = settings.floorlogoURL;
  20004. var map = tex.load(url); //可以追加done
  20005. this.floorLogos = [];
  20006. for (var i = 0; i < 2; i++) {
  20007. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  20008. var material = new o.MeshBasicMaterial({
  20009. opacity: 0,
  20010. map: map,
  20011. side: o.DoubleSide,
  20012. transparent: !0,
  20013. depthWrite: !1,
  20014. depthTest: false, //改 在chunk\skybox外也可看到
  20015. });
  20016. var logo = new o.Mesh(new o.PlaneGeometry(2, 2, 1, 1), material);
  20017. //var s = (Store.metadata.floorLogoSize || 100)/100;
  20018. //logo.scale.set(s,s,s);
  20019. logo.position.set(0, -1.5, 0);
  20020. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)));
  20021. logo.renderOrder = 100; //cover the videoSkybox
  20022. //logo.layers.set(0)
  20023. this.add(logo);
  20024. this.floorLogos.push(logo);
  20025. }
  20026. this.floorLogos[1].visible = false;
  20027. });
  20028. (n.prototype.adjustfloorLogoHeight = function (o) {
  20029. var h = player.currentPano.floorPosition.y + 0.01;
  20030. this.floorLogos[1].position.setY(h);
  20031. this.floorLogos[0].position.setY(h);
  20032. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  20033. }),
  20034. (n.prototype.changefloorLogoOpa = function (o) {
  20035. //改 i, opacity, time, delay
  20036. if (!this.floorLogos) return;
  20037. E.cancelById('flOpa_' + o.index); //先停止之前该logo的透明度变化
  20038. if (o.from != void 0) this.floorLogos[o.index].material.opacity = o.from; //初始透明度
  20039. if (!o.dur) {
  20040. //立刻
  20041. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  20042. this.floorLogos[o.index].material.opacity = o.opa;
  20043. } else {
  20044. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  20045. E.start(
  20046. lerp.property(this.floorLogos[o.index].material, 'opacity', o.opa),
  20047. o.dur || 0,
  20048. null,
  20049. o.delay || 0,
  20050. es['easeInQuad'],
  20051. 'changefloorLogoOpa',
  20052. 'flOpa_' + o.index
  20053. );
  20054. }
  20055. }),
  20056. (n.prototype.updateFloorlogo = (function () {
  20057. //xzw add 更新地标的旋转
  20058. var lastQ, lastP;
  20059. var equals = function (v1, v2, min) {
  20060. return Math.abs(v1 - v2) < min;
  20061. };
  20062. var isSame = function (now, last, k) {
  20063. //如果和上次相同就不改变
  20064. if (!last) return false;
  20065. var R = k.sceneRenderer;
  20066. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  20067. //暂时:
  20068. var min = 0.0008;
  20069. var same =
  20070. equals(now.x, last.x, min) &&
  20071. equals(now.y, last.y, min) &&
  20072. equals(now.z, last.z, min) &&
  20073. (now.w != void 0 ? equals(now.w, last.w, min) : true);
  20074. return same;
  20075. };
  20076. return function (Q, k) {
  20077. if (!Q) return;
  20078. /* if(Config.ifFish && window.lowFPS){
  20079. this.fLCompute++;
  20080. if(R.AFPS < 38){
  20081. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  20082. else if(k.flying && k.fLCompute%2 !=1) return;
  20083. k.fLCompute %= 4;
  20084. }else if(R.AFPS < 45){
  20085. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  20086. else if(k.flying && k.fLCompute%2 !=1) return;
  20087. k.fLCompute %= 6;
  20088. }else{
  20089. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  20090. //else if(k.flying && k.fLCompute%2 !=1) return;
  20091. k.fLCompute %= 2;
  20092. }
  20093. } */
  20094. var sameQ, sameP, quaternion, visible;
  20095. for (var i = 0; i < 2; i++) {
  20096. var logo = this.floorLogos[i];
  20097. if (!logo.visible || logo.material.uniforms.opacity.value == 0) continue;
  20098. visible = true;
  20099. }
  20100. if (!visible) return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  20101. var c = k.cameraControls.activeControl;
  20102. var sameQ = c
  20103. ? c.lat < 10
  20104. ? equals(c.lon, lastQ, 0.1)
  20105. : equals(c.lon, lastQ, 1)
  20106. : false;
  20107. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  20108. for (var i = 0; i < 2; i++) {
  20109. var logo = this.floorLogos[i];
  20110. if (!sameQ) {
  20111. if (!quaternion) {
  20112. var a = new THREE.Vector3(0, 0, -1);
  20113. a.applyQuaternion(Q);
  20114. a.setY(0);
  20115. var _ = new THREE.Matrix4().lookAt(
  20116. a,
  20117. new THREE.Vector3(),
  20118. new THREE.Vector3(0, 1, 0)
  20119. );
  20120. quaternion = new THREE.Quaternion().setFromRotationMatrix(_);
  20121. var a = new THREE.Quaternion(0, 0.7071067811865476, 0.7071067811865476, 0); //计算得
  20122. quaternion.multiply(a);
  20123. }
  20124. logo.quaternion.copy(quaternion);
  20125. }
  20126. }
  20127. };
  20128. })());
  20129. (n.prototype.loadLabels = function () {
  20130. //xzw
  20131. this.labels = new x(this);
  20132. var e = $.Deferred();
  20133. //加载俯视图的标签 注释这个备注就会加载
  20134. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  20135. window.DATA.showingLabels ? (this.showingLabels = true) : '';
  20136. if (!this.showingLabels) return e.resolve();
  20137. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  20138. var t = g_Prefix + 'data/' + this.sid + '/labels.json';
  20139. return (
  20140. this.labels
  20141. .load(t, !this.isPublic)
  20142. .done(e.resolve.bind(e))
  20143. .fail(function () {
  20144. O.warn('Getting labels failed, not displaying labels.'), e.resolve();
  20145. }),
  20146. e
  20147. );
  20148. }),
  20149. (n.prototype.buildRooms = function () {
  20150. (this.rooms = new T(this)),
  20151. this.rooms.createFromChunks(this.chunks),
  20152. this.rooms.calcRoomBoundaries();
  20153. }),
  20154. (n.prototype.updateProjectedPanos = function () {
  20155. this.projectedPano0 &&
  20156. this.projectedPano1 &&
  20157. this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1);
  20158. }),
  20159. (n.prototype.setProjectedPanos = function (e, t, i) {
  20160. (void 0 !== i && null !== i) || (i = !0),
  20161. (i = !!i),
  20162. (this.projectedPano0 = e),
  20163. (this.projectedPano1 = t),
  20164. this.skybox.material.setProjectedPanos(e, t, i),
  20165. this.chunks.forEach(function (n) {
  20166. n.materialInside.setProjectedPanos(e, t, i);
  20167. });
  20168. }),
  20169. (n.prototype.setSide = function (e) {
  20170. this.floors.forEach(function (t) {
  20171. t.collider.material.side = e;
  20172. });
  20173. }),
  20174. (n.prototype.heroCount = function () {
  20175. return this.heroLocations ? this.heroLocations.length : 0;
  20176. }),
  20177. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  20178. //改 因增加了二级目录
  20179. if (e[0] < 0)
  20180. return (
  20181. O.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  20182. );
  20183. if (this.heroCount() < 1)
  20184. return (
  20185. O.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'),
  20186. null
  20187. );
  20188. var t = this.heroLocations[e[0]];
  20189. if (t.heroLocations && e[1] != void 0) {
  20190. t = t.heroLocations[e[1]];
  20191. }
  20192. return void 0 === t
  20193. ? (O.warn(
  20194. 'Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'
  20195. ),
  20196. null)
  20197. : t;
  20198. }),
  20199. (n.prototype.findPanoramicHero = function () {
  20200. for (var e in this.heroLocations)
  20201. if (this.heroLocations[e].cameraMode === c.PANORAMA) return this.heroLocations[e];
  20202. return null;
  20203. }),
  20204. (n.prototype.listImagePanos = function () {
  20205. var e = [],
  20206. t = this;
  20207. return (
  20208. this.images.forEach(function (i) {
  20209. if (i.metadata && i.metadata.scan_id) {
  20210. var n = t.panos.get(i.metadata.scan_id);
  20211. n && (t.supportsTiles || n.isLoaded('high') || e.push(n));
  20212. }
  20213. }),
  20214. e
  20215. );
  20216. }),
  20217. (n.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  20218. //改
  20219. //this.panos.fadeMarkerOpacity(e, t)
  20220. if (window.DATA.hideFloorMarker) return;
  20221. var currentPano = player.currentPano;
  20222. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity; //不传opacity代表显示
  20223. var hideWhenFlyOut = () => {
  20224. var shows = [],
  20225. hides = [];
  20226. player.model.panos.forEach((pano) => {
  20227. hides.push(pano);
  20228. });
  20229. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }]);
  20230. };
  20231. if (opacity == 0) {
  20232. hideWhenFlyOut();
  20233. } else {
  20234. if (player.mode == 'panorama' && currentPano) {
  20235. var shows = [],
  20236. hides = [];
  20237. player.model.panos.forEach((pano) => {
  20238. //是邻近点就显示否则隐藏
  20239. if (currentPano.neighbourPanos[pano.id]) {
  20240. shows.push(pano);
  20241. } else {
  20242. hides.push(pano);
  20243. }
  20244. });
  20245. this.panos.fadeMarkerOpacity(opacity, dur, [
  20246. { toOp: opacity, member: shows },
  20247. { toOp: 0, member: hides },
  20248. ]);
  20249. } else if (player.modeTran.split('-')[1] != 'panorama') {
  20250. //飞出后marker隐藏
  20251. hideWhenFlyOut();
  20252. }
  20253. }
  20254. }),
  20255. (n.prototype.setSweepVisibility = function (e) {
  20256. this.panos.forEach(function (t) {
  20257. t.marker && (t.marker.visible = e);
  20258. });
  20259. }),
  20260. (n.prototype.outsideAllowed = function () {
  20261. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN];
  20262. }),
  20263. (n.prototype.addHighMapCube = function () {
  20264. //创建8*8的tile cube
  20265. if (
  20266. player.qualityManager.getMaxZoomClass() == '4k' &&
  20267. player.qualityManager.maxRenderTargetSize == 2048
  20268. ) {
  20269. var geo = new THREE.PlaneGeometry(1, 1, 1, 1);
  20270. var cube = new THREE.Object3D();
  20271. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  20272. var face = new THREE.Object3D();
  20273. for (var i = 0; i < 8; i++) {
  20274. for (var j = 0; j < 8; j++) {
  20275. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }));
  20276. tile.position.set(i - 3.5, j - 3.5, -4);
  20277. if (highMapAddColor) {
  20278. tile.material.opacity = 0.4;
  20279. tile.material.transparent = true;
  20280. var colorHue = Math.random();
  20281. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9);
  20282. }
  20283. tile.visible = false;
  20284. face.add(tile);
  20285. }
  20286. }
  20287. switch (cubeIndex) {
  20288. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  20289. face.rotation.set(0, Math.PI / 2, 0);
  20290. break;
  20291. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  20292. face.rotation.set(0, -Math.PI / 2, 0);
  20293. break;
  20294. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  20295. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20296. new THREE.Vector3(0, 1, 0),
  20297. Math.PI
  20298. );
  20299. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20300. new THREE.Vector3(1, 0, 0),
  20301. Math.PI / 2
  20302. );
  20303. face.quaternion.copy(rot1).multiply(rot2);
  20304. //face.rotation.set(Math.PI/2,0,0);
  20305. break;
  20306. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  20307. //face.rotation.set(-Math.PI/2,0,0);
  20308. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20309. new THREE.Vector3(0, 1, 0),
  20310. Math.PI
  20311. );
  20312. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20313. new THREE.Vector3(1, 0, 0),
  20314. -Math.PI / 2
  20315. );
  20316. face.quaternion.copy(rot1).multiply(rot2);
  20317. break;
  20318. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  20319. face.rotation.set(0, Math.PI, 0);
  20320. break;
  20321. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  20322. face.rotation.set(0, 0, 0);
  20323. }
  20324. face.scale.set(1, -1, 1);
  20325. cube.add(face);
  20326. }
  20327. cube.name = 'highMapCube';
  20328. this.highMapCube = cube;
  20329. this.add(cube);
  20330. cube.scale.set(0.21, 0.21, 0.21); //camera.near is 0.1
  20331. this.highMapCube.visible = false;
  20332. }
  20333. });
  20334. /*
  20335. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  20336. */
  20337. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  20338. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  20339. return !!tile.material.map;
  20340. };
  20341. n.prototype.updateHighMap = function (tex, cubeFace, tileX, tileY) {
  20342. //console.log('updateHighMap')
  20343. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY];
  20344. tile.material.map = tex;
  20345. if (highMapAddColor) {
  20346. tile.material.opacity = 1;
  20347. tile.material.transparent = false;
  20348. }
  20349. tile.visible = true;
  20350. tile.material.needsUpdate = true; //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  20351. };
  20352. n.prototype.resetHighMap = function () {
  20353. //console.log('resetHighMap')
  20354. if (!this.highMapCube) return;
  20355. this.highMapCube.children.forEach((e) =>
  20356. e.children.forEach((tile) => {
  20357. if (tile.material.map) {
  20358. tile.material.map.dispose();
  20359. tile.material.map.loaded = !1;
  20360. tile.material.map.version = 0;
  20361. var h = player.sceneRenderer.renderer.properties.get(tile.material.map);
  20362. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture);
  20363. tile.material.map = null;
  20364. if (highMapAddColor) {
  20365. tile.material.opacity = 0.4;
  20366. tile.material.transparent = true;
  20367. }
  20368. tile.material.needsUpdate = true;
  20369. tile.visible = false;
  20370. }
  20371. })
  20372. );
  20373. this.highMapCube.visible = false;
  20374. };
  20375. n.prototype.setHighMap = function (pano) {
  20376. if (!this.highMapCube) return;
  20377. this.highMapCube.position.copy(pano.position);
  20378. this.highMapCube.quaternion.copy(pano.quaternion);
  20379. };
  20380. n.prototype.showHighMap = function () {
  20381. if (!this.highMapCube) return;
  20382. this.highMapCube.visible = true;
  20383. };
  20384. n.prototype.hideHighMap = function () {
  20385. if (!this.highMapCube) return;
  20386. this.highMapCube.visible = false;
  20387. };
  20388. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  20389. t.exports = n;
  20390. }.call(this, '/js/model/Model.js'));
  20391. },
  20392. {
  20393. '../constants': 8,
  20394. '../enum/AlignmentType': 17,
  20395. '../enum/RenderOrder': 42,
  20396. '../enum/Viewmode': 51,
  20397. '../exception/BasicException': 55,
  20398. '../label/Label': 90,
  20399. '../loaders/ModelLoader': 105,
  20400. '../loaders/ModelTextureLoader': 106,
  20401. '../loaders/SweepDataLoader': 107,
  20402. '../tag/tag': 123,
  20403. '../tag/tagManager': 124,
  20404. '../objects/BoundingTextureSkybox': 143,
  20405. '../objects/Chunk': 144,
  20406. '../objects/Floor': 146,
  20407. '../objects/Panorama': 148,
  20408. '../objects/Room': 150,
  20409. '../objects/Snapshot': 153,
  20410. '../settings': 166,
  20411. '../shaders': 167,
  20412. '../util/ModelUrls': 177,
  20413. '../util/PanoramaCollection': 178,
  20414. '../util/ajax': 181,
  20415. '../util/common': 185,
  20416. '../util/easing': 186,
  20417. '../util/lerp': 188,
  20418. '../util/logger': 189,
  20419. '../util/math': 190,
  20420. '../util/texture': 194,
  20421. '../util/transitions': 195,
  20422. './../util/browser': 182,
  20423. './../util/showcase': 193,
  20424. './Chunks': 135,
  20425. './FloorCollection': 136,
  20426. './ImageCollection': 137,
  20427. './LabelCollection': 138,
  20428. './RoomCollection': 141,
  20429. events: 202,
  20430. three: 217,
  20431. hot: 'hot',
  20432. '../enum/GLCubeFaces': 25,
  20433. },
  20434. ],
  20435. 140: [
  20436. function (e, t, i) {
  20437. 'use strict';
  20438. function n() {
  20439. (this.modelMap = {}),
  20440. (this.activeModel = null),
  20441. (this.modelCount = 0),
  20442. (this.tileDownloader = null),
  20443. (this.panoRenderer = null);
  20444. }
  20445. var r = (e('three'), e('../util/common')),
  20446. o = e('../exception/BasicException'),
  20447. a = e('../enum/ModelManagerEvents'),
  20448. s = e('../enum/PanoRendererEvents'),
  20449. l = e('events').EventEmitter;
  20450. (n.prototype.init = function (e, t, i) {
  20451. (this.tileDownloader = e),
  20452. (this.panoRenderer = t),
  20453. (this.qualityManager = i),
  20454. this.bindEvents();
  20455. }),
  20456. (n.prototype.bindEvents = function () {
  20457. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this));
  20458. }),
  20459. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  20460. (n.prototype.addModel = function (e) {
  20461. (this.modelMap[e.sid] = e),
  20462. 0 === this.modelCount && this.activateModel(e.sid),
  20463. this.modelCount++,
  20464. this.emit(a.ModelAdded);
  20465. }),
  20466. (n.prototype.getModel = function (e) {
  20467. return this.modelMap[e];
  20468. }),
  20469. (n.prototype.activateModel = function (e) {
  20470. var t = this.modelMap[e];
  20471. if (!t) throw new o('Tried to activate invalid model!');
  20472. var i = this.activeModel;
  20473. (this.activeModel = t),
  20474. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  20475. this.tileDownloader.setUrls(t.urls),
  20476. t.panos.forEach(
  20477. function (e) {
  20478. e.attachToPanoRenderer(this.panoRenderer),
  20479. (e.tileDownloader = this.tileDownloader),
  20480. (e.qualityManager = this.qualityManager);
  20481. }.bind(this)
  20482. ),
  20483. this.emit(a.ActiveModelChanged, {
  20484. oldModel: i,
  20485. model: t,
  20486. });
  20487. }),
  20488. (n.prototype.getActiveModel = function () {
  20489. return this.activeModel;
  20490. }),
  20491. r.extend(n, l),
  20492. (t.exports = n);
  20493. },
  20494. {
  20495. '../enum/ModelManagerEvents': 33,
  20496. '../enum/PanoRendererEvents': 35,
  20497. '../exception/BasicException': 55,
  20498. '../util/common': 185,
  20499. events: 202,
  20500. three: 217,
  20501. },
  20502. ],
  20503. 141: [
  20504. function (e, t, i) {
  20505. (function (i) {
  20506. 'use strict';
  20507. function n() {
  20508. s.call(this);
  20509. }
  20510. var r = e('../objects/Room'),
  20511. o = (e('../settings'), e('../util/logger')),
  20512. a = (e('../util/transitions'), e('../util/easing'), e('../util/common')),
  20513. s = e('../util/IndexedCollection'),
  20514. l = e('./Chunks');
  20515. new o(i);
  20516. a.inherit(n, s),
  20517. (n.prototype.getIndex = function (e) {
  20518. return e.roomId;
  20519. }),
  20520. (n.prototype.calcRoomBoundaries = function () {
  20521. this.forEach(function (e) {
  20522. e.calcBoundaries();
  20523. });
  20524. }),
  20525. (n.prototype.createFromChunks = function (e) {
  20526. var t = {
  20527. floorId: -1,
  20528. roomId: -1,
  20529. },
  20530. i = {};
  20531. e.forEach(
  20532. function (e) {
  20533. l.parseIdsFromChunkName(e.name, t);
  20534. var o = i[t.roomId];
  20535. if (!o) {
  20536. var a = n.generateRoomId(t.floorId, t.roomId);
  20537. (o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o);
  20538. }
  20539. o.addChunk(e);
  20540. }.bind(this)
  20541. ),
  20542. this.calcRoomBoundaries();
  20543. }),
  20544. (n.generateRoomId = function (e, t) {
  20545. return e + '_' + t;
  20546. }),
  20547. (t.exports = n);
  20548. }.call(this, '/js/model/RoomCollection.js'));
  20549. },
  20550. {
  20551. '../objects/Room': 150,
  20552. '../settings': 166,
  20553. '../util/IndexedCollection': 175,
  20554. '../util/common': 185,
  20555. '../util/easing': 186,
  20556. '../util/logger': 189,
  20557. '../util/transitions': 195,
  20558. './Chunks': 135,
  20559. },
  20560. ],
  20561. 142: [
  20562. function (e, t, i) {
  20563. 'use strict';
  20564. function n(e, t, i) {
  20565. e = e.clone().expandByScalar(0.01); //改
  20566. var n = e.size(),
  20567. o = new r.BoxGeometry(n.x, n.y, n.z);
  20568. (o.boundingBox = e),
  20569. r.Mesh.call(this, o, t),
  20570. this.position.copy(e.center()),
  20571. (this.frustumCulled = !1),
  20572. i && this.add(new r.WireframeHelper(this));
  20573. }
  20574. var r = e('three');
  20575. (n.prototype = Object.create(r.Mesh.prototype)),
  20576. (n.prototype.constructor = n),
  20577. (t.exports = n);
  20578. },
  20579. {
  20580. three: 217,
  20581. },
  20582. ],
  20583. 143: [
  20584. function (e, t, i) {
  20585. (function (i) {
  20586. 'use strict';
  20587. function n(e) {
  20588. h.time('Computing a nice bounding cubemap');
  20589. var t = new a({
  20590. side: r.BackSide,
  20591. transparent: !0,
  20592. });
  20593. (t.uniforms.modelAlpha.value = 0),
  20594. (t.uniforms.opacity.value = 1 - s.modelAlpha),
  20595. (this.renderOrder = l.boundingSkybox),
  20596. o.call(this, e, t),
  20597. h.timeEnd('Computing a nice bounding cubemap');
  20598. }
  20599. var r = e('three'),
  20600. o = (e('../enum/Viewmode'), e('../shaders'), e('./BoundingMesh')),
  20601. a = e('../materials/ModelTextureMaterial'),
  20602. s = e('../settings'),
  20603. l = e('../enum/RenderOrder'),
  20604. c = e('../util/logger'),
  20605. h = new c(i);
  20606. (n.prototype = Object.create(o.prototype)),
  20607. (n.prototype.constructor = n),
  20608. (t.exports = n);
  20609. }.call(this, '/js/objects/BoundingTextureSkybox.js'));
  20610. },
  20611. {
  20612. '../enum/RenderOrder': 42,
  20613. '../enum/Viewmode': 51,
  20614. '../materials/ModelTextureMaterial': 118,
  20615. '../settings': 166,
  20616. '../shaders': 167,
  20617. '../util/logger': 189,
  20618. './BoundingMesh': 142,
  20619. three: 217,
  20620. },
  20621. ],
  20622. 144: [
  20623. function (e, t, i) {
  20624. 'use strict';
  20625. function n(e) {
  20626. this.materialInside = new s({
  20627. side: r.DoubleSide,
  20628. });
  20629. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  20630. (this.materialOutside = new r.RawShaderMaterial({
  20631. fragmentShader: o.modelOutside.fragmentShader,
  20632. vertexShader: o.modelOutside.vertexShader,
  20633. uniforms: t,
  20634. side: r.FrontSide,
  20635. name: 'chunkOut',
  20636. })),
  20637. r.Mesh.call(this, e.geometry, this.materialInside),
  20638. (this.name = e.name || ''),
  20639. (this.textureName = e.textureName),
  20640. (this.meshUrl = e.meshUrl);
  20641. }
  20642. var r = e('three'),
  20643. o = e('../shaders'),
  20644. a = e('../enum/Viewmode'),
  20645. s = e('../materials/ModelTextureMaterial');
  20646. (n.prototype = Object.create(r.Mesh.prototype)),
  20647. (n.prototype.setTextureMap = function (e) {
  20648. (this.materialInside.uniforms.map.value = e),
  20649. (this.materialOutside.uniforms.map.value = e);
  20650. }),
  20651. (n.prototype.setMode = function (e) {
  20652. var t =
  20653. e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  20654. (t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  20655. (t.transparent = this.material.transparent),
  20656. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  20657. (this.material = t);
  20658. }),
  20659. (t.exports = n);
  20660. },
  20661. {
  20662. '../enum/Viewmode': 51,
  20663. '../materials/ModelTextureMaterial': 118,
  20664. '../shaders': 167,
  20665. three: 217,
  20666. },
  20667. ],
  20668. 145: [
  20669. function (e, t, i) {
  20670. 'use strict';
  20671. function n(e) {
  20672. (this.chunksize = e || 10),
  20673. (this.chunks = {}),
  20674. (this.boundingBoxes = {}),
  20675. (this.children = []),
  20676. (this.offset = new r.Vector3(0, 0.5, 0)),
  20677. (this.material = new r.MeshBasicMaterial({
  20678. color: 16777215 * Math.random(),
  20679. side: r.DoubleSide,
  20680. }));
  20681. }
  20682. var r = e('three');
  20683. e('../enum/Viewmode');
  20684. (n.prototype.add = function (e) {
  20685. var t,
  20686. i,
  20687. n,
  20688. o,
  20689. a,
  20690. s,
  20691. l,
  20692. c,
  20693. h,
  20694. u,
  20695. d,
  20696. p,
  20697. f,
  20698. g,
  20699. m = e.attributes;
  20700. m
  20701. ? ((t = m.position.array), (i = void 0 !== e.index ? e.index.array : void 0))
  20702. : ((t = e.vertices), (n = e.faces));
  20703. var v = new r.Vector3();
  20704. if (i)
  20705. for (o = 0, a = i.length; o < a; o += 3) {
  20706. var A = 3 * i[o],
  20707. y = 3 * i[o + 1],
  20708. C = 3 * i[o + 2];
  20709. (s = (t[A] + t[y] + t[C]) / 3),
  20710. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  20711. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  20712. (h = Math.floor(s / this.chunksize)),
  20713. (u = Math.floor(l / this.chunksize)),
  20714. (d = Math.floor(c / this.chunksize)),
  20715. (p = h + '.' + u + '.' + d),
  20716. p in this.chunks
  20717. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20718. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20719. g.push(
  20720. t[A],
  20721. t[A + 1],
  20722. t[A + 2],
  20723. t[y],
  20724. t[y + 1],
  20725. t[y + 2],
  20726. t[C],
  20727. t[C + 1],
  20728. t[C + 2]
  20729. ),
  20730. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  20731. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  20732. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]));
  20733. }
  20734. else
  20735. for (o = 0, a = t.length; o < a; o += 9)
  20736. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  20737. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  20738. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  20739. (h = Math.floor(s / this.chunksize)),
  20740. (u = Math.floor(l / this.chunksize)),
  20741. (d = Math.floor(c / this.chunksize)),
  20742. (p = h + '.' + u + '.' + d),
  20743. p in this.chunks
  20744. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20745. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20746. g.push(
  20747. t[o],
  20748. t[o + 1],
  20749. t[o + 2],
  20750. t[o + 3],
  20751. t[o + 4],
  20752. t[o + 5],
  20753. t[o + 6],
  20754. t[o + 7],
  20755. t[o + 8]
  20756. ),
  20757. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  20758. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  20759. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]));
  20760. }),
  20761. (n.prototype.build = function () {
  20762. var e = new r.Object3D();
  20763. e.material = this.material;
  20764. for (var t in this.chunks) {
  20765. var i = this.chunks[t],
  20766. n = new r.BufferGeometry();
  20767. n.addAttribute('position', new r.BufferAttribute(new Float32Array(i), 3)),
  20768. (n.boundingBox = this.boundingBoxes[t]);
  20769. var o = new r.Mesh(n, this.material);
  20770. (o.material.visible = !1), e.add(o), (this.chunks[t] = []);
  20771. }
  20772. return e;
  20773. }),
  20774. (t.exports = n);
  20775. },
  20776. {
  20777. '../enum/Viewmode': 51,
  20778. three: 217,
  20779. },
  20780. ],
  20781. 146: [
  20782. function (e, t, i) {
  20783. 'use strict';
  20784. var r = e('three'),
  20785. o = e('../settings'),
  20786. a = e('../util/common'),
  20787. s = e('../util/lerp'),
  20788. l = e('./ChunkedCollider'),
  20789. c = e('../util/transitions'),
  20790. h = e('../util/easing'),
  20791. u = (e('../objects/Panorama'), e('../enum/RenderOrder')),
  20792. d = e('../localization/localize');
  20793. function n(e, t, i) {
  20794. r.Object3D.call(this),
  20795. (this.model = e),
  20796. (this.floorIndex = t),
  20797. (this.lang = o.languageTag),
  20798. (this.name =
  20799. i || o.languageTag === 'cn' ? 'Floor ' + (t + 1) + '' : '第' + (t + 1) + '层'),
  20800. (this.panos = []),
  20801. (this.chunks = []),
  20802. (this.colliderBuilder = new l(3)),
  20803. (this.collider = null),
  20804. (this.center = null),
  20805. (this.boundingBox = new r.Box3()),
  20806. (this.size = null),
  20807. (this.hidden = !1),
  20808. (this.conservativeBoundingBox = new r.Box3()),
  20809. (this.debugColor = 16777215 * Math.random()),
  20810. (this.transition = null);
  20811. }
  20812. (n.prototype = Object.create(r.Object3D.prototype)),
  20813. (n.prototype.enter = function (e) {
  20814. this.model.setFloor(this, e);
  20815. }),
  20816. (n.prototype.hide = function (e) {
  20817. if (!this.hidden || this.transition) {
  20818. this.chunks.forEach(function (e) {
  20819. e.material.transparent = !0;
  20820. }),
  20821. c.cancel(this.transition);
  20822. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  20823. i = e ? 0 : o.hideFloorDelay / t;
  20824. this.transition = c.start(
  20825. s.allUniforms(this.chunks, 'opacity', 0.08),
  20826. t,
  20827. function () {
  20828. this.hidden = !0;
  20829. }.bind(this),
  20830. i,
  20831. h.easeInOutQuad
  20832. );
  20833. }
  20834. }),
  20835. (n.prototype.show = function (e) {
  20836. if (this.hidden || this.transition) {
  20837. (this.hidden = !1), c.cancel(this.transition);
  20838. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay,
  20839. i = e ? 0 : o.showFloorDelay / t;
  20840. this.transition = c.start(
  20841. s.allUniforms(this.chunks, 'opacity', 1),
  20842. t,
  20843. function () {
  20844. this.hidden ||
  20845. this.chunks.forEach(function (e) {
  20846. e.material.transparent = !1;
  20847. });
  20848. }.bind(this),
  20849. i,
  20850. h.easeInOutQuad
  20851. );
  20852. }
  20853. }),
  20854. (n.prototype.toggle = function (e, t) {
  20855. (e = void 0 === e ? this.hidden : e), e ? this.show(t) : this.hide(t);
  20856. }),
  20857. (n.prototype.containsPoint = function (e) {
  20858. return this.collider.children.some(function (t) {
  20859. return (
  20860. t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  20861. t.geometry.boundingBox.containsPoint(e)
  20862. );
  20863. });
  20864. }),
  20865. (n.prototype.distanceToPoint = function (e) {
  20866. var t = null,
  20867. i = 1 / 0;
  20868. return (
  20869. this.collider.children.forEach(function (n) {
  20870. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  20871. var r = n.geometry.boundingBox.distanceToPoint(e);
  20872. (!t || i > r) && ((i = r), (t = n));
  20873. }),
  20874. i
  20875. );
  20876. }),
  20877. (n.prototype.addChunk = function (e) {
  20878. (e.renderOrder = u.ghostFloor),
  20879. this.add(e),
  20880. this.chunks.push(e),
  20881. this.boundingBox.union(e.geometry.boundingBox),
  20882. (this.size = this.boundingBox.size()),
  20883. this.colliderBuilder.add(e.geometry);
  20884. }),
  20885. (n.prototype.addPano = function (e) {
  20886. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker);
  20887. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  20888. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  20889. var t = new r.Vector3(1, 1, 1),
  20890. i = new r.Box3().setFromCenterAndSize(e.position, t);
  20891. this.boundingBox.union(i);
  20892. }
  20893. }),
  20894. (n.prototype.build = function () {
  20895. (this.collider = this.colliderBuilder.build(!0)),
  20896. this.add(this.collider),
  20897. (this.center = this.boundingBox.center()),
  20898. this.conservativeBoundingBox.copy(this.boundingBox),
  20899. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  20900. this.collider.children.map(function (e) {
  20901. return e.geometry.boundingBox.min.y;
  20902. }),
  20903. 5
  20904. )),
  20905. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  20906. this.collider.children.map(function (e) {
  20907. return e.geometry.boundingBox.max.y;
  20908. }),
  20909. 5
  20910. )),
  20911. (this.colliderBuilder = null);
  20912. }),
  20913. (n.prototype.toShortString = function () {
  20914. return a.nth(this.floorIndex + 1);
  20915. }),
  20916. (n.prototype.toString = function () {
  20917. return this.name;
  20918. }),
  20919. (t.exports = n);
  20920. },
  20921. {
  20922. '../enum/RenderOrder': 42,
  20923. '../localization/localize': 108,
  20924. './strings-cn-CN': 109,
  20925. '../objects/Panorama': 148,
  20926. '../settings': 166,
  20927. '../util/common': 185,
  20928. '../util/easing': 186,
  20929. '../util/lerp': 188,
  20930. '../util/transitions': 195,
  20931. './ChunkedCollider': 145,
  20932. three: 217,
  20933. },
  20934. ],
  20935. 147: [
  20936. function (e, t, i) {
  20937. 'use strict';
  20938. function n(e) {
  20939. (this.player = e), (this.obj3d = null), (this.UP = new r.Vector3(0, 1, 0));
  20940. }
  20941. var r = e('three'),
  20942. o = e('../settings');
  20943. (n.prototype.prefs = {
  20944. linewidth: 3,
  20945. height: 0.07,
  20946. opacity: 0.45,
  20947. endScale: 0.05,
  20948. }),
  20949. (n.prototype.discard = function () {
  20950. if (this.obj3d) {
  20951. var e = this.obj3d.parent;
  20952. e && e.remove(this.obj3d);
  20953. }
  20954. this.obj3d = null;
  20955. }),
  20956. (n.prototype.draw = function () {
  20957. if ((this.discard(), o.showNeighbors)) {
  20958. var e = this.player.currentPano.floor;
  20959. this.obj3d = new r.Object3D();
  20960. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  20961. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  20962. i.y += this.prefs.height;
  20963. var n = 0.1525,
  20964. a = 0.127,
  20965. s = 0.0127,
  20966. l = 0.1,
  20967. c = 0.19,
  20968. h = 0.2032,
  20969. u = 0.2286,
  20970. d = 0.255,
  20971. p = new r.Matrix4();
  20972. for (var f in t)
  20973. if (t[f]) {
  20974. var g = this.player.model.panos.get(f),
  20975. m =
  20976. (g.position.clone().sub(this.player.model.position),
  20977. g.position.clone().sub(g.floorPosition)),
  20978. v = g.floorPosition.clone().sub(this.player.model.position);
  20979. v.y += this.prefs.height;
  20980. var A = new r.Geometry();
  20981. A.vertices.push(
  20982. new r.Vector3(0, -s, 0),
  20983. new r.Vector3(-s, 0, 0),
  20984. new r.Vector3(0, s, 0),
  20985. new r.Vector3(s, 0, 0),
  20986. new r.Vector3(0, -s, 0)
  20987. ),
  20988. A.vertices.push(
  20989. new r.Vector3(0, -d, 0),
  20990. new r.Vector3(d, -d, 0),
  20991. new r.Vector3(d, n, 0),
  20992. new r.Vector3(-n, n, 0),
  20993. new r.Vector3(-n, a, 0),
  20994. new r.Vector3(-c, l, 0),
  20995. new r.Vector3(-c, -h, 0),
  20996. new r.Vector3(-n, -u, 0),
  20997. new r.Vector3(-n, -d, 0),
  20998. new r.Vector3(0, -d, 0)
  20999. ),
  21000. p.identity().setPosition(m),
  21001. A.applyMatrix(p),
  21002. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  21003. A.vertices.push(
  21004. new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  21005. new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  21006. new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  21007. new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  21008. ),
  21009. p.lookAt(v, i, this.UP).setPosition(v),
  21010. A.applyMatrix(p),
  21011. A.vertices.push(v, i);
  21012. var y = new r.Line(
  21013. A,
  21014. new r.LineBasicMaterial({
  21015. color: g.debugColor.getHex(),
  21016. transparent: !0,
  21017. opacity: this.prefs.opacity,
  21018. depthWrite: !1,
  21019. name: 'sLine' + f,
  21020. linewidth: this.prefs.linewidth,
  21021. })
  21022. );
  21023. this.obj3d.add(y);
  21024. }
  21025. e.add(this.obj3d);
  21026. }
  21027. }),
  21028. (n.prototype.update = function () {
  21029. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld();
  21030. }),
  21031. (t.exports = n);
  21032. },
  21033. {
  21034. '../settings': 166,
  21035. three: 217,
  21036. },
  21037. ],
  21038. 148: [
  21039. function (e, t, i) {
  21040. (function (i) {
  21041. 'use strict';
  21042. function n(e, t, i, n) {
  21043. (this.model = e),
  21044. (this.id = t),
  21045. (this.alignmentType = i.alignmentType || l.ALIGNED),
  21046. (this.neighbourUUIDs = i.neighbours || null),
  21047. (this.neighbourPanos = null),
  21048. (this.floor = null),
  21049. (this.floorIndex = i.floor),
  21050. (this.failedLoadingAt = 0),
  21051. (this.maxLoadRetries = 4),
  21052. (this.origin = i.position.clone()),
  21053. (this.position =
  21054. this.alignmentType === l.UNALIGNED ? new r.Vector3(0, -5, 0) : i.position.clone()),
  21055. (this.quaternion = i.quaternion.clone()),
  21056. (this.skyboxMesh = new r.Mesh(E)),
  21057. this.skyboxMesh.position.copy(this.position),
  21058. this.skyboxMesh.quaternion.copy(this.quaternion),
  21059. (this.skyboxMesh.name = 'skybox'),
  21060. (this.skyboxMesh.visible = !1),
  21061. this.skyboxMesh.updateMatrix(),
  21062. this.skyboxMesh.updateMatrixWorld(),
  21063. (this.marker = null),
  21064. (this.showFloorMarker = !window.DATA.hideFloorMarker);
  21065. if (this.isAligned()) {
  21066. (this.marker = new r.Mesh(
  21067. b,
  21068. new r.MeshBasicMaterial({
  21069. map: w,
  21070. side: r.DoubleSide,
  21071. opacity: 0,
  21072. transparent: !0,
  21073. depthWrite: !1,
  21074. })
  21075. )),
  21076. (this.marker.visible = false); //改:先不显示,之后根据opacity显示
  21077. (this.marker.renderOrder = s.panoMarker),
  21078. (this.marker.name = 'marker'),
  21079. (this.marker.pano = this),
  21080. this.marker.layers.set(v.PANOMARKERS),
  21081. this.marker.updateMatrixWorld();
  21082. if (!window.DATA.hideFloorMarker) {
  21083. //xzw
  21084. let opa = this.marker.material.opacity;
  21085. Object.defineProperty(this.marker.material, 'opacity', {
  21086. get: function () {
  21087. return opa;
  21088. },
  21089. set: (o) => {
  21090. opa = o;
  21091. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0);
  21092. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  21093. //console.log(o,this.id,this.marker.visible)
  21094. },
  21095. });
  21096. }
  21097. a.colorMarkerOnLoad &&
  21098. this.on('load', function () {
  21099. this.marker.material.color.set(65280);
  21100. });
  21101. }
  21102. (this.debugColor = new r.Color().setHSL(
  21103. 0.06 + 0.53 * Math.random(),
  21104. 0.8 + 0.2 * Math.random(),
  21105. 0.5 + 0.2 * Math.random()
  21106. )),
  21107. (this.floorPosition = i.puck ? i.puck.clone() : null),
  21108. (this.tiled = n),
  21109. this.tiled
  21110. ? (this.solidSkybox = null)
  21111. : ((this.solidSkybox = new r.Texture([null, null, null, null, null, null])),
  21112. (this.solidSkybox.flipY = !1),
  21113. a.minimalMemoryMode &&
  21114. ((this.solidSkybox.minFilter = r.LinearFilter),
  21115. (this.solidSkybox.magFilter = r.LinearFilter),
  21116. (this.solidSkybox.generateMipmaps = !1))),
  21117. (this.zoomed = !1),
  21118. (this.panoRenderer = null),
  21119. (this.qualityManager = null),
  21120. (this.tileDownloader = null),
  21121. (this.tiledPanoRenderTarget = null),
  21122. (this.minimumTiledPanoLoaded = !1),
  21123. (this.highestPartialTileRenderOpCompleted = 0),
  21124. (this.highestFullTileRenderOpCompleted = 0),
  21125. (this.shouldRedrawOnBaseLoaded = !1),
  21126. (this.lockUntilRenderingComplete = !1),
  21127. a.colorMarkerOnLoad &&
  21128. this.on('load', function () {
  21129. this.marker.material.color.set(65280);
  21130. });
  21131. /********************************************************************fyz改vr from徐世廷*************************************************************/
  21132. var e = new r.TextureLoader();
  21133. e.setCrossOrigin(!0);
  21134. var g = e.load('images/texture.jpg');
  21135. if (
  21136. ((this.vrMarker = new r.Mesh(
  21137. new r.OctahedronGeometry(0.1, 0),
  21138. new r.MeshLambertMaterial({
  21139. color: 16777215,
  21140. transparent: !0,
  21141. opacity: 0.75,
  21142. map: g,
  21143. })
  21144. )),
  21145. (this.vrMarker.boluoType = 'vr'),
  21146. (this.vrMarker.position.z = 1),
  21147. (this.vrMarker.enabled = !0),
  21148. (this.vrMarker.visible = !1),
  21149. (window.vrMarkers = window.vrMarkers || []),
  21150. window.vrMarkers.push(this.vrMarker),
  21151. this.marker && this.marker.add(this.vrMarker),
  21152. a.showAxis &&
  21153. (this.skyboxMesh.add(
  21154. new r.ArrowHelper(new r.Vector3(0, 1, 0), new r.Vector3(0, 0, 0), 1, 255)
  21155. ),
  21156. this.skyboxMesh.add(
  21157. new r.ArrowHelper(new r.Vector3(0, 0, 1), new r.Vector3(0, 0, 0), 1, 16711680)
  21158. ),
  21159. this.skyboxMesh.add(
  21160. new r.ArrowHelper(new r.Vector3(1, 0, 0), new r.Vector3(0, 0, 0), 1, 65280)
  21161. )),
  21162. this.adjustAngleEnable)
  21163. ) {
  21164. var i = new r.Quaternion();
  21165. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX),
  21166. this.skyboxMesh.quaternion.multiply(i);
  21167. var m = new r.Quaternion();
  21168. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY),
  21169. this.skyboxMesh.quaternion.multiply(m);
  21170. var n = new r.Quaternion();
  21171. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  21172. this.skyboxMesh.quaternion.multiply(n),
  21173. this.skyboxMesh.updateMatrix(),
  21174. this.skyboxMesh.updateMatrixWorld(),
  21175. this.model.updateProjectedPanos();
  21176. }
  21177. /**************************************************************************************************************************************/
  21178. }
  21179. var r = e('three'),
  21180. o = e('../util/logger'),
  21181. a = e('../settings'),
  21182. s = (e('../enum/Viewmode'), e('../enum/RenderOrder')),
  21183. l = e('../enum/AlignmentType'),
  21184. c = (e('../util/common'), e('../util/transitions')),
  21185. h = e('../util/lerp'),
  21186. u = e('../util/ajax'),
  21187. d = e('../util/texture'),
  21188. p = e('../util/panorama'),
  21189. f = (e('../enum/TileDownloaderEvents'), e('../enum/PanoramaEvents')),
  21190. g = e('../enum/PanoRendererEvents'),
  21191. m = e('../enum/PanoSizeClass'),
  21192. v = e('../enum/RenderLayers'),
  21193. A =
  21194. (e('../scene/SceneRenderer'),
  21195. e('../enum/GLCubeFaces'),
  21196. e('../exception/BasicException')),
  21197. y = e('../tile/TileUtils'),
  21198. C = e('events').EventEmitter,
  21199. I = new o(i),
  21200. E = new r.SphereBufferGeometry(0.1),
  21201. b = new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  21202. w = d.load('images/marker-256x256.png');
  21203. w.anisotropy = browser.isMobile() ? 1 : 3; //add
  21204. (n.prototype = Object.create(C.prototype)),
  21205. (n.prototype.enter = (function () {
  21206. var e = null;
  21207. return function () {
  21208. this.setZoomed(!1),
  21209. this.emit('enter', {
  21210. oldPano: e,
  21211. newPano: this,
  21212. }),
  21213. (e = this);
  21214. this.model.setHighMap(this); //add
  21215. };
  21216. })()),
  21217. (n.prototype.exit = function () {
  21218. this.tiled
  21219. ? (this.clearWaitDeferreds(),
  21220. (this.minimumTiledPanoLoaded = !1),
  21221. (this.tiledPanoRenderTarget = null),
  21222. this.setZoomed(!1),
  21223. this.panoRenderer.deactivateTiledPano(this),
  21224. (this.highestPartialTileRenderOpCompleted = 0),
  21225. (this.highestFullTileRenderOpCompleted = 0))
  21226. : (this.solidSkybox.dispose(),
  21227. (this.solidSkybox.loaded = !1),
  21228. (this.solidSkybox.version = 0)),
  21229. this.emit('exit');
  21230. }),
  21231. (n.prototype.hoverOn = function (e) {
  21232. this.marker &&
  21233. (c.start(
  21234. h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover),
  21235. 250
  21236. ),
  21237. a.navigation.panoScores & a.navigation.mouseDirection &&
  21238. this.addTextSprite('HIT', 12525854));
  21239. }),
  21240. (n.prototype.hoverOff = function (e) {
  21241. this.marker &&
  21242. c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250);
  21243. }),
  21244. (n.prototype.build1 = function () {
  21245. (this.floor =
  21246. this.floor ||
  21247. this.model.floors.get(this.floorIndex) ||
  21248. (this.model.floors.list.length == 1
  21249. ? this.model.floors.list[0]
  21250. : this.raycastToFindFloor()) ||
  21251. this.model.getFloorAtPoint(this.position)),
  21252. this.floor.addPano(this),
  21253. (this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  21254. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  21255. a.colorMarkerByFloor &&
  21256. this.marker &&
  21257. this.marker.material.color.set(this.floor.debugColor);
  21258. }),
  21259. (n.prototype.build2 = function () {
  21260. (this.floorPosition = this.floorPosition || this.interpolateFloorPosition()),
  21261. (this.height = this.position.distanceTo(this.floorPosition)),
  21262. this.placeMarker();
  21263. }),
  21264. (n.prototype.interpolateFloorPosition = function () {
  21265. var e = this.model.panos
  21266. .filter(n.filters.isNeighbourPanoTo(this))
  21267. .filter(function (e) {
  21268. return !!e.floorPosition;
  21269. })
  21270. .sort(
  21271. function (e, t) {
  21272. return (
  21273. e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  21274. );
  21275. }.bind(this)
  21276. ),
  21277. t = this.position.clone();
  21278. return (
  21279. e.length >= 2
  21280. ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2)
  21281. : t.add(a.noMeshFloorPositionOffset),
  21282. t
  21283. );
  21284. }),
  21285. (n.prototype.raycastFloorPosition = function () {
  21286. I.warn('Performance warning: Raycasting to find floor position');
  21287. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  21288. t = e.intersectObjects(this.model.colliders);
  21289. return t.length ? t[0].point : null;
  21290. }),
  21291. (n.prototype.raycastToFindFloor = (function () {
  21292. var e = [
  21293. new r.Vector3(0, -1, 0),
  21294. new r.Vector3(1, -1, 0),
  21295. new r.Vector3(0, -1, 1),
  21296. new r.Vector3(-1, -1, 0),
  21297. new r.Vector3(0, -1, -1),
  21298. new r.Vector3(1, 0, 0),
  21299. new r.Vector3(0, 0, 1),
  21300. new r.Vector3(-1, 0, 0),
  21301. new r.Vector3(0, 0, -1),
  21302. ];
  21303. return function () {
  21304. I.warn('Performance warning: Raycasting to find floor index');
  21305. for (var t = 0; t < e.length; t++) {
  21306. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  21307. n = i.intersectObjects(this.model.colliders);
  21308. if (n.length) return n[0].object.parent.parent;
  21309. }
  21310. return null;
  21311. };
  21312. })()),
  21313. (n.prototype.placeMarker = function () {
  21314. this.marker &&
  21315. (this.marker.position.copy(this.floorPosition),
  21316. (this.marker.position.y += 0.05),
  21317. this.marker.lookAt(new r.Vector3(0, 1, 0).add(this.marker.position)));
  21318. }),
  21319. (n.prototype.translate = function (e) {
  21320. this.position.add(e), this.floorPosition.add(e);
  21321. }),
  21322. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  21323. new r.Vector3().addVectors(this.position, e.position).divideScalar(2);
  21324. return this.model.panos.find(
  21325. [n.filters.notIn([this, e])],
  21326. [n.sortFunctions.distanceToPoint(point)]
  21327. );
  21328. }),
  21329. (n.prototype.attachToPanoRenderer = function (e) {
  21330. (this.panoRenderer = e),
  21331. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  21332. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  21333. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  21334. this.panoRenderer.on(
  21335. g.UploadAttemptedForAllTiles,
  21336. this.onUploadAttemptedForAllTiles.bind(this)
  21337. );
  21338. });
  21339. var _ = {};
  21340. (n.prototype.getWaitDeferred = function (e) {
  21341. var t = _[this.id];
  21342. t || ((t = {}), (_[this.id] = t));
  21343. var i = t[e];
  21344. return (
  21345. i ||
  21346. ((i = {
  21347. deferred: $.Deferred(),
  21348. active: !1,
  21349. }),
  21350. (t[e] = i)),
  21351. i
  21352. );
  21353. }),
  21354. (n.prototype.resetWaitDeferred = function (e) {
  21355. var t = this.getWaitDeferred(e);
  21356. (t.active = !1), (t.deferred = $.Deferred());
  21357. }),
  21358. (n.prototype.clearWaitDeferreds = function () {
  21359. var e = _[this.id];
  21360. e || ((e = {}), (_[this.id] = e));
  21361. for (var t in e)
  21362. if (e.hasOwnProperty(t)) {
  21363. var i = e[t];
  21364. (i.active = !1), (i.deferred = $.Deferred());
  21365. }
  21366. }),
  21367. (n.prototype.loadTiledPano = (function () {
  21368. var e = (new r.Vector3(), []),
  21369. t = [];
  21370. return function (i, n, r, o, a, s) {
  21371. (null !== o && void 0 !== o) || (o = !0), (null !== a && void 0 !== a) || (a = !0);
  21372. var l = this.getWaitDeferred(i),
  21373. c = l.deferred,
  21374. h = null,
  21375. u = null;
  21376. if (
  21377. (r && ('number' == typeof r ? (h = r) : ((h = r.hFov), (u = r.vFov))),
  21378. !this.isLoaded(i))
  21379. ) {
  21380. if (!l.active) {
  21381. if (((l.active = !0), r)) {
  21382. var d = y.matchingTilesInDirection(this, i, n, h, u);
  21383. (e[this.id + ':' + i] = {
  21384. tileCount: 0,
  21385. targetTileCount: d,
  21386. }),
  21387. I.info('Loading partial pano: ' + this.id + ' with ' + d + ' tiles');
  21388. }
  21389. t[this.id] ||
  21390. ((t[this.id] = !0),
  21391. this.on(
  21392. f.LoadComplete,
  21393. function (e, t) {
  21394. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  21395. var i = this.getWaitDeferred(e).deferred;
  21396. i &&
  21397. 'pending' === i.state() &&
  21398. this.highestPartialTileRenderOpCompleted >= e &&
  21399. (i.resolve(e, t), this.resetWaitDeferred(e));
  21400. }.bind(this)
  21401. ),
  21402. this.on(
  21403. f.LoadFailed,
  21404. function (e) {
  21405. var t = this.getWaitDeferred(e).deferred;
  21406. t &&
  21407. 'pending' === t.state() &&
  21408. this.highestPartialTileRenderOpCompleted >= e &&
  21409. (t.reject(e), this.resetWaitDeferred(e));
  21410. }.bind(this)
  21411. ),
  21412. this.on(
  21413. f.TileLoaded,
  21414. function (t, i, n) {
  21415. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  21416. var r = this.getWaitDeferred(t).deferred;
  21417. if (r && 'pending' === r.state()) {
  21418. r.notify(t, i, n);
  21419. var o = e[this.id + ':' + t];
  21420. o &&
  21421. (o.tileCount++,
  21422. o.tileCount === o.targetTileCount &&
  21423. (this.onPanoRendered(this.id, t, n, !0),
  21424. r.resolve(t, n),
  21425. this.resetWaitDeferred(t)));
  21426. }
  21427. }.bind(this)
  21428. ));
  21429. }
  21430. this.tileDownloader.clearForceQueue(),
  21431. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  21432. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(
  21433. this,
  21434. this.qualityManager.getMaxNavPanoSize(),
  21435. o
  21436. )),
  21437. this.panoRenderer.renderPanoTiles(this.id, n, a);
  21438. }
  21439. return c.promise();
  21440. };
  21441. })()),
  21442. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  21443. if (e === this.id) {
  21444. var n = this.qualityManager.getPanoSize(m.BASE);
  21445. t === n &&
  21446. this.shouldRedrawOnBaseLoaded &&
  21447. ((this.shouldRedrawOnBaseLoaded = !1),
  21448. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  21449. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0));
  21450. }
  21451. }),
  21452. (n.prototype.onTileRendered = function (e, t, i, n) {
  21453. e === this.id && this.emit(f.TileLoaded, t, i, n);
  21454. }),
  21455. (n.prototype.onPanoRendered = function (e, t, i, n) {
  21456. e === this.id &&
  21457. ((this.minimumTiledPanoLoaded = !0),
  21458. this.updateSkyboxForZoomLevel(),
  21459. t > this.highestPartialTileRenderOpCompleted &&
  21460. (this.highestPartialTileRenderOpCompleted = t),
  21461. !n &&
  21462. t > this.highestFullTileRenderOpCompleted &&
  21463. (this.highestFullTileRenderOpCompleted = t),
  21464. this.emit('load', t),
  21465. this.model.emit('load', this),
  21466. this.emit(f.LoadComplete, t, i));
  21467. }),
  21468. (n.prototype.setZoomed = function (e) {
  21469. (this.zoomed = e), this.updateSkyboxForZoomLevel();
  21470. e ? this.model.showHighMap() : this.model.hideHighMap(); //add
  21471. }),
  21472. (n.prototype.ensureSkyboxReadyForRender = function () {
  21473. this.tiled ||
  21474. (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  21475. (this.solidSkybox.loaded = !0));
  21476. }),
  21477. (n.prototype.updateSkyboxForZoomLevel = function () {
  21478. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos();
  21479. }),
  21480. (n.prototype.getSkyboxTexture = function () {
  21481. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  21482. if (!this.tiled) {
  21483. return this.solidSkybox;
  21484. }
  21485. if (this.minimumTiledPanoLoaded) {
  21486. if (
  21487. this.zoomed &&
  21488. this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize
  21489. ) {
  21490. //change 如果放大后和不放大都是2k就不用这个
  21491. return this.panoRenderer.zoomRenderTarget.texture;
  21492. } else {
  21493. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping; //add
  21494. return this.tiledPanoRenderTarget.texture;
  21495. }
  21496. } else {
  21497. return null;
  21498. }
  21499. }),
  21500. (n.prototype.onTileRenderFail = function (e, t, i) {
  21501. e === this.id && this.emit(f.LoadFailed, t);
  21502. }),
  21503. (n.prototype.isLoaded = function (e) {
  21504. if (this.tiled) {
  21505. if (e && 'string' == typeof e)
  21506. throw new A(
  21507. 'Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass'
  21508. );
  21509. return (
  21510. !!this.minimumTiledPanoLoaded &&
  21511. (!e || this.highestPartialTileRenderOpCompleted >= e)
  21512. );
  21513. }
  21514. if (e && 'number' == typeof e)
  21515. throw new A(
  21516. 'Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.'
  21517. );
  21518. return !!this.solidSkybox.high || e in this.solidSkybox;
  21519. }),
  21520. (n.prototype.loadCube = function (e) {
  21521. if (this.isLoaded(e))
  21522. return I.info('Skipping load of pano, already loaded'), $.when();
  21523. this.emit('loading', e), this.model.emit('loading', this);
  21524. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  21525. i = t.filter(function (e) {
  21526. return !e;
  21527. });
  21528. 'low' === e &&
  21529. i.length > 0 &&
  21530. (I.info('Pano', this.id, 'not available in low res, loading high res right away'),
  21531. (e = 'high'),
  21532. (t = p.getCubemapUrls(this.model.urls, this.id, e)));
  21533. var n = 0,
  21534. r = [0, 1, 2, 3, 4, 5].map(
  21535. function (e, i, n) {
  21536. return u.getImage(t[i]);
  21537. }.bind(this)
  21538. );
  21539. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  21540. function (t, i, n, r, o, a) {
  21541. return (
  21542. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  21543. ('high' !== e && this.solidSkybox.high) ||
  21544. ((this.solidSkybox.image = this.solidSkybox[e]),
  21545. (this.solidSkybox.low = null)),
  21546. (this.solidSkybox.needsUpdate = !0),
  21547. this.emit('load', e),
  21548. this.model.emit('load', this),
  21549. this
  21550. );
  21551. }.bind(this),
  21552. function () {
  21553. I.error('Downloading cubemap for pano', this.id, 'failed'),
  21554. (this.failedLoadingAt = Date.now());
  21555. }.bind(this),
  21556. function () {
  21557. return $.when(++n, 6);
  21558. }
  21559. );
  21560. }),
  21561. (n.raycastsSkipped = 0),
  21562. (n.raycastsDone = 0),
  21563. (n.prototype.findNeighourPanos = function () {
  21564. return (
  21565. this.model.panos.setNeighbour(this.id, this.id, !1),
  21566. this.model.panos.forEach(
  21567. function (e) {
  21568. if (
  21569. e !== this &&
  21570. (!this.model.panos.neighbourMap[this.id] ||
  21571. void 0 === this.model.panos.neighbourMap[this.id][e.id])
  21572. ) {
  21573. var t = this.position.distanceTo(e.position);
  21574. if (t > a.panoramaNeighbourMaxDistance)
  21575. return this.model.panos.setNeighbour(this, e, !1), void n.raycastsSkipped++;
  21576. var i = e.position.clone().sub(this.position).normalize(),
  21577. o = new r.Raycaster(this.position, i.clone(), 0, t),
  21578. s = o.intersectObjects(this.model.colliders);
  21579. n.raycastsDone++,
  21580. this.model.panos.setNeighbour(this, e, 0 === s.length),
  21581. a.showNeighbourRaycasts &&
  21582. (s.length
  21583. ? this.floor.model.add(
  21584. new r.ArrowHelper(i, this.position, s[0].distance, 16711680)
  21585. )
  21586. : this.floor.model.add(
  21587. new r.ArrowHelper(i, this.position, t, 16777215, 0, 0)
  21588. ));
  21589. }
  21590. }.bind(this)
  21591. ),
  21592. this.model.panos.neighbourMap[this.id]
  21593. );
  21594. }),
  21595. (n.prototype.worldPosition = function () {
  21596. return this.position;
  21597. }),
  21598. (n.prototype.addTextSprite = function (e, t) {
  21599. this.removeTextSprite();
  21600. var i = document.createElement('canvas'),
  21601. n = i.getContext('2d');
  21602. (i.width = 256), (i.height = 256);
  21603. var o = 'Arial',
  21604. a = 60;
  21605. (n.font = 'bold ' + a + 'px ' + o), (n.fillStyle = 'white');
  21606. var s = n.measureText(e).width;
  21607. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  21608. var l = new r.Texture(i);
  21609. l.needsUpdate = !0;
  21610. var c = new r.SpriteMaterial({
  21611. map: l,
  21612. color: t || 16428055,
  21613. });
  21614. (this.text3d = new r.Sprite(c)),
  21615. this.text3d.position.copy(this.skyboxMesh.position),
  21616. this.floor.add(this.text3d);
  21617. }),
  21618. (n.prototype.removeTextSprite = function () {
  21619. this.text3d && (this.floor.remove(this.text3d), (this.text3d = null));
  21620. }),
  21621. (n.prototype.isAligned = function () {
  21622. return this.alignmentType === l.ALIGNED;
  21623. }),
  21624. (n.filters = {
  21625. inDirection: function (e, t, i) {
  21626. return function (n) {
  21627. var r = n.position.clone().sub(e).normalize();
  21628. return r.dot(t) > i;
  21629. };
  21630. },
  21631. inFloorDirection: function (e, t, i) {
  21632. return function (n) {
  21633. var r = n.floorPosition.clone().sub(e).normalize();
  21634. return r.dot(t) > i;
  21635. };
  21636. },
  21637. inPanoDirection: function (e, t, i) {
  21638. return (
  21639. (i = a.navigation.panoScores ? a.navigation.filterStrictness : i),
  21640. function (n) {
  21641. var r = n.floorPosition.clone().sub(e).normalize(),
  21642. o = n.position.clone().sub(e).normalize();
  21643. return r.dot(t) > i || o.dot(t) > i;
  21644. }
  21645. );
  21646. },
  21647. atFloor: function (e) {
  21648. return function (t) {
  21649. return !e || t.floor === e;
  21650. };
  21651. },
  21652. not: function (e) {
  21653. return function (t) {
  21654. return t !== e;
  21655. };
  21656. },
  21657. notIn: function (e) {
  21658. return function (t) {
  21659. return e.indexOf(t) === -1;
  21660. };
  21661. },
  21662. isLoaded: function () {
  21663. return function (e) {
  21664. return e.isLoaded();
  21665. };
  21666. },
  21667. isNotLoaded: function () {
  21668. return function (e) {
  21669. return !e.isLoaded();
  21670. };
  21671. },
  21672. isCloseEnoughTo: function (e, t) {
  21673. return function (i) {
  21674. return e.distanceTo(i.floorPosition) < t;
  21675. };
  21676. },
  21677. hasMinimumHeightDifferenceTo: function (e, t) {
  21678. return function (i) {
  21679. return Math.abs(i.position.y - e.y) > t;
  21680. };
  21681. },
  21682. isNotBehindNormal: function (e, t) {
  21683. var i = new r.Vector3();
  21684. return (
  21685. (t = t.clone()),
  21686. function (n) {
  21687. var r = i.copy(n.position).sub(e).normalize();
  21688. return r.dot(t) > 0;
  21689. }
  21690. );
  21691. },
  21692. isNeighbourPanoTo: function (e) {
  21693. return function (t) {
  21694. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id];
  21695. };
  21696. },
  21697. isNeighbourOfNeighbourTo: function (e) {
  21698. return function (t) {
  21699. return (
  21700. !!e.neighbourPanos[t.id] ||
  21701. e.neighbourUUIDs.some(function (i) {
  21702. var n = e.model.panos.get(i);
  21703. return !!n && n.neighbourPanos[t.id];
  21704. })
  21705. );
  21706. };
  21707. },
  21708. isNotRecentlyFailed: function (e) {
  21709. return function (t) {
  21710. return Date.now() - t.failedLoadingAt > e;
  21711. };
  21712. },
  21713. isOnVisibleFloor: function () {
  21714. return function (e) {
  21715. return !e.floor.hidden;
  21716. };
  21717. },
  21718. isPanoAligned: function () {
  21719. return function (e) {
  21720. return e.isAligned();
  21721. };
  21722. },
  21723. }),
  21724. (n.sortFunctions = {
  21725. distanceToPoint: function (e) {
  21726. return function (t, i) {
  21727. return t.position.distanceTo(e) - i.position.distanceTo(e);
  21728. };
  21729. },
  21730. floorDistanceToPoint: function (e) {
  21731. return function (t, i) {
  21732. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e);
  21733. };
  21734. },
  21735. choose: function (e) {
  21736. return function (t, i) {
  21737. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0;
  21738. };
  21739. },
  21740. }),
  21741. (n.scoreFunctions = {
  21742. distance: function (e, t) {
  21743. return (
  21744. (t = t || a.navigation.distanceFactor),
  21745. function (i) {
  21746. return e ? e.position.distanceTo(i.position) * t : 0;
  21747. }
  21748. );
  21749. },
  21750. distanceSquared: function (e, t) {
  21751. return (
  21752. (t = t || a.navigation.distanceFactor),
  21753. function (i) {
  21754. return e ? e.position.distanceToSquared(i.position) * t : 0;
  21755. }
  21756. );
  21757. },
  21758. direction: function (e, t) {
  21759. return function (i) {
  21760. var n = i.position.clone().sub(e).normalize();
  21761. return n.dot(t) * a.navigation.directionFactor;
  21762. };
  21763. },
  21764. angle: function (e, t) {
  21765. return function (i) {
  21766. var n = i.position.clone().sub(e).normalize();
  21767. return n.angleTo(t) * a.navigation.angleFactor;
  21768. };
  21769. },
  21770. inFieldOfView: function (e, t) {
  21771. return function (i) {
  21772. var n = i.position.clone().sub(e).normalize();
  21773. return n.dot(t) > 0.75 ? 10 : -1;
  21774. };
  21775. },
  21776. optionality: function (e) {
  21777. return function (t) {
  21778. var i = t.neighbourUUIDs.filter(function (t) {
  21779. return !(t in e.neighbourUUIDs) && t !== e.id;
  21780. });
  21781. return i.length * a.navigation.optionalityFactor;
  21782. };
  21783. },
  21784. penalizeHeightDifferenceUnder: function (e, t) {
  21785. return function (i) {
  21786. return e.y - i.position.y < t ? -20 : 0;
  21787. };
  21788. },
  21789. }),
  21790. (t.exports = n);
  21791. }.call(this, '/js/objects/Panorama.js'));
  21792. },
  21793. {
  21794. '../enum/AlignmentType': 17,
  21795. '../enum/GLCubeFaces': 25,
  21796. '../enum/PanoRendererEvents': 35,
  21797. '../enum/PanoSizeClass': 36,
  21798. '../enum/PanoramaEvents': 37,
  21799. '../enum/RenderLayers': 41,
  21800. '../enum/RenderOrder': 42,
  21801. '../enum/TileDownloaderEvents': 45,
  21802. '../enum/Viewmode': 51,
  21803. '../exception/BasicException': 55,
  21804. '../scene/SceneRenderer': 158,
  21805. '../settings': 166,
  21806. '../tile/TileUtils': 174,
  21807. '../util/ajax': 181,
  21808. '../util/common': 185,
  21809. '../util/lerp': 188,
  21810. '../util/logger': 189,
  21811. '../util/panorama': 191,
  21812. '../util/texture': 194,
  21813. '../util/transitions': 195,
  21814. events: 202,
  21815. three: 217,
  21816. },
  21817. ],
  21818. 149: [
  21819. function (e, t, i) {
  21820. 'use strict';
  21821. function n(e) {
  21822. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  21823. (t.map.value = d),
  21824. (t.opacity.value = 0),
  21825. t.color.value.set(o.reticuleColor),
  21826. (t.showMouseMarker = !window.DATA.hideMouseMarker);
  21827. r.Mesh.call(
  21828. this,
  21829. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  21830. new r.RawShaderMaterial({
  21831. side: r.DoubleSide,
  21832. depthWrite: !1,
  21833. depthTest: !1,
  21834. transparent: !0,
  21835. vertexShader: c.waypoint.vertexShader,
  21836. fragmentShader: c.waypoint.fragmentShader,
  21837. uniforms: t,
  21838. name: 'waypoint',
  21839. opacity: 0,
  21840. visible: t.showMouseMarker, // 显示/隐藏鼠标标志
  21841. })
  21842. ),
  21843. this.layers.set(h.RETICULE),
  21844. (this.renderOrder = u.reticule),
  21845. (this.player = e),
  21846. (this.direction = new r.Vector3()),
  21847. (this.hidden = !0),
  21848. (this.mouseLastMoveTime = Date.now());
  21849. }
  21850. var r = e('three'),
  21851. o = e('../settings'),
  21852. a = e('../util/transitions'),
  21853. s = e('../util/texture'),
  21854. l = e('../util/lerp'),
  21855. c = e('../shaders'),
  21856. h = e('../enum/RenderLayers'),
  21857. u = e('../enum/RenderOrder'),
  21858. d = s.load('images/reticule-256x256.png');
  21859. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  21860. (n.prototype = Object.create(r.Mesh.prototype)),
  21861. (n.prototype.move = function (e, t, i) {
  21862. (this.hidden = i), (this.mouseLastMoveTime = Date.now());
  21863. }),
  21864. (n.prototype.hide = function () {
  21865. this.hidden ||
  21866. ((this.hidden = !0),
  21867. a.start(
  21868. l.property(this.material.uniforms.opacity, 'value', 0),
  21869. o.reticuleOpacityTransitionTime
  21870. ));
  21871. }),
  21872. (n.prototype.show = function () {
  21873. (this.hidden = !1),
  21874. this.material.opacity <= 0 &&
  21875. a.start(
  21876. l.property(
  21877. this.material.uniforms.opacity,
  21878. 'value',
  21879. o[this.player.mode].reticuleOpacity
  21880. ),
  21881. o.reticuleOpacityTransitionTime
  21882. );
  21883. }),
  21884. (n.prototype.update = function () {
  21885. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout &&
  21886. !this.hidden &&
  21887. this.hide();
  21888. }),
  21889. (n.prototype.updatePosition = function (e, t) {
  21890. if (!this.hidden) {
  21891. if (!t) return this.hide();
  21892. var i = t.point,
  21893. n = e.distanceTo(i),
  21894. r = 1 + 0.01 * n;
  21895. n < 1 && (r -= 1 - n),
  21896. this.show(),
  21897. this.scale.set(r, r, r),
  21898. (this.direction = this.direction.multiplyScalar(0.8)),
  21899. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  21900. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  21901. this.lookAt(this.position.clone().add(this.direction));
  21902. }
  21903. }),
  21904. (n.prototype.writeAstag = function () {
  21905. var e =
  21906. Math.floor(4294967296 * (1 + Math.random())).toString(16) +
  21907. Math.floor(16 * (1 + Math.random())).toString(16),
  21908. t = new Date();
  21909. this.tagCount = 'undefined' == typeof this.tagCount ? 1 : this.tagCount + 1;
  21910. var i = {
  21911. enabled: !0,
  21912. version: '0',
  21913. created: t.toISOString(),
  21914. created_by: 'APITest',
  21915. position: this.position.clone(),
  21916. stem: {
  21917. enabled: o.tags.pole.enabled,
  21918. direction: this.direction.multiplyScalar(o.tags.pole.height),
  21919. },
  21920. label: 'tag ' + this.tagCount,
  21921. description: 'Description ' + e,
  21922. floor: (function (e) {
  21923. if (e.currentFloor) {
  21924. var t = e.floors.indexOf(e.currentFloor);
  21925. return t > -1 ? t : void 0;
  21926. }
  21927. })(this.player.model),
  21928. type: 'info',
  21929. metadata: {
  21930. preferred_camera: {
  21931. mode: this.player.mode,
  21932. },
  21933. },
  21934. };
  21935. console.log('--------------------------'), console.log(JSON.stringify(i));
  21936. var n = this.player.model.addtag(e, i).build();
  21937. n &&
  21938. (n.disc && this.player.tagDiscs.push(n.disc),
  21939. n.visible || n.show(o.tags.startup.fadeInDuration));
  21940. }),
  21941. (t.exports = n);
  21942. },
  21943. {
  21944. '../enum/RenderLayers': 41,
  21945. '../enum/RenderOrder': 42,
  21946. '../settings': 166,
  21947. '../shaders': 167,
  21948. '../util/lerp': 188,
  21949. '../util/texture': 194,
  21950. '../util/transitions': 195,
  21951. three: 217,
  21952. },
  21953. ],
  21954. 150: [
  21955. function (e, t, i) {
  21956. 'use strict';
  21957. function n(e, t) {
  21958. (this.chunks = []),
  21959. (this.floorId = e),
  21960. (this.roomId = t),
  21961. (this.position = new r.Vector3());
  21962. }
  21963. var r = e('three');
  21964. (n.prototype.addChunk = function (e) {
  21965. this.chunks.push(e);
  21966. }),
  21967. (n.prototype.calcBoundaries = function () {
  21968. for (
  21969. var e = new r.Vector3(),
  21970. t = new r.Vector3(0, 0, 0),
  21971. i = new r.Vector3(0, 0, 0),
  21972. n = new r.Vector3(0, 0, 0),
  21973. o = 0,
  21974. a = 0;
  21975. a < this.chunks.length;
  21976. a++
  21977. ) {
  21978. var s = this.chunks[a],
  21979. l = s.geometry.attributes.position;
  21980. if (l)
  21981. for (var c = 0; c < l.array.length; c += 3)
  21982. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  21983. t.add(e),
  21984. 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)),
  21985. o++;
  21986. }
  21987. o > 0 ? (t.multiplyScalar(1 / o), (this.average = t)) : (this.average = null),
  21988. (this.boundsMax = i),
  21989. (this.boundsMin = n),
  21990. (this.center = new r.Vector3()),
  21991. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n);
  21992. }),
  21993. (t.exports = n);
  21994. },
  21995. {
  21996. three: 217,
  21997. },
  21998. ],
  21999. 151: [
  22000. function (e, t, i) {
  22001. (function (i) {
  22002. 'use strict';
  22003. function n(e, t, i) {
  22004. (this.obj3d = null),
  22005. (this.nodes = []),
  22006. (this.colorHull = []),
  22007. (this.shortPaths = {}),
  22008. (this.floorHull = null),
  22009. (this.cameraHull = null),
  22010. (this.floorPathDistance = 0),
  22011. (this.floorCurvePoints = null),
  22012. (this.floorCurveColors = null),
  22013. (this.camCurvePoints = null),
  22014. (this.warpDestHeroLoc = null),
  22015. (this.warpDestPano = null),
  22016. (this.warpPathPoints = null),
  22017. (this.warpPathLengths = [0]),
  22018. (this.warpLength = 0),
  22019. (this.closeWarpDistance = 4),
  22020. (this.UP = A.UP.clone()),
  22021. (this.longestStep = 0),
  22022. (this.upcomingTransType = null),
  22023. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  22024. (this.prevNextDist = 0),
  22025. (this.nextI = 0),
  22026. (this.activeTransType = null),
  22027. (this.lastTransType = null),
  22028. (this.bunnyObj = null),
  22029. (this.director = e),
  22030. (this.player = t),
  22031. (this.playerControls = i),
  22032. (this.modelManager = t.modelManager),
  22033. this.updateModel(),
  22034. this.updateDefaultsFromModelData(),
  22035. this.bindEvents(),
  22036. (this.warping = !1),
  22037. (this.waitingToWarp = !1),
  22038. (this.warpInterrupted = !1),
  22039. (this.warpInterruptionBlackoutStyle = null),
  22040. (this.warpInterruptionTravelTime = null);
  22041. }
  22042. var r = e('three'),
  22043. o = e('../util/logger'),
  22044. a = e('../enum/Viewmode'),
  22045. s = e('../enum/RenderOrder'),
  22046. l = e('../enum/WarpStyle'),
  22047. c = e('../settings'),
  22048. h = e('../util/math'),
  22049. u = e('../util/lerp'),
  22050. d = e('../util/easing'),
  22051. p = e('../util/transitions'),
  22052. f = e('../objects/Snapshot'),
  22053. g = e('../effects'),
  22054. m = e('../shaders'),
  22055. v = (e('../gui/gui'), e('../util/texture')),
  22056. A = e('../enum/Vectors'),
  22057. y = (e('../model/ModelManager'), new o(i)),
  22058. C = e('../enum/PlayerEvents'),
  22059. I = e('../enum/BlackoutStyle'),
  22060. E = e('../enum/ModelManagerEvents'),
  22061. b = e('../constants'),
  22062. w = {
  22063. path: v.loadBase64(
  22064. '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'
  22065. ),
  22066. pathEnd: v.load('images/End.png'),
  22067. pathStart: v.loadBase64(
  22068. '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=='
  22069. ),
  22070. };
  22071. (n.prototype.setScene = function (e) {
  22072. this.createCpm(e), this.createBunnyObj(e);
  22073. }),
  22074. (n.prototype.updateModel = function () {
  22075. this.model = this.modelManager.getActiveModel();
  22076. }),
  22077. (n.prototype.bindEvents = function () {
  22078. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this));
  22079. }),
  22080. (n.prototype.updateDefaultsFromModelData = function () {
  22081. this.model.data;
  22082. }),
  22083. (n.prototype.pointPathDistance = function (e) {
  22084. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i]);
  22085. return t;
  22086. }),
  22087. (n.prototype.pointPathLengths = function (e) {
  22088. for (var t = [0], i = 1; i < e.length; i += 1)
  22089. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  22090. return t;
  22091. }),
  22092. (n.prototype.interpAlongPath = function (e, t, i) {
  22093. var n,
  22094. o = new r.Vector3(),
  22095. a = t[t.length - 1];
  22096. if (i < 1) {
  22097. n = i * a;
  22098. for (var s = 1; s < t.length; s += 1)
  22099. if (t[s] > n) {
  22100. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  22101. return o.copy(e[s]), o.sub(e[s - 1]), o.multiplyScalar(l), o.add(e[s - 1]), o;
  22102. }
  22103. } else o.copy(e[e.length - 1]);
  22104. return o;
  22105. }),
  22106. (n.prototype.pathHeight = function () {
  22107. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight;
  22108. }),
  22109. (n.prototype.createBunnyObj = function (e) {
  22110. this.bunnyObj ||
  22111. ((this.bunnyObj = new r.AxisHelper(0.1)),
  22112. (this.bunnyObj.visible = c.warp.showBunny)),
  22113. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  22114. e.add(this.bunnyObj);
  22115. }),
  22116. (n.prototype.createCpm = function (e) {
  22117. if (!this.currentPanoMarker) {
  22118. var t = this.makeWaypointObj(w.pathEnd, 'Current');
  22119. (t.material.uniforms.opacity.value = 0),
  22120. (this.currentPanoMarker = {
  22121. mesh: t,
  22122. placed: !1,
  22123. });
  22124. }
  22125. this.currentPanoMarker.mesh.parent &&
  22126. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22127. this.placeCpm(),
  22128. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh);
  22129. }),
  22130. (n.prototype.placeCpm = function () {
  22131. if (
  22132. c.path.mapGuides &&
  22133. this.player.currentPano &&
  22134. this.player.currentPano.isAligned()
  22135. ) {
  22136. var e = this.player.currentPano.floor;
  22137. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  22138. (this.currentPanoMarker.mesh.parent &&
  22139. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22140. e.add(this.currentPanoMarker.mesh)),
  22141. this.currentPanoMarker.mesh.position
  22142. .copy(this.player.currentPano.floorPosition)
  22143. .sub(e.position),
  22144. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  22145. (this.currentPanoMarker.placed = !0);
  22146. } else this.popOutCpm();
  22147. }),
  22148. (n.prototype.fadeInCpm = function (e) {
  22149. (this.player.mode === a.PANORAMA &&
  22150. this.player.currentPano &&
  22151. !this.player.currentPano.isAligned()) ||
  22152. (c.path.mapGuides &&
  22153. this.currentPanoMarker.placed &&
  22154. p.start(
  22155. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1),
  22156. e
  22157. ));
  22158. }),
  22159. (n.prototype.fadeOutCpm = function (e) {
  22160. p.start(
  22161. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0),
  22162. e
  22163. );
  22164. }),
  22165. (n.prototype.popInCpm = function () {
  22166. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2);
  22167. }),
  22168. (n.prototype.popOutCpm = function () {
  22169. this.fadeOutCpm(2);
  22170. }),
  22171. (n.prototype.brushPrefs = {
  22172. linewidth: 7,
  22173. strokeWidth: 15,
  22174. cvSegments: 48,
  22175. paveStep: 0.1,
  22176. paveWidth: 0.2,
  22177. lookBlendDist: 3,
  22178. maxTurn: r.Math.degToRad(2),
  22179. }),
  22180. (n.prototype.panoPathDistance = function (e) {
  22181. var t = this.model.panos;
  22182. if (!e || e.length < 2) return 0;
  22183. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition);
  22184. return this.pointPathDistance(i);
  22185. }),
  22186. (n.prototype.loadTileTexture = function (e) {
  22187. var t = v.load(
  22188. e,
  22189. function (t) {
  22190. (t.wrapS = r.RepeatWrapping),
  22191. (t.wrapT = r.RepeatWrapping),
  22192. (t.needsUpdate = !0),
  22193. y.debug('path texture "' + e + '" is ready');
  22194. },
  22195. function () {
  22196. y.error('path texture "' + e + '" failed');
  22197. }
  22198. );
  22199. return (t.mapping = r.UVMapping), t;
  22200. }),
  22201. (n.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  22202. var a = {
  22203. cameraMode: n,
  22204. position: e,
  22205. quaternion: t,
  22206. panoId: i,
  22207. orthoZoom: o,
  22208. floorVisibility: r,
  22209. thumbUrl: null,
  22210. name: null,
  22211. };
  22212. return new f(a);
  22213. }),
  22214. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  22215. return this.buildWarpDestinationDescriptor(
  22216. e.position,
  22217. e.quaternion,
  22218. this.getHeroId(e),
  22219. e.cameraMode,
  22220. e.floorVisibility,
  22221. e.orthoZoom
  22222. );
  22223. }),
  22224. (n.prototype.setWarpDestination = function (e) {
  22225. this.warpDestHeroLoc = e;
  22226. }),
  22227. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  22228. var t = this.getHeroDescriptorByHeroIndex(e);
  22229. return null !== t && (this.setWarpDestination(t), !0);
  22230. }),
  22231. (n.prototype.setWarpDestinationByPano = function (e, t) {
  22232. var i = this.model.panos.get(e.id);
  22233. return !!i && this.setWarpDestinationByPanoId(e.id, t);
  22234. }),
  22235. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  22236. var i = this.model.panos.get(e);
  22237. if (i) {
  22238. t = t || new r.Quaternion();
  22239. var n = this.buildWarpDestinationDescriptor(
  22240. i.position,
  22241. t,
  22242. i.id,
  22243. 'panorama',
  22244. [],
  22245. -1
  22246. );
  22247. return this.setWarpDestination(n), !0;
  22248. }
  22249. return !1;
  22250. }),
  22251. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  22252. var t = this.model.heroCount();
  22253. /* if (null !== this.warpDestHeroLoc && t < 2)
  22254. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  22255. this.model.getHeroDescriptorByIndex(0); */
  22256. var i = this.model.getHeroDescriptorByIndex(e);
  22257. if (i) {
  22258. var n = i.isPano() ? i.panoId : i.cameraMode;
  22259. y.debug(
  22260. 'ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' +
  22261. n +
  22262. '" out of ' +
  22263. t +
  22264. ' choices.'
  22265. );
  22266. }
  22267. return i;
  22268. }),
  22269. (n.prototype.getHeroDescriptorByPano = function (e) {
  22270. var t = this.model.panos.get(e.id);
  22271. return t ? this.getHeroDescriptorByPanoId(e.id) : null;
  22272. }),
  22273. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  22274. var t = this.getHeroIndexFromPanoId(e);
  22275. return this.getHeroDescriptorByHeroIndex(t);
  22276. }),
  22277. (n.prototype.getHeroIndexFromPanoId = function (e) {
  22278. for (var t = 0; t < this.model.heroLocations.length; t++) {
  22279. var i = this.model.heroLocations[t],
  22280. n = this.getHeroId(i);
  22281. if (n && n === e) return t;
  22282. }
  22283. return -1;
  22284. }),
  22285. (n.prototype.getHeroPano = function (e) {
  22286. if (null === e) return y.warn('getHeroPano(): no destination'), null;
  22287. var t = this.getHeroId(e),
  22288. i = this.model.panos.get(t);
  22289. return (
  22290. void 0 === i &&
  22291. ((i = null), '' !== t && y.debug('unable to find pano "' + t + '"')),
  22292. i
  22293. );
  22294. }),
  22295. (n.prototype.getHeroId = function (e) {
  22296. return e.panoId;
  22297. }),
  22298. (n.prototype.setWarpDestPano = function () {
  22299. return (
  22300. (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  22301. );
  22302. }),
  22303. (n.prototype.brushToWarpPano = function (e, t) {
  22304. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1;
  22305. if (
  22306. (this.warpDestHeroLoc.cameraMode !== a.PANORAMA &&
  22307. y.warn('Can only brush from pano to pano'),
  22308. !this.warpDestPano)
  22309. )
  22310. return y.info('No brush'), !1;
  22311. if (!this.player.currentPano)
  22312. return y.debug('No current pano, visibility undefined'), !1;
  22313. if (!this.warpDestPano) return y.info('No wPano, visibility undefined'), !1;
  22314. if (!this.warpDestPano.isAligned())
  22315. return y.debug('Cannot brush to unaligned pano'), !1;
  22316. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  22317. n = !0;
  22318. if (this.player.currentPano.id === this.warpDestPano.id)
  22319. y.debug('Already at destination pano');
  22320. else {
  22321. (this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22322. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  22323. (this.obj3d = new r.Object3D()),
  22324. y.debug(
  22325. 'Brushing from "' +
  22326. this.player.currentPano.id +
  22327. '" to "' +
  22328. this.warpDestPano.id +
  22329. '" (' +
  22330. (this.nodes ? this.nodes.length : 0) +
  22331. ')'
  22332. ),
  22333. n
  22334. ? (y.info('No "walkable" route, using fall-back warp style transition'),
  22335. (e = t))
  22336. : (this.setPathHulls(this.nodes),
  22337. this.setFloorCurves(),
  22338. i &&
  22339. ('chevron' === c.path.style
  22340. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  22341. : 'ribbon' === c.path.style &&
  22342. this.obj3d.add(
  22343. this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)
  22344. ))),
  22345. this.player.currentPano.floor.add(this.obj3d);
  22346. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN,
  22347. s = e === l.STD;
  22348. if (!n && (i || s)) {
  22349. if (o) {
  22350. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  22351. this.obj3d.add(h);
  22352. }
  22353. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  22354. this.obj3d.add(u);
  22355. }
  22356. this.appearSlow();
  22357. }
  22358. return (this.upcomingTransType = e), !n;
  22359. }),
  22360. (n.prototype.findShortestPath = function (e, t) {
  22361. if (!e || !t) return null;
  22362. var i = c.warp.walkExtraPanosDistance,
  22363. n = e.id + ':' + t.id + ':' + i;
  22364. if (this.shortPaths.hasOwnProperty(n))
  22365. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  22366. var r = t.id + ':' + e.id + ':' + i;
  22367. if (this.shortPaths.hasOwnProperty(r))
  22368. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  22369. var o = this.model.panos.aStarSearch(e, t);
  22370. return (
  22371. this.model.panos.includeNodesNearPath(o, i),
  22372. (this.shortPaths[n] = o ? o.slice() : null),
  22373. o
  22374. );
  22375. }),
  22376. (n.prototype.makePathHulls = function (e) {
  22377. var t,
  22378. i,
  22379. n,
  22380. r,
  22381. o,
  22382. a = 0,
  22383. s = [],
  22384. l = [],
  22385. h = [],
  22386. u = this.model.panos;
  22387. (t = u.get(e[0])), (r = t.floor.floorIndex);
  22388. for (var d = 0; d < e.length; d += 1)
  22389. (t = u.get(e[d])),
  22390. (i = t.floorPosition.clone().sub(this.model.position)),
  22391. (i.y += this.pathHeight()),
  22392. s.push(i),
  22393. l.push(t.position.clone()),
  22394. (n = t.floor.floorIndex),
  22395. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  22396. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o));
  22397. return (
  22398. a > this.longestStep &&
  22399. ((this.longestStep = a), y.debug('path contains ' + a + ' meter segment')),
  22400. {
  22401. floor: s,
  22402. camera: l,
  22403. color: h,
  22404. }
  22405. );
  22406. }),
  22407. (n.prototype.makeFloorCurves = function (e, t, i) {
  22408. var n =
  22409. this.player.mode === a.PANORAMA
  22410. ? c.path.waypointIndoorRadius
  22411. : c.path.waypointRadius,
  22412. o = this.pointPathDistance(e) - 2 * n,
  22413. s = e.slice(0),
  22414. l = s[1].clone().sub(s[0]);
  22415. (l.y = 0),
  22416. l.normalize().multiplyScalar(n),
  22417. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  22418. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  22419. (l.y = 0),
  22420. l.normalize().multiplyScalar(n),
  22421. (s[s.length - 1] = new r.Vector3().copy(s[s.length - 1]).add(l));
  22422. var h = new r.CatmullRomCurve3(s),
  22423. u = Math.floor(o / i);
  22424. (u = 4 * Math.floor(u / 4)), (u = Math.max(4, u));
  22425. for (
  22426. var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3(), A = 0;
  22427. A < g.length;
  22428. A += 1
  22429. ) {
  22430. (f = 0), (d = g[A].distanceTo(e[0]));
  22431. for (var y = 1; y < e.length; y += 1)
  22432. v.copy(g[A]).sub(e[y]), (v.y *= 4), (p = v.length()), p < d && (f = y);
  22433. m.push(t[f]);
  22434. }
  22435. return {
  22436. distance: o,
  22437. points: g,
  22438. colors: m,
  22439. };
  22440. }),
  22441. (n.prototype.makeCameraCurvePoints = function (e, t) {
  22442. var i = this.pointPathDistance(e),
  22443. n = new r.CatmullRomCurve3(e);
  22444. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)));
  22445. }),
  22446. (n.prototype.makeCameraCurveTangents = function (e, t) {
  22447. var i = this.pointPathDistance(e),
  22448. n = new r.CatmullRomCurve3(e),
  22449. o = Math.max(2, Math.floor(i / t));
  22450. o || (o = 5);
  22451. for (var a = [], s = 0; s <= o; s++) a.push(n.getTangentAt(s / o));
  22452. return a;
  22453. }),
  22454. (n.prototype.setPathHulls = function (e) {
  22455. var t = this.makePathHulls(e);
  22456. (this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color);
  22457. }),
  22458. (n.prototype.setFloorCurves = function () {
  22459. var e = this.makeFloorCurves(
  22460. this.floorHull,
  22461. this.colorHull,
  22462. this.brushPrefs.paveStep
  22463. );
  22464. (this.floorPathDistance = e.distance),
  22465. (this.floorCurvePoints = e.points),
  22466. (this.floorCurveColors = e.colors);
  22467. }),
  22468. (n.prototype.setCameraCurvePoints = function () {
  22469. this.camCurvePoints = this.makeCameraCurvePoints(
  22470. this.cameraHull,
  22471. c.warp.stepFactor * this.brushPrefs.paveStep
  22472. );
  22473. }),
  22474. (n.prototype.chooseWarpPath = function (e) {
  22475. var t,
  22476. i,
  22477. n,
  22478. o = this.playerControls.cameras[a.PANORAMA];
  22479. if (this.player.currentPano === this.warpDestPano || !e)
  22480. return (this.warpPathPoints = null), (this.warpLength = 0), !1;
  22481. (this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22482. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  22483. ? (y.debug('warp path to unreachable node'),
  22484. (t = this.warpDestPano.position.clone().sub(o.position)),
  22485. (i = t.clone().negate()),
  22486. t.multiplyScalar(0.15).add(o.position),
  22487. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  22488. (t.y = o.position.y),
  22489. (i.y = this.warpDestPano.position.y),
  22490. (n = new r.CubicBezierCurve3(
  22491. o.position.clone(),
  22492. t,
  22493. i,
  22494. this.warpDestPano.position.clone()
  22495. )),
  22496. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  22497. : (y.debug(
  22498. 'follow warp path (path distance was ' +
  22499. this.nodes.length +
  22500. ' nodes, ' +
  22501. this.floorPathDistance +
  22502. ')'
  22503. ),
  22504. this.setCameraCurvePoints(),
  22505. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  22506. (this.warpLength = 0),
  22507. (this.warpPathLengths = [0]);
  22508. for (
  22509. var s = new r.Vector3(),
  22510. l = new r.Vector3(),
  22511. h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  22512. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)),
  22513. d = 1;
  22514. d < this.warpPathPoints.length;
  22515. d += 1
  22516. ) {
  22517. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  22518. var p = s.length();
  22519. s.y *= c.warp.climbEffort;
  22520. var f = s.length() / p;
  22521. if (d > 1) {
  22522. s.setY(0).normalize(),
  22523. l
  22524. .copy(this.warpPathPoints[d - 2])
  22525. .sub(this.warpPathPoints[d - 1])
  22526. .setY(0)
  22527. .normalize();
  22528. var g = Math.min(1, s.dot(l)),
  22529. m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  22530. f = Math.max(m, f);
  22531. }
  22532. (this.warpLength += p * f), (this.warpPathLengths[d] = this.warpLength);
  22533. }
  22534. return !0;
  22535. }),
  22536. (n.prototype.drawPathRibbon = function (e, t) {
  22537. this.bunnyObj.visible = c.warp.showBunny;
  22538. for (
  22539. var i = 0.6 * c.path.ribbonWidth * 0.5,
  22540. n = new r.Vector3(),
  22541. o = new r.Vector3(0, this.pathHeight(), 0),
  22542. l = new r.Geometry(),
  22543. h = new r.Vector3(),
  22544. u = 0;
  22545. u < e.length;
  22546. u += 1
  22547. ) {
  22548. h.copy(e[u]),
  22549. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  22550. h.normalize(),
  22551. n.crossVectors(h, A.UP),
  22552. n.multiplyScalar(i);
  22553. var d = new r.Vector3().copy(e[u]).add(o);
  22554. d.sub(n),
  22555. l.vertices.push(d),
  22556. (d = new r.Vector3().copy(e[u]).add(o)),
  22557. d.add(n),
  22558. l.vertices.push(d);
  22559. }
  22560. var p,
  22561. f = 0;
  22562. for (u = 0; u < e.length - 1; u += 1) {
  22563. var g = 2 * u,
  22564. v = f;
  22565. f += e[u + 1].distanceTo(e[u]);
  22566. var y = f,
  22567. C = t[u],
  22568. I = t[u + 1];
  22569. (p = new r.Face3(g, g + 1, g + 2)),
  22570. (p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)]),
  22571. l.faces.push(p),
  22572. l.faceVertexUvs[0].push([
  22573. new r.Vector2(0, v),
  22574. new r.Vector2(1, v),
  22575. new r.Vector2(0, y),
  22576. ]),
  22577. (p = new r.Face3(g + 2, g + 1, g + 3)),
  22578. (p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)]),
  22579. l.faces.push(p),
  22580. l.faceVertexUvs[0].push([
  22581. new r.Vector2(0, y),
  22582. new r.Vector2(1, v),
  22583. new r.Vector2(1, y),
  22584. ]);
  22585. }
  22586. l.computeFaceNormals(), l.computeVertexNormals();
  22587. var E, b;
  22588. this.player.mode === a.PANORAMA
  22589. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  22590. (b.map.value = w.path),
  22591. (b.opacity.value = 0),
  22592. b.color.value.set(c.path.color),
  22593. (E = new r.RawShaderMaterial({
  22594. side: r.DoubleSide,
  22595. depthWrite: !1,
  22596. transparent: !0,
  22597. vertexShader: m.ribbon.vertexShader,
  22598. fragmentShader: m.ribbon.fragmentShader,
  22599. uniforms: b,
  22600. name: 'ribbonT',
  22601. opacity: 0,
  22602. })))
  22603. : (E = new r.MeshBasicMaterial({
  22604. color: 16777215,
  22605. side: r.DoubleSide,
  22606. name: 'ribbonOut',
  22607. vertexColors: r.VertexColors,
  22608. }));
  22609. var _ = new r.Mesh(l, E);
  22610. return (
  22611. (_.name = 'ribbon'),
  22612. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  22613. _
  22614. );
  22615. }),
  22616. (n.prototype.drawPathPavement = function (e) {
  22617. for (
  22618. var t,
  22619. i = 0.25,
  22620. n = new r.Vector3(),
  22621. o = new r.Geometry(),
  22622. s = new r.Vector3(),
  22623. l = 0;
  22624. l < e.length;
  22625. l += 1
  22626. )
  22627. s.copy(e[l]),
  22628. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  22629. s.normalize(),
  22630. n.crossVectors(s, A.UP),
  22631. n.multiplyScalar(this.brushPrefs.paveWidth),
  22632. (t = new r.Vector3().copy(e[l])),
  22633. t.sub(n),
  22634. o.vertices.push(t),
  22635. o.vertices.push(new r.Vector3().copy(e[l])),
  22636. (t = new r.Vector3().copy(e[l])),
  22637. t.add(n),
  22638. o.vertices.push(t);
  22639. var h, u, d;
  22640. for (l = 0; l < e.length - 1; l += 1)
  22641. (h = 3 * l + 1),
  22642. (u = l * i),
  22643. (d = u + i),
  22644. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  22645. o.faceVertexUvs[0].push([
  22646. new r.Vector2(0, u),
  22647. new r.Vector2(0.5, u),
  22648. new r.Vector2(0.5, d),
  22649. ]),
  22650. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  22651. o.faceVertexUvs[0].push([
  22652. new r.Vector2(0.5, d),
  22653. new r.Vector2(0, d),
  22654. new r.Vector2(0, u),
  22655. ]),
  22656. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  22657. o.faceVertexUvs[0].push([
  22658. new r.Vector2(0.5, d),
  22659. new r.Vector2(0.5, u),
  22660. new r.Vector2(1, u),
  22661. ]),
  22662. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  22663. o.faceVertexUvs[0].push([
  22664. new r.Vector2(0.5, d),
  22665. new r.Vector2(1, u),
  22666. new r.Vector2(1, d),
  22667. ]);
  22668. var p =
  22669. this.player.mode === a.PANORAMA
  22670. ? new r.MeshBasicMaterial({
  22671. color: c.path.color,
  22672. side: r.DoubleSide,
  22673. transparent: !0,
  22674. depthWrite: !1,
  22675. opacity: 0,
  22676. name: 'paveT',
  22677. map: w.path,
  22678. })
  22679. : new r.MeshBasicMaterial({
  22680. color: c.path.color,
  22681. side: r.DoubleSide,
  22682. transparent: !0,
  22683. depthWrite: !1,
  22684. opacity: 1,
  22685. name: 'paveO',
  22686. map: w.path,
  22687. });
  22688. return new r.Mesh(o, p);
  22689. }),
  22690. (n.prototype.hintPrefs = {
  22691. rad: 0.18,
  22692. width: 0.0125,
  22693. depth: 0.0625,
  22694. setBack: -0.04,
  22695. markRad: 0.25,
  22696. markInnerRad: 0.16,
  22697. }),
  22698. (n.prototype.makeWaypointObj = function (e, t) {
  22699. var i = new r.Geometry(),
  22700. n =
  22701. this.player.mode === a.PANORAMA
  22702. ? c.path.waypointIndoorRadius
  22703. : c.path.waypointRadius,
  22704. o = this.pathHeight();
  22705. i.vertices.push(
  22706. new r.Vector3(-n, o, n),
  22707. new r.Vector3(-n, o, -n),
  22708. new r.Vector3(n, o, -n),
  22709. new r.Vector3(n, o, n)
  22710. ),
  22711. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  22712. i.faceVertexUvs[0].push([
  22713. new r.Vector2(0, 0),
  22714. new r.Vector2(1, 0),
  22715. new r.Vector2(1, 1),
  22716. ]),
  22717. i.faceVertexUvs[0].push([
  22718. new r.Vector2(1, 1),
  22719. new r.Vector2(0, 1),
  22720. new r.Vector2(0, 0),
  22721. ]);
  22722. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  22723. (s.map.value = e), (s.opacity.value = 0), s.color.value.set(c.path.color);
  22724. var l = {
  22725. side: r.DoubleSide,
  22726. depthWrite: !1,
  22727. transparent: !0,
  22728. vertexShader: m.waypoint.vertexShader,
  22729. fragmentShader: m.waypoint.fragmentShader,
  22730. uniforms: s,
  22731. name: 'waypoint',
  22732. opacity: 0,
  22733. };
  22734. this.player.mode !== a.PANORAMA && ((l.depthTest = !1), (l.name = 'wayPtOut'));
  22735. var h = new r.RawShaderMaterial(l),
  22736. u = new r.Mesh(i, h);
  22737. return (u.name = t), u;
  22738. }),
  22739. (n.prototype.makeStartMarker = function (e, t) {
  22740. var i = new r.Vector3().copy(t[1]).sub(t[0]);
  22741. (i.y = 0), i.normalize();
  22742. var n = Math.acos(i.x),
  22743. o = this.makeWaypointObj(w.pathStart, 'Start');
  22744. return o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o;
  22745. }),
  22746. (n.prototype.makeEndMarker = function (e) {
  22747. var t = this.makeWaypointObj(w.pathEnd, 'End'),
  22748. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  22749. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  22750. return (
  22751. i < n
  22752. ? t.material.uniforms.color.value.set(c.path.colorUp)
  22753. : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  22754. t.position.copy(e),
  22755. t
  22756. );
  22757. }),
  22758. (n.prototype.pathClean = function (e) {
  22759. if (e) {
  22760. for (var t in e.children) this.pathClean(e.children[t]);
  22761. e.geometry && e.geometry.dispose(), e.material && e.material.dispose();
  22762. }
  22763. }),
  22764. (n.prototype.discardPathObject = function () {
  22765. if (this.obj3d) {
  22766. var e = this.obj3d.parent;
  22767. e && e.remove(this.obj3d), this.pathClean(this.obj3d);
  22768. }
  22769. (this.obj3d = null), this.popInCpm();
  22770. }),
  22771. (n.prototype.discardSlow = function () {
  22772. if (this.obj3d) {
  22773. if (this.player.mode !== a.PANORAMA) return void this.discardPathObject();
  22774. for (
  22775. var e,
  22776. t = this,
  22777. i = 0,
  22778. n = function () {
  22779. this.discardPathObject();
  22780. }.bind(this),
  22781. r = 0;
  22782. r < t.obj3d.children.length;
  22783. r += 1
  22784. )
  22785. (e = t.obj3d.children[r]),
  22786. void 0 !== e.material &&
  22787. e.material.transparent === !0 &&
  22788. (void 0 !== e.material.uniforms
  22789. ? p.start(
  22790. u.property(e.material.uniforms.opacity, 'value', 0),
  22791. c.path.fadeOutTime,
  22792. n,
  22793. 0,
  22794. d[c.warp.blendEasing]
  22795. )
  22796. : p.start(
  22797. u.property(e.material, 'opacity', 0),
  22798. c.path.fadeOutTime,
  22799. n,
  22800. 0,
  22801. d[c.warp.blendEasing]
  22802. ),
  22803. (i += 1),
  22804. (n = null));
  22805. 0 === i && this.discardPathObject(),
  22806. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3);
  22807. }
  22808. }),
  22809. (n.prototype.appearSlow = function () {
  22810. var e,
  22811. t = this;
  22812. this.fadeOutCpm(c.path.fadeInTime);
  22813. for (
  22814. var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0;
  22815. n < t.obj3d.children.length;
  22816. n += 1
  22817. )
  22818. (e = t.obj3d.children[n]),
  22819. void 0 !== e.material &&
  22820. e.material.transparent === !0 &&
  22821. (void 0 !== e.material.uniforms
  22822. ? p.start(
  22823. u.property(e.material.uniforms.opacity, 'value', i),
  22824. c.path.fadeInTime,
  22825. null,
  22826. 0,
  22827. d[c.warp.blendEasing]
  22828. )
  22829. : p.start(
  22830. u.property(e.material, 'opacity', i),
  22831. c.path.fadeInTime,
  22832. null,
  22833. 0,
  22834. d[c.warp.blendEasing]
  22835. ));
  22836. }),
  22837. (n.prototype.update = function () {
  22838. this.obj3d && this.obj3d.updateMatrixWorld();
  22839. }),
  22840. (n.prototype.calcBurnsAmount = function (e) {
  22841. //计算导览点旋转角
  22842. var t = r.Math.degToRad(c.warp.burnsAngle);
  22843. if (this.player.mode === a.PANORAMA) {
  22844. var i = this.burnsDir * t;
  22845. if (this.upcomingTransType === l.BLACK) return i;
  22846. var n = e;
  22847. if (null === n) return y.warn('Transition request for non-highlight'), i;
  22848. var o = this.getHeroDescriptorByHeroIndex(n);
  22849. if (null === o) return i;
  22850. if (!o.isPano()) return i;
  22851. var s = this.getHeroPano(o),
  22852. h = this.playerControls.cameras[a.PANORAMA],
  22853. u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize(),
  22854. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  22855. p = function (e) {
  22856. var i = Math.acos(Math.min(1, e.dot(u))),
  22857. n = new r.Vector3().crossVectors(u, e);
  22858. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y);
  22859. };
  22860. if (s === this.player.currentPano)
  22861. return (i = p(
  22862. A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize()
  22863. ));
  22864. var f = this.findShortestPath(this.player.currentPano, s);
  22865. if (void 0 === f || null === f || f.length < 1)
  22866. return y.debug('Empty path ahead...'), i;
  22867. var g = this.makePathHulls(f),
  22868. m = new r.CatmullRomCurve3(g.camera),
  22869. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength());
  22870. return (i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize()));
  22871. }
  22872. return this.player.mode === a.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir;
  22873. }),
  22874. (n.prototype.waitNextStep = function (e, t, time) {
  22875. //xzw 改时间
  22876. var i = time == void 0 ? c.warp.tourStepDelay : time;
  22877. i == void 0 &&
  22878. (i =
  22879. this.lastTransType === l.BLACK
  22880. ? b.tourStepDelaySlideShow
  22881. : b.tourStepDelayDefault);
  22882. var n = new r.Euler(),
  22883. o = new r.Vector3();
  22884. y.debug('Starting wait: ' + (void 0 !== t));
  22885. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem); //this.model.heroLocations[this.director.currentItem[0]]
  22886. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  22887. h = function () {
  22888. this.endWarpState(),
  22889. this.player.mode === a.DOLLHOUSE &&
  22890. (this.playerControls.cameras[
  22891. a.DOLLHOUSE
  22892. ].controls.rotationAcceleration.x = 0),
  22893. t && t();
  22894. }.bind(this),
  22895. u = function (e, t) {
  22896. if (this.warpInterrupted) return h(), !0;
  22897. var r = t || 1e3 / 60;
  22898. if (c.warp.doBurns && !currentLocation.dontRot)
  22899. if (this.player.mode === a.PANORAMA) {
  22900. var l = this.playerControls.cameras[a.PANORAMA];
  22901. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  22902. var u = i == 0 ? s : (r * s) / i;
  22903. u = Math.sign(u) * Math.max(u, 0.0001); //add 如果音频长的话,使旋转可见,否则以为停住了
  22904. (n.y += u),
  22905. o.set(0, 0, -1),
  22906. o.applyEuler(n),
  22907. o.add(l.position),
  22908. l.controls.lookAt(o),
  22909. l.controls.lookVector.copy(o),
  22910. l.lookAt(o);
  22911. } else
  22912. this.player.mode === a.DOLLHOUSE
  22913. ? (this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s)
  22914. : (this.playerControls.controls[a.FLOORPLAN].absoluteScale *= 0.9996);
  22915. }.bind(this);
  22916. this.startWarpState(), p.start(u, i, h, 0, d.easeInOutQuad, 'wait');
  22917. }),
  22918. (n.prototype.warpToNonPano = function (e) {
  22919. if (
  22920. (this.discardPathObject(),
  22921. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE ||
  22922. this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)
  22923. ) {
  22924. var t = function () {
  22925. e && e();
  22926. }.bind(this);
  22927. this.player.flyToNewMode({
  22928. mode: this.warpDestHeroLoc.cameraMode,
  22929. duration: c.warp.outsideTime,
  22930. warpDest: this.warpDestHeroLoc,
  22931. callback: t,
  22932. force: !0,
  22933. });
  22934. } else y.warn('no warp destination!!!'), e && e();
  22935. }),
  22936. (n.prototype._resetWarpShaderParams = function (e) {
  22937. //
  22938. this.player.mode === a.PANORAMA &&
  22939. (void 0 !== e.material.uniforms.blackout &&
  22940. (e.material.uniforms.blackout.value = 0),
  22941. void 0 !== e.material.uniforms.modelAlpha &&
  22942. (e.material.uniforms.modelAlpha.value = 0));
  22943. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  22944. delete e.material.defines.newBlack;
  22945. e.material.needsUpdate = true
  22946. } */
  22947. }),
  22948. (n.prototype._clearWarpShading = function () {
  22949. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  22950. this._resetWarpShaderParams(e[t]), (e[t].visible = !0);
  22951. this._resetWarpShaderParams(this.model.skybox);
  22952. }),
  22953. (n.prototype._warpStopFlying = function () {
  22954. (this.activeTransType = null), this.placeCpm();
  22955. }),
  22956. (n.prototype._wrapupTravelOnlyBits = function () {
  22957. this._warpStopFlying(),
  22958. this.warpPathPoints &&
  22959. (this.player.currentPano.exit(),
  22960. this.warpDestPano.enter(),
  22961. (this.player.currentPano = this.warpDestPano)),
  22962. this.player.spider.draw(),
  22963. this.placeCpm();
  22964. }),
  22965. (n.prototype._wrapupTravel = function (e) {
  22966. this._wrapupTravelOnlyBits(), this.warpCameraAim(e);
  22967. }),
  22968. (n.prototype._wrapupWarpShading = function (e) {
  22969. this._clearWarpShading(), this._wrapupTravel(e);
  22970. }),
  22971. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  22972. t !== I.END && this._clearWarpShading(),
  22973. this._wrapupTravelOnlyBits(),
  22974. (this.upcomingTransType = null),
  22975. e && e();
  22976. }),
  22977. (n.prototype._warpCameraAim = function (e, t) {
  22978. //到每个片段终点时转向终点朝向。
  22979. var i = this.warpDestHeroLoc.quaternion,
  22980. n = this.playerControls.cameras[a.PANORAMA],
  22981. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  22982. s = new r.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize(),
  22983. l = s.dot(o),
  22984. u = r.Math.radToDeg(Math.acos(l)),
  22985. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder),
  22986. g = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  22987. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder);
  22988. (m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y));
  22989. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  22990. A = new r.Vector3(),
  22991. C = function (e, t) {
  22992. return (
  22993. !!this.warpInterrupted ||
  22994. ((v.x = g.x + e * m.x),
  22995. (v.y = g.y + e * m.y),
  22996. (v.z = g.z + e * m.z),
  22997. A.set(0, 0, -1),
  22998. A.applyEuler(v),
  22999. A.add(n.position),
  23000. n.controls.lookAt(A),
  23001. n.controls.lookVector.copy(A),
  23002. void n.lookAt(A))
  23003. );
  23004. }.bind(this);
  23005. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  23006. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  23007. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  23008. ):
  23009. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  23010. ,void (t && t())
  23011. ) */
  23012. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  23013. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e);
  23014. return u > c.warp.minRotation
  23015. ? p.start(C, e, t, 0, d[c.warp.movementEasing])
  23016. : (y.info(
  23017. 'Aim angle only is ' + u.toPrecision(3) + ' degrees, skipping explicit re-aim'
  23018. ),
  23019. void (t && t()));
  23020. }),
  23021. (n.prototype._warpBendAim = function (e, t, i, n) {
  23022. var o = n || 0,
  23023. s = this.playerControls.cameras[a.PANORAMA],
  23024. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23025. this.warpDestHeroLoc.quaternion,
  23026. c.warp.eOrder
  23027. ),
  23028. u = new r.Euler().setFromQuaternion(s.quaternion, c.warp.eOrder),
  23029. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder);
  23030. f.y = h.constrainedTurn(f.y);
  23031. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  23032. (f.x = g * Math.sign(f.x)),
  23033. (g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g)),
  23034. (this.burnsDir = Math.sign(f.y)),
  23035. (g *= Math.sign(f.y)),
  23036. (f.y = g);
  23037. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  23038. v = new r.Vector3(),
  23039. A = function (e, t) {
  23040. if (e < 0.5) (m.x = u.x + e * f.x), (m.y = u.y + e * f.y), (m.z = u.z + e * f.z);
  23041. else {
  23042. var i = (1 - e) * c.warp.softBendEnd;
  23043. (m.x = l.x - i * f.x), (m.y = l.y - i * f.y), (m.z = l.z - i * f.z);
  23044. }
  23045. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position);
  23046. s.controls.lookAt(v), s.controls.lookVector.copy(v), s.lookAt(v);
  23047. }.bind(this);
  23048. if (window.DATA.momentTourBlackNewType) {
  23049. A(1);
  23050. } else return p.start(A, t, i, o, d[c.warp.movementEasing]);
  23051. }),
  23052. (n.prototype._warpStepCameraAim = function (e, t, i) {
  23053. var n = this.playerControls.cameras[a.PANORAMA],
  23054. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23055. this.warpDestHeroLoc.quaternion,
  23056. c.warp.eOrder
  23057. ),
  23058. s = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23059. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder);
  23060. (l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y));
  23061. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  23062. f = new r.Vector3(),
  23063. g = function (e, t) {
  23064. e < 0.5 ? u.copy(s) : u.copy(o),
  23065. f.set(0, 0, -1),
  23066. f.applyEuler(u),
  23067. f.add(n.position),
  23068. n.controls.lookAt(f),
  23069. n.controls.lookVector.copy(f),
  23070. n.lookAt(f);
  23071. }.bind(this);
  23072. return p.start(g, t, i, 0, d[c.warp.movementEasing]);
  23073. }),
  23074. (n.prototype.setBurnsDir = function () {
  23075. var e = this.playerControls.cameras[a.PANORAMA],
  23076. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23077. this.warpDestHeroLoc.quaternion,
  23078. c.warp.eOrder
  23079. ),
  23080. i = new r.Euler().setFromQuaternion(e.quaternion, c.warp.eOrder),
  23081. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder);
  23082. (n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y));
  23083. }),
  23084. (n.prototype.stepWarpPath = function (firstPos, e) {
  23085. var i = this.playerControls.cameras[a.PANORAMA];
  23086. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos;
  23087. if (!n) {
  23088. return i.position.copy(this.warpDestPano.position), !0;
  23089. }
  23090. /* if (!this.warpPathPoints)
  23091. return i.position.copy(this.warpDestPano.position),
  23092. !0;
  23093. var n = this.warpPathPoints[0] */
  23094. var o = this.warpDestPano.position;
  23095. /* console.log(firstPos)
  23096. console.log(o) */
  23097. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  23098. var s = new r.Vector3();
  23099. e < 0.5
  23100. ? s
  23101. .copy(this.cameraHull[1])
  23102. .sub(n)
  23103. .normalize()
  23104. .multiplyScalar(c.warp.softPushDist * e)
  23105. .add(n)
  23106. : s
  23107. .copy(this.cameraHull[this.cameraHull.length - 2])
  23108. .sub(o)
  23109. .normalize()
  23110. .multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e))
  23111. .add(o),
  23112. i.position.copy(s);
  23113. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o);
  23114. }),
  23115. (n.prototype.interruptAndFastForward = function (e, t) {
  23116. this.warping &&
  23117. ((this.warpInterrupted = !0),
  23118. (this.warpInterruptionBlackoutStyle = e),
  23119. (this.warpInterruptionTravelTime = t),
  23120. (null !== this.warpInterruptionBlackoutStyle &&
  23121. void 0 !== this.warpInterruptionBlackoutStyle) ||
  23122. (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  23123. (null !== this.warpInterruptionTravelTime &&
  23124. void 0 !== this.warpInterruptionTravelTime) ||
  23125. (this.warpInterruptionTravelTime = c.minWarpTime));
  23126. }),
  23127. (n.prototype.warpCameraAim = function (e) {
  23128. var t = c.warp.minWarpTime;
  23129. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime;
  23130. else {
  23131. var i = this.playerControls.cameras[a.PANORAMA],
  23132. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23133. this.warpDestHeroLoc.quaternion,
  23134. c.warp.eOrder
  23135. ),
  23136. o = new r.Euler().setFromQuaternion(i.quaternion, c.warp.eOrder),
  23137. s = new r.Euler(n.x - o.x, n.y - o.y, n.z - o.z, c.warp.eOrder);
  23138. s.y = h.constrainedTurn(s.y);
  23139. var u = (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec);
  23140. t = Math.max(t, u);
  23141. }
  23142. var d = function () {
  23143. this._warpStopFlying(), this.discardSlow(), e && e();
  23144. }.bind(this);
  23145. this._warpCameraAim(t, d);
  23146. }),
  23147. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  23148. this.model.skybox.material.uniforms.blackout.value = n;
  23149. var r = u.uniform(this.model.skybox, 'progress', 1),
  23150. o = u.allUniforms(this.model.chunks, 'progress', 1),
  23151. a = !1,
  23152. s = function () {
  23153. if (this.warpInterrupted) return (a = !0), !0;
  23154. }.bind(this),
  23155. l = function (e, t) {
  23156. return i && a
  23157. ? ((this.model.skybox.material.uniforms.progress.value = 0), !0)
  23158. : void r(e, t);
  23159. }.bind(this),
  23160. h = function (e, t) {
  23161. return i && a ? (o(0), !0) : void o(e, t);
  23162. }.bind(this);
  23163. p.start(s, e, null, t, null, 'safeHaltWatch'),
  23164. p.start(l, e, null, t, d[c.warp.blendEasing], 'skyboxProgress'),
  23165. p.start(h, e, null, t, d[c.warp.blendEasing], 'chunkProgress');
  23166. }),
  23167. (n.prototype.warpTravel_STD = function (e) {
  23168. var t,
  23169. i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength),
  23170. n = this.playerControls.cameras[a.PANORAMA],
  23171. o = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  23172. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  23173. f = new r.Vector3(),
  23174. m = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23175. v = new r.Euler().copy(m),
  23176. C = n.position.clone(),
  23177. E = new r.Matrix4(),
  23178. b = new r.Euler(),
  23179. w = c.warp.minWarpTime;
  23180. (w += this.warpLength * c.warp.timePerMeter),
  23181. c.warp.flySpeed > 0.01 && (w = (1e3 * this.warpLength) / c.warp.flySpeed);
  23182. var _ = !1,
  23183. T = this.warpDestHeroLoc.quaternion,
  23184. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  23185. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  23186. .clone()
  23187. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  23188. .normalize(),
  23189. M = S.dot(x),
  23190. R = r.Math.radToDeg(Math.acos(M)),
  23191. P = function (e) {
  23192. var t = o,
  23193. i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  23194. return i;
  23195. },
  23196. O = function () {
  23197. return (
  23198. E.lookAt(C, t, A.UP),
  23199. s.setFromRotationMatrix(E, c.warp.eOrder),
  23200. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23201. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23202. h.constrainedTurn(b.y)
  23203. );
  23204. }.bind(this),
  23205. L = function (e, t) {
  23206. if (this.warpInterrupted) return (_ = !0), !0;
  23207. }.bind(this),
  23208. D = function (e, t) {
  23209. return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(e);
  23210. }.bind(this),
  23211. N = u.allUniforms(this.model.chunks, 'modelAlpha', 1),
  23212. B = function (e, t) {
  23213. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t);
  23214. }.bind(this),
  23215. F = function (e, t) {
  23216. if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0;
  23217. if (_) return !0;
  23218. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  23219. n.position.copy(i),
  23220. (C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e));
  23221. }.bind(this),
  23222. V = function (e, n) {
  23223. return this.warpPathPoints
  23224. ? !!_ ||
  23225. void (t = this.interpAlongPath(
  23226. this.warpPathPoints,
  23227. this.warpPathLengths,
  23228. Math.min(e + i, 1)
  23229. ))
  23230. : (y.debug('Lost bunny.'), !0);
  23231. }.bind(this),
  23232. U = function (e, o) {
  23233. if (_) return y.debug('>>>> Walkthrough interupted at t=' + e), !0;
  23234. if (!this.warpPathPoints) return !0;
  23235. var a = this.warpLength * e,
  23236. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  23237. u = r.Math.smoothstep(
  23238. a,
  23239. this.warpLength - this.brushPrefs.lookBlendDist,
  23240. this.warpLength
  23241. );
  23242. c.warp.matchCam && (l *= 1 - u),
  23243. E.lookAt(C, t, A.UP),
  23244. s.setFromRotationMatrix(E, c.warp.eOrder),
  23245. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23246. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23247. (b.y = h.constrainedTurn(b.y)),
  23248. (s.x = m.x + l * b.x),
  23249. (s.y = m.y + l * b.y),
  23250. (s.z = m.z + l * b.z),
  23251. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  23252. (b.y = h.constrainedTurn(b.y));
  23253. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3;
  23254. (b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  23255. (v.x = v.x + b.x * c.warp.turnFriction),
  23256. (v.y = v.y + b.y * c.warp.turnFriction),
  23257. (v.z = v.z + b.z * c.warp.turnFriction),
  23258. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x));
  23259. var p = t.clone().sub(C).normalize();
  23260. if (R < c.warp.maxAimRotation && u > 0) {
  23261. var g = 1 - u;
  23262. (p.x = p.x * g + u * S.x),
  23263. (p.y = p.y * g + u * S.y),
  23264. (p.z = p.z * g + u * S.z),
  23265. p.normalize();
  23266. }
  23267. this.bunnyObj.position.copy(n.position).add(p),
  23268. f.set(0, 0, -1).applyEuler(v).normalize(),
  23269. f.multiplyScalar(8),
  23270. f.add(n.position),
  23271. (e > 1 - i && c.warp.matchCam) ||
  23272. (n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f));
  23273. }.bind(this),
  23274. k = function () {
  23275. _
  23276. ? (this.discardSlow(),
  23277. (this.upcomingTransType = l.BLACK),
  23278. this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, I.BEGINNING, e))
  23279. : this._wrapupWarpShading(e);
  23280. }.bind(this);
  23281. V(0);
  23282. var H =
  23283. c.warp.motionLeadTime +
  23284. (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec);
  23285. w += H;
  23286. var G = H / w;
  23287. this.warpCommonParameters(w, G, !0, I.NONE),
  23288. p.start(L, w, null, 0, null, '_haltWatcher'),
  23289. c.warp.blur > 0 &&
  23290. ((g.blurStrength = c.warp.blur), p.start(D, w, null, G, P, 'blurring')),
  23291. p.start(B, w, null, G, P, 'modelAlpha'),
  23292. p.start(F, w, null, G, d[c.warp.blendEasing], 'followPath'),
  23293. p.start(V, w, null, G, d[c.warp.blendEasing], 'goBunny'),
  23294. p.start(U, w, k, 0, d[c.warp.blendEasing], 'lookAtBunny');
  23295. }),
  23296. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  23297. var r = e || 0;
  23298. (void 0 !== t && null !== t) || (t = c.warp.teleportTime);
  23299. //add
  23300. var done = () => {
  23301. Hot.updateVisibles([this.player.currentPano]); //更新热点显示
  23302. this.player.transitionPos({
  23303. type: 'beforeFlytopano',
  23304. pano: this.player.currentPano,
  23305. dur: 100,
  23306. }); //add
  23307. };
  23308. if (window.DATA.momentTourBlackNewType) {
  23309. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer);
  23310. var camera = this.playerControls.cameras[a.PANORAMA];
  23311. var end = this.warpDestHeroLoc.position;
  23312. camera.position.copy(end);
  23313. setTimeout(() => {
  23314. player.sceneRenderer.effects.transitionMaskPass.stop();
  23315. this.wrapupWarpShadingOnly(n, i);
  23316. done();
  23317. }, t);
  23318. } else {
  23319. var o = function () {
  23320. this.wrapupWarpShadingOnly(n, i);
  23321. done();
  23322. }.bind(this);
  23323. var firstPos = this.player.position.clone(); //add
  23324. p.start(
  23325. this.stepWarpPath.bind(this, firstPos),
  23326. t,
  23327. o,
  23328. r,
  23329. d[c.warp.blendEasing],
  23330. 'stepMotion'
  23331. );
  23332. }
  23333. this.warpCommonParameters(t, r, !1, i);
  23334. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  23335. // 改
  23336. if (window.DATA.momentTourBlackNewType) {
  23337. e.material.uniforms.blackout.value = 5; //i 改
  23338. //e.material.defines.newBlack = ''
  23339. //e.material.needsUpdate = true
  23340. } else {
  23341. e.material.uniforms.blackout.value = i;
  23342. }
  23343. }),
  23344. this._warpBendAim(null, t, null, r);
  23345. }),
  23346. (n.prototype.flightStepWalk = (function (e, t, i) {
  23347. var n = 0.001,
  23348. o = 1,
  23349. a = 1.2,
  23350. s = new r.Vector3(),
  23351. h = new r.Vector3(),
  23352. u = function (e, t) {
  23353. //导览速度
  23354. var i = Math.min(
  23355. this.player.position.distanceTo(e.position),
  23356. c.transition.flytimeMaxDistanceThreshold
  23357. ),
  23358. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  23359. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  23360. h.copy(A.FORWARD),
  23361. this.player.getDirection(h),
  23362. s.copy(t).sub(e.position).normalize();
  23363. var l = s.dot(h),
  23364. u = Math.acos(l),
  23365. d = u / r;
  23366. d > n && ((r *= d / n), u < o && (r *= a));
  23367. return (r / DATA.tourWalkSpeed) * 100; // 改
  23368. };
  23369. return function (e, t, i) {
  23370. if (this.warpInterrupted) i && i();
  23371. else if (this.activeTransType !== l.WALK)
  23372. this._clearWarpShading(),
  23373. this._warpStopFlying(),
  23374. this.player.spider.draw(),
  23375. this.placeCpm(),
  23376. i && i();
  23377. else if (this.player.currentPano !== e) {
  23378. var n = {
  23379. pano: e,
  23380. lookAtPoint: t,
  23381. duration: null,
  23382. maxDistanceOverride: c.warp.walkMaxDist,
  23383. skipWarpingCheck: !1,
  23384. constantMoveSpeed: !0,
  23385. };
  23386. if (e == this.warpDestPano) {
  23387. //到达终点前,放大到终点的zoom
  23388. n.zoomLevel = this.warpDestHeroLoc.zoom;
  23389. }
  23390. (n.duration = u.call(this, e, t)), this.player.nonInterruptingFlyToPano(n, i);
  23391. } else i && i();
  23392. };
  23393. })()),
  23394. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  23395. return this.flightStepWalk.bind(this, e, t, i);
  23396. }),
  23397. (n.prototype.warpTravel_WALK = (function () {
  23398. var e = [];
  23399. return function (t) {
  23400. var i = this.player.model.panos;
  23401. e.length = 0;
  23402. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  23403. var s = this.nodes[a],
  23404. l = i.get(s);
  23405. a === this.nodes.length - 1;
  23406. (o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist),
  23407. (n && o) || (e.push(s), (n = l));
  23408. }
  23409. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  23410. var h = e.length,
  23411. u = i.get(e[h - 1]),
  23412. d = new Array(h + 1);
  23413. d[d.length - 1] = function () {
  23414. t && t();
  23415. }.bind(this);
  23416. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  23417. var g = e[p];
  23418. u = i.get(g);
  23419. var m = new r.Vector3();
  23420. this.getLookAtForWalkingTourNode(e, p, m),
  23421. (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])),
  23422. p--;
  23423. }
  23424. d[0]();
  23425. };
  23426. })()),
  23427. (n.prototype.getLookAtForWalkingTourNode = (function () {
  23428. var e = new r.Vector3(),
  23429. t = new r.Vector3(),
  23430. i = new r.Vector3(),
  23431. n = new r.Vector3(),
  23432. o = new r.Vector3(),
  23433. a = 0.65,
  23434. s = 0.75,
  23435. l = 0.2,
  23436. c = 0.4,
  23437. h = 0.2,
  23438. u = 3;
  23439. return function (r, d, p) {
  23440. var f = r.length;
  23441. if (d >= f) return !1;
  23442. var g = 1,
  23443. m = 1;
  23444. t.set(0, 0, 0), o.set(0, 0, 0);
  23445. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  23446. if (
  23447. ((v = this.player.model.panos.get(r[A])),
  23448. this.getOrientationForWalkingTourNode(r, A, i),
  23449. A === d && e.copy(i),
  23450. n.copy(i),
  23451. A > d)
  23452. ) {
  23453. var y = n.dot(e) < a;
  23454. (g *= y ? l : s), (m *= y ? h : c);
  23455. }
  23456. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m);
  23457. }
  23458. return t.normalize(), p.copy(o), p.add(t), !0;
  23459. };
  23460. })()),
  23461. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  23462. var n = e.length;
  23463. if (t >= n) return !1;
  23464. if (t === n - 1) i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  23465. else {
  23466. var r = this.player.model.panos.get(e[t]),
  23467. o = this.player.model.panos.get(e[t + 1]);
  23468. i.copy(o.position).sub(r.position);
  23469. }
  23470. return i.normalize(), !0;
  23471. }),
  23472. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  23473. if (
  23474. ((this.activeTransType = this.upcomingTransType),
  23475. (this.lastTransType = this.activeTransType),
  23476. (this.upcomingTransType = null),
  23477. !e)
  23478. ) {
  23479. var r = function () {
  23480. this._wrapupTravel(n);
  23481. }.bind(this),
  23482. o = {
  23483. pano: this.warpDestPano,
  23484. lookAtPoint: null,
  23485. duration: null,
  23486. maxDistanceOverride: null,
  23487. skipWarpingCheck: !1,
  23488. };
  23489. return void this.player.flyToPano(o, r);
  23490. }
  23491. this.activeTransType === l.BLACK
  23492. ? this.warpTravel_BLACK(null, i, t, n)
  23493. : this.activeTransType === l.WALK
  23494. ? this.warpTravel_WALK(
  23495. function () {
  23496. this._clearWarpShading(),
  23497. this._warpStopFlying(),
  23498. this.player.spider.draw(),
  23499. this.placeCpm(),
  23500. n && n();
  23501. }.bind(this)
  23502. )
  23503. : this.warpTravel_STD(n);
  23504. }),
  23505. (n.prototype.startWarpState = function () {
  23506. (this.warping = !0),
  23507. (this.warpInterrupted = !1),
  23508. (this.warpInterruptionBlackoutStyle = null),
  23509. (this.warpInterruptionTravelTime = null);
  23510. }),
  23511. (n.prototype.endWarpState = function () {
  23512. this.warping = !1;
  23513. }),
  23514. (n.prototype.warpToPano = function (e, t, i, n) {
  23515. if (this.warping) return void y.warn('Cannot warp when already warping');
  23516. if (
  23517. ((this.upcomingTransType = e),
  23518. (this.activeTransType = null),
  23519. !this.setWarpDestPano())
  23520. )
  23521. return (this.upcomingTransType = null), void this.warpToNonPano(n);
  23522. if (this.player.mode !== a.PANORAMA)
  23523. return (
  23524. (this.upcomingTransType = null),
  23525. this.discardSlow(),
  23526. void this.player.flyToNewMode({
  23527. mode: a.PANORAMA,
  23528. pano: this.warpDestPano,
  23529. duration: c.warp.outsideTime,
  23530. warpDest: this.warpDestHeroLoc,
  23531. callback: n,
  23532. force: !0,
  23533. })
  23534. );
  23535. if (!this.warpDestPano)
  23536. return (
  23537. y.warn('no warp destination, callback dropped'),
  23538. void (this.upcomingTransType = null)
  23539. );
  23540. var r = !(
  23541. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  23542. this.warpDestPano !== this.player.currentPano &&
  23543. this.warpDestPano.position.distanceTo(this.player.currentPano.position) <
  23544. c.warp.nearPanoDist
  23545. ),
  23546. o = this.chooseWarpPath(r);
  23547. if (o && this.upcomingTransType !== l.WALK) {
  23548. var s = function () {
  23549. (this.waitingToWarp = !1), this.warpToPano(e, t, i, n);
  23550. }.bind(this);
  23551. if (
  23552. this.player.checkAndWaitForPanoLoad(
  23553. this.warpDestPano,
  23554. 'high',
  23555. 'low',
  23556. this.player.basePanoSize,
  23557. s
  23558. )
  23559. )
  23560. return void (this.waitingToWarp = !0);
  23561. }
  23562. this.player.currentPano ||
  23563. (y.warn('Arrived at a very strange spot!'),
  23564. (this.player.currentPano = this.warpDestPano),
  23565. this.placeCpm(),
  23566. this.fadeOutCpm(c.path.fadeOutTime),
  23567. this.player.spider.draw()),
  23568. y.debug('Warping to pano ', this.warpDestPano.position),
  23569. this.upcomingTransType !== l.WALK &&
  23570. this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  23571. this.startWarpState();
  23572. var h = function () {
  23573. this.endWarpState(), n && n();
  23574. }.bind(this);
  23575. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h);
  23576. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  23577. }),
  23578. (t.exports = n);
  23579. }.call(this, '/js/objects/ShowPath.js'));
  23580. },
  23581. {
  23582. '../constants': 8,
  23583. '../effects': 16,
  23584. '../enum/BlackoutStyle': 18,
  23585. '../enum/ModelManagerEvents': 33,
  23586. '../enum/PlayerEvents': 40,
  23587. '../enum/RenderOrder': 42,
  23588. '../enum/Vectors': 50,
  23589. '../enum/Viewmode': 51,
  23590. '../enum/WarpStyle': 52,
  23591. '../gui/gui': 65,
  23592. '../model/ModelManager': 140,
  23593. '../objects/Snapshot': 153,
  23594. '../settings': 166,
  23595. '../shaders': 167,
  23596. '../util/easing': 186,
  23597. '../util/lerp': 188,
  23598. '../util/logger': 189,
  23599. '../util/math': 190,
  23600. '../util/texture': 194,
  23601. '../util/transitions': 195,
  23602. three: 217,
  23603. },
  23604. ],
  23605. 152: [
  23606. function (e, t, i) {
  23607. 'use strict';
  23608. function n() {
  23609. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  23610. t = new r.RawShaderMaterial({
  23611. fragmentShader: o.skysphere.fragmentShader,
  23612. vertexShader: o.skysphere.vertexShader,
  23613. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  23614. side: r.BackSide,
  23615. name: 'skysphere',
  23616. });
  23617. (t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t);
  23618. }
  23619. var r = e('three'),
  23620. o = e('../shaders'),
  23621. a = e('../settings');
  23622. (n.prototype = Object.create(r.Mesh.prototype)),
  23623. (n.prototype.constructor = n),
  23624. (t.exports = n);
  23625. },
  23626. {
  23627. '../settings': 166,
  23628. '../shaders': 167,
  23629. three: 217,
  23630. },
  23631. ],
  23632. 153: [
  23633. function (e, t, i) {
  23634. (function (i) {
  23635. 'use strict';
  23636. function n(e) {
  23637. o.call(this, e),
  23638. (this.sid = e.sid), //xzw add
  23639. (this.panoId = e.panoId),
  23640. (this.orthoZoom = e.orthoZoom),
  23641. (this.floorVisibility = e.floorVisibility),
  23642. (this.thumbUrl = e.thumbUrl),
  23643. (this.name = e.name),
  23644. (this.zoom = e.zoom);
  23645. }
  23646. var r = (e('three'), e('../util/logger')),
  23647. o =
  23648. (e('../settings'),
  23649. e('../enum/Viewmode'),
  23650. e('../util/common'),
  23651. e('../util/transitions'),
  23652. e('../util/lerp'),
  23653. e('../util/ajax'),
  23654. e('../util/texture'),
  23655. e('./View'));
  23656. e('events').EventEmitter, new r(i);
  23657. (n.prototype = Object.create(o.prototype)),
  23658. (n.prototype.isPano = function () {
  23659. return this.panoId && '' !== this.panoId && this.panoId != 'outside';
  23660. }),
  23661. (t.exports = n);
  23662. }.call(this, '/js/objects/Snapshot.js'));
  23663. },
  23664. {
  23665. '../enum/Viewmode': 51,
  23666. '../settings': 166,
  23667. '../util/ajax': 181,
  23668. '../util/common': 185,
  23669. '../util/lerp': 188,
  23670. '../util/logger': 189,
  23671. '../util/texture': 194,
  23672. '../util/transitions': 195,
  23673. './View': 154,
  23674. events: 202,
  23675. three: 217,
  23676. },
  23677. ],
  23678. 154: [
  23679. function (e, t, i) {
  23680. (function (i) {
  23681. 'use strict';
  23682. function n(e) {
  23683. (e = e || {}),
  23684. (this.position = new r.Vector3()),
  23685. (this.quaternion = new r.Quaternion()),
  23686. this.update(e);
  23687. }
  23688. var r = e('three'),
  23689. o = e('../util/logger'),
  23690. a =
  23691. (e('../settings'),
  23692. e('../enum/Viewmode'),
  23693. e('../util/common'),
  23694. e('../util/transitions'),
  23695. e('../util/lerp'),
  23696. e('../util/ajax'),
  23697. e('../util/texture'),
  23698. e('events').EventEmitter);
  23699. new o(i);
  23700. (n.prototype = Object.create(a.prototype)),
  23701. (n.prototype.isValid = function () {
  23702. return !!this.cameraMode;
  23703. }),
  23704. (n.prototype.update = function (e) {
  23705. return (
  23706. (this.cameraMode = e.cameraMode || this.cameraMode),
  23707. (this.pano = e.pano || this.pano),
  23708. e.position && this.position.copy(e.position),
  23709. e.quaternion && this.quaternion.copy(e.quaternion),
  23710. this
  23711. );
  23712. }),
  23713. (t.exports = n);
  23714. }.call(this, '/js/objects/View.js'));
  23715. },
  23716. {
  23717. '../enum/Viewmode': 51,
  23718. '../settings': 166,
  23719. '../util/ajax': 181,
  23720. '../util/common': 185,
  23721. '../util/lerp': 188,
  23722. '../util/logger': 189,
  23723. '../util/texture': 194,
  23724. '../util/transitions': 195,
  23725. events: 202,
  23726. three: 217,
  23727. },
  23728. ],
  23729. 155: [
  23730. function (e, t, i) {
  23731. //player.js
  23732. (function (i) {
  23733. 'use strict';
  23734. function n(e) {
  23735. (this.currentPano = null),
  23736. (this.nextPano = null),
  23737. (this.camera = null),
  23738. (this.paused = !1),
  23739. (this.flying = !1),
  23740. (this.sceneIntersectionPlane = null),
  23741. (this.target = new r.Vector3()),
  23742. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  23743. (this.mouseAtMouseDown = new r.Vector2()),
  23744. (this.mouseCouldBeClickToMove = !1),
  23745. (this.mouseLastMoveTime = Date.now()),
  23746. (this.mouseDown = !1),
  23747. (this.mouseDownTimer = null),
  23748. (this.couldBeLongTap = !1),
  23749. (this.containsMouse = !1), //
  23750. (this.isTouchEvent = !1),
  23751. (this.isPanoHover = !1),
  23752. (this.reticule = new a(this)),
  23753. (this.panoMarkers = []),
  23754. (this.spider = new h(this)),
  23755. (this.quaternion = new r.Quaternion()),
  23756. (this.position = new r.Vector3(15, 10, 15)),
  23757. (this.previousState = null),
  23758. (this.lastInsideView = new c()),
  23759. (this.last360View = new c()),
  23760. (this.raycaster = new r.Raycaster()),
  23761. (this.intersect = null),
  23762. (this.lastChangeTime = Date.now()),
  23763. (this.history = new I()),
  23764. (this.cameraControls = null),
  23765. (this.path = null),
  23766. (this.model = null),
  23767. (this.domElement = null),
  23768. (this.cachedPanoCandidates = null),
  23769. (this.basePanoSize = 0),
  23770. (this.standardPanoSize = 0),
  23771. (this.highPanoSize = 0),
  23772. (this.ultraHighPanoSize = 0),
  23773. (this.zoomLevel = 1),
  23774. (this.zooming = 0),
  23775. (this.zoomSpeed = 0.5),
  23776. (this.scrollZoomSpeed = 0.06),
  23777. (this.zoomSpeedAdjust = 0.05),
  23778. (this.defaultZoomIncrement = 0.2),
  23779. (this.baseFov = f.insideFOV),
  23780. (this.zoomFov = this.baseFov),
  23781. (this.zoomEnabled = !0),
  23782. (this.preRenderingEnabled = !1),
  23783. this.setupCustomProperties(e),
  23784. (this.zoomStats = new L());
  23785. window.player = this;
  23786. this.modeTran = '';
  23787. }
  23788. var r = e('three'),
  23789. o = e('./util/logger'),
  23790. a = e('./objects/Reticule'),
  23791. s = e('./objects/Panorama'),
  23792. l = e('./objects/ShowPath'),
  23793. c = e('./objects/View'),
  23794. h = (e('./objects/Snapshot'), e('./objects/NSpider')),
  23795. u = e('./enum/Viewmode'),
  23796. d = (e('./enum/TagStates'), e('./enum/Vectors')),
  23797. p = e('./enum/Keys'),
  23798. f = (e('./enum/AlignmentType'), e('./settings')),
  23799. g = e('./util/common'),
  23800. m = (e('./util/browser'), e('./util/math')),
  23801. v = e('./util/lerp'),
  23802. A = e('./util/easing'),
  23803. y = e('./util/transitions'),
  23804. C = e('events').EventEmitter,
  23805. I = (e('./shaders'), e('./util/history')),
  23806. E = (e('./util/camera'), e('./model/ModelManager'), e('./enum/PathDiscardMode')),
  23807. b = e('./enum/PathDisplayMode'),
  23808. w = e('./enum/PlayerEvents'),
  23809. _ = e('./enum/ControlEvents'),
  23810. T = e('./enum/ModelManagerEvents'),
  23811. x = e('./enum/WarpStyle'),
  23812. S = e('./enum/BlackoutStyle'),
  23813. M = e('./exception/BasicException'),
  23814. R = e('./enum/PanoSizeClass'),
  23815. P = (e('./tile/TileDownloader'), e('./tile/TilePrioritizer')),
  23816. O = (e('./enum/PanoramaEvents'), e('./enum/ZoomEvents')),
  23817. L = e('./util/ZoomStats'),
  23818. D = e('./constants'),
  23819. N = e('./util/common'),
  23820. B = e('./util/cameraLight'),
  23821. //, Hot = e('hot')
  23822. F = new o(i),
  23823. V = Object.freeze({
  23824. FlyToPano: y.getUniqueId(),
  23825. FlyToNewMode: y.getUniqueId(),
  23826. FlyToSameMode: y.getUniqueId(),
  23827. FlyToViewFloor: y.getUniqueId(),
  23828. LookTransition: y.getUniqueId(),
  23829. ZoomTransition: y.getUniqueId(),
  23830. });
  23831. (n.prototype = Object.create(C.prototype)),
  23832. (n.prototype.init = function (e) {
  23833. (this.modelManager = e.modelManager),
  23834. (this.tileDownloader = e.tileDownloader),
  23835. (this.panoRenderer = e.panoRenderer),
  23836. (this.qualityManager = e.qualityManager),
  23837. (this.domElement = e.container),
  23838. (this.camera = e.camera),
  23839. (this.tagManager = e.tagManager),
  23840. (this.cameraControls = e.controls),
  23841. (this.path = new l(e.director, this, e.controls)),
  23842. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  23843. (this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD)),
  23844. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  23845. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH)),
  23846. (this.tileDownloader.processPriorityQueue = !1),
  23847. (this.tileDownloader.tilePrioritizer = new P(
  23848. this.qualityManager,
  23849. this.basePanoSize,
  23850. this.standardPanoSize,
  23851. this.highPanoSize,
  23852. this.ultraHighPanoSize
  23853. )),
  23854. this.bindEvents(e.container),
  23855. this.updateModel();
  23856. });
  23857. //xzw add: 截图
  23858. function dataURLtoBlob(dataurl) {
  23859. var arr = dataurl.split(','),
  23860. mime = arr[0].match(/:(.*?);/)[1],
  23861. bstr = atob(arr[1]),
  23862. n = bstr.length,
  23863. u8arr = new Uint8Array(n);
  23864. while (n--) {
  23865. u8arr[n] = bstr.charCodeAt(n);
  23866. }
  23867. return new Blob([u8arr], { type: mime });
  23868. }
  23869. n.prototype.screenShot = function (o) {
  23870. if (this.flying || this.flyingToTag) return;
  23871. var R = this.sceneRenderer;
  23872. R.updateScreenSize(o);
  23873. for (var i in this.model.panos.index) {
  23874. if (!this.model.panos.index[i].marker) continue;
  23875. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  23876. this.model.panos.index[i].marker.visible = false;
  23877. }
  23878. for (var i in this.model.hots) {
  23879. this.model.hots[i].mesh.visible = false;
  23880. }
  23881. this.reticule.visible = false;
  23882. this.reticule.forceUnvisible = true;
  23883. this.path.currentPanoMarker.mesh.visible = false;
  23884. setTimeout(
  23885. function () {
  23886. //因resize效用没办法立即生效(原因未知),故而延后
  23887. R.renderer.clear(true, true, true);
  23888. R.renderer.render(R.scene, R.camera);
  23889. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9);
  23890. o.f && o.f(imgData);
  23891. R.updateScreenSize({ resize: true });
  23892. this.reticule.visible = true;
  23893. for (var i in this.model.hots) {
  23894. this.model.hots[i].mesh.visible = true;
  23895. }
  23896. for (var i in this.model.panos.index) {
  23897. this.model.panos.index[i].marker.visible =
  23898. this.model.panos.index[i].marker.forceHide;
  23899. }
  23900. this.path.currentPanoMarker.mesh.visible = true;
  23901. R.renderer.render(R.scene, R.camera);
  23902. }.bind(this),
  23903. 30
  23904. ); //这个数字不能太小
  23905. };
  23906. var scaleImg = e('scaleImg');
  23907. var ResizeImg = function (img, option) {
  23908. var img2; //不能直接改img 否则可能触发第二次img.onload
  23909. var compress = function (ratio, type) {
  23910. var image = img2 || img;
  23911. var c = document.createElement('canvas');
  23912. c.width = image.width;
  23913. c.height = image.height;
  23914. var ctx = c.getContext('2d');
  23915. ctx.drawImage(image, 0, 0, image.width, image.height);
  23916. img2 = scaleImg(ratio /* option.maxSize/oldSize */, c, type /* option.type||"png" */); //最大不能超过0.8M
  23917. };
  23918. var reCom = function () {
  23919. //如果有了img2 就只需要img2 否则创造新的img2
  23920. var image = img2 || img;
  23921. var blob = dataURLtoBlob(image.src);
  23922. if (option.maxWeight && blob.size > option.maxWeight) {
  23923. compress(option.maxWeight / blob.size, 'jpeg');
  23924. blob = dataURLtoBlob(image.src);
  23925. }
  23926. if (!img2) {
  23927. img2 = new Image();
  23928. }
  23929. img2.base64Src = image.src;
  23930. img2.src = window.URL.createObjectURL(blob);
  23931. };
  23932. var oldSize = Math.max(img.width, img.height);
  23933. if (option.toType != 'png') {
  23934. //不是非要png的话
  23935. if (option.oldType == 'jpeg') {
  23936. //jpeg先判断尺寸,然后是尺寸
  23937. if (oldSize > option.maxSize) {
  23938. compress(option.maxSize / oldSize, 'jpeg');
  23939. }
  23940. reCom();
  23941. } else if (option.oldType == 'png') {
  23942. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  23943. if (option.maxWeight && option.weight > option.maxWeight) {
  23944. //如果一开始大小不大就不压缩 还是png
  23945. compress(oldSize > option.maxSize ? option.maxSize / oldSize : 1, 'jpeg');
  23946. reCom();
  23947. }
  23948. }
  23949. } else {
  23950. //?貌似png会越压缩越大?
  23951. }
  23952. return img2 || img;
  23953. };
  23954. var _fixType = function (type) {
  23955. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  23956. var r = type.match(/png|jpeg|bmp|gif/)[0];
  23957. return 'image/' + r;
  23958. };
  23959. var saveFile = function (data, filename) {
  23960. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  23961. save_link.href = data;
  23962. save_link.download = filename;
  23963. var event = document.createEvent('MouseEvents');
  23964. event.initMouseEvent(
  23965. 'click',
  23966. true,
  23967. false,
  23968. window,
  23969. 0,
  23970. 0,
  23971. 0,
  23972. 0,
  23973. 0,
  23974. false,
  23975. false,
  23976. false,
  23977. false,
  23978. 0,
  23979. null
  23980. );
  23981. save_link.dispatchEvent(event);
  23982. };
  23983. (n.prototype.getWrapShot = function () {
  23984. //获取导览点截图/初始画面和信息
  23985. var info = this.getSnapAngleInfo();
  23986. var str = ',{\r\t' + info;
  23987. var arg = arguments[0];
  23988. this.screenShot({
  23989. width: g_snapShotWidth * 4,
  23990. height: g_snapShotHeight * 4,
  23991. type: 'image/jpeg',
  23992. f: function (imgData) {
  23993. if (arg && arg.__callback) {
  23994. return arg.__callback(imgData, info);
  23995. }
  23996. var img = new Image();
  23997. img.src = imgData;
  23998. img.onload = function () {
  23999. var img2 = ResizeImg(this, { maxSize: g_snapShotWidth, oldType: 'jpeg' }); //暂定缩略图大小
  24000. img2.src.replace(_fixType('image/jpeg'), 'image/octet-stream');
  24001. var filename = 'snap' + new Date().getTime();
  24002. saveFile(img2.src, filename + '.jpg');
  24003. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",';
  24004. str += '\r\t"sid":"' + filename + '",';
  24005. str += '\r\t"name":"' + filename + '"\r}';
  24006. logData(str);
  24007. };
  24008. },
  24009. });
  24010. }),
  24011. (n.prototype.getSnapAngleInfo = function () {
  24012. var info = {};
  24013. var str = '"metadata":{';
  24014. var q = this.camera.quaternion.clone();
  24015. switch (this.mode) {
  24016. case 'panorama':
  24017. info.scan_id = this.currentPano.id;
  24018. str += '"scan_id":"' + this.currentPano.id + '",';
  24019. break;
  24020. case 'floorplan':
  24021. info.camera_mode = 1;
  24022. q = new r.Quaternion().setFromAxisAngle(
  24023. new r.Vector3(0, 1, 0),
  24024. r.Math.degToRad(90)
  24025. );
  24026. q.multiply(this.camera.quaternion);
  24027. str += '"camera_mode":1,';
  24028. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  24029. str +=
  24030. '"ortho_zoom":' +
  24031. m.toPrecision(this.cameraControls.activeControl.currentScale, 4) +
  24032. ',';
  24033. break;
  24034. case 'dollhouse':
  24035. info.camera_mode = 2;
  24036. str += '"camera_mode":2,';
  24037. break;
  24038. }
  24039. info.camera_position = m.toPrecision(this.camera.position.toArray(), 4);
  24040. console.log(info.camera_position);
  24041. if (window.screenSta === 'tour') {
  24042. // fyz 导览截屏需要做额外的
  24043. /**fyz 对相机截屏的角度进行校对 */
  24044. var out = new r.Quaternion(q.x, q.y, q.z, q.w);
  24045. out.multiply(
  24046. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate()
  24047. );
  24048. out.x *= -1;
  24049. out.w *= -1;
  24050. info.camera_quaternion = m.toPrecision(out.toArray(), 4);
  24051. } else {
  24052. info.camera_quaternion = m.toPrecision(q.toArray(), 4);
  24053. }
  24054. info.zoom = this.zoomLevel;
  24055. console.log(info.camera_quaternion);
  24056. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  24057. // fyz 扩展编辑页面, 加上导览点缩放值
  24058. str +=
  24059. '"camera_position":[' +
  24060. info.camera_position +
  24061. '],"camera_quaternion":[' +
  24062. info.camera_quaternion +
  24063. '], "zoom":' +
  24064. info.zoom +
  24065. '}';
  24066. return str;
  24067. });
  24068. //------end
  24069. (n.prototype.setupCustomProperties = function (e) {
  24070. var t = e || u.PANORAMA;
  24071. Object.defineProperty(this, 'mode', {
  24072. get: function () {
  24073. return t;
  24074. },
  24075. set: function (e) {
  24076. var i = t;
  24077. (t = e), this.onModeUpdated(i, t);
  24078. },
  24079. });
  24080. }),
  24081. (n.prototype.isInMode = function () {
  24082. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0;
  24083. return !1;
  24084. }),
  24085. (n.prototype.isOutsideMode = function (e) {
  24086. return (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN;
  24087. }),
  24088. (n.prototype.is360View = function (e, t) {
  24089. return e === u.PANORAMA && t && !t.isAligned();
  24090. }),
  24091. (n.prototype.setScene = function (e) {
  24092. (this.sceneIntersectionPlane = e.plane),
  24093. this.path.setScene(e),
  24094. this.moveReticuleToScene(e);
  24095. }),
  24096. (n.prototype.moveReticuleToScene = function (e) {
  24097. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  24098. e.add(this.reticule);
  24099. }),
  24100. (n.prototype.updateModel = function () {
  24101. function e(e, t, n) {
  24102. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y);
  24103. }
  24104. function t(e, t) {
  24105. if (this.mode === u.DOLLHOUSE) {
  24106. var n = e ? this.model.center.y : (n = t.center.y);
  24107. i.call(this, n);
  24108. }
  24109. }
  24110. function i(e) {
  24111. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  24112. i = this.cameraControls.controls[u.DOLLHOUSE],
  24113. n = t.position.y + (e - i.target.y),
  24114. r = f.showFloorDuration + f.showFloorDelay;
  24115. y.start(
  24116. v.property(i.target, 'y', e),
  24117. r,
  24118. null,
  24119. f.flydown.movementDelay,
  24120. A[f.flydown.movementEasing],
  24121. null,
  24122. V.FlyToViewFloor
  24123. ),
  24124. y.start(
  24125. v.property(t.position, 'y', n),
  24126. r,
  24127. null,
  24128. f.flydown.movementDelay,
  24129. A[f.flydown.movementEasing],
  24130. null,
  24131. V.FlyToViewFloor
  24132. );
  24133. }
  24134. (this.model = this.modelManager.getActiveModel()),
  24135. this.model.on('floor.changed', e.bind(this)),
  24136. this.model.on('allfloors.toggled', t.bind(this)),
  24137. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  24138. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  24139. var e2 = this;
  24140. this.model.panos.list.forEach(function (a) {
  24141. a.vrMarker.addEventListener('click', function () {
  24142. e2.flyToPano({
  24143. pano: a,
  24144. });
  24145. });
  24146. });
  24147. /********************************************************************************************************************************************/
  24148. this.model.addHighMapCube(); //add
  24149. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model));
  24150. }),
  24151. (n.prototype.updateModelDependentData = function () {
  24152. this.cameraControls.setModelForControls(this.model),
  24153. this.getPanoMarkersFromModel(this.model);
  24154. }),
  24155. (n.prototype.onModelChanged = function () {
  24156. this.updateModel(), this.updateModelDependentData();
  24157. }),
  24158. (n.prototype.getPanoMarkersFromModel = function (e) {
  24159. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  24160. return t.marker ? e.concat(t.marker) : e;
  24161. }, []);
  24162. }),
  24163. (n.prototype.handleControlMove = function (e) {
  24164. this.emit(w.Move, e);
  24165. }),
  24166. (n.prototype.handleControlInputStart = function (e) {
  24167. this.emit(w.InputStart, e);
  24168. }),
  24169. (n.prototype.onModeUpdated = function (e, t) {
  24170. this.cameraControls.activateControls(t), this.emit(w.ModeChanged, e, t);
  24171. }),
  24172. (n.prototype.isWarping = function () {
  24173. //是否导览缓慢走向某个点
  24174. return this.path.warping;
  24175. }),
  24176. (n.prototype.isWaitingToWarp = function () {
  24177. return this.path.waitingToWarp;
  24178. }),
  24179. (n.prototype.getLabelScaleFactor = function () {
  24180. if (this.isOutsideMode()) {
  24181. var e = 10,
  24182. t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  24183. return t;
  24184. }
  24185. return 0.5;
  24186. }),
  24187. /* n.prototype.changeMusic = function() {//xzw add
  24188. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  24189. } */
  24190. (n.prototype.bindEvents = function (e) {
  24191. e !== document && e.setAttribute('tabindex', -1),
  24192. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  24193. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  24194. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  24195. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  24196. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  24197. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  24198. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  24199. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  24200. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  24201. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  24202. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  24203. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  24204. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  24205. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  24206. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  24207. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  24208. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  24209. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  24210. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  24211. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)), //xzw add
  24212. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  24213. // lzb
  24214. window.getSeft && getSeft(this);
  24215. }),
  24216. (n.prototype.onMouseDown = function (e) {
  24217. e.currentTarget !== document && e.currentTarget.focus(),
  24218. 0 === e.button &&
  24219. (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  24220. this.updateIntersect());
  24221. }),
  24222. (n.prototype.onMouseMove = function (e) {
  24223. (this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1);
  24224. }),
  24225. (n.prototype.onMouseOver = function (e) {
  24226. (this.containsMouse = !0),
  24227. !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1);
  24228. }),
  24229. (n.prototype.onMouseOut = function (e) {
  24230. this.containsMouse = !1;
  24231. }),
  24232. (n.prototype.onMouseUp = function (e) {
  24233. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  24234. }),
  24235. (n.prototype.onTouchStart = function (e) {
  24236. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  24237. this.couldBeLongTap = !0;
  24238. var t = g.average(e.changedTouches, 'clientX'),
  24239. i = g.average(e.changedTouches, 'clientY');
  24240. this.handleInputStart.call(this, t, i, !0),
  24241. (this.mouseDownTimer = setTimeout(
  24242. function () {
  24243. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0);
  24244. }.bind(this),
  24245. f.input.longTapThreshold
  24246. ));
  24247. }
  24248. }),
  24249. (n.prototype.onTouchMove = function (e) {
  24250. var t = g.average(e.changedTouches, 'clientX'),
  24251. i = g.average(e.changedTouches, 'clientY');
  24252. this.handleInputMove.call(this, t, i, !0);
  24253. }),
  24254. (n.prototype.onTouchEnd = function (e) {
  24255. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  24256. (this.couldBeLongTap = !1), this.updateIntersect();
  24257. var t = g.average(e.changedTouches, 'clientX'),
  24258. i = g.average(e.changedTouches, 'clientY');
  24259. this.handleInputEnd.call(this, t, i, !0);
  24260. }
  24261. //add
  24262. if (this.intersectHot) this.intersectHot.setHoverState(false);
  24263. this.intersectHot = null;
  24264. Hot.mobileAutoPlay(this);
  24265. }),
  24266. (n.prototype.onPointerDown = function (e) {
  24267. return (
  24268. e.currentTarget !== document && e.currentTarget.focus(),
  24269. this.mouseDown || 'mouse' === e.pointerType
  24270. ? this.onMouseDown(e)
  24271. : ((this.couldBeLongTap = !0),
  24272. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  24273. void (this.mouseDownTimer = setTimeout(
  24274. function () {
  24275. this.updateIntersect(),
  24276. this.handleInputEnd.call(this, e.clientX, e.clientY, !0);
  24277. }.bind(this),
  24278. f.input.longTapThreshold
  24279. )))
  24280. );
  24281. }),
  24282. (n.prototype.onPointerMove = function (e) {
  24283. 'mouse' !== e.pointerType
  24284. ? this.handleInputMove.call(this, e.clientX, e.clientY, !0)
  24285. : this.onMouseMove(e);
  24286. }),
  24287. (n.prototype.onPointerUp = function (e) {
  24288. return this.mouseDown && 'mouse' !== e.pointerType
  24289. ? (clearTimeout(this.mouseDownTimer),
  24290. (this.couldBeLongTap = !1),
  24291. this.updateIntersect(),
  24292. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  24293. : this.onMouseUp(e);
  24294. }),
  24295. (n.prototype.onPointerOut = function (e) {
  24296. this.mouseDown = !1;
  24297. }),
  24298. (n.prototype.onPointerCancel = function (e) {
  24299. this.mouseDown = !1;
  24300. }),
  24301. (n.prototype.onKeyDown = function (e) {
  24302. var t = function () {
  24303. this.cameraControls.activeControl &&
  24304. this.cameraControls.activeControl.emit(_.Move, 'key');
  24305. }.bind(this),
  24306. i = e.which;
  24307. switch (i) {
  24308. case p.F:
  24309. t(), this.changeFloor(-1);
  24310. break;
  24311. case p.R:
  24312. t(), this.changeFloor(1);
  24313. }
  24314. if (this.mode === u.PANORAMA)
  24315. switch (i) {
  24316. case p.UPARROW:
  24317. case p.W:
  24318. this.flyLocalDirection(d.FORWARD.clone());
  24319. break;
  24320. case p.DOWNARROW:
  24321. case p.S:
  24322. this.flyLocalDirection(d.BACK.clone());
  24323. break;
  24324. case p.A:
  24325. this.flyLocalDirection(d.LEFT.clone());
  24326. break;
  24327. case p.D:
  24328. this.flyLocalDirection(d.RIGHT.clone());
  24329. }
  24330. }),
  24331. (n.prototype.handleScrollPinchZoom = (function () {
  24332. return function (e) {
  24333. var t = e,
  24334. i = this.zoomLevel;
  24335. this.zoomBy(t),
  24336. this.currentPano &&
  24337. this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id);
  24338. };
  24339. })()),
  24340. (n.prototype.handleControlPinch = function (e) {
  24341. f.zoom.enabled
  24342. ? this.handleScrollPinchZoom(1 - e)
  24343. : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize());
  24344. }),
  24345. (n.prototype.handleControlScroll = function (e) {
  24346. f.zoom.enabled
  24347. ? (e > 0 ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed),
  24348. 0 !== e && this.handleScrollPinchZoom(e))
  24349. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize());
  24350. }),
  24351. (n.prototype.handleInputStart = function (e, t, i) {
  24352. //许钟文加
  24353. var pad = this.handelPadding(e, t);
  24354. e = pad.x;
  24355. t = pad.y;
  24356. (this.isTouchEvent = i),
  24357. m.convertScreenPositionToNDC(e, t, this.mouse),
  24358. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  24359. (this.mouseCouldBeClickToMove = !0),
  24360. (this.mouseDown = !0);
  24361. Hot.mobileAutoPlay(this);
  24362. }),
  24363. (n.prototype.handelPadding = function (x, y) {
  24364. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  24365. if (!this.pad)
  24366. this.pad = {
  24367. x: dom.getOffset('left', $('#player')[0]),
  24368. y: dom.getOffset('top', $('#player')[0]),
  24369. };
  24370. return {
  24371. x: x - this.pad.x,
  24372. y: y - this.pad.y,
  24373. };
  24374. });
  24375. (n.prototype.handleInputMove = function (e, t, i) {
  24376. //许钟文加
  24377. var pad = this.handelPadding(e, t);
  24378. e = pad.x;
  24379. t = pad.y;
  24380. (this.isTouchEvent = i),
  24381. m.convertScreenPositionToNDC(e, t, this.mouse),
  24382. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC &&
  24383. ((this.mouseCouldBeClickToMove = !1),
  24384. (this.couldBeLongTap = !1),
  24385. clearTimeout(this.mouseDownTimer)),
  24386. (this.mouseLastMoveTime = Date.now()),
  24387. this.reticule.move(e, t, i);
  24388. }),
  24389. (n.prototype.handleInputEnd = function (e, t, i) {
  24390. //xzw
  24391. if (
  24392. ((this.isTouchEvent = i),
  24393. (this.mouseDown = !1),
  24394. this.cameraControls.controls[u.PANORAMA].emit('interaction.direct'),
  24395. !i && this.couldBeLongTap)
  24396. )
  24397. return !0;
  24398. if (this.handleLongTap()) return !0;
  24399. if (this.mouseCouldBeClickToMove) {
  24400. if (this.flying)
  24401. return (
  24402. this.path.activeTransType === x.WALK &&
  24403. this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  24404. !0
  24405. );
  24406. //add----
  24407. if (this.checkHotClick())
  24408. //add
  24409. return !0;
  24410. if (this.hoveringPlane) {
  24411. this.clickOverlay(this.hoveringPlane);
  24412. return;
  24413. }
  24414. if (
  24415. (this.cameraControls.activeControl &&
  24416. this.cameraControls.activeControl.emit(
  24417. _.Move,
  24418. this.isTouchEvent ? 'touch' : 'mouse'
  24419. ),
  24420. this.history.invalidate(),
  24421. this.intersect)
  24422. )
  24423. return this.flyToPanoClosestToMouse();
  24424. if (this.mode === u.PANORAMA) {
  24425. var n = this.closestPanoInDirection(this.getMouseDirection());
  24426. return n
  24427. ? this.flyToPano({
  24428. pano: n,
  24429. })
  24430. : this.bump(this.getMouseDirection());
  24431. }
  24432. }
  24433. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode);
  24434. }),
  24435. (n.prototype.handleLongTap = function () {
  24436. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  24437. return (
  24438. this.cameraControls.activeControl &&
  24439. this.cameraControls.activeControl.emit(_.LongTap, 'touch'),
  24440. !0
  24441. );
  24442. }),
  24443. (n.prototype.checktagClick = function () {
  24444. if (this.tagManager.intersectTag) {
  24445. var e = this.isTouchEvent,
  24446. t = this.tagManager.clickedOnTag(e, this);
  24447. return e || t || y.cancelById(V.LookTransition), !0;
  24448. }
  24449. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1;
  24450. }),
  24451. (n.prototype.rankedtagInDirection = function (e, t) {
  24452. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t);
  24453. }),
  24454. (n.prototype.start = function (e) {
  24455. //-------------------
  24456. //-------------------
  24457. var t = e.mode,
  24458. i = e.pano,
  24459. n = e.position,
  24460. rr = e.quaternion,
  24461. o = e.tag,
  24462. a = e.quickstart,
  24463. s = $.Deferred();
  24464. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews();
  24465. var l = this.is360View(t, i);
  24466. return (
  24467. !this.model.outsideAllowed() || l || a
  24468. ? this.startInside(i, n, rr, o, s)
  24469. : this.startOutside(e, s),
  24470. s.done(
  24471. function (e) {
  24472. this.emit(w.Ready, l, e, o);
  24473. }.bind(this)
  24474. ),
  24475. s.promise()
  24476. );
  24477. }),
  24478. (n.prototype.startOutside = function (e, t) {
  24479. var i = e.mode,
  24480. n = e.pano,
  24481. r = e.position,
  24482. o = e.quaternion,
  24483. a = e.zoom,
  24484. s = e.floorVisibility,
  24485. l = e.tag;
  24486. this.emit(w.StartOutside, f[i].transitionTime),
  24487. this.isOutsideMode(i)
  24488. ? (this.model.warpDestFloors(s, !0),
  24489. y.cancelById(V.FlyToViewFloor),
  24490. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  24491. t.resolve(!1))
  24492. : this.startInsideWithFlyin(n, r, o, l, t);
  24493. }),
  24494. (n.prototype.startInside = function (e, t, i, n, r) {
  24495. (r = r || $.Deferred()), (this.currentPano = e);
  24496. window.bus.dispatchEvent({ type: 'playerAndModelReady' });
  24497. this.ready = true;
  24498. var o = e && !e.isAligned();
  24499. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  24500. var a = this.startInside.bind(this, e, t, i, n, r);
  24501. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return;
  24502. }
  24503. //add
  24504. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 });
  24505. //this.updateHotVisible()
  24506. Hot.updateVisibles([this.currentPano]);
  24507. this.modeTran = 'panorama-panorama';
  24508. return (
  24509. (this.mode = u.PANORAMA),
  24510. e.floor.enter(this.mode),
  24511. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  24512. this.switchCameraMode(this.mode, i),
  24513. this.emit(w.StartInside, o),
  24514. r.resolve(!0),
  24515. r
  24516. );
  24517. }),
  24518. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  24519. if (((r = r || $.Deferred()), this.dollhouseMode(), !e))
  24520. return (
  24521. F.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'),
  24522. r.resolve(!1),
  24523. r
  24524. );
  24525. t = t || e.position;
  24526. var o = i || this.cameraControls.activeControl.camera.quaternion,
  24527. a = e.position;
  24528. return (
  24529. this.fitDollhouse(a, t, o),
  24530. setTimeout(
  24531. function (t) {
  24532. this.cameraControls.activeControl &&
  24533. (this.cameraControls.activeControl.maxDistance = t);
  24534. var n = {
  24535. mode: u.PANORAMA,
  24536. pano: e,
  24537. quaternion: i,
  24538. callback: function () {
  24539. this.emit(w.FlyinFinished), r.resolve(!0);
  24540. }.bind(this),
  24541. };
  24542. this.flyToNewMode(n);
  24543. }.bind(this, this.cameraControls.activeControl.maxDistance),
  24544. f.startupFlyinDelay
  24545. ),
  24546. r
  24547. );
  24548. }),
  24549. (n.prototype.checkAndWaitForPanoLoad = (function () {
  24550. var e = {},
  24551. t = {},
  24552. i = 5e3,
  24553. n = function () {
  24554. for (var n in e)
  24555. if (e.hasOwnProperty(n) && e[n]) {
  24556. var r = performance.now() - t[n];
  24557. if (r < i) return !0;
  24558. }
  24559. return !1;
  24560. };
  24561. return function (r, o, a, s, l, c, h, u, d, p) {
  24562. if (n()) return !0;
  24563. var f = function (t, i, n) {
  24564. N.delayOneFrame(
  24565. function () {
  24566. (e[t] = !1), l && l(i, n);
  24567. }.bind(this)
  24568. );
  24569. }.bind(this, r.id),
  24570. g = function (t, i) {
  24571. N.delayOneFrame(
  24572. function () {
  24573. (e[t] = !1), c && c(i);
  24574. }.bind(this)
  24575. );
  24576. }.bind(this, r.id);
  24577. try {
  24578. return (
  24579. (null !== u && void 0 !== u) || (u = !0),
  24580. this.model.supportsTiles
  24581. ? (e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p))
  24582. : (e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u)),
  24583. e[r.id] && (t[r.id] = performance.now()),
  24584. e[r.id]
  24585. );
  24586. } catch (n) {
  24587. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n);
  24588. }
  24589. };
  24590. })()),
  24591. (n.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  24592. if (!e)
  24593. throw new M(
  24594. 'Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.'
  24595. );
  24596. return (
  24597. r &&
  24598. this.model.waitForLoad(e, function () {
  24599. return e.isLoaded(i);
  24600. }),
  24601. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  24602. );
  24603. }),
  24604. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  24605. var e = new r.Vector3();
  24606. return function (t, i, n, r, o, a, s, l) {
  24607. if (!t)
  24608. throw new M(
  24609. 'Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.'
  24610. );
  24611. return (
  24612. e.copy(d.FORWARD),
  24613. this.getDirection(e),
  24614. !t.isLoaded(i) &&
  24615. (a &&
  24616. this.model.waitForLoad(t, function () {
  24617. return t.isLoaded(i);
  24618. }),
  24619. t
  24620. .loadTiledPano(i, e, null, s, l)
  24621. .done(
  24622. function (e, t) {
  24623. n && n(e, t);
  24624. }.bind(this)
  24625. )
  24626. .fail(
  24627. function (e) {
  24628. r && r(e);
  24629. }.bind(this)
  24630. )
  24631. .progress(
  24632. function (e, t, i) {
  24633. o && o(e, t, i);
  24634. }.bind(this)
  24635. ),
  24636. !0)
  24637. );
  24638. };
  24639. })()),
  24640. (n.prototype.switchCameraMode = function (e, t) {
  24641. var i = this.cameraControls.controls[e],
  24642. n = i.camera;
  24643. switch (e) {
  24644. case u.PANORAMA:
  24645. n.position.copy(this.currentPano.position);
  24646. var o = t
  24647. ? d.FORWARD.clone().applyQuaternion(t)
  24648. : this.getDirection().setY(0).normalize();
  24649. i.lookAt(o.add(n.position));
  24650. break;
  24651. case u.DOLLHOUSE:
  24652. /* var a = this.position.clone();
  24653. 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),
  24654. n.position.copy(a),
  24655. i.target.copy(this.target.clone().setY(this.model.center.y));
  24656. break; */
  24657. //for多楼层 且 让模型刚好适应屏幕
  24658. var box = this.model.boundingBox.clone();
  24659. box.applyMatrix4(this.camera.matrixWorld); //将 boundingbox、也就是模型, 转换到当前相机朝向
  24660. var boxSize = box.size(); //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  24661. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  24662. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2)); //根据上面获得的参数得到target到相机的距离
  24663. //console.log(boxSize.x,distance, boxSize.length() / 2)
  24664. distance += boxSize.length() / 2; //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  24665. if (this.mode === u.PANORAMA) {
  24666. i.target.copy(this.model.center);
  24667. var vec = this.getDirection().negate().setY(1).normalize(); //获得朝向
  24668. } else {
  24669. i.target.copy(this.target.clone().setY(this.model.center.y));
  24670. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize();
  24671. }
  24672. vec.multiplyScalar(distance);
  24673. n.position.copy(i.target.clone().add(vec));
  24674. break;
  24675. case u.FLOORPLAN:
  24676. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  24677. i.target.copy(this.model.center).setY(0),
  24678. i.zoomToContain(this.model.size),
  24679. i.rotateToView(this.model.size, this.getDirection());
  24680. }
  24681. i.update(0);
  24682. }),
  24683. (n.prototype.update = (function () {
  24684. var e = (new r.Vector3(), {}),
  24685. t = [];
  24686. return function (i) {
  24687. this.updatePersistentZooming(i),
  24688. this.updateFromControls(i),
  24689. this.getCurrentNodePanos(t);
  24690. if (this.hasChanged(e)) {
  24691. (this.lastChangeTime = Date.now()),
  24692. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  24693. this.emit(w.ViewChanged, e),
  24694. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point);
  24695. }
  24696. if (e.cameraChanged2) {
  24697. //变化要更大些
  24698. }
  24699. if (e.cameraChanged) {
  24700. this.mode == 'panorama' &&
  24701. window.cad &&
  24702. cad.setSign(
  24703. { x: this.position.x, y: this.position.z },
  24704. this.cameraControls.controls.panorama.lon
  24705. );
  24706. /* for(var i in this.model.hots){
  24707. this.model.hots[i].updateTitle(this)
  24708. } */
  24709. Hot.updateHots();
  24710. }
  24711. this.model.supportsTiles &&
  24712. (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  24713. this.updatePreRendering(t),
  24714. this.reticule.update(),
  24715. this.path.update(),
  24716. this.spider.update(),
  24717. this.cachedPanoCandidates &&
  24718. f.navigation.panoScores &&
  24719. this.model.panos.showPanoScores(this.cachedPanoCandidates),
  24720. this.updateControlLocks(),
  24721. this.model.supportsTiles && this.updateZoomPano();
  24722. };
  24723. })()),
  24724. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  24725. var lastMode, lastPano;
  24726. return function(){
  24727. var mode = this.mode;
  24728. var pano = mode == "panorama" ? this.currentPano : "";
  24729. if(mode != "panorama" || pano != lastPano){
  24730. overlay.noBlock = null
  24731. }
  24732. this.overlayGroup.children.forEach((overlay)=>{
  24733. if(overlay.overlayType == "video" ){
  24734. var matrix = overlay.plane.matrixWorld;
  24735. var inSight = false;
  24736. var cameraDir = this.getDirection();
  24737. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  24738. var vertexes = []
  24739. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  24740. for(let i=0; i<4; i++){
  24741. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  24742. vertexes.push(vertex)
  24743. if(overlay.noBlock == null){
  24744. if(!m.ifShelter(vertex)){
  24745. overlay.noBlock = true
  24746. }
  24747. inSight = true; break;
  24748. }else{
  24749. overlay.noBlock = true
  24750. }
  24751. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  24752. inSight = true; break;
  24753. }
  24754. }
  24755. }
  24756. overlay.inSight = inSight
  24757. if(!inSight)overlay.plane.material.map.image.pause()
  24758. else overlay.plane.material.map.image.play()//maybe fail
  24759. }
  24760. })
  24761. lastMode = mode, lastPano = pano
  24762. }
  24763. }() */
  24764. (n.prototype.updatePersistentZooming = function (e) {
  24765. 1 === this.zooming
  24766. ? this.zoomBy(1 + this.zoomSpeed * e)
  24767. : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e);
  24768. }),
  24769. (n.prototype.updateControlLocks = function () {
  24770. this.currentPano &&
  24771. this.model.supportsTiles &&
  24772. (this.cameraControls.controls[u.PANORAMA].locked =
  24773. !this.currentPano.highestFullTileRenderOpCompleted &&
  24774. this.currentPano.lockUntilRenderingComplete);
  24775. }),
  24776. (n.prototype.updatePanoRenderer = (function () {
  24777. var e = new r.Vector3();
  24778. return function (t) {
  24779. var i = this.nextPano || this.currentPano;
  24780. this.panoRenderer.hasQueuedTiles() &&
  24781. i &&
  24782. (e.copy(d.FORWARD), this.getDirection(e), this.panoRenderer.updateDirection(e));
  24783. };
  24784. })()),
  24785. (n.prototype.cleanupInactivePanos = (function () {
  24786. var e = [],
  24787. t = [];
  24788. return function () {
  24789. (e.length = 0),
  24790. e.push(this.currentPano),
  24791. this.nextPano && e.push(this.nextPano),
  24792. (t.length = 0);
  24793. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  24794. t.push(this.panoRenderer.activePanos[i]);
  24795. for (var n = 0; n < t.length; n++) {
  24796. for (var r = t[n], o = !0, a = 0; a < e.length; a++) r.id === e[a].id && (o = !1);
  24797. o && r.exit();
  24798. }
  24799. };
  24800. })()),
  24801. (n.prototype.updatePreRendering = (function () {
  24802. var e = {};
  24803. return function (t) {
  24804. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  24805. var i = this.nextPano || this.currentPano;
  24806. if (i && t && t.length > 1) {
  24807. var n = t.findIndex(function (e) {
  24808. if (e.id === i.id) return !0;
  24809. });
  24810. if (n >= 0 && n + 1 < t.length) {
  24811. var r = t[n + 1];
  24812. r.isLoaded(this.basePanoSize) ||
  24813. e[r.id] ||
  24814. (window.setTimeout(
  24815. function (t) {
  24816. this.checkAndWaitForPanoLoad(
  24817. t,
  24818. 'high',
  24819. 'low',
  24820. this.basePanoSize,
  24821. null,
  24822. null,
  24823. null,
  24824. !1,
  24825. !1,
  24826. !1
  24827. ),
  24828. window.setTimeout(
  24829. function (t) {
  24830. e[t.id] = !1;
  24831. }.bind(this, t),
  24832. f.tiling.panoPreRenderRepeatDelay
  24833. );
  24834. }.bind(this, r),
  24835. f.tiling.panoPreRenderDelay
  24836. ),
  24837. (e[r.id] = !0));
  24838. }
  24839. }
  24840. }
  24841. };
  24842. })()),
  24843. (n.prototype.enablePreRendering = function () {
  24844. this.preRenderingEnabled = !0;
  24845. }),
  24846. (n.prototype.disablePreRendering = function () {
  24847. (this.preRenderingEnabled = !1), this.cleanupInactivePanos();
  24848. }),
  24849. (n.prototype.updateTileDownloader = (function () {
  24850. var e = new r.Vector3();
  24851. return function (t) {
  24852. var i = this.nextPano || this.currentPano;
  24853. i &&
  24854. (e.copy(d.FORWARD),
  24855. this.getDirection(e),
  24856. this.tileDownloader.tilePrioritizer.updateCriteria(
  24857. i,
  24858. this.position,
  24859. e,
  24860. t.length > 0 ? t : null
  24861. ),
  24862. (this.tileDownloader.processPriorityQueue = !0));
  24863. };
  24864. })()),
  24865. (n.prototype.updateFromControls = function (e) {
  24866. (null !== e && void 0 !== e) || (e = 0),
  24867. this.cameraControls.activeControl &&
  24868. (this.cameraControls.activeControl.update(e),
  24869. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  24870. this.position.copy(this.cameraControls.activeControl.camera.position),
  24871. this.target.copy(this.cameraControls.activeControl.target),
  24872. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  24873. this.camera.projectionMatrix.copy(
  24874. this.cameraControls.activeControl.camera.projectionMatrix
  24875. )),
  24876. this.camera.position.copy(this.position),
  24877. this.camera.quaternion.copy(this.quaternion),
  24878. this.camera.updateMatrix(),
  24879. this.camera.updateMatrixWorld();
  24880. }),
  24881. (n.prototype.hasChanged = function (e) {
  24882. /* if (!this.previousState)
  24883. return this.previousState = {
  24884. allFloorsVisible: this.model.allFloorsVisible,
  24885. position: this.position.clone(),
  24886. quaternion: this.quaternion.clone(),
  24887. mouse: this.mouse.clone(),
  24888. labelScaleFactor: this.getLabelScaleFactor(),
  24889. currentFloor: this.model.currentFloor,
  24890. projectionMatrix: this.camera.projectionMatrix.clone(),
  24891. worldMatrix: this.camera.matrixWorld.clone(),
  24892. mode: this.mode,
  24893. modelPosition: this.model.position.clone(),
  24894. modelCenter: this.model.center.clone(),
  24895. zoomLevel: this.zoomLevel
  24896. },
  24897. !0;
  24898. var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  24899. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  24900. e.moved = !this.position.equals(this.previousState.position),
  24901. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  24902. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  24903. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  24904. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  24905. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  24906. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  24907. e.modeChanged = this.mode !== this.previousState.mode,
  24908. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  24909. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  24910. e.nextPanoActive = null !== this.nextPano,
  24911. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  24912. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  24913. this.previousState.position.copy(this.position),
  24914. this.previousState.quaternion.copy(this.quaternion),
  24915. this.previousState.mouse.copy(this.mouse),
  24916. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  24917. this.previousState.currentFloor = this.model.currentFloor,
  24918. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  24919. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  24920. this.previousState.mode = this.mode,
  24921. this.previousState.modelPosition.copy(this.model.position),
  24922. this.previousState.modelCenter.copy(this.model.center),
  24923. this.previousState.zoomLevel = this.zoomLevel,
  24924. !t */
  24925. if (!this.previousState) {
  24926. this.previousState = {
  24927. allFloorsVisible: this.model.allFloorsVisible,
  24928. position: this.position.clone(),
  24929. quaternion: this.quaternion.clone(),
  24930. mouse: this.mouse.clone(),
  24931. //labelScaleFactor: this.getLabelScaleFactor(),
  24932. currentFloor: this.model.currentFloor,
  24933. projectionMatrix: this.camera.projectionMatrix.clone(),
  24934. worldMatrix: this.camera.matrixWorld.clone(),
  24935. mode: this.mode,
  24936. modelPosition: this.model.position.clone(),
  24937. modelCenter: this.model.center.clone(),
  24938. zoomLevel: this.zoomLevel,
  24939. };
  24940. e.cameraChanged = e.cameraChanged2 = true;
  24941. return !0;
  24942. }
  24943. //许钟文改 分成相机是否改变cameraChanged 和其他
  24944. var a =
  24945. this.position.equals(this.previousState.position) &&
  24946. this.quaternion.equals(this.previousState.quaternion) &&
  24947. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  24948. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  24949. this.mode === this.previousState.mode &&
  24950. this.zoomLevel === this.previousState.zoomLevel &&
  24951. this.model.center.equals(this.previousState.modelCenter) &&
  24952. this.model.position.equals(this.previousState.modelPosition);
  24953. var t =
  24954. a &&
  24955. this.mouse.equals(this.previousState.mouse) &&
  24956. this.model.allFloorsVisible ===
  24957. this.previousState
  24958. .allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  24959. this.model.currentFloor === this.previousState.currentFloor &&
  24960. null === this.nextPano;
  24961. e.cameraChanged = !a;
  24962. if (e.cameraChanged) {
  24963. //
  24964. e.cameraChanged2 =
  24965. !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) ||
  24966. !MathLight.closeTo(this.position, this.previousState.position, 4) ||
  24967. !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix);
  24968. } else e.cameraChanged2 = false;
  24969. (e.allFloorsVisible =
  24970. this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  24971. (e.moved = !this.position.equals(this.previousState.position)),
  24972. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  24973. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  24974. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  24975. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  24976. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(
  24977. this.previousState.projectionMatrix
  24978. )),
  24979. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(
  24980. this.previousState.worldMatrix
  24981. )),
  24982. (e.modeChanged = this.mode !== this.previousState.mode),
  24983. (e.modelPositionChanged = !this.model.position.equals(
  24984. this.previousState.modelPosition
  24985. )),
  24986. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  24987. (e.nextPanoActive = null !== this.nextPano),
  24988. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel),
  24989. (this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  24990. this.previousState.position.copy(this.position),
  24991. this.previousState.quaternion.copy(this.quaternion),
  24992. this.previousState.mouse.copy(this.mouse),
  24993. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  24994. (this.previousState.currentFloor = this.model.currentFloor),
  24995. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  24996. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  24997. (this.previousState.mode = this.mode),
  24998. this.previousState.modelPosition.copy(this.model.position),
  24999. this.previousState.modelCenter.copy(this.model.center),
  25000. (this.previousState.zoomLevel = this.zoomLevel);
  25001. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  25002. return !t;
  25003. }),
  25004. (n.prototype.updateIntersect = function () {
  25005. var e = this.flying || this.isWarping(),
  25006. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  25007. i = y.getById(V.LookTransition),
  25008. n = !(e || t || this.isTouchEvent || (i.length && i[0].running));
  25009. {
  25010. //clear:
  25011. if (this.intersectHot) this.intersectHot.setHoverState(false);
  25012. this.intersectHot = null;
  25013. $('#player').css('cursor', '');
  25014. }
  25015. var deal = () => {
  25016. if (this.intersect && this.intersect.object.visible) {
  25017. if ('hotSprite' == this.intersect.object.type) {
  25018. this.intersectHot = this.intersect.object;
  25019. while (!(this.intersectHot instanceof Hot)) {
  25020. this.intersectHot = this.intersectHot.parent;
  25021. }
  25022. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass(
  25023. 'active'
  25024. );
  25025. this.intersectHot.setHoverState(true);
  25026. }
  25027. }
  25028. };
  25029. if (this.model.hotGroup) {
  25030. var hots = this.model.hotGroup.children.filter(
  25031. (e) =>
  25032. e.info.actionType.examine ||
  25033. e.info.actionType.fastTran ||
  25034. e.info.actionType.openHot ||
  25035. e.info.actionType.playAndPause
  25036. );
  25037. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  25038. if (this.intersect) {
  25039. deal();
  25040. this.intersectHot && $('#player').css('cursor', 'pointer');
  25041. }
  25042. }
  25043. (this.intersect = this.getMouseIntersect()),
  25044. this.intersect && this.updateClosestPano(this.intersect),
  25045. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  25046. ? (this.reticule.updatePosition(this.position, this.intersect),
  25047. f.navigation.panoScores &&
  25048. !f.navigation.mouseDirection &&
  25049. this.closestPanoInDirection(this.getDirection()))
  25050. : this.reticule.hide();
  25051. }),
  25052. (n.prototype.checkHotClick = function () {
  25053. if (this.intersectHot) {
  25054. if (
  25055. this.intersectHot.texType == 'video' &&
  25056. this.intersectHot.info.actionType.playAndPause
  25057. ) {
  25058. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser);
  25059. }
  25060. this.intersectHot.examine(this);
  25061. return true;
  25062. }
  25063. }),
  25064. (n.prototype.getMouseDirection = function (e) {
  25065. e = e || this.mouse;
  25066. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  25067. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera);
  25068. return i.sub(t).normalize();
  25069. }),
  25070. (n.prototype.hoverOverlay = function (mesh) {
  25071. if (!mesh) {
  25072. this.hoveringPlane = null;
  25073. $('#player').css('cursor', this.currentCursor || '');
  25074. } else {
  25075. var overlay = mesh.parent;
  25076. $('#player').css('cursor', 'pointer');
  25077. this.hoveringPlane = overlay;
  25078. return true;
  25079. }
  25080. }),
  25081. (n.prototype.clickOverlay = function (overlay) {
  25082. if (this.openOverlay && !overlay) return;
  25083. var plane = overlay.plane;
  25084. /* if(overlay.overlayType == "video"){
  25085. if(plane.material.map.image.paused) plane.material.map.image.play()
  25086. else plane.material.map.image.pause()
  25087. } */
  25088. if (overlay.overlayType == 'video') {
  25089. overlay.switchPlay(!!overlay.pausedByUser);
  25090. }
  25091. /* if(window.EditOverlay &&EditOverlay.editing){
  25092. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  25093. $('#overlayProp').removeClass('atRight').removeClass('hide')
  25094. EditOverlay.endAddPlane();
  25095. EditOverlay.updateOverlayPanel(overlay)
  25096. EditOverlay.controlSelectOverlay(overlay)
  25097. return;
  25098. } */
  25099. }),
  25100. (n.prototype.getMouseIntersect = function (e, t) {
  25101. //xzw change
  25102. (e = e || this.mouse.clone()),
  25103. (t =
  25104. t ||
  25105. this.model.floors.reduce(
  25106. function (e, t) {
  25107. return t.hidden ? e : e.concat(t.collider.children);
  25108. },
  25109. this.mode === u.PANORAMA ? this.panoMarkers : []
  25110. ));
  25111. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  25112. this.raycaster.set(i, this.getMouseDirection(e));
  25113. var n = this.raycaster.intersectObjects(t, true); //add true
  25114. var o = n[0];
  25115. if (o) {
  25116. o.face &&
  25117. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  25118. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  25119. this.currentPano
  25120. ? (o.onFloor = o.point.y < this.position.y - 0.5 * this.currentPano.height)
  25121. : (o.onFloor = o.point.y < this.position.y - 0.5),
  25122. (o.horizontal = 0.8 < o.normal.y));
  25123. return o;
  25124. }
  25125. }),
  25126. (n.prototype.updateClosestPano = function (e) {
  25127. var t = [s.filters.isPanoAligned()];
  25128. if (this.mode === u.PANORAMA) {
  25129. if (!this.currentPano) return;
  25130. t.push(s.filters.not(this.currentPano)),
  25131. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  25132. t.push(
  25133. s.filters.inFloorDirection(
  25134. this.currentPano.floorPosition,
  25135. this.getDirection(),
  25136. 0.25
  25137. )
  25138. ),
  25139. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  25140. t.push(s.filters.isNotBehindNormal(e.point, e.normal));
  25141. } else {
  25142. t.push(s.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor); //add
  25143. this.mode !== u.FLOORPLAN &&
  25144. t.push(s.filters.inDirection(this.position, this.getDirection(), 0.25));
  25145. }
  25146. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  25147. i !== this.closestPano
  25148. ? (i && (this.isPanoHover = !0),
  25149. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  25150. (this.closestPano = i))
  25151. : (this.isPanoHover = !1);
  25152. }),
  25153. (n.prototype.dollhouseMode = function (e, t) {
  25154. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  25155. (this.mode = u.DOLLHOUSE),
  25156. this.cameraControls.controls[u.DOLLHOUSE].reset();
  25157. var i = new r.Vector3(this.model.center.x, 0, this.model.center.z),
  25158. n = new r.Vector3(15, 10, 15);
  25159. if (e && t) {
  25160. var o = d.FORWARD.clone().applyQuaternion(t),
  25161. a = this.model.center.clone().sub(e),
  25162. s = a.dot(o);
  25163. s > 0
  25164. ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e))
  25165. : F.warn(
  25166. "Tried to initiate dollhouse mode that wasn't looking at the model",
  25167. e,
  25168. t
  25169. );
  25170. }
  25171. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  25172. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  25173. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  25174. this.updateFromControls(),
  25175. (this.model.alpha = 1),
  25176. (this.model.skybox.material.uniforms.opacity.value = 0);
  25177. }),
  25178. (n.prototype.insideMode = function (e, t) {
  25179. var i = $.Deferred(),
  25180. n = t || null;
  25181. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  25182. var r = [s.filters.isPanoAligned()];
  25183. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  25184. (e =
  25185. e ||
  25186. this.currentPano ||
  25187. this.model.panos.find(r, [
  25188. s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target),
  25189. ])),
  25190. this.flyToNewMode({
  25191. mode: u.PANORAMA,
  25192. pano: e,
  25193. callback: n,
  25194. })
  25195. .done(i.resolve.bind(i))
  25196. .fail(i.reject.bind(i));
  25197. } else {
  25198. var o =
  25199. this.mode === u.PANORAMA
  25200. ? 'Already in panorama mode'
  25201. : 'Cannot change mode during mode transition';
  25202. i.reject(o);
  25203. }
  25204. return i.promise();
  25205. }),
  25206. (n.prototype.fitDollhouse = function (e, t, i) {
  25207. //许钟文改 飞入前寻找和初始视角最合适的位置
  25208. //if(urlHasValue('oldEntry')){
  25209. //搬自一代。
  25210. var maxY = this.model.boundingBox.max.y;
  25211. var n = d.FORWARD.clone().applyQuaternion(i),
  25212. i = n.clone().add(e);
  25213. this.cameraControls.activeControl.target.copy(i),
  25214. this.cameraControls.activeControl.camera.position
  25215. .set(0, maxY * 2.4, 0)
  25216. .add(e)
  25217. .add(n.multiplyScalar(-10));
  25218. //return;
  25219. /* //this.camera.position.copy(this.model.center);
  25220. //this.camera.updateMatrixWorld()
  25221. this.switchCameraMode("dollhouse", i) */
  25222. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  25223. //直接用一代的这个 效果和二代几乎一样,且不会甩
  25224. /* var n = d.FORWARD.clone().applyQuaternion(i);
  25225. this.cameraControls.activeControl.target.copy(n).add(e);
  25226. var o = d.RIGHT.clone().applyQuaternion(i)
  25227. , a = d.UP.clone()
  25228. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  25229. , l = this.model.boundingBox.max.clone()
  25230. , c = this.model.boundingBox.min.clone()
  25231. , 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)]
  25232. , u = 0
  25233. , p = 0
  25234. , g = 0;
  25235. h.forEach(function(e, t, i) {
  25236. var n = Math.abs(e.dot(o))
  25237. , r = e.dot(s);
  25238. n > u && (u = n,
  25239. p = r),
  25240. r > g && (g = r)
  25241. });
  25242. 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)))
  25243. , v = s.clone().multiplyScalar(p).add(t)
  25244. , A = s.clone().multiplyScalar(g).add(t);
  25245. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  25246. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  25247. p = Math.max(p, 10),
  25248. g = Math.max(g, 10);
  25249. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  25250. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  25251. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  25252. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  25253. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  25254. */
  25255. }),
  25256. (n.prototype.floorplanMode = function (e, t, i) {
  25257. this.mode = u.FLOORPLAN;
  25258. var n = this.cameraControls.controls[u.FLOORPLAN];
  25259. n.reset();
  25260. var r = e ? e : this.model.center;
  25261. if (
  25262. (n.target.copy(r).setY(0),
  25263. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  25264. i
  25265. ? ((n.currentScale = i / ($('#player').width() / $('#player').height())),
  25266. (n.absoluteScale = n.currentScale))
  25267. : n.zoomToContain(this.model.size),
  25268. t)
  25269. ) {
  25270. var o = d.LEFT.clone().applyQuaternion(t);
  25271. n.rotateLeft(-Math.atan2(o.x, o.z));
  25272. } else n.rotateToView(this.model.size, this.getDirection());
  25273. n.update(0);
  25274. }),
  25275. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  25276. return (e.skipWarpingCheck = !0), this.flyToPano(e, t);
  25277. }),
  25278. (n.prototype.updateMarkerVisi = function () {
  25279. //加
  25280. if (this.mode != 'panorama') return;
  25281. this.model.panos.list.forEach((pano) => {
  25282. if (!pano.marker) return;
  25283. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  25284. });
  25285. }),
  25286. /* n.prototype.updateHotVisible = function(pano){
  25287. var hots = this.model.hots;
  25288. pano = pano || this.currentPano;
  25289. for (var index in hots){
  25290. var visible;
  25291. if(this.mode != "panorama"){
  25292. visible = true;
  25293. }else{
  25294. //hots[index].mesh.material.depthTest = false;
  25295. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  25296. }
  25297. hots[index].mesh.visible = visible;
  25298. }
  25299. } */
  25300. (n.prototype.flyToPano = function (e, t) {
  25301. var i = e.pano,
  25302. aim = e.lookAtPoint,
  25303. aimQua = e.quaternion, //ADD
  25304. o = e.duration,
  25305. a = e.aimDuration,
  25306. s = e.maxDistanceOverride,
  25307. l = e.skipWarpingCheck,
  25308. c = e.constantMoveSpeed,
  25309. h = null,
  25310. p = null;
  25311. if (aim) {
  25312. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP);
  25313. aimQua = new r.Quaternion().setFromRotationMatrix(_);
  25314. } else aimQua = aimQua;
  25315. var zoomLevel = e.zoomLevel || 1; //add
  25316. if (this.flying) return t && t(e);
  25317. window.specialScene &&
  25318. specialScene.special().specifySpot &&
  25319. specialScene.special().specifySpot(i);
  25320. if (
  25321. this.isWarping() &&
  25322. !l &&
  25323. (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD)
  25324. )
  25325. return F.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1;
  25326. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  25327. var m;
  25328. void this.flyToNewMode({
  25329. mode: u.PANORAMA,
  25330. pano: i,
  25331. duration: o,
  25332. quaternion: aimQua,
  25333. callback: t,
  25334. });
  25335. }
  25336. if (
  25337. !i ||
  25338. ((h = g.deepExtend(e)),
  25339. (p = function () {
  25340. N.delayOneFrame(
  25341. function () {
  25342. this.flyToPano(h, t);
  25343. }.bind(this)
  25344. );
  25345. }.bind(this)),
  25346. !this.checkAndWaitForPanoLoad(i, 'high', 'low', this.basePanoSize, p))
  25347. ) {
  25348. var C = function (e) {
  25349. t && t(e);
  25350. }.bind(this);
  25351. this.currentPano ||
  25352. ((this.currentPano = i),
  25353. this.path.placeCpm(),
  25354. this.path.fadeOutCpm(f.path.fadeOutTime),
  25355. this.spider.draw());
  25356. var I = o;
  25357. if ('number' != typeof o) {
  25358. var E = s || f.transition.flytimeMaxDistanceThreshold;
  25359. I =
  25360. Math.min(this.currentPano.position.distanceTo(i.position), E) *
  25361. f.transition.flytimeDistanceMultiplier +
  25362. f.transition.flyTime;
  25363. }
  25364. if (
  25365. (f.transition.flySpeed > 0.01 &&
  25366. (I =
  25367. (1e3 * this.currentPano.position.distanceTo(i.position)) /
  25368. f.transition.flySpeed),
  25369. zoomLevel !== this.zoomLevel)
  25370. )
  25371. switch (f.zoom.transitionStyle) {
  25372. case 1:
  25373. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  25374. break;
  25375. case 2:
  25376. return (
  25377. (h = g.deepExtend(e)),
  25378. (p = this.flyToPano.bind(this, h, t)),
  25379. void this.smoothZoomFovTo(
  25380. null,
  25381. zoomLevel,
  25382. f.zoom.restoreTime * (this.zoomLevel - 1),
  25383. p
  25384. )
  25385. );
  25386. }
  25387. if (aimQua) {
  25388. y.cancelById(V.LookTransition), (I *= f.transition.aimSlowFactor);
  25389. var b = this.cameraControls.activeControl.camera.quaternion.clone(),
  25390. S = b.clone(),
  25391. M = new r.Vector3();
  25392. if (i === this.currentPano) {
  25393. var R = d.FORWARD.clone().applyQuaternion(b),
  25394. P = d.FORWARD.clone().applyQuaternion(aimQua),
  25395. O = R.angleTo(P);
  25396. return (
  25397. (void 0 !== a && null !== a) ||
  25398. (a = ((1 * Math.sqrt(O)) / f.tags.navigate.rotateSpeedFactor) * 1e3),
  25399. void y.start(
  25400. function (e) {
  25401. S.copy(b),
  25402. v.quaternion(S, aimQua)(e),
  25403. M.copy(d.FORWARD)
  25404. .applyQuaternion(S)
  25405. .add(this.cameraControls.activeControl.camera.position),
  25406. this.cameraControls.activeControl.lookAt(M);
  25407. }.bind(this),
  25408. a,
  25409. C,
  25410. 0,
  25411. A[f.transition.movementEasing],
  25412. null,
  25413. V.LookTransition
  25414. )
  25415. );
  25416. }
  25417. }
  25418. if (i === this.currentPano) return void C();
  25419. this.flying = !0;
  25420. var L = this.position.clone(),
  25421. D = this.currentPano;
  25422. F.debug('Flying to pano ', i.position),
  25423. this.emit(w.PanoChosen, this.currentPano, i),
  25424. this.emit(w.FlyingStarted, i.position, L, i, D);
  25425. //---------before fly--------------- add
  25426. //this.updateHotVisible(i); //更新热点显示
  25427. this.transitionPos({ type: 'beforeFlytopano', pano: i, dur: I }); //add
  25428. Hot.updateVisibles([this.currentPano, i]);
  25429. //地标变化
  25430. if (this.model.floorLogos) {
  25431. this.model.changefloorLogoOpa({ index: 0, opa: 0, dur: p, delay: 0.7 }); //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  25432. this.model.floorLogos[1].position.copy(
  25433. i.floorPosition.clone().sub(this.model.position)
  25434. );
  25435. //this.model.adjustfloorLogoHeight();
  25436. this.model.floorLogos[1].material.opacity = 0; //uniforms.opacity.value = 0;
  25437. this.model.floorLogos[1].visible = true;
  25438. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }); //this.model.floorLogoShow(1,250);
  25439. }
  25440. //=======================================
  25441. this.nextPano = i;
  25442. let beginTran = () => {
  25443. aimQua &&
  25444. y.start(
  25445. function (e) {
  25446. S.copy(b),
  25447. v.quaternion(S, aimQua)(e),
  25448. M.copy(d.FORWARD)
  25449. .applyQuaternion(S)
  25450. .add(this.cameraControls.activeControl.camera.position),
  25451. this.cameraControls.activeControl.lookAt(M);
  25452. }.bind(this),
  25453. I,
  25454. null,
  25455. 0,
  25456. A[f.transition.movementEasing],
  25457. null,
  25458. V.LookTransition
  25459. );
  25460. var B = c ? null : A[f.transition.movementEasing];
  25461. y.start(
  25462. v.uniform(this.model.skybox, 'progress', 1),
  25463. I,
  25464. null,
  25465. 0,
  25466. A[f.transition.blendEasing],
  25467. 'skyFly',
  25468. V.FlyToPano
  25469. ),
  25470. y.start(
  25471. v.allUniforms(this.model.chunks, 'progress', 1),
  25472. I,
  25473. null,
  25474. 0,
  25475. A[f.transition.blendEasing],
  25476. 'chunkFly',
  25477. V.FlyToPano
  25478. ),
  25479. y.start(
  25480. v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position),
  25481. I,
  25482. function (e) {
  25483. (this.flying = !1),
  25484. this.currentPano !== i && this.currentPano.exit(),
  25485. i.enter(),
  25486. (this.currentPano = i),
  25487. (this.nextPano = null),
  25488. this.path.placeCpm(),
  25489. this.path.fadeOutCpm(f.path.fadeOutTime),
  25490. this.spider.draw(),
  25491. this.emit(w.FlyingEnded, i.position, L, i, D),
  25492. this.updateMarkerVisi(), //add
  25493. C(e);
  25494. //add:
  25495. if (this.mode == 'panorama') {
  25496. if (this.model.floorLogos) {
  25497. this.model.floorLogos[0].position.copy(
  25498. this.model.floorLogos[1].position
  25499. );
  25500. //this.model.adjustfloorLogoHeight()
  25501. this.model.changefloorLogoOpa({ index: 0, opa: 1, dur: 0 }); //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  25502. this.model.floorLogos[1].visible = false;
  25503. }
  25504. this.model.fadePanoMarkers(); //add
  25505. Hot.updateVisibles([this.currentPano]); //add
  25506. }
  25507. }.bind(this),
  25508. 0,
  25509. B,
  25510. 'camFly',
  25511. V.FlyToPano
  25512. );
  25513. };
  25514. if (!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024) {
  25515. setTimeout(() => {
  25516. beginTran();
  25517. }, 16); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  25518. } else {
  25519. beginTran();
  25520. }
  25521. }
  25522. }),
  25523. (n.prototype.warpToPano = function (o = {}) {});
  25524. n.prototype.blackToPano = function (o = {}) {
  25525. //add 瞬间过渡
  25526. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  25527. if (this.flying || this.isWarping()) return;
  25528. let oldPos = this.position.clone();
  25529. let oldPano = this.currentPano;
  25530. let pano = o.pano || this.model.panos.index[o.panoId];
  25531. this.path.warpDestPano = pano;
  25532. var retry = () => {
  25533. (this.waitingToWarp = !1), this.blackToPano(o);
  25534. };
  25535. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry))
  25536. return void (this.waitingToWarp = !0);
  25537. this.emit('pano.chosen', oldPano, pano);
  25538. this.flying = true;
  25539. this.nextPano = pano; //提前加载高清图片
  25540. this.path.warpDestHeroLoc = {
  25541. panoId: o.panoId,
  25542. position: pano.position,
  25543. quaternion: o.quaternion || this.quaternion.clone(),
  25544. };
  25545. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  25546. pano != this.currentPano && this.currentPano.exit();
  25547. pano.enter();
  25548. this.currentPano = pano;
  25549. this.emit('flying.ended', pano.position, oldPos, pano, oldPano);
  25550. this.flying = false;
  25551. this.nextPano = null;
  25552. this.updateMarkerVisi(); //add
  25553. });
  25554. };
  25555. window._transitionPosId = 9999;
  25556. n.prototype.transitionPos = function (o = {}) {
  25557. //渐变overlay和热点的位置
  25558. y.cancelById(_transitionPosId);
  25559. var begin = function (object, pos, qua, scale) {
  25560. if (pos) {
  25561. if (!same(object.position, pos, 0.01)) {
  25562. y.start(
  25563. v.vector(object.position, pos),
  25564. o.dur,
  25565. (e) => {},
  25566. 0,
  25567. A[f.transition.movementEasing],
  25568. 'transitionPos',
  25569. _transitionPosId
  25570. );
  25571. }
  25572. if (qua && !same(object.quaternion, qua, 1e-6)) {
  25573. y.start(
  25574. v.quaternion(object.quaternion, qua),
  25575. o.dur,
  25576. (e) => {},
  25577. 0,
  25578. A[f.transition.movementEasing],
  25579. 'transitionPos',
  25580. _transitionPosId
  25581. );
  25582. }
  25583. if (scale && !same(object.scale, scale, 0.001)) {
  25584. y.start(
  25585. v.vector(object.scale, scale),
  25586. o.dur,
  25587. (e) => {},
  25588. 0,
  25589. A[f.transition.movementEasing],
  25590. 'transitionPos',
  25591. _transitionPosId
  25592. );
  25593. }
  25594. }
  25595. };
  25596. var same = function (vec1, vec2, diff) {
  25597. var s =
  25598. Math.abs(vec1.x - vec2.x) < diff &&
  25599. Math.abs(vec1.y - vec2.y) < diff &&
  25600. Math.abs(vec1.z - vec2.z) < diff;
  25601. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff;
  25602. return s;
  25603. };
  25604. var sid = o.pano != void 0 ? o.pano.id : 'outside';
  25605. for (let i in this.model.hots) {
  25606. //是否判断visible?
  25607. var hot = this.model.hots[i];
  25608. var panoData = hot.info.transformAtPanos[sid];
  25609. var useCustom = !panoData;
  25610. //if(hot.usingTransformData || !useCustom){
  25611. var pos = useCustom ? hot.info.position : panoData.pos;
  25612. begin(hot, pos /* , qua */);
  25613. //}
  25614. }
  25615. };
  25616. window._tranOutsideFocus = 4399;
  25617. n.prototype.focusPoint = function (o = {}) {
  25618. //当在外时,聚焦相机到这一点
  25619. console.log('focusPoint');
  25620. if (this.mode == 'floorplan') {
  25621. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8); //可视范围
  25622. var control = this.cameraControls.controls.floorplan;
  25623. var absoluteScale = control.getDefaultAbsoluteScale(modelSize);
  25624. var currentScale = control.absoluteScale;
  25625. var currentTarget = control.target.clone();
  25626. y.cancelById(window._tranOutsideFocus, true);
  25627. y.start(
  25628. function (progress) {
  25629. control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress);
  25630. control.target = o.aim
  25631. .clone()
  25632. .multiplyScalar(progress)
  25633. .add(currentTarget.clone().multiplyScalar(1 - progress));
  25634. control.camera.position.copy(control.target.clone().add(control.offset)); //维持角度
  25635. }.bind(this),
  25636. o.dur || 600,
  25637. null /* cancelFuc */,
  25638. 0,
  25639. A[f.transition.movementEasing],
  25640. 'outsideFocus',
  25641. window._tranOutsideFocus,
  25642. null /* cancelFuc */
  25643. );
  25644. } else if (player.mode == 'dollhouse') {
  25645. var control = player.cameraControls.controls.dollhouse;
  25646. var radius = o.radius || 8;
  25647. var currentTarget = control.target.clone();
  25648. var dir = control.offset.clone().normalize();
  25649. var currentRadius = control.offset.length();
  25650. y.cancelById(window._tranOutsideFocus, true);
  25651. y.start(
  25652. function (progress) {
  25653. control.target = o.aim
  25654. .clone()
  25655. .multiplyScalar(progress)
  25656. .add(currentTarget.clone().multiplyScalar(1 - progress));
  25657. let radius_ = radius * progress + currentRadius * (1 - progress);
  25658. control.camera.position.copy(
  25659. control.target.clone().add(dir.clone().multiplyScalar(radius_))
  25660. );
  25661. }.bind(this),
  25662. o.dur || 600,
  25663. null /* cancelFuc */,
  25664. 0,
  25665. A[f.transition.movementEasing],
  25666. 'outsideFocus',
  25667. window._tranOutsideFocus,
  25668. null /* cancelFuc */
  25669. );
  25670. } else if (this.mode == 'panorama') {
  25671. this.flyToPano({
  25672. lookAtPoint: o.aim.clone(),
  25673. pano: this.currentPano,
  25674. aimDuration: o.dur || 600,
  25675. });
  25676. }
  25677. };
  25678. /*
  25679. 切换到某个模式后再执行函数
  25680. */
  25681. n.prototype.FlyToMode = function (mode, f1, duration) {
  25682. var f2;
  25683. if (this.mode == mode) {
  25684. f1 && f1();
  25685. } else {
  25686. f2 = f1;
  25687. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  25688. //正飞向其他模式,就要先飞完再飞进来然后执行
  25689. this.afterCModeFuc = function () {
  25690. /* objects.gui.modeChange[mode](null, {
  25691. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  25692. }); */
  25693. this.afterCModeFuc = f2;
  25694. this.flyToNewMode({
  25695. mode: mode,
  25696. pano: mode == 'panorama' && this.currentPano,
  25697. //callback : f2
  25698. });
  25699. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  25700. }.bind(this);
  25701. } else {
  25702. if (this.afterCModeFuc)
  25703. console.log('已经有afterCModeFuc了!!!!!!!!!!!!!!!');
  25704. this.afterCModeFuc = f2; //飞入后执行
  25705. try {
  25706. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  25707. this.flyToNewMode({
  25708. mode: mode,
  25709. pano: mode == 'panorama' && this.currentPano,
  25710. duration: duration,
  25711. });
  25712. } catch (e) {
  25713. console.log('FlyToMode遇到问题?');
  25714. }
  25715. }
  25716. }
  25717. };
  25718. (n.prototype.fastForwardActivePanoFlight = function (e) {
  25719. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1;
  25720. y.adjustSpeed(V.FlyToPano, e);
  25721. y.adjustSpeed(V.LookTransition, e);
  25722. }),
  25723. (n.prototype.flyToPanoClosestToMouse = function () {
  25724. if (
  25725. (Date.now() - this.mouseLastMoveTime > 50 &&
  25726. ((this.intersect = this.getMouseIntersect()),
  25727. this.intersect && this.updateClosestPano(this.intersect)),
  25728. this.closestPano)
  25729. )
  25730. return this.flyToPano({
  25731. pano: this.closestPano,
  25732. });
  25733. var e = this.getMouseDirection();
  25734. this.flyDirection(e) ||
  25735. this.flyToPano({
  25736. pano: this.currentPano,
  25737. });
  25738. }),
  25739. (n.prototype.flyLocalDirection = function (e) {
  25740. var t = this.getDirection(e),
  25741. i = 1 === e.z ? 0.4 : 0.75,
  25742. n = 1 === Math.abs(e.x);
  25743. return this.flyDirection(t, i, n);
  25744. }),
  25745. (n.prototype.flyDirection = function (e, t, i) {
  25746. Hot.closePopup(); //xzw add
  25747. var n = $.Deferred();
  25748. this.history.invalidate();
  25749. var r = this.closestPanoInDirection(e, t, i);
  25750. return (
  25751. r
  25752. ? this.flyToPano(
  25753. {
  25754. pano: r,
  25755. },
  25756. n.resolve.bind(n, !0)
  25757. )
  25758. : (this.bump(e), n.resolve(!1)),
  25759. n.promise()
  25760. );
  25761. }),
  25762. (n.prototype.closestPanoInDirection = function (e, t, i) {
  25763. return this.rankedPanoInDirection(0, e, t, i);
  25764. }),
  25765. (n.prototype.rankedPanoInDirection = (function () {
  25766. var e = {
  25767. pano: null,
  25768. candidates: [],
  25769. };
  25770. return function (t, i, n, r) {
  25771. t || (t = 0), (n = void 0 !== n ? n : 0.75);
  25772. var o = r ? 'angle' : 'direction';
  25773. return (
  25774. this.model.panos.findRankedByScore(
  25775. t,
  25776. [
  25777. s.filters.isPanoAligned(),
  25778. s.filters.not(this.currentPano),
  25779. s.filters.isNeighbourPanoTo(this.currentPano),
  25780. s.filters.inPanoDirection(this.position, i, n),
  25781. ],
  25782. [
  25783. s.scoreFunctions.distanceSquared(this.currentPano),
  25784. s.scoreFunctions[o](this.position, i),
  25785. ],
  25786. e
  25787. ),
  25788. (this.cachedPanoCandidates = e.candidates),
  25789. e.pano
  25790. );
  25791. };
  25792. })()),
  25793. (n.prototype.bump = function (e) {
  25794. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  25795. var t,
  25796. i,
  25797. n,
  25798. r = f.transition,
  25799. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  25800. a = this.camera.getWorldDirection().dot(e),
  25801. s = Math.abs(a) > 0.5;
  25802. if (s)
  25803. (t = function () {
  25804. y.start(
  25805. v.property(
  25806. this.cameraControls.cameras[u.PANORAMA],
  25807. 'zoom',
  25808. a > 0 ? 1.04 : 0.96
  25809. ),
  25810. o,
  25811. i,
  25812. 0,
  25813. A.easeInOutSine,
  25814. 'bumpZStart'
  25815. );
  25816. }.bind(this)),
  25817. (i = function () {
  25818. y.start(
  25819. v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', 1),
  25820. 5 * o,
  25821. n,
  25822. 0,
  25823. A.easeInOutSine,
  25824. 'bumpZRelax'
  25825. );
  25826. }.bind(this));
  25827. else {
  25828. var l = this.camera.position.clone(),
  25829. c = e.clone();
  25830. this.raycaster.set(l, c);
  25831. var h = this.model.floors.reduce(function (e, t) {
  25832. return e.concat(t.collider.children);
  25833. }, []),
  25834. d = this.raycaster.intersectObjects(h),
  25835. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  25836. g = l.clone().add(c.multiplyScalar(p));
  25837. (t = function () {
  25838. y.start(
  25839. v.vector(this.cameraControls.cameras[u.PANORAMA].position, g),
  25840. o,
  25841. i,
  25842. 0,
  25843. A.easeInOutSine,
  25844. 'bumpTStart'
  25845. );
  25846. }.bind(this)),
  25847. (i = function () {
  25848. y.start(
  25849. v.vector(this.cameraControls.cameras[u.PANORAMA].position, l),
  25850. 5 * o,
  25851. n,
  25852. 0,
  25853. A.easeInOutSine,
  25854. 'bumpTRelax'
  25855. );
  25856. }.bind(this));
  25857. }
  25858. (n = function () {
  25859. this.flying = !1;
  25860. }.bind(this)),
  25861. (this.flying = !0),
  25862. t();
  25863. }
  25864. }),
  25865. (n.prototype.changeFloor = function (e) {
  25866. if (!this.is360View(this.mode, this.currentPano))
  25867. if (this.mode === u.PANORAMA) {
  25868. var t = this.history.reversePano(e);
  25869. t && t.isAligned()
  25870. ? this.flyToPano({
  25871. pano: t,
  25872. })
  25873. : this.changeFloorByScore(e);
  25874. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor);
  25875. }),
  25876. (n.prototype.changeFloorByScore = (function () {
  25877. var e = {
  25878. pano: null,
  25879. candidates: [],
  25880. };
  25881. return function (t) {
  25882. var i = this.model.nextFloor(t);
  25883. return i
  25884. ? (this.model.panos.lowestByScore(
  25885. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  25886. [
  25887. s.scoreFunctions.distance(this.currentPano),
  25888. s.scoreFunctions.direction(this.position, new r.Vector3(0, t, 0)),
  25889. s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5),
  25890. ],
  25891. e
  25892. ),
  25893. void (e.pano
  25894. ? ((this.cachedPanoCandidates = e.candidates),
  25895. this.history.push(t, this.currentPano),
  25896. this.flyToPano({
  25897. pano: e.pano,
  25898. }))
  25899. : F.warn('No pano found on selected floor, not moving there.')))
  25900. : void F.debug('player.changeFloor(' + t + '): no such floor');
  25901. };
  25902. })()),
  25903. (n.prototype.gotoFloor = function (e) {
  25904. var t = e - this.model.currentFloor.floorIndex;
  25905. this.changeFloor(t);
  25906. }),
  25907. (n.prototype.getDirection = function (e) {
  25908. return (
  25909. (e = e ? e : new r.Vector3().copy(d.FORWARD)),
  25910. e.applyQuaternion(this.camera.quaternion)
  25911. );
  25912. }),
  25913. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  25914. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING))
  25915. return F.warn('should not be transitioning here'), n && n(!1), o.reject().promise();
  25916. var a = i || !1,
  25917. s = i ? i.position : this.position,
  25918. l = this.position.clone(),
  25919. c = this.currentPano;
  25920. if (
  25921. (F.debug('New pose in mode ' + this.mode),
  25922. !e ||
  25923. ((retryCallback = function () {
  25924. N.delayOneFrame(
  25925. function () {
  25926. this.flyToSameMode(e, t, i, n, o);
  25927. }.bind(this)
  25928. );
  25929. }.bind(this)),
  25930. !this.checkAndWaitForPanoLoad(
  25931. e,
  25932. 'high',
  25933. 'low',
  25934. this.basePanoSize,
  25935. retryCallback
  25936. )))
  25937. ) {
  25938. var h = function () {
  25939. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0);
  25940. }.bind(this),
  25941. d = f[this.mode],
  25942. p = void 0 !== t ? t : d.transitionTime,
  25943. g = new r.Vector3(),
  25944. C = new r.Vector3();
  25945. if ((this.emit(w.FlyingStarted, s, l, e, c), this.mode === u.PANORAMA))
  25946. F.warn('we should not be here for panorama views');
  25947. else if (this.mode === u.DOLLHOUSE)
  25948. if (a) {
  25949. var I = new r.Vector3(0, 1, 0);
  25950. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  25951. this.model.warpDestFloors(i.floorVisibility),
  25952. C.copy(i.position);
  25953. var E = new r.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  25954. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  25955. _ = b.intersectObjects(this.model.colliders),
  25956. T = 3;
  25957. _.length
  25958. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  25959. : (g.copy(E).multiplyScalar(3).add(C),
  25960. F.debug(
  25961. 'Tried to restore dollhouse mode that did not intersect...',
  25962. i.position,
  25963. i.quaternion
  25964. ));
  25965. var x = new r.Matrix4().lookAt(C, g, I),
  25966. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  25967. M = g.distanceTo(C),
  25968. R = new r.Matrix4().lookAt(
  25969. this.cameraControls.cameras[u.DOLLHOUSE].position,
  25970. this.cameraControls.controls[u.DOLLHOUSE].target,
  25971. I
  25972. ),
  25973. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  25974. O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(
  25975. this.cameraControls.controls[u.DOLLHOUSE].target
  25976. );
  25977. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  25978. var L = new r.Euler(S.x - P.x, S.y - P.y, S.z - P.z, f.warp.eOrder);
  25979. (L.y =
  25980. L.y > Math.PI
  25981. ? (L.y -= 2 * Math.PI)
  25982. : L.y < -Math.PI
  25983. ? (L.y += 2 * Math.PI)
  25984. : L.y),
  25985. (this.path.burnsDir = Math.sign(L.y));
  25986. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  25987. B = new r.Vector3();
  25988. y.start(
  25989. v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g),
  25990. p,
  25991. null,
  25992. f.flydown.movementDelay,
  25993. A[f.flydown.movementEasing],
  25994. null,
  25995. V.FlyToSameMode
  25996. ),
  25997. y.start(
  25998. function (e, t) {
  25999. (D.x = P.x + e * L.x), (D.y = P.y + e * L.y), (D.z = P.z + e * L.z);
  26000. var i = O + e * (M - O);
  26001. B.set(0, 0, i)
  26002. .applyEuler(D)
  26003. .add(this.cameraControls.controls[u.DOLLHOUSE].target),
  26004. this.cameraControls.cameras[u.DOLLHOUSE].position
  26005. .copy(B)
  26006. .add(this.model.position);
  26007. }.bind(this),
  26008. p,
  26009. null,
  26010. f.flydown.movementDelay,
  26011. A[f.flydown.movementEasing],
  26012. null,
  26013. V.FlyToSameMode
  26014. ),
  26015. y.start(
  26016. function (e, t) {
  26017. this.cameraControls.controls[u.DOLLHOUSE].update(),
  26018. this.quaternion.copy(
  26019. this.cameraControls.cameras[u.DOLLHOUSE].quaternion
  26020. ),
  26021. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position);
  26022. }.bind(this),
  26023. p,
  26024. null,
  26025. f.flydown.movementDelay,
  26026. A[f.flydown.movementEasing],
  26027. null,
  26028. V.FlyToSameMode
  26029. );
  26030. } else F.warn('invalid warp destination in flyToSameMode()? ignore it then');
  26031. else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), i)) {
  26032. this.model.warpDestFloors(i.floorVisibility);
  26033. var U = this.cameraControls.cameras[u.FLOORPLAN],
  26034. k = this.cameraControls.controls[u.FLOORPLAN],
  26035. H = k.target.clone(),
  26036. G = i.position.clone().sub(H),
  26037. z = U.position.clone().sub(k.target),
  26038. W = z.length(),
  26039. j = new r.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  26040. Y = Math.atan2(k.offset.x, k.offset.z),
  26041. X = Math.atan2(j.x, j.z),
  26042. Z = k.absoluteScale,
  26043. q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  26044. y.start(
  26045. function (e, t) {
  26046. k.target.copy(G).multiplyScalar(e).add(H);
  26047. var i = Y + (X - Y) * e;
  26048. (k.offset.x = W * Math.sin(i)),
  26049. (k.offset.z = W * Math.cos(i)),
  26050. U.position.copy(k.target).add(k.offset),
  26051. (k.absoluteScale = Z + e * (q - Z)),
  26052. k.update(),
  26053. this.quaternion.copy(U.quaternion),
  26054. this.position.copy(U.position),
  26055. this.target.copy(k.target),
  26056. this.camera.projectionMatrix.copy(U.projectionMatrix);
  26057. }.bind(this),
  26058. p,
  26059. null,
  26060. 0,
  26061. A[f.flydown.movementEasing],
  26062. null,
  26063. V.FlyToSameMode
  26064. );
  26065. } else F.info('flyToSameMode() funny floorplan view? skipping');
  26066. return (
  26067. y.setTimeout(
  26068. function (e) {
  26069. (this.mode = e), h(), o.resolve(!0);
  26070. }.bind(this, this.mode),
  26071. p,
  26072. V.FlyToSameMode
  26073. ),
  26074. (this.mode = u.TRANSITIONING),
  26075. o.promise()
  26076. );
  26077. }
  26078. }),
  26079. (n.prototype.flyToNewMode = function (e, t) {
  26080. Hot.closePopup(); //xzw add
  26081. e = e || {};
  26082. var i = e.mode,
  26083. n = e.pano,
  26084. o = e.duration,
  26085. a = e.warpDest,
  26086. s = e.callback,
  26087. l = e.force,
  26088. c = e.quaternion;
  26089. if (((t = t || $.Deferred()), this.isWarping()))
  26090. return (
  26091. F.warn('Player.flyToNewMode() -> Cannot fly when warping'),
  26092. s && s(!1),
  26093. t.reject('Cannot change mode during tour transition').promise()
  26094. );
  26095. if (this.mode === u.TRANSITIONING)
  26096. return s && s(!1), t.reject('Cannot change mode during mode transition').promise();
  26097. if (i === this.mode)
  26098. return l
  26099. ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  26100. t.promise())
  26101. : (s && s(!1), t.reject('Already in ' + i + ' mode').promise());
  26102. var h = a || !1;
  26103. F.debug('Switching mode to ' + i);
  26104. var d = function () {
  26105. N.delayOneFrame(
  26106. function () {
  26107. this.flyToNewMode(e, t);
  26108. }.bind(this)
  26109. );
  26110. }.bind(this);
  26111. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, d))
  26112. return t.promise();
  26113. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  26114. return (
  26115. F.info('Waiting for model textures to be loaded before going out to dollhouse'),
  26116. this.model.waitForLoad(
  26117. this.model,
  26118. function () {
  26119. return this.model.meshTexturesLoaded;
  26120. }.bind(this)
  26121. ),
  26122. this.model.loadMeshTextures().done(d),
  26123. t.promise()
  26124. );
  26125. this.history.invalidate(), this.updateLastView();
  26126. var p = this.mode,
  26127. C = this.cameraControls.cameras[i];
  26128. e = g.deepExtend({}, f[i], f[p + '-' + i]);
  26129. var I = void 0 !== o ? o : e.transitionTime;
  26130. this.emit(w.ModeChanging, p, i, n, I),
  26131. n && (this.currentPano = n),
  26132. this.switchCameraMode(i, c),
  26133. y.cancelById(V.LookTransition);
  26134. //before fly---------------------
  26135. this.modeTran = p + '-' + i; //add
  26136. if (this.mode == 'panorama') {
  26137. if (this.model.floorLogos) {
  26138. this.model.floorLogos[0].visible = false;
  26139. this.model.floorLogos[1].visible = false;
  26140. }
  26141. }
  26142. if (i == 'panorama') {
  26143. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: I }); //add
  26144. } else {
  26145. this.transitionPos({ type: 'beforeFlyOut', dur: I / 2 }); //add
  26146. }
  26147. window.bus.dispatchEvent({ type: 'playerAndModelReady' });
  26148. this.ready = true;
  26149. //------------------------------------
  26150. var beginTran = () => {
  26151. var _ = new r.Vector3().copy(this.position);
  26152. if (i === u.PANORAMA) {
  26153. this.emit(w.PanoChosen, n, n),
  26154. setTimeout(
  26155. function () {
  26156. n.floor.enter(i);
  26157. }.bind(this),
  26158. I / 2
  26159. ),
  26160. this.path.fadeOutCpm(f.path.fadeOutTime);
  26161. if (this.model.floorLogos) {
  26162. this.model.floorLogos[0].position.copy(
  26163. n.floorPosition.clone().sub(this.model.position)
  26164. ); //改
  26165. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position); //for floorIcon position
  26166. }
  26167. } else if (i === u.DOLLHOUSE) {
  26168. if (
  26169. (h && (this.model.stayPut = !0),
  26170. a
  26171. ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  26172. this.model.warpDestFloors(a.floorVisibility))
  26173. : this.model.toggleAllFloors(!0),
  26174. this.path.placeCpm(),
  26175. this.path.fadeInCpm(f.path.fadeInTime),
  26176. h)
  26177. ) {
  26178. var T = new r.Vector3(this.model.center.x, 0, this.model.center.z);
  26179. _.set(15, 10, 15);
  26180. var M = new r.Vector3(0, 0, -1).applyQuaternion(a.quaternion),
  26181. R = new r.Raycaster(a.position.clone(), M.clone(), 0, 1 / 0),
  26182. P = R.intersectObjects([this.sceneIntersectionPlane]);
  26183. P.length
  26184. ? (T.copy(P[0].point),
  26185. _.copy(a.position),
  26186. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  26187. 0.75 * _.distanceTo(T),
  26188. !0
  26189. ))
  26190. : (F.warn(
  26191. 'Tried to restore dollhouse mode that did not intersect...',
  26192. a.position,
  26193. a.quaternion
  26194. ),
  26195. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  26196. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  26197. _.add(this.model.position),
  26198. C.position.copy(_),
  26199. this.cameraControls.controls[u.DOLLHOUSE].update();
  26200. }
  26201. } else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), a)) {
  26202. this.model.warpDestFloors(a.floorVisibility);
  26203. var O = this.cameraControls.cameras[u.FLOORPLAN],
  26204. L = this.cameraControls.controls[u.FLOORPLAN],
  26205. D = O.position.clone().sub(L.target),
  26206. B = new r.Vector3(-1, 0, 0).applyQuaternion(a.quaternion).normalize(),
  26207. U = Math.atan2(B.x, B.z);
  26208. L.target.copy(a.position);
  26209. var k = D.length();
  26210. (L.offset.x = k * Math.sin(U)),
  26211. (L.offset.y = 0),
  26212. (L.offset.z = k * Math.cos(U)),
  26213. O.position.copy(L.target).add(L.offset);
  26214. L.target.clone().sub(C.position);
  26215. C.quaternion.copy(a.quaternion),
  26216. (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)),
  26217. (L.absoluteScale = L.currentScale),
  26218. L.update();
  26219. } else this.model.currentFloor.enter(i);
  26220. var H = this.currentPano,
  26221. G = this.position.clone();
  26222. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  26223. (this.flying = !0),
  26224. this.isOutsideMode(i) && this.is360View(p, H)
  26225. ? (h ||
  26226. i !== u.DOLLHOUSE ||
  26227. (C.position.set(15, 10, 15),
  26228. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  26229. C.controls.update()),
  26230. (e.blackoutStyle = S.FADEIN),
  26231. (I = f.show360Views.transitionTime),
  26232. this.fade360View(I, C, e))
  26233. : this.isOutsideMode(p) && this.is360View(i, n)
  26234. ? (h && this.switchCameraMode(i, h.quaternion),
  26235. (this.mode = i),
  26236. this.path && this.path.popOutCpm(),
  26237. (e.blackoutStyle = S.END),
  26238. (I = f.show360Views.transitionTime),
  26239. this.fade360View(I, C, e))
  26240. : (y.start(
  26241. v.property(this.model, 'alpha', e.modelAlpha, null),
  26242. I * e.modelAlphaLength,
  26243. null,
  26244. e.modelAlphaDelay,
  26245. null,
  26246. V.FlyToNewMode
  26247. ),
  26248. y.start(
  26249. v.vector(this.position, C.position),
  26250. I,
  26251. null,
  26252. f.flydown.movementDelay,
  26253. A[f.flydown.movementEasing],
  26254. null,
  26255. V.FlyToNewMode
  26256. ),
  26257. y.start(
  26258. v.quaternion(this.quaternion, C.quaternion),
  26259. I * e.rotationDuration,
  26260. null,
  26261. e.rotationDelay,
  26262. A[f.flydown.rotationEasing],
  26263. null,
  26264. V.FlyToNewMode
  26265. ),
  26266. y.start(
  26267. v.matrix4(this.camera.projectionMatrix, C.projectionMatrix),
  26268. I * e.cameraMatrixDuration,
  26269. null,
  26270. e.cameraMatrixDelay,
  26271. e.cameraMatrixEase,
  26272. null,
  26273. V.FlyToNewMode
  26274. ),
  26275. y.start(
  26276. v.uniform(this.model.skybox, 'opacity', e.skyboxOpacity),
  26277. I * e.skyboxOpacityLength,
  26278. null,
  26279. e.skyboxOpacityDelay,
  26280. null,
  26281. V.FlyToNewMode
  26282. ),
  26283. y.start(
  26284. v.property(this.reticule.material.uniforms.opacity, 'value', 0),
  26285. I,
  26286. null,
  26287. V.FlyToNewMode
  26288. )),
  26289. y.setTimeout(
  26290. function () {
  26291. (this.flying = !1),
  26292. p === u.PANORAMA && i !== u.PANORAMA
  26293. ? this.currentPano.exit()
  26294. : p !== u.PANORAMA &&
  26295. i === u.PANORAMA &&
  26296. (this.currentPano !== H && H.exit(),
  26297. this.currentPano.enter(),
  26298. this.path.placeCpm(),
  26299. this.path.fadeOutCpm(f.path.fadeOutTime),
  26300. this.spider.draw()),
  26301. p === u.DOLLHOUSE &&
  26302. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  26303. (this.mode = i),
  26304. this.emit(w.FlyingEnded, _, G, this.currentPano, H);
  26305. //add:
  26306. this.updateMarkerVisi();
  26307. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  26308. this.mode == u.PANORAMA &&
  26309. this.model.floorLogos &&
  26310. (this.model.changefloorLogoOpa({ index: 0, from: 0, opa: 1, dur: 150 }), //this.model.floorLogoShow(0,150);
  26311. (this.model.floorLogos[0].visible = true));
  26312. if (this.afterCModeFuc) {
  26313. //手动加的函数
  26314. var cf = this.afterCModeFuc;
  26315. this.afterCModeFuc = null; //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  26316. cf();
  26317. }
  26318. if (this.mode == u.PANORAMA) {
  26319. Hot.updateVisibles([this.currentPano]);
  26320. this.model.fadePanoMarkers();
  26321. } else {
  26322. Hot.updateVisibles(true);
  26323. this.model.hotGroup.children.forEach((overlay) => {
  26324. if (overlay.animateInfo) {
  26325. GifTexDeal.start(overlay.animation);
  26326. }
  26327. });
  26328. }
  26329. h && p !== u.PANORAMA && i === u.PANORAMA
  26330. ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s)
  26331. : (s && s(), t.resolve());
  26332. }.bind(this),
  26333. I,
  26334. V.FlyToNewMode
  26335. );
  26336. };
  26337. if (
  26338. i == 'panorama' &&
  26339. !this.model.supportsTiles &&
  26340. n.getSkyboxTexture().image[0].width > 1024
  26341. ) {
  26342. setTimeout(() => {
  26343. beginTran();
  26344. }, 16); //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  26345. } else {
  26346. beginTran();
  26347. }
  26348. this.mode = u.TRANSITIONING;
  26349. //p == "panorama" && this.updateHotVisible(),
  26350. return t.promise();
  26351. }),
  26352. (n.prototype.fade360View = function (e, t, i) {
  26353. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  26354. $(this.domElement).fadeOut(
  26355. 0.5 * e,
  26356. function () {
  26357. (this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  26358. (this.model.alpha = i.modelAlpha),
  26359. this.position.copy(t.position),
  26360. this.quaternion.copy(t.quaternion),
  26361. this.camera.projectionMatrix.copy(t.projectionMatrix),
  26362. $(this.domElement).fadeIn(0.5 * e);
  26363. }.bind(this)
  26364. );
  26365. }),
  26366. (n.prototype.findDefaultViews = function () {
  26367. this.findDefaultView(this.lastInsideView, !0),
  26368. this.findDefaultView(this.last360View, !1);
  26369. }),
  26370. (n.prototype.findDefaultView = function (e, t) {
  26371. var i,
  26372. n = this.model.heroLocations,
  26373. r = this.model.panos,
  26374. o = n.findIndex(function (e) {
  26375. if (e.cameraMode !== u.PANORAMA) return !1;
  26376. var i = r.get(e.panoId);
  26377. return i && i.isAligned() === t;
  26378. });
  26379. o >= 0
  26380. ? ((i = r.get(n[o].panoId)),
  26381. e.update({
  26382. cameraMode: u.PANORAMA,
  26383. pano: i,
  26384. position: n[o].position,
  26385. quaternion: n[o].quaternion,
  26386. }))
  26387. : ((o = r.list.findIndex(function (e) {
  26388. return e.isAligned() === t;
  26389. })),
  26390. o >= 0
  26391. ? ((i = r.list[o]),
  26392. e.update({
  26393. cameraMode: u.PANORAMA,
  26394. pano: i,
  26395. position: i.position,
  26396. }))
  26397. : F.warn('There are no', t ? 'inside' : '360º', 'views in this model'));
  26398. }),
  26399. (n.prototype.updateLastView = function () {
  26400. if (this.mode === u.PANORAMA) {
  26401. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  26402. e.update({
  26403. pano: this.currentPano,
  26404. position: this.position,
  26405. quaternion: this.quaternion,
  26406. });
  26407. }
  26408. }),
  26409. (n.prototype.goToLastView = function (e, t) {
  26410. var i = $.Deferred(),
  26411. n = i.resolve.bind(i),
  26412. r = i.reject.bind(i),
  26413. o = e ? this.lastInsideView : this.last360View;
  26414. return (
  26415. this.isInMode(u.PANORAMA) &&
  26416. this.currentPano.isAligned() !== e &&
  26417. this.updateLastView(),
  26418. this.isInMode(u.PANORAMA)
  26419. ? (this.path && this.path.popOutCpm(),
  26420. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r))
  26421. : this.isOutsideMode() &&
  26422. this.flyToNewMode({
  26423. mode: o.cameraMode,
  26424. pano: o.pano,
  26425. quaternion: o.quaternion,
  26426. callback: t,
  26427. })
  26428. .done(n)
  26429. .fail(r),
  26430. i.promise()
  26431. );
  26432. }),
  26433. (n.prototype.fadeToView = function (e, t, i, n) {
  26434. var r = $.Deferred(),
  26435. o = r.resolve.bind(r),
  26436. a = r.reject.bind(r);
  26437. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano))
  26438. return (
  26439. F.warn('Tried to fade to an illegal view', t.cameraMode),
  26440. a('Cannot go to illegal view'),
  26441. r.promise()
  26442. );
  26443. var s =
  26444. (f[t.cameraMode],
  26445. function () {
  26446. $(this.domElement).fadeIn(0.5 * i), n && n(), o();
  26447. }.bind(this)),
  26448. l = e ? S.FADEIN : S.END;
  26449. return (
  26450. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  26451. $(this.domElement).fadeOut(
  26452. 0.5 * i,
  26453. function () {
  26454. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  26455. t.cameraMode === u.PANORAMA
  26456. ? this.flyToPano(
  26457. {
  26458. pano: t.pano,
  26459. lookAtPoint: d.FORWARD.clone()
  26460. .applyQuaternion(t.quaternion)
  26461. .add(t.pano.position),
  26462. duration: 0,
  26463. },
  26464. s
  26465. )
  26466. : this.flyToNewMode({
  26467. mode: t.cameraMode,
  26468. quaternion: t.quaternion,
  26469. duration: 0,
  26470. callback: s,
  26471. });
  26472. }.bind(this)
  26473. ),
  26474. r.promise()
  26475. );
  26476. }),
  26477. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  26478. if (
  26479. (this.cameraControls.activeControl &&
  26480. (this.cameraControls.activeControl.enabled = !1),
  26481. this.flying)
  26482. )
  26483. return F.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1;
  26484. (null !== e && void 0 !== e) || (e = b.Show), this.history.invalidate();
  26485. e !== b.Retain
  26486. ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK)
  26487. : (i = this.path.upcomingTransType);
  26488. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  26489. return (
  26490. this.emit(w.WarpStarted, a, i, n, r),
  26491. (n = n || S.MIDDLE),
  26492. this.path.warpToPano(
  26493. i,
  26494. n,
  26495. r,
  26496. function () {
  26497. t === E.Slow
  26498. ? this.path.discardSlow()
  26499. : t === E.Standard && this.path.discardPathObject(),
  26500. this.emit(w.WarpEnded, i),
  26501. this.cameraControls.activeControl &&
  26502. (this.cameraControls.activeControl.enabled = !0),
  26503. o && o();
  26504. }.bind(this)
  26505. ),
  26506. e === b.Hide && this.path.discardPathObject(),
  26507. !0
  26508. );
  26509. }),
  26510. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  26511. return this.path.setWarpDestinationByPanoId(e, t)
  26512. ? this.startWarp(i, n, r, o, a, s)
  26513. : (F.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'),
  26514. s && s(),
  26515. !1);
  26516. }),
  26517. (n.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  26518. return this.path.setWarpDestinationByHeroIndex(e)
  26519. ? this.startWarp(t, i, n, r, o, a)
  26520. : (F.warn(
  26521. 'Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26522. ),
  26523. a && a(),
  26524. !1);
  26525. }),
  26526. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  26527. return this.warpToPanoById(e.id, t, i, n, r, o, a, s);
  26528. }),
  26529. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  26530. return this.path.setWarpDestinationByHeroIndex(e)
  26531. ? (this.path.warpToNonPano(t), !0)
  26532. : (F.warn(
  26533. 'Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26534. ),
  26535. t && t(),
  26536. !1);
  26537. }),
  26538. (n.prototype.aimTourCamera = function (e, t, i, n) {
  26539. return (
  26540. F.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'),
  26541. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  26542. );
  26543. }),
  26544. (n.prototype.showPathToHeroLocation = function (e) {
  26545. this.path.setWarpDestinationByHeroIndex(e) &&
  26546. this.path.brushToWarpPano(x.STD, x.BLACK);
  26547. }),
  26548. (n.prototype.tourInterlude = function (e, t) {
  26549. this.history.invalidate();
  26550. this.path.discardSlow();
  26551. //xzw:
  26552. var defaultRotTime = DATA.tourRotTime * 1000;
  26553. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200; //预估时间假设每个item飞的时间(如果距离远就少了)
  26554. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem);
  26555. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]];
  26556. //zeg 标注一下
  26557. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  26558. var rotTime;
  26559. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  26560. var restChildCount = currentLocation0.heroLocations
  26561. ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1
  26562. : 0;
  26563. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music;
  26564. if (hasMusic) {
  26565. var audioObj = SoundManager.list.find((e) => e.name == 'tour');
  26566. var current = audioObj.audio.currentTime * 1e3; // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  26567. rotTime = currentLocation0.musicInfo.time - current;
  26568. if (restChildCount) {
  26569. //如果当前folder中还有剩下的item,平分一下时间
  26570. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1);
  26571. }
  26572. } else {
  26573. rotTime = defaultRotTime;
  26574. }
  26575. rotTime = Math.max(0, rotTime);
  26576. Log(
  26577. 'rotTime ' +
  26578. rotTime +
  26579. ' at item ' +
  26580. this.director.currentItem +
  26581. (hasMusic
  26582. ? ',musicCurrentTime:' +
  26583. current +
  26584. '音乐总长:' +
  26585. currentLocation0.musicInfo.time
  26586. : ''),
  26587. '#E8E'
  26588. );
  26589. } else {
  26590. rotTime = currentLocation.rotTime * 1000;
  26591. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem, '#E8E');
  26592. }
  26593. this.path.waitNextStep(
  26594. e,
  26595. function () {
  26596. t && t();
  26597. }.bind(this),
  26598. rotTime
  26599. );
  26600. }),
  26601. (n.prototype.stopInterlude = function () {
  26602. this.interruptAndFastForward(null, 0);
  26603. }),
  26604. (n.prototype.interruptAndFastForward = function (e, t) {
  26605. //Log('interruptAndFastForward' , '#f00')
  26606. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  26607. this.flying && this.emit(w.FlyingInterrupted),
  26608. this.path.interruptAndFastForward(e, t);
  26609. }),
  26610. (n.prototype.setSize = function (e, t) {
  26611. var i = e / t;
  26612. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  26613. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  26614. n > f.insideFOVMax
  26615. ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t))
  26616. : (this.baseFov = f.insideFOV);
  26617. for (var r in this.cameraControls.cameras) {
  26618. var o = this.cameraControls.cameras[r];
  26619. (o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i);
  26620. }
  26621. }),
  26622. (n.prototype.toJSON = function () {
  26623. var e = {};
  26624. return this.cameraControls.activeControl
  26625. ? ((e = this.cameraControls.activeControl.toJSON()),
  26626. (e.camera_mode = u.toInt(this.mode)),
  26627. this.isOutsideMode()
  26628. ? this.model.allFloorsVisible
  26629. ? (e.floor_visibility = [])
  26630. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  26631. return e.hidden ? 0 : 1;
  26632. }))
  26633. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  26634. e)
  26635. : e;
  26636. }),
  26637. (n.prototype.getCurrentNodePanos = function (e) {
  26638. this.model.panos.map;
  26639. if (((e.length = 0), this.path.nodes.length)) {
  26640. var momentTour = this.director.getMomentTour(this.director.destinationItem);
  26641. if (momentTour == 'black') {
  26642. //改 upcomingPanos如果是black的只需要起点和终点
  26643. if (this.path.nodes.length) {
  26644. e.push(this.model.panos.get(this.path.nodes[0]));
  26645. }
  26646. if (this.path.nodes.length > 1) {
  26647. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length - 1]));
  26648. }
  26649. } else {
  26650. for (var t = 0; t < this.path.nodes.length; t++) {
  26651. var i = this.path.nodes[t];
  26652. e.push(this.model.panos.get(i));
  26653. }
  26654. }
  26655. }
  26656. }),
  26657. (n.prototype.zoomIncrementally = function (e) {
  26658. var t = this.zoomLevel;
  26659. this.zoomTo(this.zoomLevel + e),
  26660. t !== this.zoomLevel &&
  26661. this.currentPano &&
  26662. this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id);
  26663. }),
  26664. (n.prototype.zoomInIncrementally = function (e) {
  26665. (e = e || this.defaultZoomIncrement), this.zoomIncrementally(e);
  26666. }),
  26667. (n.prototype.zoomOutIncrementally = function (e) {
  26668. (e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e);
  26669. }),
  26670. (n.prototype.zoomBy = function (e) {
  26671. this.zoomTo(this.zoomLevel * e);
  26672. }),
  26673. (n.prototype.zoomIn = function () {
  26674. this.zoomBy(1 + this.zoomSpeed);
  26675. }),
  26676. (n.prototype.zoomOut = function () {
  26677. this.zoomBy(1 - this.zoomSpeed);
  26678. }),
  26679. (n.prototype.zoomTo = function (e, t) {
  26680. if (t || (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)) {
  26681. if (
  26682. (e < f.zoom.min && (e = f.zoom.min),
  26683. e > f.zoom.max && (e = f.zoom.max),
  26684. e > this.zoomLevel
  26685. ? (this.emit(O.ZoomIn), e === f.zoom.max && this.emit(O.ZoomMax))
  26686. : e < this.zoomLevel &&
  26687. (this.emit(O.ZoomOut), e === f.zoom.min && this.emit(O.ZoomMin)),
  26688. this.cameraControls.activeControl)
  26689. ) {
  26690. var i = this.cameraControls.activeControl.camera;
  26691. (this.zoomLevel = e),
  26692. (i.fov = this.baseFov * (1 / this.zoomLevel)),
  26693. i.updateProjectionMatrix(),
  26694. (this.zoomFov = i.fov);
  26695. }
  26696. }
  26697. }),
  26698. (n.prototype.increaseZoomSpeed = function () {
  26699. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust);
  26700. }),
  26701. (n.prototype.decreaseZoomSpeed = function () {
  26702. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust);
  26703. }),
  26704. (n.prototype.clampZoomSpeed = function (e) {
  26705. return e < 0 ? 0 : e;
  26706. }),
  26707. (n.prototype.activatePersistentZooming = function (e) {
  26708. this.zooming = e ? 1 : -1;
  26709. }),
  26710. (n.prototype.deactivatePersistentZooming = function () {
  26711. this.zooming = 0;
  26712. }),
  26713. (n.prototype.zoomDefault = function () {
  26714. this.zoomTo(1, !0);
  26715. }),
  26716. (window.fovTranId = 333); //add
  26717. n.prototype.smoothZoomToDefault = function (e, t) {
  26718. y.cancelById(window.fovTranId);
  26719. var i,
  26720. n = this.zoomLevel,
  26721. r = function (e) {
  26722. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0);
  26723. }.bind(this),
  26724. o = function () {
  26725. this.zoomDefault(), t && window.setTimeout(t, 50);
  26726. }.bind(this);
  26727. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId);
  26728. };
  26729. (n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  26730. //add
  26731. y.cancelById(window.fovTranId);
  26732. console.log('smoothZoomFovTo ' + zoomLevel);
  26733. var i,
  26734. n = this.zoomLevel,
  26735. aimLevel = zoomLevel || this.baseFov / fov;
  26736. if (n == aimLevel) return;
  26737. var fun = function (e) {
  26738. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0);
  26739. }.bind(this);
  26740. y.start(
  26741. fun,
  26742. dur,
  26743. callback,
  26744. null,
  26745. 0,
  26746. A[f.transition.blendEasing],
  26747. null,
  26748. window.fovTranId
  26749. );
  26750. }),
  26751. /* n.prototype.updateZoomPano = function() {
  26752. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  26753. var e = this.currentPano;
  26754. if (e) {
  26755. var t = this.zoomLevel > f.zoom.activationThreshold
  26756. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  26757. , n = !i && !this.isWarping()
  26758. , r = t //&& n ; // 允许flying状态下加载4K图
  26759. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  26760. this.panoRenderer.setZoomingActive(r, e, !0);
  26761. var o = function(e, t) {
  26762. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  26763. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  26764. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  26765. e.setZoomed(t)
  26766. }
  26767. .bind(this);
  26768. r && !e.zoomed ? (o(e, !0),
  26769. this.panoRenderer. (function() {
  26770. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  26771. r && o(e, !0)
  26772. }
  26773. .bind(this))) : !t && e.zoomed && o(e, !1)
  26774. }
  26775. }
  26776. }, */
  26777. (n.prototype.updateZoomPano = function () {
  26778. if (
  26779. !this.panoRenderer.zoomPanoRenderingDisabled &&
  26780. this.mode === u.PANORAMA &&
  26781. this.currentPano
  26782. ) {
  26783. let navTileClass = this.qualityManager.getNavZoomClass();
  26784. let tileClass = this.qualityManager.getMaxZoomClass();
  26785. let levelThreshold1 = navTileClass == '1k' ? 1.3 : 1.8,
  26786. levelThreshold2 = 2; //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  26787. var t = this.zoomLevel > levelThreshold1,
  26788. i = this.flying && this.nextPano && this.nextPano !== this.currentPano,
  26789. n = !i && !this.isWarping(),
  26790. r = t; //&& n ; // 允许flying状态下加载4K图
  26791. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  26792. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  26793. var o = function (pano, ifZoom) {
  26794. this.panoRenderer.resetRenderStatus(
  26795. pano.id,
  26796. !1,
  26797. !0,
  26798. this.qualityManager.getMaxNavPanoSize()
  26799. ),
  26800. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  26801. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  26802. pano.setZoomed(ifZoom);
  26803. }.bind(this);
  26804. let zoomLevelRes = this.qualityManager.zoomLevelResolution;
  26805. if (r && (!this.currentPano.zoomed || (zoomLevelRes && zoomLevelRes != '4k'))) {
  26806. //needZoom
  26807. this.currentPano.zoomed || o(this.currentPano, !0);
  26808. if (
  26809. navTileClass == '1k' &&
  26810. tileClass != '1k' &&
  26811. this.zoomLevel < levelThreshold2
  26812. ) {
  26813. this.panoRenderer.enableHighQuality(
  26814. function () {
  26815. //开启2k
  26816. if (tileClass != '4k') {
  26817. o(this.currentPano, !0);
  26818. }
  26819. }.bind(this)
  26820. );
  26821. } else {
  26822. this.panoRenderer.enableUltraHighQualityMode(
  26823. function () {
  26824. //开启4k getMaxZoomPanoSize
  26825. this.qualityManager.useUltraHighResolutionPanos &&
  26826. !f.zoom.overridemax &&
  26827. (f.zoom.max = D.ultraHighQualityMaxZoom);
  26828. o(this.currentPano, !0);
  26829. }.bind(this)
  26830. );
  26831. }
  26832. } else {
  26833. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  26834. }
  26835. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  26836. if (r && navTileClass == '1k' && tileClass == '4k') {
  26837. //目前只有手机端navTileClass == '1k'
  26838. var change = (zoomedFlag) => {
  26839. this.qualityManager.updateMaximums(); //更新maxZoomPanoSize
  26840. this.panoRenderer.setupZoomRenderTarget(); //更新renderTarget
  26841. //this.currentPano.setZoomed(t);//更新uniforms贴图
  26842. };
  26843. this.qualityManager.zoomLevelResolution =
  26844. this.zoomLevel >= levelThreshold2
  26845. ? '4k'
  26846. : this.zoomLevel > levelThreshold1
  26847. ? '2k'
  26848. : '1k';
  26849. if (this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2) {
  26850. //1k/2k-4k
  26851. change();
  26852. o(this.currentPano, t);
  26853. } else if (
  26854. this.oldZoomLevel <= levelThreshold1 &&
  26855. this.zoomLevel > levelThreshold1
  26856. ) {
  26857. //1k-2k
  26858. change();
  26859. } else if (
  26860. this.oldZoomLevel > levelThreshold2 &&
  26861. this.zoomLevel <= levelThreshold2
  26862. ) {
  26863. //4k-2k/1k
  26864. change();
  26865. o(this.currentPano, t);
  26866. } else if (
  26867. this.oldZoomLevel > levelThreshold1 &&
  26868. this.zoomLevel <= levelThreshold1
  26869. ) {
  26870. //2k-1k
  26871. change();
  26872. }
  26873. this.oldZoomLevel = this.zoomLevel;
  26874. }
  26875. }
  26876. });
  26877. (n.prototype.checkHasNeighbor = function (pano) {
  26878. //add
  26879. for (var i in pano.neighbourPanos) {
  26880. if (i == pano.id) continue;
  26881. if (pano.neighbourPanos[i]) {
  26882. return true;
  26883. }
  26884. }
  26885. }),
  26886. (t.exports = n);
  26887. }.call(this, '/js/player.js'));
  26888. },
  26889. {
  26890. './constants': 8,
  26891. './enum/AlignmentType': 17,
  26892. './enum/BlackoutStyle': 18,
  26893. './enum/ControlEvents': 21,
  26894. './enum/Keys': 30,
  26895. './enum/ModelManagerEvents': 33,
  26896. './enum/PanoSizeClass': 36,
  26897. './enum/PanoramaEvents': 37,
  26898. './enum/PathDiscardMode': 38,
  26899. './enum/PathDisplayMode': 39,
  26900. './enum/PlayerEvents': 40,
  26901. './enum/TagStates': 44,
  26902. './enum/Vectors': 50,
  26903. './enum/Viewmode': 51,
  26904. './enum/WarpStyle': 52,
  26905. './enum/ZoomEvents': 53,
  26906. './exception/BasicException': 55,
  26907. './model/ModelManager': 140,
  26908. './objects/NSpider': 147,
  26909. './objects/Panorama': 148,
  26910. './objects/Reticule': 149,
  26911. './objects/ShowPath': 151,
  26912. './objects/Snapshot': 153,
  26913. './objects/View': 154,
  26914. './settings': 166,
  26915. './shaders': 167,
  26916. './tile/TileDownloader': 171,
  26917. './tile/TilePrioritizer': 172,
  26918. './util/ZoomStats': 179,
  26919. './util/browser': 182,
  26920. './util/camera': 183,
  26921. './util/cameraLight': 184,
  26922. './util/common': 185,
  26923. './util/easing': 186,
  26924. './util/history': 187,
  26925. './util/lerp': 188,
  26926. './util/logger': 189,
  26927. './util/math': 190,
  26928. './util/transitions': 195,
  26929. hot: 'hot',
  26930. scaleImg: 'scaleImg',
  26931. events: 202,
  26932. three: 217,
  26933. },
  26934. ],
  26935. scaleImg: [
  26936. function (t, e) {
  26937. // xzw
  26938. var OUTPUT = e;
  26939. (function () {
  26940. function t(t, a, i, r) {
  26941. function h() {
  26942. (B = 'object' == typeof i ? i : a.src || r ? u : document.createElement('canvas')),
  26943. (B.width = s),
  26944. (B.height = f),
  26945. (G = B.getContext('2d'));
  26946. }
  26947. function n(t) {
  26948. if (t) {
  26949. var e,
  26950. a = G.getImageData(0, 0, s, f),
  26951. i = a.data;
  26952. for (e = 0; at > e; e += 4)
  26953. (i[e] = (t[e] * it) | 0),
  26954. (i[e + 1] = (t[e + 1] * it) | 0),
  26955. (i[e + 2] = (t[e + 2] * it) | 0),
  26956. (i[e + 3] = (t[e + 3] * it) | 0);
  26957. return delete t, a;
  26958. }
  26959. return G.getImageData(0, 0, s, f);
  26960. }
  26961. function o(t, e, a, i, r) {
  26962. return (
  26963. 0.5 * (i - e + (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) * t) * t + a
  26964. );
  26965. }
  26966. a || ((a = t.input), (i = t.output), (r = t.inputRemovable), t.scale && (t = t.scale));
  26967. var u, d;
  26968. if (a.src)
  26969. if (((u = document.createElement('canvas')), null != a.naturalWidth))
  26970. (u.width = a.naturalWidth), (u.height = a.naturalHeight);
  26971. else if (null != a.runtimeStyle) {
  26972. var l = a.runtimeStyle,
  26973. c = l.width,
  26974. g = l.height;
  26975. (l.width = 'auto'),
  26976. (l.height = 'auto'),
  26977. (u.width = a.width),
  26978. (u.height = a.height),
  26979. (l.width = c),
  26980. (l.height = g);
  26981. } else {
  26982. var c = a.width,
  26983. g = a.height;
  26984. a.removeAttribute && (a.removeAttribute('width'), a.removeAttribute('height')),
  26985. (u.width = a.width),
  26986. (u.height = a.height),
  26987. (a.width = c),
  26988. (a.height = g);
  26989. }
  26990. else u = a;
  26991. (d = u.getContext('2d')), a.src && d.drawImage(a, 0, 0);
  26992. var s,
  26993. f,
  26994. m = u.width,
  26995. w = u.height,
  26996. p = d.getImageData(0, 0, m, w).data;
  26997. if (!m || !w) return !1;
  26998. (a.src || r) && u.clearRect(0, 0, m, w),
  26999. 'object' == typeof t
  27000. ? t.width
  27001. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  27002. : ((s = (m * t.scaleX + 0.5) | 0), (f = (w * t.scaleY + 0.5) | 0))
  27003. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0));
  27004. var v,
  27005. b,
  27006. y,
  27007. x,
  27008. D,
  27009. I,
  27010. A,
  27011. j,
  27012. R,
  27013. k,
  27014. C,
  27015. E,
  27016. F,
  27017. L,
  27018. S,
  27019. U,
  27020. W,
  27021. H,
  27022. alpha,
  27023. X,
  27024. Y,
  27025. q,
  27026. z,
  27027. B,
  27028. G,
  27029. J,
  27030. K,
  27031. M,
  27032. N,
  27033. O,
  27034. P,
  27035. Q,
  27036. T,
  27037. V,
  27038. Z,
  27039. $ = s << 2,
  27040. _ = m << 2,
  27041. tt = 0,
  27042. et = 0,
  27043. at = $ * f,
  27044. it = 255.99 / 255,
  27045. rt = s / m,
  27046. ht = f / w,
  27047. nt = rt * ht;
  27048. if (rt > 1 || ht > 1)
  27049. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  27050. for (
  27051. b = x / ht,
  27052. R = 0 | b,
  27053. q = b - R,
  27054. N = R * _,
  27055. M = 1 > R ? N : N - _,
  27056. w - 2 > R ? ((O = N + _), (P = (R + 2) * _)) : (O = P = R > w - 2 ? N : N + _),
  27057. y = 0;
  27058. s > y;
  27059. y++, et += 4
  27060. )
  27061. (v = y / rt),
  27062. (j = 0 | v),
  27063. (z = v - j),
  27064. (T = j << 2),
  27065. (Q = 1 > j ? T : T - 4),
  27066. m - 2 > j ? ((V = T + 4), (Z = T + 8)) : (V = Z = j > m - 2 ? T : T + 4),
  27067. (H =
  27068. (o(
  27069. q,
  27070. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27071. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27072. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27073. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27074. ) *
  27075. it) |
  27076. 0),
  27077. ++Q,
  27078. ++T,
  27079. ++V,
  27080. ++Z,
  27081. (X =
  27082. (o(
  27083. q,
  27084. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27085. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27086. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27087. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27088. ) *
  27089. it) |
  27090. 0),
  27091. ++Q,
  27092. ++T,
  27093. ++V,
  27094. ++Z,
  27095. (Y =
  27096. (o(
  27097. q,
  27098. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27099. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27100. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27101. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27102. ) *
  27103. it) |
  27104. 0),
  27105. ++Q,
  27106. ++T,
  27107. ++V,
  27108. ++Z,
  27109. (alpha =
  27110. (o(
  27111. q,
  27112. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27113. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27114. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27115. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27116. ) *
  27117. it) |
  27118. 0),
  27119. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  27120. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  27121. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  27122. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0);
  27123. else {
  27124. if (e.Float32Array) W = new Float32Array(at);
  27125. else for (W = [], et = 0; at > et; ++et) W[et] = 0;
  27126. for (b = 0; w > b; b++)
  27127. for (
  27128. x = b * ht,
  27129. A = 0 | x,
  27130. D = A * $,
  27131. U = !!((A - ((x + ht) | 0)) * (w - 1 - b)) << 1,
  27132. U && ((F = A + 1 - x), (L = x + ht - A - 1)),
  27133. v = 0;
  27134. m > v;
  27135. v++, tt += 4
  27136. )
  27137. switch (
  27138. ((y = v * rt),
  27139. (I = 0 | y),
  27140. (et = D + (I << 2)),
  27141. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  27142. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  27143. (H = p[tt]),
  27144. (X = p[tt + 1]),
  27145. (Y = p[tt + 2]),
  27146. (alpha = p[tt + 3]),
  27147. S + U)
  27148. ) {
  27149. case 0:
  27150. (W[et] += H * nt),
  27151. (W[et + 1] += X * nt),
  27152. (W[et + 2] += Y * nt),
  27153. (W[et + 3] += alpha * nt);
  27154. break;
  27155. case 1:
  27156. (k = C * ht),
  27157. (W[et] += H * k),
  27158. (W[et + 1] += X * k),
  27159. (W[et + 2] += Y * k),
  27160. (W[et + 3] += alpha * k),
  27161. (k = E * ht),
  27162. (W[et + 4] += H * k),
  27163. (W[et + 5] += X * k),
  27164. (W[et + 6] += Y * k),
  27165. (W[et + 7] += alpha * k);
  27166. break;
  27167. case 2:
  27168. (k = rt * F),
  27169. (W[et] += H * k),
  27170. (W[et + 1] += X * k),
  27171. (W[et + 2] += Y * k),
  27172. (W[et + 3] += alpha * k),
  27173. (k = rt * L),
  27174. (et += $),
  27175. (W[et] += H * k),
  27176. (W[et + 1] += X * k),
  27177. (W[et + 2] += Y * k),
  27178. (W[et + 3] += alpha * k);
  27179. break;
  27180. default:
  27181. (k = C * F),
  27182. (W[et] += H * k),
  27183. (W[et + 1] += X * k),
  27184. (W[et + 2] += Y * k),
  27185. (W[et + 3] += alpha * k),
  27186. (k = E * F),
  27187. (W[et + 4] += H * k),
  27188. (W[et + 5] += X * k),
  27189. (W[et + 6] += Y * k),
  27190. (W[et + 7] += alpha * k),
  27191. (k = C * L),
  27192. (et += $),
  27193. (W[et] += H * k),
  27194. (W[et + 1] += X * k),
  27195. (W[et + 2] += Y * k),
  27196. (W[et + 3] += alpha * k),
  27197. (k = E * L),
  27198. (W[et + 4] += H * k),
  27199. (W[et + 5] += X * k),
  27200. (W[et + 6] += Y * k),
  27201. (W[et + 7] += alpha * k);
  27202. }
  27203. delete p, h(), (J = n(W));
  27204. }
  27205. if ((G.putImageData(J, 0, 0), 'string' == typeof i)) {
  27206. if ('png' === i || 'jpeg' === i) {
  27207. var ot;
  27208. return (
  27209. (ot = r && a.src ? a : new Image()),
  27210. (ot.width = s),
  27211. (ot.height = f),
  27212. (ot.src = B.toDataURL('image/' + i, 0.85)),
  27213. ot
  27214. );
  27215. }
  27216. if ('png-src' === i || 'jpeg-src' === i)
  27217. return B.toDataURL('image/' + i.split('-')[0], 0.85);
  27218. }
  27219. return B;
  27220. }
  27221. var e = this;
  27222. 'undefined' != typeof exports
  27223. ? ('undefined' != typeof module && module.exports && (exports = module.exports = t),
  27224. (exports.scale = t))
  27225. : (c = t);
  27226. }.call(this));
  27227. OUTPUT.exports = c;
  27228. },
  27229. {},
  27230. ],
  27231. 156: [
  27232. function (e, t, i) {
  27233. (function (i) {
  27234. 'use strict';
  27235. function n(e, t) {
  27236. (this.model = e),
  27237. (this.panos = e.panos),
  27238. (this.player = t),
  27239. (this.imagePanos = this.listImagePanos()),
  27240. (this.retryMinimumTime = 1e4);
  27241. }
  27242. var r = (e('three'), e('./enum/Viewmode')),
  27243. o = (e('./settings'), e('./objects/Panorama')),
  27244. a = e('./util/logger'),
  27245. s = new a(i);
  27246. (n.prototype.start = function () {
  27247. this.loadNextPano(
  27248. function (e) {
  27249. e
  27250. ? this.start()
  27251. : (s.debug(
  27252. 'No suitable pano loaded, waiting a little while before looking again'
  27253. ),
  27254. setTimeout(
  27255. function () {
  27256. this.start();
  27257. }.bind(this),
  27258. 1e3
  27259. ));
  27260. }.bind(this)
  27261. );
  27262. }),
  27263. (n.prototype.validLoadTarget = function (e) {
  27264. return (
  27265. e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  27266. );
  27267. }),
  27268. (n.prototype.listImagePanos = function () {
  27269. var e = [],
  27270. t = this;
  27271. return (
  27272. this.model.images.forEach(function (i) {
  27273. if (i.metadata && i.metadata.scan_id) {
  27274. var n = t.model.panos.get(i.metadata.scan_id);
  27275. n && !n.isLoaded('high') && e.push(n);
  27276. }
  27277. }),
  27278. e
  27279. );
  27280. }),
  27281. (n.prototype.nextNotLoadedImage = function () {
  27282. for (; this.imagePanos.length > 0; ) {
  27283. var e = this.imagePanos[0];
  27284. if (!e.isLoaded('high')) return e;
  27285. this.imagePanos.shift();
  27286. }
  27287. return null;
  27288. }),
  27289. (n.prototype.loadNextPano = function (e) {
  27290. var t,
  27291. i,
  27292. n = this.model.waitQueue.filter(function (e) {
  27293. return e.object instanceof o;
  27294. });
  27295. n.length > 0
  27296. ? ((t = n[0].object),
  27297. s.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  27298. : this.validLoadTarget(this.player.currentPano)
  27299. ? ((t = this.player.currentPano),
  27300. s.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  27301. : this.validLoadTarget(this.player.closestPano)
  27302. ? ((t = this.player.closestPano),
  27303. s.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  27304. : this.validLoadTarget(this.nextNotLoadedImage())
  27305. ? ((i = 'high'),
  27306. (t = this.imagePanos[0]),
  27307. s.debug('Overrode pano selection: Highlight image ' + t.id))
  27308. : this.player.mode === r.PANORAMA &&
  27309. ((t = this.panos.lowestByScore(
  27310. [
  27311. this.validLoadTarget.bind(this),
  27312. o.filters.isNeighbourPanoTo(this.player.currentPano),
  27313. ],
  27314. [
  27315. o.scoreFunctions.distance(this.player.currentPano),
  27316. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  27317. o.scoreFunctions.inFieldOfView(
  27318. this.player.position,
  27319. this.player.getDirection()
  27320. ),
  27321. ]
  27322. )),
  27323. t && s.debug('Normal pano selection: neighbor ' + t.id)),
  27324. t
  27325. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  27326. s.debug('Preloading ' + i + '-res pano ' + t.id),
  27327. t
  27328. .loadCube(i)
  27329. .done(e)
  27330. .fail(function () {
  27331. s.warn(
  27332. 'Failed preloading pano',
  27333. t.id,
  27334. ', marking it as failed and forgetting it for a while'
  27335. ),
  27336. e();
  27337. }))
  27338. : e && e(null);
  27339. }),
  27340. (t.exports = n);
  27341. }.call(this, '/js/preloaders.js'));
  27342. },
  27343. {
  27344. './enum/Viewmode': 51,
  27345. './objects/Panorama': 148,
  27346. './settings': 166,
  27347. './util/logger': 189,
  27348. three: 217,
  27349. },
  27350. ],
  27351. 157: [
  27352. function (e, t, i) {
  27353. (function (i) {
  27354. 'use strict';
  27355. function n(e, t, i, n, r) {
  27356. (this.qualityManager = e),
  27357. (this.scene = t),
  27358. (this.camera = i),
  27359. (this.container = r),
  27360. (this.controls = n),
  27361. (this.controls.enabled = !0),
  27362. (this.controls.locked = !0),
  27363. (this.quickstartCamera = n.camera),
  27364. (this.quickstartCamera.fov = h.clampVFOV(
  27365. a.insideFOV,
  27366. a.insideFOVMax,
  27367. $('#player').width(),
  27368. $('#player').height()
  27369. )),
  27370. (this.skybox = null);
  27371. }
  27372. var r = e('three'),
  27373. o = e('../util/logger'),
  27374. a = e('../constants'),
  27375. s =
  27376. (e('../util/transitions'),
  27377. e('../util/lerp'),
  27378. e('../util/easing'),
  27379. e('../enum/Vectors')),
  27380. l = e('../enum/PanoSizeClass'),
  27381. c = (e('../materials/ModelTextureMaterial'), e('../materials/CubemapMaterial')),
  27382. h =
  27383. (e('../cameras/PanoramaCamera'),
  27384. e('../controls/PanoramaControls'),
  27385. e('../tile/TileUtils'),
  27386. e('../util/camera'),
  27387. e('../util/cameraLight')),
  27388. u = (e('../util/browser'), e('../settings'), e('../gui/helpManager'), new o(i));
  27389. (n.prototype.load = function (e) {
  27390. e.pano.shouldRedrawOnBaseLoaded = !0;
  27391. var t,
  27392. i,
  27393. n = this,
  27394. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  27395. o = r.clone().negate();
  27396. this.controls.lookAt(r.add(this.quickstartCamera.position));
  27397. var a = this.qualityManager.getPanoSize(l.BASE),
  27398. c = this.qualityManager.getPanoSize(l.STANDARD);
  27399. if (e.pano.tiled) {
  27400. u.warn('Loading startPano, TILED', e.pano.id);
  27401. var d = h.getHFOVForCamera(
  27402. this.quickstartCamera,
  27403. $('#player').width(),
  27404. $('#player').height()
  27405. ),
  27406. p = this.quickstartCamera.fov;
  27407. u.warn(
  27408. 'Quickstart loading tiles in frustum: [horizontal FOV: ' +
  27409. d +
  27410. ', vertical FOV: ' +
  27411. p +
  27412. ']'
  27413. ),
  27414. (t = e.pano.loadTiledPano(
  27415. c,
  27416. r,
  27417. {
  27418. hFov: d,
  27419. vFov: p,
  27420. },
  27421. !1,
  27422. !1,
  27423. !0
  27424. )),
  27425. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0));
  27426. } else u.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'));
  27427. return $.when(t).then(
  27428. function () {
  27429. n.init(e.pano, e.quaternion),
  27430. e.pano.tiled
  27431. ? i.done(
  27432. function () {
  27433. (e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1);
  27434. }.bind(this)
  27435. )
  27436. : (this.controls.locked = !1);
  27437. }.bind(this)
  27438. );
  27439. }),
  27440. (n.prototype.init = function (e, t) {
  27441. u.info('Quickstart done loading, adding scene objects'),
  27442. (e.lockUntilRenderingComplete = !0),
  27443. (this.skybox = new r.Mesh(
  27444. new r.CubeGeometry(1, 1, 1),
  27445. new c({
  27446. side: r.BackSide,
  27447. })
  27448. )),
  27449. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  27450. this.skybox.quaternion.copy(e.quaternion),
  27451. this.scene.add(this.skybox),
  27452. $(this.container).show();
  27453. }),
  27454. (n.prototype.update = function (e) {
  27455. this.controls.update(e), this.camera.copy(this.quickstartCamera);
  27456. }),
  27457. (n.prototype.setSize = function (e, t) {
  27458. this.quickstartCamera.updateAspect(e / t);
  27459. }),
  27460. (n.prototype.destroy = function () {
  27461. this.scene.remove(this.skybox);
  27462. }),
  27463. (t.exports = n);
  27464. }.call(this, '/js/scene/QuickstartManager.js'));
  27465. },
  27466. {
  27467. '../cameras/PanoramaCamera': 7,
  27468. '../constants': 8,
  27469. '../controls/PanoramaControls': 13,
  27470. '../enum/PanoSizeClass': 36,
  27471. '../enum/Vectors': 50,
  27472. '../gui/helpManager': 68,
  27473. '../materials/CubemapMaterial': 117,
  27474. '../materials/ModelTextureMaterial': 118,
  27475. '../settings': 166,
  27476. '../tile/TileUtils': 174,
  27477. '../util/browser': 182,
  27478. '../util/camera': 183,
  27479. '../util/cameraLight': 184,
  27480. '../util/easing': 186,
  27481. '../util/lerp': 188,
  27482. '../util/logger': 189,
  27483. '../util/transitions': 195,
  27484. three: 217,
  27485. },
  27486. ],
  27487. 158: [
  27488. function (e, t, i) {
  27489. 'use strict';
  27490. function n(e, t, i) {
  27491. (this.scene = e),
  27492. (this.camera = t),
  27493. (this.renderer = null),
  27494. (this.effects = i),
  27495. (this.animateCallback = null),
  27496. (this.composer = null),
  27497. (this.qualityManager = null),
  27498. (e.renderWidth = 0),
  27499. (e.renderHeight = 0),
  27500. (this.updateClock = new r.Clock()),
  27501. (this.components = []),
  27502. (this.updateListeners = []),
  27503. (this.resizeListeners = []),
  27504. (this.forceUpdateSize = !1),
  27505. (this.started = !1),
  27506. (this.textures = {}),
  27507. (this.suspendedObjects = []);
  27508. }
  27509. var r = e('three'),
  27510. o = e('../shaders'),
  27511. a = e('../enum/SceneRendererEvents'),
  27512. s = e('../enum/GLTextureType'),
  27513. l = e('../enum/GLCubeFaces'),
  27514. c = e('../exception/BasicException'),
  27515. h = e('../exception/RendererCreationException'),
  27516. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  27517. m = e('../util/browser'),
  27518. /**************************************************************************************************************************************************/
  27519. u = e('../settings'),
  27520. d = e('events').EventEmitter;
  27521. (window.requestAnimationFrame =
  27522. window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  27523. (n.prototype = Object.create(d.prototype)),
  27524. (n.prototype.addComponent = function (e) {
  27525. this.components.push(e),
  27526. e.update && this.updateListeners.push(e),
  27527. e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0));
  27528. }),
  27529. (n.prototype.removeComponent = function (e) {
  27530. var t = function (t) {
  27531. return t !== e;
  27532. };
  27533. (this.components = this.components.filter(t)),
  27534. (this.updateListeners = this.updateListeners.filter(t)),
  27535. (this.resizeListeners = this.resizeListeners.filter(t));
  27536. }),
  27537. (n.prototype.start = function (e) {
  27538. if (this.started) throw new c("Can't start SceneRenderer, already started");
  27539. this.createContext(e),
  27540. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  27541. m.isMobile() && this.boluoVrInit(),
  27542. /*******************************************************************************************************************************/
  27543. this.initComposer(),
  27544. (this.started = !0),
  27545. (p = p.bind(this))();
  27546. }),
  27547. (n.prototype.createContext = function (e) {
  27548. var transparent = !!(settings.transparentBg || settings.bgImg);
  27549. try {
  27550. (this.renderer = new r.WebGLRenderer({
  27551. antialias: !m.isMobile(),
  27552. alpha: transparent,
  27553. })),
  27554. (this.renderer.autoClear = !0),
  27555. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  27556. this.renderer.setSize($('#player').width(), $('#player').height(), false), //改
  27557. transparent && this.renderer.setClearColor(0x000000, 0); //透明
  27558. this.emit(a.ContextCreated);
  27559. } catch (e) {
  27560. throw new h('Unable to create a WebGL rendering context');
  27561. }
  27562. u.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement);
  27563. /* window.stats = new Stats();
  27564. e.appendChild( stats.dom ); */
  27565. }),
  27566. (n.prototype.overrideTextures = function () {
  27567. var e = this.renderer.context,
  27568. t = 0,
  27569. i = e.createTexture;
  27570. e.createTexture = function () {
  27571. var n = i.call(e);
  27572. return (n.id = t++), (this.textures[n.id] = n), n;
  27573. }.bind(this);
  27574. var n = e.texImage2D;
  27575. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  27576. var d,
  27577. p = this.getTextureTypeFromTarget(e, t);
  27578. (d =
  27579. p === s.TextureCube
  27580. ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP)
  27581. : e.getParameter(e.TEXTURE_BINDING_2D)),
  27582. void 0 !== c
  27583. ? n.call(e, t, i, r, o, a, l, c, h, u)
  27584. : ((c = o),
  27585. (h = a),
  27586. (u = l),
  27587. (o = u.naturalWidth),
  27588. (a = u.naturalHeight),
  27589. n.call(e, t, i, r, c, h, u));
  27590. var f = this.textures[d.id];
  27591. (f.width = p === s.TextureCube ? 6 * o : o), (f.height = a);
  27592. }.bind(this);
  27593. var r = e.deleteTexture;
  27594. e.deleteTexture = function (t) {
  27595. delete this.textures[t.id], r.call(e, t);
  27596. }.bind(this);
  27597. }),
  27598. (n.prototype.updateTextureMemory = (function () {
  27599. var e = null;
  27600. return function () {
  27601. var t = 0;
  27602. for (var i in this.textures) {
  27603. var n = this.textures[i];
  27604. n.width && n.height && (t += n.width * n.height * 4);
  27605. }
  27606. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t);
  27607. };
  27608. })()),
  27609. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  27610. switch (t) {
  27611. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  27612. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  27613. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  27614. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27615. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  27616. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27617. return s.TextureCube;
  27618. case e.TEXTURE_2D:
  27619. return s.Texture2D;
  27620. default:
  27621. return null;
  27622. }
  27623. }),
  27624. (n.prototype.initComposer = function () {
  27625. (this.composer = new r.EffectComposer(this.renderer)),
  27626. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  27627. //this.composer.addPass(this.effects.hblurPass),
  27628. //this.composer.addPass(this.effects.vblurPass)
  27629. this.composer.addPass(this.effects.transitionMaskPass); //add
  27630. }),
  27631. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  27632. (this.renderWidth = e),
  27633. (this.renderHeight = t),
  27634. (this.effects.aspect = e / t),
  27635. /* this.renderer.setSize(e, t), -----MP */
  27636. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  27637. this.composer.setSize(e, t);
  27638. for (var i = 0; i < this.resizeListeners.length; i++)
  27639. this.resizeListeners[i].setSize(e, t);
  27640. }),
  27641. (n.prototype.render = function () {
  27642. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  27643. this.effects.transitionMaskPass.enabled
  27644. ? this.composer.render()
  27645. : this.renderer.render(this.scene, this.camera);
  27646. });
  27647. /******************************************************************************************************徐世廷**********************************************************************/
  27648. var vrPermission = {};
  27649. var vrPermissionCallBack = function (info1, info2) {
  27650. if (info1 == 'reset') {
  27651. vrPermission = {};
  27652. } else {
  27653. vrPermission[info1] = info2;
  27654. if (
  27655. Object.keys(vrPermission).length == 2 &&
  27656. (vrPermission.deviceMotion != 'granted' ||
  27657. vrPermission.deviceOrientation != 'granted')
  27658. ) {
  27659. alert(
  27660. '运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。'
  27661. );
  27662. }
  27663. }
  27664. };
  27665. (n.prototype.boluoVrInit = function () {
  27666. console.log('boluoVrInit');
  27667. //webxr.init(this.renderer)
  27668. (this.isHuawei5X = m.detectHUAWEI5X()),
  27669. (this.oldRenderer = this.renderer),
  27670. (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera));
  27671. window.panoCamera = this.camera;
  27672. var a = this;
  27673. (window._vrEnabled = !1),
  27674. Object.defineProperty(window, 'vrEnabled', {
  27675. get: function () {
  27676. return window._vrEnabled;
  27677. },
  27678. set: function (b) {
  27679. //if(webxr.xrType)return webxr.enterVR()
  27680. b = !!b;
  27681. b
  27682. ? ((a.renderer = a.newRenderer),
  27683. window.vrMarkers.forEach(function (a) {
  27684. a.visible = !0;
  27685. }))
  27686. : ((a.renderer = a.oldRenderer),
  27687. window.vrMarkers.forEach(function (a) {
  27688. a.visible = !1;
  27689. })),
  27690. (a.cursor.visible = b),
  27691. a.setSize(window.innerWidth, window.innerHeight),
  27692. (window._vrEnabled = b);
  27693. if (b) {
  27694. setTimeout(function () {
  27695. console.log('orientEnable' + window.orientEnable);
  27696. if (window.vrEnabled && !window.orientEnable) {
  27697. //很可能没能触发陀螺仪事件
  27698. if (m.detectIOS() /* && m.detectSafari() */) {
  27699. var b = m.iosVersion(); //{major: 10, minor: 3, patch: 1}
  27700. console.log('开始获取权限 major' + b.major);
  27701. if (b.major == 12 && b.minor >= 2) {
  27702. if (browser.detectSafari())
  27703. alert(
  27704. '浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。'
  27705. );
  27706. else {
  27707. //app??
  27708. alert(
  27709. '浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。'
  27710. );
  27711. }
  27712. } else if (b.major >= 13) {
  27713. if (!window.location.href.includes('https://')) {
  27714. console.log('需要https');
  27715. alert('当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。');
  27716. return;
  27717. }
  27718. var hasFailed =
  27719. window.vrPermission &&
  27720. (window.vrPermission.deviceMotion != 'granted' ||
  27721. window.vrPermission.deviceOrientation != 'granted');
  27722. setTimeout(
  27723. () => {
  27724. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  27725. if (!window.vrEnabled || window.orientEnable) return;
  27726. vrPermissionCallBack('reset');
  27727. console.log(window.DeviceMotionEvent);
  27728. if (
  27729. window.DeviceMotionEvent &&
  27730. window.DeviceMotionEvent.requestPermission &&
  27731. typeof window.DeviceMotionEvent.requestPermission === 'function'
  27732. ) {
  27733. console.log('开始获取权限1');
  27734. ///注意:需要https 本地服务器permissionState会得到denied
  27735. window.DeviceMotionEvent.requestPermission()
  27736. .then((permissionState) => {
  27737. console.log('permissionState1: ' + permissionState);
  27738. vrPermissionCallBack('deviceMotion', permissionState);
  27739. })
  27740. .catch(function (e) {
  27741. vrPermissionCallBack('deviceMotion', false);
  27742. console.log(e);
  27743. });
  27744. } else {
  27745. console.log('window.DeviceMotionEvent undefined');
  27746. vrPermissionCallBack('deviceMotion', false);
  27747. }
  27748. if (
  27749. window.DeviceOrientationEvent &&
  27750. window.DeviceOrientationEvent.requestPermission &&
  27751. typeof window.DeviceOrientationEvent.requestPermission ===
  27752. 'function'
  27753. ) {
  27754. console.log('开始获取权限2');
  27755. window.DeviceOrientationEvent.requestPermission()
  27756. .then((permissionState) => {
  27757. console.log('permissionState2: ' + permissionState);
  27758. vrPermissionCallBack('deviceOrientation', permissionState);
  27759. })
  27760. .catch(function (e) {
  27761. vrPermissionCallBack('deviceOrientation', false);
  27762. console.log(e);
  27763. });
  27764. } else {
  27765. console.log('window.DeviceOrientationEvent undefined');
  27766. vrPermissionCallBack('deviceOrientation', false);
  27767. }
  27768. },
  27769. hasFailed ? 0 : 150
  27770. );
  27771. /* /* setTimeout(function(){
  27772. if(settings.vrEnabled && !window.orientEnable){
  27773. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  27774. }
  27775. },4000) */
  27776. } else console.log('陀螺仪未能启用 ios ' + b.major + '.' + b.minor);
  27777. } else {
  27778. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  27779. }
  27780. } else {
  27781. //已经触发了
  27782. }
  27783. }, 200);
  27784. }
  27785. },
  27786. }),
  27787. this.createCursor(0.5, !1, 1, 16777215, 0);
  27788. var b = {
  27789. setSize: function (b, c) {
  27790. a.camera.aspect = b / c;
  27791. },
  27792. };
  27793. this.resizeListeners.push(b), this.vrLoadingInit();
  27794. }),
  27795. (n.prototype.vrLoadingInit = function () {
  27796. var a = function (camera) {
  27797. var a = this,
  27798. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  27799. c = new r.MeshBasicMaterial({
  27800. color: 4967932,
  27801. side: r.DoubleSide,
  27802. }),
  27803. d = new r.Mesh(b, c);
  27804. (this.mesh = d),
  27805. (d.position.z = -2),
  27806. d.scale.set(0.08, 0.08, 0.08),
  27807. (d.visible = !1),
  27808. camera.add(d),
  27809. //window.player.camera.add(d),
  27810. (a.enabled = !1),
  27811. (this.update = function (b) {
  27812. 1 == a.enabled && (d.rotation.z += 15 * b);
  27813. });
  27814. },
  27815. a = new a(this.camera);
  27816. (window.Loading = a), this.updateListeners.push(a);
  27817. }),
  27818. (n.prototype.createCursor = function (a, b, c, d, e) {
  27819. var g,
  27820. h = new r.SpriteMaterial({
  27821. opacity: c,
  27822. color: d,
  27823. transparent: b,
  27824. map: this.boluoGetTexture('images/cursor.png'),
  27825. needsUpdate: !0,
  27826. side: r.DoubleSide,
  27827. });
  27828. (h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  27829. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  27830. (h.depthTest = !1),
  27831. (h.blending = r.AdditiveBlending),
  27832. (g = new r.Sprite(h)),
  27833. // g.scale.set(a, a, a),
  27834. g.scale.set(0.3, 0.3, 0.3);
  27835. (g.position.z = -2),
  27836. (g.visible = !1),
  27837. (g.name = 'cursor'),
  27838. this.camera.add(g),
  27839. this.scene.add(this.camera),
  27840. (this.cursor = g);
  27841. var i = new this.CursorAnimation(this.scene, g, this.camera);
  27842. (this.cursor.triggerTargetEvent = i.triggerTargetEvent), this.updateListeners.push(i);
  27843. }),
  27844. (window.orientEnable = 0); //是否能触发deviceorientation
  27845. (n.prototype.CursorAnimation = function (a, b, c) {
  27846. function d() {
  27847. g.orient = r.Math.degToRad(window.orientation || 0);
  27848. }
  27849. function e(a) {
  27850. if (!window.vrEnabled && window.orientEnable) return;
  27851. window.orientEnable || (window.orientEnable = 1);
  27852. var b = r.Math.degToRad(a.alpha),
  27853. c = r.Math.degToRad(a.beta),
  27854. d = r.Math.degToRad(a.gamma);
  27855. if (
  27856. (this.isHuawei5X
  27857. ? (-1e3 === g.alpha && (g.alpha = b),
  27858. -1e3 === g.beta && (g.beta = c),
  27859. -1e3 === g.gamma && (g.gamma = d),
  27860. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  27861. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  27862. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  27863. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  27864. n.vrDebug)
  27865. ) {
  27866. $('#info-device-orientation').css('display', 'block');
  27867. var e = '';
  27868. (e += 'alpha=(' + g.alpha + ')<BR/>'),
  27869. (e += 'beta=(' + g.beta + ')<BR/>'),
  27870. (e += 'gamma=' + g.gamma + '<BR/>'),
  27871. (document.getElementById('info-device-orientation').innerHTML = e);
  27872. }
  27873. }
  27874. (this.cursor = b),
  27875. (this.raycaster = new r.Raycaster()),
  27876. (this.targetEventObj = {}),
  27877. (this.type = 1),
  27878. (this.tweenFlag = !0);
  27879. var g = this;
  27880. (this.target = c),
  27881. console.log(c.uuid),
  27882. (this.euler = new r.Euler()),
  27883. (this.q0 = new r.Quaternion()),
  27884. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  27885. (this.zee = new r.Vector3(0, 0, 1)),
  27886. (this.alpha = -1e3),
  27887. (this.beta = -1e3),
  27888. (this.gamma = -1e3),
  27889. (this.orient = r.Math.degToRad(window.orientation || 0)),
  27890. window.addEventListener('orientationchange', d),
  27891. window.addEventListener('deviceorientation', e),
  27892. (this.setObjectQuaternion = function (a, b, d, e, f) {
  27893. g.euler.set(d, b, -e, 'YXZ'),
  27894. a.setFromEuler(g.euler),
  27895. a.multiply(g.q1),
  27896. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  27897. c.updateMatrixWorld();
  27898. }),
  27899. parent !== window &&
  27900. window.addEventListener('message', function (a) {
  27901. var b = JSON.parse(a.data),
  27902. c = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H');
  27903. b &&
  27904. b.alpha &&
  27905. b.beta &&
  27906. b.gamma &&
  27907. (function (a) {
  27908. var c = r.Math.degToRad(b.alpha),
  27909. d = r.Math.degToRad(b.beta),
  27910. e = r.Math.degToRad(b.gamma);
  27911. a
  27912. ? (-1e3 === g.alpha && (g.alpha = c),
  27913. -1e3 === g.beta && (g.beta = d),
  27914. -1e3 === g.gamma && (g.gamma = e),
  27915. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  27916. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  27917. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  27918. : ((g.alpha = c), (g.beta = d), (g.gamma = e));
  27919. })(c);
  27920. }),
  27921. (this.update = function (a) {
  27922. TWEEN.update();
  27923. if (window.ifTest && window.vrEnabled)
  27924. this.triggerTargetEvent(); //测试时不根据陀螺仪来转向
  27925. else
  27926. window.vrEnabled &&
  27927. (this.setObjectQuaternion(
  27928. this.target.quaternion,
  27929. this.alpha,
  27930. this.beta,
  27931. this.gamma,
  27932. this.orient
  27933. ),
  27934. this.triggerTargetEvent());
  27935. }),
  27936. (this.triggerTargetEvent = function () {
  27937. var a = this.choseObj(),
  27938. b = a ? a.object : void 0;
  27939. (this.targetEventObj.currentObj = b),
  27940. b !== this.targetEventObj.lastObj &&
  27941. (b && this.autoCursorPosition(a),
  27942. 1 === this.type
  27943. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  27944. b &&
  27945. b.enabled &&
  27946. this.startAnimate(
  27947. function () {
  27948. this.clickCallback(b);
  27949. }.bind(this)
  27950. ))
  27951. : this.type,
  27952. (this.targetEventObj.lastObj = b));
  27953. }),
  27954. (this.choseObj = function () {
  27955. this.raycaster.setFromCamera(
  27956. {
  27957. x: 0,
  27958. y: 0,
  27959. },
  27960. c
  27961. );
  27962. var a = (this.raycaster.ray, window.vrMarkers),
  27963. b = this.raycaster.intersectObjects(a);
  27964. if (b.length > 0) return b[0];
  27965. }),
  27966. (this.clickCallback = function (a) {
  27967. this.runTHREEAction(a, 'onclick');
  27968. }),
  27969. (this.runTHREEAction = function (a, b) {
  27970. switch (b) {
  27971. case 'onclick':
  27972. a._listeners &&
  27973. a._listeners.click &&
  27974. a._listeners.click.forEach(function (a) {
  27975. a();
  27976. });
  27977. break;
  27978. case 'onhover':
  27979. a._listeners &&
  27980. a._listeners.hover &&
  27981. a._listeners.hover.forEach(function (a) {
  27982. a();
  27983. });
  27984. break;
  27985. case 'onout':
  27986. a._listeners &&
  27987. a._listeners.out &&
  27988. a._listeners.out.forEach(function (a) {
  27989. a();
  27990. });
  27991. }
  27992. }),
  27993. (this.startAnimate = function (a) {
  27994. this.tweenFlag && this.initAnimation(a);
  27995. }),
  27996. (this.initAnimation = function (a) {
  27997. var b = this,
  27998. c = this.cursor.material.map.offset,
  27999. d = function (a) {
  28000. return Math.floor(17 * a) / 17;
  28001. };
  28002. (b.tweenFlag = !1),
  28003. (this.cursorAnimate = new TWEEN.Tween(c)
  28004. .to(
  28005. {
  28006. x: 1,
  28007. },
  28008. 1e3
  28009. )
  28010. .onStart(function () {
  28011. b.tweenFlag = !1;
  28012. })
  28013. .onStop(function () {
  28014. (b.tweenFlag = !0), (this.x = 0), (c.x = 0);
  28015. })
  28016. .onUpdate(function () {})
  28017. .onComplete(function () {
  28018. a(),
  28019. (c.x = 0),
  28020. setTimeout(function () {
  28021. b.tweenFlag = !0;
  28022. }, 1500);
  28023. })),
  28024. this.cursorAnimate.easing(d),
  28025. this.cursorAnimate.start();
  28026. }),
  28027. (this.autoCursorPosition = function (a) {
  28028. // var b = Math.abs(a.distance - 10);
  28029. // this.cursor.position.z = -b,
  28030. // b /= 10;
  28031. // alert(b);
  28032. // this.cursor.scale.set(b, b, b)
  28033. this.cursor.scale.set(0.3, 0.3, 0.3);
  28034. });
  28035. }),
  28036. (n.prototype.vrRenderer = function (a, b, c) {
  28037. var d = new b.vrCamera(c);
  28038. (d.bananaAspect = 0.8), this.width, this.height;
  28039. var b = this;
  28040. (this.setSize = function (c, d) {
  28041. a.setSize.call(this, c, d), (b.width = c), (b.height = d);
  28042. }),
  28043. (this.render = function (b, c, e, f) {
  28044. window.cameraQua = c.quaternion.clone();
  28045. var g, h;
  28046. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f);
  28047. if ('PerspectiveCamera' === c.type)
  28048. (g = d.cameraL),
  28049. (h = d.cameraR),
  28050. b.updateMatrixWorld(),
  28051. null === c.parent && c.updateMatrixWorld(),
  28052. d.vrCameraUpdate(c);
  28053. else {
  28054. if ('OrthographicCamera' !== c.type)
  28055. return DEBUG && console.error('Unsupported renderer: ', c.type);
  28056. g = h = c;
  28057. }
  28058. a.setScissorTest(!0),
  28059. a.setScissor(0, 0, this.width / 2, this.height),
  28060. a.setViewport(0, 0, this.width / 2, this.height),
  28061. a.render.call(this, b, g, e, f),
  28062. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  28063. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  28064. a.render.call(this, b, h, e, f),
  28065. a.setScissorTest(!1);
  28066. }),
  28067. (this.__proto__ = {
  28068. __proto__: a,
  28069. });
  28070. }),
  28071. (n.prototype.vrCamera = function (a) {
  28072. (this.type = 'StereoCamera'),
  28073. (this._aspect = 1),
  28074. (this._overlap = 0.064),
  28075. (this.cameraL = new r.PerspectiveCamera()),
  28076. this.cameraL.layers.enable(1),
  28077. (this.cameraL.near = 0.01), //xzw add
  28078. (this.cameraL.matrixAutoUpdate = !1),
  28079. (this.cameraR = new r.PerspectiveCamera()),
  28080. this.cameraR.layers.enable(2),
  28081. (this.cameraR.near = 0.01), //xzw add
  28082. (this.cameraR.matrixAutoUpdate = !1),
  28083. (this.eyeRight = new r.Matrix4()),
  28084. (this.eyeLeft = new r.Matrix4()),
  28085. (this.vrCameraNeedsUpdate = !0),
  28086. (window.vrCameraL = this.cameraL); // fyz 记录vr相机
  28087. Object.defineProperty(this, 'bananaAspect', {
  28088. get: function () {
  28089. return this._aspect;
  28090. },
  28091. set: function (a) {
  28092. this._aspect !== a && (this.vrCameraNeedsUpdate = !0), (this._aspect = a);
  28093. },
  28094. }),
  28095. Object.defineProperty(this, 'overlap', {
  28096. get: function () {
  28097. return this._overlap;
  28098. },
  28099. set: function (a) {
  28100. this._overlap !== a && (this.vrCameraNeedsUpdate = !0), (this._overlap = a);
  28101. },
  28102. }),
  28103. (this.vrCameraUpdate = function (a) {
  28104. this.vrCameraNeedsUpdate = true;
  28105. if (
  28106. ((this.vrCameraNeedsUpdate =
  28107. this.vrCameraNeedsUpdate ||
  28108. this.bananaFov !== a.fov ||
  28109. this.bananaReal_aspect !== a.aspect * this.bananaAspect ||
  28110. this.bananaNear !== a.near ||
  28111. this.bananaFar !== a.far),
  28112. this.vrCameraNeedsUpdate)
  28113. ) {
  28114. (this.vrCameraNeedsUpdate = !1),
  28115. //console.debug("vrCameraUpdate"),
  28116. (this.bananaFocus = a.focus),
  28117. (this.bananaFov = a.fov),
  28118. (this.bananaReal_aspect = a.aspect * this.bananaAspect),
  28119. (this.bananaNear = a.near),
  28120. (this.bananaFar = a.far),
  28121. //console.debug(a.aspect),
  28122. (this.bananaFocus = 10);
  28123. var b,
  28124. c,
  28125. d = a.projectionMatrix.clone(),
  28126. e = this.overlap / 2,
  28127. f = (e * this.bananaNear) / this.bananaFocus,
  28128. g = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5);
  28129. (this.eyeLeft.elements[12] = -e),
  28130. (this.eyeRight.elements[12] = e),
  28131. (b = -g * this.bananaReal_aspect + f),
  28132. (c = g * this.bananaReal_aspect + f),
  28133. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28134. (d.elements[8] = (c + b) / (c - b)),
  28135. this.cameraL.projectionMatrix.copy(d),
  28136. (b = -g * this.bananaReal_aspect - f),
  28137. (c = g * this.bananaReal_aspect - f),
  28138. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28139. (d.elements[8] = (c + b) / (c - b)),
  28140. this.cameraR.projectionMatrix.copy(d);
  28141. }
  28142. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  28143. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight);
  28144. });
  28145. }),
  28146. (n.prototype.boluoGetTexture = function (a) {
  28147. var b = new r.TextureLoader();
  28148. return (b.crossOrigin = 'anonymous'), b.load(a);
  28149. });
  28150. /* let webxr = {
  28151. init(renderer) {
  28152. this.renderer = renderer
  28153. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  28154. renderer.xr.enabled = true
  28155. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  28156. //pico firefox
  28157. var mode = 'immersive-vr'
  28158. navigator.xr
  28159. .isSessionSupported(mode)
  28160. .then(supported => {
  28161. if (!supported) {
  28162. this.xrNotFound('isSessionSupported not supported')
  28163. } else {
  28164. this.xrType = 'xr' //showEnterXR();
  28165. }
  28166. })
  28167. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  28168. } else if ('getVRDisplays' in navigator) {
  28169. //pico 的vr browser是这个
  28170. console.log('getVRDisplays')
  28171. let setDevice = device => {
  28172. this.xrType = 'vr'
  28173. this.device = device
  28174. this.renderer.xr.setDevice(device) //新版是renderer.vr
  28175. }
  28176. window.addEventListener(
  28177. 'vrdisplayconnect',
  28178. function (event) {
  28179. setDevice(event.display)
  28180. },
  28181. false
  28182. )
  28183. window.addEventListener(
  28184. 'vrdisplaydisconnect',
  28185. function ( ) {
  28186. console.log('vrdisplaydisconnect')
  28187. window.bus.dispatchEvent({type:'exitWebXR'})
  28188. },
  28189. false
  28190. )
  28191. window.addEventListener(
  28192. 'vrdisplaypresentchange',
  28193. function (event) {
  28194. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  28195. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  28196. },
  28197. false
  28198. )
  28199. window.addEventListener(
  28200. 'vrdisplayactivate',
  28201. function (event) {
  28202. event.display.requestPresent([{ source: this.renderer.domElement }])
  28203. },
  28204. false
  28205. )
  28206. navigator
  28207. .getVRDisplays()
  28208. .then(function (displays) {
  28209. if (displays.length > 0) {
  28210. setDevice(displays[0])
  28211. } else {
  28212. this.xrNotFound('no displays')
  28213. }
  28214. })
  28215. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  28216. } else {
  28217. this.xrNotFound('xr not supported')
  28218. }
  28219. },
  28220. enterVR() {
  28221. if (!this.xrType) return //不支持
  28222. console.log('enterVR', this.xrType)
  28223. if (this.xrType == 'vr') {
  28224. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  28225. } else if (this.xrType == 'xr') {
  28226. if (this.currentSession == void 0) {
  28227. console.log('this.currentSession == void 0 ')
  28228. function getXRSessionInit(mode, options) {
  28229. var space = (options || {}).referenceSpaceType || 'local-floor'
  28230. var sessionInit = (options && options.sessionInit) || {}
  28231. // Nothing to do for default features.
  28232. if (space == 'viewer') return sessionInit
  28233. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  28234. // If the user already specified the space as an optional or required feature, don't do anything.
  28235. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  28236. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  28237. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  28238. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  28239. // request it later.
  28240. var newInit = Object.assign({}, sessionInit)
  28241. newInit.requiredFeatures = [space]
  28242. if (sessionInit.requiredFeatures) {
  28243. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  28244. }
  28245. return newInit
  28246. }
  28247. let onSessionEnded = ( ) => {
  28248. console.log('onSessionEnded')
  28249. this.currentSession.removeEventListener('end', onSessionEnded)
  28250. setTimeout(()=>{
  28251. this.renderer.xr.setSession(null)
  28252. this.currentSession = null
  28253. window.bus.dispatchEvent({type:'exitWebXR'})
  28254. },1)//延迟原因:先使THREE里的onSessionEnded执行
  28255. }
  28256. let onSessionStarted = session => {
  28257. console.log('onSessionStarted')
  28258. session.addEventListener('end', onSessionEnded)
  28259. this.renderer.xr.setSession(session)
  28260. this.currentSession = session
  28261. }
  28262. var mode = 'immersive-vr'
  28263. var sessionInit = getXRSessionInit(mode)
  28264. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  28265. } else {
  28266. console.log('this.currentSession.end()', this.currentSession)
  28267. this.currentSession.end()
  28268. }
  28269. }
  28270. },
  28271. xrNotFound(text) {
  28272. console.log('xrNotFound:', text)
  28273. },
  28274. } */
  28275. /***********************************************************************************************************************************************************************************/
  28276. (n.prototype.updateScreenSize = (function () {
  28277. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  28278. var W, H; //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  28279. return function (o) {
  28280. var render = false;
  28281. var ratio;
  28282. var w, h; //记录应当render的大小
  28283. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  28284. (w = o.width), (h = o.height), (render = true), (ratio = 1);
  28285. } else {
  28286. w = $('#player').width();
  28287. h = $('#player').height();
  28288. o && o.resize && ((W = this.renderWidth), (H = this.renderHeight));
  28289. (w !== W || h !== H || this.forceUpdateSize) &&
  28290. ((W = w), (H = h), (render = true), (ratio = window.devicePixelRatio));
  28291. }
  28292. if (render) {
  28293. this.setSize(w, h, ratio);
  28294. this.forceUpdateSize = !1;
  28295. }
  28296. };
  28297. })()),
  28298. (n.prototype.updateComponents = function () {
  28299. for (
  28300. var e = Math.min(1, this.updateClock.getDelta()), t = 0;
  28301. t < this.updateListeners.length;
  28302. t++
  28303. )
  28304. this.updateListeners[t].update(e);
  28305. }),
  28306. (n.prototype.suspend = function () {
  28307. (this.started = !1),
  28308. (this.suspendedObjects = this.scene.children.map(
  28309. function (e) {
  28310. return this.scene.remove(e), e;
  28311. }.bind(this)
  28312. )),
  28313. this.render();
  28314. }),
  28315. (n.prototype.resume = function () {
  28316. this.suspendedObjects.forEach(
  28317. function (e) {
  28318. this.scene.add(e);
  28319. }.bind(this)
  28320. ),
  28321. (this.suspendedObjects = []),
  28322. (this.started = !0),
  28323. p();
  28324. });
  28325. var p = function () {
  28326. this.started &&
  28327. (window.requestAnimationFrame(p),
  28328. this.updateScreenSize(), // fyz resize
  28329. this.updateComponents(),
  28330. this.updateTextureMemory(),
  28331. this.render(),
  28332. window.stats && (window.fps = stats.update()),
  28333. this.emit(a.AfterRender));
  28334. };
  28335. (n.prototype.getImageData = (function () {
  28336. var e = document.createElement('canvas'),
  28337. t = e.getContext('2d');
  28338. return function (i, n, r) {
  28339. return (
  28340. (e.width === n && e.height === r) || ((e.width = n), (e.height = r)),
  28341. t.drawImage(i, 0, 0, n, r),
  28342. t.getImageData(0, 0, n, r)
  28343. );
  28344. };
  28345. })()),
  28346. (n.prototype.initSizedTexture2D = function (e, t, i) {
  28347. var n = this.renderer,
  28348. o = n.context,
  28349. a = n.state,
  28350. s = new r.Texture(null);
  28351. (s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i);
  28352. var l = n.paramThreeToGL(s.format),
  28353. c = n.paramThreeToGL(s.type),
  28354. h = n.properties.get(s),
  28355. u = o.createTexture();
  28356. a.bindTexture(o.TEXTURE_2D, u),
  28357. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  28358. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  28359. (s.wrapS = t),
  28360. (s.wrapT = t);
  28361. var d = n.paramThreeToGL(t);
  28362. return (
  28363. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  28364. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  28365. i
  28366. ? ((s.magFilter = r.LinearFilter),
  28367. (s.minFilter = r.LinearMipMapLinearFilter),
  28368. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28369. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  28370. o.generateMipmap(o.TEXTURE_2D))
  28371. : ((s.magFilter = r.LinearFilter),
  28372. (s.minFilter = r.LinearFilter),
  28373. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28374. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  28375. a.bindTexture(o.TEXTURE_2D, null),
  28376. (h.__webglTexture = u),
  28377. s
  28378. );
  28379. }),
  28380. (n.prototype.initSizedCubeMap = function (e, t) {
  28381. var i = this.renderer,
  28382. n = i.context,
  28383. o = i.state,
  28384. a = new r.CubeTexture([null, null, null, null, null, null]);
  28385. (a.flipY = !1), (a.generateMipmaps = t);
  28386. var s = i.paramThreeToGL(a.format),
  28387. l = i.paramThreeToGL(a.type),
  28388. c = i.properties.get(a),
  28389. h = n.createTexture();
  28390. o.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  28391. for (var u = 0; u < 6; u++)
  28392. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  28393. return (
  28394. t
  28395. ? ((a.magFilter = r.LinearFilter),
  28396. (a.minFilter = r.LinearMipMapLinearFilter),
  28397. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28398. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  28399. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  28400. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  28401. : ((a.magFilter = r.LinearFilter),
  28402. (a.minFilter = r.LinearFilter),
  28403. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28404. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  28405. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  28406. (c.__image__webglTextureCube = h),
  28407. a
  28408. );
  28409. }),
  28410. (n.prototype.deallocateCubeTexture = function (e) {
  28411. var t = this.renderer,
  28412. i = t.context,
  28413. n = t.properties.get(e);
  28414. i.deleteTexture(n.__image__webglTextureCube);
  28415. }),
  28416. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  28417. var a = this.renderer,
  28418. s = a.context,
  28419. l = a.state,
  28420. c = a.properties.get(t);
  28421. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  28422. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28423. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  28424. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  28425. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  28426. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  28427. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  28428. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  28429. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  28430. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  28431. l.bindTexture(s.TEXTURE_2D, null);
  28432. }),
  28433. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  28434. var s = this.renderer,
  28435. l = s.context,
  28436. c = s.state,
  28437. h = s.properties.get(t);
  28438. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  28439. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28440. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  28441. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  28442. c.bindTexture(l.TEXTURE_CUBE_MAP, null);
  28443. }),
  28444. (n.prototype.rebuildMipMaps2D = function (e) {
  28445. var t = this.renderer,
  28446. i = t.context,
  28447. n = t.state;
  28448. t.properties.get(e);
  28449. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null);
  28450. }),
  28451. (n.prototype.rebuildMipMaps3D = function (e) {
  28452. var t = this.renderer,
  28453. i = t.context,
  28454. n = t.state,
  28455. r = t.properties.get(e);
  28456. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  28457. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  28458. n.bindTexture(i.TEXTURE_CUBE_MAP, null);
  28459. }),
  28460. (n.prototype.renderToCubeMap = (function () {
  28461. var e = !1,
  28462. t = null,
  28463. i = null,
  28464. n = null,
  28465. a = null,
  28466. s = null,
  28467. l = 1;
  28468. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  28469. var _ = this.renderer;
  28470. _.context;
  28471. e ||
  28472. ((i = new r.OrthographicCamera(l / -2, l / 2, l / 2, l / -2, -200, 200)),
  28473. (i.position.z = 150),
  28474. (t = new r.Scene()),
  28475. t.add(i),
  28476. (n = new r.ShaderMaterial({
  28477. uniforms: {
  28478. tDiffuse: {
  28479. type: 't',
  28480. value: null,
  28481. },
  28482. alpha: {
  28483. type: 'f',
  28484. value: 1,
  28485. },
  28486. },
  28487. vertexShader: o.basicTextured.vertexShader,
  28488. fragmentShader: o.basicTextured.fragmentShader,
  28489. depthWrite: !1,
  28490. depthTest: !1,
  28491. side: r.DoubleSide,
  28492. })),
  28493. (a = new r.PlaneBufferGeometry(l, l)),
  28494. (s = new r.Mesh(a, n)),
  28495. (s.position.z = 0),
  28496. t.add(s),
  28497. (e = !0));
  28498. var T = a.getAttribute('uv');
  28499. T.setDynamic(!0), (T.needsUpdate = !0);
  28500. var x = T.array,
  28501. S = p / u,
  28502. M = f / d,
  28503. R = g / u,
  28504. P = m / d;
  28505. (x[0] = S),
  28506. (x[1] = M + P),
  28507. (x[2] = S + R),
  28508. (x[3] = M + P),
  28509. (x[4] = S),
  28510. (x[5] = M),
  28511. (x[6] = S + R),
  28512. (x[7] = M);
  28513. var O = a.getAttribute('position');
  28514. O.setDynamic(!0), (O.needsUpdate = !0);
  28515. var L = O.array,
  28516. D = v / h.width - l / 2,
  28517. N = A / h.height - l / 2,
  28518. B = y / h.width,
  28519. F = C / h.height;
  28520. (L[0] = D),
  28521. (L[1] = N + F),
  28522. (L[3] = D + B),
  28523. (L[4] = N + F),
  28524. (L[6] = D),
  28525. (L[7] = N),
  28526. (L[9] = D + B),
  28527. (L[10] = N);
  28528. this.renderer.properties.get(c);
  28529. (n.uniforms.tDiffuse.value = c),
  28530. (n.blending = E || r.NoBlending),
  28531. (n.transparent = !!b),
  28532. (void 0 !== w && null !== w) || (w = 1),
  28533. (n.uniforms.alpha.value = w),
  28534. (n.needUpdate = !0),
  28535. (h.activeCubeFace = I),
  28536. h.viewport.set(0, 0, h.width, h.height);
  28537. var V = this.renderer.autoClear;
  28538. (this.renderer.autoClear = !1),
  28539. this.renderer.render(t, i, h, !1),
  28540. (this.renderer.autoClear = V);
  28541. };
  28542. })()),
  28543. (n.prototype.copyCubeMap = (function () {
  28544. var e = !1,
  28545. t = null,
  28546. i = null,
  28547. a = null,
  28548. s = null,
  28549. l = null,
  28550. c = new r.Euler();
  28551. new r.Vector3();
  28552. return function (h, u, d, p, f, g, m, v, A) {
  28553. if (f > this.qualityManager.maxRenderTargetSize) return; //add
  28554. this.renderer;
  28555. if (!e) {
  28556. var y = 2;
  28557. (i = new r.OrthographicCamera(y / -2, y / 2, y / 2, y / -2, 0, 200)),
  28558. i.position.set(0, 0, 0),
  28559. (t = new r.Scene()),
  28560. t.add(i),
  28561. (a = new r.ShaderMaterial({
  28562. uniforms: {
  28563. tDiffuse: {
  28564. type: 't',
  28565. value: null,
  28566. },
  28567. alpha: {
  28568. type: 'f',
  28569. value: 1,
  28570. },
  28571. },
  28572. vertexShader: o.copyCubeMap.vertexShader,
  28573. fragmentShader: o.copyCubeMap.fragmentShader,
  28574. depthWrite: !1,
  28575. depthTest: !1,
  28576. side: r.DoubleSide,
  28577. })),
  28578. (s = new r.BoxGeometry(y, y, y)),
  28579. (l = new r.Mesh(s, a)),
  28580. t.add(l),
  28581. (e = !0);
  28582. }
  28583. for (var C = 0; C < 6; C++)
  28584. n.getCubeOrientationForCubeFace(C, c),
  28585. l.rotation.copy(c),
  28586. (l.matrixWorldNeedsUpdate = !0),
  28587. l.updateMatrixWorld(),
  28588. (a.uniforms.tDiffuse.value = h),
  28589. (a.blending = m || r.NoBlending),
  28590. (a.transparent = !!v),
  28591. (void 0 !== A && null !== A) || (A = 1),
  28592. (a.uniforms.alpha.value = A),
  28593. (a.needUpdate = !0),
  28594. (u.activeCubeFace = C),
  28595. u.viewport.set(0, 0, f, g),
  28596. this.renderer.render(t, i, u, !1);
  28597. };
  28598. })()),
  28599. (n.getLookAtForCubeFace = function (e, t) {
  28600. switch (e) {
  28601. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28602. t.set(1, 0, 0);
  28603. break;
  28604. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28605. t.set(-1, 0, 0);
  28606. break;
  28607. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28608. t.set(0, 1, 0);
  28609. break;
  28610. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28611. t.set(0, -1, 0);
  28612. break;
  28613. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28614. t.set(0, 0, 1);
  28615. break;
  28616. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28617. t.set(0, 0, -1);
  28618. }
  28619. }),
  28620. (n.getCubeOrientationForCubeFace = function (e, t) {
  28621. switch (e) {
  28622. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28623. t.set(0, -Math.PI / 2, 0);
  28624. break;
  28625. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28626. t.set(0, Math.PI / 2, 0);
  28627. break;
  28628. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28629. t.set(Math.PI / 2, Math.PI, 0);
  28630. break;
  28631. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28632. t.set(-Math.PI / 2, Math.PI, 0);
  28633. break;
  28634. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28635. t.set(0, -Math.PI, 0);
  28636. break;
  28637. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28638. t.set(0, 0, 0);
  28639. }
  28640. }),
  28641. (t.exports = n);
  28642. },
  28643. {
  28644. '../enum/GLCubeFaces': 25,
  28645. '../enum/GLTextureType': 26,
  28646. '../enum/SceneRendererEvents': 43,
  28647. '../exception/BasicException': 55,
  28648. '../exception/RendererCreationException': 57,
  28649. '../settings': 166,
  28650. '../shaders': 167,
  28651. /********************************************************************fyz改 from徐世廷**********************************************************************/
  28652. '../util/browser': 182,
  28653. /************************************************************************************************************************************************/
  28654. events: 202,
  28655. three: 217,
  28656. },
  28657. ],
  28658. 159: [
  28659. function (e, t, i) {
  28660. 'use strict';
  28661. function n(e) {
  28662. (this.messenger = new a(e)), (this.clientKey = null);
  28663. }
  28664. var r = e('../util/ajax'),
  28665. o = e('./PostMessageType'),
  28666. a = e('./postmessage'),
  28667. s = e('./VersionInfo'),
  28668. l = e('events').EventEmitter,
  28669. c = window.location.origin + '/api/v1/user/';
  28670. (n.prototype = Object.create(l.prototype)),
  28671. (n.prototype.bindEvents = function () {
  28672. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this));
  28673. }),
  28674. (n.prototype.waitForConnection = function () {
  28675. var e = new Promise(
  28676. function (e, t) {
  28677. this.messenger.on(
  28678. o.CONNECT,
  28679. function (i) {
  28680. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind());
  28681. }.bind(this)
  28682. );
  28683. }.bind(this)
  28684. );
  28685. return e;
  28686. }),
  28687. (n.prototype.onConnectionReceived = function (e) {
  28688. return (
  28689. this.messenger.setTarget(e.source, e.origin),
  28690. this.verifyConnection(e).then(
  28691. function (t, i) {
  28692. this.messenger.send({
  28693. type: o.ACCEPT,
  28694. toId: e.fromId,
  28695. warning: i,
  28696. }),
  28697. (this.clientKey = t),
  28698. this.messenger.removeAllListeners(o.CONNECT),
  28699. this.bindEvents();
  28700. }.bind(this),
  28701. function (t) {
  28702. this.messenger.send({
  28703. type: o.REJECT,
  28704. toId: e.fromId,
  28705. reason: t,
  28706. }),
  28707. this.messenger.setTarget();
  28708. }.bind(this)
  28709. )
  28710. );
  28711. }),
  28712. (n.prototype.verifyConnection = function (e) {
  28713. return new Promise(function (t, i) {
  28714. var n;
  28715. if (s.isDeprecated(e.sdkVersion)) n = '这个版本正在被弃用';
  28716. else if (!s.isSupported(e.sdkVersion)) return i('不支持此版本的SDK');
  28717. var o = {
  28718. cache: !1,
  28719. headers: {
  28720. 'X-port-Application-Key': e.applicationKey,
  28721. 'X-port-Referrer': e.origin,
  28722. },
  28723. };
  28724. r.get(c, o)
  28725. .done(t.bind(this, e.applicationKey, n))
  28726. .fail(i.bind(this, 'key/referrer mismatch'));
  28727. });
  28728. }),
  28729. (n.prototype.onMessageReceived = function (e) {
  28730. if (this.validateClientApplicationKey(e.applicationKey)) {
  28731. var t = this;
  28732. (e.onDone = function (i) {
  28733. (i.toId = e.fromId), (i.uid = e.uid), (i.type = o.RESPONSE), t.messenger.send(i);
  28734. }),
  28735. this.emit(o.ACTION, e);
  28736. }
  28737. }),
  28738. (n.prototype.validateClientApplicationKey = function (e) {
  28739. return this.clientKey === e;
  28740. }),
  28741. (n.prototype.sendEvent = function (e, t) {
  28742. this.messenger.send({
  28743. type: o.EVENT,
  28744. eventType: e,
  28745. eventData: t,
  28746. });
  28747. }),
  28748. (t.exports = n);
  28749. },
  28750. {
  28751. '../util/ajax': 181,
  28752. './PostMessageType': 160,
  28753. './VersionInfo': 163,
  28754. './postmessage': 165,
  28755. events: 202,
  28756. },
  28757. ],
  28758. 160: [
  28759. function (e, t, i) {
  28760. 'use strict';
  28761. t.exports = Object.freeze({
  28762. CONNECT: 'postmessage.connect',
  28763. ACCEPT: 'postmessage.accept',
  28764. REJECT: 'postmessage.reject',
  28765. ACTION: 'postmessage.action',
  28766. RESPONSE: 'postmessage.response',
  28767. EVENT: 'postmessage.event',
  28768. });
  28769. },
  28770. {},
  28771. ],
  28772. 161: [
  28773. function (e, t, i) {
  28774. 'use strict';
  28775. t.exports = Object.freeze({
  28776. MOVE: 'sdk.move',
  28777. ENTER_PANO: 'sdk.enterpano',
  28778. MODEL_LOADED: 'sdk.modelloaded',
  28779. });
  28780. },
  28781. {},
  28782. ],
  28783. 162: [
  28784. function (e, t, i) {
  28785. 'use strict';
  28786. t.exports = Object.freeze({
  28787. FLY: 'transition.fly',
  28788. FADEOUT: 'transition.fade',
  28789. INSTANT: 'transition.instant',
  28790. });
  28791. },
  28792. {},
  28793. ],
  28794. 163: [
  28795. function (e, t, i) {
  28796. 'use strict';
  28797. t.exports = {
  28798. current: '1.0',
  28799. supported: ['1.0'],
  28800. deprecated: [],
  28801. isSupported: function (e) {
  28802. return this.supported.indexOf(e) !== -1;
  28803. },
  28804. isDeprecated: function (e) {
  28805. return this.deprecated.indexOf(e) !== -1;
  28806. },
  28807. isValid: function (e) {
  28808. return this.isSupported(e) || this.isDeprecated(e);
  28809. },
  28810. };
  28811. },
  28812. {},
  28813. ],
  28814. 164: [
  28815. function (e, t, i) {
  28816. (function (i) {
  28817. 'use strict';
  28818. function n(e, t, i) {
  28819. e && (e = e.toLowerCase().trim());
  28820. var n = new I.UP.clone(),
  28821. r = Math.PI / 3,
  28822. o = Math.PI / 2;
  28823. switch (e) {
  28824. case 'left':
  28825. i.copy(t), i.applyAxisAngle(n, o);
  28826. break;
  28827. case 'right':
  28828. i.copy(t), i.applyAxisAngle(n, -o);
  28829. break;
  28830. case 'forwardleft':
  28831. i.copy(t), i.applyAxisAngle(n, r);
  28832. break;
  28833. case 'forwardright':
  28834. i.copy(t), i.applyAxisAngle(n, -r);
  28835. break;
  28836. case 'forward':
  28837. default:
  28838. i.copy(t);
  28839. }
  28840. return i;
  28841. }
  28842. function r(e, t) {
  28843. if (e) {
  28844. var i = {
  28845. pano: e,
  28846. lookAtPoint: null,
  28847. duration: null,
  28848. maxDistanceOverride: null,
  28849. skipWarpingCheck: !1,
  28850. };
  28851. this.player.flyToPano(i, function () {
  28852. t &&
  28853. t({
  28854. success: !0,
  28855. message: 'Transition complete.',
  28856. });
  28857. });
  28858. } else
  28859. R.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  28860. t &&
  28861. t({
  28862. success: !1,
  28863. error: 'Unable to find pano.',
  28864. });
  28865. }
  28866. function o(e, t) {
  28867. var i = this.findRankedPano(e, t);
  28868. return i >= 0
  28869. ? this.handleToObject[i]
  28870. : (R.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null);
  28871. }
  28872. function a(e, t) {
  28873. var i = this.findRankedtag(e, t);
  28874. return i >= 0
  28875. ? this.handleToObject[i]
  28876. : (R.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null);
  28877. }
  28878. function s(e, t) {
  28879. t.copy(I.FORWARD), e.getDirection(t);
  28880. }
  28881. function l(e) {
  28882. function t(e) {
  28883. var t = new c.Euler().setFromQuaternion(e.quaternion, 'YXZ');
  28884. return {
  28885. x: c.Math.radToDeg(t._x),
  28886. y: c.Math.radToDeg(t._y),
  28887. z: c.Math.radToDeg(t._z),
  28888. };
  28889. }
  28890. var i = function (e) {
  28891. return e.alignmentType !== m.ALIGNED
  28892. ? null
  28893. : {
  28894. x: e.position.x,
  28895. y: e.position.y,
  28896. z: e.position.z,
  28897. };
  28898. };
  28899. return {
  28900. panos: e.panos.list.map(function (n) {
  28901. var r = y.getCubemapUrls(e.urls, n.id, 'high')[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  28902. return {
  28903. uuid: n.id,
  28904. aligned: n.alignmentType === m.ALIGNED,
  28905. neighbourUUIDs: n.neighbourUUIDs.slice(),
  28906. position: i(n),
  28907. rotation: t(n),
  28908. thumbnail: r,
  28909. };
  28910. }),
  28911. };
  28912. }
  28913. var c = e('three'),
  28914. h = e('./ApiHost'),
  28915. u = e('../util/logger'),
  28916. d = e('../util/common'),
  28917. p = e('../util/math'),
  28918. f = e('../enum/ModelManagerEvents'),
  28919. g = e('./PostMessageType'),
  28920. m = e('../enum/AlignmentType'),
  28921. v = e('../enum/Direction'),
  28922. A = e('./TransitionStyles'),
  28923. y = e('../util/panorama'),
  28924. C = e('../enum/GLCubeFaces'),
  28925. I = e('../enum/Vectors'),
  28926. E = e('../enum/Viewmode'),
  28927. b = e('../enum/WarpStyle'),
  28928. w = (e('../enum/Keys'), e('../enum/PlayerEvents')),
  28929. _ = e('../sdk/SdkEvents'),
  28930. I = e('../enum/Vectors'),
  28931. T = e('../enum/ControlEvents'),
  28932. x = e('../enum/RenderLayers'),
  28933. S = (e('../constants'), e('../settings')),
  28934. M = e('../lib/jpeg_encoder'),
  28935. R = new u(i),
  28936. P = (function () {
  28937. var e = function e() {
  28938. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  28939. e.player.getDirection(e.playerDirection),
  28940. e.projectVectors();
  28941. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  28942. if (((e.angleTravelled += Math.abs(t)), e.angleTravelled >= Math.abs(e.angle))) {
  28943. if (((e.active = !1), e.onDone)) {
  28944. var i = e.onDone;
  28945. i();
  28946. }
  28947. } else e.lastFacingDirection.copy(e.playerDirection), window.setTimeout(e, 4);
  28948. };
  28949. return (
  28950. (e.active = !1),
  28951. (e.angle = 0),
  28952. (e.angleTravelled = 0),
  28953. (e.playerDirection = new c.Vector3()),
  28954. (e.lastFacingDirection = new c.Vector3()),
  28955. (e.onDone = null),
  28956. (e.player = null),
  28957. (e.start = function (t, i, n, r) {
  28958. (e.active = !0),
  28959. t && i && (i = 0),
  28960. (e.angle = t || i),
  28961. (e.xAngle = t),
  28962. (e.yAngle = i),
  28963. (e.angleTravelled = 0),
  28964. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  28965. n.getDirection(e.playerDirection),
  28966. e.lastFacingDirection.copy(e.playerDirection),
  28967. e.projectVectors(),
  28968. (e.onDone = r),
  28969. (e.player = n),
  28970. e();
  28971. }),
  28972. (e.projectVectors = function () {
  28973. e.xAngle &&
  28974. (e.playerDirection.projectOnPlane(I.UP),
  28975. e.lastFacingDirection.projectOnPlane(I.UP));
  28976. }),
  28977. e
  28978. );
  28979. })(),
  28980. O = (function () {
  28981. var e = new c.Vector3();
  28982. return function (t) {
  28983. t
  28984. ? (e.copy(t.position),
  28985. e.add(t.discPosition),
  28986. p.projectPositionToCanvas(e, this.player.camera, e),
  28987. this.click(e.x, e.y))
  28988. : R.warn('Showcase -> clicktagObject: Unable to find tag.');
  28989. };
  28990. })(),
  28991. L = function () {
  28992. return this.player.mode === E.PANORAMA
  28993. ? S.insideLookLimitUp
  28994. : this.player.mode === E.DOLLHOUSE
  28995. ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle)
  28996. : null;
  28997. },
  28998. D = function () {
  28999. return this.player.mode === E.PANORAMA
  29000. ? S.insideLookLimitDown
  29001. : this.player.mode === E.DOLLHOUSE
  29002. ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle)
  29003. : null;
  29004. },
  29005. N = (function (e) {
  29006. var t = new c.Vector3();
  29007. return function (e) {
  29008. var i = this.player.getDirection();
  29009. t.copy(i);
  29010. var n = t.y;
  29011. (t.y = 0), t.normalize();
  29012. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  29013. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  29014. return (
  29015. 0 !== e &&
  29016. R.warn('Cannot rotate in y direction when in ' + this.player.mode + ' mode'),
  29017. 0
  29018. );
  29019. this.player.mode === E.DOLLHOUSE && (r = -r);
  29020. var o = L.call(this) - 0.1,
  29021. a = D.call(this) + 0.1,
  29022. s = r + e;
  29023. s > o ? (s = o) : s < a && (s = a);
  29024. var l = s - r;
  29025. return e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l;
  29026. };
  29027. })(),
  29028. B = (function () {
  29029. var e = new c.Euler();
  29030. return function (t) {
  29031. return (
  29032. e.setFromQuaternion(t.quaternion, 'YXZ'),
  29033. {
  29034. position: {
  29035. x: t.position.x,
  29036. y: t.position.y,
  29037. z: t.position.z,
  29038. },
  29039. rotation: {
  29040. x: c.Math.radToDeg(e.x),
  29041. y: c.Math.radToDeg(e.y),
  29042. z: 0,
  29043. },
  29044. pano: t.currentPano ? t.currentPano.id : null,
  29045. mode: t.mode,
  29046. }
  29047. );
  29048. };
  29049. })(),
  29050. F = null;
  29051. t.exports = {
  29052. init: function (e, t, i, n, r) {
  29053. V.init(e, t, i, r),
  29054. (F = new Promise(
  29055. function (e, t) {
  29056. i.on(w.Ready, function () {
  29057. e();
  29058. });
  29059. }.bind(this)
  29060. ));
  29061. var o = new h(window),
  29062. a = o.waitForConnection();
  29063. a.then(function (e) {
  29064. o.on(g.ACTION, V.onMessageReceive.bind(V));
  29065. });
  29066. var s = (function () {
  29067. var e = Date.now();
  29068. return function () {
  29069. if (!(Date.now() - e < 100)) {
  29070. var t = B(i);
  29071. o.sendEvent(_.MOVE, {
  29072. state: t,
  29073. }),
  29074. (e = Date.now());
  29075. }
  29076. };
  29077. })();
  29078. i.on(w.Move, s),
  29079. i.on(w.ViewChanged, s),
  29080. n.on(f.ActiveModelChanged, function (e) {
  29081. function t(e) {
  29082. var t,
  29083. i = e.newPano.id;
  29084. e.oldPano && (t = e.oldPano.id),
  29085. i !== t &&
  29086. o.sendEvent(_.ENTER_PANO, {
  29087. oldPano: t,
  29088. newPano: i,
  29089. });
  29090. }
  29091. var i = e.model,
  29092. n = e.oldModel;
  29093. (V.model = i),
  29094. a.then(function () {
  29095. o.sendEvent(_.MODEL_LOADED, {
  29096. metadata: l(i),
  29097. });
  29098. }),
  29099. n &&
  29100. n.panos.forEach(function (e) {
  29101. e.removeEventListener('enter', t);
  29102. }),
  29103. i.panos.forEach(function (e) {
  29104. e.on('enter', t);
  29105. });
  29106. });
  29107. },
  29108. };
  29109. var V = {
  29110. director: null,
  29111. player: null,
  29112. controls: null,
  29113. sceneRenderer: null,
  29114. model: null,
  29115. init: function (e, t, i, n) {
  29116. (this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n);
  29117. },
  29118. handleToObject: {},
  29119. objectToHandle: {},
  29120. handleCount: 0,
  29121. onMessageReceive: function (e) {
  29122. if (e) {
  29123. var t = e.targetFunction,
  29124. i = e.params,
  29125. n = e.onDone;
  29126. t && this[t] && this[t](i, n);
  29127. }
  29128. },
  29129. waitForInit: function (e, t) {
  29130. F.then(
  29131. t.bind({
  29132. success: !0,
  29133. message: 'Init complete.',
  29134. })
  29135. );
  29136. },
  29137. moveToPano: (function (e, t) {
  29138. var i = new c.Euler(0, 0, 0, 'YXZ'),
  29139. n = new c.Quaternion();
  29140. return function (e, t) {
  29141. var r = e.pano,
  29142. o = e.rotation,
  29143. a = e.transition;
  29144. if (!this.model)
  29145. return t({
  29146. success: !1,
  29147. error: 'The model has not been loaded yet',
  29148. });
  29149. var s = this.model.panos.get(r);
  29150. if (!s)
  29151. return t({
  29152. success: !1,
  29153. error: r + ' does not exist in this model',
  29154. });
  29155. if (!o)
  29156. return t({
  29157. sucess: !1,
  29158. erorr: o + ' is not a valid rotation',
  29159. });
  29160. i.set(
  29161. c.Math.degToRad(o.x || 0),
  29162. c.Math.degToRad(o.y || 0),
  29163. c.Math.degToRad(o.z || 0),
  29164. 'YXZ'
  29165. ),
  29166. console.log(o.z);
  29167. var l = {
  29168. success: !0,
  29169. message: r,
  29170. };
  29171. if (a === A.FADEOUT)
  29172. n.setFromEuler(i),
  29173. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  29174. else {
  29175. var h, u;
  29176. a === A.INSTANT && ((h = 0), (u = 0));
  29177. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  29178. this.player.flyToPano(
  29179. {
  29180. pano: s,
  29181. lookAtPoint: d,
  29182. duration: h,
  29183. aimDuration: u,
  29184. },
  29185. t.bind(this, l)
  29186. );
  29187. }
  29188. };
  29189. })(),
  29190. moveInDirection: function (e, t) {
  29191. var i = e.direction;
  29192. return 'undefined' == typeof v[i]
  29193. ? (R.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  29194. void (
  29195. t &&
  29196. t({
  29197. success: !1,
  29198. error: 'Invalid direction.',
  29199. })
  29200. ))
  29201. : void this.player.flyLocalDirection(I[i].clone()).then(function (e) {
  29202. t(
  29203. e
  29204. ? {
  29205. success: !0,
  29206. message: 'moved ' + i,
  29207. }
  29208. : {
  29209. success: !1,
  29210. error: 'Cannot move in direction: ' + i,
  29211. }
  29212. );
  29213. });
  29214. },
  29215. getPose: function (e, t) {
  29216. this.player.camera.position,
  29217. new c.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ');
  29218. return t({
  29219. success: !0,
  29220. message: B(this.player),
  29221. });
  29222. },
  29223. takeScreenShot: (function () {
  29224. var e = new c.PerspectiveCamera(),
  29225. t = new c.WebGLRenderTarget();
  29226. return function (i, n) {
  29227. if (!i.resolution)
  29228. return n({
  29229. success: !1,
  29230. error: 'An invalid resolution was specified',
  29231. });
  29232. if (i.resolution.width === -1 || i.resolution.height === -1) {
  29233. var r = this.sceneRenderer.renderer.getSize();
  29234. (i.resolution.width = r.width), (i.resolution.height = r.height);
  29235. }
  29236. e.layers.set(x.DEFAULT),
  29237. i.visibleObjects &&
  29238. (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  29239. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  29240. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  29241. var o = i.resolution.width,
  29242. a = i.resolution.height,
  29243. s = o / a;
  29244. e.position.copy(this.sceneRenderer.camera.position),
  29245. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  29246. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  29247. (e.projectionMatrix.elements[0] =
  29248. this.player.camera.projectionMatrix.elements[5] / s),
  29249. t.setSize(o, a),
  29250. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  29251. var l = new Uint8Array(o * a * 4);
  29252. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  29253. var c = M.encode(
  29254. {
  29255. data: l,
  29256. width: o,
  29257. height: a,
  29258. heading: 180,
  29259. pitch: 0,
  29260. },
  29261. {
  29262. quality: 75,
  29263. flipY: !0,
  29264. }
  29265. ),
  29266. h = 'data:image/jpg;base64,' + d.uint8ToBase64(c.data);
  29267. n({
  29268. success: !0,
  29269. message: h,
  29270. });
  29271. };
  29272. })(),
  29273. findRankedPano: (function (e, t) {
  29274. var i = new c.Vector3(),
  29275. r = new c.Vector3();
  29276. return function (e, t) {
  29277. s(this.player, r), n(t, r, i);
  29278. var o = this.player.rankedPanoInDirection(e, i);
  29279. if (o) {
  29280. var a = this.objectToHandle[o.id];
  29281. return (
  29282. a ||
  29283. ((this.objectToHandle[o.id] = a = this.handleCount++),
  29284. (this.handleToObject[a] = o)),
  29285. a
  29286. );
  29287. }
  29288. return R.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1;
  29289. };
  29290. })(),
  29291. findRankedtag: (function (e, t) {
  29292. var i = new c.Vector3(),
  29293. r = new c.Vector3();
  29294. return function (e, t) {
  29295. s(this.player, r), n(t, r, i);
  29296. var o = this.player.rankedtagInDirection(e, i);
  29297. if (o) {
  29298. var a = this.objectToHandle[o.sid];
  29299. return (
  29300. a ||
  29301. ((this.objectToHandle[o.sid] = a = this.handleCount++),
  29302. (this.handleToObject[a] = o)),
  29303. a
  29304. );
  29305. }
  29306. return R.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1;
  29307. };
  29308. })(),
  29309. clickNearesttag: function (e) {
  29310. this.clickRankedtag(0, e);
  29311. },
  29312. clickRankedtag: function (e, t) {
  29313. var i = a.call(this, e, t);
  29314. i && O.call(this, i);
  29315. },
  29316. clickNearestPano: function (e, t) {
  29317. this.clickRankedPano(0, e, t);
  29318. },
  29319. clickRankedPano: function (e, t, i) {
  29320. var n = o.call(this, e, t);
  29321. n ? r.call(this, n, i) : i(null);
  29322. },
  29323. clickPano: function (e, t) {
  29324. var i = this.handleTable[e];
  29325. i ? r.call(this, i, t) : t(null);
  29326. },
  29327. rotateDirection: (function () {
  29328. return function (e, t) {
  29329. var i = e.direction,
  29330. n = e.angle;
  29331. if (!P.active) {
  29332. var r = 0,
  29333. o = 0,
  29334. a = 0,
  29335. s = 0;
  29336. if (!n || isNaN(n))
  29337. return (
  29338. R.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  29339. void (
  29340. t &&
  29341. t({
  29342. success: !1,
  29343. error: 'Invalid rotation angle.',
  29344. })
  29345. )
  29346. );
  29347. if (this.player.mode === E.TRANSITIONING)
  29348. return (
  29349. R.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  29350. void (
  29351. t &&
  29352. t({
  29353. success: !1,
  29354. error: 'Cannot rotate while transitioning',
  29355. })
  29356. )
  29357. );
  29358. if (i === v.RIGHT || i === v.LEFT)
  29359. i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n);
  29360. else {
  29361. if (i !== v.UP && i !== v.DOWN)
  29362. return (
  29363. R.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  29364. void (
  29365. t &&
  29366. t({
  29367. success: !1,
  29368. error: 'Invalid direction for rotation.',
  29369. })
  29370. )
  29371. );
  29372. if (this.player.mode === E.FLOORPLAN)
  29373. return (
  29374. R.warn(
  29375. 'Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'
  29376. ),
  29377. void (
  29378. t &&
  29379. t({
  29380. success: !1,
  29381. error: 'Cannot rotate ' + i + ' in floorplan mode',
  29382. })
  29383. )
  29384. );
  29385. if ((i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n))
  29386. return (
  29387. R.warn(
  29388. 'Showcase -> rotateDirection: Already at maximum rotation in direction: ' +
  29389. i
  29390. ),
  29391. void (
  29392. t &&
  29393. t({
  29394. success: !1,
  29395. error: 'Already at maximum rotation in direction: ' + i,
  29396. })
  29397. )
  29398. );
  29399. (o = n > 0 ? 1 : -1), (s = n);
  29400. }
  29401. var l = n;
  29402. (n = c.Math.degToRad(n)), (a = c.Math.degToRad(a)), (s = c.Math.degToRad(s));
  29403. var h = this.controls.activeControl,
  29404. u = function () {
  29405. h.stopRotating(!0),
  29406. t &&
  29407. t({
  29408. success: !0,
  29409. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction,
  29410. });
  29411. };
  29412. h.startRotating(r, o), P.start(a, s, this.player, u);
  29413. }
  29414. };
  29415. })(),
  29416. rotate: (function () {
  29417. var e = new c.Vector3(),
  29418. t = new c.Vector3();
  29419. return function (i, n) {
  29420. var r = i.xAngle,
  29421. o = i.yAngle;
  29422. if (!P.active) {
  29423. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  29424. return (
  29425. R.warn('Showcase -> rotate: Invalid rotation angle.'),
  29426. void (
  29427. n &&
  29428. n({
  29429. success: !1,
  29430. error: 'Invalid rotation angle.',
  29431. })
  29432. )
  29433. );
  29434. if (this.player.mode === E.TRANSITIONING)
  29435. return (
  29436. R.warn('Automation -> rotate: Cannot rotate while transitioning'),
  29437. void (
  29438. n &&
  29439. n({
  29440. success: !1,
  29441. error: 'Cannot rotate while transitioning',
  29442. })
  29443. )
  29444. );
  29445. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0);
  29446. var a = o;
  29447. (o = N.call(this, o)), (r = -r);
  29448. var s = a > 0 ? 'UP' : 'DOWN';
  29449. if (!r && a && !o)
  29450. return (
  29451. R.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + s),
  29452. void (
  29453. n &&
  29454. n({
  29455. success: !1,
  29456. error: 'Already at maximum rotation in direction: ' + s,
  29457. })
  29458. )
  29459. );
  29460. a > o &&
  29461. R.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + s);
  29462. var l = o;
  29463. (o = c.Math.degToRad(o)),
  29464. (r = c.Math.degToRad(r)),
  29465. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29466. this.player.getDirection(e),
  29467. t.copy(e).applyAxisAngle(I.UP, r),
  29468. t.applyAxisAngle(I.RIGHT, o);
  29469. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  29470. u = o > 0 ? 1 : o < 0 ? -1 : 0;
  29471. Math.abs(r) > Math.abs(o)
  29472. ? (u *= Math.abs(o / r))
  29473. : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  29474. var d = this.controls.activeControl,
  29475. p = function () {
  29476. d.stopRotating(!0),
  29477. n &&
  29478. n({
  29479. success: !0,
  29480. message:
  29481. 'Rotated ' +
  29482. i.xAngle.toFixed(2) +
  29483. '° horizontally, ' +
  29484. l.toFixed(2) +
  29485. '° vertically',
  29486. });
  29487. };
  29488. d.startRotating(h, u), P.start(r, o, this.player, p);
  29489. }
  29490. };
  29491. })(),
  29492. panCamera: function (e, t) {
  29493. function i(e) {
  29494. switch (
  29495. (r.removeAllListeners(T.AutoPanComplete),
  29496. r.removeAllListeners(T.AutoPanInterrupt),
  29497. r.removeAllListeners(T.AutoPanClamped),
  29498. e)
  29499. ) {
  29500. case T.AutoPanInterrupt:
  29501. t({
  29502. success: !0,
  29503. message: 'Camera panning interrupted.',
  29504. });
  29505. break;
  29506. case T.AutoPanClamped:
  29507. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  29508. if (
  29509. Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 &&
  29510. Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01
  29511. )
  29512. return void t({
  29513. success: !1,
  29514. error: 'Already at edge of current model bounds.',
  29515. });
  29516. var i = 'The view point is outside the bounds for the current model. ';
  29517. (i += 'The view point was clamped to ' + o(r.target.x, r.target.z)),
  29518. console.warn(i);
  29519. }
  29520. case T.AutoPanComplete:
  29521. t({
  29522. success: !0,
  29523. message:
  29524. 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z),
  29525. });
  29526. }
  29527. }
  29528. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  29529. return t({
  29530. success: !1,
  29531. error: 'Camera panning is not available in the current mode: ' + this.player.mode,
  29532. });
  29533. var n = e.position,
  29534. r = this.player.control;
  29535. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0);
  29536. var o = function (e, t) {
  29537. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')';
  29538. };
  29539. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  29540. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  29541. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped));
  29542. },
  29543. click: function (e, t) {
  29544. var i = e.x,
  29545. n = e.y,
  29546. r = e.percentage;
  29547. r === !0 &&
  29548. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29549. this.player.handleInputStart(i, n),
  29550. this.player.updateIntersect(),
  29551. this.player.handleInputEnd(i, n);
  29552. },
  29553. mouseOver: function (e, t) {
  29554. var i = e.x,
  29555. n = e.y,
  29556. r = e.percentage;
  29557. r === !0 &&
  29558. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29559. this.player.handleInputMove(i, n),
  29560. this.player.updateIntersect();
  29561. },
  29562. moveToMode: function (e, t) {
  29563. function i(e) {
  29564. t(
  29565. e
  29566. ? {
  29567. success: !1,
  29568. error: 'Failed to load new mode: ' + e,
  29569. }
  29570. : {
  29571. success: !0,
  29572. message: 'Moved to new mode: ' + n,
  29573. }
  29574. );
  29575. }
  29576. var n = e.mode;
  29577. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  29578. ? this.director.changeMode(n).then(
  29579. function () {
  29580. i();
  29581. },
  29582. function (e) {
  29583. i(e);
  29584. }
  29585. )
  29586. : t({
  29587. success: !1,
  29588. error: 'Invalid mode selection',
  29589. });
  29590. },
  29591. };
  29592. }.call(this, '/js/sdk/automation.js'));
  29593. },
  29594. {
  29595. '../constants': 8,
  29596. '../enum/AlignmentType': 17,
  29597. '../enum/ControlEvents': 21,
  29598. '../enum/Direction': 22,
  29599. '../enum/GLCubeFaces': 25,
  29600. '../enum/Keys': 30,
  29601. '../enum/ModelManagerEvents': 33,
  29602. '../enum/PlayerEvents': 40,
  29603. '../enum/RenderLayers': 41,
  29604. '../enum/Vectors': 50,
  29605. '../enum/Viewmode': 51,
  29606. '../enum/WarpStyle': 52,
  29607. '../lib/jpeg_encoder': 94,
  29608. '../sdk/SdkEvents': 161,
  29609. '../settings': 166,
  29610. '../util/common': 185,
  29611. '../util/logger': 189,
  29612. '../util/math': 190,
  29613. '../util/panorama': 191,
  29614. './ApiHost': 159,
  29615. './PostMessageType': 160,
  29616. './TransitionStyles': 162,
  29617. three: 217,
  29618. },
  29619. ],
  29620. 165: [
  29621. function (e, t, i) {
  29622. 'use strict';
  29623. function n(e) {
  29624. (this.sourceWindow = e),
  29625. (this.targetWindow = null),
  29626. (this.targetOrigin = null),
  29627. (this.id = Math.floor(1e5 * Math.random())),
  29628. this.bindEvents();
  29629. }
  29630. var r = e('./PostMessageType'),
  29631. o = e('events').EventEmitter;
  29632. (n.prototype = Object.create(o.prototype)),
  29633. (n.prototype.bindEvents = function () {
  29634. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this));
  29635. }),
  29636. (n.prototype.setTarget = function (e, t) {
  29637. (this.targetWindow = e), (this.targetOrigin = t);
  29638. }),
  29639. (n.prototype.onPostmessageReceived = function (e) {
  29640. var t = e.origin || e.originalEvent.origin,
  29641. i = e.source;
  29642. switch (e.data.type) {
  29643. case r.CONNECT:
  29644. break;
  29645. case r.RESPONSE:
  29646. if (this.id !== e.data.toId) return;
  29647. default:
  29648. if (!this.validateMessageOrigin(t)) return;
  29649. }
  29650. var n = e.data;
  29651. (n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n);
  29652. }),
  29653. (n.prototype.validateMessageOrigin = function (e) {
  29654. return '*' === this.targetOrigin || e === this.targetOrigin;
  29655. }),
  29656. (n.prototype.send = function (e) {
  29657. this.targetWindow &&
  29658. this.targetOrigin &&
  29659. ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin));
  29660. }),
  29661. (t.exports = n);
  29662. },
  29663. {
  29664. './PostMessageType': 160,
  29665. events: 202,
  29666. },
  29667. ],
  29668. 166: [
  29669. function (e, t, i) {
  29670. 'use strict';
  29671. var n = e('three'),
  29672. r = e('./util/browser'),
  29673. o = e('./enum/Viewmode'),
  29674. a = e('./enum/VROption'),
  29675. s = e('./enum/Colors'),
  29676. l = e('./enum/WarpStyle'),
  29677. c = e('./util/easing'),
  29678. h = e('./util/common'),
  29679. u = e('./util/showcase'),
  29680. d = e('./constants'),
  29681. p = {
  29682. debug: !1,
  29683. version: '2.25.6-0-gd87e5b1',
  29684. languageTag: r.valueFromHash('lang', null),
  29685. pageTitle: '四维虚拟漫游',
  29686. authorizationHeader: u.getAuthorizationHeader(),
  29687. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  29688. logLevel: r.valueFromHash('log', 2),
  29689. skyboxRadius: 2500,
  29690. modelBoundsPadding: 5,
  29691. showNeighbors: !1,
  29692. brand: r.valueFromHash('brand', !0),
  29693. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  29694. startHighlights: r.valueFromHash('hl', -1),
  29695. specialEdition: r.valueFromHash('bn', 0),
  29696. useWheel: r.valueFromHash('wh', !0),
  29697. crossOrigin: 'anonymous',
  29698. fancierTransition: !1,
  29699. wireframe: !1,
  29700. skyboxWireframe: !1,
  29701. modelAlpha: 1,
  29702. highlightPanoSelection: !1,
  29703. showSweeps: !0,
  29704. showSkyboxes: !1,
  29705. showMesh: !0,
  29706. showFloors: !1,
  29707. showFloorDuration: 300,
  29708. showFloorDelay: 300,
  29709. hideFloorDuration: 300,
  29710. hideFloorDelay: 0,
  29711. reticuleOpacityTransitionTime: 250,
  29712. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  29713. markerOpacityTransitionTime: 500,
  29714. guiAnimationSpeed: 250,
  29715. highlightAnimationDuration: 500,
  29716. modelComponentLoadSpinnerDelay: 150,
  29717. captureErrors: !1,
  29718. maxMobileTextures: 6,
  29719. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  29720. startupFlyinDelay: 3e3,
  29721. dollhouseDefault: {
  29722. minDistance: 15,
  29723. maxDistance: 50,
  29724. minPolarAngle: n.Math.degToRad(10),
  29725. maxPolarAngle: n.Math.degToRad(90),
  29726. },
  29727. hideReticuleTimeout: 1e3,
  29728. analytics: {
  29729. inactivityThreshold: 30,
  29730. sessionTrackingRate: 0.15,
  29731. maxTrackedErrors: 20,
  29732. sessionDurationPingFrequency: 10,
  29733. sessionDurationTimeout: 15,
  29734. },
  29735. flydown: {
  29736. movementEasing: 'easeInOutQuad',
  29737. movementDelay: 0.001,
  29738. rotationEasing: 'easeInOutQuad',
  29739. rotationDelay: 0.5,
  29740. modelTextureDelay: 0.75,
  29741. skyboxDelay: 0.75,
  29742. },
  29743. transition: {
  29744. flySpeed: 0.001,
  29745. flyTime: 750,
  29746. flytimeMaxDistanceThreshold: 5,
  29747. flytimeDistanceMultiplier: 150,
  29748. aimTime: 1500,
  29749. aimSlowFactor: 1.5,
  29750. blur: 0.8,
  29751. movementEasing: 'easeInOutQuad',
  29752. blendEasing: 'easeInOutQuad',
  29753. fastForwardFactor: 4, //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  29754. },
  29755. show360Views: {
  29756. enabled: !0,
  29757. transitionTime: 1e3,
  29758. },
  29759. quickstart: {
  29760. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  29761. animation: 1400,
  29762. showTextDelay: 500,
  29763. fadeOutDelay: 3e3,
  29764. fovChange: 10,
  29765. },
  29766. appConfig: {
  29767. webvr_version: null,
  29768. segment_key: null,
  29769. embedly_key: null,
  29770. branch_key: null,
  29771. keen_write_key: null,
  29772. keen_project_id: null,
  29773. },
  29774. vr: {
  29775. enabled: !0,
  29776. allowWebVR: !1,
  29777. option: r.valueFromHash('vr', a.CONTEXTUAL),
  29778. },
  29779. share: {
  29780. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0),
  29781. },
  29782. input: {
  29783. longTapThreshold: 200,
  29784. moveToleranceNDC: 0.01, //.08,
  29785. touchMoveThreshold: 25,
  29786. },
  29787. help: {
  29788. modalStayDuration: 600,
  29789. },
  29790. immersive: {
  29791. timeToShowAgain: 1250,
  29792. uiStayDuration: 600,
  29793. },
  29794. tourInteraction: {
  29795. disabled: '0' === r.valueFromHash('tourcta', null),
  29796. showPauseButton: 1e3,
  29797. showModal: 1500,
  29798. allowNextClick: 200,
  29799. largeModal: '1' === r.valueFromHash('tourcta', null),
  29800. smallModal: '2' === r.valueFromHash('tourcta', null),
  29801. },
  29802. labels: {
  29803. enabled: !1,
  29804. hideUntilStart: !0,
  29805. fadeInDuration: 250,
  29806. fadeInDelay: 250,
  29807. fadeOutDuration: 250,
  29808. fadeOutDelay: 0,
  29809. zoomHideThreshhold: {
  29810. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  29811. desktop: 2,
  29812. },
  29813. zoomTruncateThreshhold: {
  29814. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  29815. desktop: 0.85,
  29816. },
  29817. minLengthForTruncate: 16,
  29818. truncateLength: 12,
  29819. truncateSuffix: '...',
  29820. },
  29821. tags: {
  29822. enabled: r.valueFromHash('mt', 1),
  29823. startup: {
  29824. hideUntilStart: !0,
  29825. fadeInDuration: 500,
  29826. fadeInDelay: 100,
  29827. },
  29828. visibility: {
  29829. anyDistance: !0,
  29830. visibleDistance: 8,
  29831. cameraClearance: 0.1,
  29832. alphaTestLevel: 0.05,
  29833. hideViaFloor: !0,
  29834. hideOffScreenDisc: !1,
  29835. hideOffScreenObject: !1,
  29836. },
  29837. disc: {
  29838. opacity: 1,
  29839. disabledOpacity: 0.5,
  29840. scale: {
  29841. nearBound: 1.5,
  29842. farBound: 4.8,
  29843. linkFarBound: !1,
  29844. linkPercent: 40,
  29845. maxSize: 80,
  29846. minSize: 40,
  29847. baseViewportSize: 800,
  29848. responsiveness: 100,
  29849. },
  29850. },
  29851. pole: {
  29852. enabled: !0,
  29853. height: 0.5,
  29854. width: 2,
  29855. opacity: 0.5,
  29856. color: 'white',
  29857. },
  29858. navigate: {
  29859. nearestPano: !0,
  29860. lineOfSight: !0,
  29861. reactivate: !0,
  29862. aimAt: 'disc',
  29863. tiltTolerance: 25,
  29864. rotateSpeedFactor: 0.6,
  29865. },
  29866. },
  29867. path: {
  29868. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  29869. colorUp: s._desat(s.newBlue, 0.5),
  29870. colorDown: s._darken(s.newBlue, 0.35),
  29871. opacity: 0.5,
  29872. style: 'ribbon',
  29873. height: 0.025,
  29874. ribbonWidth: 0.24,
  29875. outsideHeight: 0.5,
  29876. waypointRadius: 0.5,
  29877. waypointIndoorRadius: 0.24,
  29878. waypointPulse: 1e3,
  29879. typ: l.BLACK,
  29880. meshFree: r.valueFromHash('mf', 1),
  29881. mapGuides: r.valueFromHash('guides', !0),
  29882. fadeInTime: 400,
  29883. fadeOutTime: 300,
  29884. },
  29885. warp: {
  29886. nearPanoDist: 0.1,
  29887. matchCam: !1,
  29888. blur: 0.33,
  29889. fastTime: 1500,
  29890. teleportTime: 1500, //瞬间过渡的时间
  29891. flytimeDistanceMultiplier: 150, //add
  29892. flyTime: 750, //add
  29893. outsideTime: 2e3,
  29894. lookAheadMax: 0.3,
  29895. lookAheadDist: 2.5,
  29896. softPushDist: 0.37,
  29897. softPushEnd: 0.3,
  29898. softBendAngle: 8,
  29899. softBendTilt: 4,
  29900. softBendEnd: 0.3,
  29901. doBurns: true, //r.valueFromHash("kb", !0),
  29902. burnsAngle: 8, //导览在每个点停留时的旋转角度
  29903. minBurnsAngle: 35,
  29904. minDownAngle: -35,
  29905. maxTurnPerSec: 280,
  29906. maxAimPerSec: 35,
  29907. minRotation: 12,
  29908. maxAimRotation: 33.2,
  29909. turnFriction: 0.2,
  29910. flySpeed: 0.01,
  29911. minWarpTime: 1200,
  29912. warpInterruptionRedirectTime: 500,
  29913. tourStepDelay: r.valueFromHash('st', 0),
  29914. walkDelay: 0,
  29915. walkMaxDist: 50,
  29916. walkMinDist: 0.8,
  29917. walkSlideShowThreshhold: 3000,
  29918. walkExtraPanosDistance: 0.4,
  29919. timePerMeter: 1200,
  29920. motionLeadTime: 5000,
  29921. movementEasing: 'easeInOutQuad',
  29922. blendEasing: 'easeInOutQuad',
  29923. showBunny: !1,
  29924. loop: r.valueFromHash('lp', !1),
  29925. auto: r.valueFromHash('ts', -1),
  29926. eOrder: 'YXZ', //"YXZ",
  29927. stepFactor: 0.25,
  29928. brakeStrength: 2,
  29929. minBrakeAngle: 0.1,
  29930. maxBrakeAngle: 1.8,
  29931. climbEffort: 4,
  29932. },
  29933. rotationFriction: 0.05,
  29934. rotationAccelerationInside: 4.5,
  29935. rotationAccelerationOutside: 0.15,
  29936. rotationAfterMoveMultiplier: 40,
  29937. rotationAfterMoveHistoryCount: 5,
  29938. panFriction: 0.09,
  29939. panAccelerationOutside: 60,
  29940. onload: r.valueFromHash('onload', o.PANORAMA),
  29941. zoomNearLimit: 0.1,
  29942. zoomFarLimit: 50,
  29943. navigation: {
  29944. panoScores: !1,
  29945. mouseDirection: !0,
  29946. filterStrictness: 0.75,
  29947. angleFactor: -30,
  29948. directionFactor: 10,
  29949. distanceFactor: -1,
  29950. optionalityFactor: 3,
  29951. },
  29952. sdkInit: !1,
  29953. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  29954. console: r.valueFromHash('console', !1),
  29955. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  29956. panoramaNeighbourMaxDistance: 5,
  29957. panoFloorClickRadius: 0.35,
  29958. showScreenshotLocations: !1,
  29959. showAxis: !1,
  29960. showNeighbourRaycasts: !1,
  29961. colorMarkerOnLoad: !1,
  29962. colorMarkerByFloor: !1,
  29963. tiling: {
  29964. panoPreRenderRepeatDelay: 2500,
  29965. panoPreRenderDelay: 500,
  29966. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  29967. tilingFlagNames: ['usetiles', 'tiles'],
  29968. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  29969. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  29970. overlayStyle: r.valueFromHash('tileoverlay', 0),
  29971. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  29972. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  29973. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 1 /* 2 */),
  29974. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  29975. customCompression: r.valueFromHash('tilecustcomp', 0),
  29976. // mobileHighQualityOverride: !1,
  29977. mobileHighQualityOverride: 1,
  29978. allowUltraHighResolution: true,
  29979. },
  29980. zoom: {
  29981. enabled: true,
  29982. forceOff: r.valueFromHash('nozoom', 0),
  29983. overridemax: r.valueFromHash('maxzoom', null),
  29984. overridemin: r.valueFromHash('minzoom', null),
  29985. max: d.highQualityMaxZoom,
  29986. min: 1,
  29987. transitionStyle: r.valueFromHash('zoomtrans', 1),
  29988. activationThreshold: 1.1,
  29989. restoreTime: 500,
  29990. },
  29991. profiling: {
  29992. enabled: r.valueFromHash('mem', !1),
  29993. },
  29994. };
  29995. (p = h.deepExtend(p, d, {
  29996. insideFOV: r.valueFromHash('fov', d.insideFOV),
  29997. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  29998. panorama: {
  29999. transitionTime: 1e3,
  30000. modelAlpha: 0,
  30001. modelAlphaDelay: p.flydown.modelTextureDelay,
  30002. modelAlphaLength: 1,
  30003. skyboxOpacity: 1,
  30004. skyboxOpacityDelay: p.flydown.skyboxDelay,
  30005. skyboxOpacityLength: 0.9,
  30006. fovLength: 1,
  30007. fovDelay: 0,
  30008. cameraMatrixDuration: 0.8,
  30009. cameraMatrixDelay: 0,
  30010. cameraMatrixEase: c.easeInCubic,
  30011. reticuleOpacity: 1,
  30012. markerOpacity: 0.3,
  30013. markerOpacityOnHover: 1,
  30014. },
  30015. dollhouse: {
  30016. transitionTime: 1e3,
  30017. modelAlpha: 1,
  30018. modelAlphaDelay: 0,
  30019. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30020. skyboxOpacity: 0,
  30021. skyboxOpacityDelay: 0,
  30022. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30023. fovLength: 1,
  30024. fovDelay: 0,
  30025. cameraMatrixDuration: 0.8,
  30026. cameraMatrixDelay: 0.3,
  30027. cameraMatrixEase: c.easeInCubic,
  30028. reticuleOpacity: 1,
  30029. markerOpacity: 0,
  30030. markerOpacityOnHover: 0,
  30031. },
  30032. floorplan: {
  30033. transitionTime: 1e3,
  30034. modelAlpha: 1,
  30035. modelAlphaDelay: 0,
  30036. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30037. skyboxOpacity: 0,
  30038. skyboxOpacityDelay: 0,
  30039. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30040. fovLength: 1,
  30041. fovDelay: 0,
  30042. cameraMatrixDuration: 0.5,
  30043. cameraMatrixDelay: 0,
  30044. cameraMatrixEase: c.easeOutCubic,
  30045. reticuleOpacity: 1,
  30046. markerOpacity: 0,
  30047. markerOpacityOnHover: 0,
  30048. cameraHeight: 50,
  30049. },
  30050. transitioning: {
  30051. reticuleOpacity: 0,
  30052. markerOpacity: 0.3,
  30053. markerOpacityOnHover: 1,
  30054. },
  30055. 'floorplan-dollhouse': {
  30056. rotationDelay: 0,
  30057. rotationDuration: 1,
  30058. },
  30059. 'floorplan-panorama': {
  30060. rotationDelay: 0.5,
  30061. rotationDuration: 1,
  30062. },
  30063. 'dollhouse-panorama': {
  30064. rotationDelay: 0.5,
  30065. rotationDuration: 1,
  30066. },
  30067. 'dollhouse-floorplan': {
  30068. rotationDelay: 0,
  30069. rotationDuration: 1,
  30070. cameraMatrixDuration: 1.05,
  30071. cameraMatrixDelay: 0.5,
  30072. },
  30073. 'panorama-dollhouse': {
  30074. rotationDelay: 0,
  30075. rotationDuration: 0.5,
  30076. },
  30077. 'panorama-floorplan': {
  30078. transitionTime: 1500,
  30079. rotationDelay: 0,
  30080. rotationDuration: 0.5,
  30081. },
  30082. })),
  30083. p.path.meshFree && (p.path.typ = l.WALK),
  30084. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  30085. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  30086. (window._settings = t.exports = p);
  30087. },
  30088. {
  30089. './constants': 8,
  30090. './enum/Colors': 19,
  30091. './enum/VROption': 47,
  30092. './enum/Viewmode': 51,
  30093. './enum/WarpStyle': 52,
  30094. './util/browser': 182,
  30095. './util/common': 185,
  30096. './util/easing': 186,
  30097. './util/showcase': 193,
  30098. three: 217,
  30099. },
  30100. ],
  30101. 167: [
  30102. function (e, t, i) {
  30103. 'use strict';
  30104. var n = e('three'),
  30105. r = e('./settings'),
  30106. o =
  30107. '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',
  30108. a =
  30109. 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n';
  30110. t.exports = {
  30111. basicTextured: {
  30112. uniforms: {
  30113. tDiffuse: {
  30114. type: 't',
  30115. value: null,
  30116. },
  30117. alpha: {
  30118. type: 'f',
  30119. value: 1,
  30120. },
  30121. },
  30122. vertexShader:
  30123. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30124. fragmentShader:
  30125. '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}',
  30126. },
  30127. copyCubeMap: {
  30128. uniforms: {
  30129. tDiffuse: {
  30130. type: 't',
  30131. value: null,
  30132. },
  30133. alpha: {
  30134. type: 'f',
  30135. value: 1,
  30136. },
  30137. },
  30138. vertexShader:
  30139. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30140. fragmentShader:
  30141. '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}',
  30142. },
  30143. cube: {
  30144. uniforms: {
  30145. map: {
  30146. type: 't',
  30147. value: null,
  30148. },
  30149. opacity: {
  30150. type: 'f',
  30151. value: 1,
  30152. },
  30153. },
  30154. vertexShader:
  30155. o +
  30156. 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  30157. fragmentShader:
  30158. a +
  30159. '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',
  30160. },
  30161. model: {
  30162. uniforms: {
  30163. map: {
  30164. type: 't',
  30165. value: null,
  30166. },
  30167. modelAlpha: {
  30168. type: 'f',
  30169. value: r.modelAlpha,
  30170. },
  30171. opacity: {
  30172. type: 'f',
  30173. value: 1,
  30174. },
  30175. progress: {
  30176. type: 'f',
  30177. value: 0,
  30178. },
  30179. blackout: {
  30180. type: 'i',
  30181. value: 0,
  30182. },
  30183. pano0Map: {
  30184. type: 't',
  30185. value: null,
  30186. },
  30187. pano0Position: {
  30188. type: 'v3',
  30189. value: new n.Vector3(),
  30190. },
  30191. pano0Matrix: {
  30192. type: 'm4',
  30193. value: new n.Matrix4(),
  30194. },
  30195. pano1Map: {
  30196. type: 't',
  30197. value: null,
  30198. },
  30199. pano1Position: {
  30200. type: 'v3',
  30201. value: new n.Vector3(),
  30202. },
  30203. pano1Matrix: {
  30204. type: 'm4',
  30205. value: new n.Matrix4(),
  30206. },
  30207. },
  30208. vertexShader:
  30209. o +
  30210. `uniform vec3 pano0Position;
  30211. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  30212. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  30213. varying vec3 vWorldPosition0;
  30214. varying vec3 vWorldPosition1;
  30215. uniform int blackout;
  30216. void main() {
  30217. vUv = uv;
  30218. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  30219. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  30220. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  30221. vWorldPosition0.x *= -1.0;
  30222. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  30223. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  30224. vWorldPosition1.x *= -1.0;
  30225. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  30226. }`,
  30227. fragmentShader:
  30228. a +
  30229. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  30230. 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
  30231. void main() {
  30232. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  30233. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  30234. vec4 colorFromPanos;
  30235. if (blackout == 5){//add for TransitionPass
  30236. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  30237. }else{
  30238. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  30239. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  30240. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  30241. else if (blackout == 1) {
  30242. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  30243. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  30244. }
  30245. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  30246. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  30247. }
  30248. //#ifdef useModelMap //起不了作用为啥
  30249. if(modelAlpha>0.0){
  30250. vec4 colorFromTexture = texture2D( map, vUv );
  30251. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  30252. }
  30253. //#endif
  30254. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  30255. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  30256. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  30257. }`,
  30258. },
  30259. hot: {
  30260. uniforms: {
  30261. color: {
  30262. type: 'c',
  30263. value: new n.Color(0xff2200),
  30264. },
  30265. opac: {
  30266. type: 'f',
  30267. value: 0,
  30268. },
  30269. texture1: {
  30270. type: 't',
  30271. value: null,
  30272. },
  30273. texture2: {
  30274. type: 't',
  30275. value: null,
  30276. },
  30277. },
  30278. vertexShader:
  30279. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30280. fragmentShader:
  30281. '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',
  30282. },
  30283. modelOutside: {
  30284. uniforms: {
  30285. map: {
  30286. type: 't',
  30287. value: null,
  30288. },
  30289. opacity: {
  30290. type: 'f',
  30291. value: 1,
  30292. },
  30293. },
  30294. vertexShader:
  30295. o +
  30296. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30297. fragmentShader:
  30298. a +
  30299. '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',
  30300. },
  30301. ribbon: {
  30302. uniforms: {
  30303. map: {
  30304. type: 't',
  30305. value: null,
  30306. },
  30307. opacity: {
  30308. type: 'f',
  30309. value: 1,
  30310. },
  30311. color: {
  30312. type: 'c',
  30313. value: new n.Color(r.path.color),
  30314. },
  30315. },
  30316. vertexShader:
  30317. o +
  30318. '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',
  30319. fragmentShader:
  30320. a +
  30321. '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',
  30322. },
  30323. waypoint: {
  30324. uniforms: {
  30325. map: {
  30326. type: 't',
  30327. value: null,
  30328. },
  30329. opacity: {
  30330. type: 'f',
  30331. value: 1,
  30332. },
  30333. pulse: {
  30334. type: 'f',
  30335. value: 1,
  30336. },
  30337. nearFade: {
  30338. type: 'v2',
  30339. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius),
  30340. },
  30341. color: {
  30342. type: 'c',
  30343. value: new n.Color(r.reticuleColor),
  30344. },
  30345. },
  30346. vertexShader:
  30347. o +
  30348. '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',
  30349. fragmentShader:
  30350. a +
  30351. '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',
  30352. },
  30353. modelDebug: {
  30354. uniforms: {
  30355. map: {
  30356. type: 't',
  30357. value: null,
  30358. },
  30359. modelAlpha: {
  30360. type: 'f',
  30361. value: r.modelAlpha,
  30362. },
  30363. depthmapRatio: {
  30364. type: 'f',
  30365. value: 0,
  30366. },
  30367. opacity: {
  30368. type: 'f',
  30369. value: 1,
  30370. },
  30371. progress: {
  30372. type: 'f',
  30373. value: 0,
  30374. },
  30375. considerOcclusion: {
  30376. type: 'i',
  30377. value: r.fancierTransition,
  30378. },
  30379. highlightPanoSelection: {
  30380. type: 'i',
  30381. value: 0,
  30382. },
  30383. useThirdPano: {
  30384. type: 'i',
  30385. value: r.useThirdPano,
  30386. },
  30387. pano0Map: {
  30388. type: 't',
  30389. value: null,
  30390. },
  30391. pano0Depth: {
  30392. type: 't',
  30393. value: null,
  30394. },
  30395. pano0Position: {
  30396. type: 'v3',
  30397. value: new n.Vector3(),
  30398. },
  30399. pano0Matrix: {
  30400. type: 'm4',
  30401. value: new n.Matrix4(),
  30402. },
  30403. pano0Weight: {
  30404. type: 'f',
  30405. value: r.transition.pano0Weight,
  30406. },
  30407. pano1Map: {
  30408. type: 't',
  30409. value: null,
  30410. },
  30411. pano1Depth: {
  30412. type: 't',
  30413. value: null,
  30414. },
  30415. pano1Position: {
  30416. type: 'v3',
  30417. value: new n.Vector3(),
  30418. },
  30419. pano1Matrix: {
  30420. type: 'm4',
  30421. value: new n.Matrix4(),
  30422. },
  30423. pano1Weight: {
  30424. type: 'f',
  30425. value: r.transition.pano1Weight,
  30426. },
  30427. pano2Map: {
  30428. type: 't',
  30429. value: null,
  30430. },
  30431. pano2Depth: {
  30432. type: 't',
  30433. value: null,
  30434. },
  30435. pano2Position: {
  30436. type: 'v3',
  30437. value: new n.Vector3(),
  30438. },
  30439. pano2Matrix: {
  30440. type: 'm4',
  30441. value: new n.Matrix4(),
  30442. },
  30443. pano2Weight: {
  30444. type: 'f',
  30445. value: r.transition.pano2Weight,
  30446. },
  30447. },
  30448. vertexShader:
  30449. o +
  30450. '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',
  30451. fragmentShader:
  30452. a +
  30453. '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',
  30454. },
  30455. customDepth: {
  30456. uniforms: {
  30457. panoPosition: {
  30458. type: 'v3',
  30459. value: new n.Vector3(),
  30460. },
  30461. },
  30462. vertexShader:
  30463. o +
  30464. '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',
  30465. fragmentShader:
  30466. a +
  30467. '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',
  30468. },
  30469. skysphere: {
  30470. uniforms: {
  30471. radius: {
  30472. type: 'f',
  30473. value: 0,
  30474. },
  30475. },
  30476. vertexShader:
  30477. o +
  30478. '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',
  30479. fragmentShader:
  30480. a +
  30481. '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',
  30482. },
  30483. tagDisc: {
  30484. uniforms: {
  30485. opacity: {
  30486. type: 'f',
  30487. value: 0,
  30488. },
  30489. color: {
  30490. type: 'c',
  30491. value: new n.Color(),
  30492. },
  30493. bg: {
  30494. type: 't',
  30495. value: null,
  30496. },
  30497. mask: {
  30498. type: 't',
  30499. value: null,
  30500. },
  30501. },
  30502. vertexShader:
  30503. o +
  30504. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30505. fragmentShader:
  30506. a +
  30507. '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',
  30508. },
  30509. };
  30510. },
  30511. {
  30512. './settings': 166,
  30513. three: 217,
  30514. },
  30515. ],
  30516. 168: [
  30517. function (e, t, i) {
  30518. (function (i) {
  30519. 'use strict';
  30520. var n = e('three'),
  30521. r = (e('url'), e('./util/ajax')),
  30522. o = e('./settings'),
  30523. a = e('./util/logger'),
  30524. s = e('./util/math'),
  30525. l = e('./util/showcase'),
  30526. c = e('./objects/Panorama'),
  30527. h = new a(i),
  30528. u = e('./model/Model'),
  30529. d = e('./shaders'),
  30530. p = e('./util/transitions'),
  30531. f = e('./objects/Chunk'),
  30532. g = e('./objects/Reticule'),
  30533. m = e('./objects/Skybox'),
  30534. v = e('./objects/Floor'),
  30535. A = e('./cameras/DollhouseCamera'),
  30536. y = e('./cameras/FloorplanCamera'),
  30537. C = e('./cameras/PanoramaCamera'),
  30538. I = e('./controls/DollhouseControls'),
  30539. E = e('./controls/FloorplanControls'),
  30540. b = e('./controls/PanoramaControls');
  30541. (n.ImageUtils.crossOrigin = o.crossOrigin),
  30542. (t.exports = {
  30543. shaders: d,
  30544. transitions: p,
  30545. Model: u,
  30546. Chunk: f,
  30547. Floor: v,
  30548. Skybox: m,
  30549. Reticule: g,
  30550. Panorama: c,
  30551. DollhouseCamera: A,
  30552. FloorplanCamera: y,
  30553. PanoramaCamera: C,
  30554. DollhouseControls: I,
  30555. FloorplanControls: E,
  30556. PanoramaControls: b,
  30557. getModel: function (e) {
  30558. if (!e.url) throw 'getModel(): missing parameter "url"';
  30559. e.autoload = void 0 === e.autoload || e.autoload;
  30560. var t = l.parseSidUrl(e.url);
  30561. (e.urlBase = t.urlBase), (e.urlModel = t.urlModel), (e.urlFiles = t.urlFiles);
  30562. var i = this._getPlatformError();
  30563. return i
  30564. ? $.Deferred().reject(i).promise()
  30565. : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)));
  30566. },
  30567. _getPlatformError: function () {
  30568. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  30569. ? 'webgl-unsupported'
  30570. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  30571. ? 'webgl-ios'
  30572. : Modernizr.webgl
  30573. ? null
  30574. : 'webgl-unsupported';
  30575. },
  30576. _loadModel: function () {
  30577. return r
  30578. .get(this.options.urlModel, {
  30579. responseType: 'json',
  30580. prefetchFrom: 'model',
  30581. auth: l.getAuthorizationHeader(),
  30582. })
  30583. .then(null, function () {
  30584. return (
  30585. h.warn('Model loading failed at initial metadata load'), 'loading-failed'
  30586. );
  30587. });
  30588. },
  30589. _buildModel: function (e) {
  30590. e = l.normalizeModeldata(e, s);
  30591. var t = new u(this.options, e);
  30592. return this.options.autoload ? t.load(!0) : $.when(t);
  30593. },
  30594. });
  30595. }.call(this, '/js/showcase.js'));
  30596. },
  30597. {
  30598. './cameras/DollhouseCamera': 5,
  30599. './cameras/FloorplanCamera': 6,
  30600. './cameras/PanoramaCamera': 7,
  30601. './controls/DollhouseControls': 10,
  30602. './controls/FloorplanControls': 11,
  30603. './controls/PanoramaControls': 13,
  30604. './model/Model': 139,
  30605. './objects/Chunk': 144,
  30606. './objects/Floor': 146,
  30607. './objects/Panorama': 148,
  30608. './objects/Reticule': 149,
  30609. './objects/Skybox': 152,
  30610. './settings': 166,
  30611. './shaders': 167,
  30612. './util/ajax': 181,
  30613. './util/logger': 189,
  30614. './util/math': 190,
  30615. './util/showcase': 193,
  30616. './util/transitions': 195,
  30617. three: 217,
  30618. url: 208,
  30619. },
  30620. ],
  30621. 169: [
  30622. function (e, t, i) {
  30623. 'use strict';
  30624. function n() {
  30625. var e = {
  30626. renderTarget: null,
  30627. inUse: !1,
  30628. size: -1,
  30629. pano: null,
  30630. };
  30631. return e;
  30632. }
  30633. function r(e) {
  30634. M.push(e);
  30635. }
  30636. function o(e) {
  30637. var t = n();
  30638. return (t.inUse = !0), (t.size = e), r(t), t;
  30639. }
  30640. function a(e) {
  30641. for (var t = 0; t < M.length; t++) {
  30642. var i = M[t];
  30643. if (!i.inUse && i.size === e) return (i.inUse = !0), i;
  30644. }
  30645. return null;
  30646. }
  30647. function s(e) {
  30648. for (var t = 0; t < M.length; t++) {
  30649. var i = M[t];
  30650. if (i.renderTarget === e) return (i.inUse = !1), !0;
  30651. }
  30652. return !1;
  30653. }
  30654. function l() {
  30655. (this.tileDirectory = {}),
  30656. (this.activeRenderTargetDescriptors = {}),
  30657. (this.activePanos = []),
  30658. (this.panoLODDescriptors = {}),
  30659. (this.panoDescriptors = {}),
  30660. (this.tileTrees = {}),
  30661. (this.sceneRenderer = null),
  30662. (this.tileDownloader = null),
  30663. (this.forceQueue = []),
  30664. (this.uploadQueues = {}),
  30665. (this.uploadInterval = null),
  30666. (this.uploadIntervalCancelled = !1),
  30667. (this.usingTileOverlay = !1),
  30668. (this.overlayTilesLoaded = !1),
  30669. (this.overlayTileBase = null),
  30670. (this.overlayTilesBasic = {}),
  30671. (this.overlayTilesEnhanced = {}),
  30672. (this.zoomRenderTarget = null),
  30673. (this.zoomPano = null),
  30674. (this.zoomingActive = !1),
  30675. (this.zoomPanoId = null),
  30676. (this.zoomPanoRenderingDisabled = !1),
  30677. (this.direction = new h.Vector3()),
  30678. (this.initTime = -1),
  30679. (this.maxBaseUploadsPerFrame = x),
  30680. (this.maxNonBaseUploadsPerFrame = T);
  30681. }
  30682. function c() {
  30683. this.uploadIntervalCancelled ||
  30684. (this.overlayTilesLoaded || !this.usingTileOverlay
  30685. ? ((b = !0),
  30686. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  30687. this.peekNextFromUploadQueue()
  30688. ? this.refreshUploadInterval(w)
  30689. : (this.uploadInterval = null))
  30690. : this.refreshUploadInterval(this.uploadIntervalDelay));
  30691. }
  30692. /* function c() {
  30693. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  30694. this.updateUploadQueue(1, 2),
  30695. w = 18,
  30696. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  30697. } */
  30698. var h = e('three'),
  30699. u = e('../exception/BasicException'),
  30700. d = e('../settings'),
  30701. p = e('../enum/PanoSizeClass'),
  30702. f = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  30703. g = e('../enum/SceneRendererEvents'),
  30704. m = e('../enum/TileDownloaderEvents'),
  30705. v = e('../enum/Vectors'),
  30706. A = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  30707. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  30708. C = e('./TileUtils'),
  30709. p = e('../enum/PanoSizeClass'),
  30710. I = (e('../util/browser'), e('../util/panorama')),
  30711. E = e('events').EventEmitter,
  30712. b = !1,
  30713. w = d.tiling.uploadIntervalDelay,
  30714. _ = d.tiling.initialIntervalDelay,
  30715. T = d.tiling.maxNonBaseUploadsPerFrame,
  30716. x = d.tiling.maxBaseUploadsPerFrame,
  30717. S = {
  30718. Base: 0,
  30719. Remaining: 1,
  30720. },
  30721. M = [];
  30722. (l.prototype = Object.create(E.prototype)),
  30723. (l.prototype.init = function (e, t, i) {
  30724. (this.sceneRenderer = e),
  30725. (this.tileDownloader = t),
  30726. (this.qualityManager = i),
  30727. this.bindEvents(),
  30728. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  30729. (this.initTime = performance.now());
  30730. }),
  30731. (l.prototype.getActivePanoTextures = function (e) {
  30732. e = e || [];
  30733. for (var t = 0; t < M.length; t++) {
  30734. var i = M[t];
  30735. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture);
  30736. }
  30737. }),
  30738. (l.prototype.hasQueuedTiles = function () {
  30739. var e = this.peekNextFromUploadQueue();
  30740. return null !== e && void 0 !== e;
  30741. }),
  30742. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  30743. return this.activeRenderTargetDescriptors[e];
  30744. }),
  30745. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  30746. this.activeRenderTargetDescriptors[e] = t;
  30747. }),
  30748. (l.prototype.loadOverlayTiles = function () {
  30749. if (0 !== d.tiling.overlayStyle) {
  30750. var e = 0,
  30751. t = function (t, n, r) {
  30752. (t = n
  30753. ? (t[n] = this.sceneRenderer.initSizedTexture2D(
  30754. C.TILE_SIZE,
  30755. h.ClampToEdgeWrapping
  30756. ))
  30757. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(
  30758. C.TILE_SIZE,
  30759. h.ClampToEdgeWrapping
  30760. ))),
  30761. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  30762. e++,
  30763. e === i.length && (this.overlayTilesLoaded = !0);
  30764. }.bind(this),
  30765. i = [
  30766. ['images/outlineBase.png', t.bind(this, this.overlayTileBase, null)],
  30767. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 256)],
  30768. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 512)],
  30769. ['images/outlineBasic1024.png', t.bind(this, this.overlayTilesBasic, 1024)],
  30770. ['images/outlineBasic2048.png', t.bind(this, this.overlayTilesBasic, 2048)],
  30771. ['images/outlineBasic4096.png', t.bind(this, this.overlayTilesBasic, 4096)],
  30772. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 256)],
  30773. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 512)],
  30774. ['images/outlineEnhanced1024.png', t.bind(this, this.overlayTilesEnhanced, 1024)],
  30775. ['images/outlineEnhanced2048.png', t.bind(this, this.overlayTilesEnhanced, 2048)],
  30776. ['images/outlineEnhanced4096.png', t.bind(this, this.overlayTilesEnhanced, 4096)],
  30777. ];
  30778. i.forEach(
  30779. function (e) {
  30780. this.tileDownloader.loadImage(e[0], 0, e[1]);
  30781. }.bind(this)
  30782. ),
  30783. (this.usingTileOverlay = !0);
  30784. } else this.usingTileOverlay = !1;
  30785. }),
  30786. (l.prototype.bindEvents = function () {
  30787. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this));
  30788. }),
  30789. (l.prototype.setupZoomRenderTarget = (function () {
  30790. var targets = {};
  30791. return function () {
  30792. if (
  30793. this.qualityManager.maxRenderTargetSize == '2k' &&
  30794. this.qualityManager.getMaxNavPanoSize() == '2k'
  30795. )
  30796. return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  30797. if (
  30798. this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()
  30799. ) {
  30800. if (
  30801. this.zoomRenderTarget &&
  30802. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()
  30803. )
  30804. return;
  30805. var e = this.zoomRenderTarget;
  30806. var size = this.qualityManager.getMaxZoomPanoSize();
  30807. if (size > this.qualityManager.maxRenderTargetSize) {
  30808. return;
  30809. }
  30810. if (targets[size]) {
  30811. this.zoomRenderTarget = targets[size];
  30812. } else {
  30813. this.zoomRenderTarget = this.initTiledPano(size, false); //放大后不使用抗锯齿,否则消耗更多内存
  30814. targets[size] = this.zoomRenderTarget;
  30815. }
  30816. if (e) {
  30817. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  30818. var t = e.width,
  30819. i = this.zoomRenderTarget.width;
  30820. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  30821. e.texture.dispose(),
  30822. (e.texture.loaded = !1),
  30823. (e.texture.version = 0),
  30824. this.sceneRenderer.deallocateCubeTexture(e.texture),
  30825. (e.texture = null);
  30826. }
  30827. this.zoomPanoRenderingDisabled = !1;
  30828. } else this.zoomPanoRenderingDisabled = !0;
  30829. };
  30830. })()),
  30831. (l.prototype.enableHighQuality = function (e) {
  30832. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  30833. if (!this.qualityManager.highQualityModeStarted) {
  30834. this.setupZoomRenderTarget();
  30835. e();
  30836. this.qualityManager.highQualityModeStarted = true;
  30837. }
  30838. }),
  30839. (l.prototype.enableUltraHighQualityMode = function (e) {
  30840. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  30841. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  30842. this.tileDownloader.testDownload(
  30843. t,
  30844. C.TILE_SIZE,
  30845. function (t) {
  30846. t &&
  30847. (this.qualityManager.enableUltraHighQualityMode(),
  30848. this.setupZoomRenderTarget(),
  30849. e());
  30850. }.bind(this)
  30851. );
  30852. }
  30853. }),
  30854. (l.prototype.activateTiledPano = function (e, t, i) {
  30855. i && this.clearAllQueuedUploads();
  30856. for (var n = 0; n < C.FACES_PER_PANO; n++)
  30857. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  30858. this.linkAllTilesAndNodes(e);
  30859. var r = this.getActiveRenderTargetDescriptor(e.id),
  30860. l = t;
  30861. if (
  30862. (l > this.qualityManager.getMaxNavPanoSize() &&
  30863. (l = this.qualityManager.getMaxNavPanoSize()),
  30864. !r || l !== r.size)
  30865. ) {
  30866. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  30867. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */);
  30868. (r = o(c.width)), (r.renderTarget = c);
  30869. }
  30870. (r.pano = e),
  30871. this.resetPanoDescriptor(e.id),
  30872. this.resetPanoLODDescriptors(e.id),
  30873. this.resetRenderStatus(e.id, !0, !0);
  30874. }
  30875. this.setActiveRenderTargetDescriptor(e.id, r);
  30876. var h = i ? 0 : 1;
  30877. return this.updateActivePanos(e, h), r.renderTarget;
  30878. }),
  30879. (l.prototype.deactivateTiledPano = function (e) {
  30880. var t = this.getActiveRenderTargetDescriptor(e.id);
  30881. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  30882. this.setActiveRenderTargetDescriptor(e.id, null);
  30883. var i = this.getUploadQueueForPano(e.id);
  30884. this.clearUploadQueue(i), this.updateActivePanos();
  30885. }),
  30886. (l.prototype.updateActivePanos = (function () {
  30887. var e = [];
  30888. return function (t, i) {
  30889. e.length = 0;
  30890. for (var n = 0; n < this.activePanos.length; n++) {
  30891. t && e.length === i && e.push(t);
  30892. var r = this.activePanos[n],
  30893. o = this.getActiveRenderTargetDescriptor(r.id);
  30894. (t && r.id === t.id) || !this.isRenderTargetDescriptorValid(o) || e.push(r);
  30895. }
  30896. t && i >= e.length && e.push(t),
  30897. (this.activePanos.length = 0),
  30898. this.activePanos.push.apply(this.activePanos, e);
  30899. };
  30900. })()),
  30901. (l.prototype.getActivePanoCount = function () {
  30902. return this.activePanos.length;
  30903. }),
  30904. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  30905. var r = null;
  30906. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  30907. for (
  30908. var o = function (e, n, r, o) {
  30909. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1);
  30910. },
  30911. a = 0;
  30912. a < C.FACES_PER_PANO;
  30913. a++
  30914. ) {
  30915. var s = this.getTileTree(e, a);
  30916. s.breadthFirst({
  30917. callback: o.bind(this, a),
  30918. minLevel: r,
  30919. });
  30920. }
  30921. }),
  30922. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  30923. for (
  30924. var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  30925. i = function (e, t, i, n) {
  30926. (t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered);
  30927. },
  30928. n = 0;
  30929. n < C.FACES_PER_PANO;
  30930. n++
  30931. ) {
  30932. var r = this.getTileTree(e, n);
  30933. r.breadthFirst({
  30934. callback: i.bind(this, n),
  30935. maxLevel: t,
  30936. });
  30937. }
  30938. }),
  30939. (l.prototype.renderPanoTiles = (function () {
  30940. var e = [];
  30941. return function (t, i, n, r) {
  30942. (this.zoomRenderTarget &&
  30943. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) ||
  30944. this.zoomPanoRenderingDisabled ||
  30945. this.setupZoomRenderTarget(),
  30946. (i = i || this.direction || v.FORWARD);
  30947. var o = this.getActiveRenderTargetDescriptor(t);
  30948. if (!this.isRenderTargetDescriptorValid(o))
  30949. throw new u(
  30950. 'PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.'
  30951. );
  30952. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  30953. var s = this.getTileTree(t, a);
  30954. (e.length = 0),
  30955. s.breadthFirst({
  30956. saveVisited: e,
  30957. });
  30958. for (var l = 0; l < e.length; l++) {
  30959. var c = e[l];
  30960. this.queueTileUpload(c.tile, !1, r || (0 === l && n));
  30961. }
  30962. }
  30963. this.updateDirection(i);
  30964. };
  30965. })()),
  30966. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  30967. return e && e.renderTarget;
  30968. }),
  30969. (l.prototype.isPanoActive = function (e) {
  30970. var t = this.getActiveRenderTargetDescriptor(e);
  30971. return this.isRenderTargetDescriptorValid(t);
  30972. }),
  30973. (l.prototype.isPanoZoomed = function (e) {
  30974. return this.zoomingActive && this.zoomPanoId === e;
  30975. }),
  30976. (l.prototype.initTileTree = function (e, t, i) {
  30977. var n = this.tileTrees[e];
  30978. n || ((n = []), (this.tileTrees[e] = n));
  30979. var r = n[t];
  30980. if (!r) {
  30981. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  30982. (r = new A(C.TILE_SIZE, o)), (n[t] = r);
  30983. }
  30984. }),
  30985. (l.prototype.getTileTree = function (e, t) {
  30986. var i = this.tileTrees[e];
  30987. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!');
  30988. var n = i[t];
  30989. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!');
  30990. return n;
  30991. }),
  30992. (l.prototype.initTiledPano = function (e, antialias) {
  30993. var i = this.sceneRenderer.renderer,
  30994. n =
  30995. (i.context,
  30996. new h.WebGLRenderTargetCube(e, e, {
  30997. stencilBuffer: !1,
  30998. })),
  30999. r = new h.CubeTexture([]);
  31000. (n.texture = r),
  31001. (r.image = [null, null, null, null, null, null]),
  31002. (r.flipY = !0),
  31003. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  31004. antialias
  31005. ? ((r.generateMipmaps = !0),
  31006. (r.magFilter = h.LinearFilter),
  31007. (r.minFilter = h.LinearMipMapLinearFilter))
  31008. : ((r.generateMipmaps = !1),
  31009. (r.magFilter = h.LinearFilter),
  31010. (r.minFilter = h.LinearFilter)),
  31011. (r.format = h.RGBAFormat),
  31012. i.setRenderTarget(n),
  31013. i.setRenderTarget(null);
  31014. var o = i.properties.get(r);
  31015. return (o.__image__webglTextureCube = o.__webglTexture), n;
  31016. }),
  31017. (l.prototype.getUploadQueueForPano = function (e) {
  31018. var t = this.uploadQueues[e];
  31019. return t || ((t = []), (this.uploadQueues[e] = t)), t;
  31020. }),
  31021. (l.prototype.isTileUploaded = function (e) {
  31022. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded;
  31023. }),
  31024. (l.prototype.setUploaded = function (e, t) {
  31025. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t);
  31026. }),
  31027. (l.prototype.queueTileUpload = function (e, t, i) {
  31028. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  31029. if (
  31030. this.isRenderTargetDescriptorValid(n) &&
  31031. e.downloaded &&
  31032. !this.isTileUploaded(e) &&
  31033. (!e.uploadQueued || i) &&
  31034. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31035. ) {
  31036. var r = this.getUploadQueueForPano(e.panoId);
  31037. i
  31038. ? this.uploadTile(e, !1)
  31039. : (this.shoulPushToFrontOfQueue(e)
  31040. ? this.forceQueue.push(e)
  31041. : t && this.direction
  31042. ? y.insertSortedPanoTile(r, e, n.pano, this.direction)
  31043. : r.push(e),
  31044. (e.uploadQueued = !0),
  31045. this.uploadInterval ||
  31046. this.uploadIntervalCancelled ||
  31047. this.refreshUploadInterval(0));
  31048. }
  31049. }),
  31050. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  31051. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize);
  31052. }),
  31053. (l.prototype.getTopUploadQueue = function () {
  31054. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  31055. for (var n = 0; n < this.activePanos.length; n++)
  31056. if (
  31057. ((e = this.activePanos[n]), (t = this.getUploadQueueForPano(e.id)), t.length > 0)
  31058. )
  31059. switch (i) {
  31060. case S.Base:
  31061. if (0 === t[0].level) return t;
  31062. break;
  31063. case S.Remaining:
  31064. return t;
  31065. }
  31066. return null;
  31067. }),
  31068. (l.prototype.getNextFromUploadQueue = (function () {
  31069. var e = function (e) {
  31070. var t = e.shift();
  31071. return (t.uploadQueued = !1), t;
  31072. };
  31073. return function () {
  31074. if (this.forceQueue.length > 0) return e(this.forceQueue);
  31075. var t = this.getTopUploadQueue();
  31076. return t && t.length > 0 ? e(t) : null;
  31077. };
  31078. })()),
  31079. (l.prototype.peekNextFromUploadQueue = function () {
  31080. if (this.forceQueue.length > 0) return this.forceQueue[0];
  31081. var e = this.getTopUploadQueue();
  31082. return e && e.length > 0 ? e[0] : null;
  31083. }),
  31084. (l.prototype.clearAllQueuedUploads = function () {
  31085. this.clearAllUploadQueues(null, 0);
  31086. }),
  31087. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  31088. this.clearAllUploadQueues(e, 0);
  31089. }),
  31090. (l.prototype.clearAllUploadQueues = function (e, t) {
  31091. if (e)
  31092. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  31093. this.clearUploadQueue(this.forceQueue, t, e);
  31094. else {
  31095. for (var i = 0; i < this.activePanos.length; i++) {
  31096. var n = this.activePanos[i];
  31097. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t);
  31098. }
  31099. this.clearUploadQueue(this.forceQueue, t);
  31100. }
  31101. }),
  31102. (l.prototype.clearUploadQueue = function (e, t, i) {
  31103. (void 0 !== t && null !== t) || (t = 0);
  31104. for (var n = 0; n < e.length; ) {
  31105. var r = e[n];
  31106. (!i || (i && i === r.tile.panoId)) && r.level >= t
  31107. ? ((r.uploadQueued = !1), e.splice(n, 1))
  31108. : n++;
  31109. }
  31110. }),
  31111. (l.prototype.refreshUploadInterval = (function () {
  31112. var e = null;
  31113. return function (t) {
  31114. this.uploadIntervalCancelled ||
  31115. (e || (e = c.bind(this)),
  31116. (null !== t && void 0 !== t) || (t = w),
  31117. b || (t = _),
  31118. (this.uploadInterval = window.setTimeout(e, t)),
  31119. (this.uploadIntervalDelay = t));
  31120. };
  31121. })()),
  31122. (l.prototype.update = (function () {
  31123. var e = performance.now(),
  31124. t = 0;
  31125. return function () {
  31126. (this.uploadIntervalCancelled = !0),
  31127. window.clearTimeout(this.uploadInterval),
  31128. (this.uploadInterval = null);
  31129. var i = performance.now() - e;
  31130. !(i > w || 0 === t) ||
  31131. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  31132. (this.updateUploadQueue(
  31133. this.maxNonBaseUploadsPerFrame,
  31134. this.maxBaseUploadsPerFrame
  31135. ),
  31136. (e = performance.now())),
  31137. t++;
  31138. };
  31139. })()),
  31140. (l.prototype.updateUploadQueue = function (e, t) {
  31141. e || (e = 1);
  31142. for (var i = 0, n = 0; ; ) {
  31143. if (n >= t || i >= e) break;
  31144. var r = this.getNextFromUploadQueue();
  31145. if (!r) break;
  31146. if (
  31147. (0 !== r.level ? i++ : n++,
  31148. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31149. ) {
  31150. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  31151. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload);
  31152. }
  31153. }
  31154. }),
  31155. (l.prototype.updateDirection = function (e) {
  31156. if ((e = e || this.direction)) {
  31157. this.direction = e;
  31158. for (var t = 0; t < this.activePanos.length; t++) {
  31159. var i = this.activePanos[t],
  31160. n = this.getUploadQueueForPano(i.id);
  31161. y.sortPanoTiles(n, i, this.direction);
  31162. }
  31163. }
  31164. }),
  31165. (l.prototype.uploadTile = (function () {
  31166. var e = {},
  31167. t = (new h.Vector4(), d.tiling.overlayStyle);
  31168. //var failHistory = {};
  31169. return function (i, n) {
  31170. var r = i.panoId,
  31171. o = i.image,
  31172. a = i.tileSize,
  31173. s = i.panoSize,
  31174. l = i.tileIndex,
  31175. c = (i.faceTileIndex, i.totalTiles),
  31176. u = (i.face, i.tileX),
  31177. d = i.tileY,
  31178. p = !0,
  31179. g = !1,
  31180. m = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  31181. v = this.getActiveRenderTargetDescriptor(r),
  31182. A = v.renderTarget,
  31183. y = v.size;
  31184. if (
  31185. (this.isPanoZoomed(r) && ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  31186. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  31187. n ||
  31188. (this.anyUploaded(i.node) && ((p = !1), (g = !0)),
  31189. this.isTileUploaded(i) && ((p = !1), (g = !1))),
  31190. p)
  31191. ) {
  31192. /* if(failHistory[''+r+s+l]){
  31193. console.log('uploadTile retry', r, s, l)
  31194. }
  31195. console.log('uploadTile 成功', r, s, l)
  31196. */
  31197. var C = u * a,
  31198. I = d * a,
  31199. E = (a / s) * y,
  31200. b = (C / s) * y,
  31201. w = (I / s) * y;
  31202. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  31203. //var _ = e[a];
  31204. //-------------
  31205. if (s > this.qualityManager.maxRenderTargetSize) {
  31206. //4096 改
  31207. var _ = this.sceneRenderer.initSizedTexture2D(a, THREE.ClampToEdgeWrapping);
  31208. var loaded = player.model.isHighMapLoaded(i.cubeFace, u, d);
  31209. } else {
  31210. var _ = e[a];
  31211. }
  31212. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a);
  31213. if (s > this.qualityManager.maxRenderTargetSize) {
  31214. loaded || player.model.updateHighMap(_, i.cubeFace, u, d);
  31215. } else {
  31216. if (1 === t || 2 === t) {
  31217. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  31218. this.sceneRenderer.renderToCubeMap(
  31219. _,
  31220. A,
  31221. a,
  31222. a,
  31223. 0,
  31224. 0,
  31225. a,
  31226. a,
  31227. b,
  31228. w,
  31229. E,
  31230. E,
  31231. i.cubeFace
  31232. ),
  31233. this.sceneRenderer.renderToCubeMap(
  31234. T[s],
  31235. A,
  31236. a,
  31237. a,
  31238. 0,
  31239. 0,
  31240. a,
  31241. a,
  31242. b,
  31243. w,
  31244. E,
  31245. E,
  31246. i.cubeFace,
  31247. h.NormalBlending,
  31248. !0,
  31249. 0.5
  31250. );
  31251. } else
  31252. this.sceneRenderer.renderToCubeMap(
  31253. _,
  31254. A,
  31255. a,
  31256. a,
  31257. 0,
  31258. 0,
  31259. a,
  31260. a,
  31261. b,
  31262. w,
  31263. E,
  31264. E,
  31265. i.cubeFace
  31266. );
  31267. }
  31268. m.uploadCount++,
  31269. this.emit(f.TileRenderSuccess, r, s, l, c),
  31270. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  31271. this.setUploaded(i, !0),
  31272. this.addCoverageForNode(i.node);
  31273. } else {
  31274. this.setUploaded(i, !1);
  31275. //console.log('uploadTile 失败', r, s, l)
  31276. //failHistory[''+r+s+l] = true;
  31277. }
  31278. return (
  31279. i.uploadAttempted ||
  31280. (m.uploadAttempts++, this.emit(f.TileUploadAttempted, r, s, l, c)),
  31281. (i.uploadAttempted = !0),
  31282. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  31283. g
  31284. );
  31285. };
  31286. })()),
  31287. (l.prototype.linkTileAndNode = function (e, t) {
  31288. (t.tile = e), (e.node = t);
  31289. }),
  31290. (l.prototype.linkAllTilesAndNodes = function (e) {
  31291. for (
  31292. var t = function (t, i, n, r, o) {
  31293. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  31294. this.linkTileAndNode(a, n);
  31295. },
  31296. i = 0;
  31297. i < C.FACES_PER_PANO;
  31298. i++
  31299. ) {
  31300. var n = this.getTileTree(e.id, i);
  31301. n.breadthFirst({
  31302. callback: t.bind(this, n, i),
  31303. });
  31304. }
  31305. }),
  31306. (l.prototype.anyUploaded = function (e) {
  31307. if (!e) return !1;
  31308. if (e.tile && this.isTileUploaded(e.tile)) return !0;
  31309. if (e.children)
  31310. for (var t = 0; t < e.children.length; t++) {
  31311. var i = e.children[t];
  31312. if (this.anyUploaded(i)) return !0;
  31313. }
  31314. return !1;
  31315. }),
  31316. (l.prototype.setNodeCovered = function (e, t) {
  31317. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t);
  31318. }),
  31319. (l.prototype.isNodeCovered = function (e) {
  31320. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered);
  31321. }),
  31322. (l.prototype.addCoverageForNode = function (e) {
  31323. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  31324. var t = e.parent;
  31325. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0);
  31326. }
  31327. }),
  31328. (l.prototype.calcFullCoverage = function (e) {
  31329. var t = !1;
  31330. if (e.children)
  31331. for (var i = 0; i < e.children.length; i++) {
  31332. var n = e.children[i];
  31333. t = t || this.calcFullCoverage(n);
  31334. }
  31335. e.covered = e.tile.uploaded || t;
  31336. }),
  31337. (l.prototype.nodeSubcovered = function (e) {
  31338. if (!e.children) return !1;
  31339. for (var t = 0; t < e.children.length; t++)
  31340. if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1;
  31341. return !0;
  31342. }),
  31343. (l.prototype.resetPanoDescriptor = function (e) {
  31344. this.getPanoDescriptor(e);
  31345. }),
  31346. (l.prototype.getPanoDescriptor = function (e) {
  31347. var t = this.panoDescriptors[e];
  31348. return t || ((t = {}), (this.panoDescriptors[e] = t)), t;
  31349. }),
  31350. (l.prototype.resetPanoLODDescriptors = function (e) {
  31351. var t = this.getPanoLODDescriptors(e);
  31352. for (var i in t)
  31353. if (t.hasOwnProperty(i)) {
  31354. var n = t[i];
  31355. (n.uploadCount = 0), (n.uploadAttempts = 0);
  31356. }
  31357. }),
  31358. (l.prototype.getPanoLODDescriptor = function (e, t) {
  31359. var i = this.getPanoLODDescriptors(e),
  31360. n = i[t];
  31361. return (
  31362. n ||
  31363. ((n = {
  31364. uploadCount: 0,
  31365. uploadAttempts: 0,
  31366. }),
  31367. (i[t] = n)),
  31368. n
  31369. );
  31370. }),
  31371. (l.prototype.getPanoLODDescriptors = function (e) {
  31372. var t = this.panoLODDescriptors[e];
  31373. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t;
  31374. }),
  31375. (l.prototype.onTileDownloaded = function (e) {
  31376. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  31377. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  31378. if (
  31379. ((i.downloaded = !0),
  31380. (i.image = e.image),
  31381. (i.panoSize = e.panoSize),
  31382. (i.tileX = e.tileX),
  31383. (i.tileY = e.tileY),
  31384. (i.totalTiles = e.totalTiles),
  31385. (i.tileIndex = e.tileIndex),
  31386. (i.faceTileIndex = e.faceTileIndex),
  31387. (i.face = e.face),
  31388. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  31389. (i.panoId = e.panoId),
  31390. (i.tileSize = e.tileSize),
  31391. (i.direction = new h.Vector3().copy(e.direction)),
  31392. (i.node = null),
  31393. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  31394. this.isPanoActive(i.panoId))
  31395. ) {
  31396. var n = this.getTileTree(i.panoId, i.face),
  31397. r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  31398. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0);
  31399. }
  31400. }),
  31401. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  31402. var r = this.tileDirectory[e];
  31403. r || ((r = {}), (this.tileDirectory[e] = r));
  31404. var o = 16384 * t + 1024 * i + n,
  31405. a = r[o];
  31406. return (
  31407. a ||
  31408. ((a = {
  31409. downloaded: !1,
  31410. uploaded: !1,
  31411. zoomUploaded: !1,
  31412. }),
  31413. (r[o] = a)),
  31414. (a._key = e + ':' + t + ':' + i + ':' + n),
  31415. (a._tileKey = o),
  31416. a
  31417. );
  31418. }),
  31419. (l.prototype.setZoomingActive = function (e, t, i) {
  31420. this.zoomPanoRenderingDisabled ||
  31421. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  31422. ((this.zoomingActive = e),
  31423. (this.zoomPanoId = t.id),
  31424. this.zoomingActive &&
  31425. (this.zoomPanoId !== t.id || i) &&
  31426. this.updateZoomedPanoFromBase(t));
  31427. }),
  31428. (l.prototype.updateZoomedPanoFromBase = function (e) {
  31429. if (!this.zoomPanoRenderingDisabled) {
  31430. var t = this.getActiveRenderTargetDescriptor(e.id);
  31431. if (t && t.renderTarget) {
  31432. var i = Math.min(
  31433. this.qualityManager.maxRenderTargetSize,
  31434. this.qualityManager.getMaxZoomPanoSize()
  31435. ), //this.qualityManager.getMaxZoomPanoSize()
  31436. n = t.renderTarget,
  31437. r = t.size;
  31438. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  31439. this.copyBaseRenderStatusToZoomed(e.id);
  31440. }
  31441. }
  31442. }),
  31443. (t.exports = l);
  31444. },
  31445. {
  31446. '../enum/GLCubeFaces': 25,
  31447. '../enum/PanoRendererEvents': 35,
  31448. '../enum/PanoSizeClass': 36,
  31449. '../enum/SceneRendererEvents': 43,
  31450. '../enum/TileDownloaderEvents': 45,
  31451. '../enum/Vectors': 50,
  31452. '../exception/BasicException': 55,
  31453. '../objects/Panorama': 148,
  31454. '../settings': 166,
  31455. '../util/browser': 182,
  31456. '../util/panorama': 191,
  31457. './TileDownloader': 171,
  31458. './TilePrioritizer': 172,
  31459. './TileTree': 173,
  31460. './TileUtils': 174,
  31461. events: 202,
  31462. three: 217,
  31463. },
  31464. ],
  31465. 170: [
  31466. function (e, t, i) {
  31467. 'use strict';
  31468. function n(e, t, i) {
  31469. (this.maxNavPanoSize = -1),
  31470. (this.maxZoomPanoSize = -1),
  31471. (this.devicePixelDensity = e),
  31472. (this.deviceScreenSize = t),
  31473. (this.clientBandwidth = i),
  31474. (this.panoSizeClassMap = {}),
  31475. (this.useHighResolutionPanos = !0),
  31476. (this.useUltraHighResolutionPanos = !1),
  31477. (this.modelHasUltraHighPanos = !1);
  31478. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096; //add
  31479. }
  31480. var r = e('../enum/PanoSizeClass'),
  31481. o = e('../settings'),
  31482. a = e('../util/browser'),
  31483. s = e('../constants'),
  31484. l = e('../util/showcase'),
  31485. c = e('../enum/ModelManagerEvents');
  31486. (n.prototype.init = function (e) {
  31487. this.buildPanoSizeClassMap(
  31488. this.devicePixelDensity,
  31489. this.deviceScreenSize,
  31490. this.clientBandwidth
  31491. ),
  31492. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  31493. (this.highSize = this.getPanoSize(r.HIGH)),
  31494. (this.standardSize = this.getPanoSize(r.STANDARD)),
  31495. (this.baseSize = this.getPanoSize(r.BASE)),
  31496. o.tiling.maxZoomPanoQuality &&
  31497. this.ultraHighSize <= o.tiling.maxZoomPanoQuality &&
  31498. (o.tiling.allowUltraHighResolution = !0),
  31499. (this.highQualityThreshold = a.valueFromHash(
  31500. 'threshold2k',
  31501. s.windowHeightHighQualityThreshold
  31502. )),
  31503. this.updateMaximums(),
  31504. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this));
  31505. }),
  31506. (n.prototype.updateFromModel = function (e) {
  31507. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e);
  31508. }),
  31509. (n.prototype.updateHighResolutionSettings = function (e) {
  31510. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  31511. l.modelDataPromisesTiles(e.data)
  31512. ? (this.useHighResolutionPanos = !0)
  31513. : (this.useHighResolutionPanos = !1),
  31514. //this.useHighResolutionPanos = !0;
  31515. //----------------------e n d -----------------------------------------------------------------
  31516. this.updateMaximums();
  31517. }),
  31518. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  31519. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos
  31520. ? (this.useUltraHighResolutionPanos = !0)
  31521. : (this.useUltraHighResolutionPanos = !1),
  31522. this.updateMaximums();
  31523. }),
  31524. (n.prototype.enableUltraHighQualityMode = function () {
  31525. (this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null);
  31526. }),
  31527. (n.prototype.ultraHighQualityModeEnabled = function () {
  31528. return this.modelHasUltraHighPanos;
  31529. }),
  31530. (n.prototype.onModelChanged = function (e) {
  31531. this.updateFromModel(e.model), this.updateMaximums();
  31532. }),
  31533. (n.prototype.updateMaximums = function () {
  31534. (this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  31535. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  31536. this.maxZoomPanoSize < this.maxNavPanoSize &&
  31537. (this.maxNavPanoSize = this.maxZoomPanoSize);
  31538. }),
  31539. (n.prototype.buildPanoSizeClassMap = function () {
  31540. (this.panoSizeClassMap[r.BASE] = 512),
  31541. (this.panoSizeClassMap[r.STANDARD] = 1024),
  31542. (this.panoSizeClassMap[r.HIGH] = 2048),
  31543. (this.panoSizeClassMap[r.ULTRAHIGH] = 4096);
  31544. }),
  31545. (n.prototype.getPanoSize = function (e) {
  31546. return this.panoSizeClassMap[e];
  31547. }),
  31548. (n.prototype.getMaxPossiblePanoSize = function () {
  31549. return this.getPanoSize(r.ULTRAHIGH);
  31550. }),
  31551. (n.prototype.getMaxPanoSize = function () {
  31552. return this.maxZoomPanoSize;
  31553. }),
  31554. (n.prototype.getMaxNavPanoSize = function () {
  31555. return this.maxNavPanoSize;
  31556. }),
  31557. (n.prototype.getMaxZoomPanoSize = function () {
  31558. return this.maxZoomPanoSize;
  31559. }),
  31560. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  31561. if(settings.mobileNavHigh)return r.HIGH //改
  31562. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  31563. } */
  31564. (n.prototype.detectDevice = function () {
  31565. //add
  31566. if (a.isMobile()) {
  31567. let area = $('#player').width() * $('#player').height();
  31568. if (area < 768 * 1024) {
  31569. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  31570. return 'mobile';
  31571. } else {
  31572. return 'bigMobile';
  31573. }
  31574. } else {
  31575. return 'pc';
  31576. }
  31577. });
  31578. (n.prototype.detectMaxNavPanoSizeClass = function () {
  31579. //xzw 改
  31580. switch (this.getNavZoomClass()) {
  31581. case '1k':
  31582. return r.STANDARD;
  31583. break;
  31584. case '2k':
  31585. default:
  31586. return r.HIGH;
  31587. case '4k': //虽然这种暂不支持
  31588. return r.ULTRAHIGH;
  31589. }
  31590. }),
  31591. (n.prototype.detectMaxNavPanoSize = function () {
  31592. var e = this.detectMaxNavPanoSizeClass();
  31593. return this.getPanoSize(e);
  31594. }),
  31595. (n.prototype.getMaxZoomClass = function () {
  31596. //add
  31597. let type = this.detectDevice();
  31598. let setting = settings.tileClass[type]; //见manage.js的settings
  31599. return setting.max;
  31600. });
  31601. (n.prototype.getNavZoomClass = function () {
  31602. //add
  31603. let type = this.detectDevice();
  31604. let setting = settings.tileClass[type];
  31605. return setting.nav;
  31606. }),
  31607. (n.prototype.detectMaxZoomPanoSize = function () {
  31608. //获取当前zoomRenderTarget应下载的最高级别
  31609. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  31610. if (this.zoomLevelResolution) {
  31611. //有三个级别
  31612. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  31613. return this.getPanoSize(r.ULTRAHIGH);
  31614. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  31615. return this.getPanoSize(r.STANDARD);
  31616. } else {
  31617. return this.getPanoSize(r.HIGH);
  31618. }
  31619. } else {
  31620. let tileClass = this.getMaxZoomClass();
  31621. if (tileClass == '1k') return this.getPanoSize(r.STANDARD);
  31622. if (tileClass == '4k' && this.useUltraHighResolutionPanos) {
  31623. return this.getPanoSize(r.ULTRAHIGH);
  31624. } else {
  31625. //'2k'
  31626. return this.getPanoSize(r.HIGH);
  31627. }
  31628. }
  31629. }),
  31630. /* n.prototype.detectMaxZoomPanoSize = function() {
  31631. 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)
  31632. } */
  31633. (t.exports = n);
  31634. },
  31635. {
  31636. '../constants': 8,
  31637. '../enum/ModelManagerEvents': 33,
  31638. '../enum/PanoSizeClass': 36,
  31639. '../settings': 166,
  31640. '../util/browser': 182,
  31641. '../util/showcase': 193,
  31642. },
  31643. ],
  31644. 171: [
  31645. function (e, t, i) {
  31646. (function (i) {
  31647. 'use strict';
  31648. function n(e) {
  31649. (this.panos = null),
  31650. (this.retryMinimumTime = 1e4),
  31651. (this.urls = null),
  31652. (this.panoLoadCallbacks = {}),
  31653. (this.downloadDescriptors = {}),
  31654. (this.priorityQueue = []),
  31655. (this.forceQueue = []),
  31656. (this.activeDownloads = []),
  31657. (this.qualityManager = null),
  31658. (this.tilePrioritizer = null),
  31659. (this.refreshInterval = null),
  31660. (this.processPriorityQueue = !1),
  31661. (this.concurrentDownloads = e.concurrentDownloads || 1),
  31662. (this.downloadTestResults = {});
  31663. }
  31664. var r = e('three'),
  31665. o = (e('../enum/Viewmode'), e('../settings')),
  31666. a = (e('../objects/Panorama'), e('../util/logger')),
  31667. s =
  31668. (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/TileDownloaderEvents')),
  31669. l = e('./TilePrioritizer'),
  31670. c = e('./TileUtils'),
  31671. h = (e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  31672. u = e('../util/panorama'),
  31673. d = e('../util/ajax'),
  31674. p = e('../ab'),
  31675. f = e('events').EventEmitter,
  31676. g =
  31677. (new a(i),
  31678. Object.freeze({
  31679. Testing: 1,
  31680. Success: 2,
  31681. Fail: 3,
  31682. }));
  31683. (n.prototype = Object.create(f.prototype)),
  31684. (n.IDLE_REFRESH_DELAY = 500),
  31685. (n.ACTIVE_REFRESH_DELAY = 16),
  31686. (n.DOWNLOAD_RETRIES = 4),
  31687. (n.prototype.init = function (e) {
  31688. this.qualityManager = e;
  31689. }),
  31690. (n.prototype.setUrls = function (e) {
  31691. this.urls = e;
  31692. }),
  31693. (n.prototype.setPanoData = function (e, t, i) {
  31694. (this.panos = e), (this.imagePanos = t), (this.panoGroupId = i);
  31695. }),
  31696. (n.prototype.start = function () {
  31697. this.refreshUpdateInterval(0);
  31698. }),
  31699. (n.prototype.stop = function () {
  31700. window.cancel(this.refreshInterval);
  31701. }),
  31702. (n.prototype.refreshUpdateInterval = function (e) {
  31703. e || (e = 0),
  31704. (this.refreshInterval = window.setTimeout(
  31705. function () {
  31706. var e = this.update();
  31707. e
  31708. ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY)
  31709. : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY);
  31710. }.bind(this),
  31711. e
  31712. ));
  31713. }),
  31714. (n.prototype.update = function () {
  31715. var e = this.forceQueue.length > 0;
  31716. return (
  31717. this.processQueueForDownloading(this.forceQueue),
  31718. this.processPriorityQueue &&
  31719. (this.queuePrioritizedTilesForPanos(this.panos),
  31720. this.priorityQueue.length > 0 && (e = !0),
  31721. this.processQueueForDownloading(this.priorityQueue)),
  31722. e
  31723. );
  31724. }),
  31725. (n.prototype.forceQueueTilesForPano = (function () {
  31726. var e = [],
  31727. t = [];
  31728. return function (i, n, r, o, a, s) {
  31729. e.length = 0;
  31730. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  31731. var p = u[d];
  31732. (p.status !== h.None && p.status !== h.Queued) || e.push(p);
  31733. }
  31734. if (r && e.length > 0) {
  31735. l.sortPanoTiles(e, i, r),
  31736. (t.length = 0),
  31737. c.matchingTilesInDirection(i, n, r, o, a, t);
  31738. for (
  31739. var f = 0,
  31740. g = function (e) {
  31741. return e.face === m.face && e.faceTileIndex === m.faceTileIndex;
  31742. };
  31743. f < e.length;
  31744. ) {
  31745. var m = e[f],
  31746. v = t.findIndex(g);
  31747. v < 0 ? e.splice(f, 1) : f++;
  31748. }
  31749. }
  31750. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A]);
  31751. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  31752. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  31753. s && this.processQueueForDownloading(this.forceQueue, !0);
  31754. };
  31755. })()),
  31756. (n.prototype.clearForceQueue = function () {
  31757. this.clearQueue(this.forceQueue);
  31758. }),
  31759. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  31760. this.tilePrioritizer &&
  31761. (this.clearQueue(this.priorityQueue),
  31762. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  31763. this.clearFromQueue(this.priorityQueue, h.None, !0),
  31764. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued));
  31765. }),
  31766. (n.prototype.clearQueue = function (e) {
  31767. this.setStatusForAllDescriptors(e, h.None), (e.length = 0);
  31768. }),
  31769. (n.prototype.clearFromQueue = function (e, t, i) {
  31770. for (var n = 0; n < e.length; n++) {
  31771. var r = e[n];
  31772. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null);
  31773. }
  31774. }),
  31775. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  31776. for (var i = 0; i < e.length; i++) {
  31777. var n = e[i];
  31778. n && (n.status = t);
  31779. }
  31780. }),
  31781. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  31782. for (var i = 0; i < e.length; i++) {
  31783. var n = e[i];
  31784. n && (n.status !== t ? (n.status = t) : (e[i] = null));
  31785. }
  31786. }),
  31787. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  31788. var i = this.getAllTileDownloadDescriptorsForPano(e),
  31789. n = i[t];
  31790. return (
  31791. n ||
  31792. ((n = this.buildDownloadDescriptorArray(t)),
  31793. (i[t] = n),
  31794. this.initTileDownloadDescriptors(n, e, t)),
  31795. n
  31796. );
  31797. }),
  31798. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  31799. var t = this.downloadDescriptors[e.id];
  31800. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t;
  31801. }),
  31802. (n.prototype.processQueueForDownloading = function (e, t) {
  31803. if (
  31804. (this.cleanupActiveDownloads(),
  31805. this.activeDownloads.length < this.concurrentDownloads || t)
  31806. )
  31807. for (
  31808. var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length,
  31809. n = 0,
  31810. r = 0;
  31811. n < i && e.length > 0;
  31812. r++
  31813. ) {
  31814. var o = e.shift();
  31815. o && (this.startDownload(o), n++);
  31816. }
  31817. }),
  31818. (n.prototype.testDownload = function (e, t, i) {
  31819. var n = this.downloadTestResults[e];
  31820. if (n) return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  31821. this.downloadTestResults[e] = g.Testing;
  31822. var r = this.panos.list[0],
  31823. o = this.getTileUrl(r.id, e, t, 0),
  31824. a = function (t) {
  31825. (this.downloadTestResults[e] = g.Success), i(!0);
  31826. }.bind(this),
  31827. s = function () {
  31828. (this.downloadTestResults[e] = g.Fail), i(!1);
  31829. }.bind(this);
  31830. this.loadImage(o, 0, a, s);
  31831. }),
  31832. (n.prototype.startDownload = function (e) {
  31833. e.status = h.Downloading;
  31834. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  31835. this.activeDownloads.push(e),
  31836. this.loadImage(
  31837. t,
  31838. n.DOWNLOAD_RETRIES,
  31839. this.downloadComplete.bind(this, e),
  31840. this.downloadFailed.bind(this, e)
  31841. );
  31842. }),
  31843. (n.prototype.downloadFailed = function (e, t) {}),
  31844. (n.prototype.downloadComplete = function (e, t) {
  31845. if (e.panoGroupId === this.panoGroupId) {
  31846. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  31847. (e.status = h.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  31848. var n = {
  31849. panoId: e.pano.id,
  31850. image: t,
  31851. tileSize: e.tileSize,
  31852. panoSize: e.panoSize,
  31853. tileIndex: e.tileIndex,
  31854. faceTileIndex: e.faceTileIndex,
  31855. totalTiles: e.totalTiles,
  31856. face: e.face,
  31857. tileX: e.tileX,
  31858. tileY: e.tileY,
  31859. direction: e.direction,
  31860. };
  31861. (e.image = t),
  31862. this.emit(s.TileDownloadSuccess, n),
  31863. this.isPanoDownloaded(e.pano, e.panoSize) &&
  31864. ((n = {
  31865. panoId: e.pano.id,
  31866. tileSize: e.tileSize,
  31867. panoSize: e.panoSize,
  31868. }),
  31869. this.emit(s.PanoDownloadComplete, n),
  31870. i && i.onLoad && i.onLoad(e.pano, e.panoSize));
  31871. }
  31872. }),
  31873. (n.prototype.cleanupActiveDownloads = (function () {
  31874. var e = [];
  31875. return function () {
  31876. e.length = 0;
  31877. for (var t = 0; t < this.activeDownloads.length; t++) {
  31878. var i = this.activeDownloads[t];
  31879. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i);
  31880. }
  31881. (this.activeDownloads.length = 0),
  31882. this.activeDownloads.push.apply(this.activeDownloads, e);
  31883. };
  31884. })()),
  31885. (n.prototype.isPanoDownloaded = function (e, t) {
  31886. var i = this.getTileDownloadDescriptors(e, t);
  31887. if (i.length <= 0) return !1;
  31888. for (var n = 0; n < i.length; n++) {
  31889. var r = i[n];
  31890. if (r.status !== h.Downloaded) return !1;
  31891. }
  31892. return !0;
  31893. }),
  31894. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  31895. var o = e.id + ':' + this.qualityManager.getPanoSize(t);
  31896. this.panoLoadCallbacks[o] = {
  31897. onLoad: i,
  31898. onFail: n,
  31899. onProgress: r,
  31900. };
  31901. }),
  31902. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  31903. var i = e.id + ':' + t;
  31904. return this.panoLoadCallbacks[i];
  31905. }),
  31906. (n.prototype.buildDownloadDescriptorArray = function (e) {
  31907. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  31908. var r = this.buildDownloadDescriptor();
  31909. i.push(r);
  31910. }
  31911. return i;
  31912. }),
  31913. (n.prototype.buildDownloadDescriptor = function () {
  31914. var e = {
  31915. panoGroupId: null,
  31916. pano: null,
  31917. panoSize: -1,
  31918. tileSize: -1,
  31919. tileIndex: -1,
  31920. totalTiles: -1,
  31921. faceTileIndex: -1,
  31922. status: h.None,
  31923. url: null,
  31924. image: null,
  31925. direction: new r.Vector3(),
  31926. face: -1,
  31927. cubeFace: -1,
  31928. tileX: -1,
  31929. tileY: -1,
  31930. };
  31931. return e;
  31932. }),
  31933. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  31934. for (var n = 0; n < e.length; n++) {
  31935. var r = e[n];
  31936. this.initTileDownloadDescriptor(r, t, i, n);
  31937. }
  31938. }),
  31939. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  31940. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  31941. (e.face = c.getFaceForTile(i, n)),
  31942. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  31943. (e.panoGroupId = this.panoGroupId),
  31944. (e.pano = t),
  31945. (e.panoSize = i),
  31946. (e.tileSize = r),
  31947. (e.tileIndex = n),
  31948. (e.totalTiles = c.getTileCountForSize(i)),
  31949. (e.status = h.None),
  31950. (e.image = null),
  31951. c.getTileLocation(e.panoSize, e.tileIndex, e),
  31952. c.getTileVector(
  31953. e.panoSize,
  31954. e.tileSize,
  31955. e.cubeFace,
  31956. e.tileX,
  31957. e.tileY,
  31958. c.LocationOnTile.Center,
  31959. 0,
  31960. e.direction
  31961. );
  31962. }),
  31963. (n.prototype.getTileUrl = (function () {
  31964. var e = {
  31965. 256: '256',
  31966. 512: '512',
  31967. 1024: '1k',
  31968. 2048: '2k',
  31969. 4096: '4k',
  31970. },
  31971. t = {
  31972. face: -1,
  31973. faceTileIndex: -1,
  31974. tileX: -1,
  31975. tileY: -1,
  31976. };
  31977. return function (i, n, r, a) {
  31978. c.getTileLocation(n, a, t);
  31979. var s = Math.floor(n / r),
  31980. l = s * s,
  31981. h = Math.floor(a / l),
  31982. u = '';
  31983. 1 === o.tiling.customCompression && (u = '_' + o.tiling['q' + e[n]]);
  31984. var d = this.urls.get(
  31985. 'tiles/' +
  31986. i +
  31987. '/' +
  31988. e[n] +
  31989. u +
  31990. '_face' +
  31991. h +
  31992. '_' +
  31993. t.tileX +
  31994. '_' +
  31995. t.tileY +
  31996. '.jpg'
  31997. );
  31998. return (d = p.changeIfTileGenerating(d));
  31999. };
  32000. })()),
  32001. (n.prototype.loadImage = function (e, t, i, n) {
  32002. d.getImage(e, t)
  32003. .then(function (e) {
  32004. i(e);
  32005. })
  32006. .fail(n);
  32007. }),
  32008. (t.exports = n);
  32009. }.call(this, '/js/tile/TileDownloader.js'));
  32010. },
  32011. {
  32012. '../ab': 3,
  32013. '../enum/DownloadStatus': 24,
  32014. '../enum/GLCubeFaces': 25,
  32015. '../enum/PanoSizeClass': 36,
  32016. '../enum/TileDownloaderEvents': 45,
  32017. '../enum/Vectors': 50,
  32018. '../enum/Viewmode': 51,
  32019. '../objects/Panorama': 148,
  32020. '../settings': 166,
  32021. '../util/ajax': 181,
  32022. '../util/logger': 189,
  32023. '../util/panorama': 191,
  32024. './TilePrioritizer': 172,
  32025. './TileUtils': 174,
  32026. events: 202,
  32027. three: 217,
  32028. },
  32029. ],
  32030. 172: [
  32031. function (e, t, i) {
  32032. (function (i) {
  32033. 'use strict';
  32034. function n(e, t, i, o, a) {
  32035. (this.qualityManager = e),
  32036. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  32037. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  32038. (this.baseSize = t),
  32039. (this.standardSize = i),
  32040. (this.highSize = o),
  32041. (this.ultraHighSize = a),
  32042. (this.priorityCriteria = new n.PriorityCriteria(
  32043. null,
  32044. new r.Vector3(0, 0, 0),
  32045. new r.Vector3(0, 0, -1),
  32046. new r.Vector3(0, 0, -1)
  32047. ));
  32048. }
  32049. var r = e('three'),
  32050. o =
  32051. (e('../enum/Viewmode'), e('../settings'), e('../settings'), e('../objects/Panorama')),
  32052. a = e('../util/logger'),
  32053. s =
  32054. (e('../enum/Vectors'),
  32055. e('../enum/PanoSizeClass'),
  32056. e('../enum/ModelManagerEvents'),
  32057. e('../enum/GLCubeFaces'),
  32058. e('../enum/DownloadStatus')),
  32059. l = (e('../util/browser'), e('./TileUtils')),
  32060. c = e('../util/math'),
  32061. h =
  32062. (e('events').EventEmitter,
  32063. new a(i),
  32064. Object.freeze({
  32065. None: 0,
  32066. DirectionalFOV: 1,
  32067. }));
  32068. (n.PriorityCriteria = function (e, t, i, n, o) {
  32069. (this.pano = e),
  32070. (this.cameraPosition = new r.Vector3().copy(t)),
  32071. (this.cameraDir = new r.Vector3().copy(i)),
  32072. (this.panoSpaceDir = new r.Vector3().copy(n)),
  32073. (this.upcomingPanos = o),
  32074. (this.copy = function (e) {
  32075. (this.pano = e.pano),
  32076. this.cameraPosition.copy(e.cameraPosition),
  32077. this.cameraDir.copy(e.cameraDir),
  32078. this.panoSpaceDir.copy(e.panoSpaceDir),
  32079. (this.upcomingPanos = o);
  32080. }),
  32081. (this.zoomingActive = !1);
  32082. }),
  32083. (n.DIRECTIONAL_FOV = 180),
  32084. (n.DIRECTIONAL_FOV_NARROW = 120),
  32085. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  32086. (n.MAX_SCORED_PANOS_TOADD = 2),
  32087. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  32088. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  32089. (n.appendQueue = function (e, t) {
  32090. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i]);
  32091. }),
  32092. (n.prototype.updateCriteria = function (e, t, i, n) {
  32093. (this.priorityCriteria.pano = e),
  32094. this.priorityCriteria.cameraPosition.copy(t),
  32095. this.priorityCriteria.cameraDir.copy(i),
  32096. (this.priorityCriteria.upcomingPanos = n),
  32097. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  32098. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize());
  32099. }),
  32100. (n.prototype.filterAndPrioritize = (function () {
  32101. var e = [],
  32102. t = [],
  32103. i = [];
  32104. return function (r, o, a) {
  32105. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  32106. this.populateScoredPanos(
  32107. this.priorityCriteria.pano,
  32108. o,
  32109. t,
  32110. this.priorityCriteria.cameraDir,
  32111. n.MAX_SCORED_PANOS_TOCONSIDER
  32112. );
  32113. var s = this.baseSize,
  32114. l = this.standardSize,
  32115. c = this.highSize,
  32116. h = this.ultraHighSize;
  32117. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  32118. this.priorityCriteria.upcomingPanos &&
  32119. this.queueTilesForPanos(
  32120. r,
  32121. this.priorityCriteria.upcomingPanos,
  32122. a,
  32123. s,
  32124. n.MAX_UPCOMING_PANOS_TOADD
  32125. ),
  32126. this.priorityCriteria.upcomingPanos &&
  32127. this.queueTilesForPanos(
  32128. r,
  32129. this.priorityCriteria.upcomingPanos,
  32130. a,
  32131. 1024,
  32132. n.MAX_UPCOMING_PANOS_TOADD
  32133. ), //更清晰些
  32134. (i.length = 0),
  32135. this.canDownloadSize(l) &&
  32136. this.queueTilesInDirectionForPano(
  32137. i,
  32138. a,
  32139. this.priorityCriteria.pano,
  32140. l,
  32141. this.priorityCriteria.cameraPosition,
  32142. this.priorityCriteria.cameraDir,
  32143. n.DIRECTIONAL_FOV_NARROW
  32144. ),
  32145. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32146. n.appendQueue(r, i),
  32147. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  32148. (i.length = 0),
  32149. this.canDownloadSize(c) &&
  32150. this.queueTilesInDirectionForPano(
  32151. i,
  32152. a,
  32153. this.priorityCriteria.pano,
  32154. c,
  32155. this.priorityCriteria.cameraPosition,
  32156. this.priorityCriteria.cameraDir,
  32157. n.DIRECTIONAL_FOV_NARROW
  32158. ),
  32159. this.canDownloadSize(h) &&
  32160. this.queueTilesInDirectionForPano(
  32161. i,
  32162. a,
  32163. this.priorityCriteria.pano,
  32164. h,
  32165. this.priorityCriteria.cameraPosition,
  32166. this.priorityCriteria.cameraDir,
  32167. n.DIRECTIONAL_FOV_NARROW
  32168. ),
  32169. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32170. n.appendQueue(r, i),
  32171. (i.length = 0),
  32172. this.canDownloadSize(l) &&
  32173. this.queueTilesInDirectionForPano(
  32174. i,
  32175. a,
  32176. this.priorityCriteria.pano,
  32177. l,
  32178. this.priorityCriteria.cameraPosition,
  32179. this.priorityCriteria.cameraDir,
  32180. n.DIRECTIONAL_FOV
  32181. ),
  32182. this.canDownloadSize(c) &&
  32183. this.queueTilesInDirectionForPano(
  32184. i,
  32185. a,
  32186. this.priorityCriteria.pano,
  32187. c,
  32188. this.priorityCriteria.cameraPosition,
  32189. this.priorityCriteria.cameraDir,
  32190. n.DIRECTIONAL_FOV
  32191. ),
  32192. this.canDownloadSize(h) &&
  32193. this.queueTilesInDirectionForPano(
  32194. i,
  32195. a,
  32196. this.priorityCriteria.pano,
  32197. h,
  32198. this.priorityCriteria.cameraPosition,
  32199. this.priorityCriteria.cameraDir,
  32200. n.DIRECTIONAL_FOV
  32201. ),
  32202. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32203. n.appendQueue(r, i),
  32204. this.queueTilesForPanos(r, e, a, s);
  32205. };
  32206. })()),
  32207. (n.prototype.canDownloadSize = function (e) {
  32208. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive);
  32209. }),
  32210. (n.prototype.populateNeighborPanos = function (e, t, i) {
  32211. (i = i || []), (i.length = 0);
  32212. var n = t.getNeighbours(e);
  32213. for (var r in n)
  32214. if (n.hasOwnProperty(r)) {
  32215. var o = t.get(r);
  32216. i.push(o);
  32217. }
  32218. return i;
  32219. }),
  32220. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  32221. (i = i || []), (i.length = 0);
  32222. var s = [
  32223. o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS),
  32224. o.filters.not(e),
  32225. ],
  32226. l = [
  32227. o.scoreFunctions.distanceSquared(e),
  32228. o.scoreFunctions.direction(e.position, r),
  32229. ],
  32230. c = t.sortByScore(s, l);
  32231. if (c)
  32232. for (var h = 0; h < c.length && h < a; h++) {
  32233. var u = c[h].item;
  32234. i.push(u);
  32235. }
  32236. return i;
  32237. }),
  32238. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  32239. for (var o = 0, a = 0; a < t.length; a++) {
  32240. var s = t[a],
  32241. l = this.queueTilesForPano(e, i, s, n);
  32242. if (((o += l > 0 ? 1 : 0), r && o >= r)) break;
  32243. }
  32244. return o;
  32245. }),
  32246. (n.prototype.queueTilesForPano = (function () {
  32247. var e = {
  32248. filter: h.None,
  32249. };
  32250. return function (t, i, n, r) {
  32251. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e);
  32252. };
  32253. })()),
  32254. (n.prototype.queueTilesForPanosInDirection = (function () {
  32255. var e = new r.Vector3();
  32256. return function (t, i, n, r, o, a, s, l) {
  32257. for (var h = 0, u = 0; u < n.length; u++) {
  32258. var d = n[u];
  32259. e.copy(d.position), e.sub(o), e.normalize();
  32260. var p = Math.max(Math.min(a.dot(e), 1), -1),
  32261. f = c.getFOVDotThreshold(s);
  32262. if (p >= f) {
  32263. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  32264. if (((h += g > 0 ? 1 : 0), l && h >= l)) break;
  32265. }
  32266. }
  32267. return h;
  32268. };
  32269. })()),
  32270. (n.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  32271. for (var l = 0, c = 0; c < i.length; c++) {
  32272. var h = i[c],
  32273. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  32274. if (((l += u > 0 ? 1 : 0), s && l >= s)) break;
  32275. }
  32276. return l;
  32277. }),
  32278. (n.prototype.queueTilesInDirectionForPano = (function () {
  32279. var e = {
  32280. filter: h.DirectionalFOV,
  32281. direction: new r.Vector3(),
  32282. fov: 60,
  32283. },
  32284. t = new r.Vector3();
  32285. return function (i, n, r, o, a, s, c) {
  32286. return (
  32287. t.copy(s),
  32288. l.getRelativeDirection(r.quaternion, t),
  32289. e.direction.copy(t),
  32290. (e.fov = c),
  32291. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  32292. );
  32293. };
  32294. })()),
  32295. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  32296. var e = [];
  32297. return function (t, i, n, r, o) {
  32298. var a = i.getTileDownloadDescriptors(n, r);
  32299. (e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o);
  32300. for (var s = 0, l = 0; l < e.length; l++) {
  32301. var c = e[l];
  32302. c && (t.push(c), s++);
  32303. }
  32304. return s;
  32305. };
  32306. })()),
  32307. (n.prototype.filterTileDownloadDescriptors = (function () {
  32308. new r.Vector3();
  32309. return function (e, t, i, n) {
  32310. var r, o;
  32311. switch (n.filter) {
  32312. case h.DirectionalFOV:
  32313. for (r = 0; r < t.length; r++)
  32314. (o = t[r]),
  32315. l.isTileWithinFOV(
  32316. o.panoSize,
  32317. o.tileSize,
  32318. o.face,
  32319. o.tileX,
  32320. o.tileY,
  32321. n.direction,
  32322. n.fov
  32323. ) && i.push(o);
  32324. break;
  32325. default:
  32326. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o);
  32327. }
  32328. for (r = 0; r < i.length; r++)
  32329. (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null);
  32330. };
  32331. })()),
  32332. (n.prototype.canIncludeDescriptor = function (e) {
  32333. return e.status !== s.Downloading && e.status !== s.Downloaded;
  32334. }),
  32335. (n.prototype.canIncludePano = function (e, t) {
  32336. return !e.isLoaded(t);
  32337. }),
  32338. (n.getFOVDotThreshold = function (e) {
  32339. return Math.cos(r.Math.degToRad(e / 2));
  32340. });
  32341. var u = (function () {
  32342. var e = function e(t, i) {
  32343. var n = e._panoSpaceDir,
  32344. r = e._fovThreshold,
  32345. o = e._fovThresholdNarrow,
  32346. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  32347. s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  32348. return (
  32349. (t._dot = a),
  32350. (i._dot = s),
  32351. a >= r && s < r
  32352. ? -1
  32353. : a < r && s >= r
  32354. ? 1
  32355. : a >= o && s < o
  32356. ? -1
  32357. : a < o && s >= o
  32358. ? 1
  32359. : t.panoSize > i.panoSize
  32360. ? 1
  32361. : i.panoSize > t.panoSize
  32362. ? -1
  32363. : -(a - s)
  32364. );
  32365. };
  32366. return (
  32367. (e._panoSpaceDir = new r.Vector3()),
  32368. (e._fovThreshold = -1),
  32369. (e._fovThresholdNarrow = -1),
  32370. e
  32371. );
  32372. })();
  32373. (n.sortPanoTiles = function (e, t, i) {
  32374. u._panoSpaceDir.copy(i),
  32375. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  32376. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32377. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  32378. e.sort(u);
  32379. }),
  32380. (n.insertSortedPanoTile = function (e, t, i, r) {
  32381. u._panoSpaceDir.copy(r),
  32382. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  32383. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32384. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV));
  32385. for (var o = -1, a = 0; a < e.length; a++) {
  32386. var s = u(t, e[a]);
  32387. if (s <= 0) {
  32388. o = a;
  32389. break;
  32390. }
  32391. }
  32392. if (o === -1) e[e.length] = t;
  32393. else {
  32394. for (var h = e.length; h > o; h--) e[h] = e[h - 1];
  32395. e[o] = t;
  32396. }
  32397. }),
  32398. (n.prototype.setZoomingActive = function (e) {
  32399. e !== this.zoomingActive && (this.zoomingActive = e);
  32400. }),
  32401. (t.exports = n);
  32402. }.call(this, '/js/tile/TilePrioritizer.js'));
  32403. },
  32404. {
  32405. '../enum/DownloadStatus': 24,
  32406. '../enum/GLCubeFaces': 25,
  32407. '../enum/ModelManagerEvents': 33,
  32408. '../enum/PanoSizeClass': 36,
  32409. '../enum/Vectors': 50,
  32410. '../enum/Viewmode': 51,
  32411. '../objects/Panorama': 148,
  32412. '../settings': 166,
  32413. '../util/browser': 182,
  32414. '../util/logger': 189,
  32415. '../util/math': 190,
  32416. './TileUtils': 174,
  32417. events: 202,
  32418. three: 217,
  32419. },
  32420. ],
  32421. 173: [
  32422. function (e, t, i) {
  32423. 'use strict';
  32424. function n(e, t) {
  32425. (this.levels = t), (this.tileSize = e), (this.root = null), (this.allNodes = []), a(this);
  32426. }
  32427. function r(e, t) {
  32428. (this.tree = e), (this.parent = t), (this.children = []), (this.id = ++u);
  32429. }
  32430. function o(e, t, i, r, a, s, l, h) {
  32431. if (e) {
  32432. l = l || n.TraversalType.PreOrder;
  32433. var u = r * c + i;
  32434. if (
  32435. (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r), s && s.push(e)),
  32436. e.children && 0 !== e.children.length)
  32437. ) {
  32438. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  32439. for (var g = 0; g < c; g++)
  32440. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  32441. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r), s && s.push(e));
  32442. }
  32443. }
  32444. }
  32445. function a(e) {
  32446. e.root = s(e, null, 0);
  32447. }
  32448. function s(e, t, i) {
  32449. if (i > e.levels) return null;
  32450. var n = new r(e, t);
  32451. e.allNodes.push(n);
  32452. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1);
  32453. return n;
  32454. }
  32455. function l(e, t, i, n, r) {
  32456. if (!e) return null;
  32457. if (0 === i) return e;
  32458. if (!e.children || 0 === e.children.length) return null;
  32459. var o = Math.pow(c, i),
  32460. a = o / c,
  32461. s = n % a,
  32462. h = r % a,
  32463. u = Math.floor(r / a),
  32464. d = Math.floor(n / a),
  32465. p = u * c + d,
  32466. f = e.children[p];
  32467. return l(f, t + 1, i - 1, s, h);
  32468. }
  32469. var c =
  32470. (e('three'),
  32471. e('./TileUtils'),
  32472. e('../objects/Panorama'),
  32473. e('../util/panorama'),
  32474. e('events').EventEmitter,
  32475. 2),
  32476. h = c * c;
  32477. n.TraversalType = Object.freeze({
  32478. PreOrder: 0,
  32479. PostOrder: 1,
  32480. });
  32481. var u = 0;
  32482. (n.getLevelCountForSize = function (e, t) {
  32483. var i = 0;
  32484. for (t < e && (t = e); ; ) {
  32485. if (((t /= c), t < e)) break;
  32486. i++;
  32487. }
  32488. return i;
  32489. }),
  32490. (n.getSizeForLevel = function (e, t) {
  32491. return Math.pow(c, t) * e;
  32492. }),
  32493. (n.prototype.getSubNode = function (e, t, i) {
  32494. (!t || e < this.tileSize) && (t = 0),
  32495. (!i || e < this.tileSize) && (i = 0),
  32496. e < this.tileSize && (e = this.tileSize);
  32497. var r = n.getLevelCountForSize(this.tileSize, e),
  32498. o = l(this.root, 0, r, t, i);
  32499. return o;
  32500. }),
  32501. (n.prototype.breadthFirst = function (e) {
  32502. e = e || {};
  32503. var t = !!e.nullLevelEnd,
  32504. i = e.maxLevel,
  32505. n = e.minLevel,
  32506. r = e.callback,
  32507. o = e.saveVisited,
  32508. a = [],
  32509. s = {},
  32510. l = 0,
  32511. c = 0;
  32512. for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i); ) {
  32513. var h = a.shift();
  32514. if (h === s)
  32515. (!n || l >= n) && (r && t && r(null), o && t && o.push(null)),
  32516. a.length > 0 && a.push(s),
  32517. l++,
  32518. (c = 0);
  32519. else {
  32520. if (h.children)
  32521. for (var u = 0; u < h.children.length; u++) {
  32522. var d = h.children[u];
  32523. d && a.push(h.children[u]);
  32524. }
  32525. var p = this.getFaceIndexFromNode(h);
  32526. (!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++;
  32527. }
  32528. }
  32529. }),
  32530. (n.prototype.getFaceIndexFromNode = function (e) {
  32531. if (!e) return -1;
  32532. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  32533. var o = i.parent;
  32534. if (!o) break;
  32535. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s);
  32536. var l = a % c,
  32537. h = Math.floor(a / c);
  32538. (n = l * t + n), (r = h * t + r), (t *= c), (i = o);
  32539. }
  32540. return r * t + n;
  32541. }),
  32542. (n.prototype.depthFirst = function (e, t, i) {
  32543. o(this.root, 0, 0, 0, e, t, i, this.tileSize);
  32544. }),
  32545. (t.exports = n);
  32546. },
  32547. {
  32548. '../objects/Panorama': 148,
  32549. '../util/panorama': 191,
  32550. './TileUtils': 174,
  32551. events: 202,
  32552. three: 217,
  32553. },
  32554. ],
  32555. 174: [
  32556. function (e, t, i) {
  32557. 'use strict';
  32558. var n = e('../enum/GLCubeFaces'),
  32559. r = e('../util/MathLight'),
  32560. o = {};
  32561. (o.TILE_SIZE = 512),
  32562. (o.FACES_PER_PANO = 6),
  32563. (o.LocationOnTile = {
  32564. Center: 0,
  32565. UpperLeft: 1,
  32566. UpperRight: 2,
  32567. LowerRight: 3,
  32568. LowerLeft: 4,
  32569. }),
  32570. (o.getTileVector = (function () {
  32571. return function (e, t, i, a, s, l, c, h) {
  32572. l = l || o.LocationOnTile.Center;
  32573. var u = e / t,
  32574. d = a / u;
  32575. s = -s + (u - 1);
  32576. var p = s / u,
  32577. f = t / e,
  32578. g = 2 * f,
  32579. m = g / 2,
  32580. v = 2 * d - 1 + m,
  32581. A = 2 * p - 1 + m;
  32582. switch (l) {
  32583. case o.LocationOnTile.UpperLeft:
  32584. (v -= m), (A += m), (v += c * g);
  32585. break;
  32586. case o.LocationOnTile.UpperRight:
  32587. (v += m), (A += m), (A -= c * g);
  32588. break;
  32589. case o.LocationOnTile.LowerRight:
  32590. (v += m), (A -= m), (v -= c * g);
  32591. break;
  32592. case o.LocationOnTile.LowerLeft:
  32593. (v -= m), (A -= m), (A += c * g);
  32594. break;
  32595. case o.LocationOnTile.Center:
  32596. }
  32597. switch (i) {
  32598. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  32599. r.setVector(h, -1, A, -v);
  32600. break;
  32601. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  32602. r.setVector(h, 1, A, v);
  32603. break;
  32604. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  32605. r.setVector(h, -v, 1, -A);
  32606. break;
  32607. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  32608. r.setVector(h, -v, -1, A);
  32609. break;
  32610. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  32611. r.setVector(h, -v, A, 1);
  32612. break;
  32613. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  32614. r.setVector(h, v, A, -1);
  32615. }
  32616. r.normalize(h);
  32617. };
  32618. })()),
  32619. (o.getFaceForTile = function (e, t) {
  32620. var i = o.TILE_SIZE;
  32621. e < o.TILE_SIZE && (i = e);
  32622. var n = Math.floor(e / i),
  32623. r = n * n;
  32624. return Math.floor(t / r);
  32625. }),
  32626. (o.getTileLocation = function (e, t, i) {
  32627. var n = o.TILE_SIZE;
  32628. e < o.TILE_SIZE && (n = e);
  32629. var r = o.getFaceForTile(e, t),
  32630. a = Math.floor(e / n),
  32631. s = a * a,
  32632. l = t - r * s;
  32633. (i.tileX = l % a), (i.tileY = Math.floor(l / a)), (i.face = r), (i.faceTileIndex = l);
  32634. }),
  32635. (o.getTileCountForSize = function (e) {
  32636. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO;
  32637. var t = Math.floor(e / o.TILE_SIZE),
  32638. i = t * t,
  32639. n = i * o.FACES_PER_PANO;
  32640. return n;
  32641. }),
  32642. (o.getRelativeDirection = (function () {
  32643. var e = new r.Matrix4(),
  32644. t = new r.Quaternion();
  32645. return function (i, n) {
  32646. t.copy(i),
  32647. t.inverse(),
  32648. e.makeRotationFromQuaternion(t),
  32649. e.applyToVector3(n),
  32650. r.normalize(n);
  32651. };
  32652. })()),
  32653. (o.matchingTilesInDirection = (function () {
  32654. var e = new r.Vector3(),
  32655. t = new r.Vector3(0, 0, -1),
  32656. i = new r.Quaternion(),
  32657. n = function (e, t) {
  32658. e.push({
  32659. face: t.face,
  32660. faceTileIndex: t.faceTileIndex,
  32661. tileX: t.tileX,
  32662. tileY: t.tileY,
  32663. });
  32664. },
  32665. a = (function () {
  32666. var e = {
  32667. face: -1,
  32668. faceTileIndex: -1,
  32669. tileX: -1,
  32670. tileY: -1,
  32671. };
  32672. return function (t, i, r) {
  32673. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  32674. o.getTileLocation(t, l, e), (i && !i(e)) || (s++, r && n(r, e));
  32675. return s;
  32676. };
  32677. })();
  32678. return function (n, s, l, c, h, u) {
  32679. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  32680. o.getTileCountForSize(s);
  32681. if (!c && !h) return a(s, null, u);
  32682. var p = !!h;
  32683. if (
  32684. ((h = h || c),
  32685. (h = Math.max(0, Math.min(h, 360))),
  32686. (c = Math.max(0, Math.min(c, 360))),
  32687. r.copyVector(l, e),
  32688. o.getRelativeDirection(n.quaternion, e),
  32689. p)
  32690. ) {
  32691. i.setFromUnitVectors(e, t);
  32692. var f = function (e) {
  32693. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h);
  32694. };
  32695. return a(s, f, u);
  32696. }
  32697. var g = function (t) {
  32698. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c);
  32699. };
  32700. return a(s, g, u);
  32701. };
  32702. })()),
  32703. (o.isTileWithinFrustum = (function () {
  32704. var e = new r.Vector3(),
  32705. t = 1e-5;
  32706. return function (i, n, a, s, l, c, h, u) {
  32707. for (
  32708. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  32709. p = -d,
  32710. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  32711. g = -f,
  32712. m = o.mapFaceToCubemapFace(a),
  32713. v = 0,
  32714. A = 0,
  32715. y = 0,
  32716. C = 0,
  32717. I = 0,
  32718. E = 0,
  32719. b = o.LocationOnTile.Center;
  32720. b <= o.LocationOnTile.LowerLeft;
  32721. b++
  32722. )
  32723. if (
  32724. (o.getTileVector(i, n, m, s, l, b, 0, e),
  32725. r.applyQuaternionToVector(c, e),
  32726. e.z >= -t)
  32727. )
  32728. I++;
  32729. else {
  32730. var w = -1 / e.z,
  32731. _ = e.x * w,
  32732. T = e.y * w;
  32733. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++;
  32734. }
  32735. return A !== E && v !== E && y !== E && C !== E;
  32736. };
  32737. })()),
  32738. (o.isTileWithinFOV = (function () {
  32739. var e = new r.Vector3(),
  32740. t = new r.Vector3(0, 1, 0),
  32741. i = new r.Vector3(1, 0, 0);
  32742. return function (n, a, s, l, c, h, u) {
  32743. var d = o.mapFaceToCubemapFace(s);
  32744. if (
  32745. (r.cross(h, t, i),
  32746. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  32747. o.isWithinFOV(e, h, u, null))
  32748. )
  32749. return !0;
  32750. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  32751. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  32752. if ((o.getTileVector(n, a, d, l, c, v, g, e), o.isWithinFOV(e, h, u, null)))
  32753. return !0;
  32754. g += p;
  32755. }
  32756. return !1;
  32757. };
  32758. })()),
  32759. (o.isWithinFOV = (function () {
  32760. var e = new r.Vector3(),
  32761. t = new r.Vector3();
  32762. return function (i, n, o, a) {
  32763. if ((r.copyVector(i, t), a)) {
  32764. r.copyVector(a, e), r.normalize(e);
  32765. var s = r.dot(e, i);
  32766. (e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e);
  32767. }
  32768. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  32769. c = Math.cos(l),
  32770. h = r.dot(t, n);
  32771. return h >= c;
  32772. };
  32773. })()),
  32774. (o.mapFaceToCubemapFace = (function () {
  32775. var e = {
  32776. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  32777. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  32778. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  32779. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  32780. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  32781. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  32782. };
  32783. return function (t) {
  32784. return e[t];
  32785. };
  32786. })()),
  32787. (t.exports = o);
  32788. },
  32789. {
  32790. '../enum/GLCubeFaces': 25,
  32791. '../util/MathLight': 176,
  32792. },
  32793. ],
  32794. 175: [
  32795. function (e, t, i) {
  32796. (function (i) {
  32797. 'use strict';
  32798. function n() {
  32799. (this.list = []),
  32800. (this.index = {}),
  32801. Object.defineProperty(this, 'length', {
  32802. get: function () {
  32803. return this.list.length;
  32804. },
  32805. });
  32806. }
  32807. var r = (e('./common'), e('./logger'));
  32808. new r(i);
  32809. (n.prototype.forEach = function (e) {
  32810. this.list.forEach(e);
  32811. }),
  32812. (n.prototype.add = function (e) {
  32813. this.list.push(e), (this.index[this.getIndex(e)] = e);
  32814. }),
  32815. (n.prototype.getIndex = function (e) {
  32816. throw new Error('IndexedCollection.getIndex not implemented in subclass.');
  32817. }),
  32818. (n.prototype.extend = function (e) {
  32819. for (var t = 0; t < e.length; t++) this.add(e[t]);
  32820. }),
  32821. (n.prototype.get = function (e) {
  32822. return this.index[e];
  32823. }),
  32824. (n.prototype.first = function () {
  32825. return this.list[0];
  32826. }),
  32827. (n.prototype.last = function () {
  32828. return this.list[this.list.length - 1];
  32829. }),
  32830. (n.prototype.reIndex = function () {
  32831. this.index = {};
  32832. var e = this;
  32833. this.forEach(function (t) {
  32834. e.index[e.getIndex(t)] = t;
  32835. });
  32836. }),
  32837. (n.prototype.filter = function (e) {
  32838. var t = this.list.filter(e);
  32839. return this.reIndex(), t;
  32840. }),
  32841. (n.prototype.reduce = function (e, t) {
  32842. return this.list.reduce(e, t);
  32843. }),
  32844. (n.prototype.sort = function (e) {
  32845. return this.list.sort(e);
  32846. }),
  32847. (n.prototype.indexOf = function (e) {
  32848. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t;
  32849. return -1;
  32850. }),
  32851. (t.exports = n);
  32852. }.call(this, '/js/util/IndexedCollection.js'));
  32853. },
  32854. {
  32855. './common': 185,
  32856. './logger': 189,
  32857. },
  32858. ],
  32859. 176: [
  32860. function (e, t, i) {
  32861. 'use strict';
  32862. var n = e('../constants'),
  32863. r = {};
  32864. (r.RADIANS_PER_DEGREE = Math.PI / 180),
  32865. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  32866. (r.Vector3 = function (e, t, i) {
  32867. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  32868. }),
  32869. (r.Matrix4 = function () {
  32870. (this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  32871. arguments.length > 0 &&
  32872. console.error(
  32873. 'MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  32874. );
  32875. }),
  32876. (r.Matrix4.prototype = {
  32877. identity: function () {
  32878. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
  32879. },
  32880. copy: function (e) {
  32881. return this.elements.set(e.elements), this;
  32882. },
  32883. applyToVector3: function (e) {
  32884. var t = e.x,
  32885. i = e.y,
  32886. n = e.z,
  32887. r = this.elements;
  32888. return (
  32889. (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  32890. (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  32891. (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  32892. this
  32893. );
  32894. },
  32895. getInverse: function (e, t) {
  32896. var i = this.elements,
  32897. n = e.elements,
  32898. r = n[0],
  32899. o = n[1],
  32900. a = n[2],
  32901. s = n[3],
  32902. l = n[4],
  32903. c = n[5],
  32904. h = n[6],
  32905. u = n[7],
  32906. d = n[8],
  32907. p = n[9],
  32908. f = n[10],
  32909. g = n[11],
  32910. m = n[12],
  32911. v = n[13],
  32912. A = n[14],
  32913. y = n[15],
  32914. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  32915. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  32916. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  32917. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  32918. w = r * C + o * I + a * E + s * b;
  32919. if (0 === w) {
  32920. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  32921. if (t) throw new Error(_);
  32922. return console.warn(_), this.identity();
  32923. }
  32924. var T = 1 / w;
  32925. return (
  32926. (i[0] = C * T),
  32927. (i[1] =
  32928. (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T),
  32929. (i[2] =
  32930. (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T),
  32931. (i[3] =
  32932. (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  32933. (i[4] = I * T),
  32934. (i[5] =
  32935. (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T),
  32936. (i[6] =
  32937. (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T),
  32938. (i[7] =
  32939. (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  32940. (i[8] = E * T),
  32941. (i[9] =
  32942. (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T),
  32943. (i[10] =
  32944. (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T),
  32945. (i[11] =
  32946. (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  32947. (i[12] = b * T),
  32948. (i[13] =
  32949. (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T),
  32950. (i[14] =
  32951. (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T),
  32952. (i[15] =
  32953. (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  32954. this
  32955. );
  32956. },
  32957. makeRotationFromQuaternion: function (e) {
  32958. var t = this.elements,
  32959. i = e.x,
  32960. n = e.y,
  32961. r = e.z,
  32962. o = e.w,
  32963. a = i + i,
  32964. s = n + n,
  32965. l = r + r,
  32966. c = i * a,
  32967. h = i * s,
  32968. u = i * l,
  32969. d = n * s,
  32970. p = n * l,
  32971. f = r * l,
  32972. g = o * a,
  32973. m = o * s,
  32974. v = o * l;
  32975. return (
  32976. (t[0] = 1 - (d + f)),
  32977. (t[4] = h - v),
  32978. (t[8] = u + m),
  32979. (t[1] = h + v),
  32980. (t[5] = 1 - (c + f)),
  32981. (t[9] = p - g),
  32982. (t[2] = u - m),
  32983. (t[6] = p + g),
  32984. (t[10] = 1 - (c + d)),
  32985. (t[3] = 0),
  32986. (t[7] = 0),
  32987. (t[11] = 0),
  32988. (t[12] = 0),
  32989. (t[13] = 0),
  32990. (t[14] = 0),
  32991. (t[15] = 1),
  32992. this
  32993. );
  32994. },
  32995. }),
  32996. (r.Quaternion = function (e, t, i, n) {
  32997. (this._x = e || 0),
  32998. (this._y = t || 0),
  32999. (this._z = i || 0),
  33000. (this._w = void 0 !== n ? n : 1);
  33001. }),
  33002. (r.Quaternion.prototype = {
  33003. get x() {
  33004. return this._x;
  33005. },
  33006. set x(e) {
  33007. this._x = e;
  33008. },
  33009. get y() {
  33010. return this._y;
  33011. },
  33012. set y(e) {
  33013. this._y = e;
  33014. },
  33015. get z() {
  33016. return this._z;
  33017. },
  33018. set z(e) {
  33019. this._z = e;
  33020. },
  33021. get w() {
  33022. return this._w;
  33023. },
  33024. set w(e) {
  33025. this._w = e;
  33026. },
  33027. copy: function (e) {
  33028. (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w);
  33029. },
  33030. inverse: function () {
  33031. return this.conjugate().normalize();
  33032. },
  33033. conjugate: function () {
  33034. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this;
  33035. },
  33036. length: function () {
  33037. return Math.sqrt(
  33038. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  33039. );
  33040. },
  33041. normalize: function () {
  33042. var e = this.length();
  33043. return (
  33044. 0 === e
  33045. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  33046. : ((e = 1 / e),
  33047. (this._x = this._x * e),
  33048. (this._y = this._y * e),
  33049. (this._z = this._z * e),
  33050. (this._w = this._w * e)),
  33051. this
  33052. );
  33053. },
  33054. setFromAxisAngle: function (e, t) {
  33055. var i = t / 2,
  33056. n = Math.sin(i);
  33057. return (
  33058. (this._x = e.x * n),
  33059. (this._y = e.y * n),
  33060. (this._z = e.z * n),
  33061. (this._w = Math.cos(i)),
  33062. this
  33063. );
  33064. },
  33065. setFromUnitVectors: (function () {
  33066. var e,
  33067. t,
  33068. i = 1e-6;
  33069. return function (n, o) {
  33070. return (
  33071. void 0 === e && (e = new r.Vector3()),
  33072. (t = r.dot(n, o) + 1),
  33073. t < i
  33074. ? ((t = 0),
  33075. Math.abs(n.x) > Math.abs(n.z)
  33076. ? r.setVector(e, -n.y, n.x, 0)
  33077. : r.setVector(e, 0, -n.z, n.y))
  33078. : r.cross(n, o, e),
  33079. (this._x = e.x),
  33080. (this._y = e.y),
  33081. (this._z = e.z),
  33082. (this._w = t),
  33083. this.normalize()
  33084. );
  33085. };
  33086. })(),
  33087. multiply: function (e) {
  33088. return this.multiplyQuaternions(this, e);
  33089. },
  33090. premultiply: function (e) {
  33091. return this.multiplyQuaternions(e, this);
  33092. },
  33093. multiplyQuaternions: function (e, t) {
  33094. var i = e._x,
  33095. n = e._y,
  33096. r = e._z,
  33097. o = e._w,
  33098. a = t._x,
  33099. s = t._y,
  33100. l = t._z,
  33101. c = t._w;
  33102. return (
  33103. (this._x = i * c + o * a + n * l - r * s),
  33104. (this._y = n * c + o * s + r * a - i * l),
  33105. (this._z = r * c + o * l + i * s - n * a),
  33106. (this._w = o * c - i * a - n * s - r * l),
  33107. this
  33108. );
  33109. },
  33110. }),
  33111. (r.convertWorkshopVector = function (e) {
  33112. return new r.Vector3(-e.x, e.y, e.z);
  33113. }),
  33114. (r.convertWorkshopQuaternion = function (e) {
  33115. return new r.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  33116. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  33117. );
  33118. });
  33119. (r.convertWorkshopOrthoZoom = function (e) {
  33120. //xzw
  33121. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  33122. return e === -1
  33123. ? -1
  33124. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  33125. g_snapShotHeight;
  33126. }),
  33127. (r.convertWorkshopPanoramaQuaternion = function (e) {
  33128. return new r.Quaternion(e.x, -e.y, -e.z, e.w)
  33129. .normalize()
  33130. .multiply(
  33131. new r.Quaternion().setFromAxisAngle(
  33132. new r.Vector3(0, 1, 0),
  33133. 270 * r.RADIANS_PER_DEGREE
  33134. )
  33135. );
  33136. }),
  33137. (r.normalize = function (e) {
  33138. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  33139. i = Math.sqrt(t);
  33140. (e.x /= i), (e.y /= i), (e.z /= i);
  33141. }),
  33142. (r.dot = function (e, t) {
  33143. return e.x * t.x + e.y * t.y + e.z * t.z;
  33144. }),
  33145. (r.cross = function (e, t, i) {
  33146. var n = e.x,
  33147. r = e.y,
  33148. o = e.z;
  33149. (i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x);
  33150. }),
  33151. (r.setVector = function (e, t, i, n) {
  33152. (e.x = t), (e.y = i), (e.z = n);
  33153. }),
  33154. (r.copyVector = function (e, t) {
  33155. (t.x = e.x), (t.y = e.y), (t.z = e.z);
  33156. }),
  33157. (r.addVector = function (e, t) {
  33158. (e.x += t.x), (e.y += t.y), (e.z += t.z);
  33159. }),
  33160. (r.subVector = function (e, t) {
  33161. (e.x -= t.x), (e.y -= t.y), (e.z -= t.z);
  33162. }),
  33163. (r.applyQuaternionToVector = function (e, t) {
  33164. var i = t.x,
  33165. n = t.y,
  33166. r = t.z,
  33167. o = e.x,
  33168. a = e.y,
  33169. s = e.z,
  33170. l = e.w,
  33171. c = l * i + a * r - s * n,
  33172. h = l * n + s * i - o * r,
  33173. u = l * r + o * n - a * i,
  33174. d = -o * i - a * n - s * r;
  33175. (t.x = c * l + d * -o + h * -s - u * -a),
  33176. (t.y = h * l + d * -a + u * -o - c * -s),
  33177. (t.z = u * l + d * -s + c * -a - h * -o);
  33178. }),
  33179. (r.angleBetweenVectors = function (e, t) {
  33180. return Math.acos(r.dot(e, t));
  33181. }),
  33182. (t.exports = r);
  33183. },
  33184. {
  33185. '../constants': 8,
  33186. },
  33187. ],
  33188. 177: [
  33189. function (e, t, i) {
  33190. (function (i) {
  33191. 'use strict';
  33192. function n(e) {
  33193. (this.cache = null), (this.expires = 0);
  33194. }
  33195. function r() {
  33196. (this.baseUrl = null), (this.cache = null), (this.expires = 0);
  33197. }
  33198. function o() {
  33199. (this.baseUrl = null), (this.expires = 0);
  33200. }
  33201. function a(e) {
  33202. (this.initialLoadingPromise = null),
  33203. (this.endpoint = e + '?type=3'),
  33204. (this.urlContainer = null),
  33205. (this.authorizationHeader = h.getAuthorizationHeader()),
  33206. (this.containerClasses = [o, r, n]);
  33207. }
  33208. var s = e('./ajax'),
  33209. l = e('./logger'),
  33210. c = e('../constants'),
  33211. h = e('./showcase'),
  33212. u = (e('../ab'), new l(i));
  33213. (n.prototype = {
  33214. version: 1,
  33215. validate: function (e) {
  33216. return 'catalog.json' in e && Object.keys(e).length > 0;
  33217. },
  33218. update: function (e) {
  33219. return (
  33220. (this.cache = e),
  33221. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33222. $.when()
  33223. );
  33224. },
  33225. get: function (e) {
  33226. return this.cache[e];
  33227. },
  33228. }),
  33229. (r.prototype = {
  33230. version: 2,
  33231. validate: function (e) {
  33232. return 'catalog.json' in e && 'base.url' in e && Object.keys(e).length > 1;
  33233. },
  33234. update: function (e) {
  33235. return (
  33236. (this.baseUrl = e['base.url']),
  33237. (this.cache = e),
  33238. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33239. $.when()
  33240. );
  33241. },
  33242. get: function (e) {
  33243. var t = this.cache[e];
  33244. return t ? this.baseUrl.replace('{{filename}}', e) + t : null;
  33245. },
  33246. }),
  33247. (o.prototype = {
  33248. version: 3,
  33249. validate: function (e) {
  33250. return (
  33251. e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  33252. );
  33253. },
  33254. update: function (e) {
  33255. return (
  33256. (this.baseUrl = e.templates[0]),
  33257. e.expires
  33258. ? (this.expires = 1e3 * e.expires)
  33259. : (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33260. $.when()
  33261. );
  33262. },
  33263. get: function (e) {
  33264. return this.baseUrl.replace('{{filename}}', e);
  33265. },
  33266. }),
  33267. (a.prototype = {
  33268. init: function () {
  33269. return this.initialLoadingPromise
  33270. ? this.initialLoadingPromise
  33271. : (setInterval(
  33272. function () {
  33273. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  33274. Date.now() + c.signedUrlRefreshBuffer > e &&
  33275. (u.debug('Refreshing urls...'),
  33276. this.refresh()
  33277. .done(function () {
  33278. u.debug('Refreshed');
  33279. })
  33280. .fail(function () {
  33281. u.error('Failed url refresh, urls might go stale soon');
  33282. }));
  33283. }.bind(this),
  33284. c.signedUrlCheckInterval
  33285. ),
  33286. (this.initialLoadingPromise = this.refresh()),
  33287. this.initialLoadingPromise);
  33288. },
  33289. refresh: function (e) {
  33290. //已经在someData.js里加载过了 不用再加载file了吧
  33291. e = e || {};
  33292. /*var t = void 0 === e.cache || e.cache;
  33293. return s.get( this.endpoint , { //file
  33294. responseType: "json",
  33295. prefetchFrom: t ? "files" : null,
  33296. cache: t,
  33297. auth: this.authorizationHeader
  33298. }).then(function(e) {
  33299. if (this.urlContainer && this.urlContainer.validate(e))
  33300. return this.urlContainer.update(e);
  33301. for (var i = 0; i < this.containerClasses.length; i++) {
  33302. var n = this.containerClasses[i]
  33303. , r = new n;
  33304. if (r.validate(e))
  33305. return u.info("Using urls version " + r.version),
  33306. this.urlContainer = r,
  33307. this.urlContainer.update(e)
  33308. }
  33309. return t ? this.refresh({
  33310. cache: !1
  33311. }) : $.Deferred().reject("missing-urls")
  33312. }
  33313. .bind(this), function(e) {
  33314. return "loading-failed"
  33315. }) */
  33316. return $.Deferred().resolve();
  33317. },
  33318. get: function (e) {
  33319. //return this.urlContainer.get(e)
  33320. return window.DATA.files.templates[0].replace('{{filename}}', e);
  33321. },
  33322. }),
  33323. (t.exports = a);
  33324. }.call(this, '/js/util/ModelUrls.js'));
  33325. },
  33326. {
  33327. '../ab': 3,
  33328. '../constants': 8,
  33329. './ajax': 181,
  33330. './logger': 189,
  33331. './showcase': 193,
  33332. },
  33333. ],
  33334. 178: [
  33335. function (e, t, i) {
  33336. (function (i) {
  33337. 'use strict';
  33338. function n() {
  33339. u.call(this), (this.neighbourMap = {}), (this.map = null);
  33340. }
  33341. var r = e('three'),
  33342. o = e('./common'),
  33343. a = e('../settings'),
  33344. s = e('../objects/Panorama'),
  33345. a = e('../settings'),
  33346. l = e('./aStar'),
  33347. c = e('./logger'),
  33348. h = new c(i),
  33349. u = e('./IndexedCollection'),
  33350. d = e('./transitions');
  33351. o.inherit(n, u),
  33352. (n.prototype.getIndex = function (e) {
  33353. return e.id;
  33354. }),
  33355. (n.prototype.find = function (e, t) {
  33356. var i = o.filterAll(this.list, e);
  33357. return 0 === i.length
  33358. ? null
  33359. : (t &&
  33360. t.forEach(function (e) {
  33361. i = o.stableSort(i, e);
  33362. }),
  33363. i[0]);
  33364. }),
  33365. /* n.prototype.sortByScore = function(e, t) {
  33366. var i = o.filterAll(this.list, e);
  33367. return 0 === i.length ? null : i = i.map(function(e) {
  33368. return {
  33369. pano: e,
  33370. score: t.reduce(function(t, i) {
  33371. return t + i(e)
  33372. }, 0)
  33373. }
  33374. }).sort(function(e, t) {
  33375. return t.score - e.score;
  33376. })
  33377. } */
  33378. (n.prototype.sortByScore = function (request, rank) {
  33379. return common.sortByScore(this.list, request, rank);
  33380. }),
  33381. (n.prototype.lowestByScore = function (e, t, i) {
  33382. return this.findRankedByScore(0, e, t, i);
  33383. }),
  33384. (n.prototype.findRankedByScore = function (e, t, i, n) {
  33385. n && ((n.candidates = null), (n.pano = null)), e || (e = 0);
  33386. var r = this.sortByScore(t, i);
  33387. return !r || 0 === r.length || e >= r.length
  33388. ? null
  33389. : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item);
  33390. }),
  33391. (n.prototype.showPanoScores = function (e) {
  33392. this.list.forEach(function (e) {
  33393. e.removeTextSprite();
  33394. });
  33395. var t = 6344768;
  33396. e.forEach(function (e) {
  33397. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055);
  33398. });
  33399. }),
  33400. (n.prototype.isNeighbour = function (e, t) {
  33401. return this.neighbourMap[e.id][t.id];
  33402. }),
  33403. (n.prototype.getNeighbours = function (e) {
  33404. return this.neighbourMap[e.id];
  33405. }),
  33406. (n.prototype.setNeighbour = function (e, t, i) {
  33407. return (
  33408. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  33409. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  33410. (this.neighbourMap[e.id][e.id] = !0),
  33411. (this.neighbourMap[t.id][t.id] = !0),
  33412. (this.neighbourMap[e.id][t.id] = i),
  33413. (this.neighbourMap[t.id][e.id] = i),
  33414. this.neighbourMap[e.id]
  33415. );
  33416. }),
  33417. (n.prototype.findClosest = function (e, t) {
  33418. var i = [s.filters.isPanoAligned()];
  33419. return (
  33420. t && i.push(s.filters.inDirection(e, t, 0.75)),
  33421. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  33422. );
  33423. }),
  33424. (n.prototype.dualNeighbors = function (e, t) {
  33425. var i,
  33426. n = [];
  33427. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i);
  33428. return n;
  33429. }),
  33430. (n.prototype.populate_path_graph = function () {
  33431. var e,
  33432. t,
  33433. i,
  33434. n,
  33435. o,
  33436. a,
  33437. s,
  33438. l,
  33439. c = Date.now(),
  33440. u = {},
  33441. d = 0,
  33442. p = new r.Vector3(0, 0, 0),
  33443. f = 0,
  33444. g = 0;
  33445. for (e = 0; e < this.list.length; e += 1) {
  33446. (o = this.list[e]),
  33447. (s = {}),
  33448. (l = !1),
  33449. (i = o.neighbourPanos || o.findNeighourPanos());
  33450. for (t in i)
  33451. if (i[t]) {
  33452. (a = this.index[t]), p.copy(o.floorPosition), p.sub(a.floorPosition);
  33453. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  33454. v = (Math.abs(p.y) / Math.max(m, 0.01), Math.max(0, Math.abs(p.y) - 0.2));
  33455. v > 0
  33456. ? ((f += 1),
  33457. (v = Math.pow(4 * v, 2)),
  33458. (m = Math.pow(m, 2)),
  33459. (n = Math.sqrt(v * v + m * m)))
  33460. : ((g += 1), (n = p.length())),
  33461. (s[a.id] = n),
  33462. (l = !0);
  33463. }
  33464. l ? (u[o.id] = s) : (d += 1);
  33465. }
  33466. (this.map = u),
  33467. h.info('graph ready in ' + (Date.now() - c) + 'ms, ' + d + ' had no neighbors');
  33468. }),
  33469. (n.prototype.aStarSearch = function (e, t) {
  33470. var i = Date.now(),
  33471. n = new l({
  33472. start: e,
  33473. isEnd: function (e) {
  33474. return e === t;
  33475. },
  33476. neighbor: function (e) {
  33477. var t = e.neighbourPanos || e.findNeighourPanos(),
  33478. i = [];
  33479. for (var n in t) t[n] && i.push(this.index[n]); //add: t[n] &&
  33480. return i;
  33481. }.bind(this),
  33482. distance: function (e, t) {
  33483. var i = this.map[e.id],
  33484. n = i[t.id];
  33485. return n;
  33486. }.bind(this),
  33487. heuristic: function (e, t) {
  33488. return 1;
  33489. }.bind(this),
  33490. hash: function (e) {
  33491. return e.id;
  33492. },
  33493. timeout: 5e3,
  33494. });
  33495. if ((h.debug('A* search in ' + (Date.now() - i) + 'ms'), 'success' !== n.status))
  33496. return h.debug('Did not find A* path from ' + e + ' to ' + t), null;
  33497. h.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps');
  33498. var r = [];
  33499. return (
  33500. n.path.forEach(function (e) {
  33501. r.push(e.id);
  33502. }),
  33503. r
  33504. );
  33505. }),
  33506. (n.prototype.includeNodesNearPath = (function () {
  33507. var e = new r.Vector3(),
  33508. t = new r.Vector3(),
  33509. i = new r.Vector3(),
  33510. n = new r.Vector3(),
  33511. o = new r.Vector3(),
  33512. a = new r.Vector3(),
  33513. s = new r.Vector3(),
  33514. l = new r.Vector3(),
  33515. c = [],
  33516. h = new r.Vector3(),
  33517. u = new r.Vector3();
  33518. return function (r, d) {
  33519. if (r)
  33520. for (
  33521. var p = function (e, t, i) {
  33522. return o.copy(t).sub(e), o.dot(i);
  33523. },
  33524. f = function (e, t) {
  33525. return p(h, e.position, i) - p(h, t.position, i);
  33526. },
  33527. g = 0;
  33528. g < r.length - 1;
  33529. ) {
  33530. var m = r[g],
  33531. v = r[g + 1],
  33532. A = this.index[m],
  33533. y = this.index[v];
  33534. h.copy(A.position),
  33535. u.copy(y.position),
  33536. (c.length = 0),
  33537. e.copy(u).sub(h),
  33538. i.copy(e).normalize();
  33539. for (var C = 0; C < this.list.length; C++) {
  33540. var I = this.list[C];
  33541. o.copy(I.position).sub(h);
  33542. var E = o.dot(i);
  33543. if (E > 0) {
  33544. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s);
  33545. var b = a.length();
  33546. if (b < d) {
  33547. t.copy(e).negate(), n.copy(t).normalize(), l.copy(I.position).sub(u);
  33548. var w = l.dot(n);
  33549. w > 0 && c.push(I);
  33550. }
  33551. }
  33552. }
  33553. if (c.length > 0) {
  33554. c.sort(f);
  33555. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  33556. r[_] = r[_ - c.length];
  33557. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id;
  33558. }
  33559. g += c.length + 1;
  33560. }
  33561. };
  33562. })()),
  33563. /* n.prototype.fadeMarkerOpacity = function(e, t) {
  33564. var i = void 0 === e ? a.panorama.markerOpacity : e
  33565. , n = this.list.findIndex(function(e) {
  33566. return e.marker
  33567. });
  33568. if (!(n < 0)) {
  33569. var r = this.list[n].marker.material.opacity;
  33570. if (r !== e) {
  33571. var o = i - r;
  33572. d.trigger({
  33573. func: function(e, t) {
  33574. var i = r + e * o;
  33575. this.forEach(function(e) {
  33576. e.marker && (e.marker.material.opacity = i)
  33577. })
  33578. }
  33579. .bind(this),
  33580. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  33581. name: "_fpm"
  33582. })
  33583. }
  33584. }
  33585. } */
  33586. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  33587. d.cancelById('fadeMarkerOpacity');
  33588. var n = this.list.findIndex(function (e) {
  33589. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  33590. return e.marker;
  33591. });
  33592. if (n < 0) {
  33593. //logger.info('marker findIndex<0')
  33594. return;
  33595. }
  33596. var group;
  33597. var tran = function (list, index) {
  33598. list.member = list.member.filter(function (m) {
  33599. return m.marker && m.marker.material.opacity != list.toOp;
  33600. });
  33601. transitions.trigger({
  33602. func: function (e, t) {
  33603. //e:0-1
  33604. list.member.forEach(function (m) {
  33605. var o = m.marker.oldOpacity;
  33606. var i = o + e * (list.toOp - o);
  33607. m.marker && (m.marker.material.opacity = i);
  33608. });
  33609. }.bind(this),
  33610. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  33611. name: '_fpm_' + index,
  33612. id: 'fadeMarkerOpacity',
  33613. });
  33614. };
  33615. this.forEach(function (e) {
  33616. //先记录旧的opacity
  33617. e.marker && (e.marker.oldOpacity = e.marker.material.opacity);
  33618. });
  33619. group = gr;
  33620. /* if (e > 0 && gr) {
  33621. group = gr
  33622. } else {
  33623. group = [
  33624. {
  33625. member: this.list,
  33626. toOp: 0,
  33627. },
  33628. ]
  33629. } */
  33630. for (var i = 0; i < group.length; i++) {
  33631. tran(group[i], i);
  33632. }
  33633. }),
  33634. (t.exports = n);
  33635. }.call(this, '/js/util/PanoramaCollection.js'));
  33636. },
  33637. {
  33638. '../objects/Panorama': 148,
  33639. '../settings': 166,
  33640. './IndexedCollection': 175,
  33641. './aStar': 180,
  33642. './common': 185,
  33643. './logger': 189,
  33644. './transitions': 195,
  33645. three: 217,
  33646. },
  33647. ],
  33648. 179: [
  33649. function (e, t, i) {
  33650. 'use strict';
  33651. function n() {
  33652. (this.actionSequence = []), (this.actionSequenceInProgress = !1);
  33653. }
  33654. function r(e, t, i, n) {
  33655. s.trackAlways('zoom_' + e, {
  33656. from: t,
  33657. to: i,
  33658. pano: n,
  33659. });
  33660. }
  33661. function o(e, t) {
  33662. r('initial', 1, e, t);
  33663. }
  33664. function a(e, t, i) {
  33665. r('followup', e, t, i);
  33666. }
  33667. var s = e('../analytics');
  33668. (n.prototype.reset = function (e) {
  33669. (this.actionSequenceInProgress = !1), (this.actionSequence.length = 0);
  33670. }),
  33671. (n.prototype.addZoomAction = (function () {
  33672. var e = null,
  33673. t = null,
  33674. i = !1,
  33675. n = function () {
  33676. if (((e = null), this.actionSequence.length > 0)) {
  33677. var i = this.actionSequence[0].start,
  33678. n = this.actionSequence[this.actionSequence.length - 1].end;
  33679. 1 === i ? o(n, t) : a(i, n, t);
  33680. }
  33681. this.reset();
  33682. };
  33683. return function (r, o, a) {
  33684. if (r !== o) {
  33685. i || ((n = n.bind(this)), (i = !0)),
  33686. e && (window.clearTimeout(e), (e = null)),
  33687. (a === t && this.actionSequenceInProgress) || (this.reset(), (t = a)),
  33688. (this.actionSequenceInProgress = !0);
  33689. var s = {
  33690. start: r,
  33691. end: o,
  33692. };
  33693. this.actionSequence.push(s), (e = window.setTimeout(n, 150));
  33694. }
  33695. };
  33696. })()),
  33697. (t.exports = n);
  33698. },
  33699. {
  33700. '../analytics': 4,
  33701. },
  33702. ],
  33703. 180: [
  33704. function (e, t, i) {
  33705. 'use strict';
  33706. function n(e) {
  33707. void 0 === e.timeout && (e.timeout = 1 / 0);
  33708. var t = e.hash || o,
  33709. i = {
  33710. data: e.start,
  33711. g: 0,
  33712. h: e.heuristic(e.start),
  33713. },
  33714. n = i;
  33715. i.f = i.h;
  33716. var h = new s(),
  33717. u = new l(a),
  33718. d = c();
  33719. u.push(i), d.set(t(i.data), i);
  33720. for (var p = new Date(); u.size(); ) {
  33721. if (new Date() - p > e.timeout)
  33722. return {
  33723. status: 'timeout',
  33724. cost: n.g,
  33725. path: r(n),
  33726. };
  33727. var f = u.pop();
  33728. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  33729. return {
  33730. status: 'success',
  33731. cost: f.g,
  33732. path: r(f),
  33733. };
  33734. h.add(t(f.data));
  33735. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  33736. var v = g[m];
  33737. if (!h.contains(t(v))) {
  33738. var A = f.g + e.distance(f.data, v),
  33739. y = d.get(t(v)),
  33740. C = !1;
  33741. if (void 0 === y)
  33742. (y = {
  33743. data: v,
  33744. }),
  33745. d.set(t(v), y);
  33746. else {
  33747. if (y.g < A) continue;
  33748. C = !0;
  33749. }
  33750. (y.parent = f),
  33751. (y.g = A),
  33752. (y.h = e.heuristic(v)),
  33753. (y.f = A + y.h),
  33754. y.h < n.h && (n = y),
  33755. C ? u.heapify() : u.push(y);
  33756. }
  33757. }
  33758. }
  33759. return {
  33760. status: 'noPath',
  33761. cost: n.g,
  33762. path: r(n),
  33763. };
  33764. }
  33765. function r(e) {
  33766. if (void 0 !== e.parent) {
  33767. var t = r(e.parent);
  33768. return t.push(e.data), t;
  33769. }
  33770. return [e.data];
  33771. }
  33772. function o(e) {
  33773. return e.toString();
  33774. }
  33775. function a(e, t) {
  33776. return e.f - t.f;
  33777. }
  33778. var s = e('Set'),
  33779. l = e('heap'),
  33780. c = e('dict');
  33781. t.exports = n;
  33782. },
  33783. {
  33784. Set: 196,
  33785. dict: 210,
  33786. heap: 211,
  33787. },
  33788. ],
  33789. 181: [
  33790. function (e, t, i) {
  33791. (function (i) {
  33792. 'use strict';
  33793. function n(e, t, i) {
  33794. var n = new XMLHttpRequest();
  33795. if (i && 'withCredentials' in n) n.open(e, t, i);
  33796. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()), n.open(e, t);
  33797. else {
  33798. if (i) throw 'Browser does not support CORS!';
  33799. n.open(e, t);
  33800. }
  33801. return n;
  33802. }
  33803. function r(e, t, i) {
  33804. function o() {
  33805. u.warn('Retrying ', t),
  33806. r(e, t, i)
  33807. .done(c.resolve.bind(c))
  33808. .progress(c.notify.bind(c))
  33809. .fail(c.reject.bind(c));
  33810. }
  33811. function a(e, t) {
  33812. var i = e.response;
  33813. if ('json' === t && 'object' != typeof i)
  33814. try {
  33815. i = JSON.parse(e.responseText);
  33816. } catch (e) {
  33817. return void c.reject({
  33818. error: 'Failed parsing JSON',
  33819. });
  33820. }
  33821. else if ('image/jpeg' === t) {
  33822. var n = new Uint8Array(e.response),
  33823. r = new Blob([n], {
  33824. type: 'image/jpeg',
  33825. }),
  33826. o = URL.createObjectURL(r);
  33827. (i = new Image()),
  33828. (i.src = o),
  33829. (i.crossOrigin = 'Anonymous'),
  33830. (i.onload = function () {
  33831. URL.revokeObjectURL(o);
  33832. });
  33833. }
  33834. return i;
  33835. }
  33836. var s = n(e, t, !1);
  33837. if (
  33838. ((i = i || {}),
  33839. (i.retries = void 0 !== i.retries ? i.retries : 0),
  33840. (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()),
  33841. i.responseType)
  33842. )
  33843. if (['arraybuffer', 'text', 'json'].indexOf(i.responseType) > -1)
  33844. s.responseType = i.responseType;
  33845. else {
  33846. if ('image/jpeg' !== i.responseType)
  33847. throw new Error(
  33848. 'reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"'
  33849. );
  33850. s.responseType = 'arraybuffer';
  33851. }
  33852. if (
  33853. ('json' === i.responseType && s.setRequestHeader('Accept', 'application/json'),
  33854. i.auth && s.setRequestHeader('Authorization', i.auth),
  33855. 'object' == typeof i.data &&
  33856. ((i.data = JSON.stringify(i.data)),
  33857. s.setRequestHeader('Content-Type', 'application/json')),
  33858. 'object' == typeof i.headers)
  33859. )
  33860. for (var l in i.headers) s.setRequestHeader(l, i.headers[l]);
  33861. var c = $.Deferred();
  33862. return (
  33863. (s.onreadystatechange = function (e) {
  33864. if (4 === this.readyState)
  33865. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  33866. i.retries++, setTimeout(o, 1e3);
  33867. else if (200 === this.status) {
  33868. var t = a(this, i.responseType);
  33869. c.resolve(t);
  33870. } else c.reject(this);
  33871. }),
  33872. (s.onprogress = function (e) {
  33873. c.notify(e);
  33874. }),
  33875. s.send(i.data),
  33876. c.promise()
  33877. );
  33878. }
  33879. function o(e) {
  33880. return Object.keys(e)
  33881. .sort()
  33882. .map(function (t) {
  33883. return {
  33884. key: t,
  33885. value: e[t],
  33886. };
  33887. });
  33888. }
  33889. function a(e, t) {
  33890. var i = t.responseType || null,
  33891. n = t.auth || null,
  33892. r = t.prefetchFrom || null,
  33893. a = e + '__' + i + '__' + n + '__' + r;
  33894. return (
  33895. t.headers &&
  33896. o(t.headers).forEach(function (e) {
  33897. a += '__' + e.key + ':' + e.value;
  33898. }),
  33899. a
  33900. );
  33901. }
  33902. function s(e, t) {
  33903. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null;
  33904. }
  33905. function l(e, t, i) {
  33906. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i);
  33907. }
  33908. var c = e('./logger'),
  33909. h = e('../ab'),
  33910. u = new c(i);
  33911. (window.URL = window.URL || window.webkitURL),
  33912. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  33913. (window.DATA = window.DATA || {}),
  33914. /* setTimeout(function() {//MP-- xzw delete
  33915. window.MP_REQUEST_CACHE = null,
  33916. window.DATA = {}
  33917. }, 6e4),
  33918. window.onpageshow = function(e) {
  33919. e.persisted && (window.MP_REQUEST_CACHE = null,
  33920. window.DATA = {})
  33921. } */
  33922. (t.exports = {
  33923. get: function (e, t) {
  33924. t = t || {};
  33925. var i = void 0 === t.cache || t.cache;
  33926. if (i) {
  33927. var n = s(e, t);
  33928. if (n) return n;
  33929. }
  33930. var o;
  33931. return (
  33932. (o =
  33933. t.prefetchFrom && window.DATA[t.prefetchFrom]
  33934. ? $.when(window.DATA[t.prefetchFrom])
  33935. : r('GET', e, t)),
  33936. i && l(e, t, o),
  33937. o
  33938. );
  33939. },
  33940. post: function (e, t) {
  33941. return r('POST', e, t);
  33942. },
  33943. patch: function (e, t) {
  33944. return r('PATCH', e, t);
  33945. },
  33946. getImage: function (e, t) {
  33947. function i() {
  33948. u.warn('Retrying ', e),
  33949. o
  33950. .getImage(e, t - 1)
  33951. .done(n.resolve.bind(n))
  33952. .progress(n.notify.bind(n))
  33953. .fail(n.reject.bind(n));
  33954. }
  33955. var n = $.Deferred(),
  33956. r = new Image(),
  33957. o = this;
  33958. return (
  33959. (e = h.changeIfImageOptimzing(e)),
  33960. (null !== t && void 0 !== t) || (t = 3),
  33961. (r.onerror = function () {
  33962. t > 0 ? setTimeout(i, 1e3) : n.reject();
  33963. }),
  33964. (r.onload = function () {
  33965. n.resolve(r);
  33966. }),
  33967. (r.crossOrigin = 'anonymous'),
  33968. (r.src = e),
  33969. n
  33970. );
  33971. },
  33972. });
  33973. }.call(this, '/js/util/ajax.js'));
  33974. },
  33975. {
  33976. '../ab': 3,
  33977. './logger': 189,
  33978. },
  33979. ],
  33980. 182: [
  33981. function (e, t, i) {
  33982. 'use strict';
  33983. function n(e, t) {
  33984. var i = window.navigator.userAgent,
  33985. n = i.match(e);
  33986. return (
  33987. (n = n ? n[1].split(t) : []),
  33988. {
  33989. major: parseInt(n[0]) || 0,
  33990. minor: parseInt(n[1]) || 0,
  33991. patch: parseInt(n[2]) || 0,
  33992. }
  33993. );
  33994. }
  33995. var r = e('../exception/DeviceMismatchException');
  33996. t.exports = {
  33997. supportsFullscreen: function () {
  33998. return (
  33999. document.fullscreenEnabled ||
  34000. document.mozFullscreenEnabled ||
  34001. document.mozFullScreenEnabled ||
  34002. document.webkitFullscreenEnabled ||
  34003. document.msFullscreenEnabled
  34004. );
  34005. },
  34006. isPointerLocked: function () {
  34007. return (
  34008. document.pointerLockElement ||
  34009. document.mozPointerLockElement ||
  34010. document.webkitPointerLockElement
  34011. );
  34012. },
  34013. requestFullscreen: function (e, t) {
  34014. e.requestFullscreen
  34015. ? e.requestFullscreen()
  34016. : e.mozRequestFullScreen
  34017. ? e.mozRequestFullScreen()
  34018. : e.webkitRequestFullscreen
  34019. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  34020. : e.msRequestFullscreen && e.msRequestFullscreen(),
  34021. t &&
  34022. $(document).on(
  34023. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34024. browser.requestPointerLock
  34025. );
  34026. },
  34027. requestPointerLock: function () {
  34028. var e;
  34029. if (document.fullscreenElement) e = document.fullscreenElement();
  34030. else if (document.mozFullscreenElement) e = document.mozFullscreenElement();
  34031. else if (document.mozFullScreenElement) e = document.mozFullScreenElement();
  34032. else {
  34033. if (!document.webkitFullscreenElement) return;
  34034. e = document.webkitFullscreenElement();
  34035. }
  34036. (e.requestPointerLock =
  34037. e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  34038. e.requestPointerLock(),
  34039. $(document).off(
  34040. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34041. this
  34042. );
  34043. },
  34044. exitPointerLock: function () {
  34045. (document.exitPointerLock =
  34046. document.exitPointerLock ||
  34047. document.mozExitPointerLock ||
  34048. document.webkitExitPointerLock),
  34049. document.exitPointerLock();
  34050. },
  34051. exitFullscreen: function () {
  34052. document.exitFullscreen
  34053. ? document.exitFullscreen()
  34054. : document.msExitFullscreen
  34055. ? document.msExitFullscreen()
  34056. : document.mozCancelFullScreen
  34057. ? document.mozCancelFullScreen()
  34058. : document.webkitExitFullscreen && document.webkitExitFullscreen();
  34059. },
  34060. details: function () {
  34061. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)');
  34062. return e
  34063. ? {
  34064. name: e[1],
  34065. version: parseInt(e[2]),
  34066. platform: navigator.platform,
  34067. }
  34068. : {};
  34069. },
  34070. is: function (e) {
  34071. return this.details() && this.details().name === e;
  34072. },
  34073. inIframe: function () {
  34074. return window.parent !== window;
  34075. },
  34076. aspectRatio: function () {
  34077. var e = $('#player').width() / $('#player').height();
  34078. return isFinite(e) ? e : 0;
  34079. },
  34080. userAgent: function () {
  34081. return window.navigator.userAgent;
  34082. },
  34083. isLandscape: function () {
  34084. return this.isMobile && this.aspectRatio() > 1;
  34085. },
  34086. isSmallScreen: function () {
  34087. var e = screen.width / window.devicePixelRatio;
  34088. return e < 240;
  34089. },
  34090. detectIE: function () {
  34091. var e = window.navigator.userAgent,
  34092. t = e.indexOf('MSIE ');
  34093. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./);
  34094. },
  34095. detectSafari: function () {
  34096. var e = window.navigator.userAgent,
  34097. t = e.indexOf('Safari');
  34098. return t !== -1 && !this.detectChrome();
  34099. },
  34100. detectFirefox: function () {
  34101. var e = window.navigator.userAgent;
  34102. return e.indexOf('Firefox') !== -1;
  34103. },
  34104. detectChrome: function () {
  34105. var e = window.navigator.userAgent;
  34106. return e.indexOf('Chrome') !== -1 && !this.detectOpera();
  34107. },
  34108. detectOpera: function () {
  34109. var e = window.navigator.userAgent;
  34110. return e.indexOf('OPR') !== -1;
  34111. },
  34112. detectIOS: function () {
  34113. return this.detectIPhone() || this.detectIPad() || this.detectIPod();
  34114. },
  34115. detectIPad: function () {
  34116. var e = window.navigator.userAgent,
  34117. t = /iPad/;
  34118. return t.test(e);
  34119. },
  34120. detectIPod: function () {
  34121. var e = window.navigator.userAgent,
  34122. t = /iPod/;
  34123. return t.test(e);
  34124. },
  34125. detectIPhone: function () {
  34126. var e = window.navigator.userAgent,
  34127. t = /iPhone/;
  34128. return t.test(e);
  34129. },
  34130. detectAndroid: function () {
  34131. var e = window.navigator.userAgent;
  34132. return e.indexOf('Android') !== -1;
  34133. },
  34134. detectAndroidMobile: function () {
  34135. var e = window.navigator.userAgent;
  34136. return this.detectAndroid() && e.indexOf('Mobile') !== -1;
  34137. },
  34138. detectSamsungNative: function () {
  34139. var e = window.navigator.userAgent;
  34140. return (
  34141. e.indexOf('SM-G900H') !== -1 ||
  34142. e.indexOf('GT-I9500') !== -1 ||
  34143. e.indexOf('SM-N900') !== -1
  34144. );
  34145. },
  34146. detectSamsungS6: function () {
  34147. var e = window.navigator.userAgent;
  34148. return e.indexOf('SM-G92') !== -1;
  34149. },
  34150. /************************************************************fyz改from徐世廷*************************************************************/
  34151. detectHUAWEI5X: function () {
  34152. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H');
  34153. },
  34154. /*******************************************************************************************************************************/
  34155. detectWebVR: function () {
  34156. return !(!window.navigator.getVRDisplays || !window.VRDisplay);
  34157. },
  34158. getVRDisplay: function () {
  34159. var e = $.Deferred();
  34160. return this.detectWebVR()
  34161. ? (navigator.getVRDisplays().then(function (t) {
  34162. t.length >= 1 && e.resolve(t[0]), e.reject(null);
  34163. }),
  34164. e)
  34165. : e.reject(null);
  34166. },
  34167. iosVersion: function () {
  34168. if (!this.detectIOS()) throw new r('Did not detect an iDevice');
  34169. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  34170. t = '_';
  34171. return n(e, t);
  34172. },
  34173. androidVersion: function () {
  34174. if (!this.detectAndroid()) throw new r('Did not detect an Android based device');
  34175. var e = /Android ((?:\d+\.?){1,3})/,
  34176. t = '.';
  34177. return n(e, t);
  34178. },
  34179. valueFromCookie: function (e, t) {
  34180. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie);
  34181. if (!i) return t;
  34182. var n = i[1];
  34183. return 'boolean' == typeof t
  34184. ? 'true' === n || '1' === n
  34185. : 'number' == typeof t
  34186. ? parseFloat(n)
  34187. : n;
  34188. },
  34189. valueFromHash: function (e, t) {
  34190. var i = new RegExp('[#&?]' + e + '=([^#&?]*)'),
  34191. n = i.exec(window.location.href);
  34192. if (!n) return t;
  34193. var r = n[1];
  34194. return 'boolean' == typeof t
  34195. ? 'true' === r || '1' === r
  34196. : 'number' == typeof t
  34197. ? parseFloat(r)
  34198. : window.decodeURIComponent(r);
  34199. },
  34200. };
  34201. Object.assign(window.browser, t.exports);
  34202. t.exports = window.browser;
  34203. },
  34204. {
  34205. '../exception/DeviceMismatchException': 56,
  34206. },
  34207. ],
  34208. 183: [
  34209. function (e, t, i) {
  34210. (function (i) {
  34211. 'use strict';
  34212. function n(e, t) {
  34213. var i = r(t);
  34214. var replaceAll = function (str, f, e) {
  34215. //f全部替换成e
  34216. var reg = new RegExp(f, 'g'); //创建正则RegExp对象
  34217. return str.replace(reg, e);
  34218. };
  34219. var urlFirstView = c.valueFromHash('firstView');
  34220. if (urlFirstView) {
  34221. try {
  34222. urlFirstView = replaceAll(urlFirstView, 'pano:', '"pano":"');
  34223. urlFirstView = replaceAll(urlFirstView, ',qua:', '","qua":[');
  34224. urlFirstView = '{' + urlFirstView + ']}';
  34225. let info = JSON.parse(urlFirstView);
  34226. i.pano = t.index[info.pano]; //panos.get(info.pano)
  34227. if (!i.pano) {
  34228. urlFirstView = false;
  34229. console.error('检测到firstView但是 找不到该pano');
  34230. } else {
  34231. i.quaternion = new THREE.Quaternion().fromArray(info.qua);
  34232. i.zoom = -1;
  34233. i.mode = 'panorama';
  34234. i.setByUrl = true;
  34235. }
  34236. } catch (e) {
  34237. urlFirstView = false;
  34238. console.error('检测到firstView但是解析出错' + e);
  34239. }
  34240. }
  34241. if (Object.keys(i).length > 0) return i;
  34242. if (e.heroImage) i = o(e, t);
  34243. else if (window.DATA.camera_start) {
  34244. var n = window.DATA.camera_start;
  34245. try {
  34246. Object.keys(n).length > 0 &&
  34247. !l.isEmptyQuaternion(n.camera.quaternion) &&
  34248. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  34249. (i.position = n.camera.position),
  34250. //i.quaternion = n.camera.quaternion,
  34251. (i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion)), //xzw
  34252. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  34253. n.pano &&
  34254. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  34255. d.debug('Using camera_start'),
  34256. d.debug('Modeldata pano: ', i.pano.quaternion),
  34257. d.debug('Camera start pano: ', n.pano.quaternion)),
  34258. i.mode !== h.PANORAMA &&
  34259. (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  34260. } catch (e) {
  34261. d.warn(e.message);
  34262. if (i.mode == 'panorama' && !i.pano) i.pano = t.list[0];
  34263. }
  34264. }
  34265. if (
  34266. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  34267. i.mode === h.MESH &&
  34268. i.position &&
  34269. ((i.mode = h.PANORAMA),
  34270. (i.pano = t.findClosest(i.position)),
  34271. (i.quaternion = i.pano.quaternion)),
  34272. 0 === Object.keys(i).length)
  34273. ) {
  34274. var a = t.list[0];
  34275. a &&
  34276. ((i.mode = h.PANORAMA),
  34277. (i.pano = a),
  34278. (i.position = a.position),
  34279. (i.quaternion = a.quaternion),
  34280. d.info('Starting at 1st pano ' + a.id));
  34281. }
  34282. return (i.mode = i.mode || h.DOLLHOUSE), i;
  34283. }
  34284. function r(e) {
  34285. var t = c.valueFromHash('start', ''),
  34286. i = {};
  34287. if ('' !== t) {
  34288. d.debug('Start override found in parameters, trying to parse...'), (i = a(t) || {});
  34289. var n = c.valueFromHash('tag', null);
  34290. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId));
  34291. }
  34292. return i;
  34293. }
  34294. function o(e, t) {
  34295. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {};
  34296. var i = {},
  34297. n = e.heroImage.metadata;
  34298. d.debug('Using start position from thumbnail image'),
  34299. (i.position = n.camera_position),
  34300. (i.quaternion = n.camera_quaternion);
  34301. try {
  34302. (i.mode = h.convertWorkshopModeInt(n.camera_mode)),
  34303. i.mode === h.PANORAMA
  34304. ? (i.pano = t.get(n.scan_id))
  34305. : (i.floorVisibility = n.floor_visibility);
  34306. } catch (e) {
  34307. d.debug(e.message);
  34308. }
  34309. return i;
  34310. }
  34311. function a(e) {
  34312. return s.deserialize(e);
  34313. }
  34314. var s = e('../controls/serializer'),
  34315. l = e('../util/math'),
  34316. c = e('./browser'),
  34317. h = e('../enum/Viewmode'),
  34318. u = e('../util/logger'),
  34319. th = e('three'), //xzw
  34320. d = new u(i);
  34321. t.exports = {
  34322. getStartCameraOptions: n,
  34323. };
  34324. }.call(this, '/js/util/camera.js'));
  34325. },
  34326. {
  34327. '../controls/serializer': 14,
  34328. '../enum/Viewmode': 51,
  34329. '../util/logger': 189,
  34330. '../util/math': 190,
  34331. './browser': 182,
  34332. three: 217,
  34333. },
  34334. ],
  34335. 184: [
  34336. function (e, t, i) {
  34337. 'use strict';
  34338. function n(e, t, i) {
  34339. return o(e.fov, t, i);
  34340. }
  34341. var r = e('./MathLight'),
  34342. o = function (e, t, i) {
  34343. var n = t,
  34344. o = i,
  34345. a =
  34346. 2 *
  34347. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) *
  34348. r.DEGREES_PER_RADIAN;
  34349. return a;
  34350. },
  34351. a = function (e, t, i) {
  34352. var n = t,
  34353. o = i,
  34354. a =
  34355. 2 *
  34356. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) *
  34357. r.DEGREES_PER_RADIAN;
  34358. return a;
  34359. },
  34360. s = function (e, t, i, n) {
  34361. var r = o(e, i, n);
  34362. return r > t ? a(t, i, n) : e;
  34363. };
  34364. t.exports = {
  34365. clampVFOV: s,
  34366. getHFOVForCamera: n,
  34367. getHFOVFromVFOV: o,
  34368. getVFOVFromHFOV: a,
  34369. };
  34370. window.MathLight = t.exports;
  34371. MathLight.closeTo = function (e1, e2, precision) {
  34372. //xzw add 判断e1,e2是否接近
  34373. var prec = Math.pow(10, -(precision || 4));
  34374. var s1 =
  34375. Math.abs(e1.x - e2.x) < prec &&
  34376. Math.abs(e1.y - e2.y) < prec &&
  34377. Math.abs(e1.z - e2.z) < prec;
  34378. if (e1.w) {
  34379. return s1 && Math.abs(e1.w - e2.w) < prec;
  34380. } else return s1;
  34381. };
  34382. },
  34383. {
  34384. './MathLight': 176,
  34385. },
  34386. ],
  34387. 185: [
  34388. function (e, t, i) {
  34389. 'use strict';
  34390. var n = e('three');
  34391. (t.exports = {
  34392. delayOneFrame: function (e) {
  34393. window.setTimeout(e, 1);
  34394. },
  34395. normalizeUrl: function (e) {
  34396. return e.replace('https://', 'http://');
  34397. },
  34398. domainFromUrl: function (e) {
  34399. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  34400. return t ? t[3] : e;
  34401. },
  34402. average: function (e, t) {
  34403. if (0 === e.length) return null;
  34404. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  34405. var o = t ? e[r][t] : e[r];
  34406. (i += o), n++;
  34407. }
  34408. return i / n;
  34409. },
  34410. countUnique: function (e) {
  34411. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0);
  34412. return Object.keys(t).length;
  34413. },
  34414. averageVectors: function (e, t) {
  34415. var i = new n.Vector3();
  34416. if (0 === e.length) return i;
  34417. for (var r = 0, o = 0; o < e.length; o++) {
  34418. var a = t ? e[o][t] : e[o];
  34419. i.add(a), r++;
  34420. }
  34421. return i.divideScalar(r);
  34422. },
  34423. equalLists: function (e, t) {
  34424. if (e.length !== t.length) return !1;
  34425. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1;
  34426. return !0;
  34427. },
  34428. lowerMedian: function (e, t) {
  34429. if (0 === e.length) return null;
  34430. (t = t || 2),
  34431. e.sort(function (e, t) {
  34432. return e - t;
  34433. });
  34434. var i = Math.floor(e.length / t);
  34435. return e[i];
  34436. },
  34437. stableSort: function (e, t) {
  34438. return e
  34439. .map(function (e, t) {
  34440. return {
  34441. value: e,
  34442. index: t,
  34443. };
  34444. })
  34445. .sort(function (e, i) {
  34446. var n = t(e.value, i.value);
  34447. return 0 !== n ? n : e.index - i.index;
  34448. })
  34449. .map(function (e) {
  34450. return e.value;
  34451. });
  34452. },
  34453. filterAll: function (e, t) {
  34454. return e.filter(function (e) {
  34455. return t.every(function (t) {
  34456. return t(e);
  34457. });
  34458. });
  34459. },
  34460. formatDate: function (e) {
  34461. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-');
  34462. },
  34463. formatDatetime: function (e) {
  34464. return [
  34465. e.getFullYear(),
  34466. e.getMonth() + 1,
  34467. e.getDate(),
  34468. e.getHours(),
  34469. e.getMinutes(),
  34470. ].join('-');
  34471. },
  34472. randomString: function (e) {
  34473. for (
  34474. var t = '',
  34475. i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
  34476. n = 0;
  34477. n < e;
  34478. n++
  34479. )
  34480. t += i.charAt(Math.floor(Math.random() * i.length));
  34481. return t;
  34482. },
  34483. uint8ToBase64: function (e, t) {
  34484. (t && 'number' == typeof t) || (t = 8192);
  34485. for (var i = [], n = 0; n < e.length; n += t)
  34486. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  34487. return btoa(i.join(''));
  34488. },
  34489. uuid4: function e(t) {
  34490. return t
  34491. ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16)
  34492. : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e);
  34493. },
  34494. nth: function (e) {
  34495. return (
  34496. (e %= 10), 1 === e ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  34497. );
  34498. },
  34499. extendObject: function (e, t) {
  34500. return (
  34501. Object.keys(t).forEach(function (i) {
  34502. e[i] = t[i];
  34503. }),
  34504. e
  34505. );
  34506. },
  34507. deepExtend: function e(t) {
  34508. t = t || {};
  34509. for (var i = 1; i < arguments.length; i++) {
  34510. var n = arguments[i];
  34511. if (n)
  34512. for (var r in n)
  34513. n.hasOwnProperty(r) &&
  34514. ('object' == typeof n[r] ? (t[r] = e(t[r], n[r])) : (t[r] = n[r]));
  34515. }
  34516. return t;
  34517. },
  34518. inherit: function (e, t) {
  34519. (e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e);
  34520. },
  34521. extend: function (e, t) {
  34522. for (var i in t.prototype) e.prototype[i] = t.prototype[i];
  34523. },
  34524. getFileNameFromUrl: function (url) {
  34525. return url.split('/').pop();
  34526. },
  34527. }),
  34528. (Math.sign = function (e) {
  34529. return e < 0 ? -1 : 1;
  34530. });
  34531. window.common = t.exports;
  34532. expandCommon(common);
  34533. },
  34534. {
  34535. three: 217,
  34536. },
  34537. ],
  34538. 186: [
  34539. function (e, t, i) {
  34540. 'use strict';
  34541. var n = {};
  34542. (n.linearTween = function (e, t, i, n) {
  34543. return (i * e) / n + t;
  34544. }),
  34545. (n.easeInQuad = function (e, t, i, n) {
  34546. return (e /= n), i * e * e + t;
  34547. }),
  34548. (n.easeOutQuad = function (e, t, i, n) {
  34549. return (e /= n), -i * e * (e - 2) + t;
  34550. }),
  34551. (n.easeInOutQuad = function (e, t, i, n) {
  34552. return (
  34553. (e /= n / 2), e < 1 ? (i / 2) * e * e + t : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  34554. );
  34555. }),
  34556. (n.easeInCubic = function (e, t, i, n) {
  34557. return (e /= n), i * e * e * e + t;
  34558. }),
  34559. (n.easeOutCubic = function (e, t, i, n) {
  34560. return (e /= n), e--, i * (e * e * e + 1) + t;
  34561. }),
  34562. (n.easeInOutCubic = function (e, t, i, n) {
  34563. return (
  34564. (e /= n / 2),
  34565. e < 1 ? (i / 2) * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  34566. );
  34567. }),
  34568. (n.easeInQuart = function (e, t, i, n) {
  34569. return (e /= n), i * e * e * e * e + t;
  34570. }),
  34571. (n.easeOutQuart = function (e, t, i, n) {
  34572. return (e /= n), e--, -i * (e * e * e * e - 1) + t;
  34573. }),
  34574. (n.easeInOutQuart = function (e, t, i, n) {
  34575. return (
  34576. (e /= n / 2),
  34577. e < 1 ? (i / 2) * e * e * e * e + t : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  34578. );
  34579. }),
  34580. (n.easeInQuint = function (e, t, i, n) {
  34581. return (e /= n), i * e * e * e * e * e + t;
  34582. }),
  34583. (n.easeOutQuint = function (e, t, i, n) {
  34584. return (e /= n), e--, i * (e * e * e * e * e + 1) + t;
  34585. }),
  34586. (n.easeInOutQuint = function (e, t, i, n) {
  34587. return (
  34588. (e /= n / 2),
  34589. e < 1
  34590. ? (i / 2) * e * e * e * e * e + t
  34591. : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  34592. );
  34593. }),
  34594. (n.easeInSine = function (e, t, i, n) {
  34595. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t;
  34596. }),
  34597. (n.easeOutSine = function (e, t, i, n) {
  34598. return i * Math.sin((e / n) * (Math.PI / 2)) + t;
  34599. }),
  34600. (n.easeInOutSine = function (e, t, i, n) {
  34601. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t;
  34602. }),
  34603. (n.easeInExpo = function (e, t, i, n) {
  34604. return i * Math.pow(2, 10 * (e / n - 1)) + t;
  34605. }),
  34606. (n.easeOutExpo = function (e, t, i, n) {
  34607. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t;
  34608. }),
  34609. (n.easeInOutExpo = function (e, t, i, n) {
  34610. return (
  34611. (e /= n / 2),
  34612. e < 1
  34613. ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t
  34614. : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  34615. );
  34616. }),
  34617. (n.easeInCirc = function (e, t, i, n) {
  34618. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t;
  34619. }),
  34620. (n.easeOutCirc = function (e, t, i, n) {
  34621. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t;
  34622. }),
  34623. (n.easeInOutCirc = function (e, t, i, n) {
  34624. return (
  34625. (e /= n / 2),
  34626. e < 1
  34627. ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t
  34628. : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  34629. );
  34630. }),
  34631. (n.easeInElastic = function (e, t, i, n) {
  34632. var r = 1.70158,
  34633. o = 0,
  34634. a = i;
  34635. return 0 === e
  34636. ? t
  34637. : 1 === (e /= n)
  34638. ? t + i
  34639. : (o || (o = 0.3 * n),
  34640. a < Math.abs(i)
  34641. ? ((a = i), (r = o / 4))
  34642. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34643. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  34644. t);
  34645. }),
  34646. (n.easeOutElastic = function (e, t, i, n) {
  34647. var r = 1.70158,
  34648. o = 0,
  34649. a = i;
  34650. return 0 === e
  34651. ? t
  34652. : 1 === (e /= n)
  34653. ? t + i
  34654. : (o || (o = 0.3 * n),
  34655. a < Math.abs(i)
  34656. ? ((a = i), (r = o / 4))
  34657. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34658. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t);
  34659. }),
  34660. (n.easeInOutElastic = function (e, t, i, n) {
  34661. var r = 1.70158,
  34662. o = 0,
  34663. a = i;
  34664. return 0 === e
  34665. ? t
  34666. : 2 === (e /= n / 2)
  34667. ? t + i
  34668. : (o || (o = n * (0.3 * 1.5)),
  34669. a < Math.abs(i)
  34670. ? ((a = i), (r = o / 4))
  34671. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34672. e < 1
  34673. ? -0.5 *
  34674. (a *
  34675. Math.pow(2, 10 * (e -= 1)) *
  34676. Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  34677. t
  34678. : a *
  34679. Math.pow(2, -10 * (e -= 1)) *
  34680. Math.sin(((e * n - r) * (2 * Math.PI)) / o) *
  34681. 0.5 +
  34682. i +
  34683. t);
  34684. }),
  34685. (n.easeInBack = function (e, t, i, n, r) {
  34686. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t;
  34687. }),
  34688. (n.easeOutBack = function (e, t, i, n, r) {
  34689. return (
  34690. void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  34691. );
  34692. }),
  34693. (n.easeInOutBack = function (e, t, i, n, r) {
  34694. return (
  34695. void 0 === r && (r = 1.70158),
  34696. (e /= n / 2) < 1
  34697. ? (i / 2) * (e * e * (((r *= 1.525) + 1) * e - r)) + t
  34698. : (i / 2) * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  34699. );
  34700. }),
  34701. (n.easeOutBounce = function (e, t, i, n) {
  34702. return (e /= n) < 1 / 2.75
  34703. ? i * (7.5625 * e * e) + t
  34704. : e < 2 / 2.75
  34705. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  34706. : e < 2.5 / 2.75
  34707. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  34708. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
  34709. }),
  34710. (n.easeInBounce = function (e, t, i, r) {
  34711. return i - n.easeOutBounce(r - e, 0, i, r) + t;
  34712. }),
  34713. (n.easeInOutBounce = function (e, t, i, r) {
  34714. return e < r / 2
  34715. ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t
  34716. : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t;
  34717. }),
  34718. (t.exports = n);
  34719. window.easing = n;
  34720. },
  34721. {},
  34722. ],
  34723. 187: [
  34724. function (e, t, i) {
  34725. 'use strict';
  34726. function n() {
  34727. (this.events = []), (this.valid = !1);
  34728. }
  34729. var r = e('../enum/Joystick');
  34730. (n.prototype.push = function (e, t) {
  34731. this.events.push({
  34732. direction: e,
  34733. pano: t,
  34734. }),
  34735. (this.valid = !0);
  34736. }),
  34737. (n.prototype.pop = function (e) {
  34738. var t = this.events.pop();
  34739. return this.events.length < 1 && (this.valid = !1), t;
  34740. }),
  34741. (n.prototype.peek = function () {
  34742. return this.events.length
  34743. ? this.events[this.events.length - 1]
  34744. : {
  34745. direction: null,
  34746. pano: null,
  34747. };
  34748. }),
  34749. (n.prototype.invalidate = function () {
  34750. (this.events = []), (this.valid = !1);
  34751. }),
  34752. (n.prototype.reversePano = function (e) {
  34753. if (!this.valid) return null;
  34754. var t = this.peek();
  34755. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null;
  34756. }),
  34757. (t.exports = n);
  34758. },
  34759. {
  34760. '../enum/Joystick': 29,
  34761. },
  34762. ],
  34763. 188: [
  34764. function (e, t, i) {
  34765. 'use strict';
  34766. window.lerp = t.exports = {
  34767. vector: function (e, t) {
  34768. var i = e.clone();
  34769. return (
  34770. (t = t.clone()),
  34771. function (n) {
  34772. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n);
  34773. }
  34774. );
  34775. },
  34776. quaternion: function (e, t) {
  34777. var i = e.clone();
  34778. return function (n) {
  34779. e.copy(i).slerp(t, n);
  34780. };
  34781. },
  34782. property: function (e, t, i, n) {
  34783. var r = e[t];
  34784. return function (o) {
  34785. (e[t] = r * (1 - o) + i * o), n && n(e[t]);
  34786. };
  34787. },
  34788. uniform: function (e, t, i) {
  34789. var n = e.material.uniforms[t].value;
  34790. return function (r) {
  34791. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r);
  34792. };
  34793. },
  34794. matrix4: function (e, t) {
  34795. var i = e.clone();
  34796. return function (n) {
  34797. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  34798. r[s] = o[s] * (1 - n) + a[s] * n;
  34799. };
  34800. },
  34801. allUniforms: function (e, t, i) {
  34802. var n = e.map(
  34803. function (e) {
  34804. return this.uniform(e, t, i);
  34805. }.bind(this)
  34806. );
  34807. return function (e) {
  34808. n.forEach(function (t) {
  34809. t(e);
  34810. });
  34811. };
  34812. },
  34813. };
  34814. },
  34815. {},
  34816. ],
  34817. 189: [
  34818. function (e, t, i) {
  34819. 'use strict';
  34820. function n(e) {
  34821. var t,
  34822. i,
  34823. o,
  34824. a,
  34825. s = e.split('/'),
  34826. l = '[' + s[s.length - 1].replace('.js', '') + ']',
  34827. c = {};
  34828. if (n.consoleEnabled) {
  34829. var h = function (e) {
  34830. $('#debug-console').append('<p>' + e + '</p>'),
  34831. ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight);
  34832. };
  34833. (t = function (e) {
  34834. h(Array.prototype.slice.call(arguments).join(' '));
  34835. }),
  34836. (i = function (e) {
  34837. h(Array.prototype.slice.call(arguments).join(' '));
  34838. }),
  34839. (o = function (e) {
  34840. h('WARN: ' + Array.prototype.slice.call(arguments).join(' '));
  34841. }),
  34842. (a = function (e) {
  34843. h('ERROR: ' + Array.prototype.slice.call(arguments).join(' '));
  34844. });
  34845. } else
  34846. console.log
  34847. ? ((t = console.log),
  34848. (i = console.info ? console.info : console.log),
  34849. (o = console.warn ? console.warn : console.log),
  34850. (a = console.error ? console.error : console.log))
  34851. : (t = i = o = a = function () {});
  34852. var u = function (e) {
  34853. return [l, n.timestamp()].concat(Array.prototype.slice.call(e));
  34854. },
  34855. d = function (t, i) {
  34856. if (r) {
  34857. var o = Array.prototype.slice.call(t).join(' ');
  34858. r.captureMessage(o, {
  34859. level: i,
  34860. path: e,
  34861. timestamp: n.timestamp(),
  34862. });
  34863. }
  34864. },
  34865. p = function (t, i) {
  34866. if (r) {
  34867. var o = Array.prototype.slice.call(t).join(' ');
  34868. r.captureException(new Error(o), {
  34869. level: i,
  34870. path: e,
  34871. timestamp: n.timestamp(),
  34872. });
  34873. }
  34874. };
  34875. return {
  34876. debug: function () {
  34877. n.level >= n.levels.debug && t.apply(console, u(arguments));
  34878. },
  34879. info: function () {
  34880. n.level >= n.levels.info && i.apply(console, u(arguments));
  34881. },
  34882. warn: function () {
  34883. d(arguments, 'warn'), n.level >= n.levels.warn && o.apply(console, u(arguments));
  34884. },
  34885. error: function () {
  34886. p(arguments, 'error'), n.level >= n.levels.error && a.apply(console, u(arguments));
  34887. },
  34888. v3str: function (e, t) {
  34889. var i = void 0 === t ? 2 : t;
  34890. return (
  34891. '(' +
  34892. e.x.toPrecision(i) +
  34893. ', ' +
  34894. e.y.toPrecision(i) +
  34895. ', ' +
  34896. e.z.toPrecision(i) +
  34897. ')'
  34898. );
  34899. },
  34900. eulstr: function (e, t) {
  34901. var i = void 0 === t ? 2 : t;
  34902. return (
  34903. '(' +
  34904. THREE.Math.radToDeg(e.x).toPrecision(i) +
  34905. ', ' +
  34906. THREE.Math.radToDeg(e.y).toPrecision(i) +
  34907. ', ' +
  34908. THREE.Math.radToDeg(e.z).toPrecision(i) +
  34909. ' "' +
  34910. e.order +
  34911. '")'
  34912. );
  34913. },
  34914. time: function (e) {
  34915. n.level >= n.levels.debug && (c[e] = Date.now());
  34916. },
  34917. timeEnd: function (e) {
  34918. if (n.level >= n.levels.debug) {
  34919. var t = c[e];
  34920. if (!t) return;
  34921. var i = (Date.now() - t) / 1e3;
  34922. this.debug(e, i + 's');
  34923. }
  34924. },
  34925. };
  34926. }
  34927. var r = window.Raven;
  34928. (n.timestamp = function () {
  34929. return (Date.now() - window.navigationStart) / 1e3 + 's';
  34930. }),
  34931. (n.levels = {
  34932. debug: 3,
  34933. info: 2,
  34934. warn: 1,
  34935. error: 0,
  34936. }),
  34937. (n.level = n.levels.info),
  34938. (t.exports = n);
  34939. },
  34940. {},
  34941. ],
  34942. 190: [
  34943. function (e, t, i) {
  34944. 'use strict';
  34945. var n = e('three'),
  34946. r = e('../enum/GLCubeFaces'),
  34947. o = e('../constants');
  34948. t.exports = {
  34949. convertVisionVector: function (e) {
  34950. return new n.Vector3(e.x, e.z, -e.y);
  34951. },
  34952. convertVisionQuaternion: function (e) {
  34953. return new n.Quaternion(e.x, e.z, -e.y, e.w).multiply(
  34954. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90))
  34955. );
  34956. },
  34957. convertWorkshopVector: function (e) {
  34958. return new n.Vector3(-e.x, e.y, e.z);
  34959. },
  34960. convertWorkshopQuaternion: function (e) {
  34961. return new n.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  34962. new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  34963. );
  34964. },
  34965. convertWorkshopPanoramaQuaternion: function (e) {
  34966. return new n.Quaternion(e.x, -e.y, -e.z, e.w)
  34967. .normalize()
  34968. .multiply(
  34969. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270))
  34970. );
  34971. },
  34972. convertWorkshopOrthoZoom: function (e) {
  34973. // xzw
  34974. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  34975. //return e;
  34976. return e === -1
  34977. ? -1
  34978. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  34979. g_snapShotHeight;
  34980. },
  34981. toPrecision: function (e, t) {
  34982. //xzw change
  34983. var f = function (e, t) {
  34984. var i = Math.pow(10, t);
  34985. return Math.round(e * i) / i;
  34986. };
  34987. if (e instanceof Array) {
  34988. for (var s = 0; s < e.length; s++) {
  34989. e[s] = f(e[s], t);
  34990. }
  34991. return e;
  34992. } else return f(e, t);
  34993. },
  34994. isEmptyQuaternion: function (e) {
  34995. return (
  34996. 0 === Math.abs(e.x) &&
  34997. 0 === Math.abs(e.y) &&
  34998. 0 === Math.abs(e.z) &&
  34999. 0 === Math.abs(e.w)
  35000. );
  35001. },
  35002. projectPositionToCanvas: function (e, t, i) {
  35003. (i = i || new n.Vector3()), i.copy(e);
  35004. var r = 0.5 * $('#player').width(),
  35005. o = 0.5 * $('#player').height();
  35006. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i;
  35007. },
  35008. convertScreenPositionToNDC: function (e, t, i) {
  35009. return (
  35010. (i = i || new n.Vector2()),
  35011. (i.x = (e / $('#player').width()) * 2 - 1),
  35012. (i.y = 2 * -(t / $('#player').height()) + 1),
  35013. i
  35014. );
  35015. },
  35016. constrainedTurn: function (e) {
  35017. var t = e % (2 * Math.PI);
  35018. return (t = t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t);
  35019. },
  35020. getFOVDotThreshold: function (e) {
  35021. return Math.cos(n.Math.degToRad(e / 2));
  35022. },
  35023. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  35024. switch (e) {
  35025. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  35026. i.set(1, t.y, t.x);
  35027. break;
  35028. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  35029. i.set(-1, t.y, -t.x);
  35030. break;
  35031. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  35032. i.set(-t.x, 1, -t.y);
  35033. break;
  35034. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  35035. i.set(-t.x, -1, t.y);
  35036. break;
  35037. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  35038. i.set(-t.x, t.y, 1);
  35039. break;
  35040. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  35041. i.set(t.x, t.y, -1);
  35042. }
  35043. n && i.normalize();
  35044. },
  35045. //add:
  35046. getPos2d: function (point, camera, dom) {
  35047. var camera = camera;
  35048. var dom = dom;
  35049. 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);
  35050. var x, y;
  35051. x = ((pos.x + 1) / 2) * dom.clientWidth;
  35052. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  35053. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0;
  35054. return {
  35055. pos: new THREE.Vector2(x, y),
  35056. vector: pos,
  35057. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  35058. inSight: inSight, //在屏幕范围内可见
  35059. };
  35060. },
  35061. getDirByLonLat: function (lon, lat) {
  35062. var dir = new THREE.Vector3();
  35063. var phi = THREE.Math.degToRad(90 - lat);
  35064. var theta = THREE.Math.degToRad(lon);
  35065. dir.x = Math.sin(phi) * Math.cos(theta);
  35066. dir.y = Math.cos(phi);
  35067. dir.z = Math.sin(phi) * Math.sin(theta);
  35068. return dir.negate();
  35069. },
  35070. };
  35071. window.math = t.exports;
  35072. },
  35073. {
  35074. '../constants': 8,
  35075. '../enum/GLCubeFaces': 25,
  35076. three: 217,
  35077. },
  35078. ],
  35079. 191: [
  35080. function (e, t, i) {
  35081. 'use strict';
  35082. function n(e, t, i) {
  35083. return a.map(
  35084. function (n, o) {
  35085. return e.get('pan/' + i + '/' + t + '_skybox' + r(n) + '.jpg');
  35086. }.bind(this)
  35087. );
  35088. }
  35089. function r(e) {
  35090. return s[e];
  35091. }
  35092. var o = e('../enum/GLCubeFaces'),
  35093. a = [0, 1, 2, 3, 4, 5],
  35094. s = {
  35095. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  35096. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  35097. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  35098. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  35099. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  35100. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
  35101. };
  35102. t.exports = {
  35103. mapFaceToCubemapFace: r,
  35104. getCubemapUrls: n,
  35105. };
  35106. },
  35107. {
  35108. '../enum/GLCubeFaces': 25,
  35109. },
  35110. ],
  35111. 192: [
  35112. function (e, t, i) {
  35113. 'use strict';
  35114. t.exports = {
  35115. captureErrors: function (e, t, i) {
  35116. if ('Raven' in window) {
  35117. Raven.config(e, t).install(), i && Raven.setTagsContext(i);
  35118. var n = console.warn,
  35119. r = console.error;
  35120. (console.warn = function () {
  35121. var e = Array.prototype.slice.call(arguments);
  35122. Raven.captureMessage(e.join(' '), {
  35123. level: 'warning',
  35124. }),
  35125. n.apply(console, e);
  35126. }),
  35127. (console.error = function () {
  35128. var e = Array.prototype.slice.call(arguments);
  35129. Raven.captureException(new Error(e.join(' ')), {
  35130. level: 'error',
  35131. }),
  35132. r.apply(console, e);
  35133. });
  35134. } else console.error('Raven not found, not capturing errors.');
  35135. },
  35136. };
  35137. },
  35138. {},
  35139. ],
  35140. 193: [
  35141. function (e, t, i) {
  35142. (function (i) {
  35143. 'use strict';
  35144. var n = e('./browser'),
  35145. r = e('../constants'),
  35146. o = e('url'),
  35147. a = e('./logger'),
  35148. ss = e('three'),
  35149. s = new a(i),
  35150. l = {
  35151. getAuthorizationHeader: function () {
  35152. var e = n.valueFromHash('auth');
  35153. if (e) return e.replace(',', ' ');
  35154. var t = n.valueFromCookie('token');
  35155. return t ? 'Token ' + t : null;
  35156. },
  35157. parseSidUrl: function (e) {
  35158. var t, i;
  35159. t = g_Prefix;
  35160. if (((e = e || ''), e.match(/^https?/))) {
  35161. var n = o.parse(e);
  35162. (t = g_Prefix), (i = e);
  35163. } else {
  35164. //xzw 原先的不能用
  35165. //t = window.location.protocol + "//" + window.location.host, //MP
  35166. t = g_Prefix;
  35167. //i = t + "/api/player/models/" + e; //MP
  35168. i = t + 'data/' + e;
  35169. }
  35170. return {
  35171. urlBase: t,
  35172. urlModel: i,
  35173. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  35174. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb'),
  35175. };
  35176. },
  35177. getModelIDFromQueryString: function () {
  35178. return n.valueFromHash('model') || n.valueFromHash('m');
  35179. },
  35180. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  35181. e = JSON.parse(JSON.stringify(e));
  35182. var i = null;
  35183. if (e.images.forEach(function(n) {
  35184. if(!n.metadata) return;
  35185. if ("string" == typeof n.metadata)
  35186. try {
  35187. n.metadata = JSON.parse(n.metadata)
  35188. } catch (e) {
  35189. s.warn("Unable to parse image metadata"),
  35190. n.metadata = null
  35191. }
  35192. else{
  35193. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  35194. }
  35195. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  35196. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  35197. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  35198. }else{
  35199. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35200. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  35201. n.metadata.zoom = n.metadata.zoom || 1;
  35202. }
  35203. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  35204. }),
  35205. //icon初始视角的:
  35206. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  35207. var n = {};
  35208. n.pano = {
  35209. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35210. position: t.convertWorkshopVector(i.scan_position),
  35211. uuid: i.scan_id
  35212. },
  35213. n.camera = {
  35214. quaternion: i.camera_quaternion,
  35215. position: i.camera_position
  35216. },
  35217. e.startPano = n
  35218. }
  35219. return e
  35220. },
  35221. */
  35222. normalizeModeldata: function (e, t) {
  35223. //xzw 修改导览images数据
  35224. e = JSON.parse(JSON.stringify(e));
  35225. var i = null;
  35226. var deal = function (n) {
  35227. if (!n.metadata) return;
  35228. if ('string' == typeof n.metadata)
  35229. try {
  35230. n.metadata = JSON.parse(n.metadata);
  35231. } catch (e) {
  35232. s.warn('Unable to parse image metadata'), (n.metadata = null);
  35233. }
  35234. else {
  35235. 'object' == typeof n.metadata &&
  35236. s.debug('image.metadata already a JSON object');
  35237. }
  35238. if (n.metadata.camera_position instanceof Array) {
  35239. //xzw 改的格式
  35240. n.metadata.camera_position = new ss.Vector3().fromArray(
  35241. n.metadata.camera_position
  35242. );
  35243. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(
  35244. n.metadata.camera_quaternion
  35245. );
  35246. } else {
  35247. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position);
  35248. n.metadata.camera_quaternion = new ss.Quaternion().copy(
  35249. n.metadata.camera_quaternion
  35250. );
  35251. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35252. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  35253. }
  35254. !i && e.icon && e.icon === n.sid && (i = n.metadata);
  35255. };
  35256. //改
  35257. e.images.forEach((info) => {
  35258. if (info.locations) {
  35259. info.locations.forEach((a) => deal(a));
  35260. } else {
  35261. deal(info);
  35262. }
  35263. });
  35264. //icon初始视角的:
  35265. if (
  35266. i &&
  35267. i.camera_quaternion &&
  35268. i.camera_position &&
  35269. i.scan_position &&
  35270. i.scan_quaternion
  35271. ) {
  35272. var n = {};
  35273. (n.pano = {
  35274. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35275. position: t.convertWorkshopVector(i.scan_position),
  35276. uuid: i.scan_id,
  35277. }),
  35278. (n.camera = {
  35279. quaternion: i.camera_quaternion,
  35280. position: i.camera_position,
  35281. }),
  35282. (e.startPano = n);
  35283. }
  35284. return e;
  35285. },
  35286. visionVersionToInt: (function () {
  35287. var e = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''));
  35288. return function (t) {
  35289. if (!t) throw new Error('Vision version is required');
  35290. var i = e.exec(t);
  35291. if (null === i) throw new Error('String is not a vision version: ' + t);
  35292. return parseInt(i[1]);
  35293. };
  35294. })(),
  35295. modelDataPromisesTiles: function (e) {
  35296. var vision_version = e.vision_version || window.DATA.vision_version;
  35297. if (vision_version)
  35298. try {
  35299. return (
  35300. l.visionVersionToInt(vision_version) >=
  35301. l.visionVersionToInt(r.visionTilingStartVersion)
  35302. );
  35303. } catch (t) {
  35304. s.warn('Invalid vision version: ' + vision_version);
  35305. }
  35306. // var t = e.created ? new Date(e.created) : null;
  35307. // return t && t >= r.visionTilingStartDate
  35308. return false;
  35309. },
  35310. };
  35311. t.exports = l;
  35312. }.call(this, '/js/util/showcase.js'));
  35313. },
  35314. {
  35315. '../constants': 8,
  35316. './browser': 182,
  35317. './logger': 189,
  35318. three: 217,
  35319. url: 208,
  35320. },
  35321. ],
  35322. 194: [
  35323. function (e, t, i) {
  35324. 'use strict';
  35325. var n = e('../util/ajax'),
  35326. r = e('three'),
  35327. o = e('../settings'),
  35328. a = {};
  35329. t.exports = {
  35330. load: function (e, t, i) {
  35331. var s = a[e];
  35332. return s
  35333. ? (t &&
  35334. setTimeout(function () {
  35335. t(s);
  35336. }, 1),
  35337. s)
  35338. : ((s = new r.Texture()),
  35339. o.minimalMemoryMode &&
  35340. ((s.minFilter = r.LinearFilter),
  35341. (s.magFilter = r.LinearFilter),
  35342. (s.generateMipmaps = !1)),
  35343. (s.sourceFile = e),
  35344. (a[e] = s),
  35345. n
  35346. .getImage(e)
  35347. .then(function (e) {
  35348. (s.image = e), (s.needsUpdate = !0), t && t(s);
  35349. })
  35350. .fail(i),
  35351. s);
  35352. },
  35353. loadBase64: function (e, t) {
  35354. t = t || 'png';
  35355. var i = new r.Texture();
  35356. return (
  35357. (i.image = document.createElement('img')),
  35358. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  35359. o.minimalMemoryMode &&
  35360. ((i.minFilter = r.LinearFilter),
  35361. (i.magFilter = r.LinearFilter),
  35362. (i.generateMipmaps = !1)),
  35363. (i.needsUpdate = !0),
  35364. i
  35365. );
  35366. },
  35367. isLoaded: function (e) {
  35368. return !!a[e];
  35369. },
  35370. };
  35371. window.Texture = t.exports;
  35372. },
  35373. {
  35374. '../settings': 166,
  35375. '../util/ajax': 181,
  35376. three: 217,
  35377. },
  35378. ],
  35379. 195: [
  35380. function (e, t, i) {
  35381. 'use strict';
  35382. var n = e('./easing');
  35383. window.transitions = t.exports = {
  35384. globalDone: null,
  35385. funcs: [],
  35386. counter: 0,
  35387. uniqueID: 0,
  35388. start: function (e, t, i, r, o, a, s) {
  35389. return (
  35390. (r = r || 0),
  35391. this.funcs.push({
  35392. func: e,
  35393. current: -r * Math.abs(t),
  35394. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  35395. done: i,
  35396. easing: o || n.linearTween,
  35397. cycling: t < 0,
  35398. running: !0,
  35399. debug: r < 0,
  35400. name: a || 'T' + this.counter,
  35401. id: void 0 === s ? this.counter : s,
  35402. paused: !1,
  35403. }),
  35404. e(0, 16),
  35405. (this.counter += 1),
  35406. e
  35407. );
  35408. },
  35409. trigger: function (e) {
  35410. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  35411. i = e.func || function () {},
  35412. r = void 0 === e.duration ? 0 : e.duration;
  35413. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  35414. var o = e.done || null,
  35415. a = e.easing || n.linearTween,
  35416. s = e.name || 'R' + this.counter,
  35417. l = void 0 === e.id ? this.counter : e.id;
  35418. return this.start(i, r, o, t, a, s, l);
  35419. },
  35420. setTimeout: function (e, t, i) {
  35421. var n = void 0 === i ? this.counter : i;
  35422. return this.trigger({
  35423. done: e,
  35424. duration: void 0 === t ? 0 : t,
  35425. name: 'O' + this.counter,
  35426. id: n,
  35427. });
  35428. },
  35429. pause: function () {
  35430. this.paused = !0;
  35431. },
  35432. resume: function () {
  35433. this.paused = !1;
  35434. },
  35435. update: function (e) {
  35436. this.funcs.forEach(function (t) {
  35437. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  35438. if (t.current >= t.duration && !t.cycling) {
  35439. var i = t.easing(1, 0, 1, 1);
  35440. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1);
  35441. } else {
  35442. var n = t.easing((t.current % t.duration) / t.duration, 0, 1, 1),
  35443. r = t.func(n, 1e3 * e) || !1;
  35444. r && (t.done && t.done(), (t.running = !1));
  35445. }
  35446. });
  35447. var t = this.funcs.length;
  35448. this.funcs = this.funcs.filter(function (e) {
  35449. return e.running;
  35450. });
  35451. var i = this.funcs.length;
  35452. if (t > 0 && 0 === i && this.globalDone) {
  35453. var n = this.globalDone;
  35454. (this.globalDone = null), n();
  35455. }
  35456. },
  35457. adjustSpeed: function (e, t) {
  35458. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  35459. var r = i[n];
  35460. (r.duration /= t), (r.current /= t);
  35461. }
  35462. },
  35463. getById: function (e) {
  35464. return this.funcs.filter(function (t) {
  35465. return e === t.id;
  35466. });
  35467. },
  35468. get: function (e) {
  35469. for (var t = 0; t < this.funcs.length; t += 1)
  35470. if (this.funcs[t].func === e) return this.funcs[t];
  35471. return null;
  35472. },
  35473. isRunning: function (e) {
  35474. var t = this.get(e);
  35475. return null !== t && t.running;
  35476. },
  35477. countActive: function () {
  35478. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running;
  35479. return e;
  35480. },
  35481. listActive: function () {
  35482. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  35483. this.funcs[t].running && e.push(this.funcs[t].name);
  35484. return e;
  35485. },
  35486. done: function (e) {
  35487. this.globalDone = e;
  35488. },
  35489. cancelById: function (e) {
  35490. var t = void 0 === e ? 0 : e;
  35491. this.funcs = this.funcs.filter(function (e) {
  35492. return e.id !== t;
  35493. });
  35494. },
  35495. cancel: function (e) {
  35496. this.funcs = this.funcs.filter(function (t) {
  35497. return t.func !== e;
  35498. });
  35499. },
  35500. getUniqueId: function () {
  35501. return (this.uniqueID -= 1), this.uniqueID;
  35502. },
  35503. };
  35504. },
  35505. {
  35506. './easing': 186,
  35507. },
  35508. ],
  35509. 196: [
  35510. function (e, t, i) {
  35511. function n(e) {
  35512. if (
  35513. ((this.set = {}),
  35514. (this.infContains = function () {
  35515. return !0;
  35516. }),
  35517. 'object' == typeof e)
  35518. )
  35519. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0;
  35520. else this.set = e;
  35521. else if ('function' == typeof e) this.infContains = e;
  35522. else if ('undefined' != typeof e)
  35523. throw new Error('set must be either an array or an object.');
  35524. }
  35525. (t.exports = n),
  35526. (n.prototype.contains = function (e) {
  35527. return !!this.set[e];
  35528. }),
  35529. (n.prototype.has = n.prototype.contains),
  35530. (n.prototype.add = function (e) {
  35531. if (1 == arguments.length) this.set[e] = !0;
  35532. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0;
  35533. }),
  35534. (n.prototype.addAll = function (e) {
  35535. if ('object' != typeof e && !(e instanceof Array))
  35536. throw new Error('arr must be an array.');
  35537. for (var t = 0; t < e.length; t++) this.add(e[t]);
  35538. }),
  35539. (n.prototype.remove = function (e) {
  35540. if (1 == arguments.length) delete this.set[e];
  35541. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]];
  35542. }),
  35543. (n.prototype.delete = n.prototype.remove),
  35544. (n.prototype.clear = function () {
  35545. this.set = {};
  35546. }),
  35547. (n.prototype.size = function () {
  35548. return Object.keys(this.set).length;
  35549. }),
  35550. (n.prototype.toString = function () {
  35551. return '{' + Object.keys(this.set).toString() + '}';
  35552. }),
  35553. (n.prototype.toArray = function () {
  35554. return 'undefined' == typeof this.set ? [] : Object.keys(this.set);
  35555. }),
  35556. (n.prototype['*values'] = n.prototype.toArray);
  35557. },
  35558. {},
  35559. ],
  35560. 197: [function (e, t, i) {}, {}],
  35561. 198: [
  35562. function (e, t, i) {
  35563. (function (t) {
  35564. 'use strict';
  35565. function n() {
  35566. try {
  35567. var e = new Uint8Array(1);
  35568. return (
  35569. (e.__proto__ = {
  35570. __proto__: Uint8Array.prototype,
  35571. foo: function () {
  35572. return 42;
  35573. },
  35574. }),
  35575. 42 === e.foo() &&
  35576. 'function' == typeof e.subarray &&
  35577. 0 === e.subarray(1, 1).byteLength
  35578. );
  35579. } catch (e) {
  35580. return !1;
  35581. }
  35582. }
  35583. function r() {
  35584. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
  35585. }
  35586. function o(e, t) {
  35587. if (r() < t) throw new RangeError('Invalid typed array length');
  35588. return (
  35589. a.TYPED_ARRAY_SUPPORT
  35590. ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype))
  35591. : (null === e && (e = new a(t)), (e.length = t)),
  35592. e
  35593. );
  35594. }
  35595. function a(e, t, i) {
  35596. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a)) return new a(e, t, i);
  35597. if ('number' == typeof e) {
  35598. if ('string' == typeof t)
  35599. throw new Error(
  35600. 'If encoding is specified then the first argument must be a string'
  35601. );
  35602. return h(this, e);
  35603. }
  35604. return s(this, e, t, i);
  35605. }
  35606. function s(e, t, i, n) {
  35607. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number');
  35608. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
  35609. ? p(e, t, i, n)
  35610. : 'string' == typeof t
  35611. ? u(e, t, i)
  35612. : f(e, t);
  35613. }
  35614. function l(e) {
  35615. if ('number' != typeof e) throw new TypeError('"size" argument must be a number');
  35616. if (e < 0) throw new RangeError('"size" argument must not be negative');
  35617. }
  35618. function c(e, t, i, n) {
  35619. return (
  35620. l(t),
  35621. t <= 0
  35622. ? o(e, t)
  35623. : void 0 !== i
  35624. ? 'string' == typeof n
  35625. ? o(e, t).fill(i, n)
  35626. : o(e, t).fill(i)
  35627. : o(e, t)
  35628. );
  35629. }
  35630. function h(e, t) {
  35631. if ((l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT))
  35632. for (var i = 0; i < t; ++i) e[i] = 0;
  35633. return e;
  35634. }
  35635. function u(e, t, i) {
  35636. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !a.isEncoding(i)))
  35637. throw new TypeError('"encoding" must be a valid string encoding');
  35638. var n = 0 | v(t, i);
  35639. e = o(e, n);
  35640. var r = e.write(t, i);
  35641. return r !== n && (e = e.slice(0, r)), e;
  35642. }
  35643. function d(e, t) {
  35644. var i = t.length < 0 ? 0 : 0 | g(t.length);
  35645. e = o(e, i);
  35646. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n];
  35647. return e;
  35648. }
  35649. function p(e, t, i, n) {
  35650. if ((t.byteLength, i < 0 || t.byteLength < i))
  35651. throw new RangeError("'offset' is out of bounds");
  35652. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds");
  35653. return (
  35654. (t =
  35655. void 0 === i && void 0 === n
  35656. ? new Uint8Array(t)
  35657. : void 0 === n
  35658. ? new Uint8Array(t, i)
  35659. : new Uint8Array(t, i, n)),
  35660. a.TYPED_ARRAY_SUPPORT ? ((e = t), (e.__proto__ = a.prototype)) : (e = d(e, t)),
  35661. e
  35662. );
  35663. }
  35664. function f(e, t) {
  35665. if (a.isBuffer(t)) {
  35666. var i = 0 | g(t.length);
  35667. return (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e);
  35668. }
  35669. if (t) {
  35670. if (
  35671. ('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) ||
  35672. 'length' in t
  35673. )
  35674. return 'number' != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  35675. if ('Buffer' === t.type && $(t.data)) return d(e, t.data);
  35676. }
  35677. throw new TypeError(
  35678. 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.'
  35679. );
  35680. }
  35681. function g(e) {
  35682. if (e >= r())
  35683. throw new RangeError(
  35684. 'Attempt to allocate Buffer larger than maximum size: 0x' +
  35685. r().toString(16) +
  35686. ' bytes'
  35687. );
  35688. return 0 | e;
  35689. }
  35690. function m(e) {
  35691. return +e != e && (e = 0), a.alloc(+e);
  35692. }
  35693. function v(e, t) {
  35694. if (a.isBuffer(e)) return e.length;
  35695. if (
  35696. 'undefined' != typeof ArrayBuffer &&
  35697. 'function' == typeof ArrayBuffer.isView &&
  35698. (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
  35699. )
  35700. return e.byteLength;
  35701. 'string' != typeof e && (e = '' + e);
  35702. var i = e.length;
  35703. if (0 === i) return 0;
  35704. for (var n = !1; ; )
  35705. switch (t) {
  35706. case 'ascii':
  35707. case 'latin1':
  35708. case 'binary':
  35709. return i;
  35710. case 'utf8':
  35711. case 'utf-8':
  35712. case void 0:
  35713. return j(e).length;
  35714. case 'ucs2':
  35715. case 'ucs-2':
  35716. case 'utf16le':
  35717. case 'utf-16le':
  35718. return 2 * i;
  35719. case 'hex':
  35720. return i >>> 1;
  35721. case 'base64':
  35722. return Z(e).length;
  35723. default:
  35724. if (n) return j(e).length;
  35725. (t = ('' + t).toLowerCase()), (n = !0);
  35726. }
  35727. }
  35728. function A(e, t, i) {
  35729. var n = !1;
  35730. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return '';
  35731. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return '';
  35732. if (((i >>>= 0), (t >>>= 0), i <= t)) return '';
  35733. for (e || (e = 'utf8'); ; )
  35734. switch (e) {
  35735. case 'hex':
  35736. return L(this, t, i);
  35737. case 'utf8':
  35738. case 'utf-8':
  35739. return M(this, t, i);
  35740. case 'ascii':
  35741. return P(this, t, i);
  35742. case 'latin1':
  35743. case 'binary':
  35744. return O(this, t, i);
  35745. case 'base64':
  35746. return S(this, t, i);
  35747. case 'ucs2':
  35748. case 'ucs-2':
  35749. case 'utf16le':
  35750. case 'utf-16le':
  35751. return D(this, t, i);
  35752. default:
  35753. if (n) throw new TypeError('Unknown encoding: ' + e);
  35754. (e = (e + '').toLowerCase()), (n = !0);
  35755. }
  35756. }
  35757. function y(e, t, i) {
  35758. var n = e[t];
  35759. (e[t] = e[i]), (e[i] = n);
  35760. }
  35761. function C(e, t, i, n, r) {
  35762. if (0 === e.length) return -1;
  35763. if (
  35764. ('string' == typeof i
  35765. ? ((n = i), (i = 0))
  35766. : i > 2147483647
  35767. ? (i = 2147483647)
  35768. : i < -2147483648 && (i = -2147483648),
  35769. (i = +i),
  35770. isNaN(i) && (i = r ? 0 : e.length - 1),
  35771. i < 0 && (i = e.length + i),
  35772. i >= e.length)
  35773. ) {
  35774. if (r) return -1;
  35775. i = e.length - 1;
  35776. } else if (i < 0) {
  35777. if (!r) return -1;
  35778. i = 0;
  35779. }
  35780. if (('string' == typeof t && (t = a.from(t, n)), a.isBuffer(t)))
  35781. return 0 === t.length ? -1 : I(e, t, i, n, r);
  35782. if ('number' == typeof t)
  35783. return (
  35784. (t &= 255),
  35785. a.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  35786. ? r
  35787. ? Uint8Array.prototype.indexOf.call(e, t, i)
  35788. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  35789. : I(e, [t], i, n, r)
  35790. );
  35791. throw new TypeError('val must be string, number or Buffer');
  35792. }
  35793. function I(e, t, i, n, r) {
  35794. function o(e, t) {
  35795. return 1 === a ? e[t] : e.readUInt16BE(t * a);
  35796. }
  35797. var a = 1,
  35798. s = e.length,
  35799. l = t.length;
  35800. if (
  35801. void 0 !== n &&
  35802. ((n = String(n).toLowerCase()),
  35803. 'ucs2' === n || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)
  35804. ) {
  35805. if (e.length < 2 || t.length < 2) return -1;
  35806. (a = 2), (s /= 2), (l /= 2), (i /= 2);
  35807. }
  35808. var c;
  35809. if (r) {
  35810. var h = -1;
  35811. for (c = i; c < s; c++)
  35812. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  35813. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a;
  35814. } else h !== -1 && (c -= c - h), (h = -1);
  35815. } else
  35816. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  35817. for (var u = !0, d = 0; d < l; d++)
  35818. if (o(e, c + d) !== o(t, d)) {
  35819. u = !1;
  35820. break;
  35821. }
  35822. if (u) return c;
  35823. }
  35824. return -1;
  35825. }
  35826. function E(e, t, i, n) {
  35827. i = Number(i) || 0;
  35828. var r = e.length - i;
  35829. n ? ((n = Number(n)), n > r && (n = r)) : (n = r);
  35830. var o = t.length;
  35831. if (o % 2 !== 0) throw new TypeError('Invalid hex string');
  35832. n > o / 2 && (n = o / 2);
  35833. for (var a = 0; a < n; ++a) {
  35834. var s = parseInt(t.substr(2 * a, 2), 16);
  35835. if (isNaN(s)) return a;
  35836. e[i + a] = s;
  35837. }
  35838. return a;
  35839. }
  35840. function b(e, t, i, n) {
  35841. return q(j(t, e.length - i), e, i, n);
  35842. }
  35843. function w(e, t, i, n) {
  35844. return q(Y(t), e, i, n);
  35845. }
  35846. function _(e, t, i, n) {
  35847. return w(e, t, i, n);
  35848. }
  35849. function T(e, t, i, n) {
  35850. return q(Z(t), e, i, n);
  35851. }
  35852. function x(e, t, i, n) {
  35853. return q(X(t, e.length - i), e, i, n);
  35854. }
  35855. function S(e, t, i) {
  35856. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i));
  35857. }
  35858. function M(e, t, i) {
  35859. i = Math.min(e.length, i);
  35860. for (var n = [], r = t; r < i; ) {
  35861. var o = e[r],
  35862. a = null,
  35863. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  35864. if (r + s <= i) {
  35865. var l, c, h, u;
  35866. switch (s) {
  35867. case 1:
  35868. o < 128 && (a = o);
  35869. break;
  35870. case 2:
  35871. (l = e[r + 1]),
  35872. 128 === (192 & l) && ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u));
  35873. break;
  35874. case 3:
  35875. (l = e[r + 1]),
  35876. (c = e[r + 2]),
  35877. 128 === (192 & l) &&
  35878. 128 === (192 & c) &&
  35879. ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)),
  35880. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  35881. break;
  35882. case 4:
  35883. (l = e[r + 1]),
  35884. (c = e[r + 2]),
  35885. (h = e[r + 3]),
  35886. 128 === (192 & l) &&
  35887. 128 === (192 & c) &&
  35888. 128 === (192 & h) &&
  35889. ((u = ((15 & o) << 18) | ((63 & l) << 12) | ((63 & c) << 6) | (63 & h)),
  35890. u > 65535 && u < 1114112 && (a = u));
  35891. }
  35892. }
  35893. null === a
  35894. ? ((a = 65533), (s = 1))
  35895. : a > 65535 &&
  35896. ((a -= 65536), n.push(((a >>> 10) & 1023) | 55296), (a = 56320 | (1023 & a))),
  35897. n.push(a),
  35898. (r += s);
  35899. }
  35900. return R(n);
  35901. }
  35902. function R(e) {
  35903. var t = e.length;
  35904. if (t <= ee) return String.fromCharCode.apply(String, e);
  35905. for (var i = '', n = 0; n < t; )
  35906. i += String.fromCharCode.apply(String, e.slice(n, (n += ee)));
  35907. return i;
  35908. }
  35909. function P(e, t, i) {
  35910. var n = '';
  35911. i = Math.min(e.length, i);
  35912. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r]);
  35913. return n;
  35914. }
  35915. function O(e, t, i) {
  35916. var n = '';
  35917. i = Math.min(e.length, i);
  35918. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r]);
  35919. return n;
  35920. }
  35921. function L(e, t, i) {
  35922. var n = e.length;
  35923. (!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n);
  35924. for (var r = '', o = t; o < i; ++o) r += W(e[o]);
  35925. return r;
  35926. }
  35927. function D(e, t, i) {
  35928. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2)
  35929. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  35930. return r;
  35931. }
  35932. function N(e, t, i) {
  35933. if (e % 1 !== 0 || e < 0) throw new RangeError('offset is not uint');
  35934. if (e + t > i) throw new RangeError('Trying to access beyond buffer length');
  35935. }
  35936. function B(e, t, i, n, r, o) {
  35937. if (!a.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
  35938. if (t > r || t < o) throw new RangeError('"value" argument is out of bounds');
  35939. if (i + n > e.length) throw new RangeError('Index out of range');
  35940. }
  35941. function F(e, t, i, n) {
  35942. t < 0 && (t = 65535 + t + 1);
  35943. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  35944. e[i + r] = (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r));
  35945. }
  35946. function V(e, t, i, n) {
  35947. t < 0 && (t = 4294967295 + t + 1);
  35948. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  35949. e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255;
  35950. }
  35951. function U(e, t, i, n, r, o) {
  35952. if (i + n > e.length) throw new RangeError('Index out of range');
  35953. if (i < 0) throw new RangeError('Index out of range');
  35954. }
  35955. function k(e, t, i, n, r) {
  35956. return (
  35957. r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  35958. J.write(e, t, i, n, 23, 4),
  35959. i + 4
  35960. );
  35961. }
  35962. function H(e, t, i, n, r) {
  35963. return (
  35964. r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  35965. J.write(e, t, i, n, 52, 8),
  35966. i + 8
  35967. );
  35968. }
  35969. function G(e) {
  35970. if (((e = z(e).replace(te, '')), e.length < 2)) return '';
  35971. for (; e.length % 4 !== 0; ) e += '=';
  35972. return e;
  35973. }
  35974. function z(e) {
  35975. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '');
  35976. }
  35977. function W(e) {
  35978. return e < 16 ? '0' + e.toString(16) : e.toString(16);
  35979. }
  35980. function j(e, t) {
  35981. t = t || 1 / 0;
  35982. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  35983. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  35984. if (!r) {
  35985. if (i > 56319) {
  35986. (t -= 3) > -1 && o.push(239, 191, 189);
  35987. continue;
  35988. }
  35989. if (a + 1 === n) {
  35990. (t -= 3) > -1 && o.push(239, 191, 189);
  35991. continue;
  35992. }
  35993. r = i;
  35994. continue;
  35995. }
  35996. if (i < 56320) {
  35997. (t -= 3) > -1 && o.push(239, 191, 189), (r = i);
  35998. continue;
  35999. }
  36000. i = (((r - 55296) << 10) | (i - 56320)) + 65536;
  36001. } else r && (t -= 3) > -1 && o.push(239, 191, 189);
  36002. if (((r = null), i < 128)) {
  36003. if ((t -= 1) < 0) break;
  36004. o.push(i);
  36005. } else if (i < 2048) {
  36006. if ((t -= 2) < 0) break;
  36007. o.push((i >> 6) | 192, (63 & i) | 128);
  36008. } else if (i < 65536) {
  36009. if ((t -= 3) < 0) break;
  36010. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128);
  36011. } else {
  36012. if (!(i < 1114112)) throw new Error('Invalid code point');
  36013. if ((t -= 4) < 0) break;
  36014. o.push(
  36015. (i >> 18) | 240,
  36016. ((i >> 12) & 63) | 128,
  36017. ((i >> 6) & 63) | 128,
  36018. (63 & i) | 128
  36019. );
  36020. }
  36021. }
  36022. return o;
  36023. }
  36024. function Y(e) {
  36025. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i));
  36026. return t;
  36027. }
  36028. function X(e, t) {
  36029. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  36030. (i = e.charCodeAt(a)), (n = i >> 8), (r = i % 256), o.push(r), o.push(n);
  36031. return o;
  36032. }
  36033. function Z(e) {
  36034. return Q.toByteArray(G(e));
  36035. }
  36036. function q(e, t, i, n) {
  36037. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r];
  36038. return r;
  36039. }
  36040. function K(e) {
  36041. return e !== e;
  36042. }
  36043. var Q = e('base64-js'),
  36044. J = e('ieee754'),
  36045. $ = e('isarray');
  36046. (i.Buffer = a),
  36047. (i.SlowBuffer = m),
  36048. (i.INSPECT_MAX_BYTES = 50),
  36049. (a.TYPED_ARRAY_SUPPORT =
  36050. void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  36051. (i.kMaxLength = r()),
  36052. (a.poolSize = 8192),
  36053. (a._augment = function (e) {
  36054. return (e.__proto__ = a.prototype), e;
  36055. }),
  36056. (a.from = function (e, t, i) {
  36057. return s(null, e, t, i);
  36058. }),
  36059. a.TYPED_ARRAY_SUPPORT &&
  36060. ((a.prototype.__proto__ = Uint8Array.prototype),
  36061. (a.__proto__ = Uint8Array),
  36062. 'undefined' != typeof Symbol &&
  36063. Symbol.species &&
  36064. a[Symbol.species] === a &&
  36065. Object.defineProperty(a, Symbol.species, {
  36066. value: null,
  36067. configurable: !0,
  36068. })),
  36069. (a.alloc = function (e, t, i) {
  36070. return c(null, e, t, i);
  36071. }),
  36072. (a.allocUnsafe = function (e) {
  36073. return h(null, e);
  36074. }),
  36075. (a.allocUnsafeSlow = function (e) {
  36076. return h(null, e);
  36077. }),
  36078. (a.isBuffer = function (e) {
  36079. return !(null == e || !e._isBuffer);
  36080. }),
  36081. (a.compare = function (e, t) {
  36082. if (!a.isBuffer(e) || !a.isBuffer(t))
  36083. throw new TypeError('Arguments must be Buffers');
  36084. if (e === t) return 0;
  36085. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  36086. if (e[r] !== t[r]) {
  36087. (i = e[r]), (n = t[r]);
  36088. break;
  36089. }
  36090. return i < n ? -1 : n < i ? 1 : 0;
  36091. }),
  36092. (a.isEncoding = function (e) {
  36093. switch (String(e).toLowerCase()) {
  36094. case 'hex':
  36095. case 'utf8':
  36096. case 'utf-8':
  36097. case 'ascii':
  36098. case 'latin1':
  36099. case 'binary':
  36100. case 'base64':
  36101. case 'ucs2':
  36102. case 'ucs-2':
  36103. case 'utf16le':
  36104. case 'utf-16le':
  36105. return !0;
  36106. default:
  36107. return !1;
  36108. }
  36109. }),
  36110. (a.concat = function (e, t) {
  36111. if (!$(e)) throw new TypeError('"list" argument must be an Array of Buffers');
  36112. if (0 === e.length) return a.alloc(0);
  36113. var i;
  36114. if (void 0 === t) for (t = 0, i = 0; i < e.length; ++i) t += e[i].length;
  36115. var n = a.allocUnsafe(t),
  36116. r = 0;
  36117. for (i = 0; i < e.length; ++i) {
  36118. var o = e[i];
  36119. if (!a.isBuffer(o))
  36120. throw new TypeError('"list" argument must be an Array of Buffers');
  36121. o.copy(n, r), (r += o.length);
  36122. }
  36123. return n;
  36124. }),
  36125. (a.byteLength = v),
  36126. (a.prototype._isBuffer = !0),
  36127. (a.prototype.swap16 = function () {
  36128. var e = this.length;
  36129. if (e % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits');
  36130. for (var t = 0; t < e; t += 2) y(this, t, t + 1);
  36131. return this;
  36132. }),
  36133. (a.prototype.swap32 = function () {
  36134. var e = this.length;
  36135. if (e % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits');
  36136. for (var t = 0; t < e; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2);
  36137. return this;
  36138. }),
  36139. (a.prototype.swap64 = function () {
  36140. var e = this.length;
  36141. if (e % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits');
  36142. for (var t = 0; t < e; t += 8)
  36143. y(this, t, t + 7),
  36144. y(this, t + 1, t + 6),
  36145. y(this, t + 2, t + 5),
  36146. y(this, t + 3, t + 4);
  36147. return this;
  36148. }),
  36149. (a.prototype.toString = function () {
  36150. var e = 0 | this.length;
  36151. return 0 === e
  36152. ? ''
  36153. : 0 === arguments.length
  36154. ? M(this, 0, e)
  36155. : A.apply(this, arguments);
  36156. }),
  36157. (a.prototype.equals = function (e) {
  36158. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer');
  36159. return this === e || 0 === a.compare(this, e);
  36160. }),
  36161. (a.prototype.inspect = function () {
  36162. var e = '',
  36163. t = i.INSPECT_MAX_BYTES;
  36164. return (
  36165. this.length > 0 &&
  36166. ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')),
  36167. this.length > t && (e += ' ... ')),
  36168. '<Buffer ' + e + '>'
  36169. );
  36170. }),
  36171. (a.prototype.compare = function (e, t, i, n, r) {
  36172. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer');
  36173. if (
  36174. (void 0 === t && (t = 0),
  36175. void 0 === i && (i = e ? e.length : 0),
  36176. void 0 === n && (n = 0),
  36177. void 0 === r && (r = this.length),
  36178. t < 0 || i > e.length || n < 0 || r > this.length)
  36179. )
  36180. throw new RangeError('out of range index');
  36181. if (n >= r && t >= i) return 0;
  36182. if (n >= r) return -1;
  36183. if (t >= i) return 1;
  36184. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e)) return 0;
  36185. for (
  36186. var o = r - n,
  36187. s = i - t,
  36188. l = Math.min(o, s),
  36189. c = this.slice(n, r),
  36190. h = e.slice(t, i),
  36191. u = 0;
  36192. u < l;
  36193. ++u
  36194. )
  36195. if (c[u] !== h[u]) {
  36196. (o = c[u]), (s = h[u]);
  36197. break;
  36198. }
  36199. return o < s ? -1 : s < o ? 1 : 0;
  36200. }),
  36201. (a.prototype.includes = function (e, t, i) {
  36202. return this.indexOf(e, t, i) !== -1;
  36203. }),
  36204. (a.prototype.indexOf = function (e, t, i) {
  36205. return C(this, e, t, i, !0);
  36206. }),
  36207. (a.prototype.lastIndexOf = function (e, t, i) {
  36208. return C(this, e, t, i, !1);
  36209. }),
  36210. (a.prototype.write = function (e, t, i, n) {
  36211. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0);
  36212. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0);
  36213. else {
  36214. if (!isFinite(t))
  36215. throw new Error(
  36216. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  36217. );
  36218. (t |= 0),
  36219. isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0));
  36220. }
  36221. var r = this.length - t;
  36222. if (
  36223. ((void 0 === i || i > r) && (i = r),
  36224. (e.length > 0 && (i < 0 || t < 0)) || t > this.length)
  36225. )
  36226. throw new RangeError('Attempt to write outside buffer bounds');
  36227. n || (n = 'utf8');
  36228. for (var o = !1; ; )
  36229. switch (n) {
  36230. case 'hex':
  36231. return E(this, e, t, i);
  36232. case 'utf8':
  36233. case 'utf-8':
  36234. return b(this, e, t, i);
  36235. case 'ascii':
  36236. return w(this, e, t, i);
  36237. case 'latin1':
  36238. case 'binary':
  36239. return _(this, e, t, i);
  36240. case 'base64':
  36241. return T(this, e, t, i);
  36242. case 'ucs2':
  36243. case 'ucs-2':
  36244. case 'utf16le':
  36245. case 'utf-16le':
  36246. return x(this, e, t, i);
  36247. default:
  36248. if (o) throw new TypeError('Unknown encoding: ' + n);
  36249. (n = ('' + n).toLowerCase()), (o = !0);
  36250. }
  36251. }),
  36252. (a.prototype.toJSON = function () {
  36253. return {
  36254. type: 'Buffer',
  36255. data: Array.prototype.slice.call(this._arr || this, 0),
  36256. };
  36257. });
  36258. var ee = 4096;
  36259. (a.prototype.slice = function (e, t) {
  36260. var i = this.length;
  36261. (e = ~~e),
  36262. (t = void 0 === t ? i : ~~t),
  36263. e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i),
  36264. t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i),
  36265. t < e && (t = e);
  36266. var n;
  36267. if (a.TYPED_ARRAY_SUPPORT) (n = this.subarray(e, t)), (n.__proto__ = a.prototype);
  36268. else {
  36269. var r = t - e;
  36270. n = new a(r, void 0);
  36271. for (var o = 0; o < r; ++o) n[o] = this[o + e];
  36272. }
  36273. return n;
  36274. }),
  36275. (a.prototype.readUIntLE = function (e, t, i) {
  36276. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36277. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r;
  36278. return n;
  36279. }),
  36280. (a.prototype.readUIntBE = function (e, t, i) {
  36281. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36282. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); ) n += this[e + --t] * r;
  36283. return n;
  36284. }),
  36285. (a.prototype.readUInt8 = function (e, t) {
  36286. return t || N(e, 1, this.length), this[e];
  36287. }),
  36288. (a.prototype.readUInt16LE = function (e, t) {
  36289. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8);
  36290. }),
  36291. (a.prototype.readUInt16BE = function (e, t) {
  36292. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1];
  36293. }),
  36294. (a.prototype.readUInt32LE = function (e, t) {
  36295. return (
  36296. t || N(e, 4, this.length),
  36297. (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  36298. );
  36299. }),
  36300. (a.prototype.readUInt32BE = function (e, t) {
  36301. return (
  36302. t || N(e, 4, this.length),
  36303. 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  36304. );
  36305. }),
  36306. (a.prototype.readIntLE = function (e, t, i) {
  36307. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36308. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r;
  36309. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n;
  36310. }),
  36311. (a.prototype.readIntBE = function (e, t, i) {
  36312. (e |= 0), (t |= 0), i || N(e, t, this.length);
  36313. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  36314. o += this[e + --n] * r;
  36315. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o;
  36316. }),
  36317. (a.prototype.readInt8 = function (e, t) {
  36318. return t || N(e, 1, this.length), 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e];
  36319. }),
  36320. (a.prototype.readInt16LE = function (e, t) {
  36321. t || N(e, 2, this.length);
  36322. var i = this[e] | (this[e + 1] << 8);
  36323. return 32768 & i ? 4294901760 | i : i;
  36324. }),
  36325. (a.prototype.readInt16BE = function (e, t) {
  36326. t || N(e, 2, this.length);
  36327. var i = this[e + 1] | (this[e] << 8);
  36328. return 32768 & i ? 4294901760 | i : i;
  36329. }),
  36330. (a.prototype.readInt32LE = function (e, t) {
  36331. return (
  36332. t || N(e, 4, this.length),
  36333. this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  36334. );
  36335. }),
  36336. (a.prototype.readInt32BE = function (e, t) {
  36337. return (
  36338. t || N(e, 4, this.length),
  36339. (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  36340. );
  36341. }),
  36342. (a.prototype.readFloatLE = function (e, t) {
  36343. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4);
  36344. }),
  36345. (a.prototype.readFloatBE = function (e, t) {
  36346. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4);
  36347. }),
  36348. (a.prototype.readDoubleLE = function (e, t) {
  36349. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8);
  36350. }),
  36351. (a.prototype.readDoubleBE = function (e, t) {
  36352. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8);
  36353. }),
  36354. (a.prototype.writeUIntLE = function (e, t, i, n) {
  36355. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36356. var r = Math.pow(2, 8 * i) - 1;
  36357. B(this, e, t, i, r, 0);
  36358. }
  36359. var o = 1,
  36360. a = 0;
  36361. for (this[t] = 255 & e; ++a < i && (o *= 256); ) this[t + a] = (e / o) & 255;
  36362. return t + i;
  36363. }),
  36364. (a.prototype.writeUIntBE = function (e, t, i, n) {
  36365. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36366. var r = Math.pow(2, 8 * i) - 1;
  36367. B(this, e, t, i, r, 0);
  36368. }
  36369. var o = i - 1,
  36370. a = 1;
  36371. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) this[t + o] = (e / a) & 255;
  36372. return t + i;
  36373. }),
  36374. (a.prototype.writeUInt8 = function (e, t, i) {
  36375. return (
  36376. (e = +e),
  36377. (t |= 0),
  36378. i || B(this, e, t, 1, 255, 0),
  36379. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36380. (this[t] = 255 & e),
  36381. t + 1
  36382. );
  36383. }),
  36384. (a.prototype.writeUInt16LE = function (e, t, i) {
  36385. return (
  36386. (e = +e),
  36387. (t |= 0),
  36388. i || B(this, e, t, 2, 65535, 0),
  36389. a.TYPED_ARRAY_SUPPORT
  36390. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36391. : F(this, e, t, !0),
  36392. t + 2
  36393. );
  36394. }),
  36395. (a.prototype.writeUInt16BE = function (e, t, i) {
  36396. return (
  36397. (e = +e),
  36398. (t |= 0),
  36399. i || B(this, e, t, 2, 65535, 0),
  36400. a.TYPED_ARRAY_SUPPORT
  36401. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36402. : F(this, e, t, !1),
  36403. t + 2
  36404. );
  36405. }),
  36406. (a.prototype.writeUInt32LE = function (e, t, i) {
  36407. return (
  36408. (e = +e),
  36409. (t |= 0),
  36410. i || B(this, e, t, 4, 4294967295, 0),
  36411. a.TYPED_ARRAY_SUPPORT
  36412. ? ((this[t + 3] = e >>> 24),
  36413. (this[t + 2] = e >>> 16),
  36414. (this[t + 1] = e >>> 8),
  36415. (this[t] = 255 & e))
  36416. : V(this, e, t, !0),
  36417. t + 4
  36418. );
  36419. }),
  36420. (a.prototype.writeUInt32BE = function (e, t, i) {
  36421. return (
  36422. (e = +e),
  36423. (t |= 0),
  36424. i || B(this, e, t, 4, 4294967295, 0),
  36425. a.TYPED_ARRAY_SUPPORT
  36426. ? ((this[t] = e >>> 24),
  36427. (this[t + 1] = e >>> 16),
  36428. (this[t + 2] = e >>> 8),
  36429. (this[t + 3] = 255 & e))
  36430. : V(this, e, t, !1),
  36431. t + 4
  36432. );
  36433. }),
  36434. (a.prototype.writeIntLE = function (e, t, i, n) {
  36435. if (((e = +e), (t |= 0), !n)) {
  36436. var r = Math.pow(2, 8 * i - 1);
  36437. B(this, e, t, i, r - 1, -r);
  36438. }
  36439. var o = 0,
  36440. a = 1,
  36441. s = 0;
  36442. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  36443. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  36444. (this[t + o] = (((e / a) >> 0) - s) & 255);
  36445. return t + i;
  36446. }),
  36447. (a.prototype.writeIntBE = function (e, t, i, n) {
  36448. if (((e = +e), (t |= 0), !n)) {
  36449. var r = Math.pow(2, 8 * i - 1);
  36450. B(this, e, t, i, r - 1, -r);
  36451. }
  36452. var o = i - 1,
  36453. a = 1,
  36454. s = 0;
  36455. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  36456. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  36457. (this[t + o] = (((e / a) >> 0) - s) & 255);
  36458. return t + i;
  36459. }),
  36460. (a.prototype.writeInt8 = function (e, t, i) {
  36461. return (
  36462. (e = +e),
  36463. (t |= 0),
  36464. i || B(this, e, t, 1, 127, -128),
  36465. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36466. e < 0 && (e = 255 + e + 1),
  36467. (this[t] = 255 & e),
  36468. t + 1
  36469. );
  36470. }),
  36471. (a.prototype.writeInt16LE = function (e, t, i) {
  36472. return (
  36473. (e = +e),
  36474. (t |= 0),
  36475. i || B(this, e, t, 2, 32767, -32768),
  36476. a.TYPED_ARRAY_SUPPORT
  36477. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36478. : F(this, e, t, !0),
  36479. t + 2
  36480. );
  36481. }),
  36482. (a.prototype.writeInt16BE = function (e, t, i) {
  36483. return (
  36484. (e = +e),
  36485. (t |= 0),
  36486. i || B(this, e, t, 2, 32767, -32768),
  36487. a.TYPED_ARRAY_SUPPORT
  36488. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36489. : F(this, e, t, !1),
  36490. t + 2
  36491. );
  36492. }),
  36493. (a.prototype.writeInt32LE = function (e, t, i) {
  36494. return (
  36495. (e = +e),
  36496. (t |= 0),
  36497. i || B(this, e, t, 4, 2147483647, -2147483648),
  36498. a.TYPED_ARRAY_SUPPORT
  36499. ? ((this[t] = 255 & e),
  36500. (this[t + 1] = e >>> 8),
  36501. (this[t + 2] = e >>> 16),
  36502. (this[t + 3] = e >>> 24))
  36503. : V(this, e, t, !0),
  36504. t + 4
  36505. );
  36506. }),
  36507. (a.prototype.writeInt32BE = function (e, t, i) {
  36508. return (
  36509. (e = +e),
  36510. (t |= 0),
  36511. i || B(this, e, t, 4, 2147483647, -2147483648),
  36512. e < 0 && (e = 4294967295 + e + 1),
  36513. a.TYPED_ARRAY_SUPPORT
  36514. ? ((this[t] = e >>> 24),
  36515. (this[t + 1] = e >>> 16),
  36516. (this[t + 2] = e >>> 8),
  36517. (this[t + 3] = 255 & e))
  36518. : V(this, e, t, !1),
  36519. t + 4
  36520. );
  36521. }),
  36522. (a.prototype.writeFloatLE = function (e, t, i) {
  36523. return k(this, e, t, !0, i);
  36524. }),
  36525. (a.prototype.writeFloatBE = function (e, t, i) {
  36526. return k(this, e, t, !1, i);
  36527. }),
  36528. (a.prototype.writeDoubleLE = function (e, t, i) {
  36529. return H(this, e, t, !0, i);
  36530. }),
  36531. (a.prototype.writeDoubleBE = function (e, t, i) {
  36532. return H(this, e, t, !1, i);
  36533. }),
  36534. (a.prototype.copy = function (e, t, i, n) {
  36535. if (
  36536. (i || (i = 0),
  36537. n || 0 === n || (n = this.length),
  36538. t >= e.length && (t = e.length),
  36539. t || (t = 0),
  36540. n > 0 && n < i && (n = i),
  36541. n === i)
  36542. )
  36543. return 0;
  36544. if (0 === e.length || 0 === this.length) return 0;
  36545. if (t < 0) throw new RangeError('targetStart out of bounds');
  36546. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds');
  36547. if (n < 0) throw new RangeError('sourceEnd out of bounds');
  36548. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i);
  36549. var r,
  36550. o = n - i;
  36551. if (this === e && i < t && t < n) for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i];
  36552. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  36553. for (r = 0; r < o; ++r) e[r + t] = this[r + i];
  36554. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  36555. return o;
  36556. }),
  36557. (a.prototype.fill = function (e, t, i, n) {
  36558. if ('string' == typeof e) {
  36559. if (
  36560. ('string' == typeof t
  36561. ? ((n = t), (t = 0), (i = this.length))
  36562. : 'string' == typeof i && ((n = i), (i = this.length)),
  36563. 1 === e.length)
  36564. ) {
  36565. var r = e.charCodeAt(0);
  36566. r < 256 && (e = r);
  36567. }
  36568. if (void 0 !== n && 'string' != typeof n)
  36569. throw new TypeError('encoding must be a string');
  36570. if ('string' == typeof n && !a.isEncoding(n))
  36571. throw new TypeError('Unknown encoding: ' + n);
  36572. } else 'number' == typeof e && (e &= 255);
  36573. if (t < 0 || this.length < t || this.length < i)
  36574. throw new RangeError('Out of range index');
  36575. if (i <= t) return this;
  36576. (t >>>= 0), (i = void 0 === i ? this.length : i >>> 0), e || (e = 0);
  36577. var o;
  36578. if ('number' == typeof e) for (o = t; o < i; ++o) this[o] = e;
  36579. else {
  36580. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  36581. l = s.length;
  36582. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l];
  36583. }
  36584. return this;
  36585. });
  36586. var te = /[^+\/0-9A-Za-z-_]/g;
  36587. }.call(
  36588. this,
  36589. 'undefined' != typeof global
  36590. ? global
  36591. : 'undefined' != typeof self
  36592. ? self
  36593. : 'undefined' != typeof window
  36594. ? window
  36595. : {}
  36596. ));
  36597. },
  36598. {
  36599. 'base64-js': 199,
  36600. ieee754: 200,
  36601. isarray: 201,
  36602. },
  36603. ],
  36604. 199: [
  36605. function (e, t, i) {
  36606. 'use strict';
  36607. function n(e) {
  36608. var t = e.length;
  36609. if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4');
  36610. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0;
  36611. }
  36612. function r(e) {
  36613. return (3 * e.length) / 4 - n(e);
  36614. }
  36615. function o(e) {
  36616. var t,
  36617. i,
  36618. r,
  36619. o,
  36620. a,
  36621. s,
  36622. l = e.length;
  36623. (a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l);
  36624. var c = 0;
  36625. for (t = 0, i = 0; t < r; t += 4, i += 3)
  36626. (o =
  36627. (h[e.charCodeAt(t)] << 18) |
  36628. (h[e.charCodeAt(t + 1)] << 12) |
  36629. (h[e.charCodeAt(t + 2)] << 6) |
  36630. h[e.charCodeAt(t + 3)]),
  36631. (s[c++] = (o >> 16) & 255),
  36632. (s[c++] = (o >> 8) & 255),
  36633. (s[c++] = 255 & o);
  36634. return (
  36635. 2 === a
  36636. ? ((o = (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)),
  36637. (s[c++] = 255 & o))
  36638. : 1 === a &&
  36639. ((o =
  36640. (h[e.charCodeAt(t)] << 10) |
  36641. (h[e.charCodeAt(t + 1)] << 4) |
  36642. (h[e.charCodeAt(t + 2)] >> 2)),
  36643. (s[c++] = (o >> 8) & 255),
  36644. (s[c++] = 255 & o)),
  36645. s
  36646. );
  36647. }
  36648. function a(e) {
  36649. return c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e];
  36650. }
  36651. function s(e, t, i) {
  36652. for (var n, r = [], o = t; o < i; o += 3)
  36653. (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n));
  36654. return r.join('');
  36655. }
  36656. function l(e) {
  36657. for (
  36658. var t, i = e.length, n = i % 3, r = '', o = [], a = 16383, l = 0, h = i - n;
  36659. l < h;
  36660. l += a
  36661. )
  36662. o.push(s(e, l, l + a > h ? h : l + a));
  36663. return (
  36664. 1 === n
  36665. ? ((t = e[i - 1]), (r += c[t >> 2]), (r += c[(t << 4) & 63]), (r += '=='))
  36666. : 2 === n &&
  36667. ((t = (e[i - 2] << 8) + e[i - 1]),
  36668. (r += c[t >> 10]),
  36669. (r += c[(t >> 4) & 63]),
  36670. (r += c[(t << 2) & 63]),
  36671. (r += '=')),
  36672. o.push(r),
  36673. o.join('')
  36674. );
  36675. }
  36676. (i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l);
  36677. for (
  36678. var c = [],
  36679. h = [],
  36680. u = 'undefined' != typeof Uint8Array ? Uint8Array : Array,
  36681. d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
  36682. p = 0,
  36683. f = d.length;
  36684. p < f;
  36685. ++p
  36686. )
  36687. (c[p] = d[p]), (h[d.charCodeAt(p)] = p);
  36688. (h['-'.charCodeAt(0)] = 62), (h['_'.charCodeAt(0)] = 63);
  36689. },
  36690. {},
  36691. ],
  36692. 200: [
  36693. function (e, t, i) {
  36694. (i.read = function (e, t, i, n, r) {
  36695. var o,
  36696. a,
  36697. s = 8 * r - n - 1,
  36698. l = (1 << s) - 1,
  36699. c = l >> 1,
  36700. h = -7,
  36701. u = i ? r - 1 : 0,
  36702. d = i ? -1 : 1,
  36703. p = e[t + u];
  36704. for (
  36705. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  36706. h > 0;
  36707. o = 256 * o + e[t + u], u += d, h -= 8
  36708. );
  36709. for (
  36710. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  36711. h > 0;
  36712. a = 256 * a + e[t + u], u += d, h -= 8
  36713. );
  36714. if (0 === o) o = 1 - c;
  36715. else {
  36716. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36717. (a += Math.pow(2, n)), (o -= c);
  36718. }
  36719. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  36720. }),
  36721. (i.write = function (e, t, i, n, r, o) {
  36722. var a,
  36723. s,
  36724. l,
  36725. c = 8 * o - r - 1,
  36726. h = (1 << c) - 1,
  36727. u = h >> 1,
  36728. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  36729. p = n ? 0 : o - 1,
  36730. f = n ? 1 : -1,
  36731. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  36732. for (
  36733. t = Math.abs(t),
  36734. isNaN(t) || t === 1 / 0
  36735. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  36736. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  36737. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  36738. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  36739. t * l >= 2 && (a++, (l /= 2)),
  36740. a + u >= h
  36741. ? ((s = 0), (a = h))
  36742. : a + u >= 1
  36743. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  36744. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  36745. r >= 8;
  36746. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  36747. );
  36748. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  36749. e[i + p - f] |= 128 * g;
  36750. });
  36751. },
  36752. {},
  36753. ],
  36754. 201: [
  36755. function (e, t, i) {
  36756. var n = {}.toString;
  36757. t.exports =
  36758. Array.isArray ||
  36759. function (e) {
  36760. return '[object Array]' == n.call(e);
  36761. };
  36762. },
  36763. {},
  36764. ],
  36765. 202: [
  36766. function (e, t, i) {
  36767. function n() {
  36768. (this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0);
  36769. }
  36770. function r(e) {
  36771. return 'function' == typeof e;
  36772. }
  36773. function o(e) {
  36774. return 'number' == typeof e;
  36775. }
  36776. function a(e) {
  36777. return 'object' == typeof e && null !== e;
  36778. }
  36779. function s(e) {
  36780. return void 0 === e;
  36781. }
  36782. (t.exports = n),
  36783. (n.EventEmitter = n),
  36784. (n.prototype._events = void 0),
  36785. (n.prototype._maxListeners = void 0),
  36786. (n.defaultMaxListeners = 10),
  36787. (n.prototype.setMaxListeners = function (e) {
  36788. if (!o(e) || e < 0 || isNaN(e)) throw TypeError('n must be a positive number');
  36789. return (this._maxListeners = e), this;
  36790. }),
  36791. (n.prototype.emit = function (e) {
  36792. var t, i, n, o, l, c;
  36793. if (
  36794. (this._events || (this._events = {}),
  36795. 'error' === e &&
  36796. (!this._events.error || (a(this._events.error) && !this._events.error.length)))
  36797. ) {
  36798. if (((t = arguments[1]), t instanceof Error)) throw t;
  36799. var h = new Error('Uncaught, unspecified "error" event. (' + t + ')');
  36800. throw ((h.context = t), h);
  36801. }
  36802. if (((i = this._events[e]), s(i))) return !1;
  36803. if (r(i))
  36804. switch (arguments.length) {
  36805. case 1:
  36806. i.call(this);
  36807. break;
  36808. case 2:
  36809. i.call(this, arguments[1]);
  36810. break;
  36811. case 3:
  36812. i.call(this, arguments[1], arguments[2]);
  36813. break;
  36814. default:
  36815. (o = Array.prototype.slice.call(arguments, 1)), i.apply(this, o);
  36816. }
  36817. else if (a(i))
  36818. for (
  36819. o = Array.prototype.slice.call(arguments, 1), c = i.slice(), n = c.length, l = 0;
  36820. l < n;
  36821. l++
  36822. )
  36823. c[l].apply(this, o);
  36824. return !0;
  36825. }),
  36826. (n.prototype.addListener = function (e, t) {
  36827. var i;
  36828. if (!r(t)) throw TypeError('listener must be a function');
  36829. return (
  36830. this._events || (this._events = {}),
  36831. this._events.newListener &&
  36832. this.emit('newListener', e, r(t.listener) ? t.listener : t),
  36833. this._events[e]
  36834. ? a(this._events[e])
  36835. ? this._events[e].push(t)
  36836. : (this._events[e] = [this._events[e], t])
  36837. : (this._events[e] = t),
  36838. a(this._events[e]) &&
  36839. !this._events[e].warned &&
  36840. ((i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners),
  36841. i &&
  36842. i > 0 &&
  36843. this._events[e].length > i &&
  36844. ((this._events[e].warned = !0),
  36845. console.error(
  36846. '(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.',
  36847. this._events[e].length
  36848. ),
  36849. 'function' == typeof console.trace && console.trace())),
  36850. this
  36851. );
  36852. }),
  36853. (n.prototype.on = n.prototype.addListener),
  36854. (n.prototype.once = function (e, t) {
  36855. function i() {
  36856. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments));
  36857. }
  36858. if (!r(t)) throw TypeError('listener must be a function');
  36859. var n = !1;
  36860. return (i.listener = t), this.on(e, i), this;
  36861. }),
  36862. (n.prototype.removeListener = function (e, t) {
  36863. var i, n, o, s;
  36864. if (!r(t)) throw TypeError('listener must be a function');
  36865. if (!this._events || !this._events[e]) return this;
  36866. if (
  36867. ((i = this._events[e]),
  36868. (o = i.length),
  36869. (n = -1),
  36870. i === t || (r(i.listener) && i.listener === t))
  36871. )
  36872. delete this._events[e],
  36873. this._events.removeListener && this.emit('removeListener', e, t);
  36874. else if (a(i)) {
  36875. for (s = o; s-- > 0; )
  36876. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  36877. n = s;
  36878. break;
  36879. }
  36880. if (n < 0) return this;
  36881. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1),
  36882. this._events.removeListener && this.emit('removeListener', e, t);
  36883. }
  36884. return this;
  36885. }),
  36886. (n.prototype.removeAllListeners = function (e) {
  36887. var t, i;
  36888. if (!this._events) return this;
  36889. if (!this._events.removeListener)
  36890. return (
  36891. 0 === arguments.length
  36892. ? (this._events = {})
  36893. : this._events[e] && delete this._events[e],
  36894. this
  36895. );
  36896. if (0 === arguments.length) {
  36897. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t);
  36898. return this.removeAllListeners('removeListener'), (this._events = {}), this;
  36899. }
  36900. if (((i = this._events[e]), r(i))) this.removeListener(e, i);
  36901. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1]);
  36902. return delete this._events[e], this;
  36903. }),
  36904. (n.prototype.listeners = function (e) {
  36905. var t;
  36906. return (t =
  36907. this._events && this._events[e]
  36908. ? r(this._events[e])
  36909. ? [this._events[e]]
  36910. : this._events[e].slice()
  36911. : []);
  36912. }),
  36913. (n.prototype.listenerCount = function (e) {
  36914. if (this._events) {
  36915. var t = this._events[e];
  36916. if (r(t)) return 1;
  36917. if (t) return t.length;
  36918. }
  36919. return 0;
  36920. }),
  36921. (n.listenerCount = function (e, t) {
  36922. return e.listenerCount(t);
  36923. });
  36924. },
  36925. {},
  36926. ],
  36927. 203: [
  36928. function (e, t, i) {
  36929. function n() {
  36930. throw new Error('setTimeout has not been defined');
  36931. }
  36932. function r() {
  36933. throw new Error('clearTimeout has not been defined');
  36934. }
  36935. function o(e) {
  36936. if (u === setTimeout) return setTimeout(e, 0);
  36937. if ((u === n || !u) && setTimeout) return (u = setTimeout), setTimeout(e, 0);
  36938. try {
  36939. return u(e, 0);
  36940. } catch (t) {
  36941. try {
  36942. return u.call(null, e, 0);
  36943. } catch (t) {
  36944. return u.call(this, e, 0);
  36945. }
  36946. }
  36947. }
  36948. function a(e) {
  36949. if (d === clearTimeout) return clearTimeout(e);
  36950. if ((d === r || !d) && clearTimeout) return (d = clearTimeout), clearTimeout(e);
  36951. try {
  36952. return d(e);
  36953. } catch (t) {
  36954. try {
  36955. return d.call(null, e);
  36956. } catch (t) {
  36957. return d.call(this, e);
  36958. }
  36959. }
  36960. }
  36961. function s() {
  36962. m && f && ((m = !1), f.length ? (g = f.concat(g)) : (v = -1), g.length && l());
  36963. }
  36964. function l() {
  36965. if (!m) {
  36966. var e = o(s);
  36967. m = !0;
  36968. for (var t = g.length; t; ) {
  36969. for (f = g, g = []; ++v < t; ) f && f[v].run();
  36970. (v = -1), (t = g.length);
  36971. }
  36972. (f = null), (m = !1), a(e);
  36973. }
  36974. }
  36975. function c(e, t) {
  36976. (this.fun = e), (this.array = t);
  36977. }
  36978. function h() {}
  36979. var u,
  36980. d,
  36981. p = (t.exports = {});
  36982. !(function () {
  36983. try {
  36984. u = 'function' == typeof setTimeout ? setTimeout : n;
  36985. } catch (e) {
  36986. u = n;
  36987. }
  36988. try {
  36989. d = 'function' == typeof clearTimeout ? clearTimeout : r;
  36990. } catch (e) {
  36991. d = r;
  36992. }
  36993. })();
  36994. var f,
  36995. g = [],
  36996. m = !1,
  36997. v = -1;
  36998. (p.nextTick = function (e) {
  36999. var t = new Array(arguments.length - 1);
  37000. if (arguments.length > 1)
  37001. for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
  37002. g.push(new c(e, t)), 1 !== g.length || m || o(l);
  37003. }),
  37004. (c.prototype.run = function () {
  37005. this.fun.apply(null, this.array);
  37006. }),
  37007. (p.title = 'browser'),
  37008. (p.browser = !0),
  37009. (p.env = {}),
  37010. (p.argv = []),
  37011. (p.version = ''),
  37012. (p.versions = {}),
  37013. (p.on = h),
  37014. (p.addListener = h),
  37015. (p.once = h),
  37016. (p.off = h),
  37017. (p.removeListener = h),
  37018. (p.removeAllListeners = h),
  37019. (p.emit = h),
  37020. (p.binding = function (e) {
  37021. throw new Error('process.binding is not supported');
  37022. }),
  37023. (p.cwd = function () {
  37024. return '/';
  37025. }),
  37026. (p.chdir = function (e) {
  37027. throw new Error('process.chdir is not supported');
  37028. }),
  37029. (p.umask = function () {
  37030. return 0;
  37031. });
  37032. },
  37033. {},
  37034. ],
  37035. 204: [
  37036. function (e, t, i) {
  37037. (function (e) {
  37038. !(function (n) {
  37039. function r(e) {
  37040. throw new RangeError(L[e]);
  37041. }
  37042. function o(e, t) {
  37043. for (var i = e.length, n = []; i--; ) n[i] = t(e[i]);
  37044. return n;
  37045. }
  37046. function a(e, t) {
  37047. var i = e.split('@'),
  37048. n = '';
  37049. i.length > 1 && ((n = i[0] + '@'), (e = i[1])), (e = e.replace(O, '.'));
  37050. var r = e.split('.'),
  37051. a = o(r, t).join('.');
  37052. return n + a;
  37053. }
  37054. function s(e) {
  37055. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  37056. (t = e.charCodeAt(r++)),
  37057. t >= 55296 && t <= 56319 && r < o
  37058. ? ((i = e.charCodeAt(r++)),
  37059. 56320 == (64512 & i)
  37060. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  37061. : (n.push(t), r--))
  37062. : n.push(t);
  37063. return n;
  37064. }
  37065. function l(e) {
  37066. return o(e, function (e) {
  37067. var t = '';
  37068. return (
  37069. e > 65535 &&
  37070. ((e -= 65536), (t += B(((e >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))),
  37071. (t += B(e))
  37072. );
  37073. }).join('');
  37074. }
  37075. function c(e) {
  37076. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E;
  37077. }
  37078. function h(e, t) {
  37079. return e + 22 + 75 * (e < 26) - ((0 != t) << 5);
  37080. }
  37081. function u(e, t, i) {
  37082. var n = 0;
  37083. for (e = i ? N(e / T) : e >> 1, e += N(e / t); e > (D * w) >> 1; n += E) e = N(e / D);
  37084. return N(n + ((D + 1) * e) / (e + _));
  37085. }
  37086. function d(e) {
  37087. var t,
  37088. i,
  37089. n,
  37090. o,
  37091. a,
  37092. s,
  37093. h,
  37094. d,
  37095. p,
  37096. f,
  37097. g = [],
  37098. m = e.length,
  37099. v = 0,
  37100. A = S,
  37101. y = x;
  37102. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n)
  37103. e.charCodeAt(n) >= 128 && r('not-basic'), g.push(e.charCodeAt(n));
  37104. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  37105. for (
  37106. a = v, s = 1, h = E;
  37107. o >= m && r('invalid-input'),
  37108. (d = c(e.charCodeAt(o++))),
  37109. (d >= E || d > N((I - v) / s)) && r('overflow'),
  37110. (v += d * s),
  37111. (p = h <= y ? b : h >= y + w ? w : h - y),
  37112. !(d < p);
  37113. h += E
  37114. )
  37115. (f = E - p), s > N(I / f) && r('overflow'), (s *= f);
  37116. (t = g.length + 1),
  37117. (y = u(v - a, t, 0 == a)),
  37118. N(v / t) > I - A && r('overflow'),
  37119. (A += N(v / t)),
  37120. (v %= t),
  37121. g.splice(v++, 0, A);
  37122. }
  37123. return l(g);
  37124. }
  37125. function p(e) {
  37126. var t,
  37127. i,
  37128. n,
  37129. o,
  37130. a,
  37131. l,
  37132. c,
  37133. d,
  37134. p,
  37135. f,
  37136. g,
  37137. m,
  37138. v,
  37139. A,
  37140. y,
  37141. C = [];
  37142. for (e = s(e), m = e.length, t = S, i = 0, a = x, l = 0; l < m; ++l)
  37143. (g = e[l]), g < 128 && C.push(B(g));
  37144. for (n = o = C.length, o && C.push(M); n < m; ) {
  37145. for (c = I, l = 0; l < m; ++l) (g = e[l]), g >= t && g < c && (c = g);
  37146. for (
  37147. v = n + 1,
  37148. c - t > N((I - i) / v) && r('overflow'),
  37149. i += (c - t) * v,
  37150. t = c,
  37151. l = 0;
  37152. l < m;
  37153. ++l
  37154. )
  37155. if (((g = e[l]), g < t && ++i > I && r('overflow'), g == t)) {
  37156. for (d = i, p = E; (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f); p += E)
  37157. (y = d - f), (A = E - f), C.push(B(h(f + (y % A), 0))), (d = N(y / A));
  37158. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n;
  37159. }
  37160. ++i, ++t;
  37161. }
  37162. return C.join('');
  37163. }
  37164. function f(e) {
  37165. return a(e, function (e) {
  37166. return R.test(e) ? d(e.slice(4).toLowerCase()) : e;
  37167. });
  37168. }
  37169. function g(e) {
  37170. return a(e, function (e) {
  37171. return P.test(e) ? 'xn--' + p(e) : e;
  37172. });
  37173. }
  37174. var m = 'object' == typeof i && i && !i.nodeType && i,
  37175. v = 'object' == typeof t && t && !t.nodeType && t,
  37176. A = 'object' == typeof e && e;
  37177. (A.global !== A && A.window !== A && A.self !== A) || (n = A);
  37178. var y,
  37179. C,
  37180. I = 2147483647,
  37181. E = 36,
  37182. b = 1,
  37183. w = 26,
  37184. _ = 38,
  37185. T = 700,
  37186. x = 72,
  37187. S = 128,
  37188. M = '-',
  37189. R = /^xn--/,
  37190. P = /[^\x20-\x7E]/,
  37191. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  37192. L = {
  37193. overflow: 'Overflow: input needs wider integers to process',
  37194. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  37195. 'invalid-input': 'Invalid input',
  37196. },
  37197. D = E - b,
  37198. N = Math.floor,
  37199. B = String.fromCharCode;
  37200. if (
  37201. ((y = {
  37202. version: '1.4.1',
  37203. ucs2: {
  37204. decode: s,
  37205. encode: l,
  37206. },
  37207. decode: d,
  37208. encode: p,
  37209. toASCII: g,
  37210. toUnicode: f,
  37211. }),
  37212. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  37213. )
  37214. define('punycode', function () {
  37215. return y;
  37216. });
  37217. else if (m && v)
  37218. if (t.exports == m) v.exports = y;
  37219. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C]);
  37220. else n.punycode = y;
  37221. })(this);
  37222. }.call(
  37223. this,
  37224. 'undefined' != typeof global
  37225. ? global
  37226. : 'undefined' != typeof self
  37227. ? self
  37228. : 'undefined' != typeof window
  37229. ? window
  37230. : {}
  37231. ));
  37232. },
  37233. {},
  37234. ],
  37235. 205: [
  37236. function (e, t, i) {
  37237. 'use strict';
  37238. function n(e, t) {
  37239. return Object.prototype.hasOwnProperty.call(e, t);
  37240. }
  37241. t.exports = function (e, t, i, o) {
  37242. (t = t || '&'), (i = i || '=');
  37243. var a = {};
  37244. if ('string' != typeof e || 0 === e.length) return a;
  37245. var s = /\+/g;
  37246. e = e.split(t);
  37247. var l = 1e3;
  37248. o && 'number' == typeof o.maxKeys && (l = o.maxKeys);
  37249. var c = e.length;
  37250. l > 0 && c > l && (c = l);
  37251. for (var h = 0; h < c; ++h) {
  37252. var u,
  37253. d,
  37254. p,
  37255. f,
  37256. g = e[h].replace(s, '%20'),
  37257. m = g.indexOf(i);
  37258. m >= 0 ? ((u = g.substr(0, m)), (d = g.substr(m + 1))) : ((u = g), (d = '')),
  37259. (p = decodeURIComponent(u)),
  37260. (f = decodeURIComponent(d)),
  37261. n(a, p) ? (r(a[p]) ? a[p].push(f) : (a[p] = [a[p], f])) : (a[p] = f);
  37262. }
  37263. return a;
  37264. };
  37265. var r =
  37266. Array.isArray ||
  37267. function (e) {
  37268. return '[object Array]' === Object.prototype.toString.call(e);
  37269. };
  37270. },
  37271. {},
  37272. ],
  37273. 206: [
  37274. function (e, t, i) {
  37275. 'use strict';
  37276. function n(e, t) {
  37277. if (e.map) return e.map(t);
  37278. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n));
  37279. return i;
  37280. }
  37281. var r = function (e) {
  37282. switch (typeof e) {
  37283. case 'string':
  37284. return e;
  37285. case 'boolean':
  37286. return e ? 'true' : 'false';
  37287. case 'number':
  37288. return isFinite(e) ? e : '';
  37289. default:
  37290. return '';
  37291. }
  37292. };
  37293. t.exports = function (e, t, i, s) {
  37294. return (
  37295. (t = t || '&'),
  37296. (i = i || '='),
  37297. null === e && (e = void 0),
  37298. 'object' == typeof e
  37299. ? n(a(e), function (a) {
  37300. var s = encodeURIComponent(r(a)) + i;
  37301. return o(e[a])
  37302. ? n(e[a], function (e) {
  37303. return s + encodeURIComponent(r(e));
  37304. }).join(t)
  37305. : s + encodeURIComponent(r(e[a]));
  37306. }).join(t)
  37307. : s
  37308. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  37309. : ''
  37310. );
  37311. };
  37312. var o =
  37313. Array.isArray ||
  37314. function (e) {
  37315. return '[object Array]' === Object.prototype.toString.call(e);
  37316. },
  37317. a =
  37318. Object.keys ||
  37319. function (e) {
  37320. var t = [];
  37321. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  37322. return t;
  37323. };
  37324. },
  37325. {},
  37326. ],
  37327. 207: [
  37328. function (e, t, i) {
  37329. 'use strict';
  37330. (i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'));
  37331. },
  37332. {
  37333. './decode': 205,
  37334. './encode': 206,
  37335. },
  37336. ],
  37337. 208: [
  37338. function (e, t, i) {
  37339. 'use strict';
  37340. function n() {
  37341. (this.protocol = null),
  37342. (this.slashes = null),
  37343. (this.auth = null),
  37344. (this.host = null),
  37345. (this.port = null),
  37346. (this.hostname = null),
  37347. (this.hash = null),
  37348. (this.search = null),
  37349. (this.query = null),
  37350. (this.pathname = null),
  37351. (this.path = null),
  37352. (this.href = null);
  37353. }
  37354. function r(e, t, i) {
  37355. if (e && c.isObject(e) && e instanceof n) return e;
  37356. var r = new n();
  37357. return r.parse(e, t, i), r;
  37358. }
  37359. function o(e) {
  37360. return (
  37361. c.isString(e) && (e = r(e)), e instanceof n ? e.format() : n.prototype.format.call(e)
  37362. );
  37363. }
  37364. function a(e, t) {
  37365. return r(e, !1, !0).resolve(t);
  37366. }
  37367. function s(e, t) {
  37368. return e ? r(e, !1, !0).resolveObject(t) : t;
  37369. }
  37370. var l = e('punycode'),
  37371. c = e('./util');
  37372. (i.parse = r), (i.resolve = a), (i.resolveObject = s), (i.format = o), (i.Url = n);
  37373. var h = /^([a-z0-9.+-]+:)/i,
  37374. u = /:[0-9]*$/,
  37375. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  37376. p = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
  37377. f = ['{', '}', '|', '\\', '^', '`'].concat(p),
  37378. g = ["'"].concat(f),
  37379. m = ['%', '/', '?', ';', '#'].concat(g),
  37380. v = ['/', '?', '#'],
  37381. A = 255,
  37382. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  37383. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  37384. I = {
  37385. javascript: !0,
  37386. 'javascript:': !0,
  37387. },
  37388. E = {
  37389. javascript: !0,
  37390. 'javascript:': !0,
  37391. },
  37392. b = {
  37393. http: !0,
  37394. https: !0,
  37395. ftp: !0,
  37396. gopher: !0,
  37397. file: !0,
  37398. 'http:': !0,
  37399. 'https:': !0,
  37400. 'ftp:': !0,
  37401. 'gopher:': !0,
  37402. 'file:': !0,
  37403. },
  37404. w = e('querystring');
  37405. (n.prototype.parse = function (e, t, i) {
  37406. if (!c.isString(e))
  37407. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  37408. var n = e.indexOf('?'),
  37409. r = n !== -1 && n < e.indexOf('#') ? '?' : '#',
  37410. o = e.split(r),
  37411. a = /\\/g;
  37412. (o[0] = o[0].replace(a, '/')), (e = o.join(r));
  37413. var s = e;
  37414. if (((s = s.trim()), !i && 1 === e.split('#').length)) {
  37415. var u = d.exec(s);
  37416. if (u)
  37417. return (
  37418. (this.path = s),
  37419. (this.href = s),
  37420. (this.pathname = u[1]),
  37421. u[2]
  37422. ? ((this.search = u[2]),
  37423. t
  37424. ? (this.query = w.parse(this.search.substr(1)))
  37425. : (this.query = this.search.substr(1)))
  37426. : t && ((this.search = ''), (this.query = {})),
  37427. this
  37428. );
  37429. }
  37430. var p = h.exec(s);
  37431. if (p) {
  37432. p = p[0];
  37433. var f = p.toLowerCase();
  37434. (this.protocol = f), (s = s.substr(p.length));
  37435. }
  37436. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  37437. var _ = '//' === s.substr(0, 2);
  37438. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0));
  37439. }
  37440. if (!E[p] && (_ || (p && !b[p]))) {
  37441. for (var T = -1, x = 0; x < v.length; x++) {
  37442. var S = s.indexOf(v[x]);
  37443. S !== -1 && (T === -1 || S < T) && (T = S);
  37444. }
  37445. var M, R;
  37446. (R = T === -1 ? s.lastIndexOf('@') : s.lastIndexOf('@', T)),
  37447. R !== -1 &&
  37448. ((M = s.slice(0, R)), (s = s.slice(R + 1)), (this.auth = decodeURIComponent(M))),
  37449. (T = -1);
  37450. for (var x = 0; x < m.length; x++) {
  37451. var S = s.indexOf(m[x]);
  37452. S !== -1 && (T === -1 || S < T) && (T = S);
  37453. }
  37454. T === -1 && (T = s.length),
  37455. (this.host = s.slice(0, T)),
  37456. (s = s.slice(T)),
  37457. this.parseHost(),
  37458. (this.hostname = this.hostname || '');
  37459. var P = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1];
  37460. if (!P)
  37461. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  37462. var D = O[x];
  37463. if (D && !D.match(y)) {
  37464. for (var N = '', B = 0, F = D.length; B < F; B++)
  37465. N += D.charCodeAt(B) > 127 ? 'x' : D[B];
  37466. if (!N.match(y)) {
  37467. var V = O.slice(0, x),
  37468. U = O.slice(x + 1),
  37469. k = D.match(C);
  37470. k && (V.push(k[1]), U.unshift(k[2])),
  37471. U.length && (s = '/' + U.join('.') + s),
  37472. (this.hostname = V.join('.'));
  37473. break;
  37474. }
  37475. }
  37476. }
  37477. this.hostname.length > A
  37478. ? (this.hostname = '')
  37479. : (this.hostname = this.hostname.toLowerCase()),
  37480. P || (this.hostname = l.toASCII(this.hostname));
  37481. var H = this.port ? ':' + this.port : '',
  37482. G = this.hostname || '';
  37483. (this.host = G + H),
  37484. (this.href += this.host),
  37485. P &&
  37486. ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)),
  37487. '/' !== s[0] && (s = '/' + s));
  37488. }
  37489. if (!I[f])
  37490. for (var x = 0, L = g.length; x < L; x++) {
  37491. var z = g[x];
  37492. if (s.indexOf(z) !== -1) {
  37493. var W = encodeURIComponent(z);
  37494. W === z && (W = escape(z)), (s = s.split(z).join(W));
  37495. }
  37496. }
  37497. var j = s.indexOf('#');
  37498. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)));
  37499. var Y = s.indexOf('?');
  37500. if (
  37501. (Y !== -1
  37502. ? ((this.search = s.substr(Y)),
  37503. (this.query = s.substr(Y + 1)),
  37504. t && (this.query = w.parse(this.query)),
  37505. (s = s.slice(0, Y)))
  37506. : t && ((this.search = ''), (this.query = {})),
  37507. s && (this.pathname = s),
  37508. b[f] && this.hostname && !this.pathname && (this.pathname = '/'),
  37509. this.pathname || this.search)
  37510. ) {
  37511. var H = this.pathname || '',
  37512. X = this.search || '';
  37513. this.path = H + X;
  37514. }
  37515. return (this.href = this.format()), this;
  37516. }),
  37517. (n.prototype.format = function () {
  37518. var e = this.auth || '';
  37519. e && ((e = encodeURIComponent(e)), (e = e.replace(/%3A/i, ':')), (e += '@'));
  37520. var t = this.protocol || '',
  37521. i = this.pathname || '',
  37522. n = this.hash || '',
  37523. r = !1,
  37524. o = '';
  37525. this.host
  37526. ? (r = e + this.host)
  37527. : this.hostname &&
  37528. ((r =
  37529. e +
  37530. (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']')),
  37531. this.port && (r += ':' + this.port)),
  37532. this.query &&
  37533. c.isObject(this.query) &&
  37534. Object.keys(this.query).length &&
  37535. (o = w.stringify(this.query));
  37536. var a = this.search || (o && '?' + o) || '';
  37537. return (
  37538. t && ':' !== t.substr(-1) && (t += ':'),
  37539. this.slashes || ((!t || b[t]) && r !== !1)
  37540. ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i))
  37541. : r || (r = ''),
  37542. n && '#' !== n.charAt(0) && (n = '#' + n),
  37543. a && '?' !== a.charAt(0) && (a = '?' + a),
  37544. (i = i.replace(/[?#]/g, function (e) {
  37545. return encodeURIComponent(e);
  37546. })),
  37547. (a = a.replace('#', '%23')),
  37548. t + r + i + a + n
  37549. );
  37550. }),
  37551. (n.prototype.resolve = function (e) {
  37552. return this.resolveObject(r(e, !1, !0)).format();
  37553. }),
  37554. (n.prototype.resolveObject = function (e) {
  37555. if (c.isString(e)) {
  37556. var t = new n();
  37557. t.parse(e, !1, !0), (e = t);
  37558. }
  37559. for (var i = new n(), r = Object.keys(this), o = 0; o < r.length; o++) {
  37560. var a = r[o];
  37561. i[a] = this[a];
  37562. }
  37563. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i;
  37564. if (e.slashes && !e.protocol) {
  37565. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  37566. var h = s[l];
  37567. 'protocol' !== h && (i[h] = e[h]);
  37568. }
  37569. return (
  37570. b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'),
  37571. (i.href = i.format()),
  37572. i
  37573. );
  37574. }
  37575. if (e.protocol && e.protocol !== i.protocol) {
  37576. if (!b[e.protocol]) {
  37577. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  37578. var p = u[d];
  37579. i[p] = e[p];
  37580. }
  37581. return (i.href = i.format()), i;
  37582. }
  37583. if (((i.protocol = e.protocol), e.host || E[e.protocol])) i.pathname = e.pathname;
  37584. else {
  37585. for (var f = (e.pathname || '').split('/'); f.length && !(e.host = f.shift()); );
  37586. e.host || (e.host = ''),
  37587. e.hostname || (e.hostname = ''),
  37588. '' !== f[0] && f.unshift(''),
  37589. f.length < 2 && f.unshift(''),
  37590. (i.pathname = f.join('/'));
  37591. }
  37592. if (
  37593. ((i.search = e.search),
  37594. (i.query = e.query),
  37595. (i.host = e.host || ''),
  37596. (i.auth = e.auth),
  37597. (i.hostname = e.hostname || e.host),
  37598. (i.port = e.port),
  37599. i.pathname || i.search)
  37600. ) {
  37601. var g = i.pathname || '',
  37602. m = i.search || '';
  37603. i.path = g + m;
  37604. }
  37605. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i;
  37606. }
  37607. var v = i.pathname && '/' === i.pathname.charAt(0),
  37608. A = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  37609. y = A || v || (i.host && e.pathname),
  37610. C = y,
  37611. I = (i.pathname && i.pathname.split('/')) || [],
  37612. f = (e.pathname && e.pathname.split('/')) || [],
  37613. w = i.protocol && !b[i.protocol];
  37614. if (
  37615. (w &&
  37616. ((i.hostname = ''),
  37617. (i.port = null),
  37618. i.host && ('' === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  37619. (i.host = ''),
  37620. e.protocol &&
  37621. ((e.hostname = null),
  37622. (e.port = null),
  37623. e.host && ('' === f[0] ? (f[0] = e.host) : f.unshift(e.host)),
  37624. (e.host = null)),
  37625. (y = y && ('' === f[0] || '' === I[0]))),
  37626. A)
  37627. )
  37628. (i.host = e.host || '' === e.host ? e.host : i.host),
  37629. (i.hostname = e.hostname || '' === e.hostname ? e.hostname : i.hostname),
  37630. (i.search = e.search),
  37631. (i.query = e.query),
  37632. (I = f);
  37633. else if (f.length)
  37634. I || (I = []), I.pop(), (I = I.concat(f)), (i.search = e.search), (i.query = e.query);
  37635. else if (!c.isNullOrUndefined(e.search)) {
  37636. if (w) {
  37637. i.hostname = i.host = I.shift();
  37638. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@');
  37639. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  37640. }
  37641. return (
  37642. (i.search = e.search),
  37643. (i.query = e.query),
  37644. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37645. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37646. (i.href = i.format()),
  37647. i
  37648. );
  37649. }
  37650. if (!I.length)
  37651. return (
  37652. (i.pathname = null),
  37653. i.search ? (i.path = '/' + i.search) : (i.path = null),
  37654. (i.href = i.format()),
  37655. i
  37656. );
  37657. for (
  37658. var T = I.slice(-1)[0],
  37659. x = ((i.host || e.host || I.length > 1) && ('.' === T || '..' === T)) || '' === T,
  37660. S = 0,
  37661. M = I.length;
  37662. M >= 0;
  37663. M--
  37664. )
  37665. (T = I[M]),
  37666. '.' === T
  37667. ? I.splice(M, 1)
  37668. : '..' === T
  37669. ? (I.splice(M, 1), S++)
  37670. : S && (I.splice(M, 1), S--);
  37671. if (!y && !C) for (; S--; S) I.unshift('..');
  37672. !y || '' === I[0] || (I[0] && '/' === I[0].charAt(0)) || I.unshift(''),
  37673. x && '/' !== I.join('/').substr(-1) && I.push('');
  37674. var R = '' === I[0] || (I[0] && '/' === I[0].charAt(0));
  37675. if (w) {
  37676. i.hostname = i.host = R ? '' : I.length ? I.shift() : '';
  37677. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@');
  37678. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()));
  37679. }
  37680. return (
  37681. (y = y || (i.host && I.length)),
  37682. y && !R && I.unshift(''),
  37683. I.length ? (i.pathname = I.join('/')) : ((i.pathname = null), (i.path = null)),
  37684. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37685. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37686. (i.auth = e.auth || i.auth),
  37687. (i.slashes = i.slashes || e.slashes),
  37688. (i.href = i.format()),
  37689. i
  37690. );
  37691. }),
  37692. (n.prototype.parseHost = function () {
  37693. var e = this.host,
  37694. t = u.exec(e);
  37695. t &&
  37696. ((t = t[0]),
  37697. ':' !== t && (this.port = t.substr(1)),
  37698. (e = e.substr(0, e.length - t.length))),
  37699. e && (this.hostname = e);
  37700. });
  37701. },
  37702. {
  37703. './util': 209,
  37704. punycode: 204,
  37705. querystring: 207,
  37706. },
  37707. ],
  37708. 209: [
  37709. function (e, t, i) {
  37710. 'use strict';
  37711. t.exports = {
  37712. isString: function (e) {
  37713. return 'string' == typeof e;
  37714. },
  37715. isObject: function (e) {
  37716. return 'object' == typeof e && null !== e;
  37717. },
  37718. isNull: function (e) {
  37719. return null === e;
  37720. },
  37721. isNullOrUndefined: function (e) {
  37722. return null == e;
  37723. },
  37724. };
  37725. },
  37726. {},
  37727. ],
  37728. 210: [
  37729. function (e, t, i) {
  37730. 'use strict';
  37731. function n(e) {
  37732. return l + e;
  37733. }
  37734. function r(e) {
  37735. return e.substring(l.length);
  37736. }
  37737. function o(e, t) {
  37738. for (var i in t)
  37739. Object.defineProperty(e, i, {
  37740. value: t[i],
  37741. configurable: !0,
  37742. writable: !0,
  37743. });
  37744. }
  37745. function a(e) {
  37746. if ('string' != typeof e) throw new TypeError('key must be a string.');
  37747. }
  37748. var s = Object.prototype.hasOwnProperty,
  37749. l = '~';
  37750. t.exports = function (e) {
  37751. var t = Object.create(null),
  37752. i = 0,
  37753. l = {};
  37754. return (
  37755. o(l, {
  37756. get: function (e, i) {
  37757. a(e);
  37758. var r = n(e);
  37759. return r in t ? t[r] : i;
  37760. },
  37761. set: function (e, r) {
  37762. a(e);
  37763. var o = n(e);
  37764. return o in t || ++i, (t[o] = r);
  37765. },
  37766. has: function (e) {
  37767. return a(e), n(e) in t;
  37768. },
  37769. delete: function (e) {
  37770. a(e);
  37771. var r = n(e);
  37772. return r in t && (--i, delete t[r], !0);
  37773. },
  37774. clear: function () {
  37775. (t = Object.create(null)), (i = 0);
  37776. },
  37777. forEach: function (e, i) {
  37778. if ('function' != typeof e) throw new TypeError('`callback` must be a function');
  37779. for (var n in t)
  37780. if (s.call(t, n)) {
  37781. var o = r(n),
  37782. a = t[n];
  37783. e.call(i, a, o, l);
  37784. }
  37785. },
  37786. }),
  37787. Object.defineProperty(l, 'size', {
  37788. get: function () {
  37789. return i;
  37790. },
  37791. configurable: !0,
  37792. }),
  37793. 'object' == typeof e &&
  37794. null !== e &&
  37795. Object.keys(e).forEach(function (t) {
  37796. l.set(t, e[t]);
  37797. }),
  37798. l
  37799. );
  37800. };
  37801. },
  37802. {},
  37803. ],
  37804. 211: [
  37805. function (e, t, i) {
  37806. t.exports = e('./lib/heap');
  37807. },
  37808. {
  37809. './lib/heap': 212,
  37810. },
  37811. ],
  37812. 212: [
  37813. function (e, t, i) {
  37814. (function () {
  37815. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  37816. (r = Math.floor),
  37817. (u = Math.min),
  37818. (n = function (e, t) {
  37819. return e < t ? -1 : e > t ? 1 : 0;
  37820. }),
  37821. (h = function (e, t, i, o, a) {
  37822. var s;
  37823. if ((null == i && (i = 0), null == a && (a = n), i < 0))
  37824. throw new Error('lo must be non-negative');
  37825. for (null == o && (o = e.length); i < o; )
  37826. (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1);
  37827. return [].splice.apply(e, [i, i - i].concat(t)), t;
  37828. }),
  37829. (s = function (e, t, i) {
  37830. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i);
  37831. }),
  37832. (a = function (e, t) {
  37833. var i, r;
  37834. return (
  37835. null == t && (t = n),
  37836. (i = e.pop()),
  37837. e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i),
  37838. r
  37839. );
  37840. }),
  37841. (c = function (e, t, i) {
  37842. var r;
  37843. return null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r;
  37844. }),
  37845. (l = function (e, t, i) {
  37846. var r;
  37847. return (
  37848. null == i && (i = n),
  37849. e.length &&
  37850. i(e[0], t) < 0 &&
  37851. ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)),
  37852. t
  37853. );
  37854. }),
  37855. (o = function (e, t) {
  37856. var i, o, a, s, l, c;
  37857. for (
  37858. null == t && (t = n),
  37859. s = function () {
  37860. c = [];
  37861. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  37862. c.push(t);
  37863. return c;
  37864. }
  37865. .apply(this)
  37866. .reverse(),
  37867. l = [],
  37868. o = 0,
  37869. a = s.length;
  37870. o < a;
  37871. o++
  37872. )
  37873. (i = s[o]), l.push(m(e, i, t));
  37874. return l;
  37875. }),
  37876. (f = function (e, t, i) {
  37877. var r;
  37878. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1))
  37879. return g(e, 0, r, i), m(e, r, i);
  37880. }),
  37881. (d = function (e, t, i) {
  37882. var r, a, s, c, h;
  37883. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length)) return a;
  37884. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++) (r = h[s]), l(a, r, i);
  37885. return a.sort(i).reverse();
  37886. }),
  37887. (p = function (e, t, i) {
  37888. var r, s, l, c, d, p, f, g, m, v;
  37889. if ((null == i && (i = n), 10 * t <= e.length)) {
  37890. if (((c = e.slice(0, t).sort(i)), !c.length)) return c;
  37891. for (l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length; d < f; d++)
  37892. (r = g[d]), i(r, l) < 0 && (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]));
  37893. return c;
  37894. }
  37895. for (
  37896. o(e, i), v = [], s = p = 0, m = u(t, e.length);
  37897. 0 <= m ? p < m : p > m;
  37898. s = 0 <= m ? ++p : --p
  37899. )
  37900. v.push(a(e, i));
  37901. return v;
  37902. }),
  37903. (g = function (e, t, i, r) {
  37904. var o, a, s;
  37905. for (
  37906. null == r && (r = n), o = e[i];
  37907. i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0);
  37908. )
  37909. (e[i] = a), (i = s);
  37910. return (e[i] = o);
  37911. }),
  37912. (m = function (e, t, i) {
  37913. var r, o, a, s, l;
  37914. for (null == i && (i = n), o = e.length, l = t, a = e[t], r = 2 * t + 1; r < o; )
  37915. (s = r + 1),
  37916. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  37917. (e[t] = e[r]),
  37918. (t = r),
  37919. (r = 2 * t + 1);
  37920. return (e[t] = a), g(e, l, t, i);
  37921. }),
  37922. (e = (function () {
  37923. function e(e) {
  37924. (this.cmp = null != e ? e : n), (this.nodes = []);
  37925. }
  37926. return (
  37927. (e.push = s),
  37928. (e.pop = a),
  37929. (e.replace = c),
  37930. (e.pushpop = l),
  37931. (e.heapify = o),
  37932. (e.updateItem = f),
  37933. (e.nlargest = d),
  37934. (e.nsmallest = p),
  37935. (e.prototype.push = function (e) {
  37936. return s(this.nodes, e, this.cmp);
  37937. }),
  37938. (e.prototype.pop = function () {
  37939. return a(this.nodes, this.cmp);
  37940. }),
  37941. (e.prototype.peek = function () {
  37942. return this.nodes[0];
  37943. }),
  37944. (e.prototype.contains = function (e) {
  37945. return this.nodes.indexOf(e) !== -1;
  37946. }),
  37947. (e.prototype.replace = function (e) {
  37948. return c(this.nodes, e, this.cmp);
  37949. }),
  37950. (e.prototype.pushpop = function (e) {
  37951. return l(this.nodes, e, this.cmp);
  37952. }),
  37953. (e.prototype.heapify = function () {
  37954. return o(this.nodes, this.cmp);
  37955. }),
  37956. (e.prototype.updateItem = function (e) {
  37957. return f(this.nodes, e, this.cmp);
  37958. }),
  37959. (e.prototype.clear = function () {
  37960. return (this.nodes = []);
  37961. }),
  37962. (e.prototype.empty = function () {
  37963. return 0 === this.nodes.length;
  37964. }),
  37965. (e.prototype.size = function () {
  37966. return this.nodes.length;
  37967. }),
  37968. (e.prototype.clone = function () {
  37969. var t;
  37970. return (t = new e()), (t.nodes = this.nodes.slice(0)), t;
  37971. }),
  37972. (e.prototype.toArray = function () {
  37973. return this.nodes.slice(0);
  37974. }),
  37975. (e.prototype.insert = e.prototype.push),
  37976. (e.prototype.top = e.prototype.peek),
  37977. (e.prototype.front = e.prototype.peek),
  37978. (e.prototype.has = e.prototype.contains),
  37979. (e.prototype.copy = e.prototype.clone),
  37980. e
  37981. );
  37982. })()),
  37983. (function (e, n) {
  37984. return 'function' == typeof define && define.amd
  37985. ? define([], n)
  37986. : 'object' == typeof i
  37987. ? (t.exports = n())
  37988. : (e.Heap = n());
  37989. })(this, function () {
  37990. return e;
  37991. });
  37992. }.call(this));
  37993. },
  37994. {},
  37995. ],
  37996. 213: [
  37997. function (e, t, i) {
  37998. !(function (e) {
  37999. function i() {}
  38000. function n(e, t) {
  38001. return function () {
  38002. e.apply(t, arguments);
  38003. };
  38004. }
  38005. function r(e) {
  38006. if ('object' != typeof this)
  38007. throw new TypeError('Promises must be constructed via new');
  38008. if ('function' != typeof e) throw new TypeError('not a function');
  38009. (this._state = 0),
  38010. (this._handled = !1),
  38011. (this._value = void 0),
  38012. (this._deferreds = []),
  38013. h(e, this);
  38014. }
  38015. function o(e, t) {
  38016. for (; 3 === e._state; ) e = e._value;
  38017. return 0 === e._state
  38018. ? void e._deferreds.push(t)
  38019. : ((e._handled = !0),
  38020. void r._immediateFn(function () {
  38021. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  38022. if (null === i) return void (1 === e._state ? a : s)(t.promise, e._value);
  38023. var n;
  38024. try {
  38025. n = i(e._value);
  38026. } catch (e) {
  38027. return void s(t.promise, e);
  38028. }
  38029. a(t.promise, n);
  38030. }));
  38031. }
  38032. function a(e, t) {
  38033. try {
  38034. if (t === e) throw new TypeError('A promise cannot be resolved with itself.');
  38035. if (t && ('object' == typeof t || 'function' == typeof t)) {
  38036. var i = t.then;
  38037. if (t instanceof r) return (e._state = 3), (e._value = t), void l(e);
  38038. if ('function' == typeof i) return void h(n(i, t), e);
  38039. }
  38040. (e._state = 1), (e._value = t), l(e);
  38041. } catch (t) {
  38042. s(e, t);
  38043. }
  38044. }
  38045. function s(e, t) {
  38046. (e._state = 2), (e._value = t), l(e);
  38047. }
  38048. function l(e) {
  38049. 2 === e._state &&
  38050. 0 === e._deferreds.length &&
  38051. r._immediateFn(function () {
  38052. e._handled || r._unhandledRejectionFn(e._value);
  38053. });
  38054. for (var t = 0, i = e._deferreds.length; t < i; t++) o(e, e._deferreds[t]);
  38055. e._deferreds = null;
  38056. }
  38057. function c(e, t, i) {
  38058. (this.onFulfilled = 'function' == typeof e ? e : null),
  38059. (this.onRejected = 'function' == typeof t ? t : null),
  38060. (this.promise = i);
  38061. }
  38062. function h(e, t) {
  38063. var i = !1;
  38064. try {
  38065. e(
  38066. function (e) {
  38067. i || ((i = !0), a(t, e));
  38068. },
  38069. function (e) {
  38070. i || ((i = !0), s(t, e));
  38071. }
  38072. );
  38073. } catch (e) {
  38074. if (i) return;
  38075. (i = !0), s(t, e);
  38076. }
  38077. }
  38078. var u = setTimeout;
  38079. (r.prototype.catch = function (e) {
  38080. return this.then(null, e);
  38081. }),
  38082. (r.prototype.then = function (e, t) {
  38083. var n = new this.constructor(i);
  38084. return o(this, new c(e, t, n)), n;
  38085. }),
  38086. (r.all = function (e) {
  38087. var t = Array.prototype.slice.call(e);
  38088. return new r(function (e, i) {
  38089. function n(o, a) {
  38090. try {
  38091. if (a && ('object' == typeof a || 'function' == typeof a)) {
  38092. var s = a.then;
  38093. if ('function' == typeof s)
  38094. return void s.call(
  38095. a,
  38096. function (e) {
  38097. n(o, e);
  38098. },
  38099. i
  38100. );
  38101. }
  38102. (t[o] = a), 0 === --r && e(t);
  38103. } catch (e) {
  38104. i(e);
  38105. }
  38106. }
  38107. if (0 === t.length) return e([]);
  38108. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o]);
  38109. });
  38110. }),
  38111. (r.resolve = function (e) {
  38112. return e && 'object' == typeof e && e.constructor === r
  38113. ? e
  38114. : new r(function (t) {
  38115. t(e);
  38116. });
  38117. }),
  38118. (r.reject = function (e) {
  38119. return new r(function (t, i) {
  38120. i(e);
  38121. });
  38122. }),
  38123. (r.race = function (e) {
  38124. return new r(function (t, i) {
  38125. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i);
  38126. });
  38127. }),
  38128. (r._immediateFn =
  38129. ('function' == typeof setImmediate &&
  38130. function (e) {
  38131. setImmediate(e);
  38132. }) ||
  38133. function (e) {
  38134. u(e, 0);
  38135. }),
  38136. (r._unhandledRejectionFn = function (e) {
  38137. 'undefined' != typeof console &&
  38138. console &&
  38139. console.warn('Possible Unhandled Promise Rejection:', e);
  38140. }),
  38141. (r._setImmediateFn = function (e) {
  38142. r._immediateFn = e;
  38143. }),
  38144. (r._setUnhandledRejectionFn = function (e) {
  38145. r._unhandledRejectionFn = e;
  38146. }),
  38147. 'undefined' != typeof t && t.exports ? (t.exports = r) : e.Promise || (e.Promise = r);
  38148. })(this);
  38149. },
  38150. {},
  38151. ],
  38152. 214: [
  38153. function (e, t, i) {
  38154. (function (i) {
  38155. !(function (i, n) {
  38156. 'function' == typeof define && define.amd
  38157. ? define(['bytebuffer'], n)
  38158. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  38159. ? (t.exports = n(e('bytebuffer'), !0))
  38160. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer));
  38161. })(this, function (t, n) {
  38162. 'use strict';
  38163. var r = {};
  38164. return (
  38165. (r.ByteBuffer = t),
  38166. (r.Long = t.Long || null),
  38167. (r.VERSION = '5.0.1'),
  38168. (r.WIRE_TYPES = {}),
  38169. (r.WIRE_TYPES.VARINT = 0),
  38170. (r.WIRE_TYPES.BITS64 = 1),
  38171. (r.WIRE_TYPES.LDELIM = 2),
  38172. (r.WIRE_TYPES.STARTGROUP = 3),
  38173. (r.WIRE_TYPES.ENDGROUP = 4),
  38174. (r.WIRE_TYPES.BITS32 = 5),
  38175. (r.PACKABLE_WIRE_TYPES = [
  38176. r.WIRE_TYPES.VARINT,
  38177. r.WIRE_TYPES.BITS64,
  38178. r.WIRE_TYPES.BITS32,
  38179. ]),
  38180. (r.TYPES = {
  38181. int32: {
  38182. name: 'int32',
  38183. wireType: r.WIRE_TYPES.VARINT,
  38184. defaultValue: 0,
  38185. },
  38186. uint32: {
  38187. name: 'uint32',
  38188. wireType: r.WIRE_TYPES.VARINT,
  38189. defaultValue: 0,
  38190. },
  38191. sint32: {
  38192. name: 'sint32',
  38193. wireType: r.WIRE_TYPES.VARINT,
  38194. defaultValue: 0,
  38195. },
  38196. int64: {
  38197. name: 'int64',
  38198. wireType: r.WIRE_TYPES.VARINT,
  38199. defaultValue: r.Long ? r.Long.ZERO : void 0,
  38200. },
  38201. uint64: {
  38202. name: 'uint64',
  38203. wireType: r.WIRE_TYPES.VARINT,
  38204. defaultValue: r.Long ? r.Long.UZERO : void 0,
  38205. },
  38206. sint64: {
  38207. name: 'sint64',
  38208. wireType: r.WIRE_TYPES.VARINT,
  38209. defaultValue: r.Long ? r.Long.ZERO : void 0,
  38210. },
  38211. bool: {
  38212. name: 'bool',
  38213. wireType: r.WIRE_TYPES.VARINT,
  38214. defaultValue: !1,
  38215. },
  38216. double: {
  38217. name: 'double',
  38218. wireType: r.WIRE_TYPES.BITS64,
  38219. defaultValue: 0,
  38220. },
  38221. string: {
  38222. name: 'string',
  38223. wireType: r.WIRE_TYPES.LDELIM,
  38224. defaultValue: '',
  38225. },
  38226. bytes: {
  38227. name: 'bytes',
  38228. wireType: r.WIRE_TYPES.LDELIM,
  38229. defaultValue: null,
  38230. },
  38231. fixed32: {
  38232. name: 'fixed32',
  38233. wireType: r.WIRE_TYPES.BITS32,
  38234. defaultValue: 0,
  38235. },
  38236. sfixed32: {
  38237. name: 'sfixed32',
  38238. wireType: r.WIRE_TYPES.BITS32,
  38239. defaultValue: 0,
  38240. },
  38241. fixed64: {
  38242. name: 'fixed64',
  38243. wireType: r.WIRE_TYPES.BITS64,
  38244. defaultValue: r.Long ? r.Long.UZERO : void 0,
  38245. },
  38246. sfixed64: {
  38247. name: 'sfixed64',
  38248. wireType: r.WIRE_TYPES.BITS64,
  38249. defaultValue: r.Long ? r.Long.ZERO : void 0,
  38250. },
  38251. float: {
  38252. name: 'float',
  38253. wireType: r.WIRE_TYPES.BITS32,
  38254. defaultValue: 0,
  38255. },
  38256. enum: {
  38257. name: 'enum',
  38258. wireType: r.WIRE_TYPES.VARINT,
  38259. defaultValue: 0,
  38260. },
  38261. message: {
  38262. name: 'message',
  38263. wireType: r.WIRE_TYPES.LDELIM,
  38264. defaultValue: null,
  38265. },
  38266. group: {
  38267. name: 'group',
  38268. wireType: r.WIRE_TYPES.STARTGROUP,
  38269. defaultValue: null,
  38270. },
  38271. }),
  38272. (r.MAP_KEY_TYPES = [
  38273. r.TYPES.int32,
  38274. r.TYPES.sint32,
  38275. r.TYPES.sfixed32,
  38276. r.TYPES.uint32,
  38277. r.TYPES.fixed32,
  38278. r.TYPES.int64,
  38279. r.TYPES.sint64,
  38280. r.TYPES.sfixed64,
  38281. r.TYPES.uint64,
  38282. r.TYPES.fixed64,
  38283. r.TYPES.bool,
  38284. r.TYPES.string,
  38285. r.TYPES.bytes,
  38286. ]),
  38287. (r.ID_MIN = 1),
  38288. (r.ID_MAX = 536870911),
  38289. (r.convertFieldsToCamelCase = !1),
  38290. (r.populateAccessors = !0),
  38291. (r.populateDefaults = !0),
  38292. (r.Util = (function () {
  38293. var t = {};
  38294. return (
  38295. (t.IS_NODE = !(
  38296. 'object' != typeof i ||
  38297. i + '' != '[object process]' ||
  38298. i.browser
  38299. )),
  38300. (t.XHR = function () {
  38301. for (
  38302. var e = [
  38303. function () {
  38304. return new XMLHttpRequest();
  38305. },
  38306. function () {
  38307. return new ActiveXObject('Msxml2.XMLHTTP');
  38308. },
  38309. function () {
  38310. return new ActiveXObject('Msxml3.XMLHTTP');
  38311. },
  38312. function () {
  38313. return new ActiveXObject('Microsoft.XMLHTTP');
  38314. },
  38315. ],
  38316. t = null,
  38317. i = 0;
  38318. i < e.length;
  38319. i++
  38320. ) {
  38321. try {
  38322. t = e[i]();
  38323. } catch (e) {
  38324. continue;
  38325. }
  38326. break;
  38327. }
  38328. if (!t) throw Error('XMLHttpRequest is not supported');
  38329. return t;
  38330. }),
  38331. (t.fetch = function (i, n) {
  38332. if ((n && 'function' != typeof n && (n = null), t.IS_NODE)) {
  38333. var r = e('fs');
  38334. if (n)
  38335. r.readFile(i, function (e, t) {
  38336. n(e ? null : '' + t);
  38337. });
  38338. else
  38339. try {
  38340. return r.readFileSync(i);
  38341. } catch (e) {
  38342. return null;
  38343. }
  38344. } else {
  38345. var o = t.XHR();
  38346. if (
  38347. (o.open('GET', i, !!n),
  38348. o.setRequestHeader('Accept', 'text/plain'),
  38349. 'function' == typeof o.overrideMimeType && o.overrideMimeType('text/plain'),
  38350. !n)
  38351. )
  38352. return (
  38353. o.send(null),
  38354. 200 == o.status || (0 == o.status && 'string' == typeof o.responseText)
  38355. ? o.responseText
  38356. : null
  38357. );
  38358. if (
  38359. ((o.onreadystatechange = function () {
  38360. 4 == o.readyState &&
  38361. n(
  38362. 200 == o.status ||
  38363. (0 == o.status && 'string' == typeof o.responseText)
  38364. ? o.responseText
  38365. : null
  38366. );
  38367. }),
  38368. 4 == o.readyState)
  38369. )
  38370. return;
  38371. o.send(null);
  38372. }
  38373. }),
  38374. (t.toCamelCase = function (e) {
  38375. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  38376. return t.toUpperCase();
  38377. });
  38378. }),
  38379. t
  38380. );
  38381. })()),
  38382. (r.Lang = {
  38383. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  38384. RULE: /^(?:required|optional|repeated|map)$/,
  38385. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  38386. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  38387. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  38388. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  38389. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  38390. NUMBER:
  38391. /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  38392. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  38393. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  38394. NUMBER_OCT: /^0[0-7]+$/,
  38395. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  38396. BOOL: /^(?:true|false)$/i,
  38397. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38398. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38399. WHITESPACE: /\s/,
  38400. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  38401. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  38402. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  38403. }),
  38404. (r.DotProto = (function (e, t) {
  38405. function i(e, i) {
  38406. var n = -1,
  38407. r = 1;
  38408. if (
  38409. ('-' == e.charAt(0) && ((r = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38410. )
  38411. n = parseInt(e);
  38412. else if (t.NUMBER_HEX.test(e)) n = parseInt(e.substring(2), 16);
  38413. else {
  38414. if (!t.NUMBER_OCT.test(e))
  38415. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e);
  38416. n = parseInt(e.substring(1), 8);
  38417. }
  38418. if (((n = (r * n) | 0), !i && n < 0))
  38419. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e);
  38420. return n;
  38421. }
  38422. function n(e) {
  38423. var i = 1;
  38424. if (
  38425. ('-' == e.charAt(0) && ((i = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38426. )
  38427. return i * parseInt(e, 10);
  38428. if (t.NUMBER_HEX.test(e)) return i * parseInt(e.substring(2), 16);
  38429. if (t.NUMBER_OCT.test(e)) return i * parseInt(e.substring(1), 8);
  38430. if ('inf' === e) return i * (1 / 0);
  38431. if ('nan' === e) return NaN;
  38432. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e);
  38433. throw Error('illegal number value: ' + (i < 0 ? '-' : '') + e);
  38434. }
  38435. function r(e, t, i) {
  38436. 'undefined' == typeof e[t]
  38437. ? (e[t] = i)
  38438. : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i));
  38439. }
  38440. var o = {},
  38441. a = function (e) {
  38442. (this.source = e + ''),
  38443. (this.index = 0),
  38444. (this.line = 1),
  38445. (this.stack = []),
  38446. (this._stringOpen = null);
  38447. },
  38448. s = a.prototype;
  38449. (s._readString = function () {
  38450. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  38451. e.lastIndex = this.index - 1;
  38452. var i = e.exec(this.source);
  38453. if (!i) throw Error('unterminated string');
  38454. return (
  38455. (this.index = e.lastIndex),
  38456. this.stack.push(this._stringOpen),
  38457. (this._stringOpen = null),
  38458. i[1]
  38459. );
  38460. }),
  38461. (s.next = function () {
  38462. if (this.stack.length > 0) return this.stack.shift();
  38463. if (this.index >= this.source.length) return null;
  38464. if (null !== this._stringOpen) return this._readString();
  38465. var e, i, n;
  38466. do {
  38467. for (e = !1; t.WHITESPACE.test((n = this.source.charAt(this.index))); )
  38468. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38469. return null;
  38470. if ('/' === this.source.charAt(this.index))
  38471. if ((++this.index, '/' === this.source.charAt(this.index))) {
  38472. for (; '\n' !== this.source.charAt(++this.index); )
  38473. if (this.index == this.source.length) return null;
  38474. ++this.index, ++this.line, (e = !0);
  38475. } else {
  38476. if ('*' !== (n = this.source.charAt(this.index))) return '/';
  38477. do {
  38478. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38479. return null;
  38480. (i = n), (n = this.source.charAt(this.index));
  38481. } while ('*' !== i || '/' !== n);
  38482. ++this.index, (e = !0);
  38483. }
  38484. } while (e);
  38485. if (this.index === this.source.length) return null;
  38486. var r = this.index;
  38487. t.DELIM.lastIndex = 0;
  38488. var o = t.DELIM.test(this.source.charAt(r++));
  38489. if (!o)
  38490. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); ) ++r;
  38491. var a = this.source.substring(this.index, (this.index = r));
  38492. return ('"' !== a && "'" !== a) || (this._stringOpen = a), a;
  38493. }),
  38494. (s.peek = function () {
  38495. if (0 === this.stack.length) {
  38496. var e = this.next();
  38497. if (null === e) return null;
  38498. this.stack.push(e);
  38499. }
  38500. return this.stack[0];
  38501. }),
  38502. (s.skip = function (e) {
  38503. var t = this.next();
  38504. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected");
  38505. }),
  38506. (s.omit = function (e) {
  38507. return this.peek() === e && (this.next(), !0);
  38508. }),
  38509. (s.toString = function () {
  38510. return (
  38511. 'Tokenizer (' +
  38512. this.index +
  38513. '/' +
  38514. this.source.length +
  38515. ' at line ' +
  38516. this.line +
  38517. ')'
  38518. );
  38519. }),
  38520. (o.Tokenizer = a);
  38521. var l = function (e) {
  38522. (this.tn = new a(e)), (this.proto3 = !1);
  38523. },
  38524. c = l.prototype;
  38525. return (
  38526. (c.parse = function () {
  38527. var e,
  38528. i,
  38529. n = {
  38530. name: '[ROOT]',
  38531. package: null,
  38532. messages: [],
  38533. enums: [],
  38534. imports: [],
  38535. options: {},
  38536. services: [],
  38537. },
  38538. r = !0;
  38539. try {
  38540. for (; (e = this.tn.next()); )
  38541. switch (e) {
  38542. case 'package':
  38543. if (!r || null !== n.package) throw Error("unexpected 'package'");
  38544. if (((e = this.tn.next()), !t.TYPEREF.test(e)))
  38545. throw Error('illegal package name: ' + e);
  38546. this.tn.skip(';'), (n.package = e);
  38547. break;
  38548. case 'import':
  38549. if (!r) throw Error("unexpected 'import'");
  38550. (e = this.tn.peek()),
  38551. ('public' === e || (i = 'weak' === e)) && this.tn.next(),
  38552. (e = this._readString()),
  38553. this.tn.skip(';'),
  38554. i || n.imports.push(e);
  38555. break;
  38556. case 'syntax':
  38557. if (!r) throw Error("unexpected 'syntax'");
  38558. this.tn.skip('='),
  38559. 'proto3' === (n.syntax = this._readString()) && (this.proto3 = !0),
  38560. this.tn.skip(';');
  38561. break;
  38562. case 'message':
  38563. this._parseMessage(n, null), (r = !1);
  38564. break;
  38565. case 'enum':
  38566. this._parseEnum(n), (r = !1);
  38567. break;
  38568. case 'option':
  38569. this._parseOption(n);
  38570. break;
  38571. case 'service':
  38572. this._parseService(n);
  38573. break;
  38574. case 'extend':
  38575. this._parseExtend(n);
  38576. break;
  38577. default:
  38578. throw Error("unexpected '" + e + "'");
  38579. }
  38580. } catch (e) {
  38581. throw (
  38582. ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  38583. );
  38584. }
  38585. return delete n.name, n;
  38586. }),
  38587. (l.parse = function (e) {
  38588. return new l(e).parse();
  38589. }),
  38590. (c._readString = function () {
  38591. var e,
  38592. t,
  38593. i = '';
  38594. do {
  38595. if (((t = this.tn.next()), "'" !== t && '"' !== t))
  38596. throw Error('illegal string delimiter: ' + t);
  38597. (i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek());
  38598. } while ('"' === e || '"' === e);
  38599. return i;
  38600. }),
  38601. (c._readValue = function (e) {
  38602. var i = this.tn.peek();
  38603. if ('"' === i || "'" === i) return this._readString();
  38604. if ((this.tn.next(), t.NUMBER.test(i))) return n(i);
  38605. if (t.BOOL.test(i)) return 'true' === i.toLowerCase();
  38606. if (e && t.TYPEREF.test(i)) return i;
  38607. throw Error('illegal value: ' + i);
  38608. }),
  38609. (c._parseOption = function (e, i) {
  38610. var n = this.tn.next(),
  38611. r = !1;
  38612. if (('(' === n && ((r = !0), (n = this.tn.next())), !t.TYPEREF.test(n)))
  38613. throw Error('illegal option name: ' + n);
  38614. var o = n;
  38615. r &&
  38616. (this.tn.skip(')'),
  38617. (o = '(' + o + ')'),
  38618. (n = this.tn.peek()),
  38619. t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  38620. this.tn.skip('='),
  38621. this._parseOptionValue(e, o),
  38622. i || this.tn.skip(';');
  38623. }),
  38624. (c._parseOptionValue = function (e, i) {
  38625. var n = this.tn.peek();
  38626. if ('{' !== n) r(e.options, i, this._readValue(!0));
  38627. else
  38628. for (this.tn.skip('{'); '}' !== (n = this.tn.next()); ) {
  38629. if (!t.NAME.test(n)) throw Error('illegal option name: ' + i + '.' + n);
  38630. this.tn.omit(':')
  38631. ? r(e.options, i + '.' + n, this._readValue(!0))
  38632. : this._parseOptionValue(e, i + '.' + n);
  38633. }
  38634. }),
  38635. (c._parseService = function (e) {
  38636. var i = this.tn.next();
  38637. if (!t.NAME.test(i))
  38638. throw Error('illegal service name at line ' + this.tn.line + ': ' + i);
  38639. var n = i,
  38640. r = {
  38641. name: n,
  38642. rpc: {},
  38643. options: {},
  38644. };
  38645. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38646. if ('option' === i) this._parseOption(r);
  38647. else {
  38648. if ('rpc' !== i) throw Error('illegal service token: ' + i);
  38649. this._parseServiceRPC(r);
  38650. }
  38651. this.tn.omit(';'), e.services.push(r);
  38652. }),
  38653. (c._parseServiceRPC = function (e) {
  38654. var i = 'rpc',
  38655. n = this.tn.next();
  38656. if (!t.NAME.test(n)) throw Error('illegal rpc service method name: ' + n);
  38657. var r = n,
  38658. o = {
  38659. request: null,
  38660. response: null,
  38661. request_stream: !1,
  38662. response_stream: !1,
  38663. options: {},
  38664. };
  38665. if (
  38666. (this.tn.skip('('),
  38667. (n = this.tn.next()),
  38668. 'stream' === n.toLowerCase() &&
  38669. ((o.request_stream = !0), (n = this.tn.next())),
  38670. !t.TYPEREF.test(n))
  38671. )
  38672. throw Error('illegal rpc service request type: ' + n);
  38673. if (
  38674. ((o.request = n),
  38675. this.tn.skip(')'),
  38676. (n = this.tn.next()),
  38677. 'returns' !== n.toLowerCase())
  38678. )
  38679. throw Error('illegal rpc service request type delimiter: ' + n);
  38680. if (
  38681. (this.tn.skip('('),
  38682. (n = this.tn.next()),
  38683. 'stream' === n.toLowerCase() &&
  38684. ((o.response_stream = !0), (n = this.tn.next())),
  38685. (o.response = n),
  38686. this.tn.skip(')'),
  38687. (n = this.tn.peek()),
  38688. '{' === n)
  38689. ) {
  38690. for (this.tn.next(); '}' !== (n = this.tn.next()); ) {
  38691. if ('option' !== n) throw Error('illegal rpc service token: ' + n);
  38692. this._parseOption(o);
  38693. }
  38694. this.tn.omit(';');
  38695. } else this.tn.skip(';');
  38696. 'undefined' == typeof e[i] && (e[i] = {}), (e[i][r] = o);
  38697. }),
  38698. (c._parseMessage = function (e, n) {
  38699. var r = !!n,
  38700. o = this.tn.next(),
  38701. a = {
  38702. name: '',
  38703. fields: [],
  38704. enums: [],
  38705. messages: [],
  38706. options: {},
  38707. services: [],
  38708. oneofs: {},
  38709. };
  38710. if (!t.NAME.test(o))
  38711. throw Error('illegal ' + (r ? 'group' : 'message') + ' name: ' + o);
  38712. for (
  38713. a.name = o,
  38714. r && (this.tn.skip('='), (n.id = i(this.tn.next())), (a.isGroup = !0)),
  38715. o = this.tn.peek(),
  38716. '[' === o && n && this._parseFieldOptions(n),
  38717. this.tn.skip('{');
  38718. '}' !== (o = this.tn.next());
  38719. )
  38720. if (t.RULE.test(o)) this._parseMessageField(a, o);
  38721. else if ('oneof' === o) this._parseMessageOneOf(a);
  38722. else if ('enum' === o) this._parseEnum(a);
  38723. else if ('message' === o) this._parseMessage(a);
  38724. else if ('option' === o) this._parseOption(a);
  38725. else if ('service' === o) this._parseService(a);
  38726. else if ('extensions' === o) a.extensions = this._parseExtensionRanges();
  38727. else if ('reserved' === o) this._parseIgnored();
  38728. else if ('extend' === o) this._parseExtend(a);
  38729. else {
  38730. if (!t.TYPEREF.test(o)) throw Error('illegal message token: ' + o);
  38731. if (!this.proto3) throw Error('illegal field rule: ' + o);
  38732. this._parseMessageField(a, 'optional', o);
  38733. }
  38734. return this.tn.omit(';'), e.messages.push(a), a;
  38735. }),
  38736. (c._parseIgnored = function () {
  38737. for (; ';' !== this.tn.peek(); ) this.tn.next();
  38738. this.tn.skip(';');
  38739. }),
  38740. (c._parseMessageField = function (e, n, r) {
  38741. if (!t.RULE.test(n)) throw Error('illegal message field rule: ' + n);
  38742. var o,
  38743. a = {
  38744. rule: n,
  38745. type: '',
  38746. name: '',
  38747. options: {},
  38748. id: 0,
  38749. };
  38750. if ('map' === n) {
  38751. if (r) throw Error('illegal type: ' + r);
  38752. if (
  38753. (this.tn.skip('<'),
  38754. (o = this.tn.next()),
  38755. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38756. )
  38757. throw Error('illegal message field type: ' + o);
  38758. if (
  38759. ((a.keytype = o),
  38760. this.tn.skip(','),
  38761. (o = this.tn.next()),
  38762. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38763. )
  38764. throw Error('illegal message field: ' + o);
  38765. if (((a.type = o), this.tn.skip('>'), (o = this.tn.next()), !t.NAME.test(o)))
  38766. throw Error('illegal message field name: ' + o);
  38767. (a.name = o),
  38768. this.tn.skip('='),
  38769. (a.id = i(this.tn.next())),
  38770. (o = this.tn.peek()),
  38771. '[' === o && this._parseFieldOptions(a),
  38772. this.tn.skip(';');
  38773. } else if (
  38774. ((r = 'undefined' != typeof r ? r : this.tn.next()), 'group' === r)
  38775. ) {
  38776. var s = this._parseMessage(e, a);
  38777. if (!/^[A-Z]/.test(s.name)) throw Error('illegal group name: ' + s.name);
  38778. (a.type = s.name), (a.name = s.name.toLowerCase()), this.tn.omit(';');
  38779. } else {
  38780. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  38781. throw Error('illegal message field type: ' + r);
  38782. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o)))
  38783. throw Error('illegal message field name: ' + o);
  38784. (a.name = o),
  38785. this.tn.skip('='),
  38786. (a.id = i(this.tn.next())),
  38787. (o = this.tn.peek()),
  38788. '[' === o && this._parseFieldOptions(a),
  38789. this.tn.skip(';');
  38790. }
  38791. return e.fields.push(a), a;
  38792. }),
  38793. (c._parseMessageOneOf = function (e) {
  38794. var i = this.tn.next();
  38795. if (!t.NAME.test(i)) throw Error('illegal oneof name: ' + i);
  38796. var n,
  38797. r = i,
  38798. o = [];
  38799. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38800. (n = this._parseMessageField(e, 'optional', i)), (n.oneof = r), o.push(n.id);
  38801. this.tn.omit(';'), (e.oneofs[r] = o);
  38802. }),
  38803. (c._parseFieldOptions = function (e) {
  38804. this.tn.skip('[');
  38805. for (var t, i = !0; ']' !== (t = this.tn.peek()); )
  38806. i || this.tn.skip(','), this._parseOption(e, !0), (i = !1);
  38807. this.tn.next();
  38808. }),
  38809. (c._parseEnum = function (e) {
  38810. var n = {
  38811. name: '',
  38812. values: [],
  38813. options: {},
  38814. },
  38815. r = this.tn.next();
  38816. if (!t.NAME.test(r)) throw Error('illegal name: ' + r);
  38817. for (n.name = r, this.tn.skip('{'); '}' !== (r = this.tn.next()); )
  38818. if ('option' === r) this._parseOption(n);
  38819. else {
  38820. if (!t.NAME.test(r)) throw Error('illegal name: ' + r);
  38821. this.tn.skip('=');
  38822. var o = {
  38823. name: r,
  38824. id: i(this.tn.next(), !0),
  38825. };
  38826. (r = this.tn.peek()),
  38827. '[' === r &&
  38828. this._parseFieldOptions({
  38829. options: {},
  38830. }),
  38831. this.tn.skip(';'),
  38832. n.values.push(o);
  38833. }
  38834. this.tn.omit(';'), e.enums.push(n);
  38835. }),
  38836. (c._parseExtensionRanges = function () {
  38837. var t,
  38838. i,
  38839. r,
  38840. o = [];
  38841. do {
  38842. for (i = []; ; ) {
  38843. switch ((t = this.tn.next())) {
  38844. case 'min':
  38845. r = e.ID_MIN;
  38846. break;
  38847. case 'max':
  38848. r = e.ID_MAX;
  38849. break;
  38850. default:
  38851. r = n(t);
  38852. }
  38853. if ((i.push(r), 2 === i.length)) break;
  38854. if ('to' !== this.tn.peek()) {
  38855. i.push(r);
  38856. break;
  38857. }
  38858. this.tn.next();
  38859. }
  38860. o.push(i);
  38861. } while (this.tn.omit(','));
  38862. return this.tn.skip(';'), o;
  38863. }),
  38864. (c._parseExtend = function (e) {
  38865. var i = this.tn.next();
  38866. if (!t.TYPEREF.test(i)) throw Error('illegal extend reference: ' + i);
  38867. var n = {
  38868. ref: i,
  38869. fields: [],
  38870. };
  38871. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38872. if (t.RULE.test(i)) this._parseMessageField(n, i);
  38873. else {
  38874. if (!t.TYPEREF.test(i)) throw Error('illegal extend token: ' + i);
  38875. if (!this.proto3) throw Error('illegal field rule: ' + i);
  38876. this._parseMessageField(n, 'optional', i);
  38877. }
  38878. return this.tn.omit(';'), e.messages.push(n), n;
  38879. }),
  38880. (c.toString = function () {
  38881. return 'Parser at line ' + this.tn.line;
  38882. }),
  38883. (o.Parser = l),
  38884. o
  38885. );
  38886. })(r, r.Lang)),
  38887. (r.Reflect = (function (e) {
  38888. function i(i) {
  38889. if (
  38890. ('string' == typeof i && (i = e.TYPES[i]), 'undefined' == typeof i.defaultValue)
  38891. )
  38892. throw Error('default value for type ' + i.name + ' is not supported');
  38893. return i == e.TYPES.bytes ? new t(0) : i.defaultValue;
  38894. }
  38895. function n(t, i) {
  38896. if (
  38897. t &&
  38898. 'number' == typeof t.low &&
  38899. 'number' == typeof t.high &&
  38900. 'boolean' == typeof t.unsigned &&
  38901. t.low === t.low &&
  38902. t.high === t.high
  38903. )
  38904. return new e.Long(t.low, t.high, 'undefined' == typeof i ? t.unsigned : i);
  38905. if ('string' == typeof t) return e.Long.fromString(t, i || !1, 10);
  38906. if ('number' == typeof t) return e.Long.fromNumber(t, i || !1);
  38907. throw Error('not convertible to Long');
  38908. }
  38909. function r(t, i) {
  38910. var n = i.readVarint32(),
  38911. o = 7 & n,
  38912. a = n >>> 3;
  38913. switch (o) {
  38914. case e.WIRE_TYPES.VARINT:
  38915. do n = i.readUint8();
  38916. while (128 === (128 & n));
  38917. break;
  38918. case e.WIRE_TYPES.BITS64:
  38919. i.offset += 8;
  38920. break;
  38921. case e.WIRE_TYPES.LDELIM:
  38922. (n = i.readVarint32()), (i.offset += n);
  38923. break;
  38924. case e.WIRE_TYPES.STARTGROUP:
  38925. r(a, i);
  38926. break;
  38927. case e.WIRE_TYPES.ENDGROUP:
  38928. if (a === t) return !1;
  38929. throw Error(
  38930. 'Illegal GROUPEND after unknown group: ' + a + ' (' + t + ' expected)'
  38931. );
  38932. case e.WIRE_TYPES.BITS32:
  38933. i.offset += 4;
  38934. break;
  38935. default:
  38936. throw Error('Illegal wire type in unknown group ' + t + ': ' + o);
  38937. }
  38938. return !0;
  38939. }
  38940. var o = {},
  38941. a = function (e, t, i) {
  38942. (this.builder = e), (this.parent = t), (this.name = i), this.className;
  38943. },
  38944. s = a.prototype;
  38945. (s.fqn = function () {
  38946. for (var e = this.name, t = this; ; ) {
  38947. if (((t = t.parent), null == t)) break;
  38948. e = t.name + '.' + e;
  38949. }
  38950. return e;
  38951. }),
  38952. (s.toString = function (e) {
  38953. return (e ? this.className + ' ' : '') + this.fqn();
  38954. }),
  38955. (s.build = function () {
  38956. throw Error(this.toString(!0) + ' cannot be built directly');
  38957. }),
  38958. (o.T = a);
  38959. var l = function (e, t, i, n, r) {
  38960. a.call(this, e, t, i),
  38961. (this.className = 'Namespace'),
  38962. (this.children = []),
  38963. (this.options = n || {}),
  38964. (this.syntax = r || 'proto2');
  38965. },
  38966. c = (l.prototype = Object.create(a.prototype));
  38967. (c.getChildren = function (e) {
  38968. if (((e = e || null), null == e)) return this.children.slice();
  38969. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  38970. this.children[i] instanceof e && t.push(this.children[i]);
  38971. return t;
  38972. }),
  38973. (c.addChild = function (e) {
  38974. var t;
  38975. if ((t = this.getChild(e.name)))
  38976. if (
  38977. t instanceof d.Field &&
  38978. t.name !== t.originalName &&
  38979. null === this.getChild(t.originalName)
  38980. )
  38981. t.name = t.originalName;
  38982. else {
  38983. if (
  38984. !(
  38985. e instanceof d.Field &&
  38986. e.name !== e.originalName &&
  38987. null === this.getChild(e.originalName)
  38988. )
  38989. )
  38990. throw Error(
  38991. 'Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name
  38992. );
  38993. e.name = e.originalName;
  38994. }
  38995. this.children.push(e);
  38996. }),
  38997. (c.getChild = function (e) {
  38998. for (
  38999. var t = 'number' == typeof e ? 'id' : 'name', i = 0, n = this.children.length;
  39000. i < n;
  39001. ++i
  39002. )
  39003. if (this.children[i][t] === e) return this.children[i];
  39004. return null;
  39005. }),
  39006. (c.resolve = function (e, t) {
  39007. var i = 'string' == typeof e ? e.split('.') : e,
  39008. n = this,
  39009. r = 0;
  39010. if ('' === i[r]) {
  39011. for (; null !== n.parent; ) n = n.parent;
  39012. r++;
  39013. }
  39014. var a;
  39015. do {
  39016. do {
  39017. if (!(n instanceof o.Namespace)) {
  39018. n = null;
  39019. break;
  39020. }
  39021. if (
  39022. ((a = n.getChild(i[r])),
  39023. !a || !(a instanceof o.T) || (t && !(a instanceof o.Namespace)))
  39024. ) {
  39025. n = null;
  39026. break;
  39027. }
  39028. (n = a), r++;
  39029. } while (r < i.length);
  39030. if (null != n) break;
  39031. if (null !== this.parent) return this.parent.resolve(e, t);
  39032. } while (null != n);
  39033. return n;
  39034. }),
  39035. (c.qn = function (e) {
  39036. var t = [],
  39037. i = e;
  39038. do t.unshift(i.name), (i = i.parent);
  39039. while (null !== i);
  39040. for (var n = 1; n <= t.length; n++) {
  39041. var r = t.slice(t.length - n);
  39042. if (e === this.resolve(r, e instanceof o.Namespace)) return r.join('.');
  39043. }
  39044. return e.fqn();
  39045. }),
  39046. (c.build = function () {
  39047. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  39048. (e = i[n]), e instanceof l && (t[e.name] = e.build());
  39049. return (
  39050. Object.defineProperty &&
  39051. Object.defineProperty(t, '$options', {
  39052. value: this.buildOpt(),
  39053. }),
  39054. t
  39055. );
  39056. }),
  39057. (c.buildOpt = function () {
  39058. for (
  39059. var e = {}, t = Object.keys(this.options), i = 0, n = t.length;
  39060. i < n;
  39061. ++i
  39062. ) {
  39063. var r = t[i],
  39064. o = this.options[t[i]];
  39065. e[r] = o;
  39066. }
  39067. return e;
  39068. }),
  39069. (c.getOption = function (e) {
  39070. return 'undefined' == typeof e
  39071. ? this.options
  39072. : 'undefined' != typeof this.options[e]
  39073. ? this.options[e]
  39074. : null;
  39075. }),
  39076. (o.Namespace = l);
  39077. var h = function (t, i, n, r) {
  39078. if (
  39079. ((this.type = t),
  39080. (this.resolvedType = i),
  39081. (this.isMapKey = n),
  39082. (this.syntax = r),
  39083. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  39084. )
  39085. throw Error('Invalid map key type: ' + t.name);
  39086. },
  39087. u = h.prototype;
  39088. (h.defaultFieldValue = i),
  39089. (u.verifyValue = function (i) {
  39090. function r(e, t) {
  39091. throw Error(
  39092. 'Illegal value for ' +
  39093. o.toString(!0) +
  39094. ' of type ' +
  39095. o.type.name +
  39096. ': ' +
  39097. e +
  39098. ' (' +
  39099. t +
  39100. ')'
  39101. );
  39102. }
  39103. var o = this;
  39104. switch (this.type) {
  39105. case e.TYPES.int32:
  39106. case e.TYPES.sint32:
  39107. case e.TYPES.sfixed32:
  39108. return (
  39109. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39110. r(typeof i, 'not an integer'),
  39111. i > 4294967295 ? 0 | i : i
  39112. );
  39113. case e.TYPES.uint32:
  39114. case e.TYPES.fixed32:
  39115. return (
  39116. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39117. r(typeof i, 'not an integer'),
  39118. i < 0 ? i >>> 0 : i
  39119. );
  39120. case e.TYPES.int64:
  39121. case e.TYPES.sint64:
  39122. case e.TYPES.sfixed64:
  39123. if (e.Long)
  39124. try {
  39125. return n(i, !1);
  39126. } catch (e) {
  39127. r(typeof i, e.message);
  39128. }
  39129. else r(typeof i, 'requires Long.js');
  39130. case e.TYPES.uint64:
  39131. case e.TYPES.fixed64:
  39132. if (e.Long)
  39133. try {
  39134. return n(i, !0);
  39135. } catch (e) {
  39136. r(typeof i, e.message);
  39137. }
  39138. else r(typeof i, 'requires Long.js');
  39139. case e.TYPES.bool:
  39140. return 'boolean' != typeof i && r(typeof i, 'not a boolean'), i;
  39141. case e.TYPES.float:
  39142. case e.TYPES.double:
  39143. return 'number' != typeof i && r(typeof i, 'not a number'), i;
  39144. case e.TYPES.string:
  39145. return (
  39146. 'string' == typeof i ||
  39147. (i && i instanceof String) ||
  39148. r(typeof i, 'not a string'),
  39149. '' + i
  39150. );
  39151. case e.TYPES.bytes:
  39152. return t.isByteBuffer(i) ? i : t.wrap(i, 'base64');
  39153. case e.TYPES.enum:
  39154. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  39155. for (l = 0; l < a.length; l++) {
  39156. if (a[l].name == i) return a[l].id;
  39157. if (a[l].id == i) return a[l].id;
  39158. }
  39159. if ('proto3' === this.syntax)
  39160. return (
  39161. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39162. r(typeof i, 'not an integer'),
  39163. (i > 4294967295 || i < 0) && r(typeof i, 'not in range for uint32'),
  39164. i
  39165. );
  39166. r(i, 'not a valid enum value');
  39167. case e.TYPES.group:
  39168. case e.TYPES.message:
  39169. if (
  39170. ((i && 'object' == typeof i) || r(typeof i, 'object expected'),
  39171. i instanceof this.resolvedType.clazz)
  39172. )
  39173. return i;
  39174. if (i instanceof e.Builder.Message) {
  39175. var s = {};
  39176. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l]);
  39177. i = s;
  39178. }
  39179. return new this.resolvedType.clazz(i);
  39180. }
  39181. throw Error(
  39182. '[INTERNAL] Illegal value for ' +
  39183. this.toString(!0) +
  39184. ': ' +
  39185. i +
  39186. ' (undefined type ' +
  39187. this.type +
  39188. ')'
  39189. );
  39190. }),
  39191. (u.calculateLength = function (i, n) {
  39192. if (null === n) return 0;
  39193. var r;
  39194. switch (this.type) {
  39195. case e.TYPES.int32:
  39196. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  39197. case e.TYPES.uint32:
  39198. return t.calculateVarint32(n);
  39199. case e.TYPES.sint32:
  39200. return t.calculateVarint32(t.zigZagEncode32(n));
  39201. case e.TYPES.fixed32:
  39202. case e.TYPES.sfixed32:
  39203. case e.TYPES.float:
  39204. return 4;
  39205. case e.TYPES.int64:
  39206. case e.TYPES.uint64:
  39207. return t.calculateVarint64(n);
  39208. case e.TYPES.sint64:
  39209. return t.calculateVarint64(t.zigZagEncode64(n));
  39210. case e.TYPES.fixed64:
  39211. case e.TYPES.sfixed64:
  39212. return 8;
  39213. case e.TYPES.bool:
  39214. return 1;
  39215. case e.TYPES.enum:
  39216. return t.calculateVarint32(n);
  39217. case e.TYPES.double:
  39218. return 8;
  39219. case e.TYPES.string:
  39220. return (r = t.calculateUTF8Bytes(n)), t.calculateVarint32(r) + r;
  39221. case e.TYPES.bytes:
  39222. if (n.remaining() < 0)
  39223. throw Error(
  39224. 'Illegal value for ' +
  39225. this.toString(!0) +
  39226. ': ' +
  39227. n.remaining() +
  39228. ' bytes remaining'
  39229. );
  39230. return t.calculateVarint32(n.remaining()) + n.remaining();
  39231. case e.TYPES.message:
  39232. return (r = this.resolvedType.calculate(n)), t.calculateVarint32(r) + r;
  39233. case e.TYPES.group:
  39234. return (
  39235. (r = this.resolvedType.calculate(n)),
  39236. r + t.calculateVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  39237. );
  39238. }
  39239. throw Error(
  39240. '[INTERNAL] Illegal value to encode in ' +
  39241. this.toString(!0) +
  39242. ': ' +
  39243. n +
  39244. ' (unknown type)'
  39245. );
  39246. }),
  39247. (u.encodeValue = function (i, n, r) {
  39248. if (null === n) return r;
  39249. switch (this.type) {
  39250. case e.TYPES.int32:
  39251. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  39252. break;
  39253. case e.TYPES.uint32:
  39254. r.writeVarint32(n);
  39255. break;
  39256. case e.TYPES.sint32:
  39257. r.writeVarint32ZigZag(n);
  39258. break;
  39259. case e.TYPES.fixed32:
  39260. r.writeUint32(n);
  39261. break;
  39262. case e.TYPES.sfixed32:
  39263. r.writeInt32(n);
  39264. break;
  39265. case e.TYPES.int64:
  39266. case e.TYPES.uint64:
  39267. r.writeVarint64(n);
  39268. break;
  39269. case e.TYPES.sint64:
  39270. r.writeVarint64ZigZag(n);
  39271. break;
  39272. case e.TYPES.fixed64:
  39273. r.writeUint64(n);
  39274. break;
  39275. case e.TYPES.sfixed64:
  39276. r.writeInt64(n);
  39277. break;
  39278. case e.TYPES.bool:
  39279. 'string' == typeof n
  39280. ? r.writeVarint32('false' === n.toLowerCase() ? 0 : !!n)
  39281. : r.writeVarint32(n ? 1 : 0);
  39282. break;
  39283. case e.TYPES.enum:
  39284. r.writeVarint32(n);
  39285. break;
  39286. case e.TYPES.float:
  39287. r.writeFloat32(n);
  39288. break;
  39289. case e.TYPES.double:
  39290. r.writeFloat64(n);
  39291. break;
  39292. case e.TYPES.string:
  39293. r.writeVString(n);
  39294. break;
  39295. case e.TYPES.bytes:
  39296. if (n.remaining() < 0)
  39297. throw Error(
  39298. 'Illegal value for ' +
  39299. this.toString(!0) +
  39300. ': ' +
  39301. n.remaining() +
  39302. ' bytes remaining'
  39303. );
  39304. var o = n.offset;
  39305. r.writeVarint32(n.remaining()), r.append(n), (n.offset = o);
  39306. break;
  39307. case e.TYPES.message:
  39308. var a = new t().LE();
  39309. this.resolvedType.encode(n, a),
  39310. r.writeVarint32(a.offset),
  39311. r.append(a.flip());
  39312. break;
  39313. case e.TYPES.group:
  39314. this.resolvedType.encode(n, r),
  39315. r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP);
  39316. break;
  39317. default:
  39318. throw Error(
  39319. '[INTERNAL] Illegal value to encode in ' +
  39320. this.toString(!0) +
  39321. ': ' +
  39322. n +
  39323. ' (unknown type)'
  39324. );
  39325. }
  39326. return r;
  39327. }),
  39328. (u.decode = function (t, i, n) {
  39329. if (i != this.type.wireType) throw Error('Unexpected wire type for element');
  39330. var r, o;
  39331. switch (this.type) {
  39332. case e.TYPES.int32:
  39333. return 0 | t.readVarint32();
  39334. case e.TYPES.uint32:
  39335. return t.readVarint32() >>> 0;
  39336. case e.TYPES.sint32:
  39337. return 0 | t.readVarint32ZigZag();
  39338. case e.TYPES.fixed32:
  39339. return t.readUint32() >>> 0;
  39340. case e.TYPES.sfixed32:
  39341. return 0 | t.readInt32();
  39342. case e.TYPES.int64:
  39343. return t.readVarint64();
  39344. case e.TYPES.uint64:
  39345. return t.readVarint64().toUnsigned();
  39346. case e.TYPES.sint64:
  39347. return t.readVarint64ZigZag();
  39348. case e.TYPES.fixed64:
  39349. return t.readUint64();
  39350. case e.TYPES.sfixed64:
  39351. return t.readInt64();
  39352. case e.TYPES.bool:
  39353. return !!t.readVarint32();
  39354. case e.TYPES.enum:
  39355. return t.readVarint32();
  39356. case e.TYPES.float:
  39357. return t.readFloat();
  39358. case e.TYPES.double:
  39359. return t.readDouble();
  39360. case e.TYPES.string:
  39361. return t.readVString();
  39362. case e.TYPES.bytes:
  39363. if (((o = t.readVarint32()), t.remaining() < o))
  39364. throw Error(
  39365. 'Illegal number of bytes for ' +
  39366. this.toString(!0) +
  39367. ': ' +
  39368. o +
  39369. ' required but got only ' +
  39370. t.remaining()
  39371. );
  39372. return (r = t.clone()), (r.limit = r.offset + o), (t.offset += o), r;
  39373. case e.TYPES.message:
  39374. return (o = t.readVarint32()), this.resolvedType.decode(t, o);
  39375. case e.TYPES.group:
  39376. return this.resolvedType.decode(t, -1, n);
  39377. }
  39378. throw Error('[INTERNAL] Illegal decode type');
  39379. }),
  39380. (u.valueFromString = function (i) {
  39381. if (!this.isMapKey)
  39382. throw Error('valueFromString() called on non-map-key element');
  39383. switch (this.type) {
  39384. case e.TYPES.int32:
  39385. case e.TYPES.sint32:
  39386. case e.TYPES.sfixed32:
  39387. case e.TYPES.uint32:
  39388. case e.TYPES.fixed32:
  39389. return this.verifyValue(parseInt(i));
  39390. case e.TYPES.int64:
  39391. case e.TYPES.sint64:
  39392. case e.TYPES.sfixed64:
  39393. case e.TYPES.uint64:
  39394. case e.TYPES.fixed64:
  39395. return this.verifyValue(i);
  39396. case e.TYPES.bool:
  39397. return 'true' === i;
  39398. case e.TYPES.string:
  39399. return this.verifyValue(i);
  39400. case e.TYPES.bytes:
  39401. return t.fromBinary(i);
  39402. }
  39403. }),
  39404. (u.valueToString = function (t) {
  39405. if (!this.isMapKey)
  39406. throw Error('valueToString() called on non-map-key element');
  39407. return this.type === e.TYPES.bytes ? t.toString('binary') : t.toString();
  39408. }),
  39409. (o.Element = h);
  39410. var d = function (e, t, i, n, r, o) {
  39411. l.call(this, e, t, i, n, o),
  39412. (this.className = 'Message'),
  39413. (this.extensions = void 0),
  39414. (this.clazz = null),
  39415. (this.isGroup = !!r),
  39416. (this._fields = null),
  39417. (this._fieldsById = null),
  39418. (this._fieldsByName = null);
  39419. },
  39420. p = (d.prototype = Object.create(l.prototype));
  39421. (p.build = function (i) {
  39422. if (this.clazz && !i) return this.clazz;
  39423. var n = (function (e, i) {
  39424. function n(i, r, o, a) {
  39425. if (null === i || 'object' != typeof i) {
  39426. if (a && a instanceof e.Reflect.Enum) {
  39427. var s = e.Reflect.Enum.getName(a.object, i);
  39428. if (null !== s) return s;
  39429. }
  39430. return i;
  39431. }
  39432. if (t.isByteBuffer(i)) return r ? i.toBase64() : i.toBuffer();
  39433. if (e.Long.isLong(i)) return o ? i.toString() : e.Long.fromValue(i);
  39434. var l;
  39435. if (Array.isArray(i))
  39436. return (
  39437. (l = []),
  39438. i.forEach(function (e, t) {
  39439. l[t] = n(e, r, o, a);
  39440. }),
  39441. l
  39442. );
  39443. if (((l = {}), i instanceof e.Map)) {
  39444. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  39445. l[i.keyElem.valueToString(h.value[0])] = n(
  39446. h.value[1],
  39447. r,
  39448. o,
  39449. i.valueElem.resolvedType
  39450. );
  39451. return l;
  39452. }
  39453. var u = i.$type,
  39454. d = void 0;
  39455. for (var p in i)
  39456. i.hasOwnProperty(p) &&
  39457. (u && (d = u.getChild(p))
  39458. ? (l[p] = n(i[p], r, o, d.resolvedType))
  39459. : (l[p] = n(i[p], r, o)));
  39460. return l;
  39461. }
  39462. var r = i.getChildren(e.Reflect.Message.Field),
  39463. o = i.getChildren(e.Reflect.Message.OneOf),
  39464. a = function (n, s) {
  39465. e.Builder.Message.call(this);
  39466. for (var l = 0, c = o.length; l < c; ++l) this[o[l].name] = null;
  39467. for (l = 0, c = r.length; l < c; ++l) {
  39468. var h = r[l];
  39469. (this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null),
  39470. (!h.required && 'proto3' !== i.syntax) ||
  39471. null === h.defaultValue ||
  39472. (this[h.name] = h.defaultValue);
  39473. }
  39474. if (arguments.length > 0) {
  39475. var u;
  39476. if (
  39477. 1 !== arguments.length ||
  39478. null === n ||
  39479. 'object' != typeof n ||
  39480. !('function' != typeof n.encode || n instanceof a) ||
  39481. Array.isArray(n) ||
  39482. n instanceof e.Map ||
  39483. t.isByteBuffer(n) ||
  39484. n instanceof ArrayBuffer ||
  39485. (e.Long && n instanceof e.Long)
  39486. )
  39487. for (l = 0, c = arguments.length; l < c; ++l)
  39488. 'undefined' != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  39489. else this.$set(n);
  39490. }
  39491. },
  39492. s = (a.prototype = Object.create(e.Builder.Message.prototype));
  39493. (s.add = function (t, n, r) {
  39494. var o = i._fieldsByName[t];
  39495. if (!r) {
  39496. if (!o) throw Error(this + '#' + t + ' is undefined');
  39497. if (!(o instanceof e.Reflect.Message.Field))
  39498. throw Error(this + '#' + t + ' is not a field: ' + o.toString(!0));
  39499. if (!o.repeated) throw Error(this + '#' + t + ' is not a repeated field');
  39500. n = o.verifyValue(n, !0);
  39501. }
  39502. return null === this[t] && (this[t] = []), this[t].push(n), this;
  39503. }),
  39504. (s.$add = s.add),
  39505. (s.set = function (t, n, r) {
  39506. if (t && 'object' == typeof t) {
  39507. r = n;
  39508. for (var o in t)
  39509. t.hasOwnProperty(o) &&
  39510. 'undefined' != typeof (n = t[o]) &&
  39511. this.$set(o, n, r);
  39512. return this;
  39513. }
  39514. var a = i._fieldsByName[t];
  39515. if (r) this[t] = n;
  39516. else {
  39517. if (!a) throw Error(this + '#' + t + ' is not a field: undefined');
  39518. if (!(a instanceof e.Reflect.Message.Field))
  39519. throw Error(this + '#' + t + ' is not a field: ' + a.toString(!0));
  39520. this[a.name] = n = a.verifyValue(n);
  39521. }
  39522. if (a && a.oneof) {
  39523. var s = this[a.oneof.name];
  39524. null !== n
  39525. ? (null !== s && s !== a.name && (this[s] = null),
  39526. (this[a.oneof.name] = a.name))
  39527. : s === t && (this[a.oneof.name] = null);
  39528. }
  39529. return this;
  39530. }),
  39531. (s.$set = s.set),
  39532. (s.get = function (t, n) {
  39533. if (n) return this[t];
  39534. var r = i._fieldsByName[t];
  39535. if (!(r && r instanceof e.Reflect.Message.Field))
  39536. throw Error(this + '#' + t + ' is not a field: undefined');
  39537. if (!(r instanceof e.Reflect.Message.Field))
  39538. throw Error(this + '#' + t + ' is not a field: ' + r.toString(!0));
  39539. return this[r.name];
  39540. }),
  39541. (s.$get = s.get);
  39542. for (var l = 0; l < r.length; l++) {
  39543. var c = r[l];
  39544. c instanceof e.Reflect.Message.ExtensionField ||
  39545. (i.builder.options.populateAccessors &&
  39546. (function (e) {
  39547. var t = e.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  39548. return e.toUpperCase().replace('_', '');
  39549. });
  39550. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  39551. var n = e.originalName.replace(/([A-Z])/g, function (e) {
  39552. return '_' + e;
  39553. }),
  39554. r = function (t, i) {
  39555. return (this[e.name] = i ? t : e.verifyValue(t)), this;
  39556. },
  39557. o = function () {
  39558. return this[e.name];
  39559. };
  39560. null === i.getChild('set' + t) && (s['set' + t] = r),
  39561. null === i.getChild('set_' + n) && (s['set_' + n] = r),
  39562. null === i.getChild('get' + t) && (s['get' + t] = o),
  39563. null === i.getChild('get_' + n) && (s['get_' + n] = o);
  39564. })(c));
  39565. }
  39566. (s.encode = function (e, n) {
  39567. 'boolean' == typeof e && ((n = e), (e = void 0));
  39568. var r = !1;
  39569. e || ((e = new t()), (r = !0));
  39570. var o = e.littleEndian;
  39571. try {
  39572. return i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o);
  39573. } catch (t) {
  39574. throw (e.LE(o), t);
  39575. }
  39576. }),
  39577. (a.encode = function (e, t, i) {
  39578. return new a(e).encode(t, i);
  39579. }),
  39580. (s.calculate = function () {
  39581. return i.calculate(this);
  39582. }),
  39583. (s.encodeDelimited = function (e, n) {
  39584. var r = !1;
  39585. e || ((e = new t()), (r = !0));
  39586. var o = new t().LE();
  39587. return (
  39588. i.encode(this, o, n).flip(),
  39589. e.writeVarint32(o.remaining()),
  39590. e.append(o),
  39591. r ? e.flip() : e
  39592. );
  39593. }),
  39594. (s.encodeAB = function () {
  39595. try {
  39596. return this.encode().toArrayBuffer();
  39597. } catch (e) {
  39598. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e);
  39599. }
  39600. }),
  39601. (s.toArrayBuffer = s.encodeAB),
  39602. (s.encodeNB = function () {
  39603. try {
  39604. return this.encode().toBuffer();
  39605. } catch (e) {
  39606. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e);
  39607. }
  39608. }),
  39609. (s.toBuffer = s.encodeNB),
  39610. (s.encode64 = function () {
  39611. try {
  39612. return this.encode().toBase64();
  39613. } catch (e) {
  39614. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e);
  39615. }
  39616. }),
  39617. (s.toBase64 = s.encode64),
  39618. (s.encodeHex = function () {
  39619. try {
  39620. return this.encode().toHex();
  39621. } catch (e) {
  39622. throw (e.encoded && (e.encoded = e.encoded.toHex()), e);
  39623. }
  39624. }),
  39625. (s.toHex = s.encodeHex),
  39626. (s.toRaw = function (e, t) {
  39627. return n(this, !!e, !!t, this.$type);
  39628. }),
  39629. (s.encodeJSON = function () {
  39630. return JSON.stringify(n(this, !0, !0, this.$type));
  39631. }),
  39632. (a.decode = function (e, n, r) {
  39633. 'string' == typeof n && ((r = n), (n = -1)),
  39634. 'string' == typeof e && (e = t.wrap(e, r ? r : 'base64')),
  39635. (e = t.isByteBuffer(e) ? e : t.wrap(e));
  39636. var o = e.littleEndian;
  39637. try {
  39638. var a = i.decode(e.LE());
  39639. return e.LE(o), a;
  39640. } catch (t) {
  39641. throw (e.LE(o), t);
  39642. }
  39643. }),
  39644. (a.decodeDelimited = function (e, n) {
  39645. if (
  39646. ('string' == typeof e && (e = t.wrap(e, n ? n : 'base64')),
  39647. (e = t.isByteBuffer(e) ? e : t.wrap(e)),
  39648. e.remaining() < 1)
  39649. )
  39650. return null;
  39651. var r = e.offset,
  39652. o = e.readVarint32();
  39653. if (e.remaining() < o) return (e.offset = r), null;
  39654. try {
  39655. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  39656. return (e.offset += o), a;
  39657. } catch (t) {
  39658. throw ((e.offset += o), t);
  39659. }
  39660. }),
  39661. (a.decode64 = function (e) {
  39662. return a.decode(e, 'base64');
  39663. }),
  39664. (a.decodeHex = function (e) {
  39665. return a.decode(e, 'hex');
  39666. }),
  39667. (a.decodeJSON = function (e) {
  39668. return new a(JSON.parse(e));
  39669. }),
  39670. (s.toString = function () {
  39671. return i.toString();
  39672. });
  39673. return (
  39674. Object.defineProperty &&
  39675. (Object.defineProperty(a, '$options', {
  39676. value: i.buildOpt(),
  39677. }),
  39678. Object.defineProperty(s, '$options', {
  39679. value: a.$options,
  39680. }),
  39681. Object.defineProperty(a, '$type', {
  39682. value: i,
  39683. }),
  39684. Object.defineProperty(s, '$type', {
  39685. value: i,
  39686. })),
  39687. a
  39688. );
  39689. })(e, this);
  39690. (this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {});
  39691. for (var r, o = 0, a = this.children.length; o < a; o++)
  39692. if (
  39693. ((r = this.children[o]), r instanceof A || r instanceof d || r instanceof E)
  39694. ) {
  39695. if (n.hasOwnProperty(r.name))
  39696. throw Error(
  39697. 'Illegal reflect child of ' +
  39698. this.toString(!0) +
  39699. ': ' +
  39700. r.toString(!0) +
  39701. " cannot override static property '" +
  39702. r.name +
  39703. "'"
  39704. );
  39705. n[r.name] = r.build();
  39706. } else if (r instanceof d.Field)
  39707. r.build(),
  39708. this._fields.push(r),
  39709. (this._fieldsById[r.id] = r),
  39710. (this._fieldsByName[r.name] = r);
  39711. else if (!(r instanceof d.OneOf || r instanceof I))
  39712. throw Error(
  39713. 'Illegal reflect child of ' +
  39714. this.toString(!0) +
  39715. ': ' +
  39716. this.children[o].toString(!0)
  39717. );
  39718. return (this.clazz = n);
  39719. }),
  39720. (p.encode = function (e, t, i) {
  39721. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  39722. (n = this._fields[a]),
  39723. (r = e[n.name]),
  39724. n.required && null === r
  39725. ? null === o && (o = n)
  39726. : n.encode(i ? r : n.verifyValue(r), t, e);
  39727. if (null !== o) {
  39728. var l = Error(
  39729. 'Missing at least one required field for ' + this.toString(!0) + ': ' + o
  39730. );
  39731. throw ((l.encoded = t), l);
  39732. }
  39733. return t;
  39734. }),
  39735. (p.calculate = function (e) {
  39736. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  39737. if (((t = this._fields[r]), (i = e[t.name]), t.required && null === i))
  39738. throw Error(
  39739. 'Missing at least one required field for ' + this.toString(!0) + ': ' + t
  39740. );
  39741. n += t.calculate(i, e);
  39742. }
  39743. return n;
  39744. }),
  39745. (p.decode = function (t, i, n) {
  39746. i = 'number' == typeof i ? i : -1;
  39747. for (
  39748. var o, a, s, l, c = t.offset, h = new this.clazz();
  39749. t.offset < c + i || (i === -1 && t.remaining() > 0);
  39750. ) {
  39751. if (
  39752. ((o = t.readVarint32()),
  39753. (a = 7 & o),
  39754. (s = o >>> 3),
  39755. a === e.WIRE_TYPES.ENDGROUP)
  39756. ) {
  39757. if (s !== n)
  39758. throw Error(
  39759. 'Illegal group end indicator for ' +
  39760. this.toString(!0) +
  39761. ': ' +
  39762. s +
  39763. ' (' +
  39764. (n ? n + ' expected' : 'not a group') +
  39765. ')'
  39766. );
  39767. break;
  39768. }
  39769. if ((l = this._fieldsById[s])) {
  39770. if (l.repeated && !l.options.packed) h[l.name].push(l.decode(a, t));
  39771. else if (l.map) {
  39772. var u = l.decode(a, t);
  39773. h[l.name].set(u[0], u[1]);
  39774. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  39775. var d = h[l.oneof.name];
  39776. null !== d && d !== l.name && (h[d] = null), (h[l.oneof.name] = l.name);
  39777. }
  39778. } else
  39779. switch (a) {
  39780. case e.WIRE_TYPES.VARINT:
  39781. t.readVarint32();
  39782. break;
  39783. case e.WIRE_TYPES.BITS32:
  39784. t.offset += 4;
  39785. break;
  39786. case e.WIRE_TYPES.BITS64:
  39787. t.offset += 8;
  39788. break;
  39789. case e.WIRE_TYPES.LDELIM:
  39790. var p = t.readVarint32();
  39791. t.offset += p;
  39792. break;
  39793. case e.WIRE_TYPES.STARTGROUP:
  39794. for (; r(s, t); );
  39795. break;
  39796. default:
  39797. throw Error(
  39798. 'Illegal wire type for unknown field ' +
  39799. s +
  39800. ' in ' +
  39801. this.toString(!0) +
  39802. '#decode: ' +
  39803. a
  39804. );
  39805. }
  39806. }
  39807. for (var f = 0, g = this._fields.length; f < g; ++f)
  39808. if (((l = this._fields[f]), null === h[l.name]))
  39809. if ('proto3' === this.syntax) h[l.name] = l.defaultValue;
  39810. else {
  39811. if (l.required) {
  39812. var m = Error(
  39813. 'Missing at least one required field for ' +
  39814. this.toString(!0) +
  39815. ': ' +
  39816. l.name
  39817. );
  39818. throw ((m.decoded = h), m);
  39819. }
  39820. e.populateDefaults &&
  39821. null !== l.defaultValue &&
  39822. (h[l.name] = l.defaultValue);
  39823. }
  39824. return h;
  39825. }),
  39826. (o.Message = d);
  39827. var f = function (t, i, n, r, o, s, l, c, h, u) {
  39828. a.call(this, t, i, s),
  39829. (this.className = 'Message.Field'),
  39830. (this.required = 'required' === n),
  39831. (this.repeated = 'repeated' === n),
  39832. (this.map = 'map' === n),
  39833. (this.keyType = r || null),
  39834. (this.type = o),
  39835. (this.resolvedType = null),
  39836. (this.id = l),
  39837. (this.options = c || {}),
  39838. (this.defaultValue = null),
  39839. (this.oneof = h || null),
  39840. (this.syntax = u || 'proto2'),
  39841. (this.originalName = this.name),
  39842. (this.element = null),
  39843. (this.keyElement = null),
  39844. !this.builder.options.convertFieldsToCamelCase ||
  39845. this instanceof d.ExtensionField ||
  39846. (this.name = e.Util.toCamelCase(this.name));
  39847. },
  39848. g = (f.prototype = Object.create(a.prototype));
  39849. (g.build = function () {
  39850. (this.element = new h(this.type, this.resolvedType, !1, this.syntax)),
  39851. this.map && (this.keyElement = new h(this.keyType, void 0, !0, this.syntax)),
  39852. 'proto3' !== this.syntax || this.repeated || this.map
  39853. ? 'undefined' != typeof this.options.default &&
  39854. (this.defaultValue = this.verifyValue(this.options.default))
  39855. : (this.defaultValue = h.defaultFieldValue(this.type));
  39856. }),
  39857. (g.verifyValue = function (t, i) {
  39858. function n(e, t) {
  39859. throw Error(
  39860. 'Illegal value for ' +
  39861. r.toString(!0) +
  39862. ' of type ' +
  39863. r.type.name +
  39864. ': ' +
  39865. e +
  39866. ' (' +
  39867. t +
  39868. ')'
  39869. );
  39870. }
  39871. i = i || !1;
  39872. var r = this;
  39873. if (null === t)
  39874. return (
  39875. this.required && n(typeof t, 'required'),
  39876. 'proto3' === this.syntax &&
  39877. this.type !== e.TYPES.message &&
  39878. n(typeof t, 'proto3 field without field presence cannot be null'),
  39879. null
  39880. );
  39881. var o;
  39882. if (this.repeated && !i) {
  39883. Array.isArray(t) || (t = [t]);
  39884. var a = [];
  39885. for (o = 0; o < t.length; o++) a.push(this.element.verifyValue(t[o]));
  39886. return a;
  39887. }
  39888. return this.map && !i
  39889. ? t instanceof e.Map
  39890. ? t
  39891. : (t instanceof Object ||
  39892. n(typeof t, 'expected ProtoBuf.Map or raw object for map field'),
  39893. new e.Map(this, t))
  39894. : (!this.repeated && Array.isArray(t) && n(typeof t, 'no array expected'),
  39895. this.element.verifyValue(t));
  39896. }),
  39897. (g.hasWirePresence = function (t, i) {
  39898. if ('proto3' !== this.syntax) return null !== t;
  39899. if (this.oneof && i[this.oneof.name] === this.name) return !0;
  39900. switch (this.type) {
  39901. case e.TYPES.int32:
  39902. case e.TYPES.sint32:
  39903. case e.TYPES.sfixed32:
  39904. case e.TYPES.uint32:
  39905. case e.TYPES.fixed32:
  39906. return 0 !== t;
  39907. case e.TYPES.int64:
  39908. case e.TYPES.sint64:
  39909. case e.TYPES.sfixed64:
  39910. case e.TYPES.uint64:
  39911. case e.TYPES.fixed64:
  39912. return 0 !== t.low || 0 !== t.high;
  39913. case e.TYPES.bool:
  39914. return t;
  39915. case e.TYPES.float:
  39916. case e.TYPES.double:
  39917. return 0 !== t;
  39918. case e.TYPES.string:
  39919. return t.length > 0;
  39920. case e.TYPES.bytes:
  39921. return t.remaining() > 0;
  39922. case e.TYPES.enum:
  39923. return 0 !== t;
  39924. case e.TYPES.message:
  39925. return null !== t;
  39926. default:
  39927. return !0;
  39928. }
  39929. }),
  39930. (g.encode = function (i, n, r) {
  39931. if (null === this.type || 'object' != typeof this.type)
  39932. throw Error(
  39933. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  39934. );
  39935. if (null === i || (this.repeated && 0 == i.length)) return n;
  39936. try {
  39937. if (this.repeated) {
  39938. var o;
  39939. if (
  39940. this.options.packed &&
  39941. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  39942. ) {
  39943. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  39944. n.ensureCapacity((n.offset += 1));
  39945. var a = n.offset;
  39946. for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n);
  39947. var s = n.offset - a,
  39948. l = t.calculateVarint32(s);
  39949. if (l > 1) {
  39950. var c = n.slice(a, n.offset);
  39951. (a += l - 1), (n.offset = a), n.append(c);
  39952. }
  39953. n.writeVarint32(s, a - l);
  39954. } else
  39955. for (o = 0; o < i.length; o++)
  39956. n.writeVarint32((this.id << 3) | this.type.wireType),
  39957. this.element.encodeValue(this.id, i[o], n);
  39958. } else
  39959. this.map
  39960. ? i.forEach(function (i, r, o) {
  39961. var a =
  39962. t.calculateVarint32(8 | this.keyType.wireType) +
  39963. this.keyElement.calculateLength(1, r) +
  39964. t.calculateVarint32(16 | this.type.wireType) +
  39965. this.element.calculateLength(2, i);
  39966. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  39967. n.writeVarint32(a),
  39968. n.writeVarint32(8 | this.keyType.wireType),
  39969. this.keyElement.encodeValue(1, r, n),
  39970. n.writeVarint32(16 | this.type.wireType),
  39971. this.element.encodeValue(2, i, n);
  39972. }, this)
  39973. : this.hasWirePresence(i, r) &&
  39974. (n.writeVarint32((this.id << 3) | this.type.wireType),
  39975. this.element.encodeValue(this.id, i, n));
  39976. } catch (e) {
  39977. throw Error(
  39978. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  39979. );
  39980. }
  39981. return n;
  39982. }),
  39983. (g.calculate = function (i, n) {
  39984. if (
  39985. ((i = this.verifyValue(i)),
  39986. null === this.type || 'object' != typeof this.type)
  39987. )
  39988. throw Error(
  39989. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  39990. );
  39991. if (null === i || (this.repeated && 0 == i.length)) return 0;
  39992. var r = 0;
  39993. try {
  39994. if (this.repeated) {
  39995. var o, a;
  39996. if (
  39997. this.options.packed &&
  39998. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  39999. ) {
  40000. for (
  40001. r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  40002. a = 0,
  40003. o = 0;
  40004. o < i.length;
  40005. o++
  40006. )
  40007. a += this.element.calculateLength(this.id, i[o]);
  40008. (r += t.calculateVarint32(a)), (r += a);
  40009. } else
  40010. for (o = 0; o < i.length; o++)
  40011. (r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40012. (r += this.element.calculateLength(this.id, i[o]));
  40013. } else
  40014. this.map
  40015. ? i.forEach(function (i, n, o) {
  40016. var a =
  40017. t.calculateVarint32(8 | this.keyType.wireType) +
  40018. this.keyElement.calculateLength(1, n) +
  40019. t.calculateVarint32(16 | this.type.wireType) +
  40020. this.element.calculateLength(2, i);
  40021. (r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM)),
  40022. (r += t.calculateVarint32(a)),
  40023. (r += a);
  40024. }, this)
  40025. : this.hasWirePresence(i, n) &&
  40026. ((r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40027. (r += this.element.calculateLength(this.id, i)));
  40028. } catch (e) {
  40029. throw Error(
  40030. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  40031. );
  40032. }
  40033. return r;
  40034. }),
  40035. (g.decode = function (t, i, n) {
  40036. var r,
  40037. o,
  40038. a =
  40039. (!this.map && t == this.type.wireType) ||
  40040. (!n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM) ||
  40041. (this.map && t == e.WIRE_TYPES.LDELIM);
  40042. if (!a)
  40043. throw Error(
  40044. 'Illegal wire type for field ' +
  40045. this.toString(!0) +
  40046. ': ' +
  40047. t +
  40048. ' (' +
  40049. this.type.wireType +
  40050. ' expected)'
  40051. );
  40052. if (
  40053. t == e.WIRE_TYPES.LDELIM &&
  40054. this.repeated &&
  40055. this.options.packed &&
  40056. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 &&
  40057. !n
  40058. ) {
  40059. (o = i.readVarint32()), (o = i.offset + o);
  40060. for (var s = []; i.offset < o; )
  40061. s.push(this.decode(this.type.wireType, i, !0));
  40062. return s;
  40063. }
  40064. if (this.map) {
  40065. var l = h.defaultFieldValue(this.keyType);
  40066. if (
  40067. ((r = h.defaultFieldValue(this.type)),
  40068. (o = i.readVarint32()),
  40069. i.remaining() < o)
  40070. )
  40071. throw Error(
  40072. 'Illegal number of bytes for ' +
  40073. this.toString(!0) +
  40074. ': ' +
  40075. o +
  40076. ' required but got only ' +
  40077. i.remaining()
  40078. );
  40079. var c = i.clone();
  40080. for (c.limit = c.offset + o, i.offset += o; c.remaining() > 0; ) {
  40081. var u = c.readVarint32();
  40082. t = 7 & u;
  40083. var d = u >>> 3;
  40084. if (1 === d) l = this.keyElement.decode(c, t, d);
  40085. else {
  40086. if (2 !== d)
  40087. throw Error('Unexpected tag in map field key/value submessage');
  40088. r = this.element.decode(c, t, d);
  40089. }
  40090. }
  40091. return [l, r];
  40092. }
  40093. return this.element.decode(i, t, this.id);
  40094. }),
  40095. (o.Message.Field = f);
  40096. var m = function (e, t, i, n, r, o, a) {
  40097. f.call(this, e, t, i, null, n, r, o, a), this.extension;
  40098. };
  40099. (m.prototype = Object.create(f.prototype)), (o.Message.ExtensionField = m);
  40100. var v = function (e, t, i) {
  40101. a.call(this, e, t, i), (this.fields = []);
  40102. };
  40103. o.Message.OneOf = v;
  40104. var A = function (e, t, i, n, r) {
  40105. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null);
  40106. };
  40107. A.getName = function (e, t) {
  40108. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  40109. if (e[(i = n[r])] === t) return i;
  40110. return null;
  40111. };
  40112. var y = (A.prototype = Object.create(l.prototype));
  40113. (y.build = function (t) {
  40114. if (this.object && !t) return this.object;
  40115. for (
  40116. var i = new e.Builder.Enum(),
  40117. n = this.getChildren(A.Value),
  40118. r = 0,
  40119. o = n.length;
  40120. r < o;
  40121. ++r
  40122. )
  40123. i[n[r].name] = n[r].id;
  40124. return (
  40125. Object.defineProperty &&
  40126. Object.defineProperty(i, '$options', {
  40127. value: this.buildOpt(),
  40128. enumerable: !1,
  40129. }),
  40130. (this.object = i)
  40131. );
  40132. }),
  40133. (o.Enum = A);
  40134. var C = function (e, t, i, n) {
  40135. a.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n);
  40136. };
  40137. (C.prototype = Object.create(a.prototype)), (o.Enum.Value = C);
  40138. var I = function (e, t, i, n) {
  40139. a.call(this, e, t, i), (this.field = n);
  40140. };
  40141. (I.prototype = Object.create(a.prototype)), (o.Extension = I);
  40142. var E = function (e, t, i, n) {
  40143. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null);
  40144. },
  40145. b = (E.prototype = Object.create(l.prototype));
  40146. (b.build = function (i) {
  40147. return this.clazz && !i
  40148. ? this.clazz
  40149. : (this.clazz = (function (e, i) {
  40150. for (
  40151. var n = function (t) {
  40152. e.Builder.Service.call(this),
  40153. (this.rpcImpl =
  40154. t ||
  40155. function (e, t, i) {
  40156. setTimeout(
  40157. i.bind(
  40158. this,
  40159. Error(
  40160. 'Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services'
  40161. )
  40162. ),
  40163. 0
  40164. );
  40165. });
  40166. },
  40167. r = (n.prototype = Object.create(e.Builder.Service.prototype)),
  40168. o = i.getChildren(e.Reflect.Service.RPCMethod),
  40169. a = 0;
  40170. a < o.length;
  40171. a++
  40172. )
  40173. !(function (e) {
  40174. (r[e.name] = function (n, r) {
  40175. try {
  40176. try {
  40177. n = e.resolvedRequestType.clazz.decode(t.wrap(n));
  40178. } catch (e) {
  40179. if (!(e instanceof TypeError)) throw e;
  40180. }
  40181. if (null === n || 'object' != typeof n)
  40182. throw Error('Illegal arguments');
  40183. n instanceof e.resolvedRequestType.clazz ||
  40184. (n = new e.resolvedRequestType.clazz(n)),
  40185. this.rpcImpl(e.fqn(), n, function (t, n) {
  40186. if (t) return void r(t);
  40187. null === n && (n = '');
  40188. try {
  40189. n = e.resolvedResponseType.clazz.decode(n);
  40190. } catch (e) {}
  40191. return n && n instanceof e.resolvedResponseType.clazz
  40192. ? void r(null, n)
  40193. : void r(
  40194. Error(
  40195. 'Illegal response type received in service method ' +
  40196. i.name +
  40197. '#' +
  40198. e.name
  40199. )
  40200. );
  40201. });
  40202. } catch (e) {
  40203. setTimeout(r.bind(this, e), 0);
  40204. }
  40205. }),
  40206. (n[e.name] = function (t, i, r) {
  40207. new n(t)[e.name](i, r);
  40208. }),
  40209. Object.defineProperty &&
  40210. (Object.defineProperty(n[e.name], '$options', {
  40211. value: e.buildOpt(),
  40212. }),
  40213. Object.defineProperty(r[e.name], '$options', {
  40214. value: n[e.name].$options,
  40215. }));
  40216. })(o[a]);
  40217. return (
  40218. Object.defineProperty &&
  40219. (Object.defineProperty(n, '$options', {
  40220. value: i.buildOpt(),
  40221. }),
  40222. Object.defineProperty(r, '$options', {
  40223. value: n.$options,
  40224. }),
  40225. Object.defineProperty(n, '$type', {
  40226. value: i,
  40227. }),
  40228. Object.defineProperty(r, '$type', {
  40229. value: i,
  40230. })),
  40231. n
  40232. );
  40233. })(e, this));
  40234. }),
  40235. (o.Service = E);
  40236. var w = function (e, t, i, n) {
  40237. a.call(this, e, t, i),
  40238. (this.className = 'Service.Method'),
  40239. (this.options = n || {});
  40240. },
  40241. _ = (w.prototype = Object.create(a.prototype));
  40242. (_.buildOpt = c.buildOpt), (o.Service.Method = w);
  40243. var T = function (e, t, i, n, r, o, a, s) {
  40244. w.call(this, e, t, i, s),
  40245. (this.className = 'Service.RPCMethod'),
  40246. (this.requestName = n),
  40247. (this.responseName = r),
  40248. (this.requestStream = o),
  40249. (this.responseStream = a),
  40250. (this.resolvedRequestType = null),
  40251. (this.resolvedResponseType = null);
  40252. };
  40253. return (T.prototype = Object.create(w.prototype)), (o.Service.RPCMethod = T), o;
  40254. })(r)),
  40255. (r.Builder = (function (t, i, n) {
  40256. function r(e) {
  40257. e.messages &&
  40258. e.messages.forEach(function (t) {
  40259. (t.syntax = e.syntax), r(t);
  40260. }),
  40261. e.enums &&
  40262. e.enums.forEach(function (t) {
  40263. t.syntax = e.syntax;
  40264. });
  40265. }
  40266. var o = function (e) {
  40267. (this.ns = new n.Namespace(this, null, '')),
  40268. (this.ptr = this.ns),
  40269. (this.resolved = !1),
  40270. (this.result = null),
  40271. (this.files = {}),
  40272. (this.importRoot = null),
  40273. (this.options = e || {});
  40274. },
  40275. a = o.prototype;
  40276. return (
  40277. (o.isMessage = function (e) {
  40278. return (
  40279. 'string' == typeof e.name &&
  40280. 'undefined' == typeof e.values &&
  40281. 'undefined' == typeof e.rpc
  40282. );
  40283. }),
  40284. (o.isMessageField = function (e) {
  40285. return (
  40286. 'string' == typeof e.rule &&
  40287. 'string' == typeof e.name &&
  40288. 'string' == typeof e.type &&
  40289. 'undefined' != typeof e.id
  40290. );
  40291. }),
  40292. (o.isEnum = function (e) {
  40293. return (
  40294. 'string' == typeof e.name &&
  40295. !(
  40296. 'undefined' == typeof e.values ||
  40297. !Array.isArray(e.values) ||
  40298. 0 === e.values.length
  40299. )
  40300. );
  40301. }),
  40302. (o.isService = function (e) {
  40303. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc);
  40304. }),
  40305. (o.isExtend = function (e) {
  40306. return 'string' == typeof e.ref;
  40307. }),
  40308. (a.reset = function () {
  40309. return (this.ptr = this.ns), this;
  40310. }),
  40311. (a.define = function (e) {
  40312. if ('string' != typeof e || !i.TYPEREF.test(e))
  40313. throw Error('illegal namespace: ' + e);
  40314. return (
  40315. e.split('.').forEach(function (e) {
  40316. var t = this.ptr.getChild(e);
  40317. null === t && this.ptr.addChild((t = new n.Namespace(this, this.ptr, e))),
  40318. (this.ptr = t);
  40319. }, this),
  40320. this
  40321. );
  40322. }),
  40323. (a.create = function (e) {
  40324. if (!e) return this;
  40325. if (Array.isArray(e)) {
  40326. if (0 === e.length) return this;
  40327. e = e.slice();
  40328. } else e = [e];
  40329. for (var i = [e]; i.length > 0; ) {
  40330. if (((e = i.pop()), !Array.isArray(e)))
  40331. throw Error('not a valid namespace: ' + JSON.stringify(e));
  40332. for (; e.length > 0; ) {
  40333. var r = e.shift();
  40334. if (o.isMessage(r)) {
  40335. var a = new n.Message(
  40336. this,
  40337. this.ptr,
  40338. r.name,
  40339. r.options,
  40340. r.isGroup,
  40341. r.syntax
  40342. ),
  40343. s = {};
  40344. r.oneofs &&
  40345. Object.keys(r.oneofs).forEach(function (e) {
  40346. a.addChild((s[e] = new n.Message.OneOf(this, a, e)));
  40347. }, this),
  40348. r.fields &&
  40349. r.fields.forEach(function (e) {
  40350. if (null !== a.getChild(0 | e.id))
  40351. throw Error(
  40352. 'duplicate or invalid field id in ' + a.name + ': ' + e.id
  40353. );
  40354. if (e.options && 'object' != typeof e.options)
  40355. throw Error('illegal field options in ' + a.name + '#' + e.name);
  40356. var t = null;
  40357. if ('string' == typeof e.oneof && !(t = s[e.oneof]))
  40358. throw Error(
  40359. 'illegal oneof in ' + a.name + '#' + e.name + ': ' + e.oneof
  40360. );
  40361. (e = new n.Message.Field(
  40362. this,
  40363. a,
  40364. e.rule,
  40365. e.keytype,
  40366. e.type,
  40367. e.name,
  40368. e.id,
  40369. e.options,
  40370. t,
  40371. r.syntax
  40372. )),
  40373. t && t.fields.push(e),
  40374. a.addChild(e);
  40375. }, this);
  40376. var l = [];
  40377. if (
  40378. (r.enums &&
  40379. r.enums.forEach(function (e) {
  40380. l.push(e);
  40381. }),
  40382. r.messages &&
  40383. r.messages.forEach(function (e) {
  40384. l.push(e);
  40385. }),
  40386. r.services &&
  40387. r.services.forEach(function (e) {
  40388. l.push(e);
  40389. }),
  40390. r.extensions &&
  40391. ('number' == typeof r.extensions[0]
  40392. ? (a.extensions = [r.extensions])
  40393. : (a.extensions = r.extensions)),
  40394. this.ptr.addChild(a),
  40395. l.length > 0)
  40396. ) {
  40397. i.push(e), (e = l), (l = null), (this.ptr = a), (a = null);
  40398. continue;
  40399. }
  40400. l = null;
  40401. } else if (o.isEnum(r))
  40402. (a = new n.Enum(this, this.ptr, r.name, r.options, r.syntax)),
  40403. r.values.forEach(function (e) {
  40404. a.addChild(new n.Enum.Value(this, a, e.name, e.id));
  40405. }, this),
  40406. this.ptr.addChild(a);
  40407. else if (o.isService(r))
  40408. (a = new n.Service(this, this.ptr, r.name, r.options)),
  40409. Object.keys(r.rpc).forEach(function (e) {
  40410. var t = r.rpc[e];
  40411. a.addChild(
  40412. new n.Service.RPCMethod(
  40413. this,
  40414. a,
  40415. e,
  40416. t.request,
  40417. t.response,
  40418. !!t.request_stream,
  40419. !!t.response_stream,
  40420. t.options
  40421. )
  40422. );
  40423. }, this),
  40424. this.ptr.addChild(a);
  40425. else {
  40426. if (!o.isExtend(r))
  40427. throw Error('not a valid definition: ' + JSON.stringify(r));
  40428. if ((a = this.ptr.resolve(r.ref, !0)))
  40429. r.fields.forEach(function (e) {
  40430. if (null !== a.getChild(0 | e.id))
  40431. throw Error(
  40432. 'duplicate extended field id in ' + a.name + ': ' + e.id
  40433. );
  40434. if (a.extensions) {
  40435. var i = !1;
  40436. if (
  40437. (a.extensions.forEach(function (t) {
  40438. e.id >= t[0] && e.id <= t[1] && (i = !0);
  40439. }),
  40440. !i)
  40441. )
  40442. throw Error(
  40443. 'illegal extended field id in ' +
  40444. a.name +
  40445. ': ' +
  40446. e.id +
  40447. ' (not within valid ranges)'
  40448. );
  40449. }
  40450. var r = e.name;
  40451. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  40452. var o = new n.Message.ExtensionField(
  40453. this,
  40454. a,
  40455. e.rule,
  40456. e.type,
  40457. this.ptr.fqn() + '.' + r,
  40458. e.id,
  40459. e.options
  40460. ),
  40461. s = new n.Extension(this, this.ptr, e.name, o);
  40462. (o.extension = s), this.ptr.addChild(s), a.addChild(o);
  40463. }, this);
  40464. else if (!/\.?google\.protobuf\./.test(r.ref))
  40465. throw Error('extended message ' + r.ref + ' is not defined');
  40466. }
  40467. (r = null), (a = null);
  40468. }
  40469. (e = null), (this.ptr = this.ptr.parent);
  40470. }
  40471. return (this.resolved = !1), (this.result = null), this;
  40472. }),
  40473. (a.import = function (i, n) {
  40474. var o = '/';
  40475. if ('string' == typeof n) {
  40476. if ((t.Util.IS_NODE && (n = e('path').resolve(n)), this.files[n] === !0))
  40477. return this.reset();
  40478. this.files[n] = !0;
  40479. } else if ('object' == typeof n) {
  40480. var a = n.root;
  40481. t.Util.IS_NODE && (a = e('path').resolve(a)),
  40482. (a.indexOf('\\') >= 0 || n.file.indexOf('\\') >= 0) && (o = '\\');
  40483. var s = a + o + n.file;
  40484. if (this.files[s] === !0) return this.reset();
  40485. this.files[s] = !0;
  40486. }
  40487. if (i.imports && i.imports.length > 0) {
  40488. var l,
  40489. c = !1;
  40490. 'object' == typeof n
  40491. ? ((this.importRoot = n.root),
  40492. (c = !0),
  40493. (l = this.importRoot),
  40494. (n = n.file),
  40495. (l.indexOf('\\') >= 0 || n.indexOf('\\') >= 0) && (o = '\\'))
  40496. : 'string' == typeof n
  40497. ? this.importRoot
  40498. ? (l = this.importRoot)
  40499. : n.indexOf('/') >= 0
  40500. ? ((l = n.replace(/\/[^\/]*$/, '')), '' === l && (l = '/'))
  40501. : n.indexOf('\\') >= 0
  40502. ? ((l = n.replace(/\\[^\\]*$/, '')), (o = '\\'))
  40503. : (l = '.')
  40504. : (l = null);
  40505. for (var h = 0; h < i.imports.length; h++)
  40506. if ('string' == typeof i.imports[h]) {
  40507. if (!l) throw Error('cannot determine import root');
  40508. var u = i.imports[h];
  40509. if ('google/protobuf/descriptor.proto' === u) continue;
  40510. if (((u = l + o + u), this.files[u] === !0)) continue;
  40511. /\.proto$/i.test(u) &&
  40512. !t.DotProto &&
  40513. (u = u.replace(/\.proto$/, '.json'));
  40514. var d = t.Util.fetch(u);
  40515. if (null === d)
  40516. throw Error(
  40517. "failed to import '" + u + "' in '" + n + "': file not found"
  40518. );
  40519. /\.json$/i.test(u)
  40520. ? this.import(JSON.parse(d + ''), u)
  40521. : this.import(t.DotProto.Parser.parse(d), u);
  40522. } else
  40523. n
  40524. ? /\.(\w+)$/.test(n)
  40525. ? this.import(
  40526. i.imports[h],
  40527. n.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  40528. return t + '_import' + h + '.' + i;
  40529. })
  40530. )
  40531. : this.import(i.imports[h], n + '_import' + h)
  40532. : this.import(i.imports[h]);
  40533. c && (this.importRoot = null);
  40534. }
  40535. i.package && this.define(i.package), i.syntax && r(i);
  40536. var p = this.ptr;
  40537. return (
  40538. i.options &&
  40539. Object.keys(i.options).forEach(function (e) {
  40540. p.options[e] = i.options[e];
  40541. }),
  40542. i.messages && (this.create(i.messages), (this.ptr = p)),
  40543. i.enums && (this.create(i.enums), (this.ptr = p)),
  40544. i.services && (this.create(i.services), (this.ptr = p)),
  40545. i.extends && this.create(i.extends),
  40546. this.reset()
  40547. );
  40548. }),
  40549. (a.resolveAll = function () {
  40550. var e;
  40551. if (null == this.ptr || 'object' == typeof this.ptr.type) return this;
  40552. if (this.ptr instanceof n.Namespace)
  40553. this.ptr.children.forEach(function (e) {
  40554. (this.ptr = e), this.resolveAll();
  40555. }, this);
  40556. else if (this.ptr instanceof n.Message.Field) {
  40557. if (i.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type];
  40558. else {
  40559. if (!i.TYPEREF.test(this.ptr.type))
  40560. throw Error(
  40561. 'illegal type reference in ' +
  40562. this.ptr.toString(!0) +
  40563. ': ' +
  40564. this.ptr.type
  40565. );
  40566. if (
  40567. ((e = (
  40568. this.ptr instanceof n.Message.ExtensionField
  40569. ? this.ptr.extension.parent
  40570. : this.ptr.parent
  40571. ).resolve(this.ptr.type, !0)),
  40572. !e)
  40573. )
  40574. throw Error(
  40575. 'unresolvable type reference in ' +
  40576. this.ptr.toString(!0) +
  40577. ': ' +
  40578. this.ptr.type
  40579. );
  40580. if (((this.ptr.resolvedType = e), e instanceof n.Enum)) {
  40581. if (
  40582. ((this.ptr.type = t.TYPES.enum),
  40583. 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)
  40584. )
  40585. throw Error('proto3 message cannot reference proto2 enum');
  40586. } else {
  40587. if (!(e instanceof n.Message))
  40588. throw Error(
  40589. 'illegal type reference in ' +
  40590. this.ptr.toString(!0) +
  40591. ': ' +
  40592. this.ptr.type
  40593. );
  40594. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message;
  40595. }
  40596. }
  40597. if (this.ptr.map) {
  40598. if (!i.TYPE.test(this.ptr.keyType))
  40599. throw Error(
  40600. 'illegal key type for map field in ' +
  40601. this.ptr.toString(!0) +
  40602. ': ' +
  40603. this.ptr.keyType
  40604. );
  40605. this.ptr.keyType = t.TYPES[this.ptr.keyType];
  40606. }
  40607. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  40608. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  40609. throw Error('illegal service type in ' + this.ptr.toString(!0));
  40610. if (
  40611. ((e = this.ptr.parent.resolve(this.ptr.requestName, !0)),
  40612. !(e && e instanceof t.Reflect.Message))
  40613. )
  40614. throw Error(
  40615. 'Illegal type reference in ' +
  40616. this.ptr.toString(!0) +
  40617. ': ' +
  40618. this.ptr.requestName
  40619. );
  40620. if (
  40621. ((this.ptr.resolvedRequestType = e),
  40622. (e = this.ptr.parent.resolve(this.ptr.responseName, !0)),
  40623. !(e && e instanceof t.Reflect.Message))
  40624. )
  40625. throw Error(
  40626. 'Illegal type reference in ' +
  40627. this.ptr.toString(!0) +
  40628. ': ' +
  40629. this.ptr.responseName
  40630. );
  40631. this.ptr.resolvedResponseType = e;
  40632. } else if (
  40633. !(
  40634. this.ptr instanceof t.Reflect.Message.OneOf ||
  40635. this.ptr instanceof t.Reflect.Extension ||
  40636. this.ptr instanceof t.Reflect.Enum.Value
  40637. )
  40638. )
  40639. throw Error(
  40640. 'illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr
  40641. );
  40642. return this.reset();
  40643. }),
  40644. (a.build = function (e) {
  40645. if (
  40646. (this.reset(),
  40647. this.resolved ||
  40648. (this.resolveAll(), (this.resolved = !0), (this.result = null)),
  40649. null === this.result && (this.result = this.ns.build()),
  40650. !e)
  40651. )
  40652. return this.result;
  40653. for (
  40654. var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0;
  40655. n < t.length;
  40656. n++
  40657. ) {
  40658. if (!i[t[n]]) {
  40659. i = null;
  40660. break;
  40661. }
  40662. i = i[t[n]];
  40663. }
  40664. return i;
  40665. }),
  40666. (a.lookup = function (e, t) {
  40667. return e ? this.ns.resolve(e, t) : this.ns;
  40668. }),
  40669. (a.toString = function () {
  40670. return 'Builder';
  40671. }),
  40672. (o.Message = function () {}),
  40673. (o.Enum = function () {}),
  40674. (o.Service = function () {}),
  40675. o
  40676. );
  40677. })(r, r.Lang, r.Reflect)),
  40678. (r.Map = (function (e, t) {
  40679. function i(e) {
  40680. var t = 0;
  40681. return {
  40682. next: function () {
  40683. return t < e.length
  40684. ? {
  40685. done: !1,
  40686. value: e[t++],
  40687. }
  40688. : {
  40689. done: !0,
  40690. };
  40691. },
  40692. };
  40693. }
  40694. var n = function (e, i) {
  40695. if (!e.map) throw Error('field is not a map');
  40696. if (
  40697. ((this.field = e),
  40698. (this.keyElem = new t.Element(e.keyType, null, !0, e.syntax)),
  40699. (this.valueElem = new t.Element(e.type, e.resolvedType, !1, e.syntax)),
  40700. (this.map = {}),
  40701. Object.defineProperty(this, 'size', {
  40702. get: function () {
  40703. return Object.keys(this.map).length;
  40704. },
  40705. }),
  40706. i)
  40707. )
  40708. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  40709. var o = this.keyElem.valueFromString(n[r]),
  40710. a = this.valueElem.verifyValue(i[n[r]]);
  40711. this.map[this.keyElem.valueToString(o)] = {
  40712. key: o,
  40713. value: a,
  40714. };
  40715. }
  40716. },
  40717. r = n.prototype;
  40718. return (
  40719. (r.clear = function () {
  40720. this.map = {};
  40721. }),
  40722. (r.delete = function (e) {
  40723. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  40724. i = t in this.map;
  40725. return delete this.map[t], i;
  40726. }),
  40727. (r.entries = function () {
  40728. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  40729. t.push([(e = this.map[n[r]]).key, e.value]);
  40730. return i(t);
  40731. }),
  40732. (r.keys = function () {
  40733. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40734. e.push(this.map[t[n]].key);
  40735. return i(e);
  40736. }),
  40737. (r.values = function () {
  40738. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40739. e.push(this.map[t[n]].value);
  40740. return i(e);
  40741. }),
  40742. (r.forEach = function (e, t) {
  40743. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  40744. e.call(t, (i = this.map[n[r]]).value, i.key, this);
  40745. }),
  40746. (r.set = function (e, t) {
  40747. var i = this.keyElem.verifyValue(e),
  40748. n = this.valueElem.verifyValue(t);
  40749. return (
  40750. (this.map[this.keyElem.valueToString(i)] = {
  40751. key: i,
  40752. value: n,
  40753. }),
  40754. this
  40755. );
  40756. }),
  40757. (r.get = function (e) {
  40758. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  40759. if (t in this.map) return this.map[t].value;
  40760. }),
  40761. (r.has = function (e) {
  40762. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  40763. return t in this.map;
  40764. }),
  40765. n
  40766. );
  40767. })(r, r.Reflect)),
  40768. (r.loadProto = function (e, t, i) {
  40769. return (
  40770. ('string' == typeof t ||
  40771. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40772. ((i = t), (t = void 0)),
  40773. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  40774. );
  40775. }),
  40776. (r.protoFromString = r.loadProto),
  40777. (r.loadProtoFile = function (e, t, i) {
  40778. if (
  40779. (t && 'object' == typeof t
  40780. ? ((i = t), (t = null))
  40781. : (t && 'function' == typeof t) || (t = null),
  40782. t)
  40783. )
  40784. return r.Util.fetch(
  40785. 'string' == typeof e ? e : e.root + '/' + e.file,
  40786. function (n) {
  40787. if (null === n) return void t(Error('Failed to fetch file'));
  40788. try {
  40789. t(null, r.loadProto(n, i, e));
  40790. } catch (e) {
  40791. t(e);
  40792. }
  40793. }
  40794. );
  40795. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e);
  40796. return null === n ? null : r.loadProto(n, i, e);
  40797. }),
  40798. (r.protoFromFile = r.loadProtoFile),
  40799. (r.newBuilder = function (e) {
  40800. return (
  40801. (e = e || {}),
  40802. 'undefined' == typeof e.convertFieldsToCamelCase &&
  40803. (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  40804. 'undefined' == typeof e.populateAccessors &&
  40805. (e.populateAccessors = r.populateAccessors),
  40806. new r.Builder(e)
  40807. );
  40808. }),
  40809. (r.loadJson = function (e, t, i) {
  40810. return (
  40811. ('string' == typeof t ||
  40812. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40813. ((i = t), (t = null)),
  40814. (t && 'object' == typeof t) || (t = r.newBuilder()),
  40815. 'string' == typeof e && (e = JSON.parse(e)),
  40816. t.import(e, i),
  40817. t.resolveAll(),
  40818. t
  40819. );
  40820. }),
  40821. (r.loadJsonFile = function (e, t, i) {
  40822. if (
  40823. (t && 'object' == typeof t
  40824. ? ((i = t), (t = null))
  40825. : (t && 'function' == typeof t) || (t = null),
  40826. t)
  40827. )
  40828. return r.Util.fetch(
  40829. 'string' == typeof e ? e : e.root + '/' + e.file,
  40830. function (n) {
  40831. if (null === n) return void t(Error('Failed to fetch file'));
  40832. try {
  40833. t(null, r.loadJson(JSON.parse(n), i, e));
  40834. } catch (e) {
  40835. t(e);
  40836. }
  40837. }
  40838. );
  40839. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e);
  40840. return null === n ? null : r.loadJson(JSON.parse(n), i, e);
  40841. }),
  40842. r
  40843. );
  40844. });
  40845. }.call(this, e('_process')));
  40846. },
  40847. {
  40848. _process: 203,
  40849. bytebuffer: 215,
  40850. fs: 197,
  40851. path: 197,
  40852. },
  40853. ],
  40854. 215: [
  40855. function (e, t, i) {
  40856. !(function (i, n) {
  40857. 'function' == typeof define && define.amd
  40858. ? define(['long'], n)
  40859. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  40860. ? (t.exports = (function () {
  40861. var t;
  40862. try {
  40863. t = e('long');
  40864. } catch (e) {}
  40865. return n(t);
  40866. })())
  40867. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long));
  40868. })(this, function (e) {
  40869. 'use strict';
  40870. function t(e) {
  40871. var t = 0;
  40872. return function () {
  40873. return t < e.length ? e.charCodeAt(t++) : null;
  40874. };
  40875. }
  40876. function i() {
  40877. var e = [],
  40878. t = [];
  40879. return function () {
  40880. return 0 === arguments.length
  40881. ? t.join('') + l.apply(String, e)
  40882. : (e.length + arguments.length > 1024 &&
  40883. (t.push(l.apply(String, e)), (e.length = 0)),
  40884. void Array.prototype.push.apply(e, arguments));
  40885. };
  40886. }
  40887. function n(e, t, i, n, r) {
  40888. var o,
  40889. a,
  40890. s = 8 * r - n - 1,
  40891. l = (1 << s) - 1,
  40892. c = l >> 1,
  40893. h = -7,
  40894. u = i ? r - 1 : 0,
  40895. d = i ? -1 : 1,
  40896. p = e[t + u];
  40897. for (
  40898. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  40899. h > 0;
  40900. o = 256 * o + e[t + u], u += d, h -= 8
  40901. );
  40902. for (
  40903. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  40904. h > 0;
  40905. a = 256 * a + e[t + u], u += d, h -= 8
  40906. );
  40907. if (0 === o) o = 1 - c;
  40908. else {
  40909. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0);
  40910. (a += Math.pow(2, n)), (o -= c);
  40911. }
  40912. return (p ? -1 : 1) * a * Math.pow(2, o - n);
  40913. }
  40914. function r(e, t, i, n, r, o) {
  40915. var a,
  40916. s,
  40917. l,
  40918. c = 8 * o - r - 1,
  40919. h = (1 << c) - 1,
  40920. u = h >> 1,
  40921. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  40922. p = n ? 0 : o - 1,
  40923. f = n ? 1 : -1,
  40924. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
  40925. for (
  40926. t = Math.abs(t),
  40927. isNaN(t) || t === 1 / 0
  40928. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  40929. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  40930. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  40931. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  40932. t * l >= 2 && (a++, (l /= 2)),
  40933. a + u >= h
  40934. ? ((s = 0), (a = h))
  40935. : a + u >= 1
  40936. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  40937. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  40938. r >= 8;
  40939. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  40940. );
  40941. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  40942. e[i + p - f] |= 128 * g;
  40943. }
  40944. var o = function (e, t, i) {
  40945. if (
  40946. ('undefined' == typeof e && (e = o.DEFAULT_CAPACITY),
  40947. 'undefined' == typeof t && (t = o.DEFAULT_ENDIAN),
  40948. 'undefined' == typeof i && (i = o.DEFAULT_NOASSERT),
  40949. !i)
  40950. ) {
  40951. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity');
  40952. (t = !!t), (i = !!i);
  40953. }
  40954. (this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  40955. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  40956. (this.offset = 0),
  40957. (this.markedOffset = -1),
  40958. (this.limit = e),
  40959. (this.littleEndian = t),
  40960. (this.noAssert = i);
  40961. };
  40962. (o.VERSION = '5.0.1'),
  40963. (o.LITTLE_ENDIAN = !0),
  40964. (o.BIG_ENDIAN = !1),
  40965. (o.DEFAULT_CAPACITY = 16),
  40966. (o.DEFAULT_ENDIAN = o.BIG_ENDIAN),
  40967. (o.DEFAULT_NOASSERT = !1),
  40968. (o.Long = e || null);
  40969. var a = o.prototype;
  40970. a.__isByteBuffer__,
  40971. Object.defineProperty(a, '__isByteBuffer__', {
  40972. value: !0,
  40973. enumerable: !1,
  40974. configurable: !1,
  40975. });
  40976. var s = new ArrayBuffer(0),
  40977. l = String.fromCharCode;
  40978. (o.accessor = function () {
  40979. return Uint8Array;
  40980. }),
  40981. (o.allocate = function (e, t, i) {
  40982. return new o(e, t, i);
  40983. }),
  40984. (o.concat = function (e, t, i, n) {
  40985. ('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0));
  40986. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  40987. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  40988. (r = e[s].limit - e[s].offset),
  40989. r > 0 && (a += r);
  40990. if (0 === a) return new o(0, i, n);
  40991. var c,
  40992. h = new o(a, i, n);
  40993. for (s = 0; s < l; )
  40994. (c = e[s++]),
  40995. (r = c.limit - c.offset),
  40996. r <= 0 ||
  40997. (h.view.set(c.view.subarray(c.offset, c.limit), h.offset), (h.offset += r));
  40998. return (h.limit = h.offset), (h.offset = 0), h;
  40999. }),
  41000. (o.isByteBuffer = function (e) {
  41001. return (e && e.__isByteBuffer__) === !0;
  41002. }),
  41003. (o.type = function () {
  41004. return ArrayBuffer;
  41005. }),
  41006. (o.wrap = function (e, t, i, n) {
  41007. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  41008. switch (('undefined' == typeof t && (t = 'utf8'), t)) {
  41009. case 'base64':
  41010. return o.fromBase64(e, i);
  41011. case 'hex':
  41012. return o.fromHex(e, i);
  41013. case 'binary':
  41014. return o.fromBinary(e, i);
  41015. case 'utf8':
  41016. return o.fromUTF8(e, i);
  41017. case 'debug':
  41018. return o.fromDebug(e, i);
  41019. default:
  41020. throw Error('Unsupported encoding: ' + t);
  41021. }
  41022. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer');
  41023. var r;
  41024. if (o.isByteBuffer(e)) return (r = a.clone.call(e)), (r.markedOffset = -1), r;
  41025. if (e instanceof Uint8Array)
  41026. (r = new o(0, i, n)),
  41027. e.length > 0 &&
  41028. ((r.buffer = e.buffer),
  41029. (r.offset = e.byteOffset),
  41030. (r.limit = e.byteOffset + e.byteLength),
  41031. (r.view = new Uint8Array(e.buffer)));
  41032. else if (e instanceof ArrayBuffer)
  41033. (r = new o(0, i, n)),
  41034. e.byteLength > 0 &&
  41035. ((r.buffer = e),
  41036. (r.offset = 0),
  41037. (r.limit = e.byteLength),
  41038. (r.view = e.byteLength > 0 ? new Uint8Array(e) : null));
  41039. else {
  41040. if ('[object Array]' !== Object.prototype.toString.call(e))
  41041. throw TypeError('Illegal buffer');
  41042. (r = new o(e.length, i, n)), (r.limit = e.length);
  41043. for (var s = 0; s < e.length; ++s) r.view[s] = e[s];
  41044. }
  41045. return r;
  41046. }),
  41047. (a.writeBitSet = function (e, t) {
  41048. var i = 'undefined' == typeof t;
  41049. if ((i && (t = this.offset), !this.noAssert)) {
  41050. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array');
  41051. if ('number' != typeof t || t % 1 !== 0)
  41052. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41053. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41054. throw RangeError(
  41055. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41056. );
  41057. }
  41058. var n,
  41059. r = t,
  41060. o = e.length,
  41061. a = o >> 3,
  41062. s = 0;
  41063. for (t += this.writeVarint32(o, t); a--; )
  41064. (n =
  41065. (1 & !!e[s++]) |
  41066. ((1 & !!e[s++]) << 1) |
  41067. ((1 & !!e[s++]) << 2) |
  41068. ((1 & !!e[s++]) << 3) |
  41069. ((1 & !!e[s++]) << 4) |
  41070. ((1 & !!e[s++]) << 5) |
  41071. ((1 & !!e[s++]) << 6) |
  41072. ((1 & !!e[s++]) << 7)),
  41073. this.writeByte(n, t++);
  41074. if (s < o) {
  41075. var l = 0;
  41076. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++;
  41077. this.writeByte(n, t++);
  41078. }
  41079. return i ? ((this.offset = t), this) : t - r;
  41080. }),
  41081. (a.readBitSet = function (e) {
  41082. var t = 'undefined' == typeof e;
  41083. t && (e = this.offset);
  41084. var i,
  41085. n = this.readVarint32(e),
  41086. r = n.value,
  41087. o = r >> 3,
  41088. a = 0,
  41089. s = [];
  41090. for (e += n.length; o--; )
  41091. (i = this.readByte(e++)),
  41092. (s[a++] = !!(1 & i)),
  41093. (s[a++] = !!(2 & i)),
  41094. (s[a++] = !!(4 & i)),
  41095. (s[a++] = !!(8 & i)),
  41096. (s[a++] = !!(16 & i)),
  41097. (s[a++] = !!(32 & i)),
  41098. (s[a++] = !!(64 & i)),
  41099. (s[a++] = !!(128 & i));
  41100. if (a < r) {
  41101. var l = 0;
  41102. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1);
  41103. }
  41104. return t && (this.offset = e), s;
  41105. }),
  41106. (a.readBytes = function (e, t) {
  41107. var i = 'undefined' == typeof t;
  41108. if ((i && (t = this.offset), !this.noAssert)) {
  41109. if ('number' != typeof t || t % 1 !== 0)
  41110. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41111. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength))
  41112. throw RangeError(
  41113. 'Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength
  41114. );
  41115. }
  41116. var n = this.slice(t, t + e);
  41117. return i && (this.offset += e), n;
  41118. }),
  41119. (a.writeBytes = a.append),
  41120. (a.writeInt8 = function (e, t) {
  41121. var i = 'undefined' == typeof t;
  41122. if ((i && (t = this.offset), !this.noAssert)) {
  41123. if ('number' != typeof e || e % 1 !== 0)
  41124. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41125. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41126. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41127. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41128. throw RangeError(
  41129. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41130. );
  41131. }
  41132. t += 1;
  41133. var n = this.buffer.byteLength;
  41134. return (
  41135. t > n && this.resize((n *= 2) > t ? n : t),
  41136. (t -= 1),
  41137. (this.view[t] = e),
  41138. i && (this.offset += 1),
  41139. this
  41140. );
  41141. }),
  41142. (a.writeByte = a.writeInt8),
  41143. (a.readInt8 = function (e) {
  41144. var t = 'undefined' == typeof e;
  41145. if ((t && (e = this.offset), !this.noAssert)) {
  41146. if ('number' != typeof e || e % 1 !== 0)
  41147. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41148. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41149. throw RangeError(
  41150. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41151. );
  41152. }
  41153. var i = this.view[e];
  41154. return 128 === (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i;
  41155. }),
  41156. (a.readByte = a.readInt8),
  41157. (a.writeUint8 = function (e, t) {
  41158. var i = 'undefined' == typeof t;
  41159. if ((i && (t = this.offset), !this.noAssert)) {
  41160. if ('number' != typeof e || e % 1 !== 0)
  41161. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41162. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41163. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41164. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41165. throw RangeError(
  41166. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41167. );
  41168. }
  41169. t += 1;
  41170. var n = this.buffer.byteLength;
  41171. return (
  41172. t > n && this.resize((n *= 2) > t ? n : t),
  41173. (t -= 1),
  41174. (this.view[t] = e),
  41175. i && (this.offset += 1),
  41176. this
  41177. );
  41178. }),
  41179. (a.writeUInt8 = a.writeUint8),
  41180. (a.readUint8 = function (e) {
  41181. var t = 'undefined' == typeof e;
  41182. if ((t && (e = this.offset), !this.noAssert)) {
  41183. if ('number' != typeof e || e % 1 !== 0)
  41184. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41185. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41186. throw RangeError(
  41187. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41188. );
  41189. }
  41190. var i = this.view[e];
  41191. return t && (this.offset += 1), i;
  41192. }),
  41193. (a.readUInt8 = a.readUint8),
  41194. (a.writeInt16 = function (e, t) {
  41195. var i = 'undefined' == typeof t;
  41196. if ((i && (t = this.offset), !this.noAssert)) {
  41197. if ('number' != typeof e || e % 1 !== 0)
  41198. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41199. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41200. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41201. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41202. throw RangeError(
  41203. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41204. );
  41205. }
  41206. t += 2;
  41207. var n = this.buffer.byteLength;
  41208. return (
  41209. t > n && this.resize((n *= 2) > t ? n : t),
  41210. (t -= 2),
  41211. this.littleEndian
  41212. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41213. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41214. i && (this.offset += 2),
  41215. this
  41216. );
  41217. }),
  41218. (a.writeShort = a.writeInt16),
  41219. (a.readInt16 = function (e) {
  41220. var t = 'undefined' == typeof e;
  41221. if ((t && (e = this.offset), !this.noAssert)) {
  41222. if ('number' != typeof e || e % 1 !== 0)
  41223. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41224. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41225. throw RangeError(
  41226. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41227. );
  41228. }
  41229. var i = 0;
  41230. return (
  41231. this.littleEndian
  41232. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41233. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41234. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  41235. t && (this.offset += 2),
  41236. i
  41237. );
  41238. }),
  41239. (a.readShort = a.readInt16),
  41240. (a.writeUint16 = function (e, t) {
  41241. var i = 'undefined' == typeof t;
  41242. if ((i && (t = this.offset), !this.noAssert)) {
  41243. if ('number' != typeof e || e % 1 !== 0)
  41244. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41245. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41246. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41247. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41248. throw RangeError(
  41249. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41250. );
  41251. }
  41252. t += 2;
  41253. var n = this.buffer.byteLength;
  41254. return (
  41255. t > n && this.resize((n *= 2) > t ? n : t),
  41256. (t -= 2),
  41257. this.littleEndian
  41258. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41259. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41260. i && (this.offset += 2),
  41261. this
  41262. );
  41263. }),
  41264. (a.writeUInt16 = a.writeUint16),
  41265. (a.readUint16 = function (e) {
  41266. var t = 'undefined' == typeof e;
  41267. if ((t && (e = this.offset), !this.noAssert)) {
  41268. if ('number' != typeof e || e % 1 !== 0)
  41269. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41270. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41271. throw RangeError(
  41272. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41273. );
  41274. }
  41275. var i = 0;
  41276. return (
  41277. this.littleEndian
  41278. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41279. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41280. t && (this.offset += 2),
  41281. i
  41282. );
  41283. }),
  41284. (a.readUInt16 = a.readUint16),
  41285. (a.writeInt32 = function (e, t) {
  41286. var i = 'undefined' == typeof t;
  41287. if ((i && (t = this.offset), !this.noAssert)) {
  41288. if ('number' != typeof e || e % 1 !== 0)
  41289. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41290. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41291. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41292. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41293. throw RangeError(
  41294. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41295. );
  41296. }
  41297. t += 4;
  41298. var n = this.buffer.byteLength;
  41299. return (
  41300. t > n && this.resize((n *= 2) > t ? n : t),
  41301. (t -= 4),
  41302. this.littleEndian
  41303. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41304. (this.view[t + 2] = (e >>> 16) & 255),
  41305. (this.view[t + 1] = (e >>> 8) & 255),
  41306. (this.view[t] = 255 & e))
  41307. : ((this.view[t] = (e >>> 24) & 255),
  41308. (this.view[t + 1] = (e >>> 16) & 255),
  41309. (this.view[t + 2] = (e >>> 8) & 255),
  41310. (this.view[t + 3] = 255 & e)),
  41311. i && (this.offset += 4),
  41312. this
  41313. );
  41314. }),
  41315. (a.writeInt = a.writeInt32),
  41316. (a.readInt32 = function (e) {
  41317. var t = 'undefined' == typeof e;
  41318. if ((t && (e = this.offset), !this.noAssert)) {
  41319. if ('number' != typeof e || e % 1 !== 0)
  41320. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41321. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41322. throw RangeError(
  41323. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41324. );
  41325. }
  41326. var i = 0;
  41327. return (
  41328. this.littleEndian
  41329. ? ((i = this.view[e + 2] << 16),
  41330. (i |= this.view[e + 1] << 8),
  41331. (i |= this.view[e]),
  41332. (i += (this.view[e + 3] << 24) >>> 0))
  41333. : ((i = this.view[e + 1] << 16),
  41334. (i |= this.view[e + 2] << 8),
  41335. (i |= this.view[e + 3]),
  41336. (i += (this.view[e] << 24) >>> 0)),
  41337. (i |= 0),
  41338. t && (this.offset += 4),
  41339. i
  41340. );
  41341. }),
  41342. (a.readInt = a.readInt32),
  41343. (a.writeUint32 = function (e, t) {
  41344. var i = 'undefined' == typeof t;
  41345. if ((i && (t = this.offset), !this.noAssert)) {
  41346. if ('number' != typeof e || e % 1 !== 0)
  41347. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41348. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41349. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41350. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41351. throw RangeError(
  41352. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41353. );
  41354. }
  41355. t += 4;
  41356. var n = this.buffer.byteLength;
  41357. return (
  41358. t > n && this.resize((n *= 2) > t ? n : t),
  41359. (t -= 4),
  41360. this.littleEndian
  41361. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41362. (this.view[t + 2] = (e >>> 16) & 255),
  41363. (this.view[t + 1] = (e >>> 8) & 255),
  41364. (this.view[t] = 255 & e))
  41365. : ((this.view[t] = (e >>> 24) & 255),
  41366. (this.view[t + 1] = (e >>> 16) & 255),
  41367. (this.view[t + 2] = (e >>> 8) & 255),
  41368. (this.view[t + 3] = 255 & e)),
  41369. i && (this.offset += 4),
  41370. this
  41371. );
  41372. }),
  41373. (a.writeUInt32 = a.writeUint32),
  41374. (a.readUint32 = function (e) {
  41375. var t = 'undefined' == typeof e;
  41376. if ((t && (e = this.offset), !this.noAssert)) {
  41377. if ('number' != typeof e || e % 1 !== 0)
  41378. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41379. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41380. throw RangeError(
  41381. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41382. );
  41383. }
  41384. var i = 0;
  41385. return (
  41386. this.littleEndian
  41387. ? ((i = this.view[e + 2] << 16),
  41388. (i |= this.view[e + 1] << 8),
  41389. (i |= this.view[e]),
  41390. (i += (this.view[e + 3] << 24) >>> 0))
  41391. : ((i = this.view[e + 1] << 16),
  41392. (i |= this.view[e + 2] << 8),
  41393. (i |= this.view[e + 3]),
  41394. (i += (this.view[e] << 24) >>> 0)),
  41395. t && (this.offset += 4),
  41396. i
  41397. );
  41398. }),
  41399. (a.readUInt32 = a.readUint32),
  41400. e &&
  41401. ((a.writeInt64 = function (t, i) {
  41402. var n = 'undefined' == typeof i;
  41403. if ((n && (i = this.offset), !this.noAssert)) {
  41404. if ('number' == typeof t) t = e.fromNumber(t);
  41405. else if ('string' == typeof t) t = e.fromString(t);
  41406. else if (!(t && t instanceof e))
  41407. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)');
  41408. if ('number' != typeof i || i % 1 !== 0)
  41409. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41410. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41411. throw RangeError(
  41412. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41413. );
  41414. }
  41415. 'number' == typeof t
  41416. ? (t = e.fromNumber(t))
  41417. : 'string' == typeof t && (t = e.fromString(t)),
  41418. (i += 8);
  41419. var r = this.buffer.byteLength;
  41420. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  41421. var o = t.low,
  41422. a = t.high;
  41423. return (
  41424. this.littleEndian
  41425. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41426. (this.view[i + 2] = (o >>> 16) & 255),
  41427. (this.view[i + 1] = (o >>> 8) & 255),
  41428. (this.view[i] = 255 & o),
  41429. (i += 4),
  41430. (this.view[i + 3] = (a >>> 24) & 255),
  41431. (this.view[i + 2] = (a >>> 16) & 255),
  41432. (this.view[i + 1] = (a >>> 8) & 255),
  41433. (this.view[i] = 255 & a))
  41434. : ((this.view[i] = (a >>> 24) & 255),
  41435. (this.view[i + 1] = (a >>> 16) & 255),
  41436. (this.view[i + 2] = (a >>> 8) & 255),
  41437. (this.view[i + 3] = 255 & a),
  41438. (i += 4),
  41439. (this.view[i] = (o >>> 24) & 255),
  41440. (this.view[i + 1] = (o >>> 16) & 255),
  41441. (this.view[i + 2] = (o >>> 8) & 255),
  41442. (this.view[i + 3] = 255 & o)),
  41443. n && (this.offset += 8),
  41444. this
  41445. );
  41446. }),
  41447. (a.writeLong = a.writeInt64),
  41448. (a.readInt64 = function (t) {
  41449. var i = 'undefined' == typeof t;
  41450. if ((i && (t = this.offset), !this.noAssert)) {
  41451. if ('number' != typeof t || t % 1 !== 0)
  41452. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41453. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41454. throw RangeError(
  41455. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41456. );
  41457. }
  41458. var n = 0,
  41459. r = 0;
  41460. this.littleEndian
  41461. ? ((n = this.view[t + 2] << 16),
  41462. (n |= this.view[t + 1] << 8),
  41463. (n |= this.view[t]),
  41464. (n += (this.view[t + 3] << 24) >>> 0),
  41465. (t += 4),
  41466. (r = this.view[t + 2] << 16),
  41467. (r |= this.view[t + 1] << 8),
  41468. (r |= this.view[t]),
  41469. (r += (this.view[t + 3] << 24) >>> 0))
  41470. : ((r = this.view[t + 1] << 16),
  41471. (r |= this.view[t + 2] << 8),
  41472. (r |= this.view[t + 3]),
  41473. (r += (this.view[t] << 24) >>> 0),
  41474. (t += 4),
  41475. (n = this.view[t + 1] << 16),
  41476. (n |= this.view[t + 2] << 8),
  41477. (n |= this.view[t + 3]),
  41478. (n += (this.view[t] << 24) >>> 0));
  41479. var o = new e(n, r, !1);
  41480. return i && (this.offset += 8), o;
  41481. }),
  41482. (a.readLong = a.readInt64),
  41483. (a.writeUint64 = function (t, i) {
  41484. var n = 'undefined' == typeof i;
  41485. if ((n && (i = this.offset), !this.noAssert)) {
  41486. if ('number' == typeof t) t = e.fromNumber(t);
  41487. else if ('string' == typeof t) t = e.fromString(t);
  41488. else if (!(t && t instanceof e))
  41489. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)');
  41490. if ('number' != typeof i || i % 1 !== 0)
  41491. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41492. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41493. throw RangeError(
  41494. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41495. );
  41496. }
  41497. 'number' == typeof t
  41498. ? (t = e.fromNumber(t))
  41499. : 'string' == typeof t && (t = e.fromString(t)),
  41500. (i += 8);
  41501. var r = this.buffer.byteLength;
  41502. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8);
  41503. var o = t.low,
  41504. a = t.high;
  41505. return (
  41506. this.littleEndian
  41507. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41508. (this.view[i + 2] = (o >>> 16) & 255),
  41509. (this.view[i + 1] = (o >>> 8) & 255),
  41510. (this.view[i] = 255 & o),
  41511. (i += 4),
  41512. (this.view[i + 3] = (a >>> 24) & 255),
  41513. (this.view[i + 2] = (a >>> 16) & 255),
  41514. (this.view[i + 1] = (a >>> 8) & 255),
  41515. (this.view[i] = 255 & a))
  41516. : ((this.view[i] = (a >>> 24) & 255),
  41517. (this.view[i + 1] = (a >>> 16) & 255),
  41518. (this.view[i + 2] = (a >>> 8) & 255),
  41519. (this.view[i + 3] = 255 & a),
  41520. (i += 4),
  41521. (this.view[i] = (o >>> 24) & 255),
  41522. (this.view[i + 1] = (o >>> 16) & 255),
  41523. (this.view[i + 2] = (o >>> 8) & 255),
  41524. (this.view[i + 3] = 255 & o)),
  41525. n && (this.offset += 8),
  41526. this
  41527. );
  41528. }),
  41529. (a.writeUInt64 = a.writeUint64),
  41530. (a.readUint64 = function (t) {
  41531. var i = 'undefined' == typeof t;
  41532. if ((i && (t = this.offset), !this.noAssert)) {
  41533. if ('number' != typeof t || t % 1 !== 0)
  41534. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41535. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41536. throw RangeError(
  41537. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41538. );
  41539. }
  41540. var n = 0,
  41541. r = 0;
  41542. this.littleEndian
  41543. ? ((n = this.view[t + 2] << 16),
  41544. (n |= this.view[t + 1] << 8),
  41545. (n |= this.view[t]),
  41546. (n += (this.view[t + 3] << 24) >>> 0),
  41547. (t += 4),
  41548. (r = this.view[t + 2] << 16),
  41549. (r |= this.view[t + 1] << 8),
  41550. (r |= this.view[t]),
  41551. (r += (this.view[t + 3] << 24) >>> 0))
  41552. : ((r = this.view[t + 1] << 16),
  41553. (r |= this.view[t + 2] << 8),
  41554. (r |= this.view[t + 3]),
  41555. (r += (this.view[t] << 24) >>> 0),
  41556. (t += 4),
  41557. (n = this.view[t + 1] << 16),
  41558. (n |= this.view[t + 2] << 8),
  41559. (n |= this.view[t + 3]),
  41560. (n += (this.view[t] << 24) >>> 0));
  41561. var o = new e(n, r, !0);
  41562. return i && (this.offset += 8), o;
  41563. }),
  41564. (a.readUInt64 = a.readUint64)),
  41565. (a.writeFloat32 = function (e, t) {
  41566. var i = 'undefined' == typeof t;
  41567. if ((i && (t = this.offset), !this.noAssert)) {
  41568. if ('number' != typeof e)
  41569. throw TypeError('Illegal value: ' + e + ' (not a number)');
  41570. if ('number' != typeof t || t % 1 !== 0)
  41571. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41572. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41573. throw RangeError(
  41574. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41575. );
  41576. }
  41577. t += 4;
  41578. var n = this.buffer.byteLength;
  41579. return (
  41580. t > n && this.resize((n *= 2) > t ? n : t),
  41581. (t -= 4),
  41582. r(this.view, e, t, this.littleEndian, 23, 4),
  41583. i && (this.offset += 4),
  41584. this
  41585. );
  41586. }),
  41587. (a.writeFloat = a.writeFloat32),
  41588. (a.readFloat32 = function (e) {
  41589. var t = 'undefined' == typeof e;
  41590. if ((t && (e = this.offset), !this.noAssert)) {
  41591. if ('number' != typeof e || e % 1 !== 0)
  41592. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41593. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41594. throw RangeError(
  41595. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41596. );
  41597. }
  41598. var i = n(this.view, e, this.littleEndian, 23, 4);
  41599. return t && (this.offset += 4), i;
  41600. }),
  41601. (a.readFloat = a.readFloat32),
  41602. (a.writeFloat64 = function (e, t) {
  41603. var i = 'undefined' == typeof t;
  41604. if ((i && (t = this.offset), !this.noAssert)) {
  41605. if ('number' != typeof e)
  41606. throw TypeError('Illegal value: ' + e + ' (not a number)');
  41607. if ('number' != typeof t || t % 1 !== 0)
  41608. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41609. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41610. throw RangeError(
  41611. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41612. );
  41613. }
  41614. t += 8;
  41615. var n = this.buffer.byteLength;
  41616. return (
  41617. t > n && this.resize((n *= 2) > t ? n : t),
  41618. (t -= 8),
  41619. r(this.view, e, t, this.littleEndian, 52, 8),
  41620. i && (this.offset += 8),
  41621. this
  41622. );
  41623. }),
  41624. (a.writeDouble = a.writeFloat64),
  41625. (a.readFloat64 = function (e) {
  41626. var t = 'undefined' == typeof e;
  41627. if ((t && (e = this.offset), !this.noAssert)) {
  41628. if ('number' != typeof e || e % 1 !== 0)
  41629. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41630. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength))
  41631. throw RangeError(
  41632. 'Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength
  41633. );
  41634. }
  41635. var i = n(this.view, e, this.littleEndian, 52, 8);
  41636. return t && (this.offset += 8), i;
  41637. }),
  41638. (a.readDouble = a.readFloat64),
  41639. (o.MAX_VARINT32_BYTES = 5),
  41640. (o.calculateVarint32 = function (e) {
  41641. return (
  41642. (e >>>= 0), e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  41643. );
  41644. }),
  41645. (o.zigZagEncode32 = function (e) {
  41646. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0;
  41647. }),
  41648. (o.zigZagDecode32 = function (e) {
  41649. return ((e >>> 1) ^ -(1 & e)) | 0;
  41650. }),
  41651. (a.writeVarint32 = function (e, t) {
  41652. var i = 'undefined' == typeof t;
  41653. if ((i && (t = this.offset), !this.noAssert)) {
  41654. if ('number' != typeof e || e % 1 !== 0)
  41655. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  41656. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41657. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41658. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41659. throw RangeError(
  41660. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41661. );
  41662. }
  41663. var n,
  41664. r = o.calculateVarint32(e);
  41665. t += r;
  41666. var a = this.buffer.byteLength;
  41667. for (t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0; e >= 128; )
  41668. (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7);
  41669. return (this.view[t++] = e), i ? ((this.offset = t), this) : r;
  41670. }),
  41671. (a.writeVarint32ZigZag = function (e, t) {
  41672. return this.writeVarint32(o.zigZagEncode32(e), t);
  41673. }),
  41674. (a.readVarint32 = function (e) {
  41675. var t = 'undefined' == typeof e;
  41676. if ((t && (e = this.offset), !this.noAssert)) {
  41677. if ('number' != typeof e || e % 1 !== 0)
  41678. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41679. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41680. throw RangeError(
  41681. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41682. );
  41683. }
  41684. var i,
  41685. n = 0,
  41686. r = 0;
  41687. do {
  41688. if (!this.noAssert && e > this.limit) {
  41689. var o = Error('Truncated');
  41690. throw ((o.truncated = !0), o);
  41691. }
  41692. (i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n;
  41693. } while (0 !== (128 & i));
  41694. return (
  41695. (r |= 0),
  41696. t
  41697. ? ((this.offset = e), r)
  41698. : {
  41699. value: r,
  41700. length: n,
  41701. }
  41702. );
  41703. }),
  41704. (a.readVarint32ZigZag = function (e) {
  41705. var t = this.readVarint32(e);
  41706. return (
  41707. 'object' == typeof t
  41708. ? (t.value = o.zigZagDecode32(t.value))
  41709. : (t = o.zigZagDecode32(t)),
  41710. t
  41711. );
  41712. }),
  41713. e &&
  41714. ((o.MAX_VARINT64_BYTES = 10),
  41715. (o.calculateVarint64 = function (t) {
  41716. 'number' == typeof t
  41717. ? (t = e.fromNumber(t))
  41718. : 'string' == typeof t && (t = e.fromString(t));
  41719. var i = t.toInt() >>> 0,
  41720. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  41721. r = t.shiftRightUnsigned(56).toInt() >>> 0;
  41722. return 0 == r
  41723. ? 0 == n
  41724. ? i < 16384
  41725. ? i < 128
  41726. ? 1
  41727. : 2
  41728. : i < 1 << 21
  41729. ? 3
  41730. : 4
  41731. : n < 16384
  41732. ? n < 128
  41733. ? 5
  41734. : 6
  41735. : n < 1 << 21
  41736. ? 7
  41737. : 8
  41738. : r < 128
  41739. ? 9
  41740. : 10;
  41741. }),
  41742. (o.zigZagEncode64 = function (t) {
  41743. return (
  41744. 'number' == typeof t
  41745. ? (t = e.fromNumber(t, !1))
  41746. : 'string' == typeof t
  41747. ? (t = e.fromString(t, !1))
  41748. : t.unsigned !== !1 && (t = t.toSigned()),
  41749. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  41750. );
  41751. }),
  41752. (o.zigZagDecode64 = function (t) {
  41753. return (
  41754. 'number' == typeof t
  41755. ? (t = e.fromNumber(t, !1))
  41756. : 'string' == typeof t
  41757. ? (t = e.fromString(t, !1))
  41758. : t.unsigned !== !1 && (t = t.toSigned()),
  41759. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  41760. );
  41761. }),
  41762. (a.writeVarint64 = function (t, i) {
  41763. var n = 'undefined' == typeof i;
  41764. if ((n && (i = this.offset), !this.noAssert)) {
  41765. if ('number' == typeof t) t = e.fromNumber(t);
  41766. else if ('string' == typeof t) t = e.fromString(t);
  41767. else if (!(t && t instanceof e))
  41768. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)');
  41769. if ('number' != typeof i || i % 1 !== 0)
  41770. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41771. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41772. throw RangeError(
  41773. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41774. );
  41775. }
  41776. 'number' == typeof t
  41777. ? (t = e.fromNumber(t, !1))
  41778. : 'string' == typeof t
  41779. ? (t = e.fromString(t, !1))
  41780. : t.unsigned !== !1 && (t = t.toSigned());
  41781. var r = o.calculateVarint64(t),
  41782. a = t.toInt() >>> 0,
  41783. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  41784. l = t.shiftRightUnsigned(56).toInt() >>> 0;
  41785. i += r;
  41786. var c = this.buffer.byteLength;
  41787. switch ((i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)) {
  41788. case 10:
  41789. this.view[i + 9] = (l >>> 7) & 1;
  41790. case 9:
  41791. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  41792. case 8:
  41793. this.view[i + 7] = 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127;
  41794. case 7:
  41795. this.view[i + 6] = 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127;
  41796. case 6:
  41797. this.view[i + 5] = 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127;
  41798. case 5:
  41799. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  41800. case 4:
  41801. this.view[i + 3] = 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127;
  41802. case 3:
  41803. this.view[i + 2] = 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127;
  41804. case 2:
  41805. this.view[i + 1] = 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127;
  41806. case 1:
  41807. this.view[i] = 1 !== r ? 128 | a : 127 & a;
  41808. }
  41809. return n ? ((this.offset += r), this) : r;
  41810. }),
  41811. (a.writeVarint64ZigZag = function (e, t) {
  41812. return this.writeVarint64(o.zigZagEncode64(e), t);
  41813. }),
  41814. (a.readVarint64 = function (t) {
  41815. var i = 'undefined' == typeof t;
  41816. if ((i && (t = this.offset), !this.noAssert)) {
  41817. if ('number' != typeof t || t % 1 !== 0)
  41818. throw TypeError('Illegal offset: ' + t + ' (not an integer)');
  41819. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength))
  41820. throw RangeError(
  41821. 'Illegal offset: 0 <= ' + t + ' (+1) <= ' + this.buffer.byteLength
  41822. );
  41823. }
  41824. var n = t,
  41825. r = 0,
  41826. o = 0,
  41827. a = 0,
  41828. s = 0;
  41829. if (
  41830. ((s = this.view[t++]),
  41831. (r = 127 & s),
  41832. 128 & s &&
  41833. ((s = this.view[t++]),
  41834. (r |= (127 & s) << 7),
  41835. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41836. ((s = this.view[t++]),
  41837. (r |= (127 & s) << 14),
  41838. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41839. ((s = this.view[t++]),
  41840. (r |= (127 & s) << 21),
  41841. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41842. ((s = this.view[t++]),
  41843. (o = 127 & s),
  41844. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41845. ((s = this.view[t++]),
  41846. (o |= (127 & s) << 7),
  41847. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41848. ((s = this.view[t++]),
  41849. (o |= (127 & s) << 14),
  41850. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41851. ((s = this.view[t++]),
  41852. (o |= (127 & s) << 21),
  41853. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41854. ((s = this.view[t++]),
  41855. (a = 127 & s),
  41856. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41857. ((s = this.view[t++]),
  41858. (a |= (127 & s) << 7),
  41859. 128 & s || (this.noAssert && 'undefined' == typeof s)))))))))))
  41860. )
  41861. throw Error('Buffer overrun');
  41862. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1);
  41863. return i
  41864. ? ((this.offset = t), l)
  41865. : {
  41866. value: l,
  41867. length: t - n,
  41868. };
  41869. }),
  41870. (a.readVarint64ZigZag = function (t) {
  41871. var i = this.readVarint64(t);
  41872. return (
  41873. i && i.value instanceof e
  41874. ? (i.value = o.zigZagDecode64(i.value))
  41875. : (i = o.zigZagDecode64(i)),
  41876. i
  41877. );
  41878. })),
  41879. (a.writeCString = function (e, i) {
  41880. var n = 'undefined' == typeof i;
  41881. n && (i = this.offset);
  41882. var r,
  41883. o = e.length;
  41884. if (!this.noAssert) {
  41885. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  41886. for (r = 0; r < o; ++r)
  41887. if (0 === e.charCodeAt(r))
  41888. throw RangeError('Illegal str: Contains NULL-characters');
  41889. if ('number' != typeof i || i % 1 !== 0)
  41890. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41891. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41892. throw RangeError(
  41893. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41894. );
  41895. }
  41896. (o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1);
  41897. var a = this.buffer.byteLength;
  41898. return (
  41899. i > a && this.resize((a *= 2) > i ? a : i),
  41900. (i -= o + 1),
  41901. h.encodeUTF16toUTF8(
  41902. t(e),
  41903. function (e) {
  41904. this.view[i++] = e;
  41905. }.bind(this)
  41906. ),
  41907. (this.view[i++] = 0),
  41908. n ? ((this.offset = i), this) : o
  41909. );
  41910. }),
  41911. (a.readCString = function (e) {
  41912. var t = 'undefined' == typeof e;
  41913. if ((t && (e = this.offset), !this.noAssert)) {
  41914. if ('number' != typeof e || e % 1 !== 0)
  41915. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41916. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41917. throw RangeError(
  41918. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41919. );
  41920. }
  41921. var n,
  41922. r = e,
  41923. o = -1;
  41924. return (
  41925. h.decodeUTF8toUTF16(
  41926. function () {
  41927. if (0 === o) return null;
  41928. if (e >= this.limit)
  41929. throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit);
  41930. return (o = this.view[e++]), 0 === o ? null : o;
  41931. }.bind(this),
  41932. (n = i()),
  41933. !0
  41934. ),
  41935. t
  41936. ? ((this.offset = e), n())
  41937. : {
  41938. string: n(),
  41939. length: e - r,
  41940. }
  41941. );
  41942. }),
  41943. (a.writeIString = function (e, i) {
  41944. var n = 'undefined' == typeof i;
  41945. if ((n && (i = this.offset), !this.noAssert)) {
  41946. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  41947. if ('number' != typeof i || i % 1 !== 0)
  41948. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  41949. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41950. throw RangeError(
  41951. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41952. );
  41953. }
  41954. var r,
  41955. o = i;
  41956. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (i += 4 + r);
  41957. var a = this.buffer.byteLength;
  41958. if (
  41959. (i > a && this.resize((a *= 2) > i ? a : i),
  41960. (i -= 4 + r),
  41961. this.littleEndian
  41962. ? ((this.view[i + 3] = (r >>> 24) & 255),
  41963. (this.view[i + 2] = (r >>> 16) & 255),
  41964. (this.view[i + 1] = (r >>> 8) & 255),
  41965. (this.view[i] = 255 & r))
  41966. : ((this.view[i] = (r >>> 24) & 255),
  41967. (this.view[i + 1] = (r >>> 16) & 255),
  41968. (this.view[i + 2] = (r >>> 8) & 255),
  41969. (this.view[i + 3] = 255 & r)),
  41970. (i += 4),
  41971. h.encodeUTF16toUTF8(
  41972. t(e),
  41973. function (e) {
  41974. this.view[i++] = e;
  41975. }.bind(this)
  41976. ),
  41977. i !== o + 4 + r)
  41978. )
  41979. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + 4 + r));
  41980. return n ? ((this.offset = i), this) : i - o;
  41981. }),
  41982. (a.readIString = function (e) {
  41983. var t = 'undefined' == typeof e;
  41984. if ((t && (e = this.offset), !this.noAssert)) {
  41985. if ('number' != typeof e || e % 1 !== 0)
  41986. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  41987. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41988. throw RangeError(
  41989. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41990. );
  41991. }
  41992. var i = e,
  41993. n = this.readUint32(e),
  41994. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4));
  41995. return (
  41996. (e += r.length),
  41997. t
  41998. ? ((this.offset = e), r.string)
  41999. : {
  42000. string: r.string,
  42001. length: e - i,
  42002. }
  42003. );
  42004. }),
  42005. (o.METRICS_CHARS = 'c'),
  42006. (o.METRICS_BYTES = 'b'),
  42007. (a.writeUTF8String = function (e, i) {
  42008. var n = 'undefined' == typeof i;
  42009. if ((n && (i = this.offset), !this.noAssert)) {
  42010. if ('number' != typeof i || i % 1 !== 0)
  42011. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42012. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42013. throw RangeError(
  42014. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42015. );
  42016. }
  42017. var r,
  42018. o = i;
  42019. (r = h.calculateUTF16asUTF8(t(e))[1]), (i += r);
  42020. var a = this.buffer.byteLength;
  42021. return (
  42022. i > a && this.resize((a *= 2) > i ? a : i),
  42023. (i -= r),
  42024. h.encodeUTF16toUTF8(
  42025. t(e),
  42026. function (e) {
  42027. this.view[i++] = e;
  42028. }.bind(this)
  42029. ),
  42030. n ? ((this.offset = i), this) : i - o
  42031. );
  42032. }),
  42033. (a.writeString = a.writeUTF8String),
  42034. (o.calculateUTF8Chars = function (e) {
  42035. return h.calculateUTF16asUTF8(t(e))[0];
  42036. }),
  42037. (o.calculateUTF8Bytes = function (e) {
  42038. return h.calculateUTF16asUTF8(t(e))[1];
  42039. }),
  42040. (o.calculateString = o.calculateUTF8Bytes),
  42041. (a.readUTF8String = function (e, t, n) {
  42042. 'number' == typeof t && ((n = t), (t = void 0));
  42043. var r = 'undefined' == typeof n;
  42044. if (
  42045. (r && (n = this.offset),
  42046. 'undefined' == typeof t && (t = o.METRICS_CHARS),
  42047. !this.noAssert)
  42048. ) {
  42049. if ('number' != typeof e || e % 1 !== 0)
  42050. throw TypeError('Illegal length: ' + e + ' (not an integer)');
  42051. if (((e |= 0), 'number' != typeof n || n % 1 !== 0))
  42052. throw TypeError('Illegal offset: ' + n + ' (not an integer)');
  42053. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength))
  42054. throw RangeError(
  42055. 'Illegal offset: 0 <= ' + n + ' (+0) <= ' + this.buffer.byteLength
  42056. );
  42057. }
  42058. var a,
  42059. s = 0,
  42060. l = n;
  42061. if (t === o.METRICS_CHARS) {
  42062. if (
  42063. ((a = i()),
  42064. h.decodeUTF8(
  42065. function () {
  42066. return s < e && n < this.limit ? this.view[n++] : null;
  42067. }.bind(this),
  42068. function (e) {
  42069. ++s, h.UTF8toUTF16(e, a);
  42070. }
  42071. ),
  42072. s !== e)
  42073. )
  42074. throw RangeError('Illegal range: Truncated data, ' + s + ' == ' + e);
  42075. return r
  42076. ? ((this.offset = n), a())
  42077. : {
  42078. string: a(),
  42079. length: n - l,
  42080. };
  42081. }
  42082. if (t === o.METRICS_BYTES) {
  42083. if (!this.noAssert) {
  42084. if ('number' != typeof n || n % 1 !== 0)
  42085. throw TypeError('Illegal offset: ' + n + ' (not an integer)');
  42086. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength))
  42087. throw RangeError(
  42088. 'Illegal offset: 0 <= ' + n + ' (+' + e + ') <= ' + this.buffer.byteLength
  42089. );
  42090. }
  42091. var c = n + e;
  42092. if (
  42093. (h.decodeUTF8toUTF16(
  42094. function () {
  42095. return n < c ? this.view[n++] : null;
  42096. }.bind(this),
  42097. (a = i()),
  42098. this.noAssert
  42099. ),
  42100. n !== c)
  42101. )
  42102. throw RangeError('Illegal range: Truncated data, ' + n + ' == ' + c);
  42103. return r
  42104. ? ((this.offset = n), a())
  42105. : {
  42106. string: a(),
  42107. length: n - l,
  42108. };
  42109. }
  42110. throw TypeError('Unsupported metrics: ' + t);
  42111. }),
  42112. (a.readString = a.readUTF8String),
  42113. (a.writeVString = function (e, i) {
  42114. var n = 'undefined' == typeof i;
  42115. if ((n && (i = this.offset), !this.noAssert)) {
  42116. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  42117. if ('number' != typeof i || i % 1 !== 0)
  42118. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42119. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42120. throw RangeError(
  42121. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42122. );
  42123. }
  42124. var r,
  42125. a,
  42126. s = i;
  42127. (r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  42128. (a = o.calculateVarint32(r)),
  42129. (i += a + r);
  42130. var l = this.buffer.byteLength;
  42131. if (
  42132. (i > l && this.resize((l *= 2) > i ? l : i),
  42133. (i -= a + r),
  42134. (i += this.writeVarint32(r, i)),
  42135. h.encodeUTF16toUTF8(
  42136. t(e),
  42137. function (e) {
  42138. this.view[i++] = e;
  42139. }.bind(this)
  42140. ),
  42141. i !== s + r + a)
  42142. )
  42143. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + r + a));
  42144. return n ? ((this.offset = i), this) : i - s;
  42145. }),
  42146. (a.readVString = function (e) {
  42147. var t = 'undefined' == typeof e;
  42148. if ((t && (e = this.offset), !this.noAssert)) {
  42149. if ('number' != typeof e || e % 1 !== 0)
  42150. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  42151. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  42152. throw RangeError(
  42153. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  42154. );
  42155. }
  42156. var i = e,
  42157. n = this.readVarint32(e),
  42158. r = this.readUTF8String(n.value, o.METRICS_BYTES, (e += n.length));
  42159. return (
  42160. (e += r.length),
  42161. t
  42162. ? ((this.offset = e), r.string)
  42163. : {
  42164. string: r.string,
  42165. length: e - i,
  42166. }
  42167. );
  42168. }),
  42169. (a.append = function (e, t, i) {
  42170. ('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0));
  42171. var n = 'undefined' == typeof i;
  42172. if ((n && (i = this.offset), !this.noAssert)) {
  42173. if ('number' != typeof i || i % 1 !== 0)
  42174. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42175. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42176. throw RangeError(
  42177. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42178. );
  42179. }
  42180. e instanceof o || (e = o.wrap(e, t));
  42181. var r = e.limit - e.offset;
  42182. if (r <= 0) return this;
  42183. i += r;
  42184. var a = this.buffer.byteLength;
  42185. return (
  42186. i > a && this.resize((a *= 2) > i ? a : i),
  42187. (i -= r),
  42188. this.view.set(e.view.subarray(e.offset, e.limit), i),
  42189. (e.offset += r),
  42190. n && (this.offset += r),
  42191. this
  42192. );
  42193. }),
  42194. (a.appendTo = function (e, t) {
  42195. return e.append(this, t), this;
  42196. }),
  42197. (a.assert = function (e) {
  42198. return (this.noAssert = !e), this;
  42199. }),
  42200. (a.capacity = function () {
  42201. return this.buffer.byteLength;
  42202. }),
  42203. (a.clear = function () {
  42204. return (
  42205. (this.offset = 0),
  42206. (this.limit = this.buffer.byteLength),
  42207. (this.markedOffset = -1),
  42208. this
  42209. );
  42210. }),
  42211. (a.clone = function (e) {
  42212. var t = new o(0, this.littleEndian, this.noAssert);
  42213. return (
  42214. e
  42215. ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)),
  42216. (t.view = new Uint8Array(t.buffer)))
  42217. : ((t.buffer = this.buffer), (t.view = this.view)),
  42218. (t.offset = this.offset),
  42219. (t.markedOffset = this.markedOffset),
  42220. (t.limit = this.limit),
  42221. t
  42222. );
  42223. }),
  42224. (a.compact = function (e, t) {
  42225. if (
  42226. ('undefined' == typeof e && (e = this.offset),
  42227. 'undefined' == typeof t && (t = this.limit),
  42228. !this.noAssert)
  42229. ) {
  42230. if ('number' != typeof e || e % 1 !== 0)
  42231. throw TypeError('Illegal begin: Not an integer');
  42232. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42233. throw TypeError('Illegal end: Not an integer');
  42234. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42235. throw RangeError(
  42236. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42237. );
  42238. }
  42239. if (0 === e && t === this.buffer.byteLength) return this;
  42240. var i = t - e;
  42241. if (0 === i)
  42242. return (
  42243. (this.buffer = s),
  42244. (this.view = null),
  42245. this.markedOffset >= 0 && (this.markedOffset -= e),
  42246. (this.offset = 0),
  42247. (this.limit = 0),
  42248. this
  42249. );
  42250. var n = new ArrayBuffer(i),
  42251. r = new Uint8Array(n);
  42252. return (
  42253. r.set(this.view.subarray(e, t)),
  42254. (this.buffer = n),
  42255. (this.view = r),
  42256. this.markedOffset >= 0 && (this.markedOffset -= e),
  42257. (this.offset = 0),
  42258. (this.limit = i),
  42259. this
  42260. );
  42261. }),
  42262. (a.copy = function (e, t) {
  42263. if (
  42264. ('undefined' == typeof e && (e = this.offset),
  42265. 'undefined' == typeof t && (t = this.limit),
  42266. !this.noAssert)
  42267. ) {
  42268. if ('number' != typeof e || e % 1 !== 0)
  42269. throw TypeError('Illegal begin: Not an integer');
  42270. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42271. throw TypeError('Illegal end: Not an integer');
  42272. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42273. throw RangeError(
  42274. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42275. );
  42276. }
  42277. if (e === t) return new o(0, this.littleEndian, this.noAssert);
  42278. var i = t - e,
  42279. n = new o(i, this.littleEndian, this.noAssert);
  42280. return (
  42281. (n.offset = 0),
  42282. (n.limit = i),
  42283. n.markedOffset >= 0 && (n.markedOffset -= e),
  42284. this.copyTo(n, 0, e, t),
  42285. n
  42286. );
  42287. }),
  42288. (a.copyTo = function (e, t, i, n) {
  42289. var r, a;
  42290. if (!this.noAssert && !o.isByteBuffer(e))
  42291. throw TypeError('Illegal target: Not a ByteBuffer');
  42292. if (
  42293. ((t = (a = 'undefined' == typeof t) ? e.offset : 0 | t),
  42294. (i = (r = 'undefined' == typeof i) ? this.offset : 0 | i),
  42295. (n = 'undefined' == typeof n ? this.limit : 0 | n),
  42296. t < 0 || t > e.buffer.byteLength)
  42297. )
  42298. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength);
  42299. if (i < 0 || n > this.buffer.byteLength)
  42300. throw RangeError(
  42301. 'Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength
  42302. );
  42303. var s = n - i;
  42304. return 0 === s
  42305. ? e
  42306. : (e.ensureCapacity(t + s),
  42307. e.view.set(this.view.subarray(i, n), t),
  42308. r && (this.offset += s),
  42309. a && (e.offset += s),
  42310. this);
  42311. }),
  42312. (a.ensureCapacity = function (e) {
  42313. var t = this.buffer.byteLength;
  42314. return t < e ? this.resize((t *= 2) > e ? t : e) : this;
  42315. }),
  42316. (a.fill = function (e, t, i) {
  42317. var n = 'undefined' == typeof t;
  42318. if (
  42319. (n && (t = this.offset),
  42320. 'string' == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  42321. 'undefined' == typeof t && (t = this.offset),
  42322. 'undefined' == typeof i && (i = this.limit),
  42323. !this.noAssert)
  42324. ) {
  42325. if ('number' != typeof e || e % 1 !== 0)
  42326. throw TypeError('Illegal value: ' + e + ' (not an integer)');
  42327. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  42328. throw TypeError('Illegal begin: Not an integer');
  42329. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42330. throw TypeError('Illegal end: Not an integer');
  42331. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42332. throw RangeError(
  42333. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42334. );
  42335. }
  42336. if (t >= i) return this;
  42337. for (; t < i; ) this.view[t++] = e;
  42338. return n && (this.offset = t), this;
  42339. }),
  42340. (a.flip = function () {
  42341. return (this.limit = this.offset), (this.offset = 0), this;
  42342. }),
  42343. (a.mark = function (e) {
  42344. if (((e = 'undefined' == typeof e ? this.offset : e), !this.noAssert)) {
  42345. if ('number' != typeof e || e % 1 !== 0)
  42346. throw TypeError('Illegal offset: ' + e + ' (not an integer)');
  42347. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength))
  42348. throw RangeError(
  42349. 'Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength
  42350. );
  42351. }
  42352. return (this.markedOffset = e), this;
  42353. }),
  42354. (a.order = function (e) {
  42355. if (!this.noAssert && 'boolean' != typeof e)
  42356. throw TypeError('Illegal littleEndian: Not a boolean');
  42357. return (this.littleEndian = !!e), this;
  42358. }),
  42359. (a.LE = function (e) {
  42360. return (this.littleEndian = 'undefined' == typeof e || !!e), this;
  42361. }),
  42362. (a.BE = function (e) {
  42363. return (this.littleEndian = 'undefined' != typeof e && !e), this;
  42364. }),
  42365. (a.prepend = function (e, t, i) {
  42366. ('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0));
  42367. var n = 'undefined' == typeof i;
  42368. if ((n && (i = this.offset), !this.noAssert)) {
  42369. if ('number' != typeof i || i % 1 !== 0)
  42370. throw TypeError('Illegal offset: ' + i + ' (not an integer)');
  42371. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42372. throw RangeError(
  42373. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42374. );
  42375. }
  42376. e instanceof o || (e = o.wrap(e, t));
  42377. var r = e.limit - e.offset;
  42378. if (r <= 0) return this;
  42379. var a = r - i;
  42380. if (a > 0) {
  42381. var s = new ArrayBuffer(this.buffer.byteLength + a),
  42382. l = new Uint8Array(s);
  42383. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  42384. (this.buffer = s),
  42385. (this.view = l),
  42386. (this.offset += a),
  42387. this.markedOffset >= 0 && (this.markedOffset += a),
  42388. (this.limit += a),
  42389. (i += a);
  42390. } else {
  42391. new Uint8Array(this.buffer);
  42392. }
  42393. return (
  42394. this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  42395. (e.offset = e.limit),
  42396. n && (this.offset -= r),
  42397. this
  42398. );
  42399. }),
  42400. (a.prependTo = function (e, t) {
  42401. return e.prepend(this, t), this;
  42402. }),
  42403. (a.printDebug = function (e) {
  42404. 'function' != typeof e && (e = console.log.bind(console)),
  42405. e(
  42406. this.toString() +
  42407. '\n-------------------------------------------------------------------\n' +
  42408. this.toDebug(!0)
  42409. );
  42410. }),
  42411. (a.remaining = function () {
  42412. return this.limit - this.offset;
  42413. }),
  42414. (a.reset = function () {
  42415. return (
  42416. this.markedOffset >= 0
  42417. ? ((this.offset = this.markedOffset), (this.markedOffset = -1))
  42418. : (this.offset = 0),
  42419. this
  42420. );
  42421. }),
  42422. (a.resize = function (e) {
  42423. if (!this.noAssert) {
  42424. if ('number' != typeof e || e % 1 !== 0)
  42425. throw TypeError('Illegal capacity: ' + e + ' (not an integer)');
  42426. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity: 0 <= ' + e);
  42427. }
  42428. if (this.buffer.byteLength < e) {
  42429. var t = new ArrayBuffer(e),
  42430. i = new Uint8Array(t);
  42431. i.set(this.view), (this.buffer = t), (this.view = i);
  42432. }
  42433. return this;
  42434. }),
  42435. (a.reverse = function (e, t) {
  42436. if (
  42437. ('undefined' == typeof e && (e = this.offset),
  42438. 'undefined' == typeof t && (t = this.limit),
  42439. !this.noAssert)
  42440. ) {
  42441. if ('number' != typeof e || e % 1 !== 0)
  42442. throw TypeError('Illegal begin: Not an integer');
  42443. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42444. throw TypeError('Illegal end: Not an integer');
  42445. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42446. throw RangeError(
  42447. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42448. );
  42449. }
  42450. return e === t
  42451. ? this
  42452. : (Array.prototype.reverse.call(this.view.subarray(e, t)), this);
  42453. }),
  42454. (a.skip = function (e) {
  42455. if (!this.noAssert) {
  42456. if ('number' != typeof e || e % 1 !== 0)
  42457. throw TypeError('Illegal length: ' + e + ' (not an integer)');
  42458. e |= 0;
  42459. }
  42460. var t = this.offset + e;
  42461. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  42462. throw RangeError(
  42463. 'Illegal length: 0 <= ' +
  42464. this.offset +
  42465. ' + ' +
  42466. e +
  42467. ' <= ' +
  42468. this.buffer.byteLength
  42469. );
  42470. return (this.offset = t), this;
  42471. }),
  42472. (a.slice = function (e, t) {
  42473. if (
  42474. ('undefined' == typeof e && (e = this.offset),
  42475. 'undefined' == typeof t && (t = this.limit),
  42476. !this.noAssert)
  42477. ) {
  42478. if ('number' != typeof e || e % 1 !== 0)
  42479. throw TypeError('Illegal begin: Not an integer');
  42480. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42481. throw TypeError('Illegal end: Not an integer');
  42482. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42483. throw RangeError(
  42484. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42485. );
  42486. }
  42487. var i = this.clone();
  42488. return (i.offset = e), (i.limit = t), i;
  42489. }),
  42490. (a.toBuffer = function (e) {
  42491. var t = this.offset,
  42492. i = this.limit;
  42493. if (!this.noAssert) {
  42494. if ('number' != typeof t || t % 1 !== 0)
  42495. throw TypeError('Illegal offset: Not an integer');
  42496. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42497. throw TypeError('Illegal limit: Not an integer');
  42498. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42499. throw RangeError(
  42500. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42501. );
  42502. }
  42503. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer;
  42504. if (t === i) return s;
  42505. var n = new ArrayBuffer(i - t);
  42506. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n;
  42507. }),
  42508. (a.toArrayBuffer = a.toBuffer),
  42509. (a.toString = function (e, t, i) {
  42510. if ('undefined' == typeof e)
  42511. return (
  42512. 'ByteBufferAB(offset=' +
  42513. this.offset +
  42514. ',markedOffset=' +
  42515. this.markedOffset +
  42516. ',limit=' +
  42517. this.limit +
  42518. ',capacity=' +
  42519. this.capacity() +
  42520. ')'
  42521. );
  42522. switch (('number' == typeof e && ((e = 'utf8'), (t = e), (i = t)), e)) {
  42523. case 'utf8':
  42524. return this.toUTF8(t, i);
  42525. case 'base64':
  42526. return this.toBase64(t, i);
  42527. case 'hex':
  42528. return this.toHex(t, i);
  42529. case 'binary':
  42530. return this.toBinary(t, i);
  42531. case 'debug':
  42532. return this.toDebug();
  42533. case 'columns':
  42534. return this.toColumns();
  42535. default:
  42536. throw Error('Unsupported encoding: ' + e);
  42537. }
  42538. });
  42539. var c = (function () {
  42540. for (
  42541. var e = {},
  42542. t = [
  42543. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
  42544. 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
  42545. 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50,
  42546. 51, 52, 53, 54, 55, 56, 57, 43, 47,
  42547. ],
  42548. i = [],
  42549. n = 0,
  42550. r = t.length;
  42551. n < r;
  42552. ++n
  42553. )
  42554. i[t[n]] = n;
  42555. return (
  42556. (e.encode = function (e, i) {
  42557. for (var n, r; null !== (n = e()); )
  42558. i(t[(n >> 2) & 63]),
  42559. (r = (3 & n) << 4),
  42560. null !== (n = e())
  42561. ? ((r |= (n >> 4) & 15),
  42562. i(t[63 & (r | ((n >> 4) & 15))]),
  42563. (r = (15 & n) << 2),
  42564. null !== (n = e())
  42565. ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n]))
  42566. : (i(t[63 & r]), i(61)))
  42567. : (i(t[63 & r]), i(61), i(61));
  42568. }),
  42569. (e.decode = function (e, t) {
  42570. function n(e) {
  42571. throw Error('Illegal character code: ' + e);
  42572. }
  42573. for (var r, o, a; null !== (r = e()); )
  42574. if (
  42575. ((o = i[r]),
  42576. 'undefined' == typeof o && n(r),
  42577. null !== (r = e()) &&
  42578. ((a = i[r]),
  42579. 'undefined' == typeof a && n(r),
  42580. t(((o << 2) >>> 0) | ((48 & a) >> 4)),
  42581. null !== (r = e())))
  42582. ) {
  42583. if (((o = i[r]), 'undefined' == typeof o)) {
  42584. if (61 === r) break;
  42585. n(r);
  42586. }
  42587. if ((t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)), null !== (r = e()))) {
  42588. if (((a = i[r]), 'undefined' == typeof a)) {
  42589. if (61 === r) break;
  42590. n(r);
  42591. }
  42592. t((((3 & o) << 6) >>> 0) | a);
  42593. }
  42594. }
  42595. }),
  42596. (e.test = function (e) {
  42597. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(
  42598. e
  42599. );
  42600. }),
  42601. e
  42602. );
  42603. })();
  42604. (a.toBase64 = function (e, t) {
  42605. if (
  42606. ('undefined' == typeof e && (e = this.offset),
  42607. 'undefined' == typeof t && (t = this.limit),
  42608. (e |= 0),
  42609. (t |= 0),
  42610. e < 0 || t > this.capacity || e > t)
  42611. )
  42612. throw RangeError('begin, end');
  42613. var n;
  42614. return (
  42615. c.encode(
  42616. function () {
  42617. return e < t ? this.view[e++] : null;
  42618. }.bind(this),
  42619. (n = i())
  42620. ),
  42621. n()
  42622. );
  42623. }),
  42624. (o.fromBase64 = function (e, i) {
  42625. if ('string' != typeof e) throw TypeError('str');
  42626. var n = new o((e.length / 4) * 3, i),
  42627. r = 0;
  42628. return (
  42629. c.decode(t(e), function (e) {
  42630. n.view[r++] = e;
  42631. }),
  42632. (n.limit = r),
  42633. n
  42634. );
  42635. }),
  42636. (o.btoa = function (e) {
  42637. return o.fromBinary(e).toBase64();
  42638. }),
  42639. (o.atob = function (e) {
  42640. return o.fromBase64(e).toBinary();
  42641. }),
  42642. (a.toBinary = function (e, t) {
  42643. if (
  42644. ('undefined' == typeof e && (e = this.offset),
  42645. 'undefined' == typeof t && (t = this.limit),
  42646. (e |= 0),
  42647. (t |= 0),
  42648. e < 0 || t > this.capacity() || e > t)
  42649. )
  42650. throw RangeError('begin, end');
  42651. if (e === t) return '';
  42652. for (var i = [], n = []; e < t; )
  42653. i.push(this.view[e++]),
  42654. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), (i = []));
  42655. return n.join('') + String.fromCharCode.apply(String, i);
  42656. }),
  42657. (o.fromBinary = function (e, t) {
  42658. if ('string' != typeof e) throw TypeError('str');
  42659. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  42660. if (((i = e.charCodeAt(n)), i > 255)) throw RangeError('illegal char code: ' + i);
  42661. a.view[n++] = i;
  42662. }
  42663. return (a.limit = r), a;
  42664. }),
  42665. (a.toDebug = function (e) {
  42666. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  42667. if (
  42668. (i !== -1 &&
  42669. ((t = this.view[i]),
  42670. (r +=
  42671. t < 16 ? '0' + t.toString(16).toUpperCase() : t.toString(16).toUpperCase()),
  42672. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : '.')),
  42673. ++i,
  42674. e && i > 0 && i % 16 === 0 && i !== n)
  42675. ) {
  42676. for (; r.length < 51; ) r += ' ';
  42677. (a += r + o + '\n'), (r = o = '');
  42678. }
  42679. r +=
  42680. i === this.offset && i === this.limit
  42681. ? i === this.markedOffset
  42682. ? '!'
  42683. : '|'
  42684. : i === this.offset
  42685. ? i === this.markedOffset
  42686. ? '['
  42687. : '<'
  42688. : i === this.limit
  42689. ? i === this.markedOffset
  42690. ? ']'
  42691. : '>'
  42692. : i === this.markedOffset
  42693. ? "'"
  42694. : e || (0 !== i && i !== n)
  42695. ? ' '
  42696. : '';
  42697. }
  42698. if (e && ' ' !== r) {
  42699. for (; r.length < 51; ) r += ' ';
  42700. a += r + o + '\n';
  42701. }
  42702. return e ? a : r;
  42703. }),
  42704. (o.fromDebug = function (e, t, i) {
  42705. for (
  42706. var n,
  42707. r,
  42708. a = e.length,
  42709. s = new o(((a + 1) / 3) | 0, t, i),
  42710. l = 0,
  42711. c = 0,
  42712. h = !1,
  42713. u = !1,
  42714. d = !1,
  42715. p = !1,
  42716. f = !1;
  42717. l < a;
  42718. ) {
  42719. switch ((n = e.charAt(l++))) {
  42720. case '!':
  42721. if (!i) {
  42722. if (u || d || p) {
  42723. f = !0;
  42724. break;
  42725. }
  42726. u = d = p = !0;
  42727. }
  42728. (s.offset = s.markedOffset = s.limit = c), (h = !1);
  42729. break;
  42730. case '|':
  42731. if (!i) {
  42732. if (u || p) {
  42733. f = !0;
  42734. break;
  42735. }
  42736. u = p = !0;
  42737. }
  42738. (s.offset = s.limit = c), (h = !1);
  42739. break;
  42740. case '[':
  42741. if (!i) {
  42742. if (u || d) {
  42743. f = !0;
  42744. break;
  42745. }
  42746. u = d = !0;
  42747. }
  42748. (s.offset = s.markedOffset = c), (h = !1);
  42749. break;
  42750. case '<':
  42751. if (!i) {
  42752. if (u) {
  42753. f = !0;
  42754. break;
  42755. }
  42756. u = !0;
  42757. }
  42758. (s.offset = c), (h = !1);
  42759. break;
  42760. case ']':
  42761. if (!i) {
  42762. if (p || d) {
  42763. f = !0;
  42764. break;
  42765. }
  42766. p = d = !0;
  42767. }
  42768. (s.limit = s.markedOffset = c), (h = !1);
  42769. break;
  42770. case '>':
  42771. if (!i) {
  42772. if (p) {
  42773. f = !0;
  42774. break;
  42775. }
  42776. p = !0;
  42777. }
  42778. (s.limit = c), (h = !1);
  42779. break;
  42780. case "'":
  42781. if (!i) {
  42782. if (d) {
  42783. f = !0;
  42784. break;
  42785. }
  42786. d = !0;
  42787. }
  42788. (s.markedOffset = c), (h = !1);
  42789. break;
  42790. case ' ':
  42791. h = !1;
  42792. break;
  42793. default:
  42794. if (!i && h) {
  42795. f = !0;
  42796. break;
  42797. }
  42798. if (
  42799. ((r = parseInt(n + e.charAt(l++), 16)), !i && (isNaN(r) || r < 0 || r > 255))
  42800. )
  42801. throw TypeError('Illegal str: Not a debug encoded string');
  42802. (s.view[c++] = r), (h = !0);
  42803. }
  42804. if (f) throw TypeError('Illegal str: Invalid symbol at ' + l);
  42805. }
  42806. if (!i) {
  42807. if (!u || !p) throw TypeError('Illegal str: Missing offset or limit');
  42808. if (c < s.buffer.byteLength)
  42809. throw TypeError(
  42810. 'Illegal str: Not a debug encoded string (is it hex?) ' + c + ' < ' + a
  42811. );
  42812. }
  42813. return s;
  42814. }),
  42815. (a.toHex = function (e, t) {
  42816. if (
  42817. ((e = 'undefined' == typeof e ? this.offset : e),
  42818. (t = 'undefined' == typeof t ? this.limit : t),
  42819. !this.noAssert)
  42820. ) {
  42821. if ('number' != typeof e || e % 1 !== 0)
  42822. throw TypeError('Illegal begin: Not an integer');
  42823. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42824. throw TypeError('Illegal end: Not an integer');
  42825. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42826. throw RangeError(
  42827. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42828. );
  42829. }
  42830. for (var i, n = new Array(t - e); e < t; )
  42831. (i = this.view[e++]), i < 16 ? n.push('0', i.toString(16)) : n.push(i.toString(16));
  42832. return n.join('');
  42833. }),
  42834. (o.fromHex = function (e, t, i) {
  42835. if (!i) {
  42836. if ('string' != typeof e) throw TypeError('Illegal str: Not a string');
  42837. if (e.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2');
  42838. }
  42839. for (var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0; s < r; s += 2) {
  42840. if (
  42841. ((n = parseInt(e.substring(s, s + 2), 16)),
  42842. !i && (!isFinite(n) || n < 0 || n > 255))
  42843. )
  42844. throw TypeError('Illegal str: Contains non-hex characters');
  42845. a.view[l++] = n;
  42846. }
  42847. return (a.limit = l), a;
  42848. });
  42849. var h = (function () {
  42850. var e = {};
  42851. return (
  42852. (e.MAX_CODEPOINT = 1114111),
  42853. (e.encodeUTF8 = function (e, t) {
  42854. var i = null;
  42855. for (
  42856. 'number' == typeof e &&
  42857. ((i = e),
  42858. (e = function () {
  42859. return null;
  42860. }));
  42861. null !== i || null !== (i = e());
  42862. )
  42863. i < 128
  42864. ? t(127 & i)
  42865. : i < 2048
  42866. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  42867. : i < 65536
  42868. ? (t(((i >> 12) & 15) | 224), t(((i >> 6) & 63) | 128), t((63 & i) | 128))
  42869. : (t(((i >> 18) & 7) | 240),
  42870. t(((i >> 12) & 63) | 128),
  42871. t(((i >> 6) & 63) | 128),
  42872. t((63 & i) | 128)),
  42873. (i = null);
  42874. }),
  42875. (e.decodeUTF8 = function (e, t) {
  42876. for (
  42877. var i,
  42878. n,
  42879. r,
  42880. o,
  42881. a = function (e) {
  42882. e = e.slice(0, e.indexOf(null));
  42883. var t = Error(e.toString());
  42884. throw ((t.name = 'TruncatedError'), (t.bytes = e), t);
  42885. };
  42886. null !== (i = e());
  42887. )
  42888. if (0 === (128 & i)) t(i);
  42889. else if (192 === (224 & i))
  42890. null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n));
  42891. else if (224 === (240 & i))
  42892. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  42893. t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r));
  42894. else {
  42895. if (240 !== (248 & i)) throw RangeError('Illegal starting byte: ' + i);
  42896. (null === (n = e()) || null === (r = e()) || null === (o = e())) &&
  42897. a([i, n, r, o]),
  42898. t(((7 & i) << 18) | ((63 & n) << 12) | ((63 & r) << 6) | (63 & o));
  42899. }
  42900. }),
  42901. (e.UTF16toUTF8 = function (e, t) {
  42902. for (var i, n = null; ; ) {
  42903. if (null === (i = null !== n ? n : e())) break;
  42904. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343
  42905. ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null))
  42906. : t(i);
  42907. }
  42908. null !== n && t(n);
  42909. }),
  42910. (e.UTF8toUTF16 = function (e, t) {
  42911. var i = null;
  42912. for (
  42913. 'number' == typeof e &&
  42914. ((i = e),
  42915. (e = function () {
  42916. return null;
  42917. }));
  42918. null !== i || null !== (i = e());
  42919. )
  42920. i <= 65535 ? t(i) : ((i -= 65536), t((i >> 10) + 55296), t((i % 1024) + 56320)),
  42921. (i = null);
  42922. }),
  42923. (e.encodeUTF16toUTF8 = function (t, i) {
  42924. e.UTF16toUTF8(t, function (t) {
  42925. e.encodeUTF8(t, i);
  42926. });
  42927. }),
  42928. (e.decodeUTF8toUTF16 = function (t, i) {
  42929. e.decodeUTF8(t, function (t) {
  42930. e.UTF8toUTF16(t, i);
  42931. });
  42932. }),
  42933. (e.calculateCodePoint = function (e) {
  42934. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
  42935. }),
  42936. (e.calculateUTF8 = function (e) {
  42937. for (var t, i = 0; null !== (t = e()); )
  42938. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  42939. return i;
  42940. }),
  42941. (e.calculateUTF16asUTF8 = function (t) {
  42942. var i = 0,
  42943. n = 0;
  42944. return (
  42945. e.UTF16toUTF8(t, function (e) {
  42946. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4);
  42947. }),
  42948. [i, n]
  42949. );
  42950. }),
  42951. e
  42952. );
  42953. })();
  42954. return (
  42955. (a.toUTF8 = function (e, t) {
  42956. if (
  42957. ('undefined' == typeof e && (e = this.offset),
  42958. 'undefined' == typeof t && (t = this.limit),
  42959. !this.noAssert)
  42960. ) {
  42961. if ('number' != typeof e || e % 1 !== 0)
  42962. throw TypeError('Illegal begin: Not an integer');
  42963. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42964. throw TypeError('Illegal end: Not an integer');
  42965. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42966. throw RangeError(
  42967. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42968. );
  42969. }
  42970. var n;
  42971. try {
  42972. h.decodeUTF8toUTF16(
  42973. function () {
  42974. return e < t ? this.view[e++] : null;
  42975. }.bind(this),
  42976. (n = i())
  42977. );
  42978. } catch (i) {
  42979. if (e !== t) throw RangeError('Illegal range: Truncated data, ' + e + ' != ' + t);
  42980. }
  42981. return n();
  42982. }),
  42983. (o.fromUTF8 = function (e, i, n) {
  42984. if (!n && 'string' != typeof e) throw TypeError('Illegal str: Not a string');
  42985. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  42986. a = 0;
  42987. return (
  42988. h.encodeUTF16toUTF8(t(e), function (e) {
  42989. r.view[a++] = e;
  42990. }),
  42991. (r.limit = a),
  42992. r
  42993. );
  42994. }),
  42995. o
  42996. );
  42997. });
  42998. },
  42999. {
  43000. long: 216,
  43001. },
  43002. ],
  43003. 216: [
  43004. function (e, t, i) {
  43005. !(function (i, n) {
  43006. 'function' == typeof define && define.amd
  43007. ? define([], n)
  43008. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  43009. ? (t.exports = n())
  43010. : ((i.dcodeIO = i.dcodeIO || {}).Long = n());
  43011. })(this, function () {
  43012. 'use strict';
  43013. function e(e, t, i) {
  43014. (this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i);
  43015. }
  43016. function t(e) {
  43017. return (e && e.__isLong__) === !0;
  43018. }
  43019. function i(e, t) {
  43020. var i, n, o;
  43021. return t
  43022. ? ((e >>>= 0),
  43023. (o = 0 <= e && e < 256) && (n = l[e])
  43024. ? n
  43025. : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  43026. : ((e |= 0),
  43027. (o = -128 <= e && e < 128) && (n = s[e])
  43028. ? n
  43029. : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i));
  43030. }
  43031. function n(e, t) {
  43032. if (isNaN(e) || !isFinite(e)) return t ? m : g;
  43033. if (t) {
  43034. if (e < 0) return m;
  43035. if (e >= d) return I;
  43036. } else {
  43037. if (e <= -p) return E;
  43038. if (e + 1 >= p) return C;
  43039. }
  43040. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t);
  43041. }
  43042. function r(t, i, n) {
  43043. return new e(t, i, n);
  43044. }
  43045. function o(e, t, i) {
  43046. if (0 === e.length) throw Error('empty string');
  43047. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return g;
  43048. if (
  43049. ('number' == typeof t ? ((i = t), (t = !1)) : (t = !!t),
  43050. (i = i || 10),
  43051. i < 2 || 36 < i)
  43052. )
  43053. throw RangeError('radix');
  43054. var r;
  43055. if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen');
  43056. if (0 === r) return o(e.substring(1), t, i).neg();
  43057. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  43058. var h = Math.min(8, e.length - l),
  43059. u = parseInt(e.substring(l, l + h), i);
  43060. if (h < 8) {
  43061. var d = n(c(i, h));
  43062. s = s.mul(d).add(n(u));
  43063. } else (s = s.mul(a)), (s = s.add(n(u)));
  43064. }
  43065. return (s.unsigned = t), s;
  43066. }
  43067. function a(t) {
  43068. return t instanceof e
  43069. ? t
  43070. : 'number' == typeof t
  43071. ? n(t)
  43072. : 'string' == typeof t
  43073. ? o(t)
  43074. : r(t.low, t.high, t.unsigned);
  43075. }
  43076. e.prototype.__isLong__,
  43077. Object.defineProperty(e.prototype, '__isLong__', {
  43078. value: !0,
  43079. enumerable: !1,
  43080. configurable: !1,
  43081. }),
  43082. (e.isLong = t);
  43083. var s = {},
  43084. l = {};
  43085. (e.fromInt = i), (e.fromNumber = n), (e.fromBits = r);
  43086. var c = Math.pow;
  43087. (e.fromString = o), (e.fromValue = a);
  43088. var h = 1 << 24,
  43089. u = 4294967296,
  43090. d = 0x10000000000000000,
  43091. p = d / 2,
  43092. f = i(h),
  43093. g = i(0);
  43094. e.ZERO = g;
  43095. var m = i(0, !0);
  43096. e.UZERO = m;
  43097. var v = i(1);
  43098. e.ONE = v;
  43099. var A = i(1, !0);
  43100. e.UONE = A;
  43101. var y = i(-1);
  43102. e.NEG_ONE = y;
  43103. var C = r(-1, 2147483647, !1);
  43104. e.MAX_VALUE = C;
  43105. var I = r(-1, -1, !0);
  43106. e.MAX_UNSIGNED_VALUE = I;
  43107. var E = r(0, -2147483648, !1);
  43108. e.MIN_VALUE = E;
  43109. var b = e.prototype;
  43110. return (
  43111. (b.toInt = function () {
  43112. return this.unsigned ? this.low >>> 0 : this.low;
  43113. }),
  43114. (b.toNumber = function () {
  43115. return this.unsigned
  43116. ? (this.high >>> 0) * u + (this.low >>> 0)
  43117. : this.high * u + (this.low >>> 0);
  43118. }),
  43119. (b.toString = function (e) {
  43120. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError('radix');
  43121. if (this.isZero()) return '0';
  43122. if (this.isNegative()) {
  43123. if (this.eq(E)) {
  43124. var t = n(e),
  43125. i = this.div(t),
  43126. r = i.mul(t).sub(this);
  43127. return i.toString(e) + r.toInt().toString(e);
  43128. }
  43129. return '-' + this.neg().toString(e);
  43130. }
  43131. for (var o = n(c(e, 6), this.unsigned), a = this, s = ''; ; ) {
  43132. var l = a.div(o),
  43133. h = a.sub(l.mul(o)).toInt() >>> 0,
  43134. u = h.toString(e);
  43135. if (((a = l), a.isZero())) return u + s;
  43136. for (; u.length < 6; ) u = '0' + u;
  43137. s = '' + u + s;
  43138. }
  43139. }),
  43140. (b.getHighBits = function () {
  43141. return this.high;
  43142. }),
  43143. (b.getHighBitsUnsigned = function () {
  43144. return this.high >>> 0;
  43145. }),
  43146. (b.getLowBits = function () {
  43147. return this.low;
  43148. }),
  43149. (b.getLowBitsUnsigned = function () {
  43150. return this.low >>> 0;
  43151. }),
  43152. (b.getNumBitsAbs = function () {
  43153. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  43154. for (
  43155. var e = 0 != this.high ? this.high : this.low, t = 31;
  43156. t > 0 && 0 == (e & (1 << t));
  43157. t--
  43158. );
  43159. return 0 != this.high ? t + 33 : t + 1;
  43160. }),
  43161. (b.isZero = function () {
  43162. return 0 === this.high && 0 === this.low;
  43163. }),
  43164. (b.isNegative = function () {
  43165. return !this.unsigned && this.high < 0;
  43166. }),
  43167. (b.isPositive = function () {
  43168. return this.unsigned || this.high >= 0;
  43169. }),
  43170. (b.isOdd = function () {
  43171. return 1 === (1 & this.low);
  43172. }),
  43173. (b.isEven = function () {
  43174. return 0 === (1 & this.low);
  43175. }),
  43176. (b.equals = function (e) {
  43177. return (
  43178. t(e) || (e = a(e)),
  43179. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) &&
  43180. this.high === e.high &&
  43181. this.low === e.low
  43182. );
  43183. }),
  43184. (b.eq = b.equals),
  43185. (b.notEquals = function (e) {
  43186. return !this.eq(e);
  43187. }),
  43188. (b.neq = b.notEquals),
  43189. (b.lessThan = function (e) {
  43190. return this.comp(e) < 0;
  43191. }),
  43192. (b.lt = b.lessThan),
  43193. (b.lessThanOrEqual = function (e) {
  43194. return this.comp(e) <= 0;
  43195. }),
  43196. (b.lte = b.lessThanOrEqual),
  43197. (b.greaterThan = function (e) {
  43198. return this.comp(e) > 0;
  43199. }),
  43200. (b.gt = b.greaterThan),
  43201. (b.greaterThanOrEqual = function (e) {
  43202. return this.comp(e) >= 0;
  43203. }),
  43204. (b.gte = b.greaterThanOrEqual),
  43205. (b.compare = function (e) {
  43206. if ((t(e) || (e = a(e)), this.eq(e))) return 0;
  43207. var i = this.isNegative(),
  43208. n = e.isNegative();
  43209. return i && !n
  43210. ? -1
  43211. : !i && n
  43212. ? 1
  43213. : this.unsigned
  43214. ? e.high >>> 0 > this.high >>> 0 ||
  43215. (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  43216. ? -1
  43217. : 1
  43218. : this.sub(e).isNegative()
  43219. ? -1
  43220. : 1;
  43221. }),
  43222. (b.comp = b.compare),
  43223. (b.negate = function () {
  43224. return !this.unsigned && this.eq(E) ? E : this.not().add(v);
  43225. }),
  43226. (b.neg = b.negate),
  43227. (b.add = function (e) {
  43228. t(e) || (e = a(e));
  43229. var i = this.high >>> 16,
  43230. n = 65535 & this.high,
  43231. o = this.low >>> 16,
  43232. s = 65535 & this.low,
  43233. l = e.high >>> 16,
  43234. c = 65535 & e.high,
  43235. h = e.low >>> 16,
  43236. u = 65535 & e.low,
  43237. d = 0,
  43238. p = 0,
  43239. f = 0,
  43240. g = 0;
  43241. return (
  43242. (g += s + u),
  43243. (f += g >>> 16),
  43244. (g &= 65535),
  43245. (f += o + h),
  43246. (p += f >>> 16),
  43247. (f &= 65535),
  43248. (p += n + c),
  43249. (d += p >>> 16),
  43250. (p &= 65535),
  43251. (d += i + l),
  43252. (d &= 65535),
  43253. r((f << 16) | g, (d << 16) | p, this.unsigned)
  43254. );
  43255. }),
  43256. (b.subtract = function (e) {
  43257. return t(e) || (e = a(e)), this.add(e.neg());
  43258. }),
  43259. (b.sub = b.subtract),
  43260. (b.multiply = function (e) {
  43261. if (this.isZero()) return g;
  43262. if ((t(e) || (e = a(e)), e.isZero())) return g;
  43263. if (this.eq(E)) return e.isOdd() ? E : g;
  43264. if (e.eq(E)) return this.isOdd() ? E : g;
  43265. if (this.isNegative())
  43266. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  43267. if (e.isNegative()) return this.mul(e.neg()).neg();
  43268. if (this.lt(f) && e.lt(f)) return n(this.toNumber() * e.toNumber(), this.unsigned);
  43269. var i = this.high >>> 16,
  43270. o = 65535 & this.high,
  43271. s = this.low >>> 16,
  43272. l = 65535 & this.low,
  43273. c = e.high >>> 16,
  43274. h = 65535 & e.high,
  43275. u = e.low >>> 16,
  43276. d = 65535 & e.low,
  43277. p = 0,
  43278. m = 0,
  43279. v = 0,
  43280. A = 0;
  43281. return (
  43282. (A += l * d),
  43283. (v += A >>> 16),
  43284. (A &= 65535),
  43285. (v += s * d),
  43286. (m += v >>> 16),
  43287. (v &= 65535),
  43288. (v += l * u),
  43289. (m += v >>> 16),
  43290. (v &= 65535),
  43291. (m += o * d),
  43292. (p += m >>> 16),
  43293. (m &= 65535),
  43294. (m += s * u),
  43295. (p += m >>> 16),
  43296. (m &= 65535),
  43297. (m += l * h),
  43298. (p += m >>> 16),
  43299. (m &= 65535),
  43300. (p += i * d + o * u + s * h + l * c),
  43301. (p &= 65535),
  43302. r((v << 16) | A, (p << 16) | m, this.unsigned)
  43303. );
  43304. }),
  43305. (b.mul = b.multiply),
  43306. (b.divide = function (e) {
  43307. if ((t(e) || (e = a(e)), e.isZero())) throw Error('division by zero');
  43308. if (this.isZero()) return this.unsigned ? m : g;
  43309. var i, r, o;
  43310. if (this.unsigned) {
  43311. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m;
  43312. if (e.gt(this.shru(1))) return A;
  43313. o = m;
  43314. } else {
  43315. if (this.eq(E)) {
  43316. if (e.eq(v) || e.eq(y)) return E;
  43317. if (e.eq(E)) return v;
  43318. var s = this.shr(1);
  43319. return (
  43320. (i = s.div(e).shl(1)),
  43321. i.eq(g)
  43322. ? e.isNegative()
  43323. ? v
  43324. : y
  43325. : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  43326. );
  43327. }
  43328. if (e.eq(E)) return this.unsigned ? m : g;
  43329. if (this.isNegative())
  43330. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  43331. if (e.isNegative()) return this.div(e.neg()).neg();
  43332. o = g;
  43333. }
  43334. for (r = this; r.gte(e); ) {
  43335. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  43336. for (
  43337. var l = Math.ceil(Math.log(i) / Math.LN2),
  43338. h = l <= 48 ? 1 : c(2, l - 48),
  43339. u = n(i),
  43340. d = u.mul(e);
  43341. d.isNegative() || d.gt(r);
  43342. )
  43343. (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e));
  43344. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d));
  43345. }
  43346. return o;
  43347. }),
  43348. (b.div = b.divide),
  43349. (b.modulo = function (e) {
  43350. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e));
  43351. }),
  43352. (b.mod = b.modulo),
  43353. (b.not = function () {
  43354. return r(~this.low, ~this.high, this.unsigned);
  43355. }),
  43356. (b.and = function (e) {
  43357. return t(e) || (e = a(e)), r(this.low & e.low, this.high & e.high, this.unsigned);
  43358. }),
  43359. (b.or = function (e) {
  43360. return t(e) || (e = a(e)), r(this.low | e.low, this.high | e.high, this.unsigned);
  43361. }),
  43362. (b.xor = function (e) {
  43363. return t(e) || (e = a(e)), r(this.low ^ e.low, this.high ^ e.high, this.unsigned);
  43364. }),
  43365. (b.shiftLeft = function (e) {
  43366. return (
  43367. t(e) && (e = e.toInt()),
  43368. 0 === (e &= 63)
  43369. ? this
  43370. : e < 32
  43371. ? r(this.low << e, (this.high << e) | (this.low >>> (32 - e)), this.unsigned)
  43372. : r(0, this.low << (e - 32), this.unsigned)
  43373. );
  43374. }),
  43375. (b.shl = b.shiftLeft),
  43376. (b.shiftRight = function (e) {
  43377. return (
  43378. t(e) && (e = e.toInt()),
  43379. 0 === (e &= 63)
  43380. ? this
  43381. : e < 32
  43382. ? r((this.low >>> e) | (this.high << (32 - e)), this.high >> e, this.unsigned)
  43383. : r(this.high >> (e - 32), this.high >= 0 ? 0 : -1, this.unsigned)
  43384. );
  43385. }),
  43386. (b.shr = b.shiftRight),
  43387. (b.shiftRightUnsigned = function (e) {
  43388. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this;
  43389. var i = this.high;
  43390. if (e < 32) {
  43391. var n = this.low;
  43392. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned);
  43393. }
  43394. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> (e - 32), 0, this.unsigned);
  43395. }),
  43396. (b.shru = b.shiftRightUnsigned),
  43397. (b.toSigned = function () {
  43398. return this.unsigned ? r(this.low, this.high, !1) : this;
  43399. }),
  43400. (b.toUnsigned = function () {
  43401. return this.unsigned ? this : r(this.low, this.high, !0);
  43402. }),
  43403. (b.toBytes = function (e) {
  43404. return e ? this.toBytesLE() : this.toBytesBE();
  43405. }),
  43406. (b.toBytesLE = function () {
  43407. var e = this.high,
  43408. t = this.low;
  43409. return [
  43410. 255 & t,
  43411. (t >>> 8) & 255,
  43412. (t >>> 16) & 255,
  43413. (t >>> 24) & 255,
  43414. 255 & e,
  43415. (e >>> 8) & 255,
  43416. (e >>> 16) & 255,
  43417. (e >>> 24) & 255,
  43418. ];
  43419. }),
  43420. (b.toBytesBE = function () {
  43421. var e = this.high,
  43422. t = this.low;
  43423. return [
  43424. (e >>> 24) & 255,
  43425. (e >>> 16) & 255,
  43426. (e >>> 8) & 255,
  43427. 255 & e,
  43428. (t >>> 24) & 255,
  43429. (t >>> 16) & 255,
  43430. (t >>> 8) & 255,
  43431. 255 & t,
  43432. ];
  43433. }),
  43434. e
  43435. );
  43436. });
  43437. },
  43438. {},
  43439. ],
  43440. 217: [
  43441. function (e, t, i) {
  43442. var n = {
  43443. REVISION: '75',
  43444. };
  43445. 'function' == typeof define && define.amd
  43446. ? define('three', n)
  43447. : 'undefined' != typeof i && 'undefined' != typeof t && (t.exports = n),
  43448. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  43449. void 0 === Math.sign &&
  43450. (Math.sign = function (e) {
  43451. return e < 0 ? -1 : e > 0 ? 1 : +e;
  43452. }),
  43453. void 0 === Function.prototype.name &&
  43454. void 0 !== Object.defineProperty &&
  43455. Object.defineProperty(Function.prototype, 'name', {
  43456. get: function () {
  43457. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
  43458. },
  43459. }),
  43460. void 0 === Object.assign &&
  43461. Object.defineProperty(Object, 'assign', {
  43462. writable: !0,
  43463. configurable: !0,
  43464. value: function (e) {
  43465. 'use strict';
  43466. if (void 0 === e || null === e)
  43467. throw new TypeError('Cannot convert first argument to object');
  43468. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  43469. var r = arguments[i];
  43470. if (void 0 !== r && null !== r) {
  43471. r = Object(r);
  43472. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  43473. var l = o[a],
  43474. c = Object.getOwnPropertyDescriptor(r, l);
  43475. void 0 !== c && c.enumerable && (t[l] = r[l]);
  43476. }
  43477. }
  43478. }
  43479. return t;
  43480. },
  43481. }),
  43482. (n.MOUSE = {
  43483. LEFT: 0,
  43484. MIDDLE: 1,
  43485. RIGHT: 2,
  43486. }),
  43487. (n.CullFaceNone = 0),
  43488. (n.CullFaceBack = 1),
  43489. (n.CullFaceFront = 2),
  43490. (n.CullFaceFrontBack = 3),
  43491. (n.FrontFaceDirectionCW = 0),
  43492. (n.FrontFaceDirectionCCW = 1),
  43493. (n.BasicShadowMap = 0),
  43494. (n.PCFShadowMap = 1),
  43495. (n.PCFSoftShadowMap = 2),
  43496. (n.FrontSide = 0),
  43497. (n.BackSide = 1),
  43498. (n.DoubleSide = 2),
  43499. (n.FlatShading = 1),
  43500. (n.SmoothShading = 2),
  43501. (n.NoColors = 0),
  43502. (n.FaceColors = 1),
  43503. (n.VertexColors = 2),
  43504. (n.NoBlending = 0),
  43505. (n.NormalBlending = 1),
  43506. (n.AdditiveBlending = 2),
  43507. (n.SubtractiveBlending = 3),
  43508. (n.MultiplyBlending = 4),
  43509. (n.CustomBlending = 5),
  43510. (n.AddEquation = 100),
  43511. (n.SubtractEquation = 101),
  43512. (n.ReverseSubtractEquation = 102),
  43513. (n.MinEquation = 103),
  43514. (n.MaxEquation = 104),
  43515. (n.ZeroFactor = 200),
  43516. (n.OneFactor = 201),
  43517. (n.SrcColorFactor = 202),
  43518. (n.OneMinusSrcColorFactor = 203),
  43519. (n.SrcAlphaFactor = 204),
  43520. (n.OneMinusSrcAlphaFactor = 205),
  43521. (n.DstAlphaFactor = 206),
  43522. (n.OneMinusDstAlphaFactor = 207),
  43523. (n.DstColorFactor = 208),
  43524. (n.OneMinusDstColorFactor = 209),
  43525. (n.SrcAlphaSaturateFactor = 210),
  43526. (n.NeverDepth = 0),
  43527. (n.AlwaysDepth = 1),
  43528. (n.LessDepth = 2),
  43529. (n.LessEqualDepth = 3),
  43530. (n.EqualDepth = 4),
  43531. (n.GreaterEqualDepth = 5),
  43532. (n.GreaterDepth = 6),
  43533. (n.NotEqualDepth = 7),
  43534. (n.MultiplyOperation = 0),
  43535. (n.MixOperation = 1),
  43536. (n.AddOperation = 2),
  43537. (n.NoToneMapping = 0),
  43538. (n.LinearToneMapping = 1),
  43539. (n.ReinhardToneMapping = 2),
  43540. (n.Uncharted2ToneMapping = 3),
  43541. (n.CineonToneMapping = 4),
  43542. (n.UVMapping = 300),
  43543. (n.CubeReflectionMapping = 301),
  43544. (n.CubeRefractionMapping = 302),
  43545. (n.EquirectangularReflectionMapping = 303),
  43546. (n.EquirectangularRefractionMapping = 304),
  43547. (n.SphericalReflectionMapping = 305),
  43548. (n.CubeUVReflectionMapping = 306),
  43549. (n.CubeUVRefractionMapping = 307),
  43550. (n.RepeatWrapping = 1e3),
  43551. (n.ClampToEdgeWrapping = 1001),
  43552. (n.MirroredRepeatWrapping = 1002),
  43553. (n.NearestFilter = 1003),
  43554. (n.NearestMipMapNearestFilter = 1004),
  43555. (n.NearestMipMapLinearFilter = 1005),
  43556. (n.LinearFilter = 1006),
  43557. (n.LinearMipMapNearestFilter = 1007),
  43558. (n.LinearMipMapLinearFilter = 1008),
  43559. (n.UnsignedByteType = 1009),
  43560. (n.ByteType = 1010),
  43561. (n.ShortType = 1011),
  43562. (n.UnsignedShortType = 1012),
  43563. (n.IntType = 1013),
  43564. (n.UnsignedIntType = 1014),
  43565. (n.FloatType = 1015),
  43566. (n.HalfFloatType = 1025),
  43567. (n.UnsignedShort4444Type = 1016),
  43568. (n.UnsignedShort5551Type = 1017),
  43569. (n.UnsignedShort565Type = 1018),
  43570. (n.AlphaFormat = 1019),
  43571. (n.RGBFormat = 1020),
  43572. (n.RGBAFormat = 1021),
  43573. (n.LuminanceFormat = 1022),
  43574. (n.LuminanceAlphaFormat = 1023),
  43575. (n.RGBEFormat = n.RGBAFormat),
  43576. (n.RGB_S3TC_DXT1_Format = 2001),
  43577. (n.RGBA_S3TC_DXT1_Format = 2002),
  43578. (n.RGBA_S3TC_DXT3_Format = 2003),
  43579. (n.RGBA_S3TC_DXT5_Format = 2004),
  43580. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  43581. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  43582. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  43583. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  43584. (n.RGB_ETC1_Format = 2151),
  43585. (n.LoopOnce = 2200),
  43586. (n.LoopRepeat = 2201),
  43587. (n.LoopPingPong = 2202),
  43588. (n.InterpolateDiscrete = 2300),
  43589. (n.InterpolateLinear = 2301),
  43590. (n.InterpolateSmooth = 2302),
  43591. (n.ZeroCurvatureEnding = 2400),
  43592. (n.ZeroSlopeEnding = 2401),
  43593. (n.WrapAroundEnding = 2402),
  43594. (n.TrianglesDrawMode = 0),
  43595. (n.TriangleStripDrawMode = 1),
  43596. (n.TriangleFanDrawMode = 2),
  43597. (n.LinearEncoding = 3e3),
  43598. (n.sRGBEncoding = 3001),
  43599. (n.GammaEncoding = 3007),
  43600. (n.RGBEEncoding = 3002),
  43601. (n.LogLuvEncoding = 3003),
  43602. (n.RGBM7Encoding = 3004),
  43603. (n.RGBM16Encoding = 3005),
  43604. (n.RGBDEncoding = 3006),
  43605. (n.Color = function (e) {
  43606. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e);
  43607. }),
  43608. (n.Color.prototype = {
  43609. constructor: n.Color,
  43610. r: 1,
  43611. g: 1,
  43612. b: 1,
  43613. set: function (e) {
  43614. return (
  43615. e instanceof n.Color
  43616. ? this.copy(e)
  43617. : 'number' == typeof e
  43618. ? this.setHex(e)
  43619. : 'string' == typeof e && this.setStyle(e),
  43620. this
  43621. );
  43622. },
  43623. setScalar: function (e) {
  43624. (this.r = e), (this.g = e), (this.b = e);
  43625. },
  43626. setHex: function (e) {
  43627. return (
  43628. (e = Math.floor(e)),
  43629. (this.r = ((e >> 16) & 255) / 255),
  43630. (this.g = ((e >> 8) & 255) / 255),
  43631. (this.b = (255 & e) / 255),
  43632. this
  43633. );
  43634. },
  43635. setRGB: function (e, t, i) {
  43636. return (this.r = e), (this.g = t), (this.b = i), this;
  43637. },
  43638. setHSL: (function () {
  43639. function e(e, t, i) {
  43640. return (
  43641. i < 0 && (i += 1),
  43642. i > 1 && (i -= 1),
  43643. i < 1 / 6
  43644. ? e + 6 * (t - e) * i
  43645. : i < 0.5
  43646. ? t
  43647. : i < 2 / 3
  43648. ? e + 6 * (t - e) * (2 / 3 - i)
  43649. : e
  43650. );
  43651. }
  43652. return function (t, i, r) {
  43653. if (
  43654. ((t = n.Math.euclideanModulo(t, 1)),
  43655. (i = n.Math.clamp(i, 0, 1)),
  43656. (r = n.Math.clamp(r, 0, 1)),
  43657. 0 === i)
  43658. )
  43659. this.r = this.g = this.b = r;
  43660. else {
  43661. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  43662. a = 2 * r - o;
  43663. (this.r = e(a, o, t + 1 / 3)),
  43664. (this.g = e(a, o, t)),
  43665. (this.b = e(a, o, t - 1 / 3));
  43666. }
  43667. return this;
  43668. };
  43669. })(),
  43670. setStyle: function (e) {
  43671. function t(t) {
  43672. void 0 !== t &&
  43673. parseFloat(t) < 1 &&
  43674. console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.');
  43675. }
  43676. var i;
  43677. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  43678. var r,
  43679. o = i[1],
  43680. a = i[2];
  43681. switch (o) {
  43682. case 'rgb':
  43683. case 'rgba':
  43684. if (
  43685. (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  43686. )
  43687. return (
  43688. (this.r = Math.min(255, parseInt(r[1], 10)) / 255),
  43689. (this.g = Math.min(255, parseInt(r[2], 10)) / 255),
  43690. (this.b = Math.min(255, parseInt(r[3], 10)) / 255),
  43691. t(r[5]),
  43692. this
  43693. );
  43694. if (
  43695. (r =
  43696. /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43697. a
  43698. ))
  43699. )
  43700. return (
  43701. (this.r = Math.min(100, parseInt(r[1], 10)) / 100),
  43702. (this.g = Math.min(100, parseInt(r[2], 10)) / 100),
  43703. (this.b = Math.min(100, parseInt(r[3], 10)) / 100),
  43704. t(r[5]),
  43705. this
  43706. );
  43707. break;
  43708. case 'hsl':
  43709. case 'hsla':
  43710. if (
  43711. (r =
  43712. /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43713. a
  43714. ))
  43715. ) {
  43716. var s = parseFloat(r[1]) / 360,
  43717. l = parseInt(r[2], 10) / 100,
  43718. c = parseInt(r[3], 10) / 100;
  43719. return t(r[5]), this.setHSL(s, l, c);
  43720. }
  43721. }
  43722. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  43723. var h = i[1],
  43724. u = h.length;
  43725. if (3 === u)
  43726. return (
  43727. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255),
  43728. (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255),
  43729. (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255),
  43730. this
  43731. );
  43732. if (6 === u)
  43733. return (
  43734. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255),
  43735. (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255),
  43736. (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255),
  43737. this
  43738. );
  43739. }
  43740. if (e && e.length > 0) {
  43741. var h = n.ColorKeywords[e];
  43742. void 0 !== h ? this.setHex(h) : console.warn('THREE.Color: Unknown color ' + e);
  43743. }
  43744. return this;
  43745. },
  43746. clone: function () {
  43747. return new this.constructor(this.r, this.g, this.b);
  43748. },
  43749. copy: function (e) {
  43750. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this;
  43751. },
  43752. copyGammaToLinear: function (e, t) {
  43753. return (
  43754. void 0 === t && (t = 2),
  43755. (this.r = Math.pow(e.r, t)),
  43756. (this.g = Math.pow(e.g, t)),
  43757. (this.b = Math.pow(e.b, t)),
  43758. this
  43759. );
  43760. },
  43761. copyLinearToGamma: function (e, t) {
  43762. void 0 === t && (t = 2);
  43763. var i = t > 0 ? 1 / t : 1;
  43764. return (
  43765. (this.r = Math.pow(e.r, i)),
  43766. (this.g = Math.pow(e.g, i)),
  43767. (this.b = Math.pow(e.b, i)),
  43768. this
  43769. );
  43770. },
  43771. convertGammaToLinear: function () {
  43772. var e = this.r,
  43773. t = this.g,
  43774. i = this.b;
  43775. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this;
  43776. },
  43777. convertLinearToGamma: function () {
  43778. return (
  43779. (this.r = Math.sqrt(this.r)),
  43780. (this.g = Math.sqrt(this.g)),
  43781. (this.b = Math.sqrt(this.b)),
  43782. this
  43783. );
  43784. },
  43785. getHex: function () {
  43786. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0);
  43787. },
  43788. getHexString: function () {
  43789. return ('000000' + this.getHex().toString(16)).slice(-6);
  43790. },
  43791. getHSL: function (e) {
  43792. var t,
  43793. i,
  43794. n = e || {
  43795. h: 0,
  43796. s: 0,
  43797. l: 0,
  43798. },
  43799. r = this.r,
  43800. o = this.g,
  43801. a = this.b,
  43802. s = Math.max(r, o, a),
  43803. l = Math.min(r, o, a),
  43804. c = (l + s) / 2;
  43805. if (l === s) (t = 0), (i = 0);
  43806. else {
  43807. var h = s - l;
  43808. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  43809. case r:
  43810. t = (o - a) / h + (o < a ? 6 : 0);
  43811. break;
  43812. case o:
  43813. t = (a - r) / h + 2;
  43814. break;
  43815. case a:
  43816. t = (r - o) / h + 4;
  43817. }
  43818. t /= 6;
  43819. }
  43820. return (n.h = t), (n.s = i), (n.l = c), n;
  43821. },
  43822. getStyle: function () {
  43823. return (
  43824. 'rgb(' +
  43825. ((255 * this.r) | 0) +
  43826. ',' +
  43827. ((255 * this.g) | 0) +
  43828. ',' +
  43829. ((255 * this.b) | 0) +
  43830. ')'
  43831. );
  43832. },
  43833. offsetHSL: function (e, t, i) {
  43834. var n = this.getHSL();
  43835. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this;
  43836. },
  43837. add: function (e) {
  43838. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this;
  43839. },
  43840. addColors: function (e, t) {
  43841. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this;
  43842. },
  43843. addScalar: function (e) {
  43844. return (this.r += e), (this.g += e), (this.b += e), this;
  43845. },
  43846. multiply: function (e) {
  43847. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this;
  43848. },
  43849. multiplyScalar: function (e) {
  43850. return (this.r *= e), (this.g *= e), (this.b *= e), this;
  43851. },
  43852. lerp: function (e, t) {
  43853. return (
  43854. (this.r += (e.r - this.r) * t),
  43855. (this.g += (e.g - this.g) * t),
  43856. (this.b += (e.b - this.b) * t),
  43857. this
  43858. );
  43859. },
  43860. equals: function (e) {
  43861. return e.r === this.r && e.g === this.g && e.b === this.b;
  43862. },
  43863. fromArray: function (e, t) {
  43864. return (
  43865. void 0 === t && (t = 0),
  43866. (this.r = e[t]),
  43867. (this.g = e[t + 1]),
  43868. (this.b = e[t + 2]),
  43869. this
  43870. );
  43871. },
  43872. toArray: function (e, t) {
  43873. return (
  43874. void 0 === e && (e = []),
  43875. void 0 === t && (t = 0),
  43876. (e[t] = this.r),
  43877. (e[t + 1] = this.g),
  43878. (e[t + 2] = this.b),
  43879. e
  43880. );
  43881. },
  43882. }),
  43883. (n.ColorKeywords = {
  43884. aliceblue: 15792383,
  43885. antiquewhite: 16444375,
  43886. aqua: 65535,
  43887. aquamarine: 8388564,
  43888. azure: 15794175,
  43889. beige: 16119260,
  43890. bisque: 16770244,
  43891. black: 0,
  43892. blanchedalmond: 16772045,
  43893. blue: 255,
  43894. blueviolet: 9055202,
  43895. brown: 10824234,
  43896. burlywood: 14596231,
  43897. cadetblue: 6266528,
  43898. chartreuse: 8388352,
  43899. chocolate: 13789470,
  43900. coral: 16744272,
  43901. cornflowerblue: 6591981,
  43902. cornsilk: 16775388,
  43903. crimson: 14423100,
  43904. cyan: 65535,
  43905. darkblue: 139,
  43906. darkcyan: 35723,
  43907. darkgoldenrod: 12092939,
  43908. darkgray: 11119017,
  43909. darkgreen: 25600,
  43910. darkgrey: 11119017,
  43911. darkkhaki: 12433259,
  43912. darkmagenta: 9109643,
  43913. darkolivegreen: 5597999,
  43914. darkorange: 16747520,
  43915. darkorchid: 10040012,
  43916. darkred: 9109504,
  43917. darksalmon: 15308410,
  43918. darkseagreen: 9419919,
  43919. darkslateblue: 4734347,
  43920. darkslategray: 3100495,
  43921. darkslategrey: 3100495,
  43922. darkturquoise: 52945,
  43923. darkviolet: 9699539,
  43924. deeppink: 16716947,
  43925. deepskyblue: 49151,
  43926. dimgray: 6908265,
  43927. dimgrey: 6908265,
  43928. dodgerblue: 2003199,
  43929. firebrick: 11674146,
  43930. floralwhite: 16775920,
  43931. forestgreen: 2263842,
  43932. fuchsia: 16711935,
  43933. gainsboro: 14474460,
  43934. ghostwhite: 16316671,
  43935. gold: 16766720,
  43936. goldenrod: 14329120,
  43937. gray: 8421504,
  43938. green: 32768,
  43939. greenyellow: 11403055,
  43940. grey: 8421504,
  43941. honeydew: 15794160,
  43942. hotpink: 16738740,
  43943. indianred: 13458524,
  43944. indigo: 4915330,
  43945. ivory: 16777200,
  43946. khaki: 15787660,
  43947. lavender: 15132410,
  43948. lavenderblush: 16773365,
  43949. lawngreen: 8190976,
  43950. lemonchiffon: 16775885,
  43951. lightblue: 11393254,
  43952. lightcoral: 15761536,
  43953. lightcyan: 14745599,
  43954. lightgoldenrodyellow: 16448210,
  43955. lightgray: 13882323,
  43956. lightgreen: 9498256,
  43957. lightgrey: 13882323,
  43958. lightpink: 16758465,
  43959. lightsalmon: 16752762,
  43960. lightseagreen: 2142890,
  43961. lightskyblue: 8900346,
  43962. lightslategray: 7833753,
  43963. lightslategrey: 7833753,
  43964. lightsteelblue: 11584734,
  43965. lightyellow: 16777184,
  43966. lime: 65280,
  43967. limegreen: 3329330,
  43968. linen: 16445670,
  43969. magenta: 16711935,
  43970. maroon: 8388608,
  43971. mediumaquamarine: 6737322,
  43972. mediumblue: 205,
  43973. mediumorchid: 12211667,
  43974. mediumpurple: 9662683,
  43975. mediumseagreen: 3978097,
  43976. mediumslateblue: 8087790,
  43977. mediumspringgreen: 64154,
  43978. mediumturquoise: 4772300,
  43979. mediumvioletred: 13047173,
  43980. midnightblue: 1644912,
  43981. mintcream: 16121850,
  43982. mistyrose: 16770273,
  43983. moccasin: 16770229,
  43984. navajowhite: 16768685,
  43985. navy: 128,
  43986. oldlace: 16643558,
  43987. olive: 8421376,
  43988. olivedrab: 7048739,
  43989. orange: 16753920,
  43990. orangered: 16729344,
  43991. orchid: 14315734,
  43992. palegoldenrod: 15657130,
  43993. palegreen: 10025880,
  43994. paleturquoise: 11529966,
  43995. palevioletred: 14381203,
  43996. papayawhip: 16773077,
  43997. peachpuff: 16767673,
  43998. peru: 13468991,
  43999. pink: 16761035,
  44000. plum: 14524637,
  44001. powderblue: 11591910,
  44002. purple: 8388736,
  44003. red: 16711680,
  44004. rosybrown: 12357519,
  44005. royalblue: 4286945,
  44006. saddlebrown: 9127187,
  44007. salmon: 16416882,
  44008. sandybrown: 16032864,
  44009. seagreen: 3050327,
  44010. seashell: 16774638,
  44011. sienna: 10506797,
  44012. silver: 12632256,
  44013. skyblue: 8900331,
  44014. slateblue: 6970061,
  44015. slategray: 7372944,
  44016. slategrey: 7372944,
  44017. snow: 16775930,
  44018. springgreen: 65407,
  44019. steelblue: 4620980,
  44020. tan: 13808780,
  44021. teal: 32896,
  44022. thistle: 14204888,
  44023. tomato: 16737095,
  44024. turquoise: 4251856,
  44025. violet: 15631086,
  44026. wheat: 16113331,
  44027. white: 16777215,
  44028. whitesmoke: 16119285,
  44029. yellow: 16776960,
  44030. yellowgreen: 10145074,
  44031. }),
  44032. (n.Quaternion = function (e, t, i, n) {
  44033. (this._x = e || 0),
  44034. (this._y = t || 0),
  44035. (this._z = i || 0),
  44036. (this._w = void 0 !== n ? n : 1);
  44037. }),
  44038. (n.Quaternion.prototype = {
  44039. constructor: n.Quaternion,
  44040. get x() {
  44041. return this._x;
  44042. },
  44043. set x(e) {
  44044. (this._x = e), this.onChangeCallback();
  44045. },
  44046. get y() {
  44047. return this._y;
  44048. },
  44049. set y(e) {
  44050. (this._y = e), this.onChangeCallback();
  44051. },
  44052. get z() {
  44053. return this._z;
  44054. },
  44055. set z(e) {
  44056. (this._z = e), this.onChangeCallback();
  44057. },
  44058. get w() {
  44059. return this._w;
  44060. },
  44061. set w(e) {
  44062. (this._w = e), this.onChangeCallback();
  44063. },
  44064. set: function (e, t, i, n) {
  44065. return (
  44066. (this._x = e),
  44067. (this._y = t),
  44068. (this._z = i),
  44069. (this._w = n),
  44070. this.onChangeCallback(),
  44071. this
  44072. );
  44073. },
  44074. clone: function () {
  44075. return new this.constructor(this._x, this._y, this._z, this._w);
  44076. },
  44077. copy: function (e) {
  44078. return (
  44079. (this._x = e.x),
  44080. (this._y = e.y),
  44081. (this._z = e.z),
  44082. (this._w = e.w),
  44083. this.onChangeCallback(),
  44084. this
  44085. );
  44086. },
  44087. setFromEuler: function (e, t) {
  44088. if (e instanceof n.Euler == !1)
  44089. throw new Error(
  44090. 'THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  44091. );
  44092. var i = Math.cos(e._x / 2),
  44093. r = Math.cos(e._y / 2),
  44094. o = Math.cos(e._z / 2),
  44095. a = Math.sin(e._x / 2),
  44096. s = Math.sin(e._y / 2),
  44097. l = Math.sin(e._z / 2),
  44098. c = e.order;
  44099. return (
  44100. 'XYZ' === c
  44101. ? ((this._x = a * r * o + i * s * l),
  44102. (this._y = i * s * o - a * r * l),
  44103. (this._z = i * r * l + a * s * o),
  44104. (this._w = i * r * o - a * s * l))
  44105. : 'YXZ' === c
  44106. ? ((this._x = a * r * o + i * s * l),
  44107. (this._y = i * s * o - a * r * l),
  44108. (this._z = i * r * l - a * s * o),
  44109. (this._w = i * r * o + a * s * l))
  44110. : 'ZXY' === c
  44111. ? ((this._x = a * r * o - i * s * l),
  44112. (this._y = i * s * o + a * r * l),
  44113. (this._z = i * r * l + a * s * o),
  44114. (this._w = i * r * o - a * s * l))
  44115. : 'ZYX' === c
  44116. ? ((this._x = a * r * o - i * s * l),
  44117. (this._y = i * s * o + a * r * l),
  44118. (this._z = i * r * l - a * s * o),
  44119. (this._w = i * r * o + a * s * l))
  44120. : 'YZX' === c
  44121. ? ((this._x = a * r * o + i * s * l),
  44122. (this._y = i * s * o + a * r * l),
  44123. (this._z = i * r * l - a * s * o),
  44124. (this._w = i * r * o - a * s * l))
  44125. : 'XZY' === c &&
  44126. ((this._x = a * r * o - i * s * l),
  44127. (this._y = i * s * o - a * r * l),
  44128. (this._z = i * r * l + a * s * o),
  44129. (this._w = i * r * o + a * s * l)),
  44130. t !== !1 && this.onChangeCallback(),
  44131. this
  44132. );
  44133. },
  44134. setFromAxisAngle: function (e, t) {
  44135. var i = t / 2,
  44136. n = Math.sin(i);
  44137. return (
  44138. (this._x = e.x * n),
  44139. (this._y = e.y * n),
  44140. (this._z = e.z * n),
  44141. (this._w = Math.cos(i)),
  44142. this.onChangeCallback(),
  44143. this
  44144. );
  44145. },
  44146. setFromRotationMatrix: function (e) {
  44147. var t,
  44148. i = e.elements,
  44149. n = i[0],
  44150. r = i[4],
  44151. o = i[8],
  44152. a = i[1],
  44153. s = i[5],
  44154. l = i[9],
  44155. c = i[2],
  44156. h = i[6],
  44157. u = i[10],
  44158. d = n + s + u;
  44159. return (
  44160. d > 0
  44161. ? ((t = 0.5 / Math.sqrt(d + 1)),
  44162. (this._w = 0.25 / t),
  44163. (this._x = (h - l) * t),
  44164. (this._y = (o - c) * t),
  44165. (this._z = (a - r) * t))
  44166. : n > s && n > u
  44167. ? ((t = 2 * Math.sqrt(1 + n - s - u)),
  44168. (this._w = (h - l) / t),
  44169. (this._x = 0.25 * t),
  44170. (this._y = (r + a) / t),
  44171. (this._z = (o + c) / t))
  44172. : s > u
  44173. ? ((t = 2 * Math.sqrt(1 + s - n - u)),
  44174. (this._w = (o - c) / t),
  44175. (this._x = (r + a) / t),
  44176. (this._y = 0.25 * t),
  44177. (this._z = (l + h) / t))
  44178. : ((t = 2 * Math.sqrt(1 + u - n - s)),
  44179. (this._w = (a - r) / t),
  44180. (this._x = (o + c) / t),
  44181. (this._y = (l + h) / t),
  44182. (this._z = 0.25 * t)),
  44183. this.onChangeCallback(),
  44184. this
  44185. );
  44186. },
  44187. setFromUnitVectors: (function () {
  44188. var e,
  44189. t,
  44190. i = 1e-6;
  44191. return function (r, o) {
  44192. return (
  44193. void 0 === e && (e = new n.Vector3()),
  44194. (t = r.dot(o) + 1),
  44195. t < i
  44196. ? ((t = 0),
  44197. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y))
  44198. : e.crossVectors(r, o),
  44199. (this._x = e.x),
  44200. (this._y = e.y),
  44201. (this._z = e.z),
  44202. (this._w = t),
  44203. this.normalize(),
  44204. this
  44205. );
  44206. };
  44207. })(),
  44208. inverse: function () {
  44209. return this.conjugate().normalize(), this;
  44210. },
  44211. conjugate: function () {
  44212. return (
  44213. (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  44214. );
  44215. },
  44216. dot: function (e) {
  44217. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w;
  44218. },
  44219. lengthSq: function () {
  44220. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
  44221. },
  44222. length: function () {
  44223. return Math.sqrt(
  44224. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  44225. );
  44226. },
  44227. normalize: function () {
  44228. var e = this.length();
  44229. return (
  44230. 0 === e
  44231. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  44232. : ((e = 1 / e),
  44233. (this._x = this._x * e),
  44234. (this._y = this._y * e),
  44235. (this._z = this._z * e),
  44236. (this._w = this._w * e)),
  44237. this.onChangeCallback(),
  44238. this
  44239. );
  44240. },
  44241. multiply: function (e, t) {
  44242. return void 0 !== t
  44243. ? (console.warn(
  44244. 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'
  44245. ),
  44246. this.multiplyQuaternions(e, t))
  44247. : this.multiplyQuaternions(this, e);
  44248. },
  44249. multiplyQuaternions: function (e, t) {
  44250. var i = e._x,
  44251. n = e._y,
  44252. r = e._z,
  44253. o = e._w,
  44254. a = t._x,
  44255. s = t._y,
  44256. l = t._z,
  44257. c = t._w;
  44258. return (
  44259. (this._x = i * c + o * a + n * l - r * s),
  44260. (this._y = n * c + o * s + r * a - i * l),
  44261. (this._z = r * c + o * l + i * s - n * a),
  44262. (this._w = o * c - i * a - n * s - r * l),
  44263. this.onChangeCallback(),
  44264. this
  44265. );
  44266. },
  44267. slerp: function (e, t) {
  44268. if (0 === t) return this;
  44269. if (1 === t) return this.copy(e);
  44270. var i = this._x,
  44271. n = this._y,
  44272. r = this._z,
  44273. o = this._w,
  44274. a = o * e._w + i * e._x + n * e._y + r * e._z;
  44275. if (
  44276. (a < 0
  44277. ? ((this._w = -e._w),
  44278. (this._x = -e._x),
  44279. (this._y = -e._y),
  44280. (this._z = -e._z),
  44281. (a = -a))
  44282. : this.copy(e),
  44283. a >= 1)
  44284. )
  44285. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this;
  44286. var s = Math.sqrt(1 - a * a);
  44287. if (Math.abs(s) < 0.001)
  44288. return (
  44289. (this._w = 0.5 * (o + this._w)),
  44290. (this._x = 0.5 * (i + this._x)),
  44291. (this._y = 0.5 * (n + this._y)),
  44292. (this._z = 0.5 * (r + this._z)),
  44293. this
  44294. );
  44295. var l = Math.atan2(s, a),
  44296. c = Math.sin((1 - t) * l) / s,
  44297. h = Math.sin(t * l) / s;
  44298. return (
  44299. (this._w = o * c + this._w * h),
  44300. (this._x = i * c + this._x * h),
  44301. (this._y = n * c + this._y * h),
  44302. (this._z = r * c + this._z * h),
  44303. this.onChangeCallback(),
  44304. this
  44305. );
  44306. },
  44307. equals: function (e) {
  44308. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w;
  44309. },
  44310. fromArray: function (e, t) {
  44311. return (
  44312. void 0 === t && (t = 0),
  44313. (this._x = e[t]),
  44314. (this._y = e[t + 1]),
  44315. (this._z = e[t + 2]),
  44316. (this._w = e[t + 3]),
  44317. this.onChangeCallback(),
  44318. this
  44319. );
  44320. },
  44321. toArray: function (e, t) {
  44322. return (
  44323. void 0 === e && (e = []),
  44324. void 0 === t && (t = 0),
  44325. (e[t] = this._x),
  44326. (e[t + 1] = this._y),
  44327. (e[t + 2] = this._z),
  44328. (e[t + 3] = this._w),
  44329. e
  44330. );
  44331. },
  44332. onChange: function (e) {
  44333. return (this.onChangeCallback = e), this;
  44334. },
  44335. onChangeCallback: function () {},
  44336. }),
  44337. Object.assign(n.Quaternion, {
  44338. slerp: function (e, t, i, n) {
  44339. return i.copy(e).slerp(t, n);
  44340. },
  44341. slerpFlat: function (e, t, i, n, r, o, a) {
  44342. var s = i[n + 0],
  44343. l = i[n + 1],
  44344. c = i[n + 2],
  44345. h = i[n + 3],
  44346. u = r[o + 0],
  44347. d = r[o + 1],
  44348. p = r[o + 2],
  44349. f = r[o + 3];
  44350. if (h !== f || s !== u || l !== d || c !== p) {
  44351. var g = 1 - a,
  44352. m = s * u + l * d + c * p + h * f,
  44353. v = m >= 0 ? 1 : -1,
  44354. A = 1 - m * m;
  44355. if (A > Number.EPSILON) {
  44356. var y = Math.sqrt(A),
  44357. C = Math.atan2(y, m * v);
  44358. (g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y);
  44359. }
  44360. var I = a * v;
  44361. if (
  44362. ((s = s * g + u * I),
  44363. (l = l * g + d * I),
  44364. (c = c * g + p * I),
  44365. (h = h * g + f * I),
  44366. g === 1 - a)
  44367. ) {
  44368. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  44369. (s *= E), (l *= E), (c *= E), (h *= E);
  44370. }
  44371. }
  44372. (e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h);
  44373. },
  44374. }),
  44375. (n.Vector2 = function (e, t) {
  44376. (this.x = e || 0), (this.y = t || 0);
  44377. }),
  44378. (n.Vector2.prototype = {
  44379. constructor: n.Vector2,
  44380. get width() {
  44381. return this.x;
  44382. },
  44383. set width(e) {
  44384. this.x = e;
  44385. },
  44386. get height() {
  44387. return this.y;
  44388. },
  44389. set height(e) {
  44390. this.y = e;
  44391. },
  44392. set: function (e, t) {
  44393. return (this.x = e), (this.y = t), this;
  44394. },
  44395. setScalar: function (e) {
  44396. return (this.x = e), (this.y = e), this;
  44397. },
  44398. setX: function (e) {
  44399. return (this.x = e), this;
  44400. },
  44401. setY: function (e) {
  44402. return (this.y = e), this;
  44403. },
  44404. setComponent: function (e, t) {
  44405. switch (e) {
  44406. case 0:
  44407. this.x = t;
  44408. break;
  44409. case 1:
  44410. this.y = t;
  44411. break;
  44412. default:
  44413. throw new Error('index is out of range: ' + e);
  44414. }
  44415. },
  44416. getComponent: function (e) {
  44417. switch (e) {
  44418. case 0:
  44419. return this.x;
  44420. case 1:
  44421. return this.y;
  44422. default:
  44423. throw new Error('index is out of range: ' + e);
  44424. }
  44425. },
  44426. clone: function () {
  44427. return new this.constructor(this.x, this.y);
  44428. },
  44429. copy: function (e) {
  44430. return (this.x = e.x), (this.y = e.y), this;
  44431. },
  44432. add: function (e, t) {
  44433. return void 0 !== t
  44434. ? (console.warn(
  44435. 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44436. ),
  44437. this.addVectors(e, t))
  44438. : ((this.x += e.x), (this.y += e.y), this);
  44439. },
  44440. addScalar: function (e) {
  44441. return (this.x += e), (this.y += e), this;
  44442. },
  44443. addVectors: function (e, t) {
  44444. return (this.x = e.x + t.x), (this.y = e.y + t.y), this;
  44445. },
  44446. addScaledVector: function (e, t) {
  44447. return (this.x += e.x * t), (this.y += e.y * t), this;
  44448. },
  44449. sub: function (e, t) {
  44450. return void 0 !== t
  44451. ? (console.warn(
  44452. 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44453. ),
  44454. this.subVectors(e, t))
  44455. : ((this.x -= e.x), (this.y -= e.y), this);
  44456. },
  44457. subScalar: function (e) {
  44458. return (this.x -= e), (this.y -= e), this;
  44459. },
  44460. subVectors: function (e, t) {
  44461. return (this.x = e.x - t.x), (this.y = e.y - t.y), this;
  44462. },
  44463. multiply: function (e) {
  44464. return (this.x *= e.x), (this.y *= e.y), this;
  44465. },
  44466. multiplyScalar: function (e) {
  44467. return (
  44468. isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  44469. );
  44470. },
  44471. divide: function (e) {
  44472. return (this.x /= e.x), (this.y /= e.y), this;
  44473. },
  44474. divideScalar: function (e) {
  44475. return this.multiplyScalar(1 / e);
  44476. },
  44477. min: function (e) {
  44478. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this;
  44479. },
  44480. max: function (e) {
  44481. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this;
  44482. },
  44483. clamp: function (e, t) {
  44484. return (
  44485. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44486. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44487. this
  44488. );
  44489. },
  44490. clampScalar: (function () {
  44491. var e, t;
  44492. return function (i, r) {
  44493. return (
  44494. void 0 === e && ((e = new n.Vector2()), (t = new n.Vector2())),
  44495. e.set(i, i),
  44496. t.set(r, r),
  44497. this.clamp(e, t)
  44498. );
  44499. };
  44500. })(),
  44501. clampLength: function (e, t) {
  44502. var i = this.length();
  44503. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  44504. },
  44505. floor: function () {
  44506. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this;
  44507. },
  44508. ceil: function () {
  44509. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this;
  44510. },
  44511. round: function () {
  44512. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this;
  44513. },
  44514. roundToZero: function () {
  44515. return (
  44516. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  44517. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  44518. this
  44519. );
  44520. },
  44521. negate: function () {
  44522. return (this.x = -this.x), (this.y = -this.y), this;
  44523. },
  44524. dot: function (e) {
  44525. return this.x * e.x + this.y * e.y;
  44526. },
  44527. lengthSq: function () {
  44528. return this.x * this.x + this.y * this.y;
  44529. },
  44530. length: function () {
  44531. return Math.sqrt(this.x * this.x + this.y * this.y);
  44532. },
  44533. lengthManhattan: function () {
  44534. return Math.abs(this.x) + Math.abs(this.y);
  44535. },
  44536. normalize: function () {
  44537. return this.divideScalar(this.length());
  44538. },
  44539. angle: function () {
  44540. var e = Math.atan2(this.y, this.x);
  44541. return e < 0 && (e += 2 * Math.PI), e;
  44542. },
  44543. distanceTo: function (e) {
  44544. return Math.sqrt(this.distanceToSquared(e));
  44545. },
  44546. distanceToSquared: function (e) {
  44547. var t = this.x - e.x,
  44548. i = this.y - e.y;
  44549. return t * t + i * i;
  44550. },
  44551. setLength: function (e) {
  44552. return this.multiplyScalar(e / this.length());
  44553. },
  44554. lerp: function (e, t) {
  44555. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this;
  44556. },
  44557. lerpVectors: function (e, t, i) {
  44558. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  44559. },
  44560. equals: function (e) {
  44561. return e.x === this.x && e.y === this.y;
  44562. },
  44563. fromArray: function (e, t) {
  44564. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this;
  44565. },
  44566. toArray: function (e, t) {
  44567. return (
  44568. void 0 === e && (e = []),
  44569. void 0 === t && (t = 0),
  44570. (e[t] = this.x),
  44571. (e[t + 1] = this.y),
  44572. e
  44573. );
  44574. },
  44575. fromAttribute: function (e, t, i) {
  44576. return (
  44577. void 0 === i && (i = 0),
  44578. (t = t * e.itemSize + i),
  44579. (this.x = e.array[t]),
  44580. (this.y = e.array[t + 1]),
  44581. this
  44582. );
  44583. },
  44584. rotateAround: function (e, t) {
  44585. var i = Math.cos(t),
  44586. n = Math.sin(t),
  44587. r = this.x - e.x,
  44588. o = this.y - e.y;
  44589. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this;
  44590. },
  44591. }),
  44592. (n.Vector3 = function (e, t, i) {
  44593. (this.x = e || 0), (this.y = t || 0), (this.z = i || 0);
  44594. }),
  44595. (n.Vector3.prototype = {
  44596. constructor: n.Vector3,
  44597. set: function (e, t, i) {
  44598. return (this.x = e), (this.y = t), (this.z = i), this;
  44599. },
  44600. setScalar: function (e) {
  44601. return (this.x = e), (this.y = e), (this.z = e), this;
  44602. },
  44603. setX: function (e) {
  44604. return (this.x = e), this;
  44605. },
  44606. setY: function (e) {
  44607. return (this.y = e), this;
  44608. },
  44609. setZ: function (e) {
  44610. return (this.z = e), this;
  44611. },
  44612. setComponent: function (e, t) {
  44613. switch (e) {
  44614. case 0:
  44615. this.x = t;
  44616. break;
  44617. case 1:
  44618. this.y = t;
  44619. break;
  44620. case 2:
  44621. this.z = t;
  44622. break;
  44623. default:
  44624. throw new Error('index is out of range: ' + e);
  44625. }
  44626. },
  44627. getComponent: function (e) {
  44628. switch (e) {
  44629. case 0:
  44630. return this.x;
  44631. case 1:
  44632. return this.y;
  44633. case 2:
  44634. return this.z;
  44635. default:
  44636. throw new Error('index is out of range: ' + e);
  44637. }
  44638. },
  44639. clone: function () {
  44640. return new this.constructor(this.x, this.y, this.z);
  44641. },
  44642. copy: function (e) {
  44643. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this;
  44644. },
  44645. add: function (e, t) {
  44646. return void 0 !== t
  44647. ? (console.warn(
  44648. 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44649. ),
  44650. this.addVectors(e, t))
  44651. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this);
  44652. },
  44653. addScalar: function (e) {
  44654. return (this.x += e), (this.y += e), (this.z += e), this;
  44655. },
  44656. addVectors: function (e, t) {
  44657. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this;
  44658. },
  44659. addScaledVector: function (e, t) {
  44660. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this;
  44661. },
  44662. sub: function (e, t) {
  44663. return void 0 !== t
  44664. ? (console.warn(
  44665. 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44666. ),
  44667. this.subVectors(e, t))
  44668. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this);
  44669. },
  44670. subScalar: function (e) {
  44671. return (this.x -= e), (this.y -= e), (this.z -= e), this;
  44672. },
  44673. subVectors: function (e, t) {
  44674. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this;
  44675. },
  44676. multiply: function (e, t) {
  44677. return void 0 !== t
  44678. ? (console.warn(
  44679. 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'
  44680. ),
  44681. this.multiplyVectors(e, t))
  44682. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this);
  44683. },
  44684. multiplyScalar: function (e) {
  44685. return (
  44686. isFinite(e)
  44687. ? ((this.x *= e), (this.y *= e), (this.z *= e))
  44688. : ((this.x = 0), (this.y = 0), (this.z = 0)),
  44689. this
  44690. );
  44691. },
  44692. multiplyVectors: function (e, t) {
  44693. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this;
  44694. },
  44695. applyEuler: (function () {
  44696. var e;
  44697. return function (t) {
  44698. return (
  44699. t instanceof n.Euler == !1 &&
  44700. console.error(
  44701. 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'
  44702. ),
  44703. void 0 === e && (e = new n.Quaternion()),
  44704. this.applyQuaternion(e.setFromEuler(t)),
  44705. this
  44706. );
  44707. };
  44708. })(),
  44709. applyAxisAngle: (function () {
  44710. var e;
  44711. return function (t, i) {
  44712. return (
  44713. void 0 === e && (e = new n.Quaternion()),
  44714. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  44715. this
  44716. );
  44717. };
  44718. })(),
  44719. applyMatrix3: function (e) {
  44720. var t = this.x,
  44721. i = this.y,
  44722. n = this.z,
  44723. r = e.elements;
  44724. return (
  44725. (this.x = r[0] * t + r[3] * i + r[6] * n),
  44726. (this.y = r[1] * t + r[4] * i + r[7] * n),
  44727. (this.z = r[2] * t + r[5] * i + r[8] * n),
  44728. this
  44729. );
  44730. },
  44731. applyMatrix4: function (e) {
  44732. var t = this.x,
  44733. i = this.y,
  44734. n = this.z,
  44735. r = e.elements;
  44736. return (
  44737. (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  44738. (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  44739. (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  44740. this
  44741. );
  44742. },
  44743. applyProjection: function (e) {
  44744. var t = this.x,
  44745. i = this.y,
  44746. n = this.z,
  44747. r = e.elements,
  44748. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  44749. return (
  44750. (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o),
  44751. (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o),
  44752. (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o),
  44753. this
  44754. );
  44755. },
  44756. applyQuaternion: function (e) {
  44757. var t = this.x,
  44758. i = this.y,
  44759. n = this.z,
  44760. r = e.x,
  44761. o = e.y,
  44762. a = e.z,
  44763. s = e.w,
  44764. l = s * t + o * n - a * i,
  44765. c = s * i + a * t - r * n,
  44766. h = s * n + r * i - o * t,
  44767. u = -r * t - o * i - a * n;
  44768. return (
  44769. (this.x = l * s + u * -r + c * -a - h * -o),
  44770. (this.y = c * s + u * -o + h * -r - l * -a),
  44771. (this.z = h * s + u * -a + l * -o - c * -r),
  44772. this
  44773. );
  44774. },
  44775. project: (function () {
  44776. var e;
  44777. return function (t) {
  44778. return (
  44779. void 0 === e && (e = new n.Matrix4()),
  44780. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  44781. this.applyProjection(e)
  44782. );
  44783. };
  44784. })(),
  44785. unproject: (function () {
  44786. var e;
  44787. return function (t) {
  44788. return (
  44789. void 0 === e && (e = new n.Matrix4()),
  44790. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  44791. this.applyProjection(e)
  44792. );
  44793. };
  44794. })(),
  44795. transformDirection: function (e) {
  44796. var t = this.x,
  44797. i = this.y,
  44798. n = this.z,
  44799. r = e.elements;
  44800. return (
  44801. (this.x = r[0] * t + r[4] * i + r[8] * n),
  44802. (this.y = r[1] * t + r[5] * i + r[9] * n),
  44803. (this.z = r[2] * t + r[6] * i + r[10] * n),
  44804. this.normalize(),
  44805. this
  44806. );
  44807. },
  44808. divide: function (e) {
  44809. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this;
  44810. },
  44811. divideScalar: function (e) {
  44812. return this.multiplyScalar(1 / e);
  44813. },
  44814. min: function (e) {
  44815. return (
  44816. (this.x = Math.min(this.x, e.x)),
  44817. (this.y = Math.min(this.y, e.y)),
  44818. (this.z = Math.min(this.z, e.z)),
  44819. this
  44820. );
  44821. },
  44822. max: function (e) {
  44823. return (
  44824. (this.x = Math.max(this.x, e.x)),
  44825. (this.y = Math.max(this.y, e.y)),
  44826. (this.z = Math.max(this.z, e.z)),
  44827. this
  44828. );
  44829. },
  44830. clamp: function (e, t) {
  44831. return (
  44832. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44833. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44834. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  44835. this
  44836. );
  44837. },
  44838. clampScalar: (function () {
  44839. var e, t;
  44840. return function (i, r) {
  44841. return (
  44842. void 0 === e && ((e = new n.Vector3()), (t = new n.Vector3())),
  44843. e.set(i, i, i),
  44844. t.set(r, r, r),
  44845. this.clamp(e, t)
  44846. );
  44847. };
  44848. })(),
  44849. clampLength: function (e, t) {
  44850. var i = this.length();
  44851. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this;
  44852. },
  44853. floor: function () {
  44854. return (
  44855. (this.x = Math.floor(this.x)),
  44856. (this.y = Math.floor(this.y)),
  44857. (this.z = Math.floor(this.z)),
  44858. this
  44859. );
  44860. },
  44861. ceil: function () {
  44862. return (
  44863. (this.x = Math.ceil(this.x)),
  44864. (this.y = Math.ceil(this.y)),
  44865. (this.z = Math.ceil(this.z)),
  44866. this
  44867. );
  44868. },
  44869. round: function () {
  44870. return (
  44871. (this.x = Math.round(this.x)),
  44872. (this.y = Math.round(this.y)),
  44873. (this.z = Math.round(this.z)),
  44874. this
  44875. );
  44876. },
  44877. roundToZero: function () {
  44878. return (
  44879. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  44880. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  44881. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  44882. this
  44883. );
  44884. },
  44885. negate: function () {
  44886. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this;
  44887. },
  44888. dot: function (e) {
  44889. return this.x * e.x + this.y * e.y + this.z * e.z;
  44890. },
  44891. lengthSq: function () {
  44892. return this.x * this.x + this.y * this.y + this.z * this.z;
  44893. },
  44894. length: function () {
  44895. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
  44896. },
  44897. lengthManhattan: function () {
  44898. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
  44899. },
  44900. normalize: function () {
  44901. return this.divideScalar(this.length());
  44902. },
  44903. setLength: function (e) {
  44904. return this.multiplyScalar(e / this.length());
  44905. },
  44906. lerp: function (e, t) {
  44907. return (
  44908. (this.x += (e.x - this.x) * t),
  44909. (this.y += (e.y - this.y) * t),
  44910. (this.z += (e.z - this.z) * t),
  44911. this
  44912. );
  44913. },
  44914. lerpVectors: function (e, t, i) {
  44915. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  44916. },
  44917. cross: function (e, t) {
  44918. if (void 0 !== t)
  44919. return (
  44920. console.warn(
  44921. 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'
  44922. ),
  44923. this.crossVectors(e, t)
  44924. );
  44925. var i = this.x,
  44926. n = this.y,
  44927. r = this.z;
  44928. return (
  44929. (this.x = n * e.z - r * e.y),
  44930. (this.y = r * e.x - i * e.z),
  44931. (this.z = i * e.y - n * e.x),
  44932. this
  44933. );
  44934. },
  44935. crossVectors: function (e, t) {
  44936. var i = e.x,
  44937. n = e.y,
  44938. r = e.z,
  44939. o = t.x,
  44940. a = t.y,
  44941. s = t.z;
  44942. return (
  44943. (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  44944. );
  44945. },
  44946. projectOnVector: (function () {
  44947. var e, t;
  44948. return function (i) {
  44949. return (
  44950. void 0 === e && (e = new n.Vector3()),
  44951. e.copy(i).normalize(),
  44952. (t = this.dot(e)),
  44953. this.copy(e).multiplyScalar(t)
  44954. );
  44955. };
  44956. })(),
  44957. projectOnPlane: (function () {
  44958. var e;
  44959. return function (t) {
  44960. return (
  44961. void 0 === e && (e = new n.Vector3()),
  44962. e.copy(this).projectOnVector(t),
  44963. this.sub(e)
  44964. );
  44965. };
  44966. })(),
  44967. reflect: (function () {
  44968. var e;
  44969. return function (t) {
  44970. return (
  44971. void 0 === e && (e = new n.Vector3()),
  44972. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  44973. );
  44974. };
  44975. })(),
  44976. angleTo: function (e) {
  44977. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  44978. return Math.acos(n.Math.clamp(t, -1, 1));
  44979. },
  44980. distanceTo: function (e) {
  44981. return Math.sqrt(this.distanceToSquared(e));
  44982. },
  44983. distanceToSquared: function (e) {
  44984. var t = this.x - e.x,
  44985. i = this.y - e.y,
  44986. n = this.z - e.z;
  44987. return t * t + i * i + n * n;
  44988. },
  44989. setFromSpherical: function (e) {
  44990. var t = Math.sin(e.phi) * e.radius;
  44991. return (
  44992. (this.x = t * Math.sin(e.theta)),
  44993. (this.y = Math.cos(e.phi) * e.radius),
  44994. (this.z = t * Math.cos(e.theta)),
  44995. this
  44996. );
  44997. },
  44998. setFromMatrixPosition: function (e) {
  44999. return this.setFromMatrixColumn(e, 3);
  45000. },
  45001. setFromMatrixScale: function (e) {
  45002. var t = this.setFromMatrixColumn(e, 0).length(),
  45003. i = this.setFromMatrixColumn(e, 1).length(),
  45004. n = this.setFromMatrixColumn(e, 2).length();
  45005. return (this.x = t), (this.y = i), (this.z = n), this;
  45006. },
  45007. setFromMatrixColumn: function (e, t) {
  45008. return (
  45009. 'number' == typeof e &&
  45010. (console.warn(
  45011. 'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'
  45012. ),
  45013. (e = arguments[1]),
  45014. (t = arguments[0])),
  45015. this.fromArray(e.elements, 4 * t)
  45016. );
  45017. },
  45018. equals: function (e) {
  45019. return e.x === this.x && e.y === this.y && e.z === this.z;
  45020. },
  45021. fromArray: function (e, t) {
  45022. return (
  45023. void 0 === t && (t = 0),
  45024. (this.x = e[t]),
  45025. (this.y = e[t + 1]),
  45026. (this.z = e[t + 2]),
  45027. this
  45028. );
  45029. },
  45030. toArray: function (e, t) {
  45031. return (
  45032. void 0 === e && (e = []),
  45033. void 0 === t && (t = 0),
  45034. (e[t] = this.x),
  45035. (e[t + 1] = this.y),
  45036. (e[t + 2] = this.z),
  45037. e
  45038. );
  45039. },
  45040. fromAttribute: function (e, t, i) {
  45041. return (
  45042. void 0 === i && (i = 0),
  45043. (t = t * e.itemSize + i),
  45044. (this.x = e.array[t]),
  45045. (this.y = e.array[t + 1]),
  45046. (this.z = e.array[t + 2]),
  45047. this
  45048. );
  45049. },
  45050. }),
  45051. (n.Vector4 = function (e, t, i, n) {
  45052. (this.x = e || 0),
  45053. (this.y = t || 0),
  45054. (this.z = i || 0),
  45055. (this.w = void 0 !== n ? n : 1);
  45056. }),
  45057. (n.Vector4.prototype = {
  45058. constructor: n.Vector4,
  45059. set: function (e, t, i, n) {
  45060. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this;
  45061. },
  45062. setScalar: function (e) {
  45063. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this;
  45064. },
  45065. setX: function (e) {
  45066. return (this.x = e), this;
  45067. },
  45068. setY: function (e) {
  45069. return (this.y = e), this;
  45070. },
  45071. setZ: function (e) {
  45072. return (this.z = e), this;
  45073. },
  45074. setW: function (e) {
  45075. return (this.w = e), this;
  45076. },
  45077. setComponent: function (e, t) {
  45078. switch (e) {
  45079. case 0:
  45080. this.x = t;
  45081. break;
  45082. case 1:
  45083. this.y = t;
  45084. break;
  45085. case 2:
  45086. this.z = t;
  45087. break;
  45088. case 3:
  45089. this.w = t;
  45090. break;
  45091. default:
  45092. throw new Error('index is out of range: ' + e);
  45093. }
  45094. },
  45095. getComponent: function (e) {
  45096. switch (e) {
  45097. case 0:
  45098. return this.x;
  45099. case 1:
  45100. return this.y;
  45101. case 2:
  45102. return this.z;
  45103. case 3:
  45104. return this.w;
  45105. default:
  45106. throw new Error('index is out of range: ' + e);
  45107. }
  45108. },
  45109. clone: function () {
  45110. return new this.constructor(this.x, this.y, this.z, this.w);
  45111. },
  45112. copy: function (e) {
  45113. return (
  45114. (this.x = e.x),
  45115. (this.y = e.y),
  45116. (this.z = e.z),
  45117. (this.w = void 0 !== e.w ? e.w : 1),
  45118. this
  45119. );
  45120. },
  45121. add: function (e, t) {
  45122. return void 0 !== t
  45123. ? (console.warn(
  45124. 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  45125. ),
  45126. this.addVectors(e, t))
  45127. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this);
  45128. },
  45129. addScalar: function (e) {
  45130. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this;
  45131. },
  45132. addVectors: function (e, t) {
  45133. return (
  45134. (this.x = e.x + t.x),
  45135. (this.y = e.y + t.y),
  45136. (this.z = e.z + t.z),
  45137. (this.w = e.w + t.w),
  45138. this
  45139. );
  45140. },
  45141. addScaledVector: function (e, t) {
  45142. return (
  45143. (this.x += e.x * t),
  45144. (this.y += e.y * t),
  45145. (this.z += e.z * t),
  45146. (this.w += e.w * t),
  45147. this
  45148. );
  45149. },
  45150. sub: function (e, t) {
  45151. return void 0 !== t
  45152. ? (console.warn(
  45153. 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  45154. ),
  45155. this.subVectors(e, t))
  45156. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this);
  45157. },
  45158. subScalar: function (e) {
  45159. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this;
  45160. },
  45161. subVectors: function (e, t) {
  45162. return (
  45163. (this.x = e.x - t.x),
  45164. (this.y = e.y - t.y),
  45165. (this.z = e.z - t.z),
  45166. (this.w = e.w - t.w),
  45167. this
  45168. );
  45169. },
  45170. multiplyScalar: function (e) {
  45171. return (
  45172. isFinite(e)
  45173. ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e))
  45174. : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)),
  45175. this
  45176. );
  45177. },
  45178. applyMatrix4: function (e) {
  45179. var t = this.x,
  45180. i = this.y,
  45181. n = this.z,
  45182. r = this.w,
  45183. o = e.elements;
  45184. return (
  45185. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  45186. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  45187. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  45188. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  45189. this
  45190. );
  45191. },
  45192. divideScalar: function (e) {
  45193. return this.multiplyScalar(1 / e);
  45194. },
  45195. setAxisAngleFromQuaternion: function (e) {
  45196. this.w = 2 * Math.acos(e.w);
  45197. var t = Math.sqrt(1 - e.w * e.w);
  45198. return (
  45199. t < 1e-4
  45200. ? ((this.x = 1), (this.y = 0), (this.z = 0))
  45201. : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)),
  45202. this
  45203. );
  45204. },
  45205. setAxisAngleFromRotationMatrix: function (e) {
  45206. var t,
  45207. i,
  45208. n,
  45209. r,
  45210. o = 0.01,
  45211. a = 0.1,
  45212. s = e.elements,
  45213. l = s[0],
  45214. c = s[4],
  45215. h = s[8],
  45216. u = s[1],
  45217. d = s[5],
  45218. p = s[9],
  45219. f = s[2],
  45220. g = s[6],
  45221. m = s[10];
  45222. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  45223. if (
  45224. Math.abs(c + u) < a &&
  45225. Math.abs(h + f) < a &&
  45226. Math.abs(p + g) < a &&
  45227. Math.abs(l + d + m - 3) < a
  45228. )
  45229. return this.set(1, 0, 0, 0), this;
  45230. t = Math.PI;
  45231. var v = (l + 1) / 2,
  45232. A = (d + 1) / 2,
  45233. y = (m + 1) / 2,
  45234. C = (c + u) / 4,
  45235. I = (h + f) / 4,
  45236. E = (p + g) / 4;
  45237. return (
  45238. v > A && v > y
  45239. ? v < o
  45240. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  45241. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  45242. : A > y
  45243. ? A < o
  45244. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  45245. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  45246. : y < o
  45247. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  45248. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  45249. this.set(i, n, r, t),
  45250. this
  45251. );
  45252. }
  45253. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  45254. return (
  45255. Math.abs(b) < 0.001 && (b = 1),
  45256. (this.x = (g - p) / b),
  45257. (this.y = (h - f) / b),
  45258. (this.z = (u - c) / b),
  45259. (this.w = Math.acos((l + d + m - 1) / 2)),
  45260. this
  45261. );
  45262. },
  45263. min: function (e) {
  45264. return (
  45265. (this.x = Math.min(this.x, e.x)),
  45266. (this.y = Math.min(this.y, e.y)),
  45267. (this.z = Math.min(this.z, e.z)),
  45268. (this.w = Math.min(this.w, e.w)),
  45269. this
  45270. );
  45271. },
  45272. max: function (e) {
  45273. return (
  45274. (this.x = Math.max(this.x, e.x)),
  45275. (this.y = Math.max(this.y, e.y)),
  45276. (this.z = Math.max(this.z, e.z)),
  45277. (this.w = Math.max(this.w, e.w)),
  45278. this
  45279. );
  45280. },
  45281. clamp: function (e, t) {
  45282. return (
  45283. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  45284. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  45285. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  45286. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  45287. this
  45288. );
  45289. },
  45290. clampScalar: (function () {
  45291. var e, t;
  45292. return function (i, r) {
  45293. return (
  45294. void 0 === e && ((e = new n.Vector4()), (t = new n.Vector4())),
  45295. e.set(i, i, i, i),
  45296. t.set(r, r, r, r),
  45297. this.clamp(e, t)
  45298. );
  45299. };
  45300. })(),
  45301. floor: function () {
  45302. return (
  45303. (this.x = Math.floor(this.x)),
  45304. (this.y = Math.floor(this.y)),
  45305. (this.z = Math.floor(this.z)),
  45306. (this.w = Math.floor(this.w)),
  45307. this
  45308. );
  45309. },
  45310. ceil: function () {
  45311. return (
  45312. (this.x = Math.ceil(this.x)),
  45313. (this.y = Math.ceil(this.y)),
  45314. (this.z = Math.ceil(this.z)),
  45315. (this.w = Math.ceil(this.w)),
  45316. this
  45317. );
  45318. },
  45319. round: function () {
  45320. return (
  45321. (this.x = Math.round(this.x)),
  45322. (this.y = Math.round(this.y)),
  45323. (this.z = Math.round(this.z)),
  45324. (this.w = Math.round(this.w)),
  45325. this
  45326. );
  45327. },
  45328. roundToZero: function () {
  45329. return (
  45330. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  45331. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  45332. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  45333. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  45334. this
  45335. );
  45336. },
  45337. negate: function () {
  45338. return (
  45339. (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  45340. );
  45341. },
  45342. dot: function (e) {
  45343. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w;
  45344. },
  45345. lengthSq: function () {
  45346. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
  45347. },
  45348. length: function () {
  45349. return Math.sqrt(
  45350. this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  45351. );
  45352. },
  45353. lengthManhattan: function () {
  45354. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
  45355. },
  45356. normalize: function () {
  45357. return this.divideScalar(this.length());
  45358. },
  45359. setLength: function (e) {
  45360. return this.multiplyScalar(e / this.length());
  45361. },
  45362. lerp: function (e, t) {
  45363. return (
  45364. (this.x += (e.x - this.x) * t),
  45365. (this.y += (e.y - this.y) * t),
  45366. (this.z += (e.z - this.z) * t),
  45367. (this.w += (e.w - this.w) * t),
  45368. this
  45369. );
  45370. },
  45371. lerpVectors: function (e, t, i) {
  45372. return this.subVectors(t, e).multiplyScalar(i).add(e), this;
  45373. },
  45374. equals: function (e) {
  45375. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w;
  45376. },
  45377. fromArray: function (e, t) {
  45378. return (
  45379. void 0 === t && (t = 0),
  45380. (this.x = e[t]),
  45381. (this.y = e[t + 1]),
  45382. (this.z = e[t + 2]),
  45383. (this.w = e[t + 3]),
  45384. this
  45385. );
  45386. },
  45387. toArray: function (e, t) {
  45388. return (
  45389. void 0 === e && (e = []),
  45390. void 0 === t && (t = 0),
  45391. (e[t] = this.x),
  45392. (e[t + 1] = this.y),
  45393. (e[t + 2] = this.z),
  45394. (e[t + 3] = this.w),
  45395. e
  45396. );
  45397. },
  45398. fromAttribute: function (e, t, i) {
  45399. return (
  45400. void 0 === i && (i = 0),
  45401. (t = t * e.itemSize + i),
  45402. (this.x = e.array[t]),
  45403. (this.y = e.array[t + 1]),
  45404. (this.z = e.array[t + 2]),
  45405. (this.w = e.array[t + 3]),
  45406. this
  45407. );
  45408. },
  45409. }),
  45410. (n.Euler = function (e, t, i, r) {
  45411. (this._x = e || 0),
  45412. (this._y = t || 0),
  45413. (this._z = i || 0),
  45414. (this._order = r || n.Euler.DefaultOrder);
  45415. }),
  45416. (n.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  45417. (n.Euler.DefaultOrder = 'XYZ'),
  45418. (n.Euler.prototype = {
  45419. constructor: n.Euler,
  45420. get x() {
  45421. return this._x;
  45422. },
  45423. set x(e) {
  45424. (this._x = e), this.onChangeCallback();
  45425. },
  45426. get y() {
  45427. return this._y;
  45428. },
  45429. set y(e) {
  45430. (this._y = e), this.onChangeCallback();
  45431. },
  45432. get z() {
  45433. return this._z;
  45434. },
  45435. set z(e) {
  45436. (this._z = e), this.onChangeCallback();
  45437. },
  45438. get order() {
  45439. return this._order;
  45440. },
  45441. set order(e) {
  45442. (this._order = e), this.onChangeCallback();
  45443. },
  45444. set: function (e, t, i, n) {
  45445. return (
  45446. (this._x = e),
  45447. (this._y = t),
  45448. (this._z = i),
  45449. (this._order = n || this._order),
  45450. this.onChangeCallback(),
  45451. this
  45452. );
  45453. },
  45454. clone: function () {
  45455. return new this.constructor(this._x, this._y, this._z, this._order);
  45456. },
  45457. copy: function (e) {
  45458. return (
  45459. (this._x = e._x),
  45460. (this._y = e._y),
  45461. (this._z = e._z),
  45462. (this._order = e._order),
  45463. this.onChangeCallback(),
  45464. this
  45465. );
  45466. },
  45467. setFromRotationMatrix: function (e, t, i) {
  45468. var r = n.Math.clamp,
  45469. o = e.elements,
  45470. a = o[0],
  45471. s = o[4],
  45472. l = o[8],
  45473. c = o[1],
  45474. h = o[5],
  45475. u = o[9],
  45476. d = o[2],
  45477. p = o[6],
  45478. f = o[10];
  45479. return (
  45480. (t = t || this._order),
  45481. 'XYZ' === t
  45482. ? ((this._y = Math.asin(r(l, -1, 1))),
  45483. Math.abs(l) < 0.99999
  45484. ? ((this._x = Math.atan2(-u, f)), (this._z = Math.atan2(-s, a)))
  45485. : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  45486. : 'YXZ' === t
  45487. ? ((this._x = Math.asin(-r(u, -1, 1))),
  45488. Math.abs(u) < 0.99999
  45489. ? ((this._y = Math.atan2(l, f)), (this._z = Math.atan2(c, h)))
  45490. : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  45491. : 'ZXY' === t
  45492. ? ((this._x = Math.asin(r(p, -1, 1))),
  45493. Math.abs(p) < 0.99999
  45494. ? ((this._y = Math.atan2(-d, f)), (this._z = Math.atan2(-s, h)))
  45495. : ((this._y = 0), (this._z = Math.atan2(c, a))))
  45496. : 'ZYX' === t
  45497. ? ((this._y = Math.asin(-r(d, -1, 1))),
  45498. Math.abs(d) < 0.99999
  45499. ? ((this._x = Math.atan2(p, f)), (this._z = Math.atan2(c, a)))
  45500. : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  45501. : 'YZX' === t
  45502. ? ((this._z = Math.asin(r(c, -1, 1))),
  45503. Math.abs(c) < 0.99999
  45504. ? ((this._x = Math.atan2(-u, h)), (this._y = Math.atan2(-d, a)))
  45505. : ((this._x = 0), (this._y = Math.atan2(l, f))))
  45506. : 'XZY' === t
  45507. ? ((this._z = Math.asin(-r(s, -1, 1))),
  45508. Math.abs(s) < 0.99999
  45509. ? ((this._x = Math.atan2(p, h)), (this._y = Math.atan2(l, a)))
  45510. : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  45511. : console.warn(
  45512. 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t
  45513. ),
  45514. (this._order = t),
  45515. i !== !1 && this.onChangeCallback(),
  45516. this
  45517. );
  45518. },
  45519. setFromQuaternion: (function () {
  45520. var e;
  45521. return function (t, i, r) {
  45522. return (
  45523. void 0 === e && (e = new n.Matrix4()),
  45524. e.makeRotationFromQuaternion(t),
  45525. this.setFromRotationMatrix(e, i, r),
  45526. this
  45527. );
  45528. };
  45529. })(),
  45530. setFromVector3: function (e, t) {
  45531. return this.set(e.x, e.y, e.z, t || this._order);
  45532. },
  45533. reorder: (function () {
  45534. var e = new n.Quaternion();
  45535. return function (t) {
  45536. e.setFromEuler(this), this.setFromQuaternion(e, t);
  45537. };
  45538. })(),
  45539. equals: function (e) {
  45540. return (
  45541. e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  45542. );
  45543. },
  45544. fromArray: function (e) {
  45545. return (
  45546. (this._x = e[0]),
  45547. (this._y = e[1]),
  45548. (this._z = e[2]),
  45549. void 0 !== e[3] && (this._order = e[3]),
  45550. this.onChangeCallback(),
  45551. this
  45552. );
  45553. },
  45554. toArray: function (e, t) {
  45555. return (
  45556. void 0 === e && (e = []),
  45557. void 0 === t && (t = 0),
  45558. (e[t] = this._x),
  45559. (e[t + 1] = this._y),
  45560. (e[t + 2] = this._z),
  45561. (e[t + 3] = this._order),
  45562. e
  45563. );
  45564. },
  45565. toVector3: function (e) {
  45566. return e
  45567. ? e.set(this._x, this._y, this._z)
  45568. : new n.Vector3(this._x, this._y, this._z);
  45569. },
  45570. onChange: function (e) {
  45571. return (this.onChangeCallback = e), this;
  45572. },
  45573. onChangeCallback: function () {},
  45574. }),
  45575. (n.Line3 = function (e, t) {
  45576. (this.start = void 0 !== e ? e : new n.Vector3()),
  45577. (this.end = void 0 !== t ? t : new n.Vector3());
  45578. }),
  45579. (n.Line3.prototype = {
  45580. constructor: n.Line3,
  45581. set: function (e, t) {
  45582. return this.start.copy(e), this.end.copy(t), this;
  45583. },
  45584. clone: function () {
  45585. return new this.constructor().copy(this);
  45586. },
  45587. copy: function (e) {
  45588. return this.start.copy(e.start), this.end.copy(e.end), this;
  45589. },
  45590. center: function (e) {
  45591. var t = e || new n.Vector3();
  45592. return t.addVectors(this.start, this.end).multiplyScalar(0.5);
  45593. },
  45594. delta: function (e) {
  45595. var t = e || new n.Vector3();
  45596. return t.subVectors(this.end, this.start);
  45597. },
  45598. distanceSq: function () {
  45599. return this.start.distanceToSquared(this.end);
  45600. },
  45601. distance: function () {
  45602. return this.start.distanceTo(this.end);
  45603. },
  45604. at: function (e, t) {
  45605. var i = t || new n.Vector3();
  45606. return this.delta(i).multiplyScalar(e).add(this.start);
  45607. },
  45608. closestPointToPointParameter: (function () {
  45609. var e = new n.Vector3(),
  45610. t = new n.Vector3();
  45611. return function (i, r) {
  45612. e.subVectors(i, this.start), t.subVectors(this.end, this.start);
  45613. var o = t.dot(t),
  45614. a = t.dot(e),
  45615. s = a / o;
  45616. return r && (s = n.Math.clamp(s, 0, 1)), s;
  45617. };
  45618. })(),
  45619. closestPointToPoint: function (e, t, i) {
  45620. var r = this.closestPointToPointParameter(e, t),
  45621. o = i || new n.Vector3();
  45622. return this.delta(o).multiplyScalar(r).add(this.start);
  45623. },
  45624. applyMatrix4: function (e) {
  45625. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this;
  45626. },
  45627. equals: function (e) {
  45628. return e.start.equals(this.start) && e.end.equals(this.end);
  45629. },
  45630. }),
  45631. (n.Box2 = function (e, t) {
  45632. (this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))),
  45633. (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)));
  45634. }),
  45635. (n.Box2.prototype = {
  45636. constructor: n.Box2,
  45637. set: function (e, t) {
  45638. return this.min.copy(e), this.max.copy(t), this;
  45639. },
  45640. setFromPoints: function (e) {
  45641. this.makeEmpty();
  45642. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]);
  45643. return this;
  45644. },
  45645. setFromCenterAndSize: (function () {
  45646. var e = new n.Vector2();
  45647. return function (t, i) {
  45648. var n = e.copy(i).multiplyScalar(0.5);
  45649. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  45650. };
  45651. })(),
  45652. clone: function () {
  45653. return new this.constructor().copy(this);
  45654. },
  45655. copy: function (e) {
  45656. return this.min.copy(e.min), this.max.copy(e.max), this;
  45657. },
  45658. makeEmpty: function () {
  45659. return (
  45660. (this.min.x = this.min.y = +(1 / 0)), (this.max.x = this.max.y = -(1 / 0)), this
  45661. );
  45662. },
  45663. isEmpty: function () {
  45664. return this.max.x < this.min.x || this.max.y < this.min.y;
  45665. },
  45666. center: function (e) {
  45667. var t = e || new n.Vector2();
  45668. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  45669. },
  45670. size: function (e) {
  45671. var t = e || new n.Vector2();
  45672. return t.subVectors(this.max, this.min);
  45673. },
  45674. expandByPoint: function (e) {
  45675. return this.min.min(e), this.max.max(e), this;
  45676. },
  45677. expandByVector: function (e) {
  45678. return this.min.sub(e), this.max.add(e), this;
  45679. },
  45680. expandByScalar: function (e) {
  45681. return this.min.addScalar(-e), this.max.addScalar(e), this;
  45682. },
  45683. containsPoint: function (e) {
  45684. return !(
  45685. e.x < this.min.x ||
  45686. e.x > this.max.x ||
  45687. e.y < this.min.y ||
  45688. e.y > this.max.y
  45689. );
  45690. },
  45691. containsBox: function (e) {
  45692. return (
  45693. this.min.x <= e.min.x &&
  45694. e.max.x <= this.max.x &&
  45695. this.min.y <= e.min.y &&
  45696. e.max.y <= this.max.y
  45697. );
  45698. },
  45699. getParameter: function (e, t) {
  45700. var i = t || new n.Vector2();
  45701. return i.set(
  45702. (e.x - this.min.x) / (this.max.x - this.min.x),
  45703. (e.y - this.min.y) / (this.max.y - this.min.y)
  45704. );
  45705. },
  45706. intersectsBox: function (e) {
  45707. return !(
  45708. e.max.x < this.min.x ||
  45709. e.min.x > this.max.x ||
  45710. e.max.y < this.min.y ||
  45711. e.min.y > this.max.y
  45712. );
  45713. },
  45714. clampPoint: function (e, t) {
  45715. var i = t || new n.Vector2();
  45716. return i.copy(e).clamp(this.min, this.max);
  45717. },
  45718. distanceToPoint: (function () {
  45719. var e = new n.Vector2();
  45720. return function (t) {
  45721. var i = e.copy(t).clamp(this.min, this.max);
  45722. return i.sub(t).length();
  45723. };
  45724. })(),
  45725. intersect: function (e) {
  45726. return this.min.max(e.min), this.max.min(e.max), this;
  45727. },
  45728. union: function (e) {
  45729. return this.min.min(e.min), this.max.max(e.max), this;
  45730. },
  45731. translate: function (e) {
  45732. return this.min.add(e), this.max.add(e), this;
  45733. },
  45734. equals: function (e) {
  45735. return e.min.equals(this.min) && e.max.equals(this.max);
  45736. },
  45737. }),
  45738. (n.Box3 = function (e, t) {
  45739. (this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))),
  45740. (this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)));
  45741. }),
  45742. (n.Box3.prototype = {
  45743. constructor: n.Box3,
  45744. set: function (e, t) {
  45745. return this.min.copy(e), this.max.copy(t), this;
  45746. },
  45747. setFromArray: function (e) {
  45748. this.makeEmpty();
  45749. for (
  45750. var t = +(1 / 0),
  45751. i = +(1 / 0),
  45752. n = +(1 / 0),
  45753. r = -(1 / 0),
  45754. o = -(1 / 0),
  45755. a = -(1 / 0),
  45756. s = 0,
  45757. l = e.length;
  45758. s < l;
  45759. s += 3
  45760. ) {
  45761. var c = e[s],
  45762. h = e[s + 1],
  45763. u = e[s + 2];
  45764. c < t && (t = c),
  45765. h < i && (i = h),
  45766. u < n && (n = u),
  45767. c > r && (r = c),
  45768. h > o && (o = h),
  45769. u > a && (a = u);
  45770. }
  45771. this.min.set(t, i, n), this.max.set(r, o, a);
  45772. },
  45773. setFromPoints: function (e) {
  45774. this.makeEmpty();
  45775. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t]);
  45776. return this;
  45777. },
  45778. setFromCenterAndSize: (function () {
  45779. var e = new n.Vector3();
  45780. return function (t, i) {
  45781. var n = e.copy(i).multiplyScalar(0.5);
  45782. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this;
  45783. };
  45784. })(),
  45785. setFromObject: (function () {
  45786. var e;
  45787. return function (t) {
  45788. void 0 === e && (e = new n.Box3());
  45789. var i = this;
  45790. return (
  45791. this.makeEmpty(),
  45792. t.updateMatrixWorld(!0),
  45793. t.traverse(function (t) {
  45794. var n = t.geometry;
  45795. void 0 !== n &&
  45796. (null === n.boundingBox && n.computeBoundingBox(),
  45797. n.boundingBox.isEmpty() === !1 &&
  45798. (e.copy(n.boundingBox), e.applyMatrix4(t.matrixWorld), i.union(e)));
  45799. }),
  45800. this
  45801. );
  45802. };
  45803. })(),
  45804. clone: function () {
  45805. return new this.constructor().copy(this);
  45806. },
  45807. copy: function (e) {
  45808. return this.min.copy(e.min), this.max.copy(e.max), this;
  45809. },
  45810. makeEmpty: function () {
  45811. return (
  45812. (this.min.x = this.min.y = this.min.z = +(1 / 0)),
  45813. (this.max.x = this.max.y = this.max.z = -(1 / 0)),
  45814. this
  45815. );
  45816. },
  45817. isEmpty: function () {
  45818. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;
  45819. },
  45820. center: function (e) {
  45821. var t = e || new n.Vector3();
  45822. return t.addVectors(this.min, this.max).multiplyScalar(0.5);
  45823. },
  45824. size: function (e) {
  45825. var t = e || new n.Vector3();
  45826. return t.subVectors(this.max, this.min);
  45827. },
  45828. expandByPoint: function (e) {
  45829. return this.min.min(e), this.max.max(e), this;
  45830. },
  45831. expandByVector: function (e) {
  45832. return this.min.sub(e), this.max.add(e), this;
  45833. },
  45834. expandByScalar: function (e) {
  45835. return this.min.addScalar(-e), this.max.addScalar(e), this;
  45836. },
  45837. containsPoint: function (e) {
  45838. return !(
  45839. e.x < this.min.x ||
  45840. e.x > this.max.x ||
  45841. e.y < this.min.y ||
  45842. e.y > this.max.y ||
  45843. e.z < this.min.z ||
  45844. e.z > this.max.z
  45845. );
  45846. },
  45847. containsBox: function (e) {
  45848. return (
  45849. this.min.x <= e.min.x &&
  45850. e.max.x <= this.max.x &&
  45851. this.min.y <= e.min.y &&
  45852. e.max.y <= this.max.y &&
  45853. this.min.z <= e.min.z &&
  45854. e.max.z <= this.max.z
  45855. );
  45856. },
  45857. getParameter: function (e, t) {
  45858. var i = t || new n.Vector3();
  45859. return i.set(
  45860. (e.x - this.min.x) / (this.max.x - this.min.x),
  45861. (e.y - this.min.y) / (this.max.y - this.min.y),
  45862. (e.z - this.min.z) / (this.max.z - this.min.z)
  45863. );
  45864. },
  45865. intersectsBox: function (e) {
  45866. return !(
  45867. e.max.x < this.min.x ||
  45868. e.min.x > this.max.x ||
  45869. e.max.y < this.min.y ||
  45870. e.min.y > this.max.y ||
  45871. e.max.z < this.min.z ||
  45872. e.min.z > this.max.z
  45873. );
  45874. },
  45875. intersectsSphere: (function () {
  45876. var e;
  45877. return function (t) {
  45878. return (
  45879. void 0 === e && (e = new n.Vector3()),
  45880. this.clampPoint(t.center, e),
  45881. e.distanceToSquared(t.center) <= t.radius * t.radius
  45882. );
  45883. };
  45884. })(),
  45885. intersectsPlane: function (e) {
  45886. var t, i;
  45887. return (
  45888. e.normal.x > 0
  45889. ? ((t = e.normal.x * this.min.x), (i = e.normal.x * this.max.x))
  45890. : ((t = e.normal.x * this.max.x), (i = e.normal.x * this.min.x)),
  45891. e.normal.y > 0
  45892. ? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y))
  45893. : ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
  45894. e.normal.z > 0
  45895. ? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z))
  45896. : ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
  45897. t <= e.constant && i >= e.constant
  45898. );
  45899. },
  45900. clampPoint: function (e, t) {
  45901. var i = t || new n.Vector3();
  45902. return i.copy(e).clamp(this.min, this.max);
  45903. },
  45904. distanceToPoint: (function () {
  45905. var e = new n.Vector3();
  45906. return function (t) {
  45907. var i = e.copy(t).clamp(this.min, this.max);
  45908. return i.sub(t).length();
  45909. };
  45910. })(),
  45911. getBoundingSphere: (function () {
  45912. var e = new n.Vector3();
  45913. return function (t) {
  45914. var i = t || new n.Sphere();
  45915. return (i.center = this.center()), (i.radius = 0.5 * this.size(e).length()), i;
  45916. };
  45917. })(),
  45918. intersect: function (e) {
  45919. return this.min.max(e.min), this.max.min(e.max), this;
  45920. },
  45921. union: function (e) {
  45922. return this.min.min(e.min), this.max.max(e.max), this;
  45923. },
  45924. applyMatrix4: (function () {
  45925. var e = [
  45926. new n.Vector3(),
  45927. new n.Vector3(),
  45928. new n.Vector3(),
  45929. new n.Vector3(),
  45930. new n.Vector3(),
  45931. new n.Vector3(),
  45932. new n.Vector3(),
  45933. new n.Vector3(),
  45934. ];
  45935. return function (t) {
  45936. return (
  45937. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  45938. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  45939. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  45940. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  45941. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  45942. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  45943. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  45944. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  45945. this.makeEmpty(),
  45946. this.setFromPoints(e),
  45947. this
  45948. );
  45949. };
  45950. })(),
  45951. translate: function (e) {
  45952. return this.min.add(e), this.max.add(e), this;
  45953. },
  45954. equals: function (e) {
  45955. return e.min.equals(this.min) && e.max.equals(this.max);
  45956. },
  45957. }),
  45958. (n.Matrix3 = function () {
  45959. (this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])),
  45960. arguments.length > 0 &&
  45961. console.error(
  45962. 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.'
  45963. );
  45964. }),
  45965. (n.Matrix3.prototype = {
  45966. constructor: n.Matrix3,
  45967. set: function (e, t, i, n, r, o, a, s, l) {
  45968. var c = this.elements;
  45969. return (
  45970. (c[0] = e),
  45971. (c[1] = n),
  45972. (c[2] = a),
  45973. (c[3] = t),
  45974. (c[4] = r),
  45975. (c[5] = s),
  45976. (c[6] = i),
  45977. (c[7] = o),
  45978. (c[8] = l),
  45979. this
  45980. );
  45981. },
  45982. identity: function () {
  45983. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
  45984. },
  45985. clone: function () {
  45986. return new this.constructor().fromArray(this.elements);
  45987. },
  45988. copy: function (e) {
  45989. var t = e.elements;
  45990. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this;
  45991. },
  45992. setFromMatrix4: function (e) {
  45993. var t = e.elements;
  45994. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this;
  45995. },
  45996. applyToVector3Array: (function () {
  45997. var e;
  45998. return function (t, i, r) {
  45999. void 0 === e && (e = new n.Vector3()),
  46000. void 0 === i && (i = 0),
  46001. void 0 === r && (r = t.length);
  46002. for (var o = 0, a = i; o < r; o += 3, a += 3)
  46003. e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a);
  46004. return t;
  46005. };
  46006. })(),
  46007. applyToBuffer: (function () {
  46008. var e;
  46009. return function (t, i, r) {
  46010. void 0 === e && (e = new n.Vector3()),
  46011. void 0 === i && (i = 0),
  46012. void 0 === r && (r = t.length / t.itemSize);
  46013. for (var o = 0, a = i; o < r; o++, a++)
  46014. (e.x = t.getX(a)),
  46015. (e.y = t.getY(a)),
  46016. (e.z = t.getZ(a)),
  46017. e.applyMatrix3(this),
  46018. t.setXYZ(e.x, e.y, e.z);
  46019. return t;
  46020. };
  46021. })(),
  46022. multiplyScalar: function (e) {
  46023. var t = this.elements;
  46024. return (
  46025. (t[0] *= e),
  46026. (t[3] *= e),
  46027. (t[6] *= e),
  46028. (t[1] *= e),
  46029. (t[4] *= e),
  46030. (t[7] *= e),
  46031. (t[2] *= e),
  46032. (t[5] *= e),
  46033. (t[8] *= e),
  46034. this
  46035. );
  46036. },
  46037. determinant: function () {
  46038. var e = this.elements,
  46039. t = e[0],
  46040. i = e[1],
  46041. n = e[2],
  46042. r = e[3],
  46043. o = e[4],
  46044. a = e[5],
  46045. s = e[6],
  46046. l = e[7],
  46047. c = e[8];
  46048. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s;
  46049. },
  46050. getInverse: function (e, t) {
  46051. e instanceof n.Matrix4 &&
  46052. console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.');
  46053. var i = e.elements,
  46054. r = this.elements,
  46055. o = i[0],
  46056. a = i[1],
  46057. s = i[2],
  46058. l = i[3],
  46059. c = i[4],
  46060. h = i[5],
  46061. u = i[6],
  46062. d = i[7],
  46063. p = i[8],
  46064. f = p * c - h * d,
  46065. g = h * u - p * l,
  46066. m = d * l - c * u,
  46067. v = o * f + a * g + s * m;
  46068. if (0 === v) {
  46069. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  46070. if (t) throw new Error(A);
  46071. return console.warn(A), this.identity();
  46072. }
  46073. return (
  46074. (r[0] = f),
  46075. (r[1] = s * d - p * a),
  46076. (r[2] = h * a - s * c),
  46077. (r[3] = g),
  46078. (r[4] = p * o - s * u),
  46079. (r[5] = s * l - h * o),
  46080. (r[6] = m),
  46081. (r[7] = a * u - d * o),
  46082. (r[8] = c * o - a * l),
  46083. this.multiplyScalar(1 / v)
  46084. );
  46085. },
  46086. transpose: function () {
  46087. var e,
  46088. t = this.elements;
  46089. return (
  46090. (e = t[1]),
  46091. (t[1] = t[3]),
  46092. (t[3] = e),
  46093. (e = t[2]),
  46094. (t[2] = t[6]),
  46095. (t[6] = e),
  46096. (e = t[5]),
  46097. (t[5] = t[7]),
  46098. (t[7] = e),
  46099. this
  46100. );
  46101. },
  46102. flattenToArrayOffset: function (e, t) {
  46103. var i = this.elements;
  46104. return (
  46105. (e[t] = i[0]),
  46106. (e[t + 1] = i[1]),
  46107. (e[t + 2] = i[2]),
  46108. (e[t + 3] = i[3]),
  46109. (e[t + 4] = i[4]),
  46110. (e[t + 5] = i[5]),
  46111. (e[t + 6] = i[6]),
  46112. (e[t + 7] = i[7]),
  46113. (e[t + 8] = i[8]),
  46114. e
  46115. );
  46116. },
  46117. getNormalMatrix: function (e) {
  46118. return this.setFromMatrix4(e).getInverse(this).transpose();
  46119. },
  46120. transposeIntoArray: function (e) {
  46121. var t = this.elements;
  46122. return (
  46123. (e[0] = t[0]),
  46124. (e[1] = t[3]),
  46125. (e[2] = t[6]),
  46126. (e[3] = t[1]),
  46127. (e[4] = t[4]),
  46128. (e[5] = t[7]),
  46129. (e[6] = t[2]),
  46130. (e[7] = t[5]),
  46131. (e[8] = t[8]),
  46132. this
  46133. );
  46134. },
  46135. fromArray: function (e) {
  46136. return this.elements.set(e), this;
  46137. },
  46138. toArray: function () {
  46139. var e = this.elements;
  46140. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]];
  46141. },
  46142. }),
  46143. (n.Matrix4 = function () {
  46144. (this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  46145. arguments.length > 0 &&
  46146. console.error(
  46147. 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  46148. );
  46149. }),
  46150. (n.Matrix4.prototype = {
  46151. constructor: n.Matrix4,
  46152. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  46153. var m = this.elements;
  46154. return (
  46155. (m[0] = e),
  46156. (m[4] = t),
  46157. (m[8] = i),
  46158. (m[12] = n),
  46159. (m[1] = r),
  46160. (m[5] = o),
  46161. (m[9] = a),
  46162. (m[13] = s),
  46163. (m[2] = l),
  46164. (m[6] = c),
  46165. (m[10] = h),
  46166. (m[14] = u),
  46167. (m[3] = d),
  46168. (m[7] = p),
  46169. (m[11] = f),
  46170. (m[15] = g),
  46171. this
  46172. );
  46173. },
  46174. identity: function () {
  46175. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
  46176. },
  46177. clone: function () {
  46178. return new n.Matrix4().fromArray(this.elements);
  46179. },
  46180. copy: function (e) {
  46181. return this.elements.set(e.elements), this;
  46182. },
  46183. copyPosition: function (e) {
  46184. var t = this.elements,
  46185. i = e.elements;
  46186. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this;
  46187. },
  46188. extractBasis: function (e, t, i) {
  46189. return (
  46190. e.setFromMatrixColumn(this, 0),
  46191. t.setFromMatrixColumn(this, 1),
  46192. i.setFromMatrixColumn(this, 2),
  46193. this
  46194. );
  46195. },
  46196. makeBasis: function (e, t, i) {
  46197. return (
  46198. this.set(e.x, t.x, i.x, 0, e.y, t.y, i.y, 0, e.z, t.z, i.z, 0, 0, 0, 0, 1), this
  46199. );
  46200. },
  46201. extractRotation: (function () {
  46202. var e;
  46203. return function (t) {
  46204. void 0 === e && (e = new n.Vector3());
  46205. var i = this.elements,
  46206. r = t.elements,
  46207. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  46208. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  46209. s = 1 / e.setFromMatrixColumn(t, 2).length();
  46210. return (
  46211. (i[0] = r[0] * o),
  46212. (i[1] = r[1] * o),
  46213. (i[2] = r[2] * o),
  46214. (i[4] = r[4] * a),
  46215. (i[5] = r[5] * a),
  46216. (i[6] = r[6] * a),
  46217. (i[8] = r[8] * s),
  46218. (i[9] = r[9] * s),
  46219. (i[10] = r[10] * s),
  46220. this
  46221. );
  46222. };
  46223. })(),
  46224. makeRotationFromEuler: function (e) {
  46225. e instanceof n.Euler == !1 &&
  46226. console.error(
  46227. 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  46228. );
  46229. var t = this.elements,
  46230. i = e.x,
  46231. r = e.y,
  46232. o = e.z,
  46233. a = Math.cos(i),
  46234. s = Math.sin(i),
  46235. l = Math.cos(r),
  46236. c = Math.sin(r),
  46237. h = Math.cos(o),
  46238. u = Math.sin(o);
  46239. if ('XYZ' === e.order) {
  46240. var d = a * h,
  46241. p = a * u,
  46242. f = s * h,
  46243. g = s * u;
  46244. (t[0] = l * h),
  46245. (t[4] = -l * u),
  46246. (t[8] = c),
  46247. (t[1] = p + f * c),
  46248. (t[5] = d - g * c),
  46249. (t[9] = -s * l),
  46250. (t[2] = g - d * c),
  46251. (t[6] = f + p * c),
  46252. (t[10] = a * l);
  46253. } else if ('YXZ' === e.order) {
  46254. var m = l * h,
  46255. v = l * u,
  46256. A = c * h,
  46257. y = c * u;
  46258. (t[0] = m + y * s),
  46259. (t[4] = A * s - v),
  46260. (t[8] = a * c),
  46261. (t[1] = a * u),
  46262. (t[5] = a * h),
  46263. (t[9] = -s),
  46264. (t[2] = v * s - A),
  46265. (t[6] = y + m * s),
  46266. (t[10] = a * l);
  46267. } else if ('ZXY' === e.order) {
  46268. var m = l * h,
  46269. v = l * u,
  46270. A = c * h,
  46271. y = c * u;
  46272. (t[0] = m - y * s),
  46273. (t[4] = -a * u),
  46274. (t[8] = A + v * s),
  46275. (t[1] = v + A * s),
  46276. (t[5] = a * h),
  46277. (t[9] = y - m * s),
  46278. (t[2] = -a * c),
  46279. (t[6] = s),
  46280. (t[10] = a * l);
  46281. } else if ('ZYX' === e.order) {
  46282. var d = a * h,
  46283. p = a * u,
  46284. f = s * h,
  46285. g = s * u;
  46286. (t[0] = l * h),
  46287. (t[4] = f * c - p),
  46288. (t[8] = d * c + g),
  46289. (t[1] = l * u),
  46290. (t[5] = g * c + d),
  46291. (t[9] = p * c - f),
  46292. (t[2] = -c),
  46293. (t[6] = s * l),
  46294. (t[10] = a * l);
  46295. } else if ('YZX' === e.order) {
  46296. var C = a * l,
  46297. I = a * c,
  46298. E = s * l,
  46299. b = s * c;
  46300. (t[0] = l * h),
  46301. (t[4] = b - C * u),
  46302. (t[8] = E * u + I),
  46303. (t[1] = u),
  46304. (t[5] = a * h),
  46305. (t[9] = -s * h),
  46306. (t[2] = -c * h),
  46307. (t[6] = I * u + E),
  46308. (t[10] = C - b * u);
  46309. } else if ('XZY' === e.order) {
  46310. var C = a * l,
  46311. I = a * c,
  46312. E = s * l,
  46313. b = s * c;
  46314. (t[0] = l * h),
  46315. (t[4] = -u),
  46316. (t[8] = c * h),
  46317. (t[1] = C * u + b),
  46318. (t[5] = a * h),
  46319. (t[9] = I * u - E),
  46320. (t[2] = E * u - I),
  46321. (t[6] = s * h),
  46322. (t[10] = b * u + C);
  46323. }
  46324. return (
  46325. (t[3] = 0),
  46326. (t[7] = 0),
  46327. (t[11] = 0),
  46328. (t[12] = 0),
  46329. (t[13] = 0),
  46330. (t[14] = 0),
  46331. (t[15] = 1),
  46332. this
  46333. );
  46334. },
  46335. makeRotationFromQuaternion: function (e) {
  46336. var t = this.elements,
  46337. i = e.x,
  46338. n = e.y,
  46339. r = e.z,
  46340. o = e.w,
  46341. a = i + i,
  46342. s = n + n,
  46343. l = r + r,
  46344. c = i * a,
  46345. h = i * s,
  46346. u = i * l,
  46347. d = n * s,
  46348. p = n * l,
  46349. f = r * l,
  46350. g = o * a,
  46351. m = o * s,
  46352. v = o * l;
  46353. return (
  46354. (t[0] = 1 - (d + f)),
  46355. (t[4] = h - v),
  46356. (t[8] = u + m),
  46357. (t[1] = h + v),
  46358. (t[5] = 1 - (c + f)),
  46359. (t[9] = p - g),
  46360. (t[2] = u - m),
  46361. (t[6] = p + g),
  46362. (t[10] = 1 - (c + d)),
  46363. (t[3] = 0),
  46364. (t[7] = 0),
  46365. (t[11] = 0),
  46366. (t[12] = 0),
  46367. (t[13] = 0),
  46368. (t[14] = 0),
  46369. (t[15] = 1),
  46370. this
  46371. );
  46372. },
  46373. lookAt: (function () {
  46374. var e, t, i;
  46375. return function (r, o, a) {
  46376. void 0 === e && (e = new n.Vector3()),
  46377. void 0 === t && (t = new n.Vector3()),
  46378. void 0 === i && (i = new n.Vector3());
  46379. var s = this.elements;
  46380. return (
  46381. i.subVectors(r, o).normalize(),
  46382. 0 === i.lengthSq() && (i.z = 1),
  46383. e.crossVectors(a, i).normalize(),
  46384. 0 === e.lengthSq() && ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  46385. t.crossVectors(i, e),
  46386. (s[0] = e.x),
  46387. (s[4] = t.x),
  46388. (s[8] = i.x),
  46389. (s[1] = e.y),
  46390. (s[5] = t.y),
  46391. (s[9] = i.y),
  46392. (s[2] = e.z),
  46393. (s[6] = t.z),
  46394. (s[10] = i.z),
  46395. this
  46396. );
  46397. };
  46398. })(),
  46399. multiply: function (e, t) {
  46400. return void 0 !== t
  46401. ? (console.warn(
  46402. 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'
  46403. ),
  46404. this.multiplyMatrices(e, t))
  46405. : this.multiplyMatrices(this, e);
  46406. },
  46407. multiplyMatrices: function (e, t) {
  46408. var i = e.elements,
  46409. n = t.elements,
  46410. r = this.elements,
  46411. o = i[0],
  46412. a = i[4],
  46413. s = i[8],
  46414. l = i[12],
  46415. c = i[1],
  46416. h = i[5],
  46417. u = i[9],
  46418. d = i[13],
  46419. p = i[2],
  46420. f = i[6],
  46421. g = i[10],
  46422. m = i[14],
  46423. v = i[3],
  46424. A = i[7],
  46425. y = i[11],
  46426. C = i[15],
  46427. I = n[0],
  46428. E = n[4],
  46429. b = n[8],
  46430. w = n[12],
  46431. _ = n[1],
  46432. T = n[5],
  46433. x = n[9],
  46434. S = n[13],
  46435. M = n[2],
  46436. R = n[6],
  46437. P = n[10],
  46438. O = n[14],
  46439. L = n[3],
  46440. D = n[7],
  46441. N = n[11],
  46442. B = n[15];
  46443. return (
  46444. (r[0] = o * I + a * _ + s * M + l * L),
  46445. (r[4] = o * E + a * T + s * R + l * D),
  46446. (r[8] = o * b + a * x + s * P + l * N),
  46447. (r[12] = o * w + a * S + s * O + l * B),
  46448. (r[1] = c * I + h * _ + u * M + d * L),
  46449. (r[5] = c * E + h * T + u * R + d * D),
  46450. (r[9] = c * b + h * x + u * P + d * N),
  46451. (r[13] = c * w + h * S + u * O + d * B),
  46452. (r[2] = p * I + f * _ + g * M + m * L),
  46453. (r[6] = p * E + f * T + g * R + m * D),
  46454. (r[10] = p * b + f * x + g * P + m * N),
  46455. (r[14] = p * w + f * S + g * O + m * B),
  46456. (r[3] = v * I + A * _ + y * M + C * L),
  46457. (r[7] = v * E + A * T + y * R + C * D),
  46458. (r[11] = v * b + A * x + y * P + C * N),
  46459. (r[15] = v * w + A * S + y * O + C * B),
  46460. this
  46461. );
  46462. },
  46463. multiplyToArray: function (e, t, i) {
  46464. var n = this.elements;
  46465. return (
  46466. this.multiplyMatrices(e, t),
  46467. (i[0] = n[0]),
  46468. (i[1] = n[1]),
  46469. (i[2] = n[2]),
  46470. (i[3] = n[3]),
  46471. (i[4] = n[4]),
  46472. (i[5] = n[5]),
  46473. (i[6] = n[6]),
  46474. (i[7] = n[7]),
  46475. (i[8] = n[8]),
  46476. (i[9] = n[9]),
  46477. (i[10] = n[10]),
  46478. (i[11] = n[11]),
  46479. (i[12] = n[12]),
  46480. (i[13] = n[13]),
  46481. (i[14] = n[14]),
  46482. (i[15] = n[15]),
  46483. this
  46484. );
  46485. },
  46486. multiplyScalar: function (e) {
  46487. var t = this.elements;
  46488. return (
  46489. (t[0] *= e),
  46490. (t[4] *= e),
  46491. (t[8] *= e),
  46492. (t[12] *= e),
  46493. (t[1] *= e),
  46494. (t[5] *= e),
  46495. (t[9] *= e),
  46496. (t[13] *= e),
  46497. (t[2] *= e),
  46498. (t[6] *= e),
  46499. (t[10] *= e),
  46500. (t[14] *= e),
  46501. (t[3] *= e),
  46502. (t[7] *= e),
  46503. (t[11] *= e),
  46504. (t[15] *= e),
  46505. this
  46506. );
  46507. },
  46508. applyToVector3Array: (function () {
  46509. var e;
  46510. return function (t, i, r) {
  46511. void 0 === e && (e = new n.Vector3()),
  46512. void 0 === i && (i = 0),
  46513. void 0 === r && (r = t.length);
  46514. for (var o = 0, a = i; o < r; o += 3, a += 3)
  46515. e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a);
  46516. return t;
  46517. };
  46518. })(),
  46519. applyToBuffer: (function () {
  46520. var e;
  46521. return function (t, i, r) {
  46522. void 0 === e && (e = new n.Vector3()),
  46523. void 0 === i && (i = 0),
  46524. void 0 === r && (r = t.length / t.itemSize);
  46525. for (var o = 0, a = i; o < r; o++, a++)
  46526. (e.x = t.getX(a)),
  46527. (e.y = t.getY(a)),
  46528. (e.z = t.getZ(a)),
  46529. e.applyMatrix4(this),
  46530. t.setXYZ(e.x, e.y, e.z);
  46531. return t;
  46532. };
  46533. })(),
  46534. determinant: function () {
  46535. var e = this.elements,
  46536. t = e[0],
  46537. i = e[4],
  46538. n = e[8],
  46539. r = e[12],
  46540. o = e[1],
  46541. a = e[5],
  46542. s = e[9],
  46543. l = e[13],
  46544. c = e[2],
  46545. h = e[6],
  46546. u = e[10],
  46547. d = e[14],
  46548. p = e[3],
  46549. f = e[7],
  46550. g = e[11],
  46551. m = e[15];
  46552. return (
  46553. p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  46554. f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  46555. g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  46556. m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  46557. );
  46558. },
  46559. transpose: function () {
  46560. var e,
  46561. t = this.elements;
  46562. return (
  46563. (e = t[1]),
  46564. (t[1] = t[4]),
  46565. (t[4] = e),
  46566. (e = t[2]),
  46567. (t[2] = t[8]),
  46568. (t[8] = e),
  46569. (e = t[6]),
  46570. (t[6] = t[9]),
  46571. (t[9] = e),
  46572. (e = t[3]),
  46573. (t[3] = t[12]),
  46574. (t[12] = e),
  46575. (e = t[7]),
  46576. (t[7] = t[13]),
  46577. (t[13] = e),
  46578. (e = t[11]),
  46579. (t[11] = t[14]),
  46580. (t[14] = e),
  46581. this
  46582. );
  46583. },
  46584. flattenToArrayOffset: function (e, t) {
  46585. var i = this.elements;
  46586. return (
  46587. (e[t] = i[0]),
  46588. (e[t + 1] = i[1]),
  46589. (e[t + 2] = i[2]),
  46590. (e[t + 3] = i[3]),
  46591. (e[t + 4] = i[4]),
  46592. (e[t + 5] = i[5]),
  46593. (e[t + 6] = i[6]),
  46594. (e[t + 7] = i[7]),
  46595. (e[t + 8] = i[8]),
  46596. (e[t + 9] = i[9]),
  46597. (e[t + 10] = i[10]),
  46598. (e[t + 11] = i[11]),
  46599. (e[t + 12] = i[12]),
  46600. (e[t + 13] = i[13]),
  46601. (e[t + 14] = i[14]),
  46602. (e[t + 15] = i[15]),
  46603. e
  46604. );
  46605. },
  46606. getPosition: (function () {
  46607. var e;
  46608. return function () {
  46609. return (
  46610. void 0 === e && (e = new n.Vector3()),
  46611. console.warn(
  46612. 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'
  46613. ),
  46614. e.setFromMatrixColumn(this, 3)
  46615. );
  46616. };
  46617. })(),
  46618. setPosition: function (e) {
  46619. var t = this.elements;
  46620. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this;
  46621. },
  46622. getInverse: function (e, t) {
  46623. var i = this.elements,
  46624. n = e.elements,
  46625. r = n[0],
  46626. o = n[1],
  46627. a = n[2],
  46628. s = n[3],
  46629. l = n[4],
  46630. c = n[5],
  46631. h = n[6],
  46632. u = n[7],
  46633. d = n[8],
  46634. p = n[9],
  46635. f = n[10],
  46636. g = n[11],
  46637. m = n[12],
  46638. v = n[13],
  46639. A = n[14],
  46640. y = n[15],
  46641. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  46642. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  46643. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  46644. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  46645. w = r * C + o * I + a * E + s * b;
  46646. if (0 === w) {
  46647. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  46648. if (t) throw new Error(_);
  46649. return console.warn(_), this.identity();
  46650. }
  46651. return (
  46652. (i[0] = C),
  46653. (i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y),
  46654. (i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y),
  46655. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  46656. (i[4] = I),
  46657. (i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y),
  46658. (i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y),
  46659. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  46660. (i[8] = E),
  46661. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y),
  46662. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y),
  46663. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  46664. (i[12] = b),
  46665. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A),
  46666. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A),
  46667. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  46668. this.multiplyScalar(1 / w)
  46669. );
  46670. },
  46671. scale: function (e) {
  46672. var t = this.elements,
  46673. i = e.x,
  46674. n = e.y,
  46675. r = e.z;
  46676. return (
  46677. (t[0] *= i),
  46678. (t[4] *= n),
  46679. (t[8] *= r),
  46680. (t[1] *= i),
  46681. (t[5] *= n),
  46682. (t[9] *= r),
  46683. (t[2] *= i),
  46684. (t[6] *= n),
  46685. (t[10] *= r),
  46686. (t[3] *= i),
  46687. (t[7] *= n),
  46688. (t[11] *= r),
  46689. this
  46690. );
  46691. },
  46692. getMaxScaleOnAxis: function () {
  46693. var e = this.elements,
  46694. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  46695. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  46696. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  46697. return Math.sqrt(Math.max(t, i, n));
  46698. },
  46699. makeTranslation: function (e, t, i) {
  46700. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this;
  46701. },
  46702. makeRotationX: function (e) {
  46703. var t = Math.cos(e),
  46704. i = Math.sin(e);
  46705. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this;
  46706. },
  46707. makeRotationY: function (e) {
  46708. var t = Math.cos(e),
  46709. i = Math.sin(e);
  46710. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this;
  46711. },
  46712. makeRotationZ: function (e) {
  46713. var t = Math.cos(e),
  46714. i = Math.sin(e);
  46715. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
  46716. },
  46717. makeRotationAxis: function (e, t) {
  46718. var i = Math.cos(t),
  46719. n = Math.sin(t),
  46720. r = 1 - i,
  46721. o = e.x,
  46722. a = e.y,
  46723. s = e.z,
  46724. l = r * o,
  46725. c = r * a;
  46726. return (
  46727. this.set(
  46728. l * o + i,
  46729. l * a - n * s,
  46730. l * s + n * a,
  46731. 0,
  46732. l * a + n * s,
  46733. c * a + i,
  46734. c * s - n * o,
  46735. 0,
  46736. l * s - n * a,
  46737. c * s + n * o,
  46738. r * s * s + i,
  46739. 0,
  46740. 0,
  46741. 0,
  46742. 0,
  46743. 1
  46744. ),
  46745. this
  46746. );
  46747. },
  46748. makeScale: function (e, t, i) {
  46749. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this;
  46750. },
  46751. compose: function (e, t, i) {
  46752. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this;
  46753. },
  46754. decompose: (function () {
  46755. var e, t;
  46756. return function (i, r, o) {
  46757. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Matrix4());
  46758. var a = this.elements,
  46759. s = e.set(a[0], a[1], a[2]).length(),
  46760. l = e.set(a[4], a[5], a[6]).length(),
  46761. c = e.set(a[8], a[9], a[10]).length(),
  46762. h = this.determinant();
  46763. h < 0 && (s = -s),
  46764. (i.x = a[12]),
  46765. (i.y = a[13]),
  46766. (i.z = a[14]),
  46767. t.elements.set(this.elements);
  46768. var u = 1 / s,
  46769. d = 1 / l,
  46770. p = 1 / c;
  46771. return (
  46772. (t.elements[0] *= u),
  46773. (t.elements[1] *= u),
  46774. (t.elements[2] *= u),
  46775. (t.elements[4] *= d),
  46776. (t.elements[5] *= d),
  46777. (t.elements[6] *= d),
  46778. (t.elements[8] *= p),
  46779. (t.elements[9] *= p),
  46780. (t.elements[10] *= p),
  46781. r.setFromRotationMatrix(t),
  46782. (o.x = s),
  46783. (o.y = l),
  46784. (o.z = c),
  46785. this
  46786. );
  46787. };
  46788. })(),
  46789. makeFrustum: function (e, t, i, n, r, o) {
  46790. var a = this.elements,
  46791. s = (2 * r) / (t - e),
  46792. l = (2 * r) / (n - i),
  46793. c = (t + e) / (t - e),
  46794. h = (n + i) / (n - i),
  46795. u = -(o + r) / (o - r),
  46796. d = (-2 * o * r) / (o - r);
  46797. return (
  46798. (a[0] = s),
  46799. (a[4] = 0),
  46800. (a[8] = c),
  46801. (a[12] = 0),
  46802. (a[1] = 0),
  46803. (a[5] = l),
  46804. (a[9] = h),
  46805. (a[13] = 0),
  46806. (a[2] = 0),
  46807. (a[6] = 0),
  46808. (a[10] = u),
  46809. (a[14] = d),
  46810. (a[3] = 0),
  46811. (a[7] = 0),
  46812. (a[11] = -1),
  46813. (a[15] = 0),
  46814. this
  46815. );
  46816. },
  46817. makePerspective: function (e, t, i, r) {
  46818. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  46819. a = -o,
  46820. s = a * t,
  46821. l = o * t;
  46822. return this.makeFrustum(s, l, a, o, i, r);
  46823. },
  46824. makeOrthographic: function (e, t, i, n, r, o) {
  46825. var a = this.elements,
  46826. s = 1 / (t - e),
  46827. l = 1 / (i - n),
  46828. c = 1 / (o - r),
  46829. h = (t + e) * s,
  46830. u = (i + n) * l,
  46831. d = (o + r) * c;
  46832. return (
  46833. (a[0] = 2 * s),
  46834. (a[4] = 0),
  46835. (a[8] = 0),
  46836. (a[12] = -h),
  46837. (a[1] = 0),
  46838. (a[5] = 2 * l),
  46839. (a[9] = 0),
  46840. (a[13] = -u),
  46841. (a[2] = 0),
  46842. (a[6] = 0),
  46843. (a[10] = -2 * c),
  46844. (a[14] = -d),
  46845. (a[3] = 0),
  46846. (a[7] = 0),
  46847. (a[11] = 0),
  46848. (a[15] = 1),
  46849. this
  46850. );
  46851. },
  46852. equals: function (e) {
  46853. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  46854. if (t[n] !== i[n]) return !1;
  46855. return !0;
  46856. },
  46857. fromArray: function (e) {
  46858. return this.elements.set(e), this;
  46859. },
  46860. toArray: function () {
  46861. var e = this.elements;
  46862. return [
  46863. e[0],
  46864. e[1],
  46865. e[2],
  46866. e[3],
  46867. e[4],
  46868. e[5],
  46869. e[6],
  46870. e[7],
  46871. e[8],
  46872. e[9],
  46873. e[10],
  46874. e[11],
  46875. e[12],
  46876. e[13],
  46877. e[14],
  46878. e[15],
  46879. ];
  46880. },
  46881. }),
  46882. (n.Ray = function (e, t) {
  46883. (this.origin = void 0 !== e ? e : new n.Vector3()),
  46884. (this.direction = void 0 !== t ? t : new n.Vector3());
  46885. }),
  46886. (n.Ray.prototype = {
  46887. constructor: n.Ray,
  46888. set: function (e, t) {
  46889. return this.origin.copy(e), this.direction.copy(t), this;
  46890. },
  46891. clone: function () {
  46892. return new this.constructor().copy(this);
  46893. },
  46894. copy: function (e) {
  46895. return this.origin.copy(e.origin), this.direction.copy(e.direction), this;
  46896. },
  46897. at: function (e, t) {
  46898. var i = t || new n.Vector3();
  46899. return i.copy(this.direction).multiplyScalar(e).add(this.origin);
  46900. },
  46901. lookAt: function (e) {
  46902. this.direction.copy(e).sub(this.origin).normalize();
  46903. },
  46904. recast: (function () {
  46905. var e = new n.Vector3();
  46906. return function (t) {
  46907. return this.origin.copy(this.at(t, e)), this;
  46908. };
  46909. })(),
  46910. closestPointToPoint: function (e, t) {
  46911. var i = t || new n.Vector3();
  46912. i.subVectors(e, this.origin);
  46913. var r = i.dot(this.direction);
  46914. return r < 0
  46915. ? i.copy(this.origin)
  46916. : i.copy(this.direction).multiplyScalar(r).add(this.origin);
  46917. },
  46918. distanceToPoint: function (e) {
  46919. return Math.sqrt(this.distanceSqToPoint(e));
  46920. },
  46921. distanceSqToPoint: (function () {
  46922. var e = new n.Vector3();
  46923. return function (t) {
  46924. var i = e.subVectors(t, this.origin).dot(this.direction);
  46925. return i < 0
  46926. ? this.origin.distanceToSquared(t)
  46927. : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  46928. e.distanceToSquared(t));
  46929. };
  46930. })(),
  46931. distanceSqToSegment: (function () {
  46932. var e = new n.Vector3(),
  46933. t = new n.Vector3(),
  46934. i = new n.Vector3();
  46935. return function (n, r, o, a) {
  46936. e.copy(n).add(r).multiplyScalar(0.5),
  46937. t.copy(r).sub(n).normalize(),
  46938. i.copy(this.origin).sub(e);
  46939. var s,
  46940. l,
  46941. c,
  46942. h,
  46943. u = 0.5 * n.distanceTo(r),
  46944. d = -this.direction.dot(t),
  46945. p = i.dot(this.direction),
  46946. f = -i.dot(t),
  46947. g = i.lengthSq(),
  46948. m = Math.abs(1 - d * d);
  46949. if (m > 0)
  46950. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  46951. if (l >= -h)
  46952. if (l <= h) {
  46953. var v = 1 / m;
  46954. (s *= v),
  46955. (l *= v),
  46956. (c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g);
  46957. } else
  46958. (l = u),
  46959. (s = Math.max(0, -(d * l + p))),
  46960. (c = -s * s + l * (l + 2 * f) + g);
  46961. else
  46962. (l = -u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g);
  46963. else
  46964. l <= -h
  46965. ? ((s = Math.max(0, -(-d * u + p))),
  46966. (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)),
  46967. (c = -s * s + l * (l + 2 * f) + g))
  46968. : l <= h
  46969. ? ((s = 0), (l = Math.min(Math.max(-u, -f), u)), (c = l * (l + 2 * f) + g))
  46970. : ((s = Math.max(0, -(d * u + p))),
  46971. (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)),
  46972. (c = -s * s + l * (l + 2 * f) + g));
  46973. else
  46974. (l = d > 0 ? -u : u),
  46975. (s = Math.max(0, -(d * l + p))),
  46976. (c = -s * s + l * (l + 2 * f) + g);
  46977. return (
  46978. o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  46979. a && a.copy(t).multiplyScalar(l).add(e),
  46980. c
  46981. );
  46982. };
  46983. })(),
  46984. intersectSphere: (function () {
  46985. var e = new n.Vector3();
  46986. return function (t, i) {
  46987. e.subVectors(t.center, this.origin);
  46988. var n = e.dot(this.direction),
  46989. r = e.dot(e) - n * n,
  46990. o = t.radius * t.radius;
  46991. if (r > o) return null;
  46992. var a = Math.sqrt(o - r),
  46993. s = n - a,
  46994. l = n + a;
  46995. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i);
  46996. };
  46997. })(),
  46998. intersectsSphere: function (e) {
  46999. return this.distanceToPoint(e.center) <= e.radius;
  47000. },
  47001. distanceToPlane: function (e) {
  47002. var t = e.normal.dot(this.direction);
  47003. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  47004. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  47005. return i >= 0 ? i : null;
  47006. },
  47007. intersectPlane: function (e, t) {
  47008. var i = this.distanceToPlane(e);
  47009. return null === i ? null : this.at(i, t);
  47010. },
  47011. intersectsPlane: function (e) {
  47012. var t = e.distanceToPoint(this.origin);
  47013. if (0 === t) return !0;
  47014. var i = e.normal.dot(this.direction);
  47015. return i * t < 0;
  47016. },
  47017. intersectBox: function (e, t) {
  47018. var i,
  47019. n,
  47020. r,
  47021. o,
  47022. a,
  47023. s,
  47024. l = 1 / this.direction.x,
  47025. c = 1 / this.direction.y,
  47026. h = 1 / this.direction.z,
  47027. u = this.origin;
  47028. return (
  47029. l >= 0
  47030. ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l))
  47031. : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  47032. c >= 0
  47033. ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c))
  47034. : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  47035. i > o || r > n
  47036. ? null
  47037. : ((r > i || i !== i) && (i = r),
  47038. (o < n || n !== n) && (n = o),
  47039. h >= 0
  47040. ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h))
  47041. : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  47042. i > s || a > n
  47043. ? null
  47044. : ((a > i || i !== i) && (i = a),
  47045. (s < n || n !== n) && (n = s),
  47046. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  47047. );
  47048. },
  47049. intersectsBox: (function () {
  47050. var e = new n.Vector3();
  47051. return function (t) {
  47052. return null !== this.intersectBox(t, e);
  47053. };
  47054. })(),
  47055. intersectTriangle: (function () {
  47056. var e = new n.Vector3(),
  47057. t = new n.Vector3(),
  47058. i = new n.Vector3(),
  47059. r = new n.Vector3();
  47060. return function (n, o, a, s, l) {
  47061. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i);
  47062. var c,
  47063. h = this.direction.dot(r);
  47064. if (h > 0) {
  47065. if (s) return null;
  47066. c = 1;
  47067. } else {
  47068. if (!(h < 0)) return null;
  47069. (c = -1), (h = -h);
  47070. }
  47071. e.subVectors(this.origin, n);
  47072. var u = c * this.direction.dot(i.crossVectors(e, i));
  47073. if (u < 0) return null;
  47074. var d = c * this.direction.dot(t.cross(e));
  47075. if (d < 0) return null;
  47076. if (u + d > h) return null;
  47077. var p = -c * e.dot(r);
  47078. return p < 0 ? null : this.at(p / h, l);
  47079. };
  47080. })(),
  47081. applyMatrix4: function (e) {
  47082. return (
  47083. this.direction.add(this.origin).applyMatrix4(e),
  47084. this.origin.applyMatrix4(e),
  47085. this.direction.sub(this.origin),
  47086. this.direction.normalize(),
  47087. this
  47088. );
  47089. },
  47090. equals: function (e) {
  47091. return e.origin.equals(this.origin) && e.direction.equals(this.direction);
  47092. },
  47093. }),
  47094. (n.Sphere = function (e, t) {
  47095. (this.center = void 0 !== e ? e : new n.Vector3()),
  47096. (this.radius = void 0 !== t ? t : 0);
  47097. }),
  47098. (n.Sphere.prototype = {
  47099. constructor: n.Sphere,
  47100. set: function (e, t) {
  47101. return this.center.copy(e), (this.radius = t), this;
  47102. },
  47103. setFromPoints: (function () {
  47104. var e = new n.Box3();
  47105. return function (t, i) {
  47106. var n = this.center;
  47107. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  47108. for (var r = 0, o = 0, a = t.length; o < a; o++)
  47109. r = Math.max(r, n.distanceToSquared(t[o]));
  47110. return (this.radius = Math.sqrt(r)), this;
  47111. };
  47112. })(),
  47113. clone: function () {
  47114. return new this.constructor().copy(this);
  47115. },
  47116. copy: function (e) {
  47117. return this.center.copy(e.center), (this.radius = e.radius), this;
  47118. },
  47119. empty: function () {
  47120. return this.radius <= 0;
  47121. },
  47122. containsPoint: function (e) {
  47123. return e.distanceToSquared(this.center) <= this.radius * this.radius;
  47124. },
  47125. distanceToPoint: function (e) {
  47126. return e.distanceTo(this.center) - this.radius;
  47127. },
  47128. intersectsSphere: function (e) {
  47129. var t = this.radius + e.radius;
  47130. return e.center.distanceToSquared(this.center) <= t * t;
  47131. },
  47132. intersectsBox: function (e) {
  47133. return e.intersectsSphere(this);
  47134. },
  47135. intersectsPlane: function (e) {
  47136. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius;
  47137. },
  47138. clampPoint: function (e, t) {
  47139. var i = this.center.distanceToSquared(e),
  47140. r = t || new n.Vector3();
  47141. return (
  47142. r.copy(e),
  47143. i > this.radius * this.radius &&
  47144. (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)),
  47145. r
  47146. );
  47147. },
  47148. getBoundingBox: function (e) {
  47149. var t = e || new n.Box3();
  47150. return t.set(this.center, this.center), t.expandByScalar(this.radius), t;
  47151. },
  47152. applyMatrix4: function (e) {
  47153. return (
  47154. this.center.applyMatrix4(e),
  47155. (this.radius = this.radius * e.getMaxScaleOnAxis()),
  47156. this
  47157. );
  47158. },
  47159. translate: function (e) {
  47160. return this.center.add(e), this;
  47161. },
  47162. equals: function (e) {
  47163. return e.center.equals(this.center) && e.radius === this.radius;
  47164. },
  47165. }),
  47166. (n.Frustum = function (e, t, i, r, o, a) {
  47167. this.planes = [
  47168. void 0 !== e ? e : new n.Plane(),
  47169. void 0 !== t ? t : new n.Plane(),
  47170. void 0 !== i ? i : new n.Plane(),
  47171. void 0 !== r ? r : new n.Plane(),
  47172. void 0 !== o ? o : new n.Plane(),
  47173. void 0 !== a ? a : new n.Plane(),
  47174. ];
  47175. }),
  47176. (n.Frustum.prototype = {
  47177. constructor: n.Frustum,
  47178. set: function (e, t, i, n, r, o) {
  47179. var a = this.planes;
  47180. return (
  47181. a[0].copy(e),
  47182. a[1].copy(t),
  47183. a[2].copy(i),
  47184. a[3].copy(n),
  47185. a[4].copy(r),
  47186. a[5].copy(o),
  47187. this
  47188. );
  47189. },
  47190. clone: function () {
  47191. return new this.constructor().copy(this);
  47192. },
  47193. copy: function (e) {
  47194. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i]);
  47195. return this;
  47196. },
  47197. setFromMatrix: function (e) {
  47198. var t = this.planes,
  47199. i = e.elements,
  47200. n = i[0],
  47201. r = i[1],
  47202. o = i[2],
  47203. a = i[3],
  47204. s = i[4],
  47205. l = i[5],
  47206. c = i[6],
  47207. h = i[7],
  47208. u = i[8],
  47209. d = i[9],
  47210. p = i[10],
  47211. f = i[11],
  47212. g = i[12],
  47213. m = i[13],
  47214. v = i[14],
  47215. A = i[15];
  47216. return (
  47217. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  47218. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  47219. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  47220. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  47221. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  47222. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  47223. this
  47224. );
  47225. },
  47226. intersectsObject: (function () {
  47227. var e = new n.Sphere();
  47228. return function (t) {
  47229. var i = t.geometry;
  47230. return (
  47231. null === i.boundingSphere && i.computeBoundingSphere(),
  47232. e.copy(i.boundingSphere),
  47233. e.applyMatrix4(t.matrixWorld),
  47234. this.intersectsSphere(e)
  47235. );
  47236. };
  47237. })(),
  47238. intersectsSphere: function (e) {
  47239. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  47240. var o = t[r].distanceToPoint(i);
  47241. if (o < n) return !1;
  47242. }
  47243. return !0;
  47244. },
  47245. intersectsBox: (function () {
  47246. var e = new n.Vector3(),
  47247. t = new n.Vector3();
  47248. return function (i) {
  47249. for (var n = this.planes, r = 0; r < 6; r++) {
  47250. var o = n[r];
  47251. (e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  47252. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  47253. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  47254. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  47255. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  47256. (t.z = o.normal.z > 0 ? i.max.z : i.min.z);
  47257. var a = o.distanceToPoint(e),
  47258. s = o.distanceToPoint(t);
  47259. if (a < 0 && s < 0) return !1;
  47260. }
  47261. return !0;
  47262. };
  47263. })(),
  47264. containsPoint: function (e) {
  47265. for (var t = this.planes, i = 0; i < 6; i++)
  47266. if (t[i].distanceToPoint(e) < 0) return !1;
  47267. return !0;
  47268. },
  47269. }),
  47270. (n.Plane = function (e, t) {
  47271. (this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)),
  47272. (this.constant = void 0 !== t ? t : 0);
  47273. }),
  47274. (n.Plane.prototype = {
  47275. constructor: n.Plane,
  47276. set: function (e, t) {
  47277. return this.normal.copy(e), (this.constant = t), this;
  47278. },
  47279. setComponents: function (e, t, i, n) {
  47280. return this.normal.set(e, t, i), (this.constant = n), this;
  47281. },
  47282. setFromNormalAndCoplanarPoint: function (e, t) {
  47283. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this;
  47284. },
  47285. setFromCoplanarPoints: (function () {
  47286. var e = new n.Vector3(),
  47287. t = new n.Vector3();
  47288. return function (i, n, r) {
  47289. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  47290. return this.setFromNormalAndCoplanarPoint(o, i), this;
  47291. };
  47292. })(),
  47293. clone: function () {
  47294. return new this.constructor().copy(this);
  47295. },
  47296. copy: function (e) {
  47297. return this.normal.copy(e.normal), (this.constant = e.constant), this;
  47298. },
  47299. normalize: function () {
  47300. var e = 1 / this.normal.length();
  47301. return this.normal.multiplyScalar(e), (this.constant *= e), this;
  47302. },
  47303. negate: function () {
  47304. return (this.constant *= -1), this.normal.negate(), this;
  47305. },
  47306. distanceToPoint: function (e) {
  47307. return this.normal.dot(e) + this.constant;
  47308. },
  47309. distanceToSphere: function (e) {
  47310. return this.distanceToPoint(e.center) - e.radius;
  47311. },
  47312. projectPoint: function (e, t) {
  47313. return this.orthoPoint(e, t).sub(e).negate();
  47314. },
  47315. orthoPoint: function (e, t) {
  47316. var i = this.distanceToPoint(e),
  47317. r = t || new n.Vector3();
  47318. return r.copy(this.normal).multiplyScalar(i);
  47319. },
  47320. intersectLine: (function () {
  47321. var e = new n.Vector3();
  47322. return function (t, i) {
  47323. var r = i || new n.Vector3(),
  47324. o = t.delta(e),
  47325. a = this.normal.dot(o);
  47326. if (0 !== a) {
  47327. var s = -(t.start.dot(this.normal) + this.constant) / a;
  47328. if (!(s < 0 || s > 1)) return r.copy(o).multiplyScalar(s).add(t.start);
  47329. } else if (0 === this.distanceToPoint(t.start)) return r.copy(t.start);
  47330. };
  47331. })(),
  47332. intersectsLine: function (e) {
  47333. var t = this.distanceToPoint(e.start),
  47334. i = this.distanceToPoint(e.end);
  47335. return (t < 0 && i > 0) || (i < 0 && t > 0);
  47336. },
  47337. intersectsBox: function (e) {
  47338. return e.intersectsPlane(this);
  47339. },
  47340. intersectsSphere: function (e) {
  47341. return e.intersectsPlane(this);
  47342. },
  47343. coplanarPoint: function (e) {
  47344. var t = e || new n.Vector3();
  47345. return t.copy(this.normal).multiplyScalar(-this.constant);
  47346. },
  47347. applyMatrix4: (function () {
  47348. var e = new n.Vector3(),
  47349. t = new n.Vector3(),
  47350. i = new n.Matrix3();
  47351. return function (n, r) {
  47352. var o = r || i.getNormalMatrix(n),
  47353. a = e.copy(this.normal).applyMatrix3(o),
  47354. s = this.coplanarPoint(t);
  47355. return s.applyMatrix4(n), this.setFromNormalAndCoplanarPoint(a, s), this;
  47356. };
  47357. })(),
  47358. translate: function (e) {
  47359. return (this.constant = this.constant - e.dot(this.normal)), this;
  47360. },
  47361. equals: function (e) {
  47362. return e.normal.equals(this.normal) && e.constant === this.constant;
  47363. },
  47364. }),
  47365. (n.Spherical = function (e, t, i) {
  47366. return (
  47367. (this.radius = void 0 !== e ? e : 1),
  47368. (this.phi = void 0 !== t ? t : 0),
  47369. (this.theta = void 0 !== i ? i : 0),
  47370. this
  47371. );
  47372. }),
  47373. (n.Spherical.prototype = {
  47374. constructor: n.Spherical,
  47375. set: function (e, t, i) {
  47376. (this.radius = e), (this.phi = t), (this.theta = i);
  47377. },
  47378. clone: function () {
  47379. return new this.constructor().copy(this);
  47380. },
  47381. copy: function (e) {
  47382. return (
  47383. this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  47384. );
  47385. },
  47386. makeSafe: function () {
  47387. var e = 1e-6;
  47388. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi));
  47389. },
  47390. setFromVector3: function (e) {
  47391. return (
  47392. (this.radius = e.length()),
  47393. 0 === this.radius
  47394. ? ((this.theta = 0), (this.phi = 0))
  47395. : ((this.theta = Math.atan2(e.x, e.z)),
  47396. (this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1)))),
  47397. this
  47398. );
  47399. },
  47400. }),
  47401. (n.Math = {
  47402. generateUUID: (function () {
  47403. var e,
  47404. t = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
  47405. i = new Array(36),
  47406. n = 0;
  47407. return function () {
  47408. for (var r = 0; r < 36; r++)
  47409. 8 === r || 13 === r || 18 === r || 23 === r
  47410. ? (i[r] = '-')
  47411. : 14 === r
  47412. ? (i[r] = '4')
  47413. : (n <= 2 && (n = (33554432 + 16777216 * Math.random()) | 0),
  47414. (e = 15 & n),
  47415. (n >>= 4),
  47416. (i[r] = t[19 === r ? (3 & e) | 8 : e]));
  47417. return i.join('');
  47418. };
  47419. })(),
  47420. clamp: function (e, t, i) {
  47421. return Math.max(t, Math.min(i, e));
  47422. },
  47423. euclideanModulo: function (e, t) {
  47424. return ((e % t) + t) % t;
  47425. },
  47426. mapLinear: function (e, t, i, n, r) {
  47427. return n + ((e - t) * (r - n)) / (i - t);
  47428. },
  47429. smoothstep: function (e, t, i) {
  47430. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e));
  47431. },
  47432. smootherstep: function (e, t, i) {
  47433. return e <= t
  47434. ? 0
  47435. : e >= i
  47436. ? 1
  47437. : ((e = (e - t) / (i - t)), e * e * e * (e * (6 * e - 15) + 10));
  47438. },
  47439. random16: function () {
  47440. return (
  47441. console.warn(
  47442. 'THREE.Math.random16() has been deprecated. Use Math.random() instead.'
  47443. ),
  47444. Math.random()
  47445. );
  47446. },
  47447. randInt: function (e, t) {
  47448. return e + Math.floor(Math.random() * (t - e + 1));
  47449. },
  47450. randFloat: function (e, t) {
  47451. return e + Math.random() * (t - e);
  47452. },
  47453. randFloatSpread: function (e) {
  47454. return e * (0.5 - Math.random());
  47455. },
  47456. degToRad: (function () {
  47457. var e = Math.PI / 180;
  47458. return function (t) {
  47459. return t * e;
  47460. };
  47461. })(),
  47462. radToDeg: (function () {
  47463. var e = 180 / Math.PI;
  47464. return function (t) {
  47465. return t * e;
  47466. };
  47467. })(),
  47468. isPowerOfTwo: function (e) {
  47469. return 0 === (e & (e - 1)) && 0 !== e;
  47470. },
  47471. nearestPowerOfTwo: function (e) {
  47472. return Math.pow(2, Math.round(Math.log(e) / Math.LN2));
  47473. },
  47474. nextPowerOfTwo: function (e) {
  47475. return (
  47476. e--,
  47477. (e |= e >> 1),
  47478. (e |= e >> 2),
  47479. (e |= e >> 4),
  47480. (e |= e >> 8),
  47481. (e |= e >> 16),
  47482. e++,
  47483. e
  47484. );
  47485. },
  47486. }),
  47487. (n.Spline = function (e) {
  47488. function t(e, t, i, n, r, o, a) {
  47489. var s = 0.5 * (i - e),
  47490. l = 0.5 * (n - t);
  47491. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t;
  47492. }
  47493. this.points = e;
  47494. var i,
  47495. r,
  47496. o,
  47497. a,
  47498. s,
  47499. l,
  47500. c,
  47501. h,
  47502. u,
  47503. d = [],
  47504. p = {
  47505. x: 0,
  47506. y: 0,
  47507. z: 0,
  47508. };
  47509. (this.initFromArray = function (e) {
  47510. this.points = [];
  47511. for (var t = 0; t < e.length; t++)
  47512. this.points[t] = {
  47513. x: e[t][0],
  47514. y: e[t][1],
  47515. z: e[t][2],
  47516. };
  47517. }),
  47518. (this.getPoint = function (e) {
  47519. return (
  47520. (i = (this.points.length - 1) * e),
  47521. (r = Math.floor(i)),
  47522. (o = i - r),
  47523. (d[0] = 0 === r ? r : r - 1),
  47524. (d[1] = r),
  47525. (d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1),
  47526. (d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2),
  47527. (l = this.points[d[0]]),
  47528. (c = this.points[d[1]]),
  47529. (h = this.points[d[2]]),
  47530. (u = this.points[d[3]]),
  47531. (a = o * o),
  47532. (s = o * a),
  47533. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  47534. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  47535. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  47536. p
  47537. );
  47538. }),
  47539. (this.getControlPointsArray = function () {
  47540. var e,
  47541. t,
  47542. i = this.points.length,
  47543. n = [];
  47544. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z]);
  47545. return n;
  47546. }),
  47547. (this.getLength = function (e) {
  47548. var t,
  47549. i,
  47550. r,
  47551. o,
  47552. a = 0,
  47553. s = 0,
  47554. l = 0,
  47555. c = new n.Vector3(),
  47556. h = new n.Vector3(),
  47557. u = [],
  47558. d = 0;
  47559. for (
  47560. u[0] = 0,
  47561. e || (e = 100),
  47562. r = this.points.length * e,
  47563. c.copy(this.points[0]),
  47564. t = 1;
  47565. t < r;
  47566. t++
  47567. )
  47568. (i = t / r),
  47569. (o = this.getPoint(i)),
  47570. h.copy(o),
  47571. (d += h.distanceTo(c)),
  47572. c.copy(o),
  47573. (a = (this.points.length - 1) * i),
  47574. (s = Math.floor(a)),
  47575. s !== l && ((u[s] = d), (l = s));
  47576. return (
  47577. (u[u.length] = d),
  47578. {
  47579. chunks: u,
  47580. total: d,
  47581. }
  47582. );
  47583. }),
  47584. (this.reparametrizeByArcLength = function (e) {
  47585. var t,
  47586. i,
  47587. r,
  47588. o,
  47589. a,
  47590. s,
  47591. l,
  47592. c,
  47593. h = [],
  47594. u = new n.Vector3(),
  47595. d = this.getLength();
  47596. for (h.push(u.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  47597. for (
  47598. s = d.chunks[t] - d.chunks[t - 1],
  47599. l = Math.ceil((e * s) / d.total),
  47600. o = (t - 1) / (this.points.length - 1),
  47601. a = t / (this.points.length - 1),
  47602. i = 1;
  47603. i < l - 1;
  47604. i++
  47605. )
  47606. (r = o + i * (1 / l) * (a - o)),
  47607. (c = this.getPoint(r)),
  47608. h.push(u.copy(c).clone());
  47609. h.push(u.copy(this.points[t]).clone());
  47610. }
  47611. this.points = h;
  47612. });
  47613. }),
  47614. (n.Triangle = function (e, t, i) {
  47615. (this.a = void 0 !== e ? e : new n.Vector3()),
  47616. (this.b = void 0 !== t ? t : new n.Vector3()),
  47617. (this.c = void 0 !== i ? i : new n.Vector3());
  47618. }),
  47619. (n.Triangle.normal = (function () {
  47620. var e = new n.Vector3();
  47621. return function (t, i, r, o) {
  47622. var a = o || new n.Vector3();
  47623. a.subVectors(r, i), e.subVectors(t, i), a.cross(e);
  47624. var s = a.lengthSq();
  47625. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0);
  47626. };
  47627. })()),
  47628. (n.Triangle.barycoordFromPoint = (function () {
  47629. var e = new n.Vector3(),
  47630. t = new n.Vector3(),
  47631. i = new n.Vector3();
  47632. return function (r, o, a, s, l) {
  47633. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o);
  47634. var c = e.dot(e),
  47635. h = e.dot(t),
  47636. u = e.dot(i),
  47637. d = t.dot(t),
  47638. p = t.dot(i),
  47639. f = c * d - h * h,
  47640. g = l || new n.Vector3();
  47641. if (0 === f) return g.set(-2, -1, -1);
  47642. var m = 1 / f,
  47643. v = (d * u - h * p) * m,
  47644. A = (c * p - h * u) * m;
  47645. return g.set(1 - v - A, A, v);
  47646. };
  47647. })()),
  47648. (n.Triangle.containsPoint = (function () {
  47649. var e = new n.Vector3();
  47650. return function (t, i, r, o) {
  47651. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  47652. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1;
  47653. };
  47654. })()),
  47655. (n.Triangle.prototype = {
  47656. constructor: n.Triangle,
  47657. set: function (e, t, i) {
  47658. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this;
  47659. },
  47660. setFromPointsAndIndices: function (e, t, i, n) {
  47661. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this;
  47662. },
  47663. clone: function () {
  47664. return new this.constructor().copy(this);
  47665. },
  47666. copy: function (e) {
  47667. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this;
  47668. },
  47669. area: (function () {
  47670. var e = new n.Vector3(),
  47671. t = new n.Vector3();
  47672. return function () {
  47673. return (
  47674. e.subVectors(this.c, this.b),
  47675. t.subVectors(this.a, this.b),
  47676. 0.5 * e.cross(t).length()
  47677. );
  47678. };
  47679. })(),
  47680. midpoint: function (e) {
  47681. var t = e || new n.Vector3();
  47682. return t
  47683. .addVectors(this.a, this.b)
  47684. .add(this.c)
  47685. .multiplyScalar(1 / 3);
  47686. },
  47687. normal: function (e) {
  47688. return n.Triangle.normal(this.a, this.b, this.c, e);
  47689. },
  47690. plane: function (e) {
  47691. var t = e || new n.Plane();
  47692. return t.setFromCoplanarPoints(this.a, this.b, this.c);
  47693. },
  47694. barycoordFromPoint: function (e, t) {
  47695. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t);
  47696. },
  47697. containsPoint: function (e) {
  47698. return n.Triangle.containsPoint(e, this.a, this.b, this.c);
  47699. },
  47700. equals: function (e) {
  47701. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c);
  47702. },
  47703. }),
  47704. (n.Interpolant = function (e, t, i, n) {
  47705. (this.parameterPositions = e),
  47706. (this._cachedIndex = 0),
  47707. (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)),
  47708. (this.sampleValues = t),
  47709. (this.valueSize = i);
  47710. }),
  47711. (n.Interpolant.prototype = {
  47712. constructor: n.Interpolant,
  47713. evaluate: function (e) {
  47714. var t = this.parameterPositions,
  47715. i = this._cachedIndex,
  47716. n = t[i],
  47717. r = t[i - 1];
  47718. e: {
  47719. t: {
  47720. var o;
  47721. i: {
  47722. n: if (!(e < n)) {
  47723. for (var a = i + 2; ; ) {
  47724. if (void 0 === n) {
  47725. if (e < r) break n;
  47726. return (
  47727. (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  47728. );
  47729. }
  47730. if (i === a) break;
  47731. if (((r = n), (n = t[++i]), e < n)) break t;
  47732. }
  47733. o = t.length;
  47734. break i;
  47735. }
  47736. {
  47737. if (e >= r) break e;
  47738. var s = t[1];
  47739. e < s && ((i = 2), (r = s));
  47740. for (var a = i - 2; ; ) {
  47741. if (void 0 === r)
  47742. return (this._cachedIndex = 0), this.beforeStart_(0, e, n);
  47743. if (i === a) break;
  47744. if (((n = r), (r = t[--i - 1]), e >= r)) break t;
  47745. }
  47746. (o = i), (i = 0);
  47747. }
  47748. }
  47749. for (; i < o; ) {
  47750. var l = (i + o) >>> 1;
  47751. e < t[l] ? (o = l) : (i = l + 1);
  47752. }
  47753. if (((n = t[i]), (r = t[i - 1]), void 0 === r))
  47754. return (this._cachedIndex = 0), this.beforeStart_(0, e, n);
  47755. if (void 0 === n)
  47756. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e);
  47757. }
  47758. (this._cachedIndex = i), this.intervalChanged_(i, r, n);
  47759. }
  47760. return this.interpolate_(i, r, e, n);
  47761. },
  47762. settings: null,
  47763. DefaultSettings_: {},
  47764. getSettings_: function () {
  47765. return this.settings || this.DefaultSettings_;
  47766. },
  47767. copySampleValue_: function (e) {
  47768. for (
  47769. var t = this.resultBuffer,
  47770. i = this.sampleValues,
  47771. n = this.valueSize,
  47772. r = e * n,
  47773. o = 0;
  47774. o !== n;
  47775. ++o
  47776. )
  47777. t[o] = i[r + o];
  47778. return t;
  47779. },
  47780. interpolate_: function (e, t, i, n) {
  47781. throw new Error('call to abstract method');
  47782. },
  47783. intervalChanged_: function (e, t, i) {},
  47784. }),
  47785. Object.assign(n.Interpolant.prototype, {
  47786. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  47787. afterEnd_: n.Interpolant.prototype.copySampleValue_,
  47788. }),
  47789. (n.CubicInterpolant = function (e, t, i, r) {
  47790. n.Interpolant.call(this, e, t, i, r),
  47791. (this._weightPrev = -0),
  47792. (this._offsetPrev = -0),
  47793. (this._weightNext = -0),
  47794. (this._offsetNext = -0);
  47795. }),
  47796. (n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47797. constructor: n.CubicInterpolant,
  47798. DefaultSettings_: {
  47799. endingStart: n.ZeroCurvatureEnding,
  47800. endingEnd: n.ZeroCurvatureEnding,
  47801. },
  47802. intervalChanged_: function (e, t, i) {
  47803. var r = this.parameterPositions,
  47804. o = e - 2,
  47805. a = e + 1,
  47806. s = r[o],
  47807. l = r[a];
  47808. if (void 0 === s)
  47809. switch (this.getSettings_().endingStart) {
  47810. case n.ZeroSlopeEnding:
  47811. (o = e), (s = 2 * t - i);
  47812. break;
  47813. case n.WrapAroundEnding:
  47814. (o = r.length - 2), (s = t + r[o] - r[o + 1]);
  47815. break;
  47816. default:
  47817. (o = e), (s = i);
  47818. }
  47819. if (void 0 === l)
  47820. switch (this.getSettings_().endingEnd) {
  47821. case n.ZeroSlopeEnding:
  47822. (a = e), (l = 2 * i - t);
  47823. break;
  47824. case n.WrapAroundEnding:
  47825. (a = 1), (l = i + r[1] - r[0]);
  47826. break;
  47827. default:
  47828. (a = e - 1), (l = t);
  47829. }
  47830. var c = 0.5 * (i - t),
  47831. h = this.valueSize;
  47832. (this._weightPrev = c / (t - s)),
  47833. (this._weightNext = c / (l - i)),
  47834. (this._offsetPrev = o * h),
  47835. (this._offsetNext = a * h);
  47836. },
  47837. interpolate_: function (e, t, i, n) {
  47838. for (
  47839. var r = this.resultBuffer,
  47840. o = this.sampleValues,
  47841. a = this.valueSize,
  47842. s = e * a,
  47843. l = s - a,
  47844. c = this._offsetPrev,
  47845. h = this._offsetNext,
  47846. u = this._weightPrev,
  47847. d = this._weightNext,
  47848. p = (i - t) / (n - t),
  47849. f = p * p,
  47850. g = f * p,
  47851. m = -u * g + 2 * u * f - u * p,
  47852. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  47853. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  47854. y = d * g - d * f,
  47855. C = 0;
  47856. C !== a;
  47857. ++C
  47858. )
  47859. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  47860. return r;
  47861. },
  47862. })),
  47863. (n.DiscreteInterpolant = function (e, t, i, r) {
  47864. n.Interpolant.call(this, e, t, i, r);
  47865. }),
  47866. (n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47867. constructor: n.DiscreteInterpolant,
  47868. interpolate_: function (e, t, i, n) {
  47869. return this.copySampleValue_(e - 1);
  47870. },
  47871. })),
  47872. (n.LinearInterpolant = function (e, t, i, r) {
  47873. n.Interpolant.call(this, e, t, i, r);
  47874. }),
  47875. (n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47876. constructor: n.LinearInterpolant,
  47877. interpolate_: function (e, t, i, n) {
  47878. for (
  47879. var r = this.resultBuffer,
  47880. o = this.sampleValues,
  47881. a = this.valueSize,
  47882. s = e * a,
  47883. l = s - a,
  47884. c = (i - t) / (n - t),
  47885. h = 1 - c,
  47886. u = 0;
  47887. u !== a;
  47888. ++u
  47889. )
  47890. r[u] = o[l + u] * h + o[s + u] * c;
  47891. return r;
  47892. },
  47893. })),
  47894. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  47895. n.Interpolant.call(this, e, t, i, r);
  47896. }),
  47897. (n.QuaternionLinearInterpolant.prototype = Object.assign(
  47898. Object.create(n.Interpolant.prototype),
  47899. {
  47900. constructor: n.QuaternionLinearInterpolant,
  47901. interpolate_: function (e, t, i, r) {
  47902. for (
  47903. var o = this.resultBuffer,
  47904. a = this.sampleValues,
  47905. s = this.valueSize,
  47906. l = e * s,
  47907. c = (i - t) / (r - t),
  47908. h = l + s;
  47909. l !== h;
  47910. l += 4
  47911. )
  47912. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  47913. return o;
  47914. },
  47915. }
  47916. )),
  47917. (n.Clock = function (e) {
  47918. (this.autoStart = void 0 === e || e),
  47919. (this.startTime = 0),
  47920. (this.oldTime = 0),
  47921. (this.elapsedTime = 0),
  47922. (this.running = !1);
  47923. }),
  47924. (n.Clock.prototype = {
  47925. constructor: n.Clock,
  47926. start: function () {
  47927. (this.startTime = performance.now()),
  47928. (this.oldTime = this.startTime),
  47929. (this.running = !0);
  47930. },
  47931. stop: function () {
  47932. this.getElapsedTime(), (this.running = !1);
  47933. },
  47934. getElapsedTime: function () {
  47935. return this.getDelta(), this.elapsedTime;
  47936. },
  47937. getDelta: function () {
  47938. var e = 0;
  47939. if ((this.autoStart && !this.running && this.start(), this.running)) {
  47940. var t = performance.now();
  47941. (e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e);
  47942. }
  47943. return e;
  47944. },
  47945. }),
  47946. (n.EventDispatcher = function () {}),
  47947. (n.EventDispatcher.prototype = {
  47948. constructor: n.EventDispatcher,
  47949. apply: function (e) {
  47950. (e.addEventListener = n.EventDispatcher.prototype.addEventListener),
  47951. (e.hasEventListener = n.EventDispatcher.prototype.hasEventListener),
  47952. (e.removeEventListener = n.EventDispatcher.prototype.removeEventListener),
  47953. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent);
  47954. },
  47955. addEventListener: function (e, t) {
  47956. void 0 === this._listeners && (this._listeners = {});
  47957. var i = this._listeners;
  47958. void 0 === i[e] && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t);
  47959. },
  47960. hasEventListener: function (e, t) {
  47961. if (void 0 === this._listeners) return !1;
  47962. var i = this._listeners;
  47963. return void 0 !== i[e] && i[e].indexOf(t) !== -1;
  47964. },
  47965. removeEventListener: function (e, t) {
  47966. if (void 0 !== this._listeners) {
  47967. var i = this._listeners,
  47968. n = i[e];
  47969. if (void 0 !== n) {
  47970. var r = n.indexOf(t);
  47971. r !== -1 && n.splice(r, 1);
  47972. }
  47973. }
  47974. },
  47975. dispatchEvent: function (e) {
  47976. if (void 0 !== this._listeners) {
  47977. var t = this._listeners,
  47978. i = t[e.type];
  47979. if (void 0 !== i) {
  47980. e.target = this;
  47981. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o];
  47982. for (var o = 0; o < r; o++) n[o].call(this, e);
  47983. }
  47984. }
  47985. },
  47986. }),
  47987. (n.Layers = function () {
  47988. this.mask = 1;
  47989. }),
  47990. (n.Layers.prototype = {
  47991. constructor: n.Layers,
  47992. set: function (e) {
  47993. this.mask = 1 << e;
  47994. },
  47995. enable: function (e) {
  47996. this.mask |= 1 << e;
  47997. },
  47998. toggle: function (e) {
  47999. this.mask ^= 1 << e;
  48000. },
  48001. disable: function (e) {
  48002. this.mask &= ~(1 << e);
  48003. },
  48004. test: function (e) {
  48005. return 0 !== (this.mask & e.mask);
  48006. },
  48007. }),
  48008. (function (e) {
  48009. function t(e, t) {
  48010. return e.distance - t.distance;
  48011. }
  48012. function i(e, t, n, r) {
  48013. if (e.visible !== !1 && (e.raycast(t, n), r === !0))
  48014. for (var o = e.children, a = 0, s = o.length; a < s; a++) i(o[a], t, n, !0);
  48015. }
  48016. (e.Raycaster = function (t, i, n, r) {
  48017. (this.ray = new e.Ray(t, i)),
  48018. (this.near = n || 0),
  48019. (this.far = r || 1 / 0),
  48020. (this.params = {
  48021. Mesh: {},
  48022. Line: {},
  48023. LOD: {},
  48024. Points: {
  48025. threshold: 1,
  48026. },
  48027. Sprite: {},
  48028. }),
  48029. Object.defineProperties(this.params, {
  48030. PointCloud: {
  48031. get: function () {
  48032. return (
  48033. console.warn(
  48034. 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.'
  48035. ),
  48036. this.Points
  48037. );
  48038. },
  48039. },
  48040. });
  48041. }),
  48042. (e.Raycaster.prototype = {
  48043. constructor: e.Raycaster,
  48044. linePrecision: 1,
  48045. set: function (e, t) {
  48046. this.ray.set(e, t);
  48047. },
  48048. setFromCamera: function (t, i) {
  48049. i instanceof e.PerspectiveCamera
  48050. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  48051. this.ray.direction
  48052. .set(t.x, t.y, 0.5)
  48053. .unproject(i)
  48054. .sub(this.ray.origin)
  48055. .normalize())
  48056. : i instanceof e.OrthographicCamera
  48057. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  48058. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld))
  48059. : console.error('THREE.Raycaster: Unsupported camera type.');
  48060. },
  48061. intersectObject: function (e, n) {
  48062. var r = [];
  48063. return i(e, this, r, n), r.sort(t), r;
  48064. },
  48065. intersectObjects: function (e, n) {
  48066. var r = [];
  48067. if (Array.isArray(e) === !1)
  48068. return (
  48069. console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), r
  48070. );
  48071. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n);
  48072. return r.sort(t), r;
  48073. },
  48074. });
  48075. })(n),
  48076. (n.Object3D = function () {
  48077. function e() {
  48078. o.setFromEuler(r, !1);
  48079. }
  48080. function t() {
  48081. r.setFromQuaternion(o, void 0, !1);
  48082. }
  48083. Object.defineProperty(this, 'id', {
  48084. value: n.Object3DIdCount++,
  48085. }),
  48086. (this.uuid = n.Math.generateUUID()),
  48087. (this.name = ''),
  48088. (this.type = 'Object3D'),
  48089. (this.parent = null),
  48090. (this.children = []),
  48091. (this.up = n.Object3D.DefaultUp.clone());
  48092. var i = new n.Vector3(),
  48093. r = new n.Euler(),
  48094. o = new n.Quaternion(),
  48095. a = new n.Vector3(1, 1, 1);
  48096. r.onChange(e),
  48097. o.onChange(t),
  48098. Object.defineProperties(this, {
  48099. position: {
  48100. enumerable: !0,
  48101. value: i,
  48102. },
  48103. rotation: {
  48104. enumerable: !0,
  48105. value: r,
  48106. },
  48107. quaternion: {
  48108. enumerable: !0,
  48109. value: o,
  48110. },
  48111. scale: {
  48112. enumerable: !0,
  48113. value: a,
  48114. },
  48115. modelViewMatrix: {
  48116. value: new n.Matrix4(),
  48117. },
  48118. normalMatrix: {
  48119. value: new n.Matrix3(),
  48120. },
  48121. }),
  48122. (this.rotationAutoUpdate = !0),
  48123. (this.matrix = new n.Matrix4()),
  48124. (this.matrixWorld = new n.Matrix4()),
  48125. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  48126. (this.matrixWorldNeedsUpdate = !1),
  48127. (this.layers = new n.Layers()),
  48128. (this.visible = !0),
  48129. (this.castShadow = !1),
  48130. (this.receiveShadow = !1),
  48131. (this.frustumCulled = !0),
  48132. (this.renderOrder = 0),
  48133. (this.userData = {});
  48134. }),
  48135. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  48136. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  48137. (n.Object3D.prototype = {
  48138. constructor: n.Object3D,
  48139. applyMatrix: function (e) {
  48140. this.matrix.multiplyMatrices(e, this.matrix),
  48141. this.matrix.decompose(this.position, this.quaternion, this.scale);
  48142. },
  48143. setRotationFromAxisAngle: function (e, t) {
  48144. this.quaternion.setFromAxisAngle(e, t);
  48145. },
  48146. setRotationFromEuler: function (e) {
  48147. this.quaternion.setFromEuler(e, !0);
  48148. },
  48149. setRotationFromMatrix: function (e) {
  48150. this.quaternion.setFromRotationMatrix(e);
  48151. },
  48152. setRotationFromQuaternion: function (e) {
  48153. this.quaternion.copy(e);
  48154. },
  48155. rotateOnAxis: (function () {
  48156. var e = new n.Quaternion();
  48157. return function (t, i) {
  48158. return e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this;
  48159. };
  48160. })(),
  48161. rotateX: (function () {
  48162. var e = new n.Vector3(1, 0, 0);
  48163. return function (t) {
  48164. return this.rotateOnAxis(e, t);
  48165. };
  48166. })(),
  48167. rotateY: (function () {
  48168. var e = new n.Vector3(0, 1, 0);
  48169. return function (t) {
  48170. return this.rotateOnAxis(e, t);
  48171. };
  48172. })(),
  48173. rotateZ: (function () {
  48174. var e = new n.Vector3(0, 0, 1);
  48175. return function (t) {
  48176. return this.rotateOnAxis(e, t);
  48177. };
  48178. })(),
  48179. translateOnAxis: (function () {
  48180. var e = new n.Vector3();
  48181. return function (t, i) {
  48182. return (
  48183. e.copy(t).applyQuaternion(this.quaternion),
  48184. this.position.add(e.multiplyScalar(i)),
  48185. this
  48186. );
  48187. };
  48188. })(),
  48189. translateX: (function () {
  48190. var e = new n.Vector3(1, 0, 0);
  48191. return function (t) {
  48192. return this.translateOnAxis(e, t);
  48193. };
  48194. })(),
  48195. translateY: (function () {
  48196. var e = new n.Vector3(0, 1, 0);
  48197. return function (t) {
  48198. return this.translateOnAxis(e, t);
  48199. };
  48200. })(),
  48201. translateZ: (function () {
  48202. var e = new n.Vector3(0, 0, 1);
  48203. return function (t) {
  48204. return this.translateOnAxis(e, t);
  48205. };
  48206. })(),
  48207. localToWorld: function (e) {
  48208. return e.applyMatrix4(this.matrixWorld);
  48209. },
  48210. worldToLocal: (function () {
  48211. var e = new n.Matrix4();
  48212. return function (t) {
  48213. return t.applyMatrix4(e.getInverse(this.matrixWorld));
  48214. };
  48215. })(),
  48216. lookAt: (function () {
  48217. var e = new n.Matrix4();
  48218. return function (t) {
  48219. e.lookAt(t, this.position, this.up), this.quaternion.setFromRotationMatrix(e);
  48220. };
  48221. })(),
  48222. add: function (e) {
  48223. if (arguments.length > 1) {
  48224. for (var t = 0; t < arguments.length; t++) this.add(arguments[t]);
  48225. return this;
  48226. }
  48227. return e === this
  48228. ? (console.error(
  48229. "THREE.Object3D.add: object can't be added as a child of itself.",
  48230. e
  48231. ),
  48232. this)
  48233. : (e instanceof n.Object3D
  48234. ? (null !== e.parent && e.parent.remove(e),
  48235. (e.parent = this),
  48236. e.dispatchEvent({
  48237. type: 'added',
  48238. }),
  48239. this.children.push(e))
  48240. : console.error(
  48241. 'THREE.Object3D.add: object not an instance of THREE.Object3D.',
  48242. e
  48243. ),
  48244. this);
  48245. },
  48246. remove: function (e) {
  48247. if (arguments.length > 1)
  48248. for (var t = 0; t < arguments.length; t++) this.remove(arguments[t]);
  48249. var i = this.children.indexOf(e);
  48250. i !== -1 &&
  48251. ((e.parent = null),
  48252. e.dispatchEvent({
  48253. type: 'removed',
  48254. }),
  48255. this.children.splice(i, 1));
  48256. },
  48257. getObjectById: function (e) {
  48258. return this.getObjectByProperty('id', e);
  48259. },
  48260. getObjectByName: function (e) {
  48261. return this.getObjectByProperty('name', e);
  48262. },
  48263. getObjectByProperty: function (e, t) {
  48264. if (this[e] === t) return this;
  48265. for (var i = 0, n = this.children.length; i < n; i++) {
  48266. var r = this.children[i],
  48267. o = r.getObjectByProperty(e, t);
  48268. if (void 0 !== o) return o;
  48269. }
  48270. },
  48271. getWorldPosition: function (e) {
  48272. var t = e || new n.Vector3();
  48273. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld);
  48274. },
  48275. getWorldQuaternion: (function () {
  48276. var e = new n.Vector3(),
  48277. t = new n.Vector3();
  48278. return function (i) {
  48279. var r = i || new n.Quaternion();
  48280. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, r, t), r;
  48281. };
  48282. })(),
  48283. getWorldRotation: (function () {
  48284. var e = new n.Quaternion();
  48285. return function (t) {
  48286. var i = t || new n.Euler();
  48287. return this.getWorldQuaternion(e), i.setFromQuaternion(e, this.rotation.order, !1);
  48288. };
  48289. })(),
  48290. getWorldScale: (function () {
  48291. var e = new n.Vector3(),
  48292. t = new n.Quaternion();
  48293. return function (i) {
  48294. var r = i || new n.Vector3();
  48295. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, r), r;
  48296. };
  48297. })(),
  48298. getWorldDirection: (function () {
  48299. var e = new n.Quaternion();
  48300. return function (t) {
  48301. var i = t || new n.Vector3();
  48302. return this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e);
  48303. };
  48304. })(),
  48305. raycast: function () {},
  48306. traverse: function (e) {
  48307. e(this);
  48308. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e);
  48309. },
  48310. traverseVisible: function (e) {
  48311. if (this.visible !== !1) {
  48312. e(this);
  48313. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  48314. t[i].traverseVisible(e);
  48315. }
  48316. },
  48317. traverseAncestors: function (e) {
  48318. var t = this.parent;
  48319. null !== t && (e(t), t.traverseAncestors(e));
  48320. },
  48321. updateMatrix: function () {
  48322. this.matrix.compose(this.position, this.quaternion, this.scale),
  48323. (this.matrixWorldNeedsUpdate = !0);
  48324. },
  48325. updateMatrixWorld: function (e) {
  48326. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  48327. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  48328. (null === this.parent
  48329. ? this.matrixWorld.copy(this.matrix)
  48330. : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  48331. (this.matrixWorldNeedsUpdate = !1),
  48332. (e = !0));
  48333. for (var t = 0, i = this.children.length; t < i; t++)
  48334. this.children[t].updateMatrixWorld(e);
  48335. },
  48336. toJSON: function (e) {
  48337. function t(e) {
  48338. var t = [];
  48339. for (var i in e) {
  48340. var n = e[i];
  48341. delete n.metadata, t.push(n);
  48342. }
  48343. return t;
  48344. }
  48345. var i = void 0 === e,
  48346. n = {};
  48347. i &&
  48348. ((e = {
  48349. geometries: {},
  48350. materials: {},
  48351. textures: {},
  48352. images: {},
  48353. }),
  48354. (n.metadata = {
  48355. version: 4.4,
  48356. type: 'Object',
  48357. generator: 'Object3D.toJSON',
  48358. }));
  48359. var r = {};
  48360. if (
  48361. ((r.uuid = this.uuid),
  48362. (r.type = this.type),
  48363. '' !== this.name && (r.name = this.name),
  48364. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  48365. this.castShadow === !0 && (r.castShadow = !0),
  48366. this.receiveShadow === !0 && (r.receiveShadow = !0),
  48367. this.visible === !1 && (r.visible = !1),
  48368. (r.matrix = this.matrix.toArray()),
  48369. void 0 !== this.geometry &&
  48370. (void 0 === e.geometries[this.geometry.uuid] &&
  48371. (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  48372. (r.geometry = this.geometry.uuid)),
  48373. void 0 !== this.material &&
  48374. (void 0 === e.materials[this.material.uuid] &&
  48375. (e.materials[this.material.uuid] = this.material.toJSON(e)),
  48376. (r.material = this.material.uuid)),
  48377. this.children.length > 0)
  48378. ) {
  48379. r.children = [];
  48380. for (var o = 0; o < this.children.length; o++)
  48381. r.children.push(this.children[o].toJSON(e).object);
  48382. }
  48383. if (i) {
  48384. var a = t(e.geometries),
  48385. s = t(e.materials),
  48386. l = t(e.textures),
  48387. c = t(e.images);
  48388. a.length > 0 && (n.geometries = a),
  48389. s.length > 0 && (n.materials = s),
  48390. l.length > 0 && (n.textures = l),
  48391. c.length > 0 && (n.images = c);
  48392. }
  48393. return (n.object = r), n;
  48394. },
  48395. clone: function (e) {
  48396. return new this.constructor().copy(this, e);
  48397. },
  48398. copy: function (e, t) {
  48399. if (
  48400. (void 0 === t && (t = !0),
  48401. (this.name = e.name),
  48402. this.up.copy(e.up),
  48403. this.position.copy(e.position),
  48404. this.quaternion.copy(e.quaternion),
  48405. this.scale.copy(e.scale),
  48406. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  48407. this.matrix.copy(e.matrix),
  48408. this.matrixWorld.copy(e.matrixWorld),
  48409. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  48410. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  48411. (this.visible = e.visible),
  48412. (this.castShadow = e.castShadow),
  48413. (this.receiveShadow = e.receiveShadow),
  48414. (this.frustumCulled = e.frustumCulled),
  48415. (this.renderOrder = e.renderOrder),
  48416. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  48417. t === !0)
  48418. )
  48419. for (var i = 0; i < e.children.length; i++) {
  48420. var n = e.children[i];
  48421. this.add(n.clone());
  48422. }
  48423. return this;
  48424. },
  48425. }),
  48426. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  48427. (n.Object3DIdCount = 0),
  48428. (n.Face3 = function (e, t, i, r, o, a) {
  48429. (this.a = e),
  48430. (this.b = t),
  48431. (this.c = i),
  48432. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  48433. (this.vertexNormals = Array.isArray(r) ? r : []),
  48434. (this.color = o instanceof n.Color ? o : new n.Color()),
  48435. (this.vertexColors = Array.isArray(o) ? o : []),
  48436. (this.materialIndex = void 0 !== a ? a : 0);
  48437. }),
  48438. (n.Face3.prototype = {
  48439. constructor: n.Face3,
  48440. clone: function () {
  48441. return new this.constructor().copy(this);
  48442. },
  48443. copy: function (e) {
  48444. (this.a = e.a),
  48445. (this.b = e.b),
  48446. (this.c = e.c),
  48447. this.normal.copy(e.normal),
  48448. this.color.copy(e.color),
  48449. (this.materialIndex = e.materialIndex);
  48450. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  48451. this.vertexNormals[t] = e.vertexNormals[t].clone();
  48452. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  48453. this.vertexColors[t] = e.vertexColors[t].clone();
  48454. return this;
  48455. },
  48456. }),
  48457. (n.BufferAttribute = function (e, t) {
  48458. (this.uuid = n.Math.generateUUID()),
  48459. (this.array = e),
  48460. (this.itemSize = t),
  48461. (this.dynamic = !1),
  48462. (this.updateRange = {
  48463. offset: 0,
  48464. count: -1,
  48465. }),
  48466. (this.version = 0);
  48467. }),
  48468. (n.BufferAttribute.prototype = {
  48469. constructor: n.BufferAttribute,
  48470. get count() {
  48471. return this.array.length / this.itemSize;
  48472. },
  48473. set needsUpdate(e) {
  48474. e === !0 && this.version++;
  48475. },
  48476. setDynamic: function (e) {
  48477. return (this.dynamic = e), this;
  48478. },
  48479. copy: function (e) {
  48480. return (
  48481. (this.array = new e.array.constructor(e.array)),
  48482. (this.itemSize = e.itemSize),
  48483. (this.dynamic = e.dynamic),
  48484. this
  48485. );
  48486. },
  48487. copyAt: function (e, t, i) {
  48488. (e *= this.itemSize), (i *= t.itemSize);
  48489. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n];
  48490. return this;
  48491. },
  48492. copyArray: function (e) {
  48493. return this.array.set(e), this;
  48494. },
  48495. copyColorsArray: function (e) {
  48496. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48497. var a = e[r];
  48498. void 0 === a &&
  48499. (console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', r),
  48500. (a = new n.Color())),
  48501. (t[i++] = a.r),
  48502. (t[i++] = a.g),
  48503. (t[i++] = a.b);
  48504. }
  48505. return this;
  48506. },
  48507. copyIndicesArray: function (e) {
  48508. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  48509. var o = e[n];
  48510. (t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c);
  48511. }
  48512. return this;
  48513. },
  48514. copyVector2sArray: function (e) {
  48515. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48516. var a = e[r];
  48517. void 0 === a &&
  48518. (console.warn(
  48519. 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined',
  48520. r
  48521. ),
  48522. (a = new n.Vector2())),
  48523. (t[i++] = a.x),
  48524. (t[i++] = a.y);
  48525. }
  48526. return this;
  48527. },
  48528. copyVector3sArray: function (e) {
  48529. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48530. var a = e[r];
  48531. void 0 === a &&
  48532. (console.warn(
  48533. 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined',
  48534. r
  48535. ),
  48536. (a = new n.Vector3())),
  48537. (t[i++] = a.x),
  48538. (t[i++] = a.y),
  48539. (t[i++] = a.z);
  48540. }
  48541. return this;
  48542. },
  48543. copyVector4sArray: function (e) {
  48544. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48545. var a = e[r];
  48546. void 0 === a &&
  48547. (console.warn(
  48548. 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined',
  48549. r
  48550. ),
  48551. (a = new n.Vector4())),
  48552. (t[i++] = a.x),
  48553. (t[i++] = a.y),
  48554. (t[i++] = a.z),
  48555. (t[i++] = a.w);
  48556. }
  48557. return this;
  48558. },
  48559. set: function (e, t) {
  48560. return void 0 === t && (t = 0), this.array.set(e, t), this;
  48561. },
  48562. getX: function (e) {
  48563. return this.array[e * this.itemSize];
  48564. },
  48565. setX: function (e, t) {
  48566. return (this.array[e * this.itemSize] = t), this;
  48567. },
  48568. getY: function (e) {
  48569. return this.array[e * this.itemSize + 1];
  48570. },
  48571. setY: function (e, t) {
  48572. return (this.array[e * this.itemSize + 1] = t), this;
  48573. },
  48574. getZ: function (e) {
  48575. return this.array[e * this.itemSize + 2];
  48576. },
  48577. setZ: function (e, t) {
  48578. return (this.array[e * this.itemSize + 2] = t), this;
  48579. },
  48580. getW: function (e) {
  48581. return this.array[e * this.itemSize + 3];
  48582. },
  48583. setW: function (e, t) {
  48584. return (this.array[e * this.itemSize + 3] = t), this;
  48585. },
  48586. setXY: function (e, t, i) {
  48587. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this;
  48588. },
  48589. setXYZ: function (e, t, i, n) {
  48590. return (
  48591. (e *= this.itemSize),
  48592. (this.array[e + 0] = t),
  48593. (this.array[e + 1] = i),
  48594. (this.array[e + 2] = n),
  48595. this
  48596. );
  48597. },
  48598. setXYZW: function (e, t, i, n, r) {
  48599. return (
  48600. (e *= this.itemSize),
  48601. (this.array[e + 0] = t),
  48602. (this.array[e + 1] = i),
  48603. (this.array[e + 2] = n),
  48604. (this.array[e + 3] = r),
  48605. this
  48606. );
  48607. },
  48608. clone: function () {
  48609. return new this.constructor().copy(this);
  48610. },
  48611. }),
  48612. (n.Int8Attribute = function (e, t) {
  48613. return new n.BufferAttribute(new Int8Array(e), t);
  48614. }),
  48615. (n.Uint8Attribute = function (e, t) {
  48616. return new n.BufferAttribute(new Uint8Array(e), t);
  48617. }),
  48618. (n.Uint8ClampedAttribute = function (e, t) {
  48619. return new n.BufferAttribute(new Uint8ClampedArray(e), t);
  48620. }),
  48621. (n.Int16Attribute = function (e, t) {
  48622. return new n.BufferAttribute(new Int16Array(e), t);
  48623. }),
  48624. (n.Uint16Attribute = function (e, t) {
  48625. return new n.BufferAttribute(new Uint16Array(e), t);
  48626. });
  48627. n.Int32Attribute = function (e, t) {
  48628. return new n.BufferAttribute(new Int32Array(e), t);
  48629. };
  48630. (n.Uint32Attribute = function (e, t) {
  48631. return new n.BufferAttribute(new Uint32Array(e), t);
  48632. }),
  48633. (n.Float32Attribute = function (e, t) {
  48634. return new n.BufferAttribute(new Float32Array(e), t);
  48635. }),
  48636. (n.Float64Attribute = function (e, t) {
  48637. return new n.BufferAttribute(new Float64Array(e), t);
  48638. }),
  48639. (n.DynamicBufferAttribute = function (e, t) {
  48640. return (
  48641. console.warn(
  48642. 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'
  48643. ),
  48644. new n.BufferAttribute(e, t).setDynamic(!0)
  48645. );
  48646. }),
  48647. (n.InstancedBufferAttribute = function (e, t, i) {
  48648. n.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1);
  48649. }),
  48650. (n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype)),
  48651. (n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute),
  48652. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  48653. return (
  48654. n.BufferAttribute.prototype.copy.call(this, e),
  48655. (this.meshPerAttribute = e.meshPerAttribute),
  48656. this
  48657. );
  48658. }),
  48659. (n.InterleavedBuffer = function (e, t) {
  48660. (this.uuid = n.Math.generateUUID()),
  48661. (this.array = e),
  48662. (this.stride = t),
  48663. (this.dynamic = !1),
  48664. (this.updateRange = {
  48665. offset: 0,
  48666. count: -1,
  48667. }),
  48668. (this.version = 0);
  48669. }),
  48670. (n.InterleavedBuffer.prototype = {
  48671. constructor: n.InterleavedBuffer,
  48672. get length() {
  48673. return this.array.length;
  48674. },
  48675. get count() {
  48676. return this.array.length / this.stride;
  48677. },
  48678. set needsUpdate(e) {
  48679. e === !0 && this.version++;
  48680. },
  48681. setDynamic: function (e) {
  48682. return (this.dynamic = e), this;
  48683. },
  48684. copy: function (e) {
  48685. return (
  48686. (this.array = new e.array.constructor(e.array)),
  48687. (this.stride = e.stride),
  48688. (this.dynamic = e.dynamic),
  48689. this
  48690. );
  48691. },
  48692. copyAt: function (e, t, i) {
  48693. (e *= this.stride), (i *= t.stride);
  48694. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n];
  48695. return this;
  48696. },
  48697. set: function (e, t) {
  48698. return void 0 === t && (t = 0), this.array.set(e, t), this;
  48699. },
  48700. clone: function () {
  48701. return new this.constructor().copy(this);
  48702. },
  48703. }),
  48704. (n.InstancedInterleavedBuffer = function (e, t, i) {
  48705. n.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1);
  48706. }),
  48707. (n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype)),
  48708. (n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer),
  48709. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  48710. return (
  48711. n.InterleavedBuffer.prototype.copy.call(this, e),
  48712. (this.meshPerAttribute = e.meshPerAttribute),
  48713. this
  48714. );
  48715. }),
  48716. (n.InterleavedBufferAttribute = function (e, t, i) {
  48717. (this.uuid = n.Math.generateUUID()),
  48718. (this.data = e),
  48719. (this.itemSize = t),
  48720. (this.offset = i);
  48721. }),
  48722. (n.InterleavedBufferAttribute.prototype = {
  48723. constructor: n.InterleavedBufferAttribute,
  48724. get length() {
  48725. return (
  48726. console.warn(
  48727. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  48728. ),
  48729. this.array.length
  48730. );
  48731. },
  48732. get count() {
  48733. return this.data.count;
  48734. },
  48735. setX: function (e, t) {
  48736. return (this.data.array[e * this.data.stride + this.offset] = t), this;
  48737. },
  48738. setY: function (e, t) {
  48739. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this;
  48740. },
  48741. setZ: function (e, t) {
  48742. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this;
  48743. },
  48744. setW: function (e, t) {
  48745. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this;
  48746. },
  48747. getX: function (e) {
  48748. return this.data.array[e * this.data.stride + this.offset];
  48749. },
  48750. getY: function (e) {
  48751. return this.data.array[e * this.data.stride + this.offset + 1];
  48752. },
  48753. getZ: function (e) {
  48754. return this.data.array[e * this.data.stride + this.offset + 2];
  48755. },
  48756. getW: function (e) {
  48757. return this.data.array[e * this.data.stride + this.offset + 3];
  48758. },
  48759. setXY: function (e, t, i) {
  48760. return (
  48761. (e = e * this.data.stride + this.offset),
  48762. (this.data.array[e + 0] = t),
  48763. (this.data.array[e + 1] = i),
  48764. this
  48765. );
  48766. },
  48767. setXYZ: function (e, t, i, n) {
  48768. return (
  48769. (e = e * this.data.stride + this.offset),
  48770. (this.data.array[e + 0] = t),
  48771. (this.data.array[e + 1] = i),
  48772. (this.data.array[e + 2] = n),
  48773. this
  48774. );
  48775. },
  48776. setXYZW: function (e, t, i, n, r) {
  48777. return (
  48778. (e = e * this.data.stride + this.offset),
  48779. (this.data.array[e + 0] = t),
  48780. (this.data.array[e + 1] = i),
  48781. (this.data.array[e + 2] = n),
  48782. (this.data.array[e + 3] = r),
  48783. this
  48784. );
  48785. },
  48786. }),
  48787. (n.Geometry = function () {
  48788. Object.defineProperty(this, 'id', {
  48789. value: n.GeometryIdCount++,
  48790. }),
  48791. (this.uuid = n.Math.generateUUID()),
  48792. (this.name = ''),
  48793. (this.type = 'Geometry'),
  48794. (this.vertices = []),
  48795. (this.colors = []),
  48796. (this.faces = []),
  48797. (this.faceVertexUvs = [[]]),
  48798. (this.morphTargets = []),
  48799. (this.morphNormals = []),
  48800. (this.skinWeights = []),
  48801. (this.skinIndices = []),
  48802. (this.lineDistances = []),
  48803. (this.boundingBox = null),
  48804. (this.boundingSphere = null),
  48805. (this.verticesNeedUpdate = !1),
  48806. (this.elementsNeedUpdate = !1),
  48807. (this.uvsNeedUpdate = !1),
  48808. (this.normalsNeedUpdate = !1),
  48809. (this.colorsNeedUpdate = !1),
  48810. (this.lineDistancesNeedUpdate = !1),
  48811. (this.groupsNeedUpdate = !1);
  48812. }),
  48813. (n.Geometry.prototype = {
  48814. constructor: n.Geometry,
  48815. applyMatrix: function (e) {
  48816. for (
  48817. var t = new n.Matrix3().getNormalMatrix(e), i = 0, r = this.vertices.length;
  48818. i < r;
  48819. i++
  48820. ) {
  48821. var o = this.vertices[i];
  48822. o.applyMatrix4(e);
  48823. }
  48824. for (var i = 0, r = this.faces.length; i < r; i++) {
  48825. var a = this.faces[i];
  48826. a.normal.applyMatrix3(t).normalize();
  48827. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  48828. a.vertexNormals[s].applyMatrix3(t).normalize();
  48829. }
  48830. return (
  48831. null !== this.boundingBox && this.computeBoundingBox(),
  48832. null !== this.boundingSphere && this.computeBoundingSphere(),
  48833. (this.verticesNeedUpdate = !0),
  48834. (this.normalsNeedUpdate = !0),
  48835. this
  48836. );
  48837. },
  48838. rotateX: (function () {
  48839. var e;
  48840. return function (t) {
  48841. return (
  48842. void 0 === e && (e = new n.Matrix4()),
  48843. e.makeRotationX(t),
  48844. this.applyMatrix(e),
  48845. this
  48846. );
  48847. };
  48848. })(),
  48849. rotateY: (function () {
  48850. var e;
  48851. return function (t) {
  48852. return (
  48853. void 0 === e && (e = new n.Matrix4()),
  48854. e.makeRotationY(t),
  48855. this.applyMatrix(e),
  48856. this
  48857. );
  48858. };
  48859. })(),
  48860. rotateZ: (function () {
  48861. var e;
  48862. return function (t) {
  48863. return (
  48864. void 0 === e && (e = new n.Matrix4()),
  48865. e.makeRotationZ(t),
  48866. this.applyMatrix(e),
  48867. this
  48868. );
  48869. };
  48870. })(),
  48871. translate: (function () {
  48872. var e;
  48873. return function (t, i, r) {
  48874. return (
  48875. void 0 === e && (e = new n.Matrix4()),
  48876. e.makeTranslation(t, i, r),
  48877. this.applyMatrix(e),
  48878. this
  48879. );
  48880. };
  48881. })(),
  48882. scale: (function () {
  48883. var e;
  48884. return function (t, i, r) {
  48885. return (
  48886. void 0 === e && (e = new n.Matrix4()),
  48887. e.makeScale(t, i, r),
  48888. this.applyMatrix(e),
  48889. this
  48890. );
  48891. };
  48892. })(),
  48893. lookAt: (function () {
  48894. var e;
  48895. return function (t) {
  48896. void 0 === e && (e = new n.Object3D()),
  48897. e.lookAt(t),
  48898. e.updateMatrix(),
  48899. this.applyMatrix(e.matrix);
  48900. };
  48901. })(),
  48902. fromBufferGeometry: function (e) {
  48903. function t(e, t, r, o) {
  48904. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : [],
  48905. f =
  48906. void 0 !== l
  48907. ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()]
  48908. : [],
  48909. g = new n.Face3(e, t, r, a, f, o);
  48910. i.faces.push(g),
  48911. void 0 !== c &&
  48912. i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  48913. void 0 !== h &&
  48914. i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()]);
  48915. }
  48916. var i = this,
  48917. r = null !== e.index ? e.index.array : void 0,
  48918. o = e.attributes,
  48919. a = o.position.array,
  48920. s = void 0 !== o.normal ? o.normal.array : void 0,
  48921. l = void 0 !== o.color ? o.color.array : void 0,
  48922. c = void 0 !== o.uv ? o.uv.array : void 0,
  48923. h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  48924. void 0 !== h && (this.faceVertexUvs[1] = []);
  48925. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3, g += 2)
  48926. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  48927. void 0 !== s && u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  48928. void 0 !== l && i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  48929. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  48930. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]));
  48931. if (void 0 !== r) {
  48932. var m = e.groups;
  48933. if (m.length > 0)
  48934. for (var f = 0; f < m.length; f++)
  48935. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  48936. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  48937. else for (var f = 0; f < r.length; f += 3) t(r[f], r[f + 1], r[f + 2]);
  48938. } else for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2);
  48939. return (
  48940. this.computeFaceNormals(),
  48941. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  48942. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  48943. this
  48944. );
  48945. },
  48946. center: function () {
  48947. this.computeBoundingBox();
  48948. var e = this.boundingBox.center().negate();
  48949. return this.translate(e.x, e.y, e.z), e;
  48950. },
  48951. normalize: function () {
  48952. this.computeBoundingSphere();
  48953. var e = this.boundingSphere.center,
  48954. t = this.boundingSphere.radius,
  48955. i = 0 === t ? 1 : 1 / t,
  48956. r = new n.Matrix4();
  48957. return (
  48958. r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  48959. this.applyMatrix(r),
  48960. this
  48961. );
  48962. },
  48963. computeFaceNormals: function () {
  48964. for (
  48965. var e = new n.Vector3(), t = new n.Vector3(), i = 0, r = this.faces.length;
  48966. i < r;
  48967. i++
  48968. ) {
  48969. var o = this.faces[i],
  48970. a = this.vertices[o.a],
  48971. s = this.vertices[o.b],
  48972. l = this.vertices[o.c];
  48973. e.subVectors(l, s), t.subVectors(a, s), e.cross(t), e.normalize(), o.normal.copy(e);
  48974. }
  48975. },
  48976. computeVertexNormals: function (e) {
  48977. void 0 === e && (e = !0);
  48978. var t, i, r, o, a, s;
  48979. for (s = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++)
  48980. s[t] = new n.Vector3();
  48981. if (e) {
  48982. var l,
  48983. c,
  48984. h,
  48985. u = new n.Vector3(),
  48986. d = new n.Vector3();
  48987. for (r = 0, o = this.faces.length; r < o; r++)
  48988. (a = this.faces[r]),
  48989. (l = this.vertices[a.a]),
  48990. (c = this.vertices[a.b]),
  48991. (h = this.vertices[a.c]),
  48992. u.subVectors(h, c),
  48993. d.subVectors(l, c),
  48994. u.cross(d),
  48995. s[a.a].add(u),
  48996. s[a.b].add(u),
  48997. s[a.c].add(u);
  48998. } else
  48999. for (r = 0, o = this.faces.length; r < o; r++)
  49000. (a = this.faces[r]),
  49001. s[a.a].add(a.normal),
  49002. s[a.b].add(a.normal),
  49003. s[a.c].add(a.normal);
  49004. for (t = 0, i = this.vertices.length; t < i; t++) s[t].normalize();
  49005. for (r = 0, o = this.faces.length; r < o; r++) {
  49006. a = this.faces[r];
  49007. var p = a.vertexNormals;
  49008. 3 === p.length
  49009. ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c]))
  49010. : ((p[0] = s[a.a].clone()), (p[1] = s[a.b].clone()), (p[2] = s[a.c].clone()));
  49011. }
  49012. this.faces.length > 0 && (this.normalsNeedUpdate = !0);
  49013. },
  49014. computeMorphNormals: function () {
  49015. var e, t, i, r, o;
  49016. for (i = 0, r = this.faces.length; i < r; i++)
  49017. for (
  49018. o = this.faces[i],
  49019. o.__originalFaceNormal
  49020. ? o.__originalFaceNormal.copy(o.normal)
  49021. : (o.__originalFaceNormal = o.normal.clone()),
  49022. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  49023. e = 0,
  49024. t = o.vertexNormals.length;
  49025. e < t;
  49026. e++
  49027. )
  49028. o.__originalVertexNormals[e]
  49029. ? o.__originalVertexNormals[e].copy(o.vertexNormals[e])
  49030. : (o.__originalVertexNormals[e] = o.vertexNormals[e].clone());
  49031. var a = new n.Geometry();
  49032. for (a.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  49033. if (!this.morphNormals[e]) {
  49034. (this.morphNormals[e] = {}),
  49035. (this.morphNormals[e].faceNormals = []),
  49036. (this.morphNormals[e].vertexNormals = []);
  49037. var s,
  49038. l,
  49039. c = this.morphNormals[e].faceNormals,
  49040. h = this.morphNormals[e].vertexNormals;
  49041. for (i = 0, r = this.faces.length; i < r; i++)
  49042. (s = new n.Vector3()),
  49043. (l = {
  49044. a: new n.Vector3(),
  49045. b: new n.Vector3(),
  49046. c: new n.Vector3(),
  49047. }),
  49048. c.push(s),
  49049. h.push(l);
  49050. }
  49051. var u = this.morphNormals[e];
  49052. (a.vertices = this.morphTargets[e].vertices),
  49053. a.computeFaceNormals(),
  49054. a.computeVertexNormals();
  49055. var s, l;
  49056. for (i = 0, r = this.faces.length; i < r; i++)
  49057. (o = this.faces[i]),
  49058. (s = u.faceNormals[i]),
  49059. (l = u.vertexNormals[i]),
  49060. s.copy(o.normal),
  49061. l.a.copy(o.vertexNormals[0]),
  49062. l.b.copy(o.vertexNormals[1]),
  49063. l.c.copy(o.vertexNormals[2]);
  49064. }
  49065. for (i = 0, r = this.faces.length; i < r; i++)
  49066. (o = this.faces[i]),
  49067. (o.normal = o.__originalFaceNormal),
  49068. (o.vertexNormals = o.__originalVertexNormals);
  49069. },
  49070. computeTangents: function () {
  49071. console.warn('THREE.Geometry: .computeTangents() has been removed.');
  49072. },
  49073. computeLineDistances: function () {
  49074. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  49075. i > 0 && (e += t[i].distanceTo(t[i - 1])), (this.lineDistances[i] = e);
  49076. },
  49077. computeBoundingBox: function () {
  49078. null === this.boundingBox && (this.boundingBox = new n.Box3()),
  49079. this.boundingBox.setFromPoints(this.vertices);
  49080. },
  49081. computeBoundingSphere: function () {
  49082. null === this.boundingSphere && (this.boundingSphere = new n.Sphere()),
  49083. this.boundingSphere.setFromPoints(this.vertices);
  49084. },
  49085. merge: function (e, t, i) {
  49086. if (e instanceof n.Geometry == !1)
  49087. return void console.error(
  49088. 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.',
  49089. e
  49090. );
  49091. var r,
  49092. o = this.vertices.length,
  49093. a = this.vertices,
  49094. s = e.vertices,
  49095. l = this.faces,
  49096. c = e.faces,
  49097. h = this.faceVertexUvs[0],
  49098. u = e.faceVertexUvs[0];
  49099. void 0 === i && (i = 0), void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t));
  49100. for (var d = 0, p = s.length; d < p; d++) {
  49101. var f = s[d],
  49102. g = f.clone();
  49103. void 0 !== t && g.applyMatrix4(t), a.push(g);
  49104. }
  49105. for (d = 0, p = c.length; d < p; d++) {
  49106. var m,
  49107. v,
  49108. A,
  49109. y = c[d],
  49110. C = y.vertexNormals,
  49111. I = y.vertexColors;
  49112. (m = new n.Face3(y.a + o, y.b + o, y.c + o)),
  49113. m.normal.copy(y.normal),
  49114. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  49115. for (var E = 0, b = C.length; E < b; E++)
  49116. (v = C[E].clone()),
  49117. void 0 !== r && v.applyMatrix3(r).normalize(),
  49118. m.vertexNormals.push(v);
  49119. m.color.copy(y.color);
  49120. for (var E = 0, b = I.length; E < b; E++)
  49121. (A = I[E]), m.vertexColors.push(A.clone());
  49122. (m.materialIndex = y.materialIndex + i), l.push(m);
  49123. }
  49124. for (d = 0, p = u.length; d < p; d++) {
  49125. var w = u[d],
  49126. _ = [];
  49127. if (void 0 !== w) {
  49128. for (var E = 0, b = w.length; E < b; E++) _.push(w[E].clone());
  49129. h.push(_);
  49130. }
  49131. }
  49132. },
  49133. mergeMesh: function (e) {
  49134. return e instanceof n.Mesh == !1
  49135. ? void console.error(
  49136. 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.',
  49137. e
  49138. )
  49139. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix));
  49140. },
  49141. mergeVertices: function () {
  49142. var e,
  49143. t,
  49144. i,
  49145. n,
  49146. r,
  49147. o,
  49148. a,
  49149. s,
  49150. l = {},
  49151. c = [],
  49152. h = [],
  49153. u = 4,
  49154. d = Math.pow(10, u);
  49155. for (i = 0, n = this.vertices.length; i < n; i++)
  49156. (e = this.vertices[i]),
  49157. (t = Math.round(e.x * d) + '_' + Math.round(e.y * d) + '_' + Math.round(e.z * d)),
  49158. void 0 === l[t]
  49159. ? ((l[t] = i), c.push(this.vertices[i]), (h[i] = c.length - 1))
  49160. : (h[i] = h[l[t]]);
  49161. var p = [];
  49162. for (i = 0, n = this.faces.length; i < n; i++) {
  49163. (r = this.faces[i]),
  49164. (r.a = h[r.a]),
  49165. (r.b = h[r.b]),
  49166. (r.c = h[r.c]),
  49167. (o = [r.a, r.b, r.c]);
  49168. for (var f = -1, g = 0; g < 3; g++)
  49169. if (o[g] === o[(g + 1) % 3]) {
  49170. (f = g), p.push(i);
  49171. break;
  49172. }
  49173. }
  49174. for (i = p.length - 1; i >= 0; i--) {
  49175. var m = p[i];
  49176. for (this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++)
  49177. this.faceVertexUvs[a].splice(m, 1);
  49178. }
  49179. var v = this.vertices.length - c.length;
  49180. return (this.vertices = c), v;
  49181. },
  49182. sortFacesByMaterialIndex: function () {
  49183. function e(e, t) {
  49184. return e.materialIndex - t.materialIndex;
  49185. }
  49186. for (var t = this.faces, i = t.length, n = 0; n < i; n++) t[n]._id = n;
  49187. t.sort(e);
  49188. var r,
  49189. o,
  49190. a = this.faceVertexUvs[0],
  49191. s = this.faceVertexUvs[1];
  49192. a && a.length === i && (r = []), s && s.length === i && (o = []);
  49193. for (var n = 0; n < i; n++) {
  49194. var l = t[n]._id;
  49195. r && r.push(a[l]), o && o.push(s[l]);
  49196. }
  49197. r && (this.faceVertexUvs[0] = r), o && (this.faceVertexUvs[1] = o);
  49198. },
  49199. toJSON: function () {
  49200. function e(e, t, i) {
  49201. return i ? e | (1 << t) : e & ~(1 << t);
  49202. }
  49203. function t(e) {
  49204. var t = e.x.toString() + e.y.toString() + e.z.toString();
  49205. return void 0 !== d[t]
  49206. ? d[t]
  49207. : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t]);
  49208. }
  49209. function i(e) {
  49210. var t = e.r.toString() + e.g.toString() + e.b.toString();
  49211. return void 0 !== f[t] ? f[t] : ((f[t] = p.length), p.push(e.getHex()), f[t]);
  49212. }
  49213. function n(e) {
  49214. var t = e.x.toString() + e.y.toString();
  49215. return void 0 !== m[t] ? m[t] : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t]);
  49216. }
  49217. var r = {
  49218. metadata: {
  49219. version: 4.4,
  49220. type: 'Geometry',
  49221. generator: 'Geometry.toJSON',
  49222. },
  49223. };
  49224. if (
  49225. ((r.uuid = this.uuid),
  49226. (r.type = this.type),
  49227. '' !== this.name && (r.name = this.name),
  49228. void 0 !== this.parameters)
  49229. ) {
  49230. var o = this.parameters;
  49231. for (var a in o) void 0 !== o[a] && (r[a] = o[a]);
  49232. return r;
  49233. }
  49234. for (var s = [], l = 0; l < this.vertices.length; l++) {
  49235. var c = this.vertices[l];
  49236. s.push(c.x, c.y, c.z);
  49237. }
  49238. for (
  49239. var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0;
  49240. l < this.faces.length;
  49241. l++
  49242. ) {
  49243. var v = this.faces[l],
  49244. A = !0,
  49245. y = !1,
  49246. C = void 0 !== this.faceVertexUvs[0][l],
  49247. I = v.normal.length() > 0,
  49248. E = v.vertexNormals.length > 0,
  49249. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  49250. w = v.vertexColors.length > 0,
  49251. _ = 0;
  49252. if (
  49253. ((_ = e(_, 0, 0)),
  49254. (_ = e(_, 1, A)),
  49255. (_ = e(_, 2, y)),
  49256. (_ = e(_, 3, C)),
  49257. (_ = e(_, 4, I)),
  49258. (_ = e(_, 5, E)),
  49259. (_ = e(_, 6, b)),
  49260. (_ = e(_, 7, w)),
  49261. h.push(_),
  49262. h.push(v.a, v.b, v.c),
  49263. h.push(v.materialIndex),
  49264. C)
  49265. ) {
  49266. var T = this.faceVertexUvs[0][l];
  49267. h.push(n(T[0]), n(T[1]), n(T[2]));
  49268. }
  49269. if ((I && h.push(t(v.normal)), E)) {
  49270. var x = v.vertexNormals;
  49271. h.push(t(x[0]), t(x[1]), t(x[2]));
  49272. }
  49273. if ((b && h.push(i(v.color)), w)) {
  49274. var S = v.vertexColors;
  49275. h.push(i(S[0]), i(S[1]), i(S[2]));
  49276. }
  49277. }
  49278. return (
  49279. (r.data = {}),
  49280. (r.data.vertices = s),
  49281. (r.data.normals = u),
  49282. p.length > 0 && (r.data.colors = p),
  49283. g.length > 0 && (r.data.uvs = [g]),
  49284. (r.data.faces = h),
  49285. r
  49286. );
  49287. },
  49288. clone: function () {
  49289. return new n.Geometry().copy(this);
  49290. },
  49291. copy: function (e) {
  49292. (this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]]);
  49293. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  49294. this.vertices.push(t[i].clone());
  49295. for (var r = e.faces, i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone());
  49296. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  49297. var o = e.faceVertexUvs[i];
  49298. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  49299. for (var a = 0, s = o.length; a < s; a++) {
  49300. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  49301. var d = l[h];
  49302. c.push(d.clone());
  49303. }
  49304. this.faceVertexUvs[i].push(c);
  49305. }
  49306. }
  49307. return this;
  49308. },
  49309. dispose: function () {
  49310. this.dispatchEvent({
  49311. type: 'dispose',
  49312. });
  49313. },
  49314. }),
  49315. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  49316. (n.GeometryIdCount = 0),
  49317. (n.DirectGeometry = function () {
  49318. Object.defineProperty(this, 'id', {
  49319. value: n.GeometryIdCount++,
  49320. }),
  49321. (this.uuid = n.Math.generateUUID()),
  49322. (this.name = ''),
  49323. (this.type = 'DirectGeometry'),
  49324. (this.indices = []),
  49325. (this.vertices = []),
  49326. (this.normals = []),
  49327. (this.colors = []),
  49328. (this.uvs = []),
  49329. (this.uvs2 = []),
  49330. (this.groups = []),
  49331. (this.morphTargets = {}),
  49332. (this.skinWeights = []),
  49333. (this.skinIndices = []),
  49334. (this.boundingBox = null),
  49335. (this.boundingSphere = null),
  49336. (this.verticesNeedUpdate = !1),
  49337. (this.normalsNeedUpdate = !1),
  49338. (this.colorsNeedUpdate = !1),
  49339. (this.uvsNeedUpdate = !1),
  49340. (this.groupsNeedUpdate = !1);
  49341. }),
  49342. (n.DirectGeometry.prototype = {
  49343. constructor: n.DirectGeometry,
  49344. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  49345. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  49346. computeFaceNormals: function () {
  49347. console.warn(
  49348. 'THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.'
  49349. );
  49350. },
  49351. computeVertexNormals: function () {
  49352. console.warn(
  49353. 'THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.'
  49354. );
  49355. },
  49356. computeGroups: function (e) {
  49357. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  49358. var a = r[o];
  49359. a.materialIndex !== i &&
  49360. ((i = a.materialIndex),
  49361. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  49362. (t = {
  49363. start: 3 * o,
  49364. materialIndex: i,
  49365. }));
  49366. }
  49367. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n);
  49368. },
  49369. fromGeometry: function (e) {
  49370. var t,
  49371. i = e.faces,
  49372. r = e.vertices,
  49373. o = e.faceVertexUvs,
  49374. a = o[0] && o[0].length > 0,
  49375. s = o[1] && o[1].length > 0,
  49376. l = e.morphTargets,
  49377. c = l.length;
  49378. if (c > 0) {
  49379. t = [];
  49380. for (var h = 0; h < c; h++) t[h] = [];
  49381. this.morphTargets.position = t;
  49382. }
  49383. var u,
  49384. d = e.morphNormals,
  49385. p = d.length;
  49386. if (p > 0) {
  49387. u = [];
  49388. for (var h = 0; h < p; h++) u[h] = [];
  49389. this.morphTargets.normal = u;
  49390. }
  49391. for (
  49392. var f = e.skinIndices,
  49393. g = e.skinWeights,
  49394. m = f.length === r.length,
  49395. v = g.length === r.length,
  49396. h = 0;
  49397. h < i.length;
  49398. h++
  49399. ) {
  49400. var A = i[h];
  49401. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  49402. var y = A.vertexNormals;
  49403. if (3 === y.length) this.normals.push(y[0], y[1], y[2]);
  49404. else {
  49405. var C = A.normal;
  49406. this.normals.push(C, C, C);
  49407. }
  49408. var I = A.vertexColors;
  49409. if (3 === I.length) this.colors.push(I[0], I[1], I[2]);
  49410. else {
  49411. var E = A.color;
  49412. this.colors.push(E, E, E);
  49413. }
  49414. if (a === !0) {
  49415. var b = o[0][h];
  49416. void 0 !== b
  49417. ? this.uvs.push(b[0], b[1], b[2])
  49418. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', h),
  49419. this.uvs.push(new n.Vector2(), new n.Vector2(), new n.Vector2()));
  49420. }
  49421. if (s === !0) {
  49422. var b = o[1][h];
  49423. void 0 !== b
  49424. ? this.uvs2.push(b[0], b[1], b[2])
  49425. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', h),
  49426. this.uvs2.push(new n.Vector2(), new n.Vector2(), new n.Vector2()));
  49427. }
  49428. for (var w = 0; w < c; w++) {
  49429. var _ = l[w].vertices;
  49430. t[w].push(_[A.a], _[A.b], _[A.c]);
  49431. }
  49432. for (var w = 0; w < p; w++) {
  49433. var T = d[w].vertexNormals[h];
  49434. u[w].push(T.a, T.b, T.c);
  49435. }
  49436. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  49437. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c]);
  49438. }
  49439. return (
  49440. this.computeGroups(e),
  49441. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  49442. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  49443. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  49444. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  49445. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  49446. this
  49447. );
  49448. },
  49449. dispose: function () {
  49450. this.dispatchEvent({
  49451. type: 'dispose',
  49452. });
  49453. },
  49454. }),
  49455. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  49456. (n.BufferGeometry = function () {
  49457. Object.defineProperty(this, 'id', {
  49458. value: n.GeometryIdCount++,
  49459. }),
  49460. (this.uuid = n.Math.generateUUID()),
  49461. (this.name = ''),
  49462. (this.type = 'BufferGeometry'),
  49463. (this.index = null),
  49464. (this.attributes = {}),
  49465. (this.morphAttributes = {}),
  49466. (this.groups = []),
  49467. (this.boundingBox = null),
  49468. (this.boundingSphere = null),
  49469. (this.drawRange = {
  49470. start: 0,
  49471. count: 1 / 0,
  49472. });
  49473. }),
  49474. (n.BufferGeometry.prototype = {
  49475. constructor: n.BufferGeometry,
  49476. getIndex: function () {
  49477. return this.index;
  49478. },
  49479. setIndex: function (e) {
  49480. this.index = e;
  49481. },
  49482. addAttribute: function (e, t) {
  49483. return t instanceof n.BufferAttribute == !1 &&
  49484. t instanceof n.InterleavedBufferAttribute == !1
  49485. ? (console.warn(
  49486. 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'
  49487. ),
  49488. void this.addAttribute(e, new n.BufferAttribute(arguments[1], arguments[2])))
  49489. : 'index' === e
  49490. ? (console.warn(
  49491. 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'
  49492. ),
  49493. void this.setIndex(t))
  49494. : ((this.attributes[e] = t), this);
  49495. },
  49496. getAttribute: function (e) {
  49497. return this.attributes[e];
  49498. },
  49499. removeAttribute: function (e) {
  49500. return delete this.attributes[e], this;
  49501. },
  49502. addGroup: function (e, t, i) {
  49503. this.groups.push({
  49504. start: e,
  49505. count: t,
  49506. materialIndex: void 0 !== i ? i : 0,
  49507. });
  49508. },
  49509. clearGroups: function () {
  49510. this.groups = [];
  49511. },
  49512. setDrawRange: function (e, t) {
  49513. (this.drawRange.start = e), (this.drawRange.count = t);
  49514. },
  49515. applyMatrix: function (e) {
  49516. var t = this.attributes.position;
  49517. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0));
  49518. var i = this.attributes.normal;
  49519. if (void 0 !== i) {
  49520. var r = new n.Matrix3().getNormalMatrix(e);
  49521. r.applyToVector3Array(i.array), (i.needsUpdate = !0);
  49522. }
  49523. return (
  49524. null !== this.boundingBox && this.computeBoundingBox(),
  49525. null !== this.boundingSphere && this.computeBoundingSphere(),
  49526. this
  49527. );
  49528. },
  49529. rotateX: (function () {
  49530. var e;
  49531. return function (t) {
  49532. return (
  49533. void 0 === e && (e = new n.Matrix4()),
  49534. e.makeRotationX(t),
  49535. this.applyMatrix(e),
  49536. this
  49537. );
  49538. };
  49539. })(),
  49540. rotateY: (function () {
  49541. var e;
  49542. return function (t) {
  49543. return (
  49544. void 0 === e && (e = new n.Matrix4()),
  49545. e.makeRotationY(t),
  49546. this.applyMatrix(e),
  49547. this
  49548. );
  49549. };
  49550. })(),
  49551. rotateZ: (function () {
  49552. var e;
  49553. return function (t) {
  49554. return (
  49555. void 0 === e && (e = new n.Matrix4()),
  49556. e.makeRotationZ(t),
  49557. this.applyMatrix(e),
  49558. this
  49559. );
  49560. };
  49561. })(),
  49562. translate: (function () {
  49563. var e;
  49564. return function (t, i, r) {
  49565. return (
  49566. void 0 === e && (e = new n.Matrix4()),
  49567. e.makeTranslation(t, i, r),
  49568. this.applyMatrix(e),
  49569. this
  49570. );
  49571. };
  49572. })(),
  49573. scale: (function () {
  49574. var e;
  49575. return function (t, i, r) {
  49576. return (
  49577. void 0 === e && (e = new n.Matrix4()),
  49578. e.makeScale(t, i, r),
  49579. this.applyMatrix(e),
  49580. this
  49581. );
  49582. };
  49583. })(),
  49584. lookAt: (function () {
  49585. var e;
  49586. return function (t) {
  49587. void 0 === e && (e = new n.Object3D()),
  49588. e.lookAt(t),
  49589. e.updateMatrix(),
  49590. this.applyMatrix(e.matrix);
  49591. };
  49592. })(),
  49593. center: function () {
  49594. this.computeBoundingBox();
  49595. var e = this.boundingBox.center().negate();
  49596. return this.translate(e.x, e.y, e.z), e;
  49597. },
  49598. setFromObject: function (e) {
  49599. var t = e.geometry;
  49600. if (e instanceof n.Points || e instanceof n.Line) {
  49601. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  49602. r = new n.Float32Attribute(3 * t.colors.length, 3);
  49603. if (
  49604. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  49605. this.addAttribute('color', r.copyColorsArray(t.colors)),
  49606. t.lineDistances && t.lineDistances.length === t.vertices.length)
  49607. ) {
  49608. var o = new n.Float32Attribute(t.lineDistances.length, 1);
  49609. this.addAttribute('lineDistance', o.copyArray(t.lineDistances));
  49610. }
  49611. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  49612. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone());
  49613. } else e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  49614. return this;
  49615. },
  49616. updateFromObject: function (e) {
  49617. var t = e.geometry;
  49618. if (e instanceof n.Mesh) {
  49619. var i = t.__directGeometry;
  49620. if (void 0 === i) return this.fromGeometry(t);
  49621. (i.verticesNeedUpdate = t.verticesNeedUpdate),
  49622. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  49623. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  49624. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  49625. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  49626. (t.verticesNeedUpdate = !1),
  49627. (t.normalsNeedUpdate = !1),
  49628. (t.colorsNeedUpdate = !1),
  49629. (t.uvsNeedUpdate = !1),
  49630. (t.groupsNeedUpdate = !1),
  49631. (t = i);
  49632. }
  49633. if (t.verticesNeedUpdate === !0) {
  49634. var r = this.attributes.position;
  49635. void 0 !== r && (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)),
  49636. (t.verticesNeedUpdate = !1);
  49637. }
  49638. if (t.normalsNeedUpdate === !0) {
  49639. var r = this.attributes.normal;
  49640. void 0 !== r && (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)),
  49641. (t.normalsNeedUpdate = !1);
  49642. }
  49643. if (t.colorsNeedUpdate === !0) {
  49644. var r = this.attributes.color;
  49645. void 0 !== r && (r.copyColorsArray(t.colors), (r.needsUpdate = !0)),
  49646. (t.colorsNeedUpdate = !1);
  49647. }
  49648. if (t.uvsNeedUpdate) {
  49649. var r = this.attributes.uv;
  49650. void 0 !== r && (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)),
  49651. (t.uvsNeedUpdate = !1);
  49652. }
  49653. if (t.lineDistancesNeedUpdate) {
  49654. var r = this.attributes.lineDistance;
  49655. void 0 !== r && (r.copyArray(t.lineDistances), (r.needsUpdate = !0)),
  49656. (t.lineDistancesNeedUpdate = !1);
  49657. }
  49658. return (
  49659. t.groupsNeedUpdate &&
  49660. (t.computeGroups(e.geometry),
  49661. (this.groups = t.groups),
  49662. (t.groupsNeedUpdate = !1)),
  49663. this
  49664. );
  49665. },
  49666. fromGeometry: function (e) {
  49667. return (
  49668. (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)),
  49669. this.fromDirectGeometry(e.__directGeometry)
  49670. );
  49671. },
  49672. fromDirectGeometry: function (e) {
  49673. var t = new Float32Array(3 * e.vertices.length);
  49674. if (
  49675. (this.addAttribute(
  49676. 'position',
  49677. new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)
  49678. ),
  49679. e.normals.length > 0)
  49680. ) {
  49681. var i = new Float32Array(3 * e.normals.length);
  49682. this.addAttribute(
  49683. 'normal',
  49684. new n.BufferAttribute(i, 3).copyVector3sArray(e.normals)
  49685. );
  49686. }
  49687. if (e.colors.length > 0) {
  49688. var r = new Float32Array(3 * e.colors.length);
  49689. this.addAttribute('color', new n.BufferAttribute(r, 3).copyColorsArray(e.colors));
  49690. }
  49691. if (e.uvs.length > 0) {
  49692. var o = new Float32Array(2 * e.uvs.length);
  49693. this.addAttribute('uv', new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs));
  49694. }
  49695. if (e.uvs2.length > 0) {
  49696. var a = new Float32Array(2 * e.uvs2.length);
  49697. this.addAttribute('uv2', new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2));
  49698. }
  49699. if (e.indices.length > 0) {
  49700. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  49701. l = new s(3 * e.indices.length);
  49702. this.setIndex(new n.BufferAttribute(l, 1).copyIndicesArray(e.indices));
  49703. }
  49704. this.groups = e.groups;
  49705. for (var c in e.morphTargets) {
  49706. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  49707. var f = u[d],
  49708. g = new n.Float32Attribute(3 * f.length, 3);
  49709. h.push(g.copyVector3sArray(f));
  49710. }
  49711. this.morphAttributes[c] = h;
  49712. }
  49713. if (e.skinIndices.length > 0) {
  49714. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4);
  49715. this.addAttribute('skinIndex', m.copyVector4sArray(e.skinIndices));
  49716. }
  49717. if (e.skinWeights.length > 0) {
  49718. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4);
  49719. this.addAttribute('skinWeight', v.copyVector4sArray(e.skinWeights));
  49720. }
  49721. return (
  49722. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  49723. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  49724. this
  49725. );
  49726. },
  49727. computeBoundingBox: (function () {
  49728. new n.Vector3();
  49729. return function () {
  49730. null === this.boundingBox && (this.boundingBox = new n.Box3());
  49731. var e = this.attributes.position.array;
  49732. e && this.boundingBox.setFromArray(e),
  49733. (void 0 !== e && 0 !== e.length) ||
  49734. (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  49735. (isNaN(this.boundingBox.min.x) ||
  49736. isNaN(this.boundingBox.min.y) ||
  49737. isNaN(this.boundingBox.min.z)) &&
  49738. console.error(
  49739. 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
  49740. this
  49741. );
  49742. };
  49743. })(),
  49744. computeBoundingSphere: (function () {
  49745. var e = new n.Box3(),
  49746. t = new n.Vector3();
  49747. return function () {
  49748. null === this.boundingSphere && (this.boundingSphere = new n.Sphere());
  49749. var i = this.attributes.position.array;
  49750. if (i) {
  49751. var r = this.boundingSphere.center;
  49752. e.setFromArray(i), e.center(r);
  49753. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  49754. t.fromArray(i, a), (o = Math.max(o, r.distanceToSquared(t)));
  49755. (this.boundingSphere.radius = Math.sqrt(o)),
  49756. isNaN(this.boundingSphere.radius) &&
  49757. console.error(
  49758. 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
  49759. this
  49760. );
  49761. }
  49762. };
  49763. })(),
  49764. computeFaceNormals: function () {},
  49765. computeVertexNormals: function () {
  49766. var e = this.index,
  49767. t = this.attributes,
  49768. i = this.groups;
  49769. if (t.position) {
  49770. var r = t.position.array;
  49771. if (void 0 === t.normal)
  49772. this.addAttribute('normal', new n.BufferAttribute(new Float32Array(r.length), 3));
  49773. else for (var o = t.normal.array, a = 0, s = o.length; a < s; a++) o[a] = 0;
  49774. var l,
  49775. c,
  49776. h,
  49777. u = t.normal.array,
  49778. d = new n.Vector3(),
  49779. p = new n.Vector3(),
  49780. f = new n.Vector3(),
  49781. g = new n.Vector3(),
  49782. m = new n.Vector3();
  49783. if (e) {
  49784. var v = e.array;
  49785. 0 === i.length && this.addGroup(0, v.length);
  49786. for (var A = 0, y = i.length; A < y; ++A)
  49787. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  49788. (l = 3 * v[a + 0]),
  49789. (c = 3 * v[a + 1]),
  49790. (h = 3 * v[a + 2]),
  49791. d.fromArray(r, l),
  49792. p.fromArray(r, c),
  49793. f.fromArray(r, h),
  49794. g.subVectors(f, p),
  49795. m.subVectors(d, p),
  49796. g.cross(m),
  49797. (u[l] += g.x),
  49798. (u[l + 1] += g.y),
  49799. (u[l + 2] += g.z),
  49800. (u[c] += g.x),
  49801. (u[c + 1] += g.y),
  49802. (u[c + 2] += g.z),
  49803. (u[h] += g.x),
  49804. (u[h + 1] += g.y),
  49805. (u[h + 2] += g.z);
  49806. } else
  49807. for (var a = 0, s = r.length; a < s; a += 9)
  49808. d.fromArray(r, a),
  49809. p.fromArray(r, a + 3),
  49810. f.fromArray(r, a + 6),
  49811. g.subVectors(f, p),
  49812. m.subVectors(d, p),
  49813. g.cross(m),
  49814. (u[a] = g.x),
  49815. (u[a + 1] = g.y),
  49816. (u[a + 2] = g.z),
  49817. (u[a + 3] = g.x),
  49818. (u[a + 4] = g.y),
  49819. (u[a + 5] = g.z),
  49820. (u[a + 6] = g.x),
  49821. (u[a + 7] = g.y),
  49822. (u[a + 8] = g.z);
  49823. this.normalizeNormals(), (t.normal.needsUpdate = !0);
  49824. }
  49825. },
  49826. merge: function (e, t) {
  49827. if (e instanceof n.BufferGeometry == !1)
  49828. return void console.error(
  49829. 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.',
  49830. e
  49831. );
  49832. void 0 === t && (t = 0);
  49833. var i = this.attributes;
  49834. for (var r in i)
  49835. if (void 0 !== e.attributes[r])
  49836. for (
  49837. var o = i[r],
  49838. a = o.array,
  49839. s = e.attributes[r],
  49840. l = s.array,
  49841. c = s.itemSize,
  49842. h = 0,
  49843. u = c * t;
  49844. h < l.length;
  49845. h++, u++
  49846. )
  49847. a[u] = l[h];
  49848. return this;
  49849. },
  49850. normalizeNormals: function () {
  49851. for (
  49852. var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length;
  49853. o < a;
  49854. o += 3
  49855. )
  49856. (e = r[o]),
  49857. (t = r[o + 1]),
  49858. (i = r[o + 2]),
  49859. (n = 1 / Math.sqrt(e * e + t * t + i * i)),
  49860. (r[o] *= n),
  49861. (r[o + 1] *= n),
  49862. (r[o + 2] *= n);
  49863. },
  49864. toNonIndexed: function () {
  49865. if (null === this.index)
  49866. return (
  49867. console.warn(
  49868. 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'
  49869. ),
  49870. this
  49871. );
  49872. var e = new n.BufferGeometry(),
  49873. t = this.index.array,
  49874. i = this.attributes;
  49875. for (var r in i) {
  49876. for (
  49877. var o = i[r],
  49878. a = o.array,
  49879. s = o.itemSize,
  49880. l = new a.constructor(t.length * s),
  49881. c = 0,
  49882. h = 0,
  49883. u = 0,
  49884. d = t.length;
  49885. u < d;
  49886. u++
  49887. ) {
  49888. c = t[u] * s;
  49889. for (var p = 0; p < s; p++) l[h++] = a[c++];
  49890. }
  49891. e.addAttribute(r, new n.BufferAttribute(l, s));
  49892. }
  49893. return e;
  49894. },
  49895. toJSON: function () {
  49896. var e = {
  49897. metadata: {
  49898. version: 4.4,
  49899. type: 'BufferGeometry',
  49900. generator: 'BufferGeometry.toJSON',
  49901. },
  49902. };
  49903. if (
  49904. ((e.uuid = this.uuid),
  49905. (e.type = this.type),
  49906. '' !== this.name && (e.name = this.name),
  49907. void 0 !== this.parameters)
  49908. ) {
  49909. var t = this.parameters;
  49910. for (var i in t) void 0 !== t[i] && (e[i] = t[i]);
  49911. return e;
  49912. }
  49913. e.data = {
  49914. attributes: {},
  49915. };
  49916. var n = this.index;
  49917. if (null !== n) {
  49918. var r = Array.prototype.slice.call(n.array);
  49919. e.data.index = {
  49920. type: n.array.constructor.name,
  49921. array: r,
  49922. };
  49923. }
  49924. var o = this.attributes;
  49925. for (var i in o) {
  49926. var a = o[i],
  49927. r = Array.prototype.slice.call(a.array);
  49928. e.data.attributes[i] = {
  49929. itemSize: a.itemSize,
  49930. type: a.array.constructor.name,
  49931. array: r,
  49932. };
  49933. }
  49934. var s = this.groups;
  49935. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  49936. var l = this.boundingSphere;
  49937. return (
  49938. null !== l &&
  49939. (e.data.boundingSphere = {
  49940. center: l.center.toArray(),
  49941. radius: l.radius,
  49942. }),
  49943. e
  49944. );
  49945. },
  49946. clone: function () {
  49947. return new n.BufferGeometry().copy(this);
  49948. },
  49949. copy: function (e) {
  49950. var t = e.index;
  49951. null !== t && this.setIndex(t.clone());
  49952. var i = e.attributes;
  49953. for (var n in i) {
  49954. var r = i[n];
  49955. this.addAttribute(n, r.clone());
  49956. }
  49957. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  49958. var l = o[a];
  49959. this.addGroup(l.start, l.count);
  49960. }
  49961. return this;
  49962. },
  49963. dispose: function () {
  49964. this.dispatchEvent({
  49965. type: 'dispose',
  49966. });
  49967. },
  49968. }),
  49969. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  49970. (n.BufferGeometry.MaxIndex = 65535),
  49971. (n.InstancedBufferGeometry = function () {
  49972. n.BufferGeometry.call(this),
  49973. (this.type = 'InstancedBufferGeometry'),
  49974. (this.maxInstancedCount = void 0);
  49975. }),
  49976. (n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  49977. (n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry),
  49978. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  49979. this.groups.push({
  49980. start: e,
  49981. count: t,
  49982. instances: i,
  49983. });
  49984. }),
  49985. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  49986. var t = e.index;
  49987. null !== t && this.setIndex(t.clone());
  49988. var i = e.attributes;
  49989. for (var n in i) {
  49990. var r = i[n];
  49991. this.addAttribute(n, r.clone());
  49992. }
  49993. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  49994. var l = o[a];
  49995. this.addGroup(l.start, l.count, l.instances);
  49996. }
  49997. return this;
  49998. }),
  49999. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  50000. (n.Uniform = function (e, t) {
  50001. (this.type = e), (this.value = t), (this.dynamic = !1);
  50002. }),
  50003. (n.Uniform.prototype = {
  50004. constructor: n.Uniform,
  50005. onUpdate: function (e) {
  50006. return (this.dynamic = !0), (this.onUpdateCallback = e), this;
  50007. },
  50008. }),
  50009. (n.AnimationClip = function (e, t, i) {
  50010. (this.name = e || n.Math.generateUUID()),
  50011. (this.tracks = i),
  50012. (this.duration = void 0 !== t ? t : -1),
  50013. this.duration < 0 && this.resetDuration(),
  50014. this.trim(),
  50015. this.optimize();
  50016. }),
  50017. (n.AnimationClip.prototype = {
  50018. constructor: n.AnimationClip,
  50019. resetDuration: function () {
  50020. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  50021. var r = this.tracks[i];
  50022. t = Math.max(t, r.times[r.times.length - 1]);
  50023. }
  50024. this.duration = t;
  50025. },
  50026. trim: function () {
  50027. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration);
  50028. return this;
  50029. },
  50030. optimize: function () {
  50031. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize();
  50032. return this;
  50033. },
  50034. }),
  50035. Object.assign(n.AnimationClip, {
  50036. parse: function (e) {
  50037. for (
  50038. var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length;
  50039. o !== a;
  50040. ++o
  50041. )
  50042. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  50043. return new n.AnimationClip(e.name, e.duration, t);
  50044. },
  50045. toJSON: function (e) {
  50046. for (
  50047. var t = [],
  50048. i = e.tracks,
  50049. r = {
  50050. name: e.name,
  50051. duration: e.duration,
  50052. tracks: t,
  50053. },
  50054. o = 0,
  50055. a = i.length;
  50056. o !== a;
  50057. ++o
  50058. )
  50059. t.push(n.KeyframeTrack.toJSON(i[o]));
  50060. return r;
  50061. },
  50062. CreateFromMorphTargetSequence: function (e, t, i) {
  50063. for (var r = t.length, o = [], a = 0; a < r; a++) {
  50064. var s = [],
  50065. l = [];
  50066. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0);
  50067. var c = n.AnimationUtils.getKeyframeOrder(s);
  50068. (s = n.AnimationUtils.sortedArray(s, 1, c)),
  50069. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  50070. 0 === s[0] && (s.push(r), l.push(l[0])),
  50071. o.push(
  50072. new n.NumberKeyframeTrack(
  50073. '.morphTargetInfluences[' + t[a].name + ']',
  50074. s,
  50075. l
  50076. ).scale(1 / i)
  50077. );
  50078. }
  50079. return new n.AnimationClip(e, -1, o);
  50080. },
  50081. findByName: function (e, t) {
  50082. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i];
  50083. return null;
  50084. },
  50085. CreateClipsFromMorphTargetSequences: function (e, t) {
  50086. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  50087. var s = e[o],
  50088. l = s.name.match(r);
  50089. if (l && l.length > 1) {
  50090. var c = l[1],
  50091. h = i[c];
  50092. h || (i[c] = h = []), h.push(s);
  50093. }
  50094. }
  50095. var u = [];
  50096. for (var c in i) u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  50097. return u;
  50098. },
  50099. parseAnimation: function (e, t, i) {
  50100. if (!e) return console.error(' no animation in JSONLoader data'), null;
  50101. for (
  50102. var r = function (e, t, i, r, o) {
  50103. if (0 !== i.length) {
  50104. var a = [],
  50105. s = [];
  50106. n.AnimationUtils.flattenJSON(i, a, s, r),
  50107. 0 !== a.length && o.push(new e(t, a, s));
  50108. }
  50109. },
  50110. o = [],
  50111. a = e.name || 'default',
  50112. s = e.length || -1,
  50113. l = e.fps || 30,
  50114. c = e.hierarchy || [],
  50115. h = 0;
  50116. h < c.length;
  50117. h++
  50118. ) {
  50119. var u = c[h].keys;
  50120. if (u && 0 != u.length)
  50121. if (u[0].morphTargets) {
  50122. for (var d = {}, p = 0; p < u.length; p++)
  50123. if (u[p].morphTargets)
  50124. for (var f = 0; f < u[p].morphTargets.length; f++)
  50125. d[u[p].morphTargets[f]] = -1;
  50126. for (var g in d) {
  50127. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  50128. var A = u[p];
  50129. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0);
  50130. }
  50131. o.push(new n.NumberKeyframeTrack('.morphTargetInfluence[' + g + ']', m, v));
  50132. }
  50133. s = d.length * (l || 1);
  50134. } else {
  50135. var y = '.bones[' + t[h].name + ']';
  50136. r(n.VectorKeyframeTrack, y + '.position', u, 'pos', o),
  50137. r(n.QuaternionKeyframeTrack, y + '.quaternion', u, 'rot', o),
  50138. r(n.VectorKeyframeTrack, y + '.scale', u, 'scl', o);
  50139. }
  50140. }
  50141. if (0 === o.length) return null;
  50142. var C = new n.AnimationClip(a, s, o);
  50143. return C;
  50144. },
  50145. }),
  50146. (n.AnimationMixer = function (e) {
  50147. (this._root = e),
  50148. this._initMemoryManager(),
  50149. (this._accuIndex = 0),
  50150. (this.time = 0),
  50151. (this.timeScale = 1);
  50152. }),
  50153. (n.AnimationMixer.prototype = {
  50154. constructor: n.AnimationMixer,
  50155. clipAction: function (e, t) {
  50156. var i,
  50157. r = t || this._root,
  50158. o = r.uuid,
  50159. a = 'string' == typeof e ? e : e.name,
  50160. s = e !== a ? e : null,
  50161. l = this._actionsByClip[a];
  50162. if (void 0 !== l) {
  50163. var c = l.actionByRoot[o];
  50164. if (void 0 !== c) return c;
  50165. if (((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s))
  50166. throw new Error('Different clips with the same name detected!');
  50167. }
  50168. if (null === s) return null;
  50169. var h = new n.AnimationMixer._Action(this, s, t);
  50170. return this._bindAction(h, i), this._addInactiveAction(h, a, o), h;
  50171. },
  50172. existingAction: function (e, t) {
  50173. var i = t || this._root,
  50174. n = i.uuid,
  50175. r = 'string' == typeof e ? e : e.name,
  50176. o = this._actionsByClip[r];
  50177. return void 0 !== o ? o.actionByRoot[n] || null : null;
  50178. },
  50179. stopAllAction: function () {
  50180. var e = this._actions,
  50181. t = this._nActiveActions,
  50182. i = this._bindings,
  50183. n = this._nActiveBindings;
  50184. (this._nActiveActions = 0), (this._nActiveBindings = 0);
  50185. for (var r = 0; r !== t; ++r) e[r].reset();
  50186. for (var r = 0; r !== n; ++r) i[r].useCount = 0;
  50187. return this;
  50188. },
  50189. update: function (e) {
  50190. e *= this.timeScale;
  50191. for (
  50192. var t = this._actions,
  50193. i = this._nActiveActions,
  50194. n = (this.time += e),
  50195. r = Math.sign(e),
  50196. o = (this._accuIndex ^= 1),
  50197. a = 0;
  50198. a !== i;
  50199. ++a
  50200. ) {
  50201. var s = t[a];
  50202. s.enabled && s._update(n, e, r, o);
  50203. }
  50204. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  50205. l[a].apply(o);
  50206. return this;
  50207. },
  50208. getRoot: function () {
  50209. return this._root;
  50210. },
  50211. uncacheClip: function (e) {
  50212. var t = this._actions,
  50213. i = e.name,
  50214. n = this._actionsByClip,
  50215. r = n[i];
  50216. if (void 0 !== r) {
  50217. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  50218. var l = o[a];
  50219. this._deactivateAction(l);
  50220. var c = l._cacheIndex,
  50221. h = t[t.length - 1];
  50222. (l._cacheIndex = null),
  50223. (l._byClipCacheIndex = null),
  50224. (h._cacheIndex = c),
  50225. (t[c] = h),
  50226. t.pop(),
  50227. this._removeInactiveBindingsForAction(l);
  50228. }
  50229. delete n[i];
  50230. }
  50231. },
  50232. uncacheRoot: function (e) {
  50233. var t = e.uuid,
  50234. i = this._actionsByClip;
  50235. for (var n in i) {
  50236. var r = i[n].actionByRoot,
  50237. o = r[t];
  50238. void 0 !== o && (this._deactivateAction(o), this._removeInactiveAction(o));
  50239. }
  50240. var a = this._bindingsByRootAndName,
  50241. s = a[t];
  50242. if (void 0 !== s)
  50243. for (var l in s) {
  50244. var c = s[l];
  50245. c.restoreOriginalState(), this._removeInactiveBinding(c);
  50246. }
  50247. },
  50248. uncacheAction: function (e, t) {
  50249. var i = this.existingAction(e, t);
  50250. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i));
  50251. },
  50252. }),
  50253. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  50254. (n.AnimationMixer._Action = function (e, t, i) {
  50255. (this._mixer = e), (this._clip = t), (this._localRoot = i || null);
  50256. for (
  50257. var r = t.tracks,
  50258. o = r.length,
  50259. a = new Array(o),
  50260. s = {
  50261. endingStart: n.ZeroCurvatureEnding,
  50262. endingEnd: n.ZeroCurvatureEnding,
  50263. },
  50264. l = 0;
  50265. l !== o;
  50266. ++l
  50267. ) {
  50268. var c = r[l].createInterpolant(null);
  50269. (a[l] = c), (c.settings = s);
  50270. }
  50271. (this._interpolantSettings = s),
  50272. (this._interpolants = a),
  50273. (this._propertyBindings = new Array(o)),
  50274. (this._cacheIndex = null),
  50275. (this._byClipCacheIndex = null),
  50276. (this._timeScaleInterpolant = null),
  50277. (this._weightInterpolant = null),
  50278. (this.loop = n.LoopRepeat),
  50279. (this._loopCount = -1),
  50280. (this._startTime = null),
  50281. (this.time = 0),
  50282. (this.timeScale = 1),
  50283. (this._effectiveTimeScale = 1),
  50284. (this.weight = 1),
  50285. (this._effectiveWeight = 1),
  50286. (this.repetitions = 1 / 0),
  50287. (this.paused = !1),
  50288. (this.enabled = !0),
  50289. (this.clampWhenFinished = !1),
  50290. (this.zeroSlopeAtStart = !0),
  50291. (this.zeroSlopeAtEnd = !0);
  50292. }),
  50293. (n.AnimationMixer._Action.prototype = {
  50294. constructor: n.AnimationMixer._Action,
  50295. play: function () {
  50296. return this._mixer._activateAction(this), this;
  50297. },
  50298. stop: function () {
  50299. return this._mixer._deactivateAction(this), this.reset();
  50300. },
  50301. reset: function () {
  50302. return (
  50303. (this.paused = !1),
  50304. (this.enabled = !0),
  50305. (this.time = 0),
  50306. (this._loopCount = -1),
  50307. (this._startTime = null),
  50308. this.stopFading().stopWarping()
  50309. );
  50310. },
  50311. isRunning: function () {
  50312. this._startTime;
  50313. return (
  50314. this.enabled &&
  50315. !this.paused &&
  50316. 0 !== this.timeScale &&
  50317. null === this._startTime &&
  50318. this._mixer._isActiveAction(this)
  50319. );
  50320. },
  50321. isScheduled: function () {
  50322. return this._mixer._isActiveAction(this);
  50323. },
  50324. startAt: function (e) {
  50325. return (this._startTime = e), this;
  50326. },
  50327. setLoop: function (e, t) {
  50328. return (this.loop = e), (this.repetitions = t), this;
  50329. },
  50330. setEffectiveWeight: function (e) {
  50331. return (
  50332. (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  50333. );
  50334. },
  50335. getEffectiveWeight: function () {
  50336. return this._effectiveWeight;
  50337. },
  50338. fadeIn: function (e) {
  50339. return this._scheduleFading(e, 0, 1);
  50340. },
  50341. fadeOut: function (e) {
  50342. return this._scheduleFading(e, 1, 0);
  50343. },
  50344. crossFadeFrom: function (e, t, i) {
  50345. this._mixer;
  50346. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  50347. var n = this._clip.duration,
  50348. r = e._clip.duration,
  50349. o = r / n,
  50350. a = n / r;
  50351. e.warp(1, o, t), this.warp(a, 1, t);
  50352. }
  50353. return this;
  50354. },
  50355. crossFadeTo: function (e, t, i) {
  50356. return e.crossFadeFrom(this, t, i);
  50357. },
  50358. stopFading: function () {
  50359. var e = this._weightInterpolant;
  50360. return (
  50361. null !== e &&
  50362. ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50363. this
  50364. );
  50365. },
  50366. setEffectiveTimeScale: function (e) {
  50367. return (
  50368. (this.timeScale = e),
  50369. (this._effectiveTimeScale = this.paused ? 0 : e),
  50370. this.stopWarping()
  50371. );
  50372. },
  50373. getEffectiveTimeScale: function () {
  50374. return this._effectiveTimeScale;
  50375. },
  50376. setDuration: function (e) {
  50377. return (this.timeScale = this._clip.duration / e), this.stopWarping();
  50378. },
  50379. syncWith: function (e) {
  50380. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping();
  50381. },
  50382. halt: function (e) {
  50383. return this.warp(this._currentTimeScale, 0, e);
  50384. },
  50385. warp: function (e, t, i) {
  50386. var n = this._mixer,
  50387. r = n.time,
  50388. o = this._timeScaleInterpolant,
  50389. a = this.timeScale;
  50390. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o));
  50391. var s = o.parameterPositions,
  50392. l = o.sampleValues;
  50393. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this;
  50394. },
  50395. stopWarping: function () {
  50396. var e = this._timeScaleInterpolant;
  50397. return (
  50398. null !== e &&
  50399. ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50400. this
  50401. );
  50402. },
  50403. getMixer: function () {
  50404. return this._mixer;
  50405. },
  50406. getClip: function () {
  50407. return this._clip;
  50408. },
  50409. getRoot: function () {
  50410. return this._localRoot || this._mixer._root;
  50411. },
  50412. _update: function (e, t, i, n) {
  50413. var r = this._startTime;
  50414. if (null !== r) {
  50415. var o = (e - r) * i;
  50416. if (o < 0 || 0 === i) return;
  50417. (this._startTime = null), (t = i * o);
  50418. }
  50419. t *= this._updateTimeScale(e);
  50420. var a = this._updateTime(t),
  50421. s = this._updateWeight(e);
  50422. if (s > 0)
  50423. for (
  50424. var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length;
  50425. h !== u;
  50426. ++h
  50427. )
  50428. l[h].evaluate(a), c[h].accumulate(n, s);
  50429. },
  50430. _updateWeight: function (e) {
  50431. var t = 0;
  50432. if (this.enabled) {
  50433. t = this.weight;
  50434. var i = this._weightInterpolant;
  50435. if (null !== i) {
  50436. var n = i.evaluate(e)[0];
  50437. (t *= n),
  50438. e > i.parameterPositions[1] &&
  50439. (this.stopFading(), 0 === n && (this.enabled = !1));
  50440. }
  50441. }
  50442. return (this._effectiveWeight = t), t;
  50443. },
  50444. _updateTimeScale: function (e) {
  50445. var t = 0;
  50446. if (!this.paused) {
  50447. t = this.timeScale;
  50448. var i = this._timeScaleInterpolant;
  50449. if (null !== i) {
  50450. var n = i.evaluate(e)[0];
  50451. (t *= n),
  50452. e > i.parameterPositions[1] &&
  50453. (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t));
  50454. }
  50455. }
  50456. return (this._effectiveTimeScale = t), t;
  50457. },
  50458. _updateTime: function (e) {
  50459. var t = this.time + e;
  50460. if (0 === e) return t;
  50461. var i = this._clip.duration,
  50462. r = this.loop,
  50463. o = this._loopCount,
  50464. a = !1;
  50465. switch (r) {
  50466. case n.LoopOnce:
  50467. if ((o === -1 && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), t >= i))
  50468. t = i;
  50469. else {
  50470. if (!(t < 0)) break;
  50471. t = 0;
  50472. }
  50473. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  50474. this._mixer.dispatchEvent({
  50475. type: 'finished',
  50476. action: this,
  50477. direction: e < 0 ? -1 : 1,
  50478. });
  50479. break;
  50480. case n.LoopPingPong:
  50481. a = !0;
  50482. case n.LoopRepeat:
  50483. if (
  50484. (o === -1 &&
  50485. (e > 0
  50486. ? ((o = 0), this._setEndings(!0, 0 === this.repetitions, a))
  50487. : this._setEndings(0 === this.repetitions, !0, a)),
  50488. t >= i || t < 0)
  50489. ) {
  50490. var s = Math.floor(t / i);
  50491. (t -= i * s), (o += Math.abs(s));
  50492. var l = this.repetitions - o;
  50493. if (l < 0) {
  50494. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  50495. (t = e > 0 ? i : 0),
  50496. this._mixer.dispatchEvent({
  50497. type: 'finished',
  50498. action: this,
  50499. direction: e > 0 ? 1 : -1,
  50500. });
  50501. break;
  50502. }
  50503. if (0 === l) {
  50504. var c = e < 0;
  50505. this._setEndings(c, !c, a);
  50506. } else this._setEndings(!1, !1, a);
  50507. (this._loopCount = o),
  50508. this._mixer.dispatchEvent({
  50509. type: 'loop',
  50510. action: this,
  50511. loopDelta: s,
  50512. });
  50513. }
  50514. if (r === n.LoopPingPong && 1 === (1 & o)) return (this.time = t), i - t;
  50515. }
  50516. return (this.time = t), t;
  50517. },
  50518. _setEndings: function (e, t, i) {
  50519. var r = this._interpolantSettings;
  50520. i
  50521. ? ((r.endingStart = n.ZeroSlopeEnding), (r.endingEnd = n.ZeroSlopeEnding))
  50522. : (e
  50523. ? (r.endingStart = this.zeroSlopeAtStart
  50524. ? n.ZeroSlopeEnding
  50525. : n.ZeroCurvatureEnding)
  50526. : (r.endingStart = n.WrapAroundEnding),
  50527. t
  50528. ? (r.endingEnd = this.zeroSlopeAtEnd
  50529. ? n.ZeroSlopeEnding
  50530. : n.ZeroCurvatureEnding)
  50531. : (r.endingEnd = n.WrapAroundEnding));
  50532. },
  50533. _scheduleFading: function (e, t, i) {
  50534. var n = this._mixer,
  50535. r = n.time,
  50536. o = this._weightInterpolant;
  50537. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o));
  50538. var a = o.parameterPositions,
  50539. s = o.sampleValues;
  50540. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this;
  50541. },
  50542. }),
  50543. Object.assign(n.AnimationMixer.prototype, {
  50544. _bindAction: function (e, t) {
  50545. var i = e._localRoot || this._root,
  50546. r = e._clip.tracks,
  50547. o = r.length,
  50548. a = e._propertyBindings,
  50549. s = e._interpolants,
  50550. l = i.uuid,
  50551. c = this._bindingsByRootAndName,
  50552. h = c[l];
  50553. void 0 === h && ((h = {}), (c[l] = h));
  50554. for (var u = 0; u !== o; ++u) {
  50555. var d = r[u],
  50556. p = d.name,
  50557. f = h[p];
  50558. if (void 0 !== f) a[u] = f;
  50559. else {
  50560. if (((f = a[u]), void 0 !== f)) {
  50561. null === f._cacheIndex &&
  50562. (++f.referenceCount, this._addInactiveBinding(f, l, p));
  50563. continue;
  50564. }
  50565. var g = t && t._propertyBindings[u].binding.parsedPath;
  50566. (f = new n.PropertyMixer(
  50567. n.PropertyBinding.create(i, p, g),
  50568. d.ValueTypeName,
  50569. d.getValueSize()
  50570. )),
  50571. ++f.referenceCount,
  50572. this._addInactiveBinding(f, l, p),
  50573. (a[u] = f);
  50574. }
  50575. s[u].resultBuffer = f.buffer;
  50576. }
  50577. },
  50578. _activateAction: function (e) {
  50579. if (!this._isActiveAction(e)) {
  50580. if (null === e._cacheIndex) {
  50581. var t = (e._localRoot || this._root).uuid,
  50582. i = e._clip.name,
  50583. n = this._actionsByClip[i];
  50584. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t);
  50585. }
  50586. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  50587. var s = r[o];
  50588. 0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState());
  50589. }
  50590. this._lendAction(e);
  50591. }
  50592. },
  50593. _deactivateAction: function (e) {
  50594. if (this._isActiveAction(e)) {
  50595. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50596. var r = t[i];
  50597. 0 === --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r));
  50598. }
  50599. this._takeBackAction(e);
  50600. }
  50601. },
  50602. _initMemoryManager: function () {
  50603. (this._actions = []),
  50604. (this._nActiveActions = 0),
  50605. (this._actionsByClip = {}),
  50606. (this._bindings = []),
  50607. (this._nActiveBindings = 0),
  50608. (this._bindingsByRootAndName = {}),
  50609. (this._controlInterpolants = []),
  50610. (this._nActiveControlInterpolants = 0);
  50611. var e = this;
  50612. this.stats = {
  50613. actions: {
  50614. get total() {
  50615. return e._actions.length;
  50616. },
  50617. get inUse() {
  50618. return e._nActiveActions;
  50619. },
  50620. },
  50621. bindings: {
  50622. get total() {
  50623. return e._bindings.length;
  50624. },
  50625. get inUse() {
  50626. return e._nActiveBindings;
  50627. },
  50628. },
  50629. controlInterpolants: {
  50630. get total() {
  50631. return e._controlInterpolants.length;
  50632. },
  50633. get inUse() {
  50634. return e._nActiveControlInterpolants;
  50635. },
  50636. },
  50637. };
  50638. },
  50639. _isActiveAction: function (e) {
  50640. var t = e._cacheIndex;
  50641. return null !== t && t < this._nActiveActions;
  50642. },
  50643. _addInactiveAction: function (e, t, i) {
  50644. var n = this._actions,
  50645. r = this._actionsByClip,
  50646. o = r[t];
  50647. if (void 0 === o)
  50648. (o = {
  50649. knownActions: [e],
  50650. actionByRoot: {},
  50651. }),
  50652. (e._byClipCacheIndex = 0),
  50653. (r[t] = o);
  50654. else {
  50655. var a = o.knownActions;
  50656. (e._byClipCacheIndex = a.length), a.push(e);
  50657. }
  50658. (e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e);
  50659. },
  50660. _removeInactiveAction: function (e) {
  50661. var t = this._actions,
  50662. i = t[t.length - 1],
  50663. n = e._cacheIndex;
  50664. (i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null);
  50665. var r = e._clip.name,
  50666. o = this._actionsByClip,
  50667. a = o[r],
  50668. s = a.knownActions,
  50669. l = s[s.length - 1],
  50670. c = e._byClipCacheIndex;
  50671. (l._byClipCacheIndex = c), (s[c] = l), s.pop(), (e._byClipCacheIndex = null);
  50672. var h = a.actionByRoot,
  50673. u = (t._localRoot || this._root).uuid;
  50674. delete h[u], 0 === s.length && delete o[r], this._removeInactiveBindingsForAction(e);
  50675. },
  50676. _removeInactiveBindingsForAction: function (e) {
  50677. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50678. var r = t[i];
  50679. 0 === --r.referenceCount && this._removeInactiveBinding(r);
  50680. }
  50681. },
  50682. _lendAction: function (e) {
  50683. var t = this._actions,
  50684. i = e._cacheIndex,
  50685. n = this._nActiveActions++,
  50686. r = t[n];
  50687. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50688. },
  50689. _takeBackAction: function (e) {
  50690. var t = this._actions,
  50691. i = e._cacheIndex,
  50692. n = --this._nActiveActions,
  50693. r = t[n];
  50694. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50695. },
  50696. _addInactiveBinding: function (e, t, i) {
  50697. var n = this._bindingsByRootAndName,
  50698. r = n[t],
  50699. o = this._bindings;
  50700. void 0 === r && ((r = {}), (n[t] = r)),
  50701. (r[i] = e),
  50702. (e._cacheIndex = o.length),
  50703. o.push(e);
  50704. },
  50705. _removeInactiveBinding: function (e) {
  50706. var t = this._bindings,
  50707. i = e.binding,
  50708. n = i.rootNode.uuid,
  50709. r = i.path,
  50710. o = this._bindingsByRootAndName,
  50711. a = o[n],
  50712. s = t[t.length - 1],
  50713. l = e._cacheIndex;
  50714. (s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r];
  50715. e: {
  50716. for (var c in a) break e;
  50717. delete o[n];
  50718. }
  50719. },
  50720. _lendBinding: function (e) {
  50721. var t = this._bindings,
  50722. i = e._cacheIndex,
  50723. n = this._nActiveBindings++,
  50724. r = t[n];
  50725. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50726. },
  50727. _takeBackBinding: function (e) {
  50728. var t = this._bindings,
  50729. i = e._cacheIndex,
  50730. n = --this._nActiveBindings,
  50731. r = t[n];
  50732. (e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r);
  50733. },
  50734. _lendControlInterpolant: function () {
  50735. var e = this._controlInterpolants,
  50736. t = this._nActiveControlInterpolants++,
  50737. i = e[t];
  50738. return (
  50739. void 0 === i &&
  50740. ((i = new n.LinearInterpolant(
  50741. new Float32Array(2),
  50742. new Float32Array(2),
  50743. 1,
  50744. this._controlInterpolantsResultBuffer
  50745. )),
  50746. (i.__cacheIndex = t),
  50747. (e[t] = i)),
  50748. i
  50749. );
  50750. },
  50751. _takeBackControlInterpolant: function (e) {
  50752. var t = this._controlInterpolants,
  50753. i = e.__cacheIndex,
  50754. n = --this._nActiveControlInterpolants,
  50755. r = t[n];
  50756. (e.__cacheIndex = n), (t[n] = e), (r.__cacheIndex = i), (t[i] = r);
  50757. },
  50758. _controlInterpolantsResultBuffer: new Float32Array(1),
  50759. }),
  50760. (n.AnimationObjectGroup = function (e) {
  50761. (this.uuid = n.Math.generateUUID()),
  50762. (this._objects = Array.prototype.slice.call(arguments)),
  50763. (this.nCachedObjects_ = 0);
  50764. var t = {};
  50765. this._indicesByUUID = t;
  50766. for (var i = 0, r = arguments.length; i !== r; ++i) t[arguments[i].uuid] = i;
  50767. (this._paths = []),
  50768. (this._parsedPaths = []),
  50769. (this._bindings = []),
  50770. (this._bindingsIndicesByPath = {});
  50771. var o = this;
  50772. this.stats = {
  50773. objects: {
  50774. get total() {
  50775. return o._objects.length;
  50776. },
  50777. get inUse() {
  50778. return this.total - o.nCachedObjects_;
  50779. },
  50780. },
  50781. get bindingsPerObject() {
  50782. return o._bindings.length;
  50783. },
  50784. };
  50785. }),
  50786. (n.AnimationObjectGroup.prototype = {
  50787. constructor: n.AnimationObjectGroup,
  50788. add: function (e) {
  50789. for (
  50790. var t = this._objects,
  50791. i = t.length,
  50792. r = this.nCachedObjects_,
  50793. o = this._indicesByUUID,
  50794. a = this._paths,
  50795. s = this._parsedPaths,
  50796. l = this._bindings,
  50797. c = l.length,
  50798. h = 0,
  50799. u = arguments.length;
  50800. h !== u;
  50801. ++h
  50802. ) {
  50803. var d = arguments[h],
  50804. p = d.uuid,
  50805. f = o[p];
  50806. if (void 0 === f) {
  50807. (f = i++), (o[p] = f), t.push(d);
  50808. for (var g = 0, m = c; g !== m; ++g)
  50809. l[g].push(new n.PropertyBinding(d, a[g], s[g]));
  50810. } else if (f < r) {
  50811. var v = t[f],
  50812. A = --r,
  50813. y = t[A];
  50814. (o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d);
  50815. for (var g = 0, m = c; g !== m; ++g) {
  50816. var C = l[g],
  50817. I = C[A],
  50818. E = C[f];
  50819. (C[f] = I),
  50820. void 0 === E && (E = new n.PropertyBinding(d, a[g], s[g])),
  50821. (C[A] = E);
  50822. }
  50823. } else
  50824. t[f] !== v &&
  50825. console.error(
  50826. 'Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...'
  50827. );
  50828. }
  50829. this.nCachedObjects_ = r;
  50830. },
  50831. remove: function (e) {
  50832. for (
  50833. var t = this._objects,
  50834. i = (t.length, this.nCachedObjects_),
  50835. n = this._indicesByUUID,
  50836. r = this._bindings,
  50837. o = r.length,
  50838. a = 0,
  50839. s = arguments.length;
  50840. a !== s;
  50841. ++a
  50842. ) {
  50843. var l = arguments[a],
  50844. c = l.uuid,
  50845. h = n[c];
  50846. if (void 0 !== h && h >= i) {
  50847. var u = i++,
  50848. d = t[u];
  50849. (n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l);
  50850. for (var p = 0, f = o; p !== f; ++p) {
  50851. var g = r[p],
  50852. m = g[u],
  50853. v = g[h];
  50854. (g[h] = m), (g[u] = v);
  50855. }
  50856. }
  50857. }
  50858. this.nCachedObjects_ = i;
  50859. },
  50860. uncache: function (e) {
  50861. for (
  50862. var t = this._objects,
  50863. i = t.length,
  50864. n = this.nCachedObjects_,
  50865. r = this._indicesByUUID,
  50866. o = this._bindings,
  50867. a = o.length,
  50868. s = 0,
  50869. l = arguments.length;
  50870. s !== l;
  50871. ++s
  50872. ) {
  50873. var c = arguments[s],
  50874. h = c.uuid,
  50875. u = r[h];
  50876. if (void 0 !== u)
  50877. if ((delete r[h], u < n)) {
  50878. var d = --n,
  50879. p = t[d],
  50880. f = --i,
  50881. g = t[f];
  50882. (r[p.uuid] = u), (t[u] = p), (r[g.uuid] = d), (t[d] = g), t.pop();
  50883. for (var m = 0, v = a; m !== v; ++m) {
  50884. var A = o[m],
  50885. y = A[d],
  50886. C = A[f];
  50887. (A[u] = y), (A[d] = C), A.pop();
  50888. }
  50889. } else {
  50890. var f = --i,
  50891. g = t[f];
  50892. (r[g.uuid] = u), (t[u] = g), t.pop();
  50893. for (var m = 0, v = a; m !== v; ++m) {
  50894. var A = o[m];
  50895. (A[u] = A[f]), A.pop();
  50896. }
  50897. }
  50898. }
  50899. this.nCachedObjects_ = n;
  50900. },
  50901. subscribe_: function (e, t) {
  50902. var i = this._bindingsIndicesByPath,
  50903. r = i[e],
  50904. o = this._bindings;
  50905. if (void 0 !== r) return o[r];
  50906. var a = this._paths,
  50907. s = this._parsedPaths,
  50908. l = this._objects,
  50909. c = l.length,
  50910. h = this.nCachedObjects_,
  50911. u = new Array(c);
  50912. (r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u);
  50913. for (var d = h, p = l.length; d !== p; ++d) {
  50914. var f = l[d];
  50915. u[d] = new n.PropertyBinding(f, e, t);
  50916. }
  50917. return u;
  50918. },
  50919. unsubscribe_: function (e) {
  50920. var t = this._bindingsIndicesByPath,
  50921. i = t[e];
  50922. if (void 0 !== i) {
  50923. var n = this._paths,
  50924. r = this._parsedPaths,
  50925. o = this._bindings,
  50926. a = o.length - 1,
  50927. s = o[a],
  50928. l = e[a];
  50929. (t[l] = i), (o[i] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop();
  50930. }
  50931. },
  50932. }),
  50933. (n.AnimationUtils = {
  50934. arraySlice: function (e, t, i) {
  50935. return n.AnimationUtils.isTypedArray(e)
  50936. ? new e.constructor(e.subarray(t, i))
  50937. : e.slice(t, i);
  50938. },
  50939. convertArray: function (e, t, i) {
  50940. return !e || (!i && e.constructor === t)
  50941. ? e
  50942. : 'number' == typeof t.BYTES_PER_ELEMENT
  50943. ? new t(e)
  50944. : Array.prototype.slice.call(e);
  50945. },
  50946. isTypedArray: function (e) {
  50947. return ArrayBuffer.isView(e) && !(e instanceof DataView);
  50948. },
  50949. getKeyframeOrder: function (e) {
  50950. function t(t, i) {
  50951. return e[t] - e[i];
  50952. }
  50953. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r) n[r] = r;
  50954. return n.sort(t), n;
  50955. },
  50956. sortedArray: function (e, t, i) {
  50957. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  50958. for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l];
  50959. return r;
  50960. },
  50961. flattenJSON: function (e, t, i, n) {
  50962. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++];
  50963. if (void 0 !== o) {
  50964. var a = o[n];
  50965. if (void 0 !== a)
  50966. if (Array.isArray(a)) {
  50967. do
  50968. (a = o[n]),
  50969. void 0 !== a && (t.push(o.time), i.push.apply(i, a)),
  50970. (o = e[r++]);
  50971. while (void 0 !== o);
  50972. } else if (void 0 !== a.toArray) {
  50973. do
  50974. (a = o[n]),
  50975. void 0 !== a && (t.push(o.time), a.toArray(i, i.length)),
  50976. (o = e[r++]);
  50977. while (void 0 !== o);
  50978. } else
  50979. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push(a)), (o = e[r++]);
  50980. while (void 0 !== o);
  50981. }
  50982. },
  50983. }),
  50984. (n.KeyframeTrack = function (e, t, i, r) {
  50985. if (void 0 === e) throw new Error('track name is undefined');
  50986. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e);
  50987. (this.name = e),
  50988. (this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType)),
  50989. (this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType)),
  50990. this.setInterpolation(r || this.DefaultInterpolation),
  50991. this.validate(),
  50992. this.optimize();
  50993. }),
  50994. (n.KeyframeTrack.prototype = {
  50995. constructor: n.KeyframeTrack,
  50996. TimeBufferType: Float32Array,
  50997. ValueBufferType: Float32Array,
  50998. DefaultInterpolation: n.InterpolateLinear,
  50999. InterpolantFactoryMethodDiscrete: function (e) {
  51000. return new n.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e);
  51001. },
  51002. InterpolantFactoryMethodLinear: function (e) {
  51003. return new n.LinearInterpolant(this.times, this.values, this.getValueSize(), e);
  51004. },
  51005. InterpolantFactoryMethodSmooth: function (e) {
  51006. return new n.CubicInterpolant(this.times, this.values, this.getValueSize(), e);
  51007. },
  51008. setInterpolation: function (e) {
  51009. var t = void 0;
  51010. switch (e) {
  51011. case n.InterpolateDiscrete:
  51012. t = this.InterpolantFactoryMethodDiscrete;
  51013. break;
  51014. case n.InterpolateLinear:
  51015. t = this.InterpolantFactoryMethodLinear;
  51016. break;
  51017. case n.InterpolateSmooth:
  51018. t = this.InterpolantFactoryMethodSmooth;
  51019. }
  51020. if (void 0 === t) {
  51021. var i =
  51022. 'unsupported interpolation for ' +
  51023. this.ValueTypeName +
  51024. ' keyframe track named ' +
  51025. this.name;
  51026. if (void 0 === this.createInterpolant) {
  51027. if (e === this.DefaultInterpolation) throw new Error(i);
  51028. this.setInterpolation(this.DefaultInterpolation);
  51029. }
  51030. return void console.warn(i);
  51031. }
  51032. this.createInterpolant = t;
  51033. },
  51034. getInterpolation: function () {
  51035. switch (this.createInterpolant) {
  51036. case this.InterpolantFactoryMethodDiscrete:
  51037. return n.InterpolateDiscrete;
  51038. case this.InterpolantFactoryMethodLinear:
  51039. return n.InterpolateLinear;
  51040. case this.InterpolantFactoryMethodSmooth:
  51041. return n.InterpolateSmooth;
  51042. }
  51043. },
  51044. getValueSize: function () {
  51045. return this.values.length / this.times.length;
  51046. },
  51047. shift: function (e) {
  51048. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e;
  51049. return this;
  51050. },
  51051. scale: function (e) {
  51052. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e;
  51053. return this;
  51054. },
  51055. trim: function (e, t) {
  51056. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; ) ++o;
  51057. for (; a !== -1 && i[a] > t; ) --a;
  51058. if ((++a, 0 !== o || a !== r)) {
  51059. o >= a && ((a = Math.max(a, 1)), (o = a - 1));
  51060. var s = this.getValueSize();
  51061. (this.times = n.AnimationUtils.arraySlice(i, o, a)),
  51062. (this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s));
  51063. }
  51064. return this;
  51065. },
  51066. validate: function () {
  51067. var e = !0,
  51068. t = this.getValueSize();
  51069. t - Math.floor(t) !== 0 &&
  51070. (console.error('invalid value size in track', this), (e = !1));
  51071. var i = this.times,
  51072. r = this.values,
  51073. o = i.length;
  51074. 0 === o && (console.error('track is empty', this), (e = !1));
  51075. for (var a = null, s = 0; s !== o; s++) {
  51076. var l = i[s];
  51077. if ('number' == typeof l && isNaN(l)) {
  51078. console.error('time is not a valid number', this, s, l), (e = !1);
  51079. break;
  51080. }
  51081. if (null !== a && a > l) {
  51082. console.error('out of order keys', this, s, l, a), (e = !1);
  51083. break;
  51084. }
  51085. a = l;
  51086. }
  51087. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  51088. for (var s = 0, c = r.length; s !== c; ++s) {
  51089. var h = r[s];
  51090. if (isNaN(h)) {
  51091. console.error('value is not a valid number', this, s, h), (e = !1);
  51092. break;
  51093. }
  51094. }
  51095. return e;
  51096. },
  51097. optimize: function () {
  51098. for (
  51099. var e = this.times,
  51100. t = this.values,
  51101. i = this.getValueSize(),
  51102. r = 1,
  51103. o = 1,
  51104. a = e.length - 1;
  51105. o <= a;
  51106. ++o
  51107. ) {
  51108. var s = !1,
  51109. l = e[o],
  51110. c = e[o + 1];
  51111. if (l !== c && (1 !== o || l !== l[0]))
  51112. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  51113. var f = t[h + p];
  51114. if (f !== t[u + p] || f !== t[d + p]) {
  51115. s = !0;
  51116. break;
  51117. }
  51118. }
  51119. if (s) {
  51120. if (o !== r) {
  51121. e[r] = e[o];
  51122. for (var g = o * i, m = r * i, p = 0; p !== i; ++p) t[m + p] = t[g + p];
  51123. }
  51124. ++r;
  51125. }
  51126. }
  51127. return (
  51128. r !== e.length &&
  51129. ((this.times = n.AnimationUtils.arraySlice(e, 0, r)),
  51130. (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))),
  51131. this
  51132. );
  51133. },
  51134. }),
  51135. Object.assign(n.KeyframeTrack, {
  51136. parse: function (e) {
  51137. if (void 0 === e.type) throw new Error('track type undefined, can not parse');
  51138. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  51139. if (void 0 === e.times) {
  51140. console.warn('legacy JSON format detected, converting');
  51141. var i = [],
  51142. r = [];
  51143. n.AnimationUtils.flattenJSON(e.keys, i, r, 'value'), (e.times = i), (e.values = r);
  51144. }
  51145. return void 0 !== t.parse
  51146. ? t.parse(e)
  51147. : new t(e.name, e.times, e.values, e.interpolation);
  51148. },
  51149. toJSON: function (e) {
  51150. var t,
  51151. i = e.constructor;
  51152. if (void 0 !== i.toJSON) t = i.toJSON(e);
  51153. else {
  51154. t = {
  51155. name: e.name,
  51156. times: n.AnimationUtils.convertArray(e.times, Array),
  51157. values: n.AnimationUtils.convertArray(e.values, Array),
  51158. };
  51159. var r = e.getInterpolation();
  51160. r !== e.DefaultInterpolation && (t.interpolation = r);
  51161. }
  51162. return (t.type = e.ValueTypeName), t;
  51163. },
  51164. _getTrackTypeForValueTypeName: function (e) {
  51165. switch (e.toLowerCase()) {
  51166. case 'scalar':
  51167. case 'double':
  51168. case 'float':
  51169. case 'number':
  51170. case 'integer':
  51171. return n.NumberKeyframeTrack;
  51172. case 'vector':
  51173. case 'vector2':
  51174. case 'vector3':
  51175. case 'vector4':
  51176. return n.VectorKeyframeTrack;
  51177. case 'color':
  51178. return n.ColorKeyframeTrack;
  51179. case 'quaternion':
  51180. return n.QuaternionKeyframeTrack;
  51181. case 'bool':
  51182. case 'boolean':
  51183. return n.BooleanKeyframeTrack;
  51184. case 'string':
  51185. return n.StringKeyframeTrack;
  51186. }
  51187. throw new Error('Unsupported typeName: ' + e);
  51188. },
  51189. }),
  51190. (n.PropertyBinding = function (e, t, i) {
  51191. (this.path = t),
  51192. (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)),
  51193. (this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e),
  51194. (this.rootNode = e);
  51195. }),
  51196. (n.PropertyBinding.prototype = {
  51197. constructor: n.PropertyBinding,
  51198. getValue: function (e, t) {
  51199. this.bind(), this.getValue(e, t);
  51200. },
  51201. setValue: function (e, t) {
  51202. this.bind(), this.setValue(e, t);
  51203. },
  51204. bind: function () {
  51205. var e = this.node,
  51206. t = this.parsedPath,
  51207. i = t.objectName,
  51208. r = t.propertyName,
  51209. o = t.propertyIndex;
  51210. if (
  51211. (e ||
  51212. ((e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode),
  51213. (this.node = e)),
  51214. (this.getValue = this._getValue_unavailable),
  51215. (this.setValue = this._setValue_unavailable),
  51216. !e)
  51217. )
  51218. return void console.error(
  51219. ' trying to update node for track: ' + this.path + " but it wasn't found."
  51220. );
  51221. if (i) {
  51222. var a = t.objectIndex;
  51223. switch (i) {
  51224. case 'materials':
  51225. if (!e.material)
  51226. return void console.error(
  51227. ' can not bind to material as node does not have a material',
  51228. this
  51229. );
  51230. if (!e.material.materials)
  51231. return void console.error(
  51232. ' can not bind to material.materials as node.material does not have a materials array',
  51233. this
  51234. );
  51235. e = e.material.materials;
  51236. break;
  51237. case 'bones':
  51238. if (!e.skeleton)
  51239. return void console.error(
  51240. ' can not bind to bones as node does not have a skeleton',
  51241. this
  51242. );
  51243. e = e.skeleton.bones;
  51244. for (var s = 0; s < e.length; s++)
  51245. if (e[s].name === a) {
  51246. a = s;
  51247. break;
  51248. }
  51249. break;
  51250. default:
  51251. if (void 0 === e[i])
  51252. return void console.error(
  51253. ' can not bind to objectName of node, undefined',
  51254. this
  51255. );
  51256. e = e[i];
  51257. }
  51258. if (void 0 !== a) {
  51259. if (void 0 === e[a])
  51260. return void console.error(
  51261. ' trying to bind to objectIndex of objectName, but is undefined:',
  51262. this,
  51263. e
  51264. );
  51265. e = e[a];
  51266. }
  51267. }
  51268. var l = e[r];
  51269. if (!l) {
  51270. var c = t.nodeName;
  51271. return void console.error(
  51272. ' trying to update property for track: ' + c + '.' + r + " but it wasn't found.",
  51273. e
  51274. );
  51275. }
  51276. var h = this.Versioning.None;
  51277. void 0 !== e.needsUpdate
  51278. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  51279. : void 0 !== e.matrixWorldNeedsUpdate &&
  51280. ((h = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e));
  51281. var u = this.BindingType.Direct;
  51282. if (void 0 !== o) {
  51283. if ('morphTargetInfluences' === r) {
  51284. if (!e.geometry)
  51285. return void console.error(
  51286. ' can not bind to morphTargetInfluences becasuse node does not have a geometry',
  51287. this
  51288. );
  51289. if (!e.geometry.morphTargets)
  51290. return void console.error(
  51291. ' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets',
  51292. this
  51293. );
  51294. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  51295. if (e.geometry.morphTargets[s].name === o) {
  51296. o = s;
  51297. break;
  51298. }
  51299. }
  51300. (u = this.BindingType.ArrayElement),
  51301. (this.resolvedProperty = l),
  51302. (this.propertyIndex = o);
  51303. } else
  51304. void 0 !== l.fromArray && void 0 !== l.toArray
  51305. ? ((u = this.BindingType.HasFromToArray), (this.resolvedProperty = l))
  51306. : void 0 !== l.length
  51307. ? ((u = this.BindingType.EntireArray), (this.resolvedProperty = l))
  51308. : (this.propertyName = r);
  51309. (this.getValue = this.GetterByBindingType[u]),
  51310. (this.setValue = this.SetterByBindingTypeAndVersioning[u][h]);
  51311. },
  51312. unbind: function () {
  51313. (this.node = null),
  51314. (this.getValue = this._getValue_unbound),
  51315. (this.setValue = this._setValue_unbound);
  51316. },
  51317. }),
  51318. Object.assign(n.PropertyBinding.prototype, {
  51319. _getValue_unavailable: function () {},
  51320. _setValue_unavailable: function () {},
  51321. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  51322. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  51323. BindingType: {
  51324. Direct: 0,
  51325. EntireArray: 1,
  51326. ArrayElement: 2,
  51327. HasFromToArray: 3,
  51328. },
  51329. Versioning: {
  51330. None: 0,
  51331. NeedsUpdate: 1,
  51332. MatrixWorldNeedsUpdate: 2,
  51333. },
  51334. GetterByBindingType: [
  51335. function (e, t) {
  51336. e[t] = this.node[this.propertyName];
  51337. },
  51338. function (e, t) {
  51339. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51340. e[t++] = i[n];
  51341. },
  51342. function (e, t) {
  51343. e[t] = this.resolvedProperty[this.propertyIndex];
  51344. },
  51345. function (e, t) {
  51346. this.resolvedProperty.toArray(e, t);
  51347. },
  51348. ],
  51349. SetterByBindingTypeAndVersioning: [
  51350. [
  51351. function (e, t) {
  51352. this.node[this.propertyName] = e[t];
  51353. },
  51354. function (e, t) {
  51355. (this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0);
  51356. },
  51357. function (e, t) {
  51358. (this.node[this.propertyName] = e[t]),
  51359. (this.targetObject.matrixWorldNeedsUpdate = !0);
  51360. },
  51361. ],
  51362. [
  51363. function (e, t) {
  51364. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51365. i[n] = e[t++];
  51366. },
  51367. function (e, t) {
  51368. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51369. i[n] = e[t++];
  51370. this.targetObject.needsUpdate = !0;
  51371. },
  51372. function (e, t) {
  51373. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51374. i[n] = e[t++];
  51375. this.targetObject.matrixWorldNeedsUpdate = !0;
  51376. },
  51377. ],
  51378. [
  51379. function (e, t) {
  51380. this.resolvedProperty[this.propertyIndex] = e[t];
  51381. },
  51382. function (e, t) {
  51383. (this.resolvedProperty[this.propertyIndex] = e[t]),
  51384. (this.targetObject.needsUpdate = !0);
  51385. },
  51386. function (e, t) {
  51387. (this.resolvedProperty[this.propertyIndex] = e[t]),
  51388. (this.targetObject.matrixWorldNeedsUpdate = !0);
  51389. },
  51390. ],
  51391. [
  51392. function (e, t) {
  51393. this.resolvedProperty.fromArray(e, t);
  51394. },
  51395. function (e, t) {
  51396. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0);
  51397. },
  51398. function (e, t) {
  51399. this.resolvedProperty.fromArray(e, t),
  51400. (this.targetObject.matrixWorldNeedsUpdate = !0);
  51401. },
  51402. ],
  51403. ],
  51404. }),
  51405. (n.PropertyBinding.Composite = function (e, t, i) {
  51406. var r = i || n.PropertyBinding.parseTrackName(t);
  51407. (this._targetGroup = e), (this._bindings = e.subscribe_(t, r));
  51408. }),
  51409. (n.PropertyBinding.Composite.prototype = {
  51410. constructor: n.PropertyBinding.Composite,
  51411. getValue: function (e, t) {
  51412. this.bind();
  51413. var i = this._targetGroup.nCachedObjects_,
  51414. n = this._bindings[i];
  51415. void 0 !== n && n.getValue(e, t);
  51416. },
  51417. setValue: function (e, t) {
  51418. for (
  51419. var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length;
  51420. n !== r;
  51421. ++n
  51422. )
  51423. i[n].setValue(e, t);
  51424. },
  51425. bind: function () {
  51426. for (
  51427. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51428. t !== i;
  51429. ++t
  51430. )
  51431. e[t].bind();
  51432. },
  51433. unbind: function () {
  51434. for (
  51435. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51436. t !== i;
  51437. ++t
  51438. )
  51439. e[t].unbind();
  51440. },
  51441. }),
  51442. (n.PropertyBinding.create = function (e, t, i) {
  51443. return e instanceof n.AnimationObjectGroup
  51444. ? new n.PropertyBinding.Composite(e, t, i)
  51445. : new n.PropertyBinding(e, t, i);
  51446. }),
  51447. (n.PropertyBinding.parseTrackName = function (e) {
  51448. var t =
  51449. /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  51450. i = t.exec(e);
  51451. if (!i) throw new Error('cannot parse trackName at all: ' + e);
  51452. i.index === t.lastIndex && t.lastIndex++;
  51453. var n = {
  51454. nodeName: i[3],
  51455. objectName: i[5],
  51456. objectIndex: i[7],
  51457. propertyName: i[9],
  51458. propertyIndex: i[11],
  51459. };
  51460. if (null === n.propertyName || 0 === n.propertyName.length)
  51461. throw new Error('can not parse propertyName from trackName: ' + e);
  51462. return n;
  51463. }),
  51464. (n.PropertyBinding.findNode = function (e, t) {
  51465. if (
  51466. !t ||
  51467. '' === t ||
  51468. 'root' === t ||
  51469. '.' === t ||
  51470. t === -1 ||
  51471. t === e.name ||
  51472. t === e.uuid
  51473. )
  51474. return e;
  51475. if (e.skeleton) {
  51476. var i = function (e) {
  51477. for (var i = 0; i < e.bones.length; i++) {
  51478. var n = e.bones[i];
  51479. if (n.name === t) return n;
  51480. }
  51481. return null;
  51482. },
  51483. n = i(e.skeleton);
  51484. if (n) return n;
  51485. }
  51486. if (e.children) {
  51487. var r = function (e) {
  51488. for (var i = 0; i < e.length; i++) {
  51489. var n = e[i];
  51490. if (n.name === t || n.uuid === t) return n;
  51491. var o = r(n.children);
  51492. if (o) return o;
  51493. }
  51494. return null;
  51495. },
  51496. o = r(e.children);
  51497. if (o) return o;
  51498. }
  51499. return null;
  51500. }),
  51501. (n.PropertyMixer = function (e, t, i) {
  51502. (this.binding = e), (this.valueSize = i);
  51503. var n,
  51504. r = Float64Array;
  51505. switch (t) {
  51506. case 'quaternion':
  51507. n = this._slerp;
  51508. break;
  51509. case 'string':
  51510. case 'bool':
  51511. (r = Array), (n = this._select);
  51512. break;
  51513. default:
  51514. n = this._lerp;
  51515. }
  51516. (this.buffer = new r(4 * i)),
  51517. (this._mixBufferRegion = n),
  51518. (this.cumulativeWeight = 0),
  51519. (this.useCount = 0),
  51520. (this.referenceCount = 0);
  51521. }),
  51522. (n.PropertyMixer.prototype = {
  51523. constructor: n.PropertyMixer,
  51524. accumulate: function (e, t) {
  51525. var i = this.buffer,
  51526. n = this.valueSize,
  51527. r = e * n + n,
  51528. o = this.cumulativeWeight;
  51529. if (0 === o) {
  51530. for (var a = 0; a !== n; ++a) i[r + a] = i[a];
  51531. o = t;
  51532. } else {
  51533. o += t;
  51534. var s = t / o;
  51535. this._mixBufferRegion(i, r, 0, s, n);
  51536. }
  51537. this.cumulativeWeight = o;
  51538. },
  51539. apply: function (e) {
  51540. var t = this.valueSize,
  51541. i = this.buffer,
  51542. n = e * t + t,
  51543. r = this.cumulativeWeight,
  51544. o = this.binding;
  51545. if (((this.cumulativeWeight = 0), r < 1)) {
  51546. var a = 3 * t;
  51547. this._mixBufferRegion(i, n, a, 1 - r, t);
  51548. }
  51549. for (var s = t, l = t + t; s !== l; ++s)
  51550. if (i[s] !== i[s + t]) {
  51551. o.setValue(i, n);
  51552. break;
  51553. }
  51554. },
  51555. saveOriginalState: function () {
  51556. var e = this.binding,
  51557. t = this.buffer,
  51558. i = this.valueSize,
  51559. n = 3 * i;
  51560. e.getValue(t, n);
  51561. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)];
  51562. this.cumulativeWeight = 0;
  51563. },
  51564. restoreOriginalState: function () {
  51565. var e = 3 * this.valueSize;
  51566. this.binding.setValue(this.buffer, e);
  51567. },
  51568. _select: function (e, t, i, n, r) {
  51569. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o];
  51570. },
  51571. _slerp: function (e, t, i, r, o) {
  51572. n.Quaternion.slerpFlat(e, t, e, t, e, i, r);
  51573. },
  51574. _lerp: function (e, t, i, n, r) {
  51575. for (var o = 1 - n, a = 0; a !== r; ++a) {
  51576. var s = t + a;
  51577. e[s] = e[s] * o + e[i + a] * n;
  51578. }
  51579. },
  51580. }),
  51581. (n.BooleanKeyframeTrack = function (e, t, i) {
  51582. n.KeyframeTrack.call(this, e, t, i);
  51583. }),
  51584. (n.BooleanKeyframeTrack.prototype = Object.assign(
  51585. Object.create(n.KeyframeTrack.prototype),
  51586. {
  51587. constructor: n.BooleanKeyframeTrack,
  51588. ValueTypeName: 'bool',
  51589. ValueBufferType: Array,
  51590. DefaultInterpolation: n.IntepolateDiscrete,
  51591. InterpolantFactoryMethodLinear: void 0,
  51592. InterpolantFactoryMethodSmooth: void 0,
  51593. }
  51594. )),
  51595. (n.NumberKeyframeTrack = function (e, t, i, r) {
  51596. n.KeyframeTrack.call(this, e, t, i, r);
  51597. }),
  51598. (n.NumberKeyframeTrack.prototype = Object.assign(
  51599. Object.create(n.KeyframeTrack.prototype),
  51600. {
  51601. constructor: n.NumberKeyframeTrack,
  51602. ValueTypeName: 'number',
  51603. }
  51604. )),
  51605. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  51606. n.KeyframeTrack.call(this, e, t, i, r);
  51607. }),
  51608. (n.QuaternionKeyframeTrack.prototype = Object.assign(
  51609. Object.create(n.KeyframeTrack.prototype),
  51610. {
  51611. constructor: n.QuaternionKeyframeTrack,
  51612. ValueTypeName: 'quaternion',
  51613. DefaultInterpolation: n.InterpolateLinear,
  51614. InterpolantFactoryMethodLinear: function (e) {
  51615. return new n.QuaternionLinearInterpolant(
  51616. this.times,
  51617. this.values,
  51618. this.getValueSize(),
  51619. e
  51620. );
  51621. },
  51622. InterpolantFactoryMethodSmooth: void 0,
  51623. }
  51624. )),
  51625. (n.StringKeyframeTrack = function (e, t, i, r) {
  51626. n.KeyframeTrack.call(this, e, t, i, r);
  51627. }),
  51628. (n.StringKeyframeTrack.prototype = Object.assign(
  51629. Object.create(n.KeyframeTrack.prototype),
  51630. {
  51631. constructor: n.StringKeyframeTrack,
  51632. ValueTypeName: 'string',
  51633. ValueBufferType: Array,
  51634. DefaultInterpolation: n.IntepolateDiscrete,
  51635. InterpolantFactoryMethodLinear: void 0,
  51636. InterpolantFactoryMethodSmooth: void 0,
  51637. }
  51638. )),
  51639. (n.VectorKeyframeTrack = function (e, t, i, r) {
  51640. n.KeyframeTrack.call(this, e, t, i, r);
  51641. }),
  51642. (n.VectorKeyframeTrack.prototype = Object.assign(
  51643. Object.create(n.KeyframeTrack.prototype),
  51644. {
  51645. constructor: n.VectorKeyframeTrack,
  51646. ValueTypeName: 'vector',
  51647. }
  51648. )),
  51649. (n.Audio = function (e) {
  51650. n.Object3D.call(this),
  51651. (this.type = 'Audio'),
  51652. (this.context = e.context),
  51653. (this.source = this.context.createBufferSource()),
  51654. (this.source.onended = this.onEnded.bind(this)),
  51655. (this.gain = this.context.createGain()),
  51656. this.gain.connect(e.getInput()),
  51657. (this.autoplay = !1),
  51658. (this.startTime = 0),
  51659. (this.playbackRate = 1),
  51660. (this.isPlaying = !1),
  51661. (this.hasPlaybackControl = !0),
  51662. (this.sourceType = 'empty'),
  51663. (this.filter = null);
  51664. }),
  51665. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  51666. (n.Audio.prototype.constructor = n.Audio),
  51667. (n.Audio.prototype.getOutput = function () {
  51668. return this.gain;
  51669. }),
  51670. (n.Audio.prototype.load = function (e) {
  51671. var t = new n.AudioBuffer(this.context);
  51672. return t.load(e), this.setBuffer(t), this;
  51673. }),
  51674. (n.Audio.prototype.setNodeSource = function (e) {
  51675. return (
  51676. (this.hasPlaybackControl = !1),
  51677. (this.sourceType = 'audioNode'),
  51678. (this.source = e),
  51679. this.connect(),
  51680. this
  51681. );
  51682. }),
  51683. (n.Audio.prototype.setBuffer = function (e) {
  51684. var t = this;
  51685. return (
  51686. e.onReady(function (e) {
  51687. (t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play();
  51688. }),
  51689. this
  51690. );
  51691. }),
  51692. (n.Audio.prototype.play = function () {
  51693. if (this.isPlaying === !0)
  51694. return void console.warn('THREE.Audio: Audio is already playing.');
  51695. if (this.hasPlaybackControl === !1)
  51696. return void console.warn('THREE.Audio: this Audio has no playback control.');
  51697. var e = this.context.createBufferSource();
  51698. (e.buffer = this.source.buffer),
  51699. (e.loop = this.source.loop),
  51700. (e.onended = this.source.onended),
  51701. e.start(0, this.startTime),
  51702. (e.playbackRate.value = this.playbackRate),
  51703. (this.isPlaying = !0),
  51704. (this.source = e),
  51705. this.connect();
  51706. }),
  51707. (n.Audio.prototype.pause = function () {
  51708. return this.hasPlaybackControl === !1
  51709. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51710. : (this.source.stop(), void (this.startTime = this.context.currentTime));
  51711. }),
  51712. (n.Audio.prototype.stop = function () {
  51713. return this.hasPlaybackControl === !1
  51714. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51715. : (this.source.stop(), void (this.startTime = 0));
  51716. }),
  51717. (n.Audio.prototype.connect = function () {
  51718. null !== this.filter
  51719. ? (this.source.connect(this.filter), this.filter.connect(this.getOutput()))
  51720. : this.source.connect(this.getOutput());
  51721. }),
  51722. (n.Audio.prototype.disconnect = function () {
  51723. null !== this.filter
  51724. ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput()))
  51725. : this.source.disconnect(this.getOutput());
  51726. }),
  51727. (n.Audio.prototype.getFilter = function () {
  51728. return this.filter;
  51729. }),
  51730. (n.Audio.prototype.setFilter = function (e) {
  51731. void 0 === e && (e = null),
  51732. this.isPlaying === !0
  51733. ? (this.disconnect(), (this.filter = e), this.connect())
  51734. : (this.filter = e);
  51735. }),
  51736. (n.Audio.prototype.setPlaybackRate = function (e) {
  51737. return this.hasPlaybackControl === !1
  51738. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51739. : ((this.playbackRate = e),
  51740. void (
  51741. this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)
  51742. ));
  51743. }),
  51744. (n.Audio.prototype.getPlaybackRate = function () {
  51745. return this.playbackRate;
  51746. }),
  51747. (n.Audio.prototype.onEnded = function () {
  51748. this.isPlaying = !1;
  51749. }),
  51750. (n.Audio.prototype.setLoop = function (e) {
  51751. return this.hasPlaybackControl === !1
  51752. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51753. : void (this.source.loop = e);
  51754. }),
  51755. (n.Audio.prototype.getLoop = function () {
  51756. return this.hasPlaybackControl === !1
  51757. ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1)
  51758. : this.source.loop;
  51759. }),
  51760. (n.Audio.prototype.setVolume = function (e) {
  51761. this.gain.gain.value = e;
  51762. }),
  51763. (n.Audio.prototype.getVolume = function () {
  51764. return this.gain.gain.value;
  51765. }),
  51766. (n.AudioAnalyser = function (e, t) {
  51767. (this.analyser = e.context.createAnalyser()),
  51768. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  51769. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  51770. e.getOutput().connect(this.analyser);
  51771. }),
  51772. (n.AudioAnalyser.prototype = {
  51773. constructor: n.AudioAnalyser,
  51774. getData: function () {
  51775. return this.analyser.getByteFrequencyData(this.data), this.data;
  51776. },
  51777. }),
  51778. (n.AudioBuffer = function (e) {
  51779. (this.context = e), (this.ready = !1), (this.readyCallbacks = []);
  51780. }),
  51781. (n.AudioBuffer.prototype.load = function (e) {
  51782. var t = this,
  51783. i = new XMLHttpRequest();
  51784. return (
  51785. i.open('GET', e, !0),
  51786. (i.responseType = 'arraybuffer'),
  51787. (i.onload = function (e) {
  51788. t.context.decodeAudioData(this.response, function (e) {
  51789. (t.buffer = e), (t.ready = !0);
  51790. for (var i = 0; i < t.readyCallbacks.length; i++) t.readyCallbacks[i](t.buffer);
  51791. t.readyCallbacks = [];
  51792. });
  51793. }),
  51794. i.send(),
  51795. this
  51796. );
  51797. }),
  51798. (n.AudioBuffer.prototype.onReady = function (e) {
  51799. this.ready ? e(this.buffer) : this.readyCallbacks.push(e);
  51800. }),
  51801. (n.PositionalAudio = function (e) {
  51802. n.Audio.call(this, e),
  51803. (this.panner = this.context.createPanner()),
  51804. this.panner.connect(this.gain);
  51805. }),
  51806. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  51807. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  51808. (n.PositionalAudio.prototype.getOutput = function () {
  51809. return this.panner;
  51810. }),
  51811. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  51812. this.panner.refDistance = e;
  51813. }),
  51814. (n.PositionalAudio.prototype.getRefDistance = function () {
  51815. return this.panner.refDistance;
  51816. }),
  51817. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  51818. this.panner.rolloffFactor = e;
  51819. }),
  51820. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  51821. return this.panner.rolloffFactor;
  51822. }),
  51823. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  51824. this.panner.distanceModel = e;
  51825. }),
  51826. (n.PositionalAudio.prototype.getDistanceModel = function () {
  51827. return this.panner.distanceModel;
  51828. }),
  51829. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  51830. this.panner.maxDistance = e;
  51831. }),
  51832. (n.PositionalAudio.prototype.getMaxDistance = function () {
  51833. return this.panner.maxDistance;
  51834. }),
  51835. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  51836. var e = new n.Vector3();
  51837. return function (t) {
  51838. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  51839. e.setFromMatrixPosition(this.matrixWorld),
  51840. this.panner.setPosition(e.x, e.y, e.z);
  51841. };
  51842. })()),
  51843. (n.AudioListener = function () {
  51844. n.Object3D.call(this),
  51845. (this.type = 'AudioListener'),
  51846. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  51847. (this.gain = this.context.createGain()),
  51848. this.gain.connect(this.context.destination),
  51849. (this.filter = null);
  51850. }),
  51851. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  51852. (n.AudioListener.prototype.constructor = n.AudioListener),
  51853. (n.AudioListener.prototype.getInput = function () {
  51854. return this.gain;
  51855. }),
  51856. (n.AudioListener.prototype.removeFilter = function () {
  51857. null !== this.filter &&
  51858. (this.gain.disconnect(this.filter),
  51859. this.filter.disconnect(this.context.destination),
  51860. this.gain.connect(this.context.destination),
  51861. (this.filter = null));
  51862. }),
  51863. (n.AudioListener.prototype.setFilter = function (e) {
  51864. null !== this.filter
  51865. ? (this.gain.disconnect(this.filter),
  51866. this.filter.disconnect(this.context.destination))
  51867. : this.gain.disconnect(this.context.destination),
  51868. (this.filter = e),
  51869. this.gain.connect(this.filter),
  51870. this.filter.connect(this.context.destination);
  51871. }),
  51872. (n.AudioListener.prototype.getFilter = function () {
  51873. return this.filter;
  51874. }),
  51875. (n.AudioListener.prototype.setMasterVolume = function (e) {
  51876. this.gain.gain.value = e;
  51877. }),
  51878. (n.AudioListener.prototype.getMasterVolume = function () {
  51879. return this.gain.gain.value;
  51880. }),
  51881. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  51882. var e = new n.Vector3(),
  51883. t = new n.Quaternion(),
  51884. i = new n.Vector3(),
  51885. r = new n.Vector3();
  51886. return function (o) {
  51887. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  51888. var a = this.context.listener,
  51889. s = this.up;
  51890. this.matrixWorld.decompose(e, t, i),
  51891. r.set(0, 0, -1).applyQuaternion(t),
  51892. a.setPosition(e.x, e.y, e.z),
  51893. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z);
  51894. };
  51895. })()),
  51896. (n.Camera = function () {
  51897. n.Object3D.call(this),
  51898. (this.type = 'Camera'),
  51899. (this.matrixWorldInverse = new n.Matrix4()),
  51900. (this.projectionMatrix = new n.Matrix4());
  51901. }),
  51902. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  51903. (n.Camera.prototype.constructor = n.Camera),
  51904. (n.Camera.prototype.getWorldDirection = (function () {
  51905. var e = new n.Quaternion();
  51906. return function (t) {
  51907. var i = t || new n.Vector3();
  51908. return this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e);
  51909. };
  51910. })()),
  51911. (n.Camera.prototype.lookAt = (function () {
  51912. var e = new n.Matrix4();
  51913. return function (t) {
  51914. e.lookAt(this.position, t, this.up), this.quaternion.setFromRotationMatrix(e);
  51915. };
  51916. })()),
  51917. (n.Camera.prototype.clone = function () {
  51918. return new this.constructor().copy(this);
  51919. }),
  51920. (n.Camera.prototype.copy = function (e) {
  51921. return (
  51922. n.Object3D.prototype.copy.call(this, e),
  51923. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  51924. this.projectionMatrix.copy(e.projectionMatrix),
  51925. this
  51926. );
  51927. }),
  51928. (n.CubeCamera = function (e, t, i) {
  51929. n.Object3D.call(this), (this.type = 'CubeCamera');
  51930. var r = 90,
  51931. o = 1,
  51932. a = new n.PerspectiveCamera(r, o, e, t);
  51933. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a);
  51934. var s = new n.PerspectiveCamera(r, o, e, t);
  51935. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s);
  51936. var l = new n.PerspectiveCamera(r, o, e, t);
  51937. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l);
  51938. var c = new n.PerspectiveCamera(r, o, e, t);
  51939. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c);
  51940. var h = new n.PerspectiveCamera(r, o, e, t);
  51941. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h);
  51942. var u = new n.PerspectiveCamera(r, o, e, t);
  51943. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u);
  51944. var d = {
  51945. format: n.RGBFormat,
  51946. magFilter: n.LinearFilter,
  51947. minFilter: n.LinearFilter,
  51948. };
  51949. (this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  51950. (this.updateCubeMap = function (e, t) {
  51951. null === this.parent && this.updateMatrixWorld();
  51952. var i = this.renderTarget,
  51953. n = i.texture.generateMipmaps;
  51954. (i.texture.generateMipmaps = !1),
  51955. (i.activeCubeFace = 0),
  51956. e.render(t, a, i),
  51957. (i.activeCubeFace = 1),
  51958. e.render(t, s, i),
  51959. (i.activeCubeFace = 2),
  51960. e.render(t, l, i),
  51961. (i.activeCubeFace = 3),
  51962. e.render(t, c, i),
  51963. (i.activeCubeFace = 4),
  51964. e.render(t, h, i),
  51965. (i.texture.generateMipmaps = n),
  51966. (i.activeCubeFace = 5),
  51967. e.render(t, u, i),
  51968. e.setRenderTarget(null);
  51969. });
  51970. }),
  51971. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  51972. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  51973. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  51974. n.Camera.call(this),
  51975. (this.type = 'OrthographicCamera'),
  51976. (this.zoom = 1),
  51977. (this.left = e),
  51978. (this.right = t),
  51979. (this.top = i),
  51980. (this.bottom = r),
  51981. (this.near = void 0 !== o ? o : 0.1),
  51982. (this.far = void 0 !== a ? a : 2e3),
  51983. this.updateProjectionMatrix();
  51984. }),
  51985. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  51986. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  51987. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  51988. var e = (this.right - this.left) / (2 * this.zoom),
  51989. t = (this.top - this.bottom) / (2 * this.zoom),
  51990. i = (this.right + this.left) / 2,
  51991. n = (this.top + this.bottom) / 2;
  51992. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far);
  51993. }),
  51994. (n.OrthographicCamera.prototype.copy = function (e) {
  51995. return (
  51996. n.Camera.prototype.copy.call(this, e),
  51997. (this.left = e.left),
  51998. (this.right = e.right),
  51999. (this.top = e.top),
  52000. (this.bottom = e.bottom),
  52001. (this.near = e.near),
  52002. (this.far = e.far),
  52003. (this.zoom = e.zoom),
  52004. this
  52005. );
  52006. }),
  52007. (n.OrthographicCamera.prototype.toJSON = function (e) {
  52008. var t = n.Object3D.prototype.toJSON.call(this, e);
  52009. return (
  52010. (t.object.zoom = this.zoom),
  52011. (t.object.left = this.left),
  52012. (t.object.right = this.right),
  52013. (t.object.top = this.top),
  52014. (t.object.bottom = this.bottom),
  52015. (t.object.near = this.near),
  52016. (t.object.far = this.far),
  52017. t
  52018. );
  52019. }),
  52020. (n.PerspectiveCamera = function (e, t, i, r) {
  52021. n.Camera.call(this),
  52022. (this.type = 'PerspectiveCamera'),
  52023. (this.focalLength = 10),
  52024. (this.zoom = 1),
  52025. (this.fov = void 0 !== e ? e : 50),
  52026. (this.aspect = void 0 !== t ? t : 1),
  52027. (this.near = void 0 !== i ? i : 0.1),
  52028. (this.far = void 0 !== r ? r : 2e3),
  52029. this.updateProjectionMatrix();
  52030. }),
  52031. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  52032. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  52033. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  52034. void 0 === t && (t = 24),
  52035. (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))),
  52036. this.updateProjectionMatrix();
  52037. }),
  52038. (n.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  52039. (this.fullWidth = e),
  52040. (this.fullHeight = t),
  52041. (this.x = i),
  52042. (this.y = n),
  52043. (this.width = r),
  52044. (this.height = o),
  52045. this.updateProjectionMatrix();
  52046. }),
  52047. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  52048. var e = n.Math.radToDeg(
  52049. 2 * Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom)
  52050. );
  52051. if (this.fullWidth) {
  52052. var t = this.fullWidth / this.fullHeight,
  52053. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  52054. r = -i,
  52055. o = t * r,
  52056. a = t * i,
  52057. s = Math.abs(a - o),
  52058. l = Math.abs(i - r);
  52059. this.projectionMatrix.makeFrustum(
  52060. o + (this.x * s) / this.fullWidth,
  52061. o + ((this.x + this.width) * s) / this.fullWidth,
  52062. i - ((this.y + this.height) * l) / this.fullHeight,
  52063. i - (this.y * l) / this.fullHeight,
  52064. this.near,
  52065. this.far
  52066. );
  52067. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far);
  52068. }),
  52069. (n.PerspectiveCamera.prototype.copy = function (e) {
  52070. return (
  52071. n.Camera.prototype.copy.call(this, e),
  52072. (this.focalLength = e.focalLength),
  52073. (this.zoom = e.zoom),
  52074. (this.fov = e.fov),
  52075. (this.aspect = e.aspect),
  52076. (this.near = e.near),
  52077. (this.far = e.far),
  52078. this
  52079. );
  52080. }),
  52081. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  52082. var t = n.Object3D.prototype.toJSON.call(this, e);
  52083. return (
  52084. (t.object.focalLength = this.focalLength),
  52085. (t.object.zoom = this.zoom),
  52086. (t.object.fov = this.fov),
  52087. (t.object.aspect = this.aspect),
  52088. (t.object.near = this.near),
  52089. (t.object.far = this.far),
  52090. t
  52091. );
  52092. }),
  52093. (n.StereoCamera = function () {
  52094. (this.type = 'StereoCamera'),
  52095. (this.aspect = 1),
  52096. (this.cameraL = new n.PerspectiveCamera()),
  52097. this.cameraL.layers.enable(1),
  52098. (this.cameraL.matrixAutoUpdate = !1),
  52099. (this.cameraR = new n.PerspectiveCamera()),
  52100. this.cameraR.layers.enable(2),
  52101. (this.cameraR.matrixAutoUpdate = !1);
  52102. }),
  52103. (n.StereoCamera.prototype = {
  52104. constructor: n.StereoCamera,
  52105. update: (function () {
  52106. var e,
  52107. t,
  52108. i,
  52109. r,
  52110. o,
  52111. a = new n.Matrix4(),
  52112. s = new n.Matrix4();
  52113. return function (l) {
  52114. var c =
  52115. e !== l.focalLength ||
  52116. t !== l.fov ||
  52117. i !== l.aspect * this.aspect ||
  52118. r !== l.near ||
  52119. o !== l.far;
  52120. if (c) {
  52121. (e = l.focalLength),
  52122. (t = l.fov),
  52123. (i = l.aspect * this.aspect),
  52124. (r = l.near),
  52125. (o = l.far);
  52126. var h,
  52127. u,
  52128. d = l.projectionMatrix.clone(),
  52129. p = 0.032,
  52130. f = (p * r) / e,
  52131. g = r * Math.tan(n.Math.degToRad(0.5 * t));
  52132. (s.elements[12] = -p),
  52133. (a.elements[12] = p),
  52134. (h = -g * i + f),
  52135. (u = g * i + f),
  52136. (d.elements[0] = (2 * r) / (u - h)),
  52137. (d.elements[8] = (u + h) / (u - h)),
  52138. this.cameraL.projectionMatrix.copy(d),
  52139. (h = -g * i - f),
  52140. (u = g * i - f),
  52141. (d.elements[0] = (2 * r) / (u - h)),
  52142. (d.elements[8] = (u + h) / (u - h)),
  52143. this.cameraR.projectionMatrix.copy(d);
  52144. }
  52145. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  52146. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a);
  52147. };
  52148. })(),
  52149. }),
  52150. (n.Light = function (e, t) {
  52151. n.Object3D.call(this),
  52152. (this.type = 'Light'),
  52153. (this.color = new n.Color(e)),
  52154. (this.intensity = void 0 !== t ? t : 1),
  52155. (this.receiveShadow = void 0);
  52156. }),
  52157. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  52158. (n.Light.prototype.constructor = n.Light),
  52159. (n.Light.prototype.copy = function (e) {
  52160. return (
  52161. n.Object3D.prototype.copy.call(this, e),
  52162. this.color.copy(e.color),
  52163. (this.intensity = e.intensity),
  52164. this
  52165. );
  52166. }),
  52167. (n.Light.prototype.toJSON = function (e) {
  52168. var t = n.Object3D.prototype.toJSON.call(this, e);
  52169. return (
  52170. (t.object.color = this.color.getHex()),
  52171. (t.object.intensity = this.intensity),
  52172. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  52173. void 0 !== this.distance && (t.object.distance = this.distance),
  52174. void 0 !== this.angle && (t.object.angle = this.angle),
  52175. void 0 !== this.decay && (t.object.decay = this.decay),
  52176. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  52177. t
  52178. );
  52179. }),
  52180. (n.LightShadow = function (e) {
  52181. (this.camera = e),
  52182. (this.bias = 0),
  52183. (this.radius = 1),
  52184. (this.mapSize = new n.Vector2(512, 512)),
  52185. (this.map = null),
  52186. (this.matrix = new n.Matrix4());
  52187. }),
  52188. (n.LightShadow.prototype = {
  52189. constructor: n.LightShadow,
  52190. copy: function (e) {
  52191. return (
  52192. (this.camera = e.camera.clone()),
  52193. (this.bias = e.bias),
  52194. (this.radius = e.radius),
  52195. this.mapSize.copy(e.mapSize),
  52196. this
  52197. );
  52198. },
  52199. clone: function () {
  52200. return new this.constructor().copy(this);
  52201. },
  52202. }),
  52203. (n.AmbientLight = function (e, t) {
  52204. n.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0);
  52205. }),
  52206. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  52207. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  52208. (n.DirectionalLight = function (e, t) {
  52209. n.Light.call(this, e, t),
  52210. (this.type = 'DirectionalLight'),
  52211. this.position.set(0, 1, 0),
  52212. this.updateMatrix(),
  52213. (this.target = new n.Object3D()),
  52214. (this.shadow = new n.LightShadow(new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)));
  52215. }),
  52216. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  52217. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  52218. (n.DirectionalLight.prototype.copy = function (e) {
  52219. return (
  52220. n.Light.prototype.copy.call(this, e),
  52221. (this.target = e.target.clone()),
  52222. (this.shadow = e.shadow.clone()),
  52223. this
  52224. );
  52225. }),
  52226. (n.HemisphereLight = function (e, t, i) {
  52227. n.Light.call(this, e, i),
  52228. (this.type = 'HemisphereLight'),
  52229. (this.castShadow = void 0),
  52230. this.position.set(0, 1, 0),
  52231. this.updateMatrix(),
  52232. (this.groundColor = new n.Color(t));
  52233. }),
  52234. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  52235. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  52236. (n.HemisphereLight.prototype.copy = function (e) {
  52237. return n.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this;
  52238. }),
  52239. (n.PointLight = function (e, t, i, r) {
  52240. n.Light.call(this, e, t),
  52241. (this.type = 'PointLight'),
  52242. (this.distance = void 0 !== i ? i : 0),
  52243. (this.decay = void 0 !== r ? r : 1),
  52244. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(90, 1, 0.5, 500)));
  52245. }),
  52246. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  52247. (n.PointLight.prototype.constructor = n.PointLight),
  52248. Object.defineProperty(n.PointLight.prototype, 'power', {
  52249. get: function () {
  52250. return 4 * this.intensity * Math.PI;
  52251. },
  52252. set: function (e) {
  52253. this.intensity = e / (4 * Math.PI);
  52254. },
  52255. }),
  52256. (n.PointLight.prototype.copy = function (e) {
  52257. return (
  52258. n.Light.prototype.copy.call(this, e),
  52259. (this.distance = e.distance),
  52260. (this.decay = e.decay),
  52261. (this.shadow = e.shadow.clone()),
  52262. this
  52263. );
  52264. }),
  52265. (n.SpotLight = function (e, t, i, r, o, a) {
  52266. n.Light.call(this, e, t),
  52267. (this.type = 'SpotLight'),
  52268. this.position.set(0, 1, 0),
  52269. this.updateMatrix(),
  52270. (this.target = new n.Object3D()),
  52271. (this.distance = void 0 !== i ? i : 0),
  52272. (this.angle = void 0 !== r ? r : Math.PI / 3),
  52273. (this.penumbra = void 0 !== o ? o : 0),
  52274. (this.decay = void 0 !== a ? a : 1),
  52275. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(50, 1, 0.5, 500)));
  52276. }),
  52277. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  52278. (n.SpotLight.prototype.constructor = n.SpotLight),
  52279. Object.defineProperty(n.SpotLight.prototype, 'power', {
  52280. get: function () {
  52281. return this.intensity * Math.PI;
  52282. },
  52283. set: function (e) {
  52284. this.intensity = e / Math.PI;
  52285. },
  52286. }),
  52287. (n.SpotLight.prototype.copy = function (e) {
  52288. return (
  52289. n.Light.prototype.copy.call(this, e),
  52290. (this.distance = e.distance),
  52291. (this.angle = e.angle),
  52292. (this.penumbra = e.penumbra),
  52293. (this.decay = e.decay),
  52294. (this.target = e.target.clone()),
  52295. (this.shadow = e.shadow.clone()),
  52296. this
  52297. );
  52298. }),
  52299. (n.Cache = {
  52300. enabled: !1,
  52301. files: {},
  52302. add: function (e, t) {
  52303. this.enabled !== !1 && (this.files[e] = t);
  52304. },
  52305. get: function (e) {
  52306. if (this.enabled !== !1) return this.files[e];
  52307. },
  52308. remove: function (e) {
  52309. delete this.files[e];
  52310. },
  52311. clear: function () {
  52312. this.files = {};
  52313. },
  52314. }),
  52315. (n.Loader = function () {
  52316. (this.onLoadStart = function () {}),
  52317. (this.onLoadProgress = function () {}),
  52318. (this.onLoadComplete = function () {});
  52319. }),
  52320. (n.Loader.prototype = {
  52321. constructor: n.Loader,
  52322. crossOrigin: void 0,
  52323. extractUrlBase: function (e) {
  52324. var t = e.split('/');
  52325. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/');
  52326. },
  52327. initMaterials: function (e, t, i) {
  52328. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i);
  52329. return n;
  52330. },
  52331. createMaterial: (function () {
  52332. var e, t, i;
  52333. return function (r, o, a) {
  52334. function s(e, i, r, s, c) {
  52335. var h,
  52336. u = o + e,
  52337. d = n.Loader.Handlers.get(u);
  52338. null !== d ? (h = d.load(u)) : (t.setCrossOrigin(a), (h = t.load(u))),
  52339. void 0 !== i &&
  52340. (h.repeat.fromArray(i),
  52341. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  52342. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  52343. void 0 !== r && h.offset.fromArray(r),
  52344. void 0 !== s &&
  52345. ('repeat' === s[0] && (h.wrapS = n.RepeatWrapping),
  52346. 'mirror' === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  52347. 'repeat' === s[1] && (h.wrapT = n.RepeatWrapping),
  52348. 'mirror' === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  52349. void 0 !== c && (h.anisotropy = c);
  52350. var p = n.Math.generateUUID();
  52351. return (l[p] = h), p;
  52352. }
  52353. void 0 === e && (e = new n.Color()),
  52354. void 0 === t && (t = new n.TextureLoader()),
  52355. void 0 === i && (i = new n.MaterialLoader());
  52356. var l = {},
  52357. c = {
  52358. uuid: n.Math.generateUUID(),
  52359. type: 'MeshLambertMaterial',
  52360. };
  52361. for (var h in r) {
  52362. var u = r[h];
  52363. switch (h) {
  52364. case 'DbgColor':
  52365. case 'DbgIndex':
  52366. case 'opticalDensity':
  52367. case 'illumination':
  52368. break;
  52369. case 'DbgName':
  52370. c.name = u;
  52371. break;
  52372. case 'blending':
  52373. c.blending = n[u];
  52374. break;
  52375. case 'colorAmbient':
  52376. case 'mapAmbient':
  52377. console.warn('THREE.Loader.createMaterial:', h, 'is no longer supported.');
  52378. break;
  52379. case 'colorDiffuse':
  52380. c.color = e.fromArray(u).getHex();
  52381. break;
  52382. case 'colorSpecular':
  52383. c.specular = e.fromArray(u).getHex();
  52384. break;
  52385. case 'colorEmissive':
  52386. c.emissive = e.fromArray(u).getHex();
  52387. break;
  52388. case 'specularCoef':
  52389. c.shininess = u;
  52390. break;
  52391. case 'shading':
  52392. 'basic' === u.toLowerCase() && (c.type = 'MeshBasicMaterial'),
  52393. 'phong' === u.toLowerCase() && (c.type = 'MeshPhongMaterial');
  52394. break;
  52395. case 'mapDiffuse':
  52396. c.map = s(
  52397. u,
  52398. r.mapDiffuseRepeat,
  52399. r.mapDiffuseOffset,
  52400. r.mapDiffuseWrap,
  52401. r.mapDiffuseAnisotropy
  52402. );
  52403. break;
  52404. case 'mapDiffuseRepeat':
  52405. case 'mapDiffuseOffset':
  52406. case 'mapDiffuseWrap':
  52407. case 'mapDiffuseAnisotropy':
  52408. break;
  52409. case 'mapLight':
  52410. c.lightMap = s(
  52411. u,
  52412. r.mapLightRepeat,
  52413. r.mapLightOffset,
  52414. r.mapLightWrap,
  52415. r.mapLightAnisotropy
  52416. );
  52417. break;
  52418. case 'mapLightRepeat':
  52419. case 'mapLightOffset':
  52420. case 'mapLightWrap':
  52421. case 'mapLightAnisotropy':
  52422. break;
  52423. case 'mapAO':
  52424. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  52425. break;
  52426. case 'mapAORepeat':
  52427. case 'mapAOOffset':
  52428. case 'mapAOWrap':
  52429. case 'mapAOAnisotropy':
  52430. break;
  52431. case 'mapBump':
  52432. c.bumpMap = s(
  52433. u,
  52434. r.mapBumpRepeat,
  52435. r.mapBumpOffset,
  52436. r.mapBumpWrap,
  52437. r.mapBumpAnisotropy
  52438. );
  52439. break;
  52440. case 'mapBumpScale':
  52441. c.bumpScale = u;
  52442. break;
  52443. case 'mapBumpRepeat':
  52444. case 'mapBumpOffset':
  52445. case 'mapBumpWrap':
  52446. case 'mapBumpAnisotropy':
  52447. break;
  52448. case 'mapNormal':
  52449. c.normalMap = s(
  52450. u,
  52451. r.mapNormalRepeat,
  52452. r.mapNormalOffset,
  52453. r.mapNormalWrap,
  52454. r.mapNormalAnisotropy
  52455. );
  52456. break;
  52457. case 'mapNormalFactor':
  52458. c.normalScale = [u, u];
  52459. break;
  52460. case 'mapNormalRepeat':
  52461. case 'mapNormalOffset':
  52462. case 'mapNormalWrap':
  52463. case 'mapNormalAnisotropy':
  52464. break;
  52465. case 'mapSpecular':
  52466. c.specularMap = s(
  52467. u,
  52468. r.mapSpecularRepeat,
  52469. r.mapSpecularOffset,
  52470. r.mapSpecularWrap,
  52471. r.mapSpecularAnisotropy
  52472. );
  52473. break;
  52474. case 'mapSpecularRepeat':
  52475. case 'mapSpecularOffset':
  52476. case 'mapSpecularWrap':
  52477. case 'mapSpecularAnisotropy':
  52478. break;
  52479. case 'mapAlpha':
  52480. c.alphaMap = s(
  52481. u,
  52482. r.mapAlphaRepeat,
  52483. r.mapAlphaOffset,
  52484. r.mapAlphaWrap,
  52485. r.mapAlphaAnisotropy
  52486. );
  52487. break;
  52488. case 'mapAlphaRepeat':
  52489. case 'mapAlphaOffset':
  52490. case 'mapAlphaWrap':
  52491. case 'mapAlphaAnisotropy':
  52492. break;
  52493. case 'flipSided':
  52494. c.side = n.BackSide;
  52495. break;
  52496. case 'doubleSided':
  52497. c.side = n.DoubleSide;
  52498. break;
  52499. case 'transparency':
  52500. console.warn(
  52501. 'THREE.Loader.createMaterial: transparency has been renamed to opacity'
  52502. ),
  52503. (c.opacity = u);
  52504. break;
  52505. case 'depthTest':
  52506. case 'depthWrite':
  52507. case 'colorWrite':
  52508. case 'opacity':
  52509. case 'reflectivity':
  52510. case 'transparent':
  52511. case 'visible':
  52512. case 'wireframe':
  52513. c[h] = u;
  52514. break;
  52515. case 'vertexColors':
  52516. u === !0 && (c.vertexColors = n.VertexColors),
  52517. 'face' === u && (c.vertexColors = n.FaceColors);
  52518. break;
  52519. default:
  52520. console.error('THREE.Loader.createMaterial: Unsupported', h, u);
  52521. }
  52522. }
  52523. return (
  52524. 'MeshBasicMaterial' === c.type && delete c.emissive,
  52525. 'MeshPhongMaterial' !== c.type && delete c.specular,
  52526. c.opacity < 1 && (c.transparent = !0),
  52527. i.setTextures(l),
  52528. i.parse(c)
  52529. );
  52530. };
  52531. })(),
  52532. }),
  52533. (n.Loader.Handlers = {
  52534. handlers: [],
  52535. add: function (e, t) {
  52536. this.handlers.push(e, t);
  52537. },
  52538. get: function (e) {
  52539. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  52540. var r = t[i],
  52541. o = t[i + 1];
  52542. if (r.test(e)) return o;
  52543. }
  52544. return null;
  52545. },
  52546. }),
  52547. (n.XHRLoader = function (e) {
  52548. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  52549. }),
  52550. (n.XHRLoader.prototype = {
  52551. constructor: n.XHRLoader,
  52552. load: function (e, t, i, r) {
  52553. void 0 !== this.path && (e = this.path + e);
  52554. var o = this,
  52555. a = n.Cache.get(e);
  52556. if (void 0 !== a)
  52557. return (
  52558. t &&
  52559. setTimeout(function () {
  52560. t(a);
  52561. }, 0),
  52562. a
  52563. );
  52564. var s = new XMLHttpRequest();
  52565. return (
  52566. s.overrideMimeType('text/plain'),
  52567. s.open('GET', e, !0),
  52568. s.addEventListener(
  52569. 'load',
  52570. function (i) {
  52571. var a = i.target.response;
  52572. n.Cache.add(e, a),
  52573. 200 === this.status
  52574. ? (t && t(a), o.manager.itemEnd(e))
  52575. : 0 === this.status
  52576. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'),
  52577. t && t(a),
  52578. o.manager.itemEnd(e))
  52579. : (r && r(i), o.manager.itemError(e));
  52580. },
  52581. !1
  52582. ),
  52583. void 0 !== i &&
  52584. s.addEventListener(
  52585. 'progress',
  52586. function (e) {
  52587. i(e);
  52588. },
  52589. !1
  52590. ),
  52591. s.addEventListener(
  52592. 'error',
  52593. function (t) {
  52594. r && r(t), o.manager.itemError(e);
  52595. },
  52596. !1
  52597. ),
  52598. void 0 !== this.responseType && (s.responseType = this.responseType),
  52599. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  52600. s.send(null),
  52601. o.manager.itemStart(e),
  52602. s
  52603. );
  52604. },
  52605. setPath: function (e) {
  52606. this.path = e;
  52607. },
  52608. setResponseType: function (e) {
  52609. this.responseType = e;
  52610. },
  52611. setWithCredentials: function (e) {
  52612. this.withCredentials = e;
  52613. },
  52614. }),
  52615. (n.FontLoader = function (e) {
  52616. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  52617. }),
  52618. (n.FontLoader.prototype = {
  52619. constructor: n.FontLoader,
  52620. load: function (e, t, i, r) {
  52621. var o = new n.XHRLoader(this.manager);
  52622. o.load(
  52623. e,
  52624. function (e) {
  52625. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))));
  52626. },
  52627. i,
  52628. r
  52629. );
  52630. },
  52631. }),
  52632. (n.ImageLoader = function (e) {
  52633. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  52634. }),
  52635. (n.ImageLoader.prototype = {
  52636. constructor: n.ImageLoader,
  52637. load: function (e, t, i, r) {
  52638. void 0 !== this.path && (e = this.path + e);
  52639. var o = this,
  52640. a = n.Cache.get(e);
  52641. if (void 0 !== a)
  52642. return (
  52643. o.manager.itemStart(e),
  52644. t
  52645. ? setTimeout(function () {
  52646. t(a), o.manager.itemEnd(e);
  52647. }, 0)
  52648. : o.manager.itemEnd(e),
  52649. a
  52650. );
  52651. var s = document.createElement('img');
  52652. return (
  52653. s.addEventListener(
  52654. 'load',
  52655. function (i) {
  52656. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e);
  52657. },
  52658. !1
  52659. ),
  52660. void 0 !== i &&
  52661. s.addEventListener(
  52662. 'progress',
  52663. function (e) {
  52664. i(e);
  52665. },
  52666. !1
  52667. ),
  52668. s.addEventListener(
  52669. 'error',
  52670. function (t) {
  52671. r && r(t), o.manager.itemError(e);
  52672. },
  52673. !1
  52674. ),
  52675. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  52676. o.manager.itemStart(e),
  52677. (s.src = e),
  52678. s
  52679. );
  52680. },
  52681. setCrossOrigin: function (e) {
  52682. this.crossOrigin = e;
  52683. },
  52684. setPath: function (e) {
  52685. this.path = e;
  52686. },
  52687. }),
  52688. (n.JSONLoader = function (e) {
  52689. 'boolean' == typeof e &&
  52690. (console.warn(
  52691. 'THREE.JSONLoader: showStatus parameter has been removed from constructor.'
  52692. ),
  52693. (e = void 0)),
  52694. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  52695. (this.withCredentials = !1);
  52696. }),
  52697. (n.JSONLoader.prototype = {
  52698. constructor: n.JSONLoader,
  52699. get statusDomElement() {
  52700. return (
  52701. void 0 === this._statusDomElement &&
  52702. (this._statusDomElement = document.createElement('div')),
  52703. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  52704. this._statusDomElement
  52705. );
  52706. },
  52707. load: function (e, t, i, r) {
  52708. var o = this,
  52709. a =
  52710. this.texturePath && 'string' == typeof this.texturePath
  52711. ? this.texturePath
  52712. : n.Loader.prototype.extractUrlBase(e),
  52713. s = new n.XHRLoader(this.manager);
  52714. s.setWithCredentials(this.withCredentials),
  52715. s.load(
  52716. e,
  52717. function (i) {
  52718. var n = JSON.parse(i),
  52719. r = n.metadata;
  52720. if (void 0 !== r) {
  52721. var s = r.type;
  52722. if (void 0 !== s) {
  52723. if ('object' === s.toLowerCase())
  52724. return void console.error(
  52725. 'THREE.JSONLoader: ' +
  52726. e +
  52727. ' should be loaded with THREE.ObjectLoader instead.'
  52728. );
  52729. if ('scene' === s.toLowerCase())
  52730. return void console.error(
  52731. 'THREE.JSONLoader: ' +
  52732. e +
  52733. ' should be loaded with THREE.SceneLoader instead.'
  52734. );
  52735. }
  52736. }
  52737. var l = o.parse(n, a);
  52738. t(l.geometry, l.materials);
  52739. },
  52740. i,
  52741. r
  52742. );
  52743. },
  52744. setTexturePath: function (e) {
  52745. this.texturePath = e;
  52746. },
  52747. parse: function (e, t) {
  52748. function i(t) {
  52749. function i(e, t) {
  52750. return e & (1 << t);
  52751. }
  52752. var r,
  52753. o,
  52754. a,
  52755. l,
  52756. c,
  52757. h,
  52758. u,
  52759. d,
  52760. p,
  52761. f,
  52762. g,
  52763. m,
  52764. v,
  52765. A,
  52766. y,
  52767. C,
  52768. I,
  52769. E,
  52770. b,
  52771. w,
  52772. _,
  52773. T,
  52774. x,
  52775. S,
  52776. M,
  52777. R,
  52778. P,
  52779. O = e.faces,
  52780. L = e.vertices,
  52781. D = e.normals,
  52782. N = e.colors,
  52783. B = 0;
  52784. if (void 0 !== e.uvs) {
  52785. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++;
  52786. for (r = 0; r < B; r++) s.faceVertexUvs[r] = [];
  52787. }
  52788. for (l = 0, c = L.length; l < c; )
  52789. (E = new n.Vector3()),
  52790. (E.x = L[l++] * t),
  52791. (E.y = L[l++] * t),
  52792. (E.z = L[l++] * t),
  52793. s.vertices.push(E);
  52794. for (l = 0, c = O.length; l < c; )
  52795. if (
  52796. ((f = O[l++]),
  52797. (g = i(f, 0)),
  52798. (m = i(f, 1)),
  52799. (v = i(f, 3)),
  52800. (A = i(f, 4)),
  52801. (y = i(f, 5)),
  52802. (C = i(f, 6)),
  52803. (I = i(f, 7)),
  52804. g)
  52805. ) {
  52806. if (
  52807. ((w = new n.Face3()),
  52808. (w.a = O[l]),
  52809. (w.b = O[l + 1]),
  52810. (w.c = O[l + 3]),
  52811. (_ = new n.Face3()),
  52812. (_.a = O[l + 1]),
  52813. (_.b = O[l + 2]),
  52814. (_.c = O[l + 3]),
  52815. (l += 4),
  52816. m && ((p = O[l++]), (w.materialIndex = p), (_.materialIndex = p)),
  52817. (a = s.faces.length),
  52818. v)
  52819. )
  52820. for (r = 0; r < B; r++)
  52821. for (
  52822. S = e.uvs[r],
  52823. s.faceVertexUvs[r][a] = [],
  52824. s.faceVertexUvs[r][a + 1] = [],
  52825. o = 0;
  52826. o < 4;
  52827. o++
  52828. )
  52829. (d = O[l++]),
  52830. (R = S[2 * d]),
  52831. (P = S[2 * d + 1]),
  52832. (M = new n.Vector2(R, P)),
  52833. 2 !== o && s.faceVertexUvs[r][a].push(M),
  52834. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  52835. if (
  52836. (A &&
  52837. ((u = 3 * O[l++]),
  52838. w.normal.set(D[u++], D[u++], D[u]),
  52839. _.normal.copy(w.normal)),
  52840. y)
  52841. )
  52842. for (r = 0; r < 4; r++)
  52843. (u = 3 * O[l++]),
  52844. (x = new n.Vector3(D[u++], D[u++], D[u])),
  52845. 2 !== r && w.vertexNormals.push(x),
  52846. 0 !== r && _.vertexNormals.push(x);
  52847. if ((C && ((h = O[l++]), (T = N[h]), w.color.setHex(T), _.color.setHex(T)), I))
  52848. for (r = 0; r < 4; r++)
  52849. (h = O[l++]),
  52850. (T = N[h]),
  52851. 2 !== r && w.vertexColors.push(new n.Color(T)),
  52852. 0 !== r && _.vertexColors.push(new n.Color(T));
  52853. s.faces.push(w), s.faces.push(_);
  52854. } else {
  52855. if (
  52856. ((b = new n.Face3()),
  52857. (b.a = O[l++]),
  52858. (b.b = O[l++]),
  52859. (b.c = O[l++]),
  52860. m && ((p = O[l++]), (b.materialIndex = p)),
  52861. (a = s.faces.length),
  52862. v)
  52863. )
  52864. for (r = 0; r < B; r++)
  52865. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0; o < 3; o++)
  52866. (d = O[l++]),
  52867. (R = S[2 * d]),
  52868. (P = S[2 * d + 1]),
  52869. (M = new n.Vector2(R, P)),
  52870. s.faceVertexUvs[r][a].push(M);
  52871. if ((A && ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])), y))
  52872. for (r = 0; r < 3; r++)
  52873. (u = 3 * O[l++]),
  52874. (x = new n.Vector3(D[u++], D[u++], D[u])),
  52875. b.vertexNormals.push(x);
  52876. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I))
  52877. for (r = 0; r < 3; r++) (h = O[l++]), b.vertexColors.push(new n.Color(N[h]));
  52878. s.faces.push(b);
  52879. }
  52880. }
  52881. function r() {
  52882. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  52883. if (e.skinWeights)
  52884. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  52885. var o = e.skinWeights[i],
  52886. a = t > 1 ? e.skinWeights[i + 1] : 0,
  52887. l = t > 2 ? e.skinWeights[i + 2] : 0,
  52888. c = t > 3 ? e.skinWeights[i + 3] : 0;
  52889. s.skinWeights.push(new n.Vector4(o, a, l, c));
  52890. }
  52891. if (e.skinIndices)
  52892. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  52893. var h = e.skinIndices[i],
  52894. u = t > 1 ? e.skinIndices[i + 1] : 0,
  52895. d = t > 2 ? e.skinIndices[i + 2] : 0,
  52896. p = t > 3 ? e.skinIndices[i + 3] : 0;
  52897. s.skinIndices.push(new n.Vector4(h, u, d, p));
  52898. }
  52899. (s.bones = e.bones),
  52900. s.bones &&
  52901. s.bones.length > 0 &&
  52902. (s.skinWeights.length !== s.skinIndices.length ||
  52903. s.skinIndices.length !== s.vertices.length) &&
  52904. console.warn(
  52905. 'When skinning, number of vertices (' +
  52906. s.vertices.length +
  52907. '), skinIndices (' +
  52908. s.skinIndices.length +
  52909. '), and skinWeights (' +
  52910. s.skinWeights.length +
  52911. ') should match.'
  52912. );
  52913. }
  52914. function o(t) {
  52915. if (void 0 !== e.morphTargets)
  52916. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  52917. (s.morphTargets[i] = {}),
  52918. (s.morphTargets[i].name = e.morphTargets[i].name),
  52919. (s.morphTargets[i].vertices = []);
  52920. for (
  52921. var o = s.morphTargets[i].vertices,
  52922. a = e.morphTargets[i].vertices,
  52923. l = 0,
  52924. c = a.length;
  52925. l < c;
  52926. l += 3
  52927. ) {
  52928. var h = new n.Vector3();
  52929. (h.x = a[l] * t), (h.y = a[l + 1] * t), (h.z = a[l + 2] * t), o.push(h);
  52930. }
  52931. }
  52932. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  52933. console.warn(
  52934. 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'
  52935. );
  52936. for (
  52937. var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length;
  52938. i < r;
  52939. i++
  52940. )
  52941. u[i].color.fromArray(d, 3 * i);
  52942. }
  52943. }
  52944. function a() {
  52945. var t = [],
  52946. i = [];
  52947. void 0 !== e.animation && i.push(e.animation),
  52948. void 0 !== e.animations &&
  52949. (e.animations.length ? (i = i.concat(e.animations)) : i.push(e.animations));
  52950. for (var r = 0; r < i.length; r++) {
  52951. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  52952. o && t.push(o);
  52953. }
  52954. if (s.morphTargets) {
  52955. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  52956. t = t.concat(a);
  52957. }
  52958. t.length > 0 && (s.animations = t);
  52959. }
  52960. var s = new n.Geometry(),
  52961. l = void 0 !== e.scale ? 1 / e.scale : 1;
  52962. if (
  52963. (i(l),
  52964. r(),
  52965. o(l),
  52966. a(),
  52967. s.computeFaceNormals(),
  52968. s.computeBoundingSphere(),
  52969. void 0 === e.materials || 0 === e.materials.length)
  52970. )
  52971. return {
  52972. geometry: s,
  52973. };
  52974. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  52975. return {
  52976. geometry: s,
  52977. materials: c,
  52978. };
  52979. },
  52980. }),
  52981. (n.LoadingManager = function (e, t, i) {
  52982. var n = this,
  52983. r = !1,
  52984. o = 0,
  52985. a = 0;
  52986. (this.onStart = void 0),
  52987. (this.onLoad = e),
  52988. (this.onProgress = t),
  52989. (this.onError = i),
  52990. (this.itemStart = function (e) {
  52991. a++, r === !1 && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0);
  52992. }),
  52993. (this.itemEnd = function (e) {
  52994. o++,
  52995. void 0 !== n.onProgress && n.onProgress(e, o, a),
  52996. o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad());
  52997. }),
  52998. (this.itemError = function (e) {
  52999. void 0 !== n.onError && n.onError(e);
  53000. });
  53001. }),
  53002. (n.DefaultLoadingManager = new n.LoadingManager()),
  53003. (n.BufferGeometryLoader = function (e) {
  53004. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  53005. }),
  53006. (n.BufferGeometryLoader.prototype = {
  53007. constructor: n.BufferGeometryLoader,
  53008. load: function (e, t, i, r) {
  53009. var o = this,
  53010. a = new n.XHRLoader(o.manager);
  53011. a.load(
  53012. e,
  53013. function (e) {
  53014. t(o.parse(JSON.parse(e)));
  53015. },
  53016. i,
  53017. r
  53018. );
  53019. },
  53020. parse: function (e) {
  53021. var t = new n.BufferGeometry(),
  53022. i = e.data.index,
  53023. r = {
  53024. Int8Array: Int8Array,
  53025. Uint8Array: Uint8Array,
  53026. Uint8ClampedArray: Uint8ClampedArray,
  53027. Int16Array: Int16Array,
  53028. Uint16Array: Uint16Array,
  53029. Int32Array: Int32Array,
  53030. Uint32Array: Uint32Array,
  53031. Float32Array: Float32Array,
  53032. Float64Array: Float64Array,
  53033. };
  53034. if (void 0 !== i) {
  53035. var o = new r[i.type](i.array);
  53036. t.setIndex(new n.BufferAttribute(o, 1));
  53037. }
  53038. var a = e.data.attributes;
  53039. for (var s in a) {
  53040. var l = a[s],
  53041. o = new r[l.type](l.array);
  53042. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize));
  53043. }
  53044. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  53045. if (void 0 !== c)
  53046. for (var h = 0, u = c.length; h !== u; ++h) {
  53047. var d = c[h];
  53048. t.addGroup(d.start, d.count, d.materialIndex);
  53049. }
  53050. var p = e.data.boundingSphere;
  53051. if (void 0 !== p) {
  53052. var f = new n.Vector3();
  53053. void 0 !== p.center && f.fromArray(p.center),
  53054. (t.boundingSphere = new n.Sphere(f, p.radius));
  53055. }
  53056. return t;
  53057. },
  53058. }),
  53059. (n.MaterialLoader = function (e) {
  53060. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.textures = {});
  53061. }),
  53062. (n.MaterialLoader.prototype = {
  53063. constructor: n.MaterialLoader,
  53064. load: function (e, t, i, r) {
  53065. var o = this,
  53066. a = new n.XHRLoader(o.manager);
  53067. a.load(
  53068. e,
  53069. function (e) {
  53070. t(o.parse(JSON.parse(e)));
  53071. },
  53072. i,
  53073. r
  53074. );
  53075. },
  53076. setTextures: function (e) {
  53077. this.textures = e;
  53078. },
  53079. getTexture: function (e) {
  53080. var t = this.textures;
  53081. return (
  53082. void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  53083. );
  53084. },
  53085. parse: function (e) {
  53086. var t = new n[e.type]();
  53087. if (
  53088. (void 0 !== e.uuid && (t.uuid = e.uuid),
  53089. void 0 !== e.name && (t.name = e.name),
  53090. void 0 !== e.color && t.color.setHex(e.color),
  53091. void 0 !== e.roughness && (t.roughness = e.roughness),
  53092. void 0 !== e.metalness && (t.metalness = e.metalness),
  53093. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  53094. void 0 !== e.specular && t.specular.setHex(e.specular),
  53095. void 0 !== e.shininess && (t.shininess = e.shininess),
  53096. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  53097. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  53098. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  53099. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  53100. void 0 !== e.shading && (t.shading = e.shading),
  53101. void 0 !== e.blending && (t.blending = e.blending),
  53102. void 0 !== e.side && (t.side = e.side),
  53103. void 0 !== e.opacity && (t.opacity = e.opacity),
  53104. void 0 !== e.transparent && (t.transparent = e.transparent),
  53105. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  53106. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  53107. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  53108. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  53109. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  53110. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  53111. void 0 !== e.size && (t.size = e.size),
  53112. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  53113. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  53114. void 0 !== e.alphaMap &&
  53115. ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  53116. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  53117. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  53118. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  53119. void 0 !== e.normalScale)
  53120. ) {
  53121. var i = e.normalScale;
  53122. Array.isArray(i) === !1 && (i = [i, i]),
  53123. (t.normalScale = new n.Vector2().fromArray(i));
  53124. }
  53125. if (
  53126. (void 0 !== e.displacementMap &&
  53127. (t.displacementMap = this.getTexture(e.displacementMap)),
  53128. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  53129. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  53130. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  53131. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  53132. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  53133. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  53134. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  53135. void 0 !== e.envMap &&
  53136. ((t.envMap = this.getTexture(e.envMap)), (t.combine = n.MultiplyOperation)),
  53137. e.reflectivity && (t.reflectivity = e.reflectivity),
  53138. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  53139. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  53140. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  53141. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  53142. void 0 !== e.materials)
  53143. )
  53144. for (var r = 0, o = e.materials.length; r < o; r++)
  53145. t.materials.push(this.parse(e.materials[r]));
  53146. return t;
  53147. },
  53148. }),
  53149. (n.ObjectLoader = function (e) {
  53150. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.texturePath = '');
  53151. }),
  53152. (n.ObjectLoader.prototype = {
  53153. constructor: n.ObjectLoader,
  53154. load: function (e, t, i, r) {
  53155. '' === this.texturePath &&
  53156. (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1));
  53157. var o = this,
  53158. a = new n.XHRLoader(o.manager);
  53159. a.load(
  53160. e,
  53161. function (e) {
  53162. o.parse(JSON.parse(e), t);
  53163. },
  53164. i,
  53165. r
  53166. );
  53167. },
  53168. setTexturePath: function (e) {
  53169. this.texturePath = e;
  53170. },
  53171. setCrossOrigin: function (e) {
  53172. this.crossOrigin = e;
  53173. },
  53174. parse: function (e, t) {
  53175. var i = this.parseGeometries(e.geometries),
  53176. n = this.parseImages(e.images, function () {
  53177. void 0 !== t && t(a);
  53178. }),
  53179. r = this.parseTextures(e.textures, n),
  53180. o = this.parseMaterials(e.materials, r),
  53181. a = this.parseObject(e.object, i, o);
  53182. return (
  53183. e.animations && (a.animations = this.parseAnimations(e.animations)),
  53184. (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)),
  53185. a
  53186. );
  53187. },
  53188. parseGeometries: function (e) {
  53189. var t = {};
  53190. if (void 0 !== e)
  53191. for (
  53192. var i = new n.JSONLoader(), r = new n.BufferGeometryLoader(), o = 0, a = e.length;
  53193. o < a;
  53194. o++
  53195. ) {
  53196. var s,
  53197. l = e[o];
  53198. switch (l.type) {
  53199. case 'PlaneGeometry':
  53200. case 'PlaneBufferGeometry':
  53201. s = new n[l.type](l.width, l.height, l.widthSegments, l.heightSegments);
  53202. break;
  53203. case 'BoxGeometry':
  53204. case 'BoxBufferGeometry':
  53205. case 'CubeGeometry':
  53206. s = new n[l.type](
  53207. l.width,
  53208. l.height,
  53209. l.depth,
  53210. l.widthSegments,
  53211. l.heightSegments,
  53212. l.depthSegments
  53213. );
  53214. break;
  53215. case 'CircleGeometry':
  53216. case 'CircleBufferGeometry':
  53217. s = new n[l.type](l.radius, l.segments, l.thetaStart, l.thetaLength);
  53218. break;
  53219. case 'CylinderGeometry':
  53220. case 'CylinderBufferGeometry':
  53221. s = new n[l.type](
  53222. l.radiusTop,
  53223. l.radiusBottom,
  53224. l.height,
  53225. l.radialSegments,
  53226. l.heightSegments,
  53227. l.openEnded,
  53228. l.thetaStart,
  53229. l.thetaLength
  53230. );
  53231. break;
  53232. case 'SphereGeometry':
  53233. case 'SphereBufferGeometry':
  53234. s = new n[l.type](
  53235. l.radius,
  53236. l.widthSegments,
  53237. l.heightSegments,
  53238. l.phiStart,
  53239. l.phiLength,
  53240. l.thetaStart,
  53241. l.thetaLength
  53242. );
  53243. break;
  53244. case 'DodecahedronGeometry':
  53245. s = new n.DodecahedronGeometry(l.radius, l.detail);
  53246. break;
  53247. case 'IcosahedronGeometry':
  53248. s = new n.IcosahedronGeometry(l.radius, l.detail);
  53249. break;
  53250. case 'OctahedronGeometry':
  53251. s = new n.OctahedronGeometry(l.radius, l.detail);
  53252. break;
  53253. case 'TetrahedronGeometry':
  53254. s = new n.TetrahedronGeometry(l.radius, l.detail);
  53255. break;
  53256. case 'RingGeometry':
  53257. case 'RingBufferGeometry':
  53258. s = new n[l.type](
  53259. l.innerRadius,
  53260. l.outerRadius,
  53261. l.thetaSegments,
  53262. l.phiSegments,
  53263. l.thetaStart,
  53264. l.thetaLength
  53265. );
  53266. break;
  53267. case 'TorusGeometry':
  53268. case 'TorusBufferGeometry':
  53269. s = new n[l.type](
  53270. l.radius,
  53271. l.tube,
  53272. l.radialSegments,
  53273. l.tubularSegments,
  53274. l.arc
  53275. );
  53276. break;
  53277. case 'TorusKnotGeometry':
  53278. case 'TorusKnotBufferGeometry':
  53279. s = new n[l.type](
  53280. l.radius,
  53281. l.tube,
  53282. l.tubularSegments,
  53283. l.radialSegments,
  53284. l.p,
  53285. l.q
  53286. );
  53287. break;
  53288. case 'LatheGeometry':
  53289. s = new n.LatheGeometry(l.points, l.segments, l.phiStart, l.phiLength);
  53290. break;
  53291. case 'BufferGeometry':
  53292. s = r.parse(l);
  53293. break;
  53294. case 'Geometry':
  53295. s = i.parse(l.data, this.texturePath).geometry;
  53296. break;
  53297. default:
  53298. console.warn(
  53299. 'THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"'
  53300. );
  53301. continue;
  53302. }
  53303. (s.uuid = l.uuid), void 0 !== l.name && (s.name = l.name), (t[l.uuid] = s);
  53304. }
  53305. return t;
  53306. },
  53307. parseMaterials: function (e, t) {
  53308. var i = {};
  53309. if (void 0 !== e) {
  53310. var r = new n.MaterialLoader();
  53311. r.setTextures(t);
  53312. for (var o = 0, a = e.length; o < a; o++) {
  53313. var s = r.parse(e[o]);
  53314. i[s.uuid] = s;
  53315. }
  53316. }
  53317. return i;
  53318. },
  53319. parseAnimations: function (e) {
  53320. for (var t = [], i = 0; i < e.length; i++) {
  53321. var r = n.AnimationClip.parse(e[i]);
  53322. t.push(r);
  53323. }
  53324. return t;
  53325. },
  53326. parseImages: function (e, t) {
  53327. function i(e) {
  53328. return (
  53329. r.manager.itemStart(e),
  53330. s.load(e, function () {
  53331. r.manager.itemEnd(e);
  53332. })
  53333. );
  53334. }
  53335. var r = this,
  53336. o = {};
  53337. if (void 0 !== e && e.length > 0) {
  53338. var a = new n.LoadingManager(t),
  53339. s = new n.ImageLoader(a);
  53340. s.setCrossOrigin(this.crossOrigin);
  53341. for (var l = 0, c = e.length; l < c; l++) {
  53342. var h = e[l],
  53343. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  53344. o[h.uuid] = i(u);
  53345. }
  53346. }
  53347. return o;
  53348. },
  53349. parseTextures: function (e, t) {
  53350. function i(e) {
  53351. return 'number' == typeof e
  53352. ? e
  53353. : (console.warn(
  53354. 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.',
  53355. e
  53356. ),
  53357. n[e]);
  53358. }
  53359. var r = {};
  53360. if (void 0 !== e)
  53361. for (var o = 0, a = e.length; o < a; o++) {
  53362. var s = e[o];
  53363. void 0 === s.image &&
  53364. console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  53365. void 0 === t[s.image] &&
  53366. console.warn('THREE.ObjectLoader: Undefined image', s.image);
  53367. var l = new n.Texture(t[s.image]);
  53368. (l.needsUpdate = !0),
  53369. (l.uuid = s.uuid),
  53370. void 0 !== s.name && (l.name = s.name),
  53371. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  53372. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  53373. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  53374. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  53375. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  53376. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  53377. Array.isArray(s.wrap) && ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  53378. (r[s.uuid] = l);
  53379. }
  53380. return r;
  53381. },
  53382. parseObject: (function () {
  53383. var e = new n.Matrix4();
  53384. return function (t, i, r) {
  53385. function o(e) {
  53386. return (
  53387. void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e),
  53388. i[e]
  53389. );
  53390. }
  53391. function a(e) {
  53392. if (void 0 !== e)
  53393. return (
  53394. void 0 === r[e] && console.warn('THREE.ObjectLoader: Undefined material', e),
  53395. r[e]
  53396. );
  53397. }
  53398. var s;
  53399. switch (t.type) {
  53400. case 'Scene':
  53401. s = new n.Scene();
  53402. break;
  53403. case 'PerspectiveCamera':
  53404. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far);
  53405. break;
  53406. case 'OrthographicCamera':
  53407. s = new n.OrthographicCamera(t.left, t.right, t.top, t.bottom, t.near, t.far);
  53408. break;
  53409. case 'AmbientLight':
  53410. s = new n.AmbientLight(t.color, t.intensity);
  53411. break;
  53412. case 'DirectionalLight':
  53413. s = new n.DirectionalLight(t.color, t.intensity);
  53414. break;
  53415. case 'PointLight':
  53416. s = new n.PointLight(t.color, t.intensity, t.distance, t.decay);
  53417. break;
  53418. case 'SpotLight':
  53419. s = new n.SpotLight(
  53420. t.color,
  53421. t.intensity,
  53422. t.distance,
  53423. t.angle,
  53424. t.penumbra,
  53425. t.decay
  53426. );
  53427. break;
  53428. case 'HemisphereLight':
  53429. s = new n.HemisphereLight(t.color, t.groundColor, t.intensity);
  53430. break;
  53431. case 'Mesh':
  53432. var l = o(t.geometry),
  53433. c = a(t.material);
  53434. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l, c) : new n.Mesh(l, c);
  53435. break;
  53436. case 'LOD':
  53437. s = new n.LOD();
  53438. break;
  53439. case 'Line':
  53440. s = new n.Line(o(t.geometry), a(t.material), t.mode);
  53441. break;
  53442. case 'PointCloud':
  53443. case 'Points':
  53444. s = new n.Points(o(t.geometry), a(t.material));
  53445. break;
  53446. case 'Sprite':
  53447. s = new n.Sprite(a(t.material));
  53448. break;
  53449. case 'Group':
  53450. s = new n.Group();
  53451. break;
  53452. default:
  53453. s = new n.Object3D();
  53454. }
  53455. if (
  53456. ((s.uuid = t.uuid),
  53457. void 0 !== t.name && (s.name = t.name),
  53458. void 0 !== t.matrix
  53459. ? (e.fromArray(t.matrix), e.decompose(s.position, s.quaternion, s.scale))
  53460. : (void 0 !== t.position && s.position.fromArray(t.position),
  53461. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  53462. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  53463. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  53464. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  53465. void 0 !== t.visible && (s.visible = t.visible),
  53466. void 0 !== t.userData && (s.userData = t.userData),
  53467. void 0 !== t.children)
  53468. )
  53469. for (var h in t.children) s.add(this.parseObject(t.children[h], i, r));
  53470. if ('LOD' === t.type)
  53471. for (var u = t.levels, d = 0; d < u.length; d++) {
  53472. var p = u[d],
  53473. h = s.getObjectByProperty('uuid', p.object);
  53474. void 0 !== h && s.addLevel(h, p.distance);
  53475. }
  53476. return s;
  53477. };
  53478. })(),
  53479. }),
  53480. (n.TextureLoader = function (e) {
  53481. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  53482. }),
  53483. (n.TextureLoader.prototype = {
  53484. constructor: n.TextureLoader,
  53485. load: function (e, t, i, r) {
  53486. var o = new n.Texture(),
  53487. a = new n.ImageLoader(this.manager);
  53488. return (
  53489. a.setCrossOrigin(this.crossOrigin),
  53490. a.setPath(this.path),
  53491. a.load(
  53492. e,
  53493. function (e) {
  53494. (o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o);
  53495. },
  53496. i,
  53497. r
  53498. ),
  53499. o
  53500. );
  53501. },
  53502. setCrossOrigin: function (e) {
  53503. this.crossOrigin = e;
  53504. },
  53505. setPath: function (e) {
  53506. this.path = e;
  53507. },
  53508. }),
  53509. (n.CubeTextureLoader = function (e) {
  53510. this.manager = void 0 !== e ? e : n.DefaultLoadingManager;
  53511. }),
  53512. (n.CubeTextureLoader.prototype = {
  53513. constructor: n.CubeTextureLoader,
  53514. load: function (e, t, i, r) {
  53515. function o(i) {
  53516. s.load(
  53517. e[i],
  53518. function (e) {
  53519. (a.images[i] = e), l++, 6 === l && ((a.needsUpdate = !0), t && t(a));
  53520. },
  53521. void 0,
  53522. r
  53523. );
  53524. }
  53525. var a = new n.CubeTexture(),
  53526. s = new n.ImageLoader(this.manager);
  53527. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path);
  53528. for (var l = 0, c = 0; c < e.length; ++c) o(c);
  53529. return a;
  53530. },
  53531. setCrossOrigin: function (e) {
  53532. this.crossOrigin = e;
  53533. },
  53534. setPath: function (e) {
  53535. this.path = e;
  53536. },
  53537. }),
  53538. (n.DataTextureLoader = n.BinaryTextureLoader =
  53539. function (e) {
  53540. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null);
  53541. }),
  53542. (n.BinaryTextureLoader.prototype = {
  53543. constructor: n.BinaryTextureLoader,
  53544. load: function (e, t, i, r) {
  53545. var o = this,
  53546. a = new n.DataTexture(),
  53547. s = new n.XHRLoader(this.manager);
  53548. return (
  53549. s.setResponseType('arraybuffer'),
  53550. s.load(
  53551. e,
  53552. function (e) {
  53553. var i = o._parser(e);
  53554. i &&
  53555. (void 0 !== i.image
  53556. ? (a.image = i.image)
  53557. : void 0 !== i.data &&
  53558. ((a.image.width = i.width),
  53559. (a.image.height = i.height),
  53560. (a.image.data = i.data)),
  53561. (a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  53562. (a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  53563. (a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  53564. (a.minFilter =
  53565. void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter),
  53566. (a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1),
  53567. void 0 !== i.format && (a.format = i.format),
  53568. void 0 !== i.type && (a.type = i.type),
  53569. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  53570. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  53571. (a.needsUpdate = !0),
  53572. t && t(a, i));
  53573. },
  53574. i,
  53575. r
  53576. ),
  53577. a
  53578. );
  53579. },
  53580. }),
  53581. (n.CompressedTextureLoader = function (e) {
  53582. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null);
  53583. });
  53584. n.CompressedTextureLoader.prototype = {
  53585. constructor: n.CompressedTextureLoader,
  53586. load: function (e, t, i, r) {
  53587. function o(o) {
  53588. c.load(
  53589. e[o],
  53590. function (e) {
  53591. var i = a._parser(e, !0);
  53592. (s[o] = {
  53593. width: i.width,
  53594. height: i.height,
  53595. format: i.format,
  53596. mipmaps: i.mipmaps,
  53597. }),
  53598. (h += 1),
  53599. 6 === h &&
  53600. (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53601. (l.format = i.format),
  53602. (l.needsUpdate = !0),
  53603. t && t(l));
  53604. },
  53605. i,
  53606. r
  53607. );
  53608. }
  53609. var a = this,
  53610. s = [],
  53611. l = new n.CompressedTexture();
  53612. l.image = s;
  53613. var c = new n.XHRLoader(this.manager);
  53614. if ((c.setPath(this.path), c.setResponseType('arraybuffer'), Array.isArray(e)))
  53615. for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u);
  53616. else
  53617. c.load(
  53618. e,
  53619. function (e) {
  53620. var i = a._parser(e, !0);
  53621. if (i.isCubemap)
  53622. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  53623. s[o] = {
  53624. mipmaps: [],
  53625. };
  53626. for (var c = 0; c < i.mipmapCount; c++)
  53627. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  53628. (s[o].format = i.format),
  53629. (s[o].width = i.width),
  53630. (s[o].height = i.height);
  53631. }
  53632. else
  53633. (l.image.width = i.width), (l.image.height = i.height), (l.mipmaps = i.mipmaps);
  53634. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53635. (l.format = i.format),
  53636. (l.needsUpdate = !0),
  53637. t && t(l);
  53638. },
  53639. i,
  53640. r
  53641. );
  53642. return l;
  53643. },
  53644. setPath: function (e) {
  53645. this.path = e;
  53646. },
  53647. };
  53648. (n.Material = function () {
  53649. Object.defineProperty(this, 'id', {
  53650. value: n.MaterialIdCount++,
  53651. }),
  53652. (this.uuid = n.Math.generateUUID()),
  53653. (this.name = ''),
  53654. (this.type = 'Material'),
  53655. (this.side = n.FrontSide),
  53656. (this.opacity = 1),
  53657. (this.transparent = !1),
  53658. (this.blending = n.NormalBlending),
  53659. (this.blendSrc = n.SrcAlphaFactor),
  53660. (this.blendDst = n.OneMinusSrcAlphaFactor),
  53661. (this.blendEquation = n.AddEquation),
  53662. (this.blendSrcAlpha = null),
  53663. (this.blendDstAlpha = null),
  53664. (this.blendEquationAlpha = null),
  53665. (this.depthFunc = n.LessEqualDepth),
  53666. (this.depthTest = !0),
  53667. (this.depthWrite = !0),
  53668. (this.colorWrite = !0),
  53669. (this.precision = null),
  53670. (this.polygonOffset = !1),
  53671. (this.polygonOffsetFactor = 0),
  53672. (this.polygonOffsetUnits = 0),
  53673. (this.alphaTest = 0),
  53674. (this.premultipliedAlpha = !1),
  53675. (this.overdraw = 0),
  53676. (this.visible = !0),
  53677. (this._needsUpdate = !0);
  53678. }),
  53679. (n.Material.prototype = {
  53680. constructor: n.Material,
  53681. get needsUpdate() {
  53682. return this._needsUpdate;
  53683. },
  53684. set needsUpdate(e) {
  53685. e === !0 && this.update(), (this._needsUpdate = e);
  53686. },
  53687. setValues: function (e) {
  53688. if (void 0 !== e)
  53689. for (var t in e) {
  53690. var i = e[t];
  53691. if (void 0 !== i) {
  53692. var r = this[t];
  53693. void 0 !== r
  53694. ? r instanceof n.Color
  53695. ? r.set(i)
  53696. : r instanceof n.Vector3 && i instanceof n.Vector3
  53697. ? r.copy(i)
  53698. : 'overdraw' === t
  53699. ? (this[t] = Number(i))
  53700. : (this[t] = i)
  53701. : console.warn(
  53702. 'THREE.' + this.type + ": '" + t + "' is not a property of this material."
  53703. );
  53704. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.");
  53705. }
  53706. },
  53707. toJSON: function (e) {
  53708. function t(e) {
  53709. var t = [];
  53710. for (var i in e) {
  53711. var n = e[i];
  53712. delete n.metadata, t.push(n);
  53713. }
  53714. return t;
  53715. }
  53716. var i = void 0 === e;
  53717. i &&
  53718. (e = {
  53719. textures: {},
  53720. images: {},
  53721. });
  53722. var r = {
  53723. metadata: {
  53724. version: 4.4,
  53725. type: 'Material',
  53726. generator: 'Material.toJSON',
  53727. },
  53728. };
  53729. if (
  53730. ((r.uuid = this.uuid),
  53731. (r.type = this.type),
  53732. '' !== this.name && (r.name = this.name),
  53733. this.color instanceof n.Color && (r.color = this.color.getHex()),
  53734. 0.5 !== this.roughness && (r.roughness = this.roughness),
  53735. 0.5 !== this.metalness && (r.metalness = this.metalness),
  53736. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  53737. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  53738. void 0 !== this.shininess && (r.shininess = this.shininess),
  53739. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  53740. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  53741. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  53742. this.bumpMap instanceof n.Texture &&
  53743. ((r.bumpMap = this.bumpMap.toJSON(e).uuid), (r.bumpScale = this.bumpScale)),
  53744. this.normalMap instanceof n.Texture &&
  53745. ((r.normalMap = this.normalMap.toJSON(e).uuid),
  53746. (r.normalScale = this.normalScale.toArray())),
  53747. this.displacementMap instanceof n.Texture &&
  53748. ((r.displacementMap = this.displacementMap.toJSON(e).uuid),
  53749. (r.displacementScale = this.displacementScale),
  53750. (r.displacementBias = this.displacementBias)),
  53751. this.roughnessMap instanceof n.Texture &&
  53752. (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  53753. this.metalnessMap instanceof n.Texture &&
  53754. (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  53755. this.emissiveMap instanceof n.Texture &&
  53756. (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  53757. this.specularMap instanceof n.Texture &&
  53758. (r.specularMap = this.specularMap.toJSON(e).uuid),
  53759. this.envMap instanceof n.Texture &&
  53760. ((r.envMap = this.envMap.toJSON(e).uuid), (r.reflectivity = this.reflectivity)),
  53761. void 0 !== this.size && (r.size = this.size),
  53762. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  53763. void 0 !== this.vertexColors &&
  53764. this.vertexColors !== n.NoColors &&
  53765. (r.vertexColors = this.vertexColors),
  53766. void 0 !== this.shading &&
  53767. this.shading !== n.SmoothShading &&
  53768. (r.shading = this.shading),
  53769. void 0 !== this.blending &&
  53770. this.blending !== n.NormalBlending &&
  53771. (r.blending = this.blending),
  53772. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  53773. this.opacity < 1 && (r.opacity = this.opacity),
  53774. this.transparent === !0 && (r.transparent = this.transparent),
  53775. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  53776. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  53777. this.wireframe === !0 && (r.wireframe = this.wireframe),
  53778. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  53779. i)
  53780. ) {
  53781. var o = t(e.textures),
  53782. a = t(e.images);
  53783. o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a);
  53784. }
  53785. return r;
  53786. },
  53787. clone: function () {
  53788. return new this.constructor().copy(this);
  53789. },
  53790. copy: function (e) {
  53791. return (
  53792. (this.name = e.name),
  53793. (this.side = e.side),
  53794. (this.opacity = e.opacity),
  53795. (this.transparent = e.transparent),
  53796. (this.blending = e.blending),
  53797. (this.blendSrc = e.blendSrc),
  53798. (this.blendDst = e.blendDst),
  53799. (this.blendEquation = e.blendEquation),
  53800. (this.blendSrcAlpha = e.blendSrcAlpha),
  53801. (this.blendDstAlpha = e.blendDstAlpha),
  53802. (this.blendEquationAlpha = e.blendEquationAlpha),
  53803. (this.depthFunc = e.depthFunc),
  53804. (this.depthTest = e.depthTest),
  53805. (this.depthWrite = e.depthWrite),
  53806. (this.colorWrite = e.colorWrite),
  53807. (this.precision = e.precision),
  53808. (this.polygonOffset = e.polygonOffset),
  53809. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  53810. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  53811. (this.alphaTest = e.alphaTest),
  53812. (this.premultipliedAlpha = e.premultipliedAlpha),
  53813. (this.overdraw = e.overdraw),
  53814. (this.visible = e.visible),
  53815. this
  53816. );
  53817. },
  53818. update: function () {
  53819. this.dispatchEvent({
  53820. type: 'update',
  53821. });
  53822. },
  53823. dispose: function () {
  53824. this.dispatchEvent({
  53825. type: 'dispose',
  53826. });
  53827. },
  53828. }),
  53829. n.EventDispatcher.prototype.apply(n.Material.prototype),
  53830. (n.MaterialIdCount = 0),
  53831. (n.LineBasicMaterial = function (e) {
  53832. n.Material.call(this),
  53833. (this.type = 'LineBasicMaterial'),
  53834. (this.color = new n.Color(16777215)),
  53835. (this.linewidth = 1),
  53836. (this.linecap = 'round'),
  53837. (this.linejoin = 'round'),
  53838. (this.blending = n.NormalBlending),
  53839. (this.vertexColors = n.NoColors),
  53840. (this.fog = !0),
  53841. this.setValues(e);
  53842. }),
  53843. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  53844. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  53845. (n.LineBasicMaterial.prototype.copy = function (e) {
  53846. return (
  53847. n.Material.prototype.copy.call(this, e),
  53848. this.color.copy(e.color),
  53849. (this.linewidth = e.linewidth),
  53850. (this.linecap = e.linecap),
  53851. (this.linejoin = e.linejoin),
  53852. (this.vertexColors = e.vertexColors),
  53853. (this.fog = e.fog),
  53854. this
  53855. );
  53856. }),
  53857. (n.LineDashedMaterial = function (e) {
  53858. n.Material.call(this),
  53859. (this.type = 'LineDashedMaterial'),
  53860. (this.color = new n.Color(16777215)),
  53861. (this.linewidth = 1),
  53862. (this.scale = 1),
  53863. (this.dashSize = 3),
  53864. (this.gapSize = 1),
  53865. (this.blending = n.NormalBlending),
  53866. (this.vertexColors = n.NoColors),
  53867. (this.fog = !0),
  53868. this.setValues(e);
  53869. }),
  53870. (n.LineDashedMaterial.prototype = Object.create(n.Material.prototype)),
  53871. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  53872. (n.LineDashedMaterial.prototype.copy = function (e) {
  53873. return (
  53874. n.Material.prototype.copy.call(this, e),
  53875. this.color.copy(e.color),
  53876. (this.linewidth = e.linewidth),
  53877. (this.scale = e.scale),
  53878. (this.dashSize = e.dashSize),
  53879. (this.gapSize = e.gapSize),
  53880. (this.vertexColors = e.vertexColors),
  53881. (this.fog = e.fog),
  53882. this
  53883. );
  53884. }),
  53885. (n.MeshBasicMaterial = function (e) {
  53886. n.Material.call(this),
  53887. (this.type = 'MeshBasicMaterial'),
  53888. (this.color = new n.Color(16777215)),
  53889. (this.map = null),
  53890. (this.aoMap = null),
  53891. (this.aoMapIntensity = 1),
  53892. (this.specularMap = null),
  53893. (this.alphaMap = null),
  53894. (this.envMap = null),
  53895. (this.combine = n.MultiplyOperation),
  53896. (this.reflectivity = 1),
  53897. (this.refractionRatio = 0.98),
  53898. (this.fog = !0),
  53899. (this.shading = n.SmoothShading),
  53900. (this.blending = n.NormalBlending),
  53901. (this.wireframe = !1),
  53902. (this.wireframeLinewidth = 1),
  53903. (this.wireframeLinecap = 'round'),
  53904. (this.wireframeLinejoin = 'round'),
  53905. (this.vertexColors = n.NoColors),
  53906. (this.skinning = !1),
  53907. (this.morphTargets = !1),
  53908. this.setValues(e);
  53909. }),
  53910. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  53911. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  53912. (n.MeshBasicMaterial.prototype.copy = function (e) {
  53913. return (
  53914. n.Material.prototype.copy.call(this, e),
  53915. this.color.copy(e.color),
  53916. (this.map = e.map),
  53917. (this.aoMap = e.aoMap),
  53918. (this.aoMapIntensity = e.aoMapIntensity),
  53919. (this.specularMap = e.specularMap),
  53920. (this.alphaMap = e.alphaMap),
  53921. (this.envMap = e.envMap),
  53922. (this.combine = e.combine),
  53923. (this.reflectivity = e.reflectivity),
  53924. (this.refractionRatio = e.refractionRatio),
  53925. (this.fog = e.fog),
  53926. (this.shading = e.shading),
  53927. (this.wireframe = e.wireframe),
  53928. (this.wireframeLinewidth = e.wireframeLinewidth),
  53929. (this.wireframeLinecap = e.wireframeLinecap),
  53930. (this.wireframeLinejoin = e.wireframeLinejoin),
  53931. (this.vertexColors = e.vertexColors),
  53932. (this.skinning = e.skinning),
  53933. (this.morphTargets = e.morphTargets),
  53934. this
  53935. );
  53936. }),
  53937. (n.MeshLambertMaterial = function (e) {
  53938. n.Material.call(this),
  53939. (this.type = 'MeshLambertMaterial'),
  53940. (this.color = new n.Color(16777215)),
  53941. (this.map = null),
  53942. (this.lightMap = null),
  53943. (this.lightMapIntensity = 1),
  53944. (this.aoMap = null),
  53945. (this.aoMapIntensity = 1),
  53946. (this.emissive = new n.Color(0)),
  53947. (this.emissiveIntensity = 1),
  53948. (this.emissiveMap = null),
  53949. (this.specularMap = null),
  53950. (this.alphaMap = null),
  53951. (this.envMap = null),
  53952. (this.combine = n.MultiplyOperation),
  53953. (this.reflectivity = 1),
  53954. (this.refractionRatio = 0.98),
  53955. (this.fog = !0),
  53956. (this.blending = n.NormalBlending),
  53957. (this.wireframe = !1),
  53958. (this.wireframeLinewidth = 1),
  53959. (this.wireframeLinecap = 'round'),
  53960. (this.wireframeLinejoin = 'round'),
  53961. (this.vertexColors = n.NoColors),
  53962. (this.skinning = !1),
  53963. (this.morphTargets = !1),
  53964. (this.morphNormals = !1),
  53965. this.setValues(e);
  53966. }),
  53967. (n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype)),
  53968. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  53969. (n.MeshLambertMaterial.prototype.copy = function (e) {
  53970. return (
  53971. n.Material.prototype.copy.call(this, e),
  53972. this.color.copy(e.color),
  53973. (this.map = e.map),
  53974. (this.lightMap = e.lightMap),
  53975. (this.lightMapIntensity = e.lightMapIntensity),
  53976. (this.aoMap = e.aoMap),
  53977. (this.aoMapIntensity = e.aoMapIntensity),
  53978. this.emissive.copy(e.emissive),
  53979. (this.emissiveMap = e.emissiveMap),
  53980. (this.emissiveIntensity = e.emissiveIntensity),
  53981. (this.specularMap = e.specularMap),
  53982. (this.alphaMap = e.alphaMap),
  53983. (this.envMap = e.envMap),
  53984. (this.combine = e.combine),
  53985. (this.reflectivity = e.reflectivity),
  53986. (this.refractionRatio = e.refractionRatio),
  53987. (this.fog = e.fog),
  53988. (this.wireframe = e.wireframe),
  53989. (this.wireframeLinewidth = e.wireframeLinewidth),
  53990. (this.wireframeLinecap = e.wireframeLinecap),
  53991. (this.wireframeLinejoin = e.wireframeLinejoin),
  53992. (this.vertexColors = e.vertexColors),
  53993. (this.skinning = e.skinning),
  53994. (this.morphTargets = e.morphTargets),
  53995. (this.morphNormals = e.morphNormals),
  53996. this
  53997. );
  53998. }),
  53999. (n.MeshPhongMaterial = function (e) {
  54000. n.Material.call(this),
  54001. (this.type = 'MeshPhongMaterial'),
  54002. (this.color = new n.Color(16777215)),
  54003. (this.specular = new n.Color(1118481)),
  54004. (this.shininess = 30),
  54005. (this.map = null),
  54006. (this.lightMap = null),
  54007. (this.lightMapIntensity = 1),
  54008. (this.aoMap = null),
  54009. (this.aoMapIntensity = 1),
  54010. (this.emissive = new n.Color(0)),
  54011. (this.emissiveIntensity = 1),
  54012. (this.emissiveMap = null),
  54013. (this.bumpMap = null),
  54014. (this.bumpScale = 1),
  54015. (this.normalMap = null),
  54016. (this.normalScale = new n.Vector2(1, 1)),
  54017. (this.displacementMap = null),
  54018. (this.displacementScale = 1),
  54019. (this.displacementBias = 0),
  54020. (this.specularMap = null),
  54021. (this.alphaMap = null),
  54022. (this.envMap = null),
  54023. (this.combine = n.MultiplyOperation),
  54024. (this.reflectivity = 1),
  54025. (this.refractionRatio = 0.98),
  54026. (this.fog = !0),
  54027. (this.shading = n.SmoothShading),
  54028. (this.blending = n.NormalBlending),
  54029. (this.wireframe = !1),
  54030. (this.wireframeLinewidth = 1),
  54031. (this.wireframeLinecap = 'round'),
  54032. (this.wireframeLinejoin = 'round'),
  54033. (this.vertexColors = n.NoColors),
  54034. (this.skinning = !1),
  54035. (this.morphTargets = !1),
  54036. (this.morphNormals = !1),
  54037. this.setValues(e);
  54038. }),
  54039. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  54040. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  54041. (n.MeshPhongMaterial.prototype.copy = function (e) {
  54042. return (
  54043. n.Material.prototype.copy.call(this, e),
  54044. this.color.copy(e.color),
  54045. this.specular.copy(e.specular),
  54046. (this.shininess = e.shininess),
  54047. (this.map = e.map),
  54048. (this.lightMap = e.lightMap),
  54049. (this.lightMapIntensity = e.lightMapIntensity),
  54050. (this.aoMap = e.aoMap),
  54051. (this.aoMapIntensity = e.aoMapIntensity),
  54052. this.emissive.copy(e.emissive),
  54053. (this.emissiveMap = e.emissiveMap),
  54054. (this.emissiveIntensity = e.emissiveIntensity),
  54055. (this.bumpMap = e.bumpMap),
  54056. (this.bumpScale = e.bumpScale),
  54057. (this.normalMap = e.normalMap),
  54058. this.normalScale.copy(e.normalScale),
  54059. (this.displacementMap = e.displacementMap),
  54060. (this.displacementScale = e.displacementScale),
  54061. (this.displacementBias = e.displacementBias),
  54062. (this.specularMap = e.specularMap),
  54063. (this.alphaMap = e.alphaMap),
  54064. (this.envMap = e.envMap),
  54065. (this.combine = e.combine),
  54066. (this.reflectivity = e.reflectivity),
  54067. (this.refractionRatio = e.refractionRatio),
  54068. (this.fog = e.fog),
  54069. (this.shading = e.shading),
  54070. (this.wireframe = e.wireframe),
  54071. (this.wireframeLinewidth = e.wireframeLinewidth),
  54072. (this.wireframeLinecap = e.wireframeLinecap),
  54073. (this.wireframeLinejoin = e.wireframeLinejoin),
  54074. (this.vertexColors = e.vertexColors),
  54075. (this.skinning = e.skinning),
  54076. (this.morphTargets = e.morphTargets),
  54077. (this.morphNormals = e.morphNormals),
  54078. this
  54079. );
  54080. }),
  54081. (n.MeshStandardMaterial = function (e) {
  54082. n.Material.call(this),
  54083. (this.type = 'MeshStandardMaterial'),
  54084. (this.color = new n.Color(16777215)),
  54085. (this.roughness = 0.5),
  54086. (this.metalness = 0.5),
  54087. (this.map = null),
  54088. (this.lightMap = null),
  54089. (this.lightMapIntensity = 1),
  54090. (this.aoMap = null),
  54091. (this.aoMapIntensity = 1),
  54092. (this.emissive = new n.Color(0)),
  54093. (this.emissiveIntensity = 1),
  54094. (this.emissiveMap = null),
  54095. (this.bumpMap = null),
  54096. (this.bumpScale = 1),
  54097. (this.normalMap = null),
  54098. (this.normalScale = new n.Vector2(1, 1)),
  54099. (this.displacementMap = null),
  54100. (this.displacementScale = 1),
  54101. (this.displacementBias = 0),
  54102. (this.roughnessMap = null),
  54103. (this.metalnessMap = null),
  54104. (this.alphaMap = null),
  54105. (this.envMap = null),
  54106. (this.envMapIntensity = 1),
  54107. (this.refractionRatio = 0.98),
  54108. (this.fog = !0),
  54109. (this.shading = n.SmoothShading),
  54110. (this.blending = n.NormalBlending),
  54111. (this.wireframe = !1),
  54112. (this.wireframeLinewidth = 1),
  54113. (this.wireframeLinecap = 'round'),
  54114. (this.wireframeLinejoin = 'round'),
  54115. (this.vertexColors = n.NoColors),
  54116. (this.skinning = !1),
  54117. (this.morphTargets = !1),
  54118. (this.morphNormals = !1),
  54119. this.setValues(e);
  54120. }),
  54121. (n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype)),
  54122. (n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial),
  54123. (n.MeshStandardMaterial.prototype.copy = function (e) {
  54124. return (
  54125. n.Material.prototype.copy.call(this, e),
  54126. this.color.copy(e.color),
  54127. (this.roughness = e.roughness),
  54128. (this.metalness = e.metalness),
  54129. (this.map = e.map),
  54130. (this.lightMap = e.lightMap),
  54131. (this.lightMapIntensity = e.lightMapIntensity),
  54132. (this.aoMap = e.aoMap),
  54133. (this.aoMapIntensity = e.aoMapIntensity),
  54134. this.emissive.copy(e.emissive),
  54135. (this.emissiveMap = e.emissiveMap),
  54136. (this.emissiveIntensity = e.emissiveIntensity),
  54137. (this.bumpMap = e.bumpMap),
  54138. (this.bumpScale = e.bumpScale),
  54139. (this.normalMap = e.normalMap),
  54140. this.normalScale.copy(e.normalScale),
  54141. (this.displacementMap = e.displacementMap),
  54142. (this.displacementScale = e.displacementScale),
  54143. (this.displacementBias = e.displacementBias),
  54144. (this.roughnessMap = e.roughnessMap),
  54145. (this.metalnessMap = e.metalnessMap),
  54146. (this.alphaMap = e.alphaMap),
  54147. (this.envMap = e.envMap),
  54148. (this.envMapIntensity = e.envMapIntensity),
  54149. (this.refractionRatio = e.refractionRatio),
  54150. (this.fog = e.fog),
  54151. (this.shading = e.shading),
  54152. (this.wireframe = e.wireframe),
  54153. (this.wireframeLinewidth = e.wireframeLinewidth),
  54154. (this.wireframeLinecap = e.wireframeLinecap),
  54155. (this.wireframeLinejoin = e.wireframeLinejoin),
  54156. (this.vertexColors = e.vertexColors),
  54157. (this.skinning = e.skinning),
  54158. (this.morphTargets = e.morphTargets),
  54159. (this.morphNormals = e.morphNormals),
  54160. this
  54161. );
  54162. }),
  54163. (n.MeshDepthMaterial = function (e) {
  54164. n.Material.call(this),
  54165. (this.type = 'MeshDepthMaterial'),
  54166. (this.morphTargets = !1),
  54167. (this.wireframe = !1),
  54168. (this.wireframeLinewidth = 1),
  54169. this.setValues(e);
  54170. }),
  54171. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  54172. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  54173. (n.MeshDepthMaterial.prototype.copy = function (e) {
  54174. return (
  54175. n.Material.prototype.copy.call(this, e),
  54176. (this.wireframe = e.wireframe),
  54177. (this.wireframeLinewidth = e.wireframeLinewidth),
  54178. this
  54179. );
  54180. }),
  54181. (n.MeshNormalMaterial = function (e) {
  54182. n.Material.call(this, e),
  54183. (this.type = 'MeshNormalMaterial'),
  54184. (this.wireframe = !1),
  54185. (this.wireframeLinewidth = 1),
  54186. (this.morphTargets = !1),
  54187. this.setValues(e);
  54188. }),
  54189. (n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype)),
  54190. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  54191. (n.MeshNormalMaterial.prototype.copy = function (e) {
  54192. return (
  54193. n.Material.prototype.copy.call(this, e),
  54194. (this.wireframe = e.wireframe),
  54195. (this.wireframeLinewidth = e.wireframeLinewidth),
  54196. this
  54197. );
  54198. }),
  54199. (n.MultiMaterial = function (e) {
  54200. (this.uuid = n.Math.generateUUID()),
  54201. (this.type = 'MultiMaterial'),
  54202. (this.materials = e instanceof Array ? e : []),
  54203. (this.visible = !0);
  54204. }),
  54205. (n.MultiMaterial.prototype = {
  54206. constructor: n.MultiMaterial,
  54207. toJSON: function (e) {
  54208. for (
  54209. var t = {
  54210. metadata: {
  54211. version: 4.2,
  54212. type: 'material',
  54213. generator: 'MaterialExporter',
  54214. },
  54215. uuid: this.uuid,
  54216. type: this.type,
  54217. materials: [],
  54218. },
  54219. i = this.materials,
  54220. n = 0,
  54221. r = i.length;
  54222. n < r;
  54223. n++
  54224. ) {
  54225. var o = i[n].toJSON(e);
  54226. delete o.metadata, t.materials.push(o);
  54227. }
  54228. return (t.visible = this.visible), t;
  54229. },
  54230. clone: function () {
  54231. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++)
  54232. e.materials.push(this.materials[t].clone());
  54233. return (e.visible = this.visible), e;
  54234. },
  54235. }),
  54236. (n.PointsMaterial = function (e) {
  54237. n.Material.call(this),
  54238. (this.type = 'PointsMaterial'),
  54239. (this.color = new n.Color(16777215)),
  54240. (this.map = null),
  54241. (this.size = 1),
  54242. (this.sizeAttenuation = !0),
  54243. (this.blending = n.NormalBlending),
  54244. (this.vertexColors = n.NoColors),
  54245. (this.fog = !0),
  54246. this.setValues(e);
  54247. }),
  54248. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  54249. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  54250. (n.PointsMaterial.prototype.copy = function (e) {
  54251. return (
  54252. n.Material.prototype.copy.call(this, e),
  54253. this.color.copy(e.color),
  54254. (this.map = e.map),
  54255. (this.size = e.size),
  54256. (this.sizeAttenuation = e.sizeAttenuation),
  54257. (this.vertexColors = e.vertexColors),
  54258. (this.fog = e.fog),
  54259. this
  54260. );
  54261. }),
  54262. (n.ShaderMaterial = function (e) {
  54263. n.Material.call(this),
  54264. (this.type = 'ShaderMaterial'),
  54265. (this.defines = {}),
  54266. (this.uniforms = {}),
  54267. (this.vertexShader =
  54268. 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  54269. (this.fragmentShader =
  54270. 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  54271. (this.shading = n.SmoothShading),
  54272. (this.linewidth = 1),
  54273. (this.wireframe = !1),
  54274. (this.wireframeLinewidth = 1),
  54275. (this.fog = !1),
  54276. (this.lights = !1),
  54277. (this.vertexColors = n.NoColors),
  54278. (this.skinning = !1),
  54279. (this.morphTargets = !1),
  54280. (this.morphNormals = !1),
  54281. (this.extensions = {
  54282. derivatives: !1,
  54283. fragDepth: !1,
  54284. drawBuffers: !1,
  54285. shaderTextureLOD: !1,
  54286. }),
  54287. (this.defaultAttributeValues = {
  54288. color: [1, 1, 1],
  54289. uv: [0, 0],
  54290. uv2: [0, 0],
  54291. }),
  54292. (this.index0AttributeName = void 0),
  54293. void 0 !== e &&
  54294. (void 0 !== e.attributes &&
  54295. console.error(
  54296. 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'
  54297. ),
  54298. this.setValues(e));
  54299. }),
  54300. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  54301. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  54302. (n.ShaderMaterial.prototype.copy = function (e) {
  54303. return (
  54304. n.Material.prototype.copy.call(this, e),
  54305. (this.fragmentShader = e.fragmentShader),
  54306. (this.vertexShader = e.vertexShader),
  54307. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  54308. (this.defines = e.defines),
  54309. (this.shading = e.shading),
  54310. (this.wireframe = e.wireframe),
  54311. (this.wireframeLinewidth = e.wireframeLinewidth),
  54312. (this.fog = e.fog),
  54313. (this.lights = e.lights),
  54314. (this.vertexColors = e.vertexColors),
  54315. (this.skinning = e.skinning),
  54316. (this.morphTargets = e.morphTargets),
  54317. (this.morphNormals = e.morphNormals),
  54318. (this.extensions = e.extensions),
  54319. this
  54320. );
  54321. }),
  54322. (n.ShaderMaterial.prototype.toJSON = function (e) {
  54323. var t = n.Material.prototype.toJSON.call(this, e);
  54324. return (
  54325. (t.uniforms = this.uniforms),
  54326. (t.vertexShader = this.vertexShader),
  54327. (t.fragmentShader = this.fragmentShader),
  54328. t
  54329. );
  54330. }),
  54331. (n.RawShaderMaterial = function (e) {
  54332. n.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial');
  54333. }),
  54334. (n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype)),
  54335. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  54336. (n.SpriteMaterial = function (e) {
  54337. n.Material.call(this),
  54338. (this.type = 'SpriteMaterial'),
  54339. (this.color = new n.Color(16777215)),
  54340. (this.map = null),
  54341. (this.rotation = 0),
  54342. (this.fog = !1),
  54343. this.setValues(e);
  54344. }),
  54345. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  54346. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  54347. (n.SpriteMaterial.prototype.copy = function (e) {
  54348. return (
  54349. n.Material.prototype.copy.call(this, e),
  54350. this.color.copy(e.color),
  54351. (this.map = e.map),
  54352. (this.rotation = e.rotation),
  54353. (this.fog = e.fog),
  54354. this
  54355. );
  54356. }),
  54357. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  54358. Object.defineProperty(this, 'id', {
  54359. value: n.TextureIdCount++,
  54360. }),
  54361. (this.uuid = n.Math.generateUUID()),
  54362. (this.name = ''),
  54363. (this.sourceFile = ''),
  54364. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  54365. (this.mipmaps = []),
  54366. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  54367. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  54368. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  54369. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  54370. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  54371. (this.anisotropy = void 0 !== c ? c : 1),
  54372. (this.format = void 0 !== s ? s : n.RGBAFormat),
  54373. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  54374. (this.offset = new n.Vector2(0, 0)),
  54375. (this.repeat = new n.Vector2(1, 1)),
  54376. (this.generateMipmaps = !0),
  54377. (this.premultiplyAlpha = !1),
  54378. (this.flipY = !0),
  54379. (this.unpackAlignment = 4),
  54380. (this.encoding = n.LinearEncoding),
  54381. (this.version = 0),
  54382. (this.onUpdate = null);
  54383. }),
  54384. (n.Texture.DEFAULT_IMAGE = void 0),
  54385. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  54386. (n.Texture.prototype = {
  54387. constructor: n.Texture,
  54388. set needsUpdate(e) {
  54389. e === !0 && this.version++;
  54390. },
  54391. clone: function () {
  54392. return new this.constructor().copy(this);
  54393. },
  54394. copy: function (e) {
  54395. return (
  54396. (this.image = e.image),
  54397. (this.mipmaps = e.mipmaps.slice(0)),
  54398. (this.mapping = e.mapping),
  54399. (this.wrapS = e.wrapS),
  54400. (this.wrapT = e.wrapT),
  54401. (this.magFilter = e.magFilter),
  54402. (this.minFilter = e.minFilter),
  54403. (this.anisotropy = e.anisotropy),
  54404. (this.format = e.format),
  54405. (this.type = e.type),
  54406. this.offset.copy(e.offset),
  54407. this.repeat.copy(e.repeat),
  54408. (this.generateMipmaps = e.generateMipmaps),
  54409. (this.premultiplyAlpha = e.premultiplyAlpha),
  54410. (this.flipY = e.flipY),
  54411. (this.unpackAlignment = e.unpackAlignment),
  54412. (this.encoding = e.encoding),
  54413. this
  54414. );
  54415. },
  54416. toJSON: function (e) {
  54417. function t(e) {
  54418. var t;
  54419. return (
  54420. void 0 !== e.toDataURL
  54421. ? (t = e)
  54422. : ((t = document.createElement('canvas')),
  54423. (t.width = e.width),
  54424. (t.height = e.height),
  54425. t.getContext('2d').drawImage(e, 0, 0, e.width, e.height)),
  54426. t.width > 2048 || t.height > 2048
  54427. ? t.toDataURL('image/jpeg', 0.6)
  54428. : t.toDataURL('image/png')
  54429. );
  54430. }
  54431. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid];
  54432. var i = {
  54433. metadata: {
  54434. version: 4.4,
  54435. type: 'Texture',
  54436. generator: 'Texture.toJSON',
  54437. },
  54438. uuid: this.uuid,
  54439. name: this.name,
  54440. mapping: this.mapping,
  54441. repeat: [this.repeat.x, this.repeat.y],
  54442. offset: [this.offset.x, this.offset.y],
  54443. wrap: [this.wrapS, this.wrapT],
  54444. minFilter: this.minFilter,
  54445. magFilter: this.magFilter,
  54446. anisotropy: this.anisotropy,
  54447. };
  54448. if (void 0 !== this.image) {
  54449. var r = this.image;
  54450. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  54451. void 0 === e.images[r.uuid] &&
  54452. (e.images[r.uuid] = {
  54453. uuid: r.uuid,
  54454. url: t(r),
  54455. }),
  54456. (i.image = r.uuid);
  54457. }
  54458. return (e.textures[this.uuid] = i), i;
  54459. },
  54460. dispose: function () {
  54461. this.dispatchEvent({
  54462. type: 'dispose',
  54463. });
  54464. },
  54465. transformUv: function (e) {
  54466. if (this.mapping === n.UVMapping) {
  54467. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || e.x > 1))
  54468. switch (this.wrapS) {
  54469. case n.RepeatWrapping:
  54470. e.x = e.x - Math.floor(e.x);
  54471. break;
  54472. case n.ClampToEdgeWrapping:
  54473. e.x = e.x < 0 ? 0 : 1;
  54474. break;
  54475. case n.MirroredRepeatWrapping:
  54476. 1 === Math.abs(Math.floor(e.x) % 2)
  54477. ? (e.x = Math.ceil(e.x) - e.x)
  54478. : (e.x = e.x - Math.floor(e.x));
  54479. }
  54480. if (e.y < 0 || e.y > 1)
  54481. switch (this.wrapT) {
  54482. case n.RepeatWrapping:
  54483. e.y = e.y - Math.floor(e.y);
  54484. break;
  54485. case n.ClampToEdgeWrapping:
  54486. e.y = e.y < 0 ? 0 : 1;
  54487. break;
  54488. case n.MirroredRepeatWrapping:
  54489. 1 === Math.abs(Math.floor(e.y) % 2)
  54490. ? (e.y = Math.ceil(e.y) - e.y)
  54491. : (e.y = e.y - Math.floor(e.y));
  54492. }
  54493. this.flipY && (e.y = 1 - e.y);
  54494. }
  54495. },
  54496. }),
  54497. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  54498. (n.TextureIdCount = 0),
  54499. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  54500. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.needsUpdate = !0);
  54501. }),
  54502. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  54503. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  54504. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  54505. (e = void 0 !== e ? e : []),
  54506. (t = void 0 !== t ? t : n.CubeReflectionMapping),
  54507. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  54508. (this.flipY = !1);
  54509. }),
  54510. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  54511. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  54512. Object.defineProperty(n.CubeTexture.prototype, 'images', {
  54513. get: function () {
  54514. return this.image;
  54515. },
  54516. set: function (e) {
  54517. this.image = e;
  54518. },
  54519. }),
  54520. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54521. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54522. (this.image = {
  54523. width: t,
  54524. height: i,
  54525. }),
  54526. (this.mipmaps = e),
  54527. (this.flipY = !1),
  54528. (this.generateMipmaps = !1);
  54529. }),
  54530. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  54531. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  54532. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54533. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54534. (this.image = {
  54535. data: e,
  54536. width: t,
  54537. height: i,
  54538. }),
  54539. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  54540. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  54541. (this.flipY = !1),
  54542. (this.generateMipmaps = !1);
  54543. }),
  54544. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  54545. (n.DataTexture.prototype.constructor = n.DataTexture),
  54546. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  54547. function h() {
  54548. requestAnimationFrame(h);
  54549. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  54550. //改 add !e.paused
  54551. u.needsUpdate = !0;
  54552. }
  54553. }
  54554. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.generateMipmaps = !1);
  54555. var u = this;
  54556. h();
  54557. }),
  54558. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  54559. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  54560. (n.Group = function () {
  54561. n.Object3D.call(this), (this.type = 'Group');
  54562. }),
  54563. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  54564. (n.Group.prototype.constructor = n.Group),
  54565. (n.Points = function (e, t) {
  54566. n.Object3D.call(this),
  54567. (this.type = 'Points'),
  54568. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54569. (this.material =
  54570. void 0 !== t
  54571. ? t
  54572. : new n.PointsMaterial({
  54573. color: 16777215 * Math.random(),
  54574. }));
  54575. }),
  54576. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  54577. (n.Points.prototype.constructor = n.Points),
  54578. (n.Points.prototype.raycast = (function () {
  54579. var e = new n.Matrix4(),
  54580. t = new n.Ray(),
  54581. i = new n.Sphere();
  54582. return function (r, o) {
  54583. function a(e, i) {
  54584. var n = t.distanceSqToPoint(e);
  54585. if (n < d) {
  54586. var a = t.closestPointToPoint(e);
  54587. a.applyMatrix4(c);
  54588. var l = r.ray.origin.distanceTo(a);
  54589. if (l < r.near || l > r.far) return;
  54590. o.push({
  54591. distance: l,
  54592. distanceToRay: Math.sqrt(n),
  54593. point: a.clone(),
  54594. index: i,
  54595. face: null,
  54596. object: s,
  54597. });
  54598. }
  54599. }
  54600. var s = this,
  54601. l = this.geometry,
  54602. c = this.matrixWorld,
  54603. h = r.params.Points.threshold;
  54604. if (
  54605. (null === l.boundingSphere && l.computeBoundingSphere(),
  54606. i.copy(l.boundingSphere),
  54607. i.applyMatrix4(c),
  54608. r.ray.intersectsSphere(i) !== !1)
  54609. ) {
  54610. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  54611. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  54612. d = u * u,
  54613. p = new n.Vector3();
  54614. if (l instanceof n.BufferGeometry) {
  54615. var f = l.index,
  54616. g = l.attributes,
  54617. m = g.position.array;
  54618. if (null !== f)
  54619. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  54620. var C = v[A];
  54621. p.fromArray(m, 3 * C), a(p, C);
  54622. }
  54623. else for (var A = 0, I = m.length / 3; A < I; A++) p.fromArray(m, 3 * A), a(p, A);
  54624. } else for (var E = l.vertices, A = 0, I = E.length; A < I; A++) a(E[A], A);
  54625. }
  54626. };
  54627. })()),
  54628. (n.Points.prototype.clone = function () {
  54629. return new this.constructor(this.geometry, this.material).copy(this);
  54630. }),
  54631. (n.Line = function (e, t, i) {
  54632. return 1 === i
  54633. ? (console.warn(
  54634. 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'
  54635. ),
  54636. new n.LineSegments(e, t))
  54637. : (n.Object3D.call(this),
  54638. (this.type = 'Line'),
  54639. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54640. void (this.material =
  54641. void 0 !== t
  54642. ? t
  54643. : new n.LineBasicMaterial({
  54644. color: 16777215 * Math.random(),
  54645. })));
  54646. }),
  54647. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  54648. (n.Line.prototype.constructor = n.Line),
  54649. (n.Line.prototype.raycast = (function () {
  54650. var e = new n.Matrix4(),
  54651. t = new n.Ray(),
  54652. i = new n.Sphere();
  54653. return function (r, o) {
  54654. var a = r.linePrecision,
  54655. s = a * a,
  54656. l = this.geometry,
  54657. c = this.matrixWorld;
  54658. if (
  54659. (null === l.boundingSphere && l.computeBoundingSphere(),
  54660. i.copy(l.boundingSphere),
  54661. i.applyMatrix4(c),
  54662. r.ray.intersectsSphere(i) !== !1)
  54663. ) {
  54664. e.getInverse(c), t.copy(r.ray).applyMatrix4(e);
  54665. var h = new n.Vector3(),
  54666. u = new n.Vector3(),
  54667. d = new n.Vector3(),
  54668. p = new n.Vector3(),
  54669. f = this instanceof n.LineSegments ? 2 : 1;
  54670. if (l instanceof n.BufferGeometry) {
  54671. var g = l.index,
  54672. m = l.attributes,
  54673. v = m.position.array;
  54674. if (null !== g)
  54675. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  54676. var I = A[y],
  54677. E = A[y + 1];
  54678. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E);
  54679. var b = t.distanceSqToSegment(h, u, p, d);
  54680. if (!(b > s)) {
  54681. p.applyMatrix4(this.matrixWorld);
  54682. var w = r.ray.origin.distanceTo(p);
  54683. w < r.near ||
  54684. w > r.far ||
  54685. o.push({
  54686. distance: w,
  54687. point: d.clone().applyMatrix4(this.matrixWorld),
  54688. index: y,
  54689. face: null,
  54690. faceIndex: null,
  54691. object: this,
  54692. });
  54693. }
  54694. }
  54695. else
  54696. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  54697. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3);
  54698. var b = t.distanceSqToSegment(h, u, p, d);
  54699. if (!(b > s)) {
  54700. p.applyMatrix4(this.matrixWorld);
  54701. var w = r.ray.origin.distanceTo(p);
  54702. w < r.near ||
  54703. w > r.far ||
  54704. o.push({
  54705. distance: w,
  54706. point: d.clone().applyMatrix4(this.matrixWorld),
  54707. index: y,
  54708. face: null,
  54709. faceIndex: null,
  54710. object: this,
  54711. });
  54712. }
  54713. }
  54714. } else if (l instanceof n.Geometry)
  54715. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  54716. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  54717. if (!(b > s)) {
  54718. p.applyMatrix4(this.matrixWorld);
  54719. var w = r.ray.origin.distanceTo(p);
  54720. w < r.near ||
  54721. w > r.far ||
  54722. o.push({
  54723. distance: w,
  54724. point: d.clone().applyMatrix4(this.matrixWorld),
  54725. index: y,
  54726. face: null,
  54727. faceIndex: null,
  54728. object: this,
  54729. });
  54730. }
  54731. }
  54732. }
  54733. };
  54734. })()),
  54735. (n.Line.prototype.clone = function () {
  54736. return new this.constructor(this.geometry, this.material).copy(this);
  54737. }),
  54738. (n.LineStrip = 0),
  54739. (n.LinePieces = 1),
  54740. (n.LineSegments = function (e, t) {
  54741. n.Line.call(this, e, t), (this.type = 'LineSegments');
  54742. }),
  54743. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  54744. (n.LineSegments.prototype.constructor = n.LineSegments),
  54745. (n.Mesh = function (e, t) {
  54746. n.Object3D.call(this),
  54747. (this.type = 'Mesh'),
  54748. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54749. (this.material =
  54750. void 0 !== t
  54751. ? t
  54752. : new n.MeshBasicMaterial({
  54753. color: 16777215 * Math.random(),
  54754. })),
  54755. (this.drawMode = n.TrianglesDrawMode),
  54756. this.updateMorphTargets();
  54757. }),
  54758. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  54759. (n.Mesh.prototype.constructor = n.Mesh),
  54760. (n.Mesh.prototype.setDrawMode = function (e) {
  54761. this.drawMode = e;
  54762. }),
  54763. (n.Mesh.prototype.updateMorphTargets = function () {
  54764. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  54765. (this.morphTargetBase = -1),
  54766. (this.morphTargetInfluences = []),
  54767. (this.morphTargetDictionary = {});
  54768. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  54769. this.morphTargetInfluences.push(0),
  54770. (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e);
  54771. }
  54772. }),
  54773. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  54774. return void 0 !== this.morphTargetDictionary[e]
  54775. ? this.morphTargetDictionary[e]
  54776. : (console.warn(
  54777. 'THREE.Mesh.getMorphTargetIndexByName: morph target ' +
  54778. e +
  54779. ' does not exist. Returning 0.'
  54780. ),
  54781. 0);
  54782. }),
  54783. (n.Mesh.prototype.raycast = (function () {
  54784. function e(e, t, i, r, o, a, s) {
  54785. return (
  54786. n.Triangle.barycoordFromPoint(e, t, i, r, m),
  54787. o.multiplyScalar(m.x),
  54788. a.multiplyScalar(m.y),
  54789. s.multiplyScalar(m.z),
  54790. o.add(a).add(s),
  54791. o.clone()
  54792. );
  54793. }
  54794. function t(e, t, i, r, o, a, s) {
  54795. var l,
  54796. c = e.material;
  54797. if (
  54798. ((l =
  54799. c.side === n.BackSide
  54800. ? i.intersectTriangle(a, o, r, !0, s)
  54801. : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)),
  54802. null === l)
  54803. )
  54804. return null;
  54805. A.copy(s), A.applyMatrix4(e.matrixWorld);
  54806. var h = t.ray.origin.distanceTo(A);
  54807. return h < t.near || h > t.far
  54808. ? null
  54809. : {
  54810. distance: h,
  54811. point: A.clone(),
  54812. object: e,
  54813. };
  54814. }
  54815. function i(i, r, o, a, h, u, d, m) {
  54816. s.fromArray(a, 3 * u), l.fromArray(a, 3 * d), c.fromArray(a, 3 * m);
  54817. var A = t(i, r, o, s, l, c, v);
  54818. return (
  54819. A &&
  54820. (h &&
  54821. (p.fromArray(h, 2 * u),
  54822. f.fromArray(h, 2 * d),
  54823. g.fromArray(h, 2 * m),
  54824. (A.uv = e(v, s, l, c, p, f, g))),
  54825. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  54826. (A.faceIndex = u)),
  54827. A
  54828. );
  54829. }
  54830. var r = new n.Matrix4(),
  54831. o = new n.Ray(),
  54832. a = new n.Sphere(),
  54833. s = new n.Vector3(),
  54834. l = new n.Vector3(),
  54835. c = new n.Vector3(),
  54836. h = new n.Vector3(),
  54837. u = new n.Vector3(),
  54838. d = new n.Vector3(),
  54839. p = new n.Vector2(),
  54840. f = new n.Vector2(),
  54841. g = new n.Vector2(),
  54842. m = new n.Vector3(),
  54843. v = new n.Vector3(),
  54844. A = new n.Vector3();
  54845. return function (m, A) {
  54846. var y = this.geometry,
  54847. C = this.material,
  54848. I = this.matrixWorld;
  54849. if (
  54850. void 0 !== C &&
  54851. (null === y.boundingSphere && y.computeBoundingSphere(),
  54852. a.copy(y.boundingSphere),
  54853. a.applyMatrix4(I),
  54854. m.ray.intersectsSphere(a) !== !1 &&
  54855. (r.getInverse(I),
  54856. o.copy(m.ray).applyMatrix4(r),
  54857. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))
  54858. ) {
  54859. var E, b;
  54860. if (y instanceof n.BufferGeometry) {
  54861. var w,
  54862. _,
  54863. T,
  54864. x = y.index,
  54865. S = y.attributes,
  54866. M = S.position.array;
  54867. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  54868. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  54869. (w = R[P]),
  54870. (_ = R[P + 1]),
  54871. (T = R[P + 2]),
  54872. (b = i(this, m, o, M, E, w, _, T)),
  54873. b && ((b.faceIndex = Math.floor(P / 3)), A.push(b));
  54874. else
  54875. for (var P = 0, O = M.length; P < O; P += 9)
  54876. (w = P / 3),
  54877. (_ = w + 1),
  54878. (T = w + 2),
  54879. (b = i(this, m, o, M, E, w, _, T)),
  54880. b && ((b.index = w), A.push(b));
  54881. } else if (y instanceof n.Geometry) {
  54882. var L,
  54883. D,
  54884. N,
  54885. B = C instanceof n.MultiMaterial,
  54886. F = B === !0 ? C.materials : null,
  54887. V = y.vertices,
  54888. U = y.faces,
  54889. k = y.faceVertexUvs[0];
  54890. k.length > 0 && (E = k);
  54891. for (var H = 0, G = U.length; H < G; H++) {
  54892. var z = U[H],
  54893. W = B === !0 ? F[z.materialIndex] : C;
  54894. if (void 0 !== W) {
  54895. if (((L = V[z.a]), (D = V[z.b]), (N = V[z.c]), W.morphTargets === !0)) {
  54896. var j = y.morphTargets,
  54897. Y = this.morphTargetInfluences;
  54898. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0);
  54899. for (var X = 0, Z = j.length; X < Z; X++) {
  54900. var q = Y[X];
  54901. if (0 !== q) {
  54902. var K = j[X].vertices;
  54903. s.addScaledVector(h.subVectors(K[z.a], L), q),
  54904. l.addScaledVector(u.subVectors(K[z.b], D), q),
  54905. c.addScaledVector(d.subVectors(K[z.c], N), q);
  54906. }
  54907. }
  54908. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c);
  54909. }
  54910. if ((b = t(this, m, o, L, D, N, v))) {
  54911. if (E) {
  54912. var Q = E[H];
  54913. p.copy(Q[0]), f.copy(Q[1]), g.copy(Q[2]), (b.uv = e(v, L, D, N, p, f, g));
  54914. }
  54915. (b.face = z), (b.faceIndex = H), A.push(b);
  54916. }
  54917. }
  54918. }
  54919. }
  54920. }
  54921. };
  54922. })()),
  54923. (n.Mesh.prototype.clone = function () {
  54924. return new this.constructor(this.geometry, this.material).copy(this);
  54925. }),
  54926. (n.Bone = function (e) {
  54927. n.Object3D.call(this), (this.type = 'Bone'), (this.skin = e);
  54928. }),
  54929. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  54930. (n.Bone.prototype.constructor = n.Bone),
  54931. (n.Bone.prototype.copy = function (e) {
  54932. return n.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this;
  54933. }),
  54934. (n.Skeleton = function (e, t, i) {
  54935. if (
  54936. ((this.useVertexTexture = void 0 === i || i),
  54937. (this.identityMatrix = new n.Matrix4()),
  54938. (e = e || []),
  54939. (this.bones = e.slice(0)),
  54940. this.useVertexTexture)
  54941. ) {
  54942. var r = Math.sqrt(4 * this.bones.length);
  54943. (r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  54944. (r = Math.max(r, 4)),
  54945. (this.boneTextureWidth = r),
  54946. (this.boneTextureHeight = r),
  54947. (this.boneMatrices = new Float32Array(
  54948. this.boneTextureWidth * this.boneTextureHeight * 4
  54949. )),
  54950. (this.boneTexture = new n.DataTexture(
  54951. this.boneMatrices,
  54952. this.boneTextureWidth,
  54953. this.boneTextureHeight,
  54954. n.RGBAFormat,
  54955. n.FloatType
  54956. ));
  54957. } else this.boneMatrices = new Float32Array(16 * this.bones.length);
  54958. if (void 0 === t) this.calculateInverses();
  54959. else if (this.bones.length === t.length) this.boneInverses = t.slice(0);
  54960. else {
  54961. console.warn('THREE.Skeleton bonInverses is the wrong length.'),
  54962. (this.boneInverses = []);
  54963. for (var o = 0, a = this.bones.length; o < a; o++)
  54964. this.boneInverses.push(new n.Matrix4());
  54965. }
  54966. }),
  54967. (n.Skeleton.prototype.calculateInverses = function () {
  54968. this.boneInverses = [];
  54969. for (var e = 0, t = this.bones.length; e < t; e++) {
  54970. var i = new n.Matrix4();
  54971. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i);
  54972. }
  54973. }),
  54974. (n.Skeleton.prototype.pose = function () {
  54975. for (var e, t = 0, i = this.bones.length; t < i; t++)
  54976. (e = this.bones[t]), e && e.matrixWorld.getInverse(this.boneInverses[t]);
  54977. for (var t = 0, i = this.bones.length; t < i; t++)
  54978. (e = this.bones[t]),
  54979. e &&
  54980. (e.parent
  54981. ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld))
  54982. : e.matrix.copy(e.matrixWorld),
  54983. e.matrix.decompose(e.position, e.quaternion, e.scale));
  54984. }),
  54985. (n.Skeleton.prototype.update = (function () {
  54986. var e = new n.Matrix4();
  54987. return function () {
  54988. for (var t = 0, i = this.bones.length; t < i; t++) {
  54989. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  54990. e.multiplyMatrices(n, this.boneInverses[t]),
  54991. e.flattenToArrayOffset(this.boneMatrices, 16 * t);
  54992. }
  54993. this.useVertexTexture && (this.boneTexture.needsUpdate = !0);
  54994. };
  54995. })()),
  54996. (n.Skeleton.prototype.clone = function () {
  54997. return new n.Skeleton(this.bones, this.boneInverses, this.useVertexTexture);
  54998. }),
  54999. (n.SkinnedMesh = function (e, t, i) {
  55000. n.Mesh.call(this, e, t),
  55001. (this.type = 'SkinnedMesh'),
  55002. (this.bindMode = 'attached'),
  55003. (this.bindMatrix = new n.Matrix4()),
  55004. (this.bindMatrixInverse = new n.Matrix4());
  55005. var r = [];
  55006. if (this.geometry && void 0 !== this.geometry.bones) {
  55007. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  55008. (a = this.geometry.bones[s]),
  55009. (o = new n.Bone(this)),
  55010. r.push(o),
  55011. (o.name = a.name),
  55012. o.position.fromArray(a.pos),
  55013. o.quaternion.fromArray(a.rotq),
  55014. void 0 !== a.scl && o.scale.fromArray(a.scl);
  55015. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  55016. (a = this.geometry.bones[s]),
  55017. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s]);
  55018. }
  55019. this.normalizeSkinWeights(),
  55020. this.updateMatrixWorld(!0),
  55021. this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld);
  55022. }),
  55023. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  55024. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  55025. (n.SkinnedMesh.prototype.bind = function (e, t) {
  55026. (this.skeleton = e),
  55027. void 0 === t &&
  55028. (this.updateMatrixWorld(!0),
  55029. this.skeleton.calculateInverses(),
  55030. (t = this.matrixWorld)),
  55031. this.bindMatrix.copy(t),
  55032. this.bindMatrixInverse.getInverse(t);
  55033. }),
  55034. (n.SkinnedMesh.prototype.pose = function () {
  55035. this.skeleton.pose();
  55036. }),
  55037. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  55038. if (this.geometry instanceof n.Geometry)
  55039. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  55040. var t = this.geometry.skinWeights[e],
  55041. i = 1 / t.lengthManhattan();
  55042. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0);
  55043. }
  55044. else if (this.geometry instanceof n.BufferGeometry)
  55045. for (
  55046. var r = new n.Vector4(), o = this.geometry.attributes.skinWeight, e = 0;
  55047. e < o.count;
  55048. e++
  55049. ) {
  55050. (r.x = o.getX(e)), (r.y = o.getY(e)), (r.z = o.getZ(e)), (r.w = o.getW(e));
  55051. var i = 1 / r.lengthManhattan();
  55052. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  55053. o.setXYZW(e, r.x, r.y, r.z, r.w);
  55054. }
  55055. }),
  55056. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  55057. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  55058. 'attached' === this.bindMode
  55059. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  55060. : 'detached' === this.bindMode
  55061. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  55062. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode);
  55063. }),
  55064. (n.SkinnedMesh.prototype.clone = function () {
  55065. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(
  55066. this
  55067. );
  55068. }),
  55069. (n.LOD = function () {
  55070. n.Object3D.call(this),
  55071. (this.type = 'LOD'),
  55072. Object.defineProperties(this, {
  55073. levels: {
  55074. enumerable: !0,
  55075. value: [],
  55076. },
  55077. objects: {
  55078. get: function () {
  55079. return (
  55080. console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  55081. );
  55082. },
  55083. },
  55084. });
  55085. }),
  55086. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  55087. (n.LOD.prototype.constructor = n.LOD),
  55088. (n.LOD.prototype.addLevel = function (e, t) {
  55089. void 0 === t && (t = 0), (t = Math.abs(t));
  55090. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  55091. i.splice(n, 0, {
  55092. distance: t,
  55093. object: e,
  55094. }),
  55095. this.add(e);
  55096. }),
  55097. (n.LOD.prototype.getObjectForDistance = function (e) {
  55098. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  55099. return t[i - 1].object;
  55100. }),
  55101. (n.LOD.prototype.raycast = (function () {
  55102. var e = new n.Vector3();
  55103. return function (t, i) {
  55104. e.setFromMatrixPosition(this.matrixWorld);
  55105. var n = t.ray.origin.distanceTo(e);
  55106. this.getObjectForDistance(n).raycast(t, i);
  55107. };
  55108. })()),
  55109. (n.LOD.prototype.update = (function () {
  55110. var e = new n.Vector3(),
  55111. t = new n.Vector3();
  55112. return function (i) {
  55113. var n = this.levels;
  55114. if (n.length > 1) {
  55115. e.setFromMatrixPosition(i.matrixWorld), t.setFromMatrixPosition(this.matrixWorld);
  55116. var r = e.distanceTo(t);
  55117. n[0].object.visible = !0;
  55118. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  55119. (n[o - 1].object.visible = !1), (n[o].object.visible = !0);
  55120. for (; o < a; o++) n[o].object.visible = !1;
  55121. }
  55122. };
  55123. })()),
  55124. (n.LOD.prototype.copy = function (e) {
  55125. n.Object3D.prototype.copy.call(this, e, !1);
  55126. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  55127. var o = t[i];
  55128. this.addLevel(o.object.clone(), o.distance);
  55129. }
  55130. return this;
  55131. }),
  55132. (n.LOD.prototype.toJSON = function (e) {
  55133. var t = n.Object3D.prototype.toJSON.call(this, e);
  55134. t.object.levels = [];
  55135. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  55136. var a = i[r];
  55137. t.object.levels.push({
  55138. object: a.object.uuid,
  55139. distance: a.distance,
  55140. });
  55141. }
  55142. return t;
  55143. }),
  55144. (n.Sprite = (function () {
  55145. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  55146. t = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0]),
  55147. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  55148. r = new n.BufferGeometry();
  55149. return (
  55150. r.setIndex(new n.BufferAttribute(e, 1)),
  55151. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  55152. r.addAttribute('uv', new n.BufferAttribute(i, 2)),
  55153. function (e) {
  55154. n.Object3D.call(this),
  55155. (this.type = 'Sprite'),
  55156. (this.geometry = r),
  55157. (this.material = void 0 !== e ? e : new n.SpriteMaterial());
  55158. }
  55159. );
  55160. })()),
  55161. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  55162. (n.Sprite.prototype.constructor = n.Sprite),
  55163. (n.Sprite.prototype.raycast = (function () {
  55164. var e = new n.Vector3();
  55165. return function (t, i) {
  55166. e.setFromMatrixPosition(this.matrixWorld);
  55167. var n = t.ray.distanceSqToPoint(e),
  55168. r = this.scale.x * this.scale.y;
  55169. n > r ||
  55170. i.push({
  55171. distance: Math.sqrt(n),
  55172. point: this.position,
  55173. face: null,
  55174. object: this,
  55175. });
  55176. };
  55177. })()),
  55178. (n.Sprite.prototype.clone = function () {
  55179. return new this.constructor(this.material).copy(this);
  55180. }),
  55181. (n.Particle = n.Sprite),
  55182. (n.LensFlare = function (e, t, i, r, o) {
  55183. n.Object3D.call(this),
  55184. (this.lensFlares = []),
  55185. (this.positionScreen = new n.Vector3()),
  55186. (this.customUpdateCallback = void 0),
  55187. void 0 !== e && this.add(e, t, i, r, o);
  55188. }),
  55189. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  55190. (n.LensFlare.prototype.constructor = n.LensFlare),
  55191. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  55192. void 0 === t && (t = -1),
  55193. void 0 === i && (i = 0),
  55194. void 0 === a && (a = 1),
  55195. void 0 === o && (o = new n.Color(16777215)),
  55196. void 0 === r && (r = n.NormalBlending),
  55197. (i = Math.min(i, Math.max(0, i))),
  55198. this.lensFlares.push({
  55199. texture: e,
  55200. size: t,
  55201. distance: i,
  55202. x: 0,
  55203. y: 0,
  55204. z: 0,
  55205. scale: 1,
  55206. rotation: 0,
  55207. opacity: a,
  55208. color: o,
  55209. blending: r,
  55210. });
  55211. }),
  55212. (n.LensFlare.prototype.updateLensFlares = function () {
  55213. var e,
  55214. t,
  55215. i = this.lensFlares.length,
  55216. n = 2 * -this.positionScreen.x,
  55217. r = 2 * -this.positionScreen.y;
  55218. for (e = 0; e < i; e++)
  55219. (t = this.lensFlares[e]),
  55220. (t.x = this.positionScreen.x + n * t.distance),
  55221. (t.y = this.positionScreen.y + r * t.distance),
  55222. (t.wantedRotation = t.x * Math.PI * 0.25),
  55223. (t.rotation += 0.25 * (t.wantedRotation - t.rotation));
  55224. }),
  55225. (n.LensFlare.prototype.copy = function (e) {
  55226. n.Object3D.prototype.copy.call(this, e),
  55227. this.positionScreen.copy(e.positionScreen),
  55228. (this.customUpdateCallback = e.customUpdateCallback);
  55229. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  55230. this.lensFlares.push(e.lensFlares[t]);
  55231. return this;
  55232. }),
  55233. (n.Scene = function () {
  55234. n.Object3D.call(this),
  55235. (this.type = 'Scene'),
  55236. (this.fog = null),
  55237. (this.overrideMaterial = null),
  55238. (this.autoUpdate = !0);
  55239. }),
  55240. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  55241. (n.Scene.prototype.constructor = n.Scene),
  55242. (n.Scene.prototype.copy = function (e, t) {
  55243. return (
  55244. n.Object3D.prototype.copy.call(this, e, t),
  55245. null !== e.fog && (this.fog = e.fog.clone()),
  55246. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  55247. (this.autoUpdate = e.autoUpdate),
  55248. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  55249. this
  55250. );
  55251. }),
  55252. (n.Fog = function (e, t, i) {
  55253. (this.name = ''),
  55254. (this.color = new n.Color(e)),
  55255. (this.near = void 0 !== t ? t : 1),
  55256. (this.far = void 0 !== i ? i : 1e3);
  55257. }),
  55258. (n.Fog.prototype.clone = function () {
  55259. return new n.Fog(this.color.getHex(), this.near, this.far);
  55260. }),
  55261. (n.FogExp2 = function (e, t) {
  55262. (this.name = ''),
  55263. (this.color = new n.Color(e)),
  55264. (this.density = void 0 !== t ? t : 25e-5);
  55265. }),
  55266. (n.FogExp2.prototype.clone = function () {
  55267. return new n.FogExp2(this.color.getHex(), this.density);
  55268. }),
  55269. (n.ShaderChunk = {}),
  55270. (n.ShaderChunk.alphamap_fragment =
  55271. '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  55272. (n.ShaderChunk.alphamap_pars_fragment =
  55273. '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  55274. (n.ShaderChunk.alphatest_fragment =
  55275. '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  55276. (n.ShaderChunk.aomap_fragment =
  55277. '#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'),
  55278. (n.ShaderChunk.aomap_pars_fragment =
  55279. '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  55280. (n.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  55281. (n.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  55282. (n.ShaderChunk.bsdfs =
  55283. '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'),
  55284. (n.ShaderChunk.bumpmap_pars_fragment =
  55285. '#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'),
  55286. (n.ShaderChunk.color_fragment =
  55287. '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  55288. (n.ShaderChunk.color_pars_fragment =
  55289. '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  55290. (n.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  55291. (n.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  55292. (n.ShaderChunk.common =
  55293. '#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'),
  55294. (n.ShaderChunk.cube_uv_reflection_fragment =
  55295. '#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'),
  55296. (n.ShaderChunk.defaultnormal_vertex =
  55297. '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  55298. (n.ShaderChunk.displacementmap_vertex =
  55299. '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  55300. (n.ShaderChunk.displacementmap_pars_vertex =
  55301. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  55302. (n.ShaderChunk.emissivemap_fragment =
  55303. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  55304. (n.ShaderChunk.emissivemap_pars_fragment =
  55305. '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  55306. (n.ShaderChunk.encodings_pars_fragment =
  55307. '\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'),
  55308. (n.ShaderChunk.encodings_fragment =
  55309. ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  55310. (n.ShaderChunk.envmap_fragment =
  55311. '#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'),
  55312. (n.ShaderChunk.envmap_pars_fragment =
  55313. '#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'),
  55314. (n.ShaderChunk.envmap_pars_vertex =
  55315. '#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'),
  55316. (n.ShaderChunk.envmap_vertex =
  55317. '#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'),
  55318. (n.ShaderChunk.fog_fragment =
  55319. '#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'),
  55320. (n.ShaderChunk.fog_pars_fragment =
  55321. '#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'),
  55322. (n.ShaderChunk.lightmap_fragment =
  55323. '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  55324. (n.ShaderChunk.lightmap_pars_fragment =
  55325. '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  55326. (n.ShaderChunk.lights_lambert_vertex =
  55327. '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'),
  55328. (n.ShaderChunk.lights_pars =
  55329. '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'),
  55330. (n.ShaderChunk.lights_phong_fragment =
  55331. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  55332. (n.ShaderChunk.lights_phong_pars_fragment =
  55333. '#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'),
  55334. (n.ShaderChunk.lights_phong_pars_vertex =
  55335. '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  55336. (n.ShaderChunk.lights_phong_vertex =
  55337. '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  55338. (n.ShaderChunk.lights_standard_fragment =
  55339. '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'),
  55340. (n.ShaderChunk.lights_standard_pars_fragment =
  55341. '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'),
  55342. (n.ShaderChunk.lights_template =
  55343. '\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'),
  55344. (n.ShaderChunk.logdepthbuf_fragment =
  55345. '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  55346. (n.ShaderChunk.logdepthbuf_pars_fragment =
  55347. '#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n'),
  55348. (n.ShaderChunk.logdepthbuf_pars_vertex =
  55349. '#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif'),
  55350. (n.ShaderChunk.logdepthbuf_vertex =
  55351. '#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'),
  55352. (n.ShaderChunk.map_fragment =
  55353. '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  55354. (n.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  55355. (n.ShaderChunk.map_particle_fragment =
  55356. '#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'),
  55357. (n.ShaderChunk.map_particle_pars_fragment =
  55358. '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  55359. (n.ShaderChunk.metalnessmap_fragment =
  55360. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  55361. (n.ShaderChunk.metalnessmap_pars_fragment =
  55362. '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  55363. (n.ShaderChunk.morphnormal_vertex =
  55364. '#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'),
  55365. (n.ShaderChunk.morphtarget_pars_vertex =
  55366. '#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');
  55367. n.ShaderChunk.morphtarget_vertex =
  55368. '#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';
  55369. (n.ShaderChunk.normal_fragment =
  55370. '#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'),
  55371. (n.ShaderChunk.normalmap_pars_fragment =
  55372. '#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'),
  55373. (n.ShaderChunk.premultiplied_alpha_fragment =
  55374. '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  55375. (n.ShaderChunk.project_vertex =
  55376. '#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'),
  55377. (n.ShaderChunk.roughnessmap_fragment =
  55378. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  55379. (n.ShaderChunk.roughnessmap_pars_fragment =
  55380. '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  55381. (n.ShaderChunk.shadowmap_pars_fragment =
  55382. '#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'),
  55383. (n.ShaderChunk.shadowmap_pars_vertex =
  55384. '#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'),
  55385. (n.ShaderChunk.shadowmap_vertex =
  55386. '#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'),
  55387. (n.ShaderChunk.shadowmask_pars_fragment =
  55388. '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'),
  55389. (n.ShaderChunk.skinbase_vertex =
  55390. '#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'),
  55391. (n.ShaderChunk.skinning_pars_vertex =
  55392. '#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'),
  55393. (n.ShaderChunk.skinning_vertex =
  55394. '#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'),
  55395. (n.ShaderChunk.skinnormal_vertex =
  55396. '#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'),
  55397. (n.ShaderChunk.specularmap_fragment =
  55398. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  55399. (n.ShaderChunk.specularmap_pars_fragment =
  55400. '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  55401. (n.ShaderChunk.tonemapping_fragment =
  55402. '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  55403. (n.ShaderChunk.tonemapping_pars_fragment =
  55404. '#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'),
  55405. (n.ShaderChunk.uv2_pars_fragment =
  55406. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  55407. (n.ShaderChunk.uv2_pars_vertex =
  55408. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  55409. (n.ShaderChunk.uv2_vertex =
  55410. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  55411. (n.ShaderChunk.uv_pars_fragment =
  55412. '#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'),
  55413. (n.ShaderChunk.uv_pars_vertex =
  55414. '#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'),
  55415. (n.ShaderChunk.uv_vertex =
  55416. '#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'),
  55417. (n.ShaderChunk.worldpos_vertex =
  55418. '#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'),
  55419. (n.UniformsUtils = {
  55420. merge: function (e) {
  55421. for (var t = {}, i = 0; i < e.length; i++) {
  55422. var n = this.clone(e[i]);
  55423. for (var r in n) t[r] = n[r];
  55424. }
  55425. return t;
  55426. },
  55427. clone: function (e) {
  55428. var t = {};
  55429. for (var i in e) {
  55430. t[i] = {};
  55431. for (var r in e[i]) {
  55432. var o = e[i][r];
  55433. o instanceof n.Color ||
  55434. o instanceof n.Vector2 ||
  55435. o instanceof n.Vector3 ||
  55436. o instanceof n.Vector4 ||
  55437. o instanceof n.Matrix3 ||
  55438. o instanceof n.Matrix4 ||
  55439. o instanceof n.Texture
  55440. ? (t[i][r] = o.clone())
  55441. : Array.isArray(o)
  55442. ? (t[i][r] = o.slice())
  55443. : (t[i][r] = o);
  55444. }
  55445. }
  55446. return t;
  55447. },
  55448. }),
  55449. (n.UniformsLib = {
  55450. common: {
  55451. diffuse: {
  55452. type: 'c',
  55453. value: new n.Color(15658734),
  55454. },
  55455. opacity: {
  55456. type: 'f',
  55457. value: 1,
  55458. },
  55459. map: {
  55460. type: 't',
  55461. value: null,
  55462. },
  55463. offsetRepeat: {
  55464. type: 'v4',
  55465. value: new n.Vector4(0, 0, 1, 1),
  55466. },
  55467. specularMap: {
  55468. type: 't',
  55469. value: null,
  55470. },
  55471. alphaMap: {
  55472. type: 't',
  55473. value: null,
  55474. },
  55475. envMap: {
  55476. type: 't',
  55477. value: null,
  55478. },
  55479. flipEnvMap: {
  55480. type: 'f',
  55481. value: -1,
  55482. },
  55483. reflectivity: {
  55484. type: 'f',
  55485. value: 1,
  55486. },
  55487. refractionRatio: {
  55488. type: 'f',
  55489. value: 0.98,
  55490. },
  55491. },
  55492. aomap: {
  55493. aoMap: {
  55494. type: 't',
  55495. value: null,
  55496. },
  55497. aoMapIntensity: {
  55498. type: 'f',
  55499. value: 1,
  55500. },
  55501. },
  55502. lightmap: {
  55503. lightMap: {
  55504. type: 't',
  55505. value: null,
  55506. },
  55507. lightMapIntensity: {
  55508. type: 'f',
  55509. value: 1,
  55510. },
  55511. },
  55512. emissivemap: {
  55513. emissiveMap: {
  55514. type: 't',
  55515. value: null,
  55516. },
  55517. },
  55518. bumpmap: {
  55519. bumpMap: {
  55520. type: 't',
  55521. value: null,
  55522. },
  55523. bumpScale: {
  55524. type: 'f',
  55525. value: 1,
  55526. },
  55527. },
  55528. normalmap: {
  55529. normalMap: {
  55530. type: 't',
  55531. value: null,
  55532. },
  55533. normalScale: {
  55534. type: 'v2',
  55535. value: new n.Vector2(1, 1),
  55536. },
  55537. },
  55538. displacementmap: {
  55539. displacementMap: {
  55540. type: 't',
  55541. value: null,
  55542. },
  55543. displacementScale: {
  55544. type: 'f',
  55545. value: 1,
  55546. },
  55547. displacementBias: {
  55548. type: 'f',
  55549. value: 0,
  55550. },
  55551. },
  55552. roughnessmap: {
  55553. roughnessMap: {
  55554. type: 't',
  55555. value: null,
  55556. },
  55557. },
  55558. metalnessmap: {
  55559. metalnessMap: {
  55560. type: 't',
  55561. value: null,
  55562. },
  55563. },
  55564. fog: {
  55565. fogDensity: {
  55566. type: 'f',
  55567. value: 25e-5,
  55568. },
  55569. fogNear: {
  55570. type: 'f',
  55571. value: 1,
  55572. },
  55573. fogFar: {
  55574. type: 'f',
  55575. value: 2e3,
  55576. },
  55577. fogColor: {
  55578. type: 'c',
  55579. value: new n.Color(16777215),
  55580. },
  55581. },
  55582. lights: {
  55583. ambientLightColor: {
  55584. type: 'fv',
  55585. value: [],
  55586. },
  55587. directionalLights: {
  55588. type: 'sa',
  55589. value: [],
  55590. properties: {
  55591. direction: {
  55592. type: 'v3',
  55593. },
  55594. color: {
  55595. type: 'c',
  55596. },
  55597. shadow: {
  55598. type: 'i',
  55599. },
  55600. shadowBias: {
  55601. type: 'f',
  55602. },
  55603. shadowRadius: {
  55604. type: 'f',
  55605. },
  55606. shadowMapSize: {
  55607. type: 'v2',
  55608. },
  55609. },
  55610. },
  55611. directionalShadowMap: {
  55612. type: 'tv',
  55613. value: [],
  55614. },
  55615. directionalShadowMatrix: {
  55616. type: 'm4v',
  55617. value: [],
  55618. },
  55619. spotLights: {
  55620. type: 'sa',
  55621. value: [],
  55622. properties: {
  55623. color: {
  55624. type: 'c',
  55625. },
  55626. position: {
  55627. type: 'v3',
  55628. },
  55629. direction: {
  55630. type: 'v3',
  55631. },
  55632. distance: {
  55633. type: 'f',
  55634. },
  55635. coneCos: {
  55636. type: 'f',
  55637. },
  55638. penumbraCos: {
  55639. type: 'f',
  55640. },
  55641. decay: {
  55642. type: 'f',
  55643. },
  55644. shadow: {
  55645. type: 'i',
  55646. },
  55647. shadowBias: {
  55648. type: 'f',
  55649. },
  55650. shadowRadius: {
  55651. type: 'f',
  55652. },
  55653. shadowMapSize: {
  55654. type: 'v2',
  55655. },
  55656. },
  55657. },
  55658. spotShadowMap: {
  55659. type: 'tv',
  55660. value: [],
  55661. },
  55662. spotShadowMatrix: {
  55663. type: 'm4v',
  55664. value: [],
  55665. },
  55666. pointLights: {
  55667. type: 'sa',
  55668. value: [],
  55669. properties: {
  55670. color: {
  55671. type: 'c',
  55672. },
  55673. position: {
  55674. type: 'v3',
  55675. },
  55676. decay: {
  55677. type: 'f',
  55678. },
  55679. distance: {
  55680. type: 'f',
  55681. },
  55682. shadow: {
  55683. type: 'i',
  55684. },
  55685. shadowBias: {
  55686. type: 'f',
  55687. },
  55688. shadowRadius: {
  55689. type: 'f',
  55690. },
  55691. shadowMapSize: {
  55692. type: 'v2',
  55693. },
  55694. },
  55695. },
  55696. pointShadowMap: {
  55697. type: 'tv',
  55698. value: [],
  55699. },
  55700. pointShadowMatrix: {
  55701. type: 'm4v',
  55702. value: [],
  55703. },
  55704. hemisphereLights: {
  55705. type: 'sa',
  55706. value: [],
  55707. properties: {
  55708. direction: {
  55709. type: 'v3',
  55710. },
  55711. skyColor: {
  55712. type: 'c',
  55713. },
  55714. groundColor: {
  55715. type: 'c',
  55716. },
  55717. },
  55718. },
  55719. },
  55720. points: {
  55721. diffuse: {
  55722. type: 'c',
  55723. value: new n.Color(15658734),
  55724. },
  55725. opacity: {
  55726. type: 'f',
  55727. value: 1,
  55728. },
  55729. size: {
  55730. type: 'f',
  55731. value: 1,
  55732. },
  55733. scale: {
  55734. type: 'f',
  55735. value: 1,
  55736. },
  55737. map: {
  55738. type: 't',
  55739. value: null,
  55740. },
  55741. offsetRepeat: {
  55742. type: 'v4',
  55743. value: new n.Vector4(0, 0, 1, 1),
  55744. },
  55745. },
  55746. }),
  55747. (n.ShaderChunk.cube_frag =
  55748. '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'),
  55749. (n.ShaderChunk.cube_vert =
  55750. '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'),
  55751. (n.ShaderChunk.depth_frag =
  55752. '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'),
  55753. (n.ShaderChunk.depth_vert =
  55754. '#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'),
  55755. (n.ShaderChunk.depthRGBA_frag =
  55756. '#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'),
  55757. (n.ShaderChunk.depthRGBA_vert =
  55758. '#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'),
  55759. (n.ShaderChunk.distanceRGBA_frag =
  55760. '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'),
  55761. (n.ShaderChunk.distanceRGBA_vert =
  55762. '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'),
  55763. (n.ShaderChunk.equirect_frag =
  55764. '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'),
  55765. (n.ShaderChunk.equirect_vert =
  55766. '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'),
  55767. (n.ShaderChunk.linedashed_frag =
  55768. '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'),
  55769. (n.ShaderChunk.linedashed_vert =
  55770. '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'),
  55771. (n.ShaderChunk.meshbasic_frag =
  55772. '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'),
  55773. (n.ShaderChunk.meshbasic_vert =
  55774. '#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'),
  55775. (n.ShaderChunk.meshlambert_frag =
  55776. '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'),
  55777. (n.ShaderChunk.meshlambert_vert =
  55778. '#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'),
  55779. (n.ShaderChunk.meshphong_frag =
  55780. '#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'),
  55781. (n.ShaderChunk.meshphong_vert =
  55782. '#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'),
  55783. (n.ShaderChunk.meshstandard_frag =
  55784. '#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'),
  55785. (n.ShaderChunk.meshstandard_vert =
  55786. '#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'),
  55787. (n.ShaderChunk.normal_frag =
  55788. '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'),
  55789. (n.ShaderChunk.normal_vert =
  55790. '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'),
  55791. (n.ShaderChunk.points_frag =
  55792. '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'),
  55793. (n.ShaderChunk.points_vert =
  55794. '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'),
  55795. (n.ShaderLib = {
  55796. basic: {
  55797. uniforms: n.UniformsUtils.merge([
  55798. n.UniformsLib.common,
  55799. n.UniformsLib.aomap,
  55800. n.UniformsLib.fog,
  55801. ]),
  55802. vertexShader: n.ShaderChunk.meshbasic_vert,
  55803. fragmentShader: n.ShaderChunk.meshbasic_frag,
  55804. },
  55805. lambert: {
  55806. uniforms: n.UniformsUtils.merge([
  55807. n.UniformsLib.common,
  55808. n.UniformsLib.aomap,
  55809. n.UniformsLib.lightmap,
  55810. n.UniformsLib.emissivemap,
  55811. n.UniformsLib.fog,
  55812. n.UniformsLib.lights,
  55813. {
  55814. emissive: {
  55815. type: 'c',
  55816. value: new n.Color(0),
  55817. },
  55818. },
  55819. ]),
  55820. vertexShader: n.ShaderChunk.meshlambert_vert,
  55821. fragmentShader: n.ShaderChunk.meshlambert_frag,
  55822. },
  55823. phong: {
  55824. uniforms: n.UniformsUtils.merge([
  55825. n.UniformsLib.common,
  55826. n.UniformsLib.aomap,
  55827. n.UniformsLib.lightmap,
  55828. n.UniformsLib.emissivemap,
  55829. n.UniformsLib.bumpmap,
  55830. n.UniformsLib.normalmap,
  55831. n.UniformsLib.displacementmap,
  55832. n.UniformsLib.fog,
  55833. n.UniformsLib.lights,
  55834. {
  55835. emissive: {
  55836. type: 'c',
  55837. value: new n.Color(0),
  55838. },
  55839. specular: {
  55840. type: 'c',
  55841. value: new n.Color(1118481),
  55842. },
  55843. shininess: {
  55844. type: 'f',
  55845. value: 30,
  55846. },
  55847. },
  55848. ]),
  55849. vertexShader: n.ShaderChunk.meshphong_vert,
  55850. fragmentShader: n.ShaderChunk.meshphong_frag,
  55851. },
  55852. standard: {
  55853. uniforms: n.UniformsUtils.merge([
  55854. n.UniformsLib.common,
  55855. n.UniformsLib.aomap,
  55856. n.UniformsLib.lightmap,
  55857. n.UniformsLib.emissivemap,
  55858. n.UniformsLib.bumpmap,
  55859. n.UniformsLib.normalmap,
  55860. n.UniformsLib.displacementmap,
  55861. n.UniformsLib.roughnessmap,
  55862. n.UniformsLib.metalnessmap,
  55863. n.UniformsLib.fog,
  55864. n.UniformsLib.lights,
  55865. {
  55866. emissive: {
  55867. type: 'c',
  55868. value: new n.Color(0),
  55869. },
  55870. roughness: {
  55871. type: 'f',
  55872. value: 0.5,
  55873. },
  55874. metalness: {
  55875. type: 'f',
  55876. value: 0,
  55877. },
  55878. envMapIntensity: {
  55879. type: 'f',
  55880. value: 1,
  55881. },
  55882. },
  55883. ]),
  55884. vertexShader: n.ShaderChunk.meshstandard_vert,
  55885. fragmentShader: n.ShaderChunk.meshstandard_frag,
  55886. },
  55887. points: {
  55888. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  55889. vertexShader: n.ShaderChunk.points_vert,
  55890. fragmentShader: n.ShaderChunk.points_frag,
  55891. },
  55892. dashed: {
  55893. uniforms: n.UniformsUtils.merge([
  55894. n.UniformsLib.common,
  55895. n.UniformsLib.fog,
  55896. {
  55897. scale: {
  55898. type: 'f',
  55899. value: 1,
  55900. },
  55901. dashSize: {
  55902. type: 'f',
  55903. value: 1,
  55904. },
  55905. totalSize: {
  55906. type: 'f',
  55907. value: 2,
  55908. },
  55909. },
  55910. ]),
  55911. vertexShader: n.ShaderChunk.linedashed_vert,
  55912. fragmentShader: n.ShaderChunk.linedashed_frag,
  55913. },
  55914. depth: {
  55915. uniforms: {
  55916. mNear: {
  55917. type: 'f',
  55918. value: 1,
  55919. },
  55920. mFar: {
  55921. type: 'f',
  55922. value: 2e3,
  55923. },
  55924. opacity: {
  55925. type: 'f',
  55926. value: 1,
  55927. },
  55928. },
  55929. vertexShader: n.ShaderChunk.depth_vert,
  55930. fragmentShader: n.ShaderChunk.depth_frag,
  55931. },
  55932. normal: {
  55933. uniforms: {
  55934. opacity: {
  55935. type: 'f',
  55936. value: 1,
  55937. },
  55938. },
  55939. vertexShader: n.ShaderChunk.normal_vert,
  55940. fragmentShader: n.ShaderChunk.normal_frag,
  55941. },
  55942. cube: {
  55943. uniforms: {
  55944. tCube: {
  55945. type: 't',
  55946. value: null,
  55947. },
  55948. tFlip: {
  55949. type: 'f',
  55950. value: -1,
  55951. },
  55952. },
  55953. vertexShader: n.ShaderChunk.cube_vert,
  55954. fragmentShader: n.ShaderChunk.cube_frag,
  55955. },
  55956. equirect: {
  55957. uniforms: {
  55958. tEquirect: {
  55959. type: 't',
  55960. value: null,
  55961. },
  55962. tFlip: {
  55963. type: 'f',
  55964. value: -1,
  55965. },
  55966. },
  55967. vertexShader: n.ShaderChunk.equirect_vert,
  55968. fragmentShader: n.ShaderChunk.equirect_frag,
  55969. },
  55970. depthRGBA: {
  55971. uniforms: {},
  55972. vertexShader: n.ShaderChunk.depthRGBA_vert,
  55973. fragmentShader: n.ShaderChunk.depthRGBA_frag,
  55974. },
  55975. distanceRGBA: {
  55976. uniforms: {
  55977. lightPos: {
  55978. type: 'v3',
  55979. value: new n.Vector3(0, 0, 0),
  55980. },
  55981. },
  55982. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  55983. fragmentShader: n.ShaderChunk.distanceRGBA_frag,
  55984. },
  55985. }),
  55986. (n.WebGLRenderer = function (e) {
  55987. function t() {
  55988. return null === ye ? Oe : 1;
  55989. }
  55990. function i(e, t, i, n) {
  55991. se === !0 && ((e *= n), (t *= n), (i *= n)), Ye.clearColor(e, t, i, n);
  55992. }
  55993. function r() {
  55994. Ye.init(),
  55995. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  55996. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  55997. i(Se.r, Se.g, Se.b, Me);
  55998. }
  55999. function o() {
  56000. (Ae = null), (be = null), (Ee = ''), (Ie = -1), Ye.reset();
  56001. }
  56002. function a(e) {
  56003. e.preventDefault(), o(), r(), Xe.clear();
  56004. }
  56005. function s(e) {
  56006. var t = e.target;
  56007. t.removeEventListener('dispose', s), h(t), ke.textures--;
  56008. }
  56009. function l(e) {
  56010. var t = e.target;
  56011. t.removeEventListener('dispose', l), u(t), ke.textures--;
  56012. }
  56013. function c(e) {
  56014. var t = e.target;
  56015. t.removeEventListener('dispose', c), d(t);
  56016. }
  56017. function h(e) {
  56018. var t = Xe.get(e);
  56019. if (e.image && t.__image__webglTextureCube)
  56020. Ge.deleteTexture(t.__image__webglTextureCube);
  56021. else {
  56022. if (void 0 === t.__webglInit) return;
  56023. Ge.deleteTexture(t.__webglTexture);
  56024. }
  56025. Xe.delete(e);
  56026. }
  56027. function u(e) {
  56028. var t = Xe.get(e),
  56029. i = Xe.get(e.texture);
  56030. if (e && void 0 !== i.__webglTexture) {
  56031. if ((Ge.deleteTexture(i.__webglTexture), e instanceof n.WebGLRenderTargetCube))
  56032. for (var r = 0; r < 6; r++)
  56033. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  56034. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  56035. else
  56036. Ge.deleteFramebuffer(t.__webglFramebuffer),
  56037. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  56038. Xe.delete(e.texture), Xe.delete(e);
  56039. }
  56040. }
  56041. function d(e) {
  56042. p(e), Xe.delete(e);
  56043. }
  56044. function p(e) {
  56045. var t = Xe.get(e).program;
  56046. (e.program = void 0), void 0 !== t && qe.releaseProgram(t);
  56047. }
  56048. function f(e, t, i, r) {
  56049. var o;
  56050. if (
  56051. i instanceof n.InstancedBufferGeometry &&
  56052. ((o = We.get('ANGLE_instanced_arrays')), null === o)
  56053. )
  56054. return void console.error(
  56055. 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  56056. );
  56057. void 0 === r && (r = 0), Ye.initAttributes();
  56058. var a = i.attributes,
  56059. s = t.getAttributes(),
  56060. l = e.defaultAttributeValues;
  56061. for (var c in s) {
  56062. var h = s[c];
  56063. if (h >= 0) {
  56064. var u = a[c];
  56065. if (void 0 !== u) {
  56066. var d = u.itemSize,
  56067. p = Ze.getAttributeBuffer(u);
  56068. if (u instanceof n.InterleavedBufferAttribute) {
  56069. var f = u.data,
  56070. g = f.stride,
  56071. m = u.offset;
  56072. f instanceof n.InstancedInterleavedBuffer
  56073. ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  56074. void 0 === i.maxInstancedCount &&
  56075. (i.maxInstancedCount = f.meshPerAttribute * f.count))
  56076. : Ye.enableAttribute(h),
  56077. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56078. Ge.vertexAttribPointer(
  56079. h,
  56080. d,
  56081. Ge.FLOAT,
  56082. !1,
  56083. g * f.array.BYTES_PER_ELEMENT,
  56084. (r * g + m) * f.array.BYTES_PER_ELEMENT
  56085. );
  56086. } else
  56087. u instanceof n.InstancedBufferAttribute
  56088. ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  56089. void 0 === i.maxInstancedCount &&
  56090. (i.maxInstancedCount = u.meshPerAttribute * u.count))
  56091. : Ye.enableAttribute(h),
  56092. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56093. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4);
  56094. } else if (void 0 !== l) {
  56095. var v = l[c];
  56096. if (void 0 !== v)
  56097. switch (v.length) {
  56098. case 2:
  56099. Ge.vertexAttrib2fv(h, v);
  56100. break;
  56101. case 3:
  56102. Ge.vertexAttrib3fv(h, v);
  56103. break;
  56104. case 4:
  56105. Ge.vertexAttrib4fv(h, v);
  56106. break;
  56107. default:
  56108. Ge.vertexAttrib1fv(h, v);
  56109. }
  56110. }
  56111. }
  56112. }
  56113. Ye.disableUnusedAttributes();
  56114. }
  56115. function g(e, t) {
  56116. return Math.abs(t[0]) - Math.abs(e[0]);
  56117. }
  56118. function m(e, t) {
  56119. return e.object.renderOrder !== t.object.renderOrder
  56120. ? e.object.renderOrder - t.object.renderOrder
  56121. : e.material.id !== t.material.id
  56122. ? e.material.id - t.material.id
  56123. : e.z !== t.z
  56124. ? e.z - t.z
  56125. : e.id - t.id;
  56126. }
  56127. function v(e, t) {
  56128. return e.object.renderOrder !== t.object.renderOrder
  56129. ? e.object.renderOrder - t.object.renderOrder
  56130. : e.z !== t.z
  56131. ? t.z - e.z
  56132. : e.id - t.id;
  56133. }
  56134. function A(e, t, i, n, r) {
  56135. var o, a;
  56136. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue));
  56137. var s = o[a];
  56138. void 0 !== s
  56139. ? ((s.id = e.id),
  56140. (s.object = e),
  56141. (s.geometry = t),
  56142. (s.material = i),
  56143. (s.z = Ve.z),
  56144. (s.group = r))
  56145. : ((s = {
  56146. id: e.id,
  56147. object: e,
  56148. geometry: t,
  56149. material: i,
  56150. z: Ve.z,
  56151. group: r,
  56152. }),
  56153. o.push(s));
  56154. }
  56155. function y(e, t) {
  56156. if (e.visible !== !1) {
  56157. if (e.layers.test(t.layers))
  56158. if (e instanceof n.Light) ce.push(e);
  56159. else if (e instanceof n.Sprite)
  56160. (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) || ge.push(e);
  56161. else if (e instanceof n.LensFlare) me.push(e);
  56162. else if (e instanceof n.ImmediateRenderObject)
  56163. ve.sortObjects === !0 &&
  56164. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe)),
  56165. A(e, null, e.material, Ve.z, null);
  56166. else if (
  56167. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  56168. (e instanceof n.SkinnedMesh && e.skeleton.update(),
  56169. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  56170. ) {
  56171. var i = e.material;
  56172. if (i.visible === !0) {
  56173. ve.sortObjects === !0 &&
  56174. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe));
  56175. var r = Ze.update(e);
  56176. if (i instanceof n.MultiMaterial)
  56177. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  56178. var c = o[s],
  56179. h = a[c.materialIndex];
  56180. h.visible === !0 && A(e, r, h, Ve.z, c);
  56181. }
  56182. else A(e, r, i, Ve.z, null);
  56183. }
  56184. }
  56185. for (var u = e.children, s = 0, l = u.length; s < l; s++) y(u[s], t);
  56186. }
  56187. }
  56188. function C(e, t, i, r) {
  56189. for (var o = 0, a = e.length; o < a; o++) {
  56190. var s = e[o],
  56191. l = s.object,
  56192. c = s.geometry,
  56193. h = void 0 === r ? s.material : r,
  56194. u = s.group;
  56195. if (
  56196. (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  56197. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  56198. l instanceof n.ImmediateRenderObject)
  56199. ) {
  56200. E(h);
  56201. var d = w(t, i, h, l);
  56202. (Ee = ''),
  56203. l.render(function (e) {
  56204. ve.renderBufferImmediate(e, d, h);
  56205. });
  56206. } else ve.renderBufferDirect(t, i, c, h, l, u);
  56207. }
  56208. }
  56209. function I(e, t, i) {
  56210. var r = Xe.get(e),
  56211. o = qe.getParameters(e, Ue, t, i),
  56212. a = qe.getProgramCode(e, o),
  56213. s = r.program,
  56214. l = !0;
  56215. if (void 0 === s) e.addEventListener('dispose', c);
  56216. else if (s.code !== a) p(e);
  56217. else {
  56218. if (void 0 !== o.shaderID) return;
  56219. l = !1;
  56220. }
  56221. if (l) {
  56222. if (o.shaderID) {
  56223. var h = n.ShaderLib[o.shaderID];
  56224. r.__webglShader = {
  56225. name: e.type,
  56226. uniforms: n.UniformsUtils.clone(h.uniforms),
  56227. vertexShader: h.vertexShader,
  56228. fragmentShader: h.fragmentShader,
  56229. };
  56230. } else
  56231. r.__webglShader = {
  56232. name: e.type,
  56233. uniforms: e.uniforms,
  56234. vertexShader: e.vertexShader,
  56235. fragmentShader: e.fragmentShader,
  56236. };
  56237. (e.__webglShader = r.__webglShader),
  56238. (s = qe.acquireProgram(e, o, a)),
  56239. (r.program = s),
  56240. (e.program = s);
  56241. }
  56242. var u = s.getAttributes();
  56243. if (e.morphTargets) {
  56244. e.numSupportedMorphTargets = 0;
  56245. for (var d = 0; d < ve.maxMorphTargets; d++)
  56246. u['morphTarget' + d] >= 0 && e.numSupportedMorphTargets++;
  56247. }
  56248. if (e.morphNormals) {
  56249. e.numSupportedMorphNormals = 0;
  56250. for (var d = 0; d < ve.maxMorphNormals; d++)
  56251. u['morphNormal' + d] >= 0 && e.numSupportedMorphNormals++;
  56252. }
  56253. r.uniformsList = [];
  56254. var f = r.__webglShader.uniforms,
  56255. g = r.program.getUniforms();
  56256. for (var m in f) {
  56257. var v = g[m];
  56258. v && r.uniformsList.push([r.__webglShader.uniforms[m], v]);
  56259. }
  56260. (e instanceof n.MeshPhongMaterial ||
  56261. e instanceof n.MeshLambertMaterial ||
  56262. e instanceof n.MeshStandardMaterial ||
  56263. e.lights) &&
  56264. ((r.lightsHash = Ue.hash),
  56265. (f.ambientLightColor.value = Ue.ambient),
  56266. (f.directionalLights.value = Ue.directional),
  56267. (f.spotLights.value = Ue.spot),
  56268. (f.pointLights.value = Ue.point),
  56269. (f.hemisphereLights.value = Ue.hemi),
  56270. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  56271. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  56272. (f.spotShadowMap.value = Ue.spotShadowMap),
  56273. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  56274. (f.pointShadowMap.value = Ue.pointShadowMap),
  56275. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  56276. (r.hasDynamicUniforms = !1);
  56277. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  56278. var C = r.uniformsList[A][0];
  56279. if (C.dynamic === !0) {
  56280. r.hasDynamicUniforms = !0;
  56281. break;
  56282. }
  56283. }
  56284. }
  56285. function E(e) {
  56286. b(e),
  56287. e.transparent === !0
  56288. ? Ye.setBlending(
  56289. e.blending,
  56290. e.blendEquation,
  56291. e.blendSrc,
  56292. e.blendDst,
  56293. e.blendEquationAlpha,
  56294. e.blendSrcAlpha,
  56295. e.blendDstAlpha,
  56296. e.premultipliedAlpha
  56297. )
  56298. : Ye.setBlending(n.NoBlending),
  56299. Ye.setDepthFunc(e.depthFunc),
  56300. Ye.setDepthTest(e.depthTest),
  56301. Ye.setDepthWrite(e.depthWrite),
  56302. Ye.setColorWrite(e.colorWrite),
  56303. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits);
  56304. }
  56305. function b(e) {
  56306. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  56307. Ye.setFlipSided(e.side === n.BackSide);
  56308. }
  56309. function w(e, t, i, r) {
  56310. xe = 0;
  56311. var o = Xe.get(i);
  56312. void 0 === o.program && (i.needsUpdate = !0),
  56313. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  56314. i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1));
  56315. var a = !1,
  56316. s = !1,
  56317. l = !1,
  56318. c = o.program,
  56319. h = c.getUniforms(),
  56320. u = o.__webglShader.uniforms;
  56321. if (
  56322. (c.id !== Ae &&
  56323. (Ge.useProgram(c.program), (Ae = c.id), (a = !0), (s = !0), (l = !0)),
  56324. i.id !== Ie && ((Ie = i.id), (s = !0)),
  56325. (a || e !== be) &&
  56326. (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  56327. je.logarithmicDepthBuffer &&
  56328. Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  56329. e !== be && ((be = e), (s = !0), (l = !0)),
  56330. (i instanceof n.ShaderMaterial ||
  56331. i instanceof n.MeshPhongMaterial ||
  56332. i instanceof n.MeshStandardMaterial ||
  56333. i.envMap) &&
  56334. void 0 !== h.cameraPosition &&
  56335. (Ve.setFromMatrixPosition(e.matrixWorld),
  56336. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  56337. (i instanceof n.MeshPhongMaterial ||
  56338. i instanceof n.MeshLambertMaterial ||
  56339. i instanceof n.MeshBasicMaterial ||
  56340. i instanceof n.MeshStandardMaterial ||
  56341. i instanceof n.ShaderMaterial ||
  56342. i.skinning) &&
  56343. void 0 !== h.viewMatrix &&
  56344. Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  56345. void 0 !== h.toneMappingExposure &&
  56346. Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  56347. void 0 !== h.toneMappingWhitePoint &&
  56348. Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  56349. i.skinning)
  56350. )
  56351. if (
  56352. (r.bindMatrix &&
  56353. void 0 !== h.bindMatrix &&
  56354. Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  56355. r.bindMatrixInverse &&
  56356. void 0 !== h.bindMatrixInverse &&
  56357. Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  56358. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture)
  56359. ) {
  56360. if (void 0 !== h.boneTexture) {
  56361. var d = B();
  56362. Ge.uniform1i(h.boneTexture, d), ve.setTexture(r.skeleton.boneTexture, d);
  56363. }
  56364. void 0 !== h.boneTextureWidth &&
  56365. Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  56366. void 0 !== h.boneTextureHeight &&
  56367. Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight);
  56368. } else
  56369. r.skeleton &&
  56370. r.skeleton.boneMatrices &&
  56371. void 0 !== h.boneGlobalMatrices &&
  56372. Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  56373. return (
  56374. s &&
  56375. ((i instanceof n.MeshPhongMaterial ||
  56376. i instanceof n.MeshLambertMaterial ||
  56377. i instanceof n.MeshStandardMaterial ||
  56378. i.lights) &&
  56379. D(u, l),
  56380. t && i.fog && R(u, t),
  56381. (i instanceof n.MeshBasicMaterial ||
  56382. i instanceof n.MeshLambertMaterial ||
  56383. i instanceof n.MeshPhongMaterial ||
  56384. i instanceof n.MeshStandardMaterial) &&
  56385. T(u, i),
  56386. i instanceof n.LineBasicMaterial
  56387. ? x(u, i)
  56388. : i instanceof n.LineDashedMaterial
  56389. ? (x(u, i), S(u, i))
  56390. : i instanceof n.PointsMaterial
  56391. ? M(u, i)
  56392. : i instanceof n.MeshLambertMaterial
  56393. ? P(u, i)
  56394. : i instanceof n.MeshPhongMaterial
  56395. ? O(u, i)
  56396. : i instanceof n.MeshStandardMaterial
  56397. ? L(u, i)
  56398. : i instanceof n.MeshDepthMaterial
  56399. ? ((u.mNear.value = e.near),
  56400. (u.mFar.value = e.far),
  56401. (u.opacity.value = i.opacity))
  56402. : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  56403. V(o.uniformsList)),
  56404. N(h, r),
  56405. void 0 !== h.modelMatrix &&
  56406. Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  56407. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  56408. c
  56409. );
  56410. }
  56411. function _(e, t, i) {
  56412. for (var n = [], r = 0, o = e.length; r < o; r++) {
  56413. var a = e[r][0],
  56414. s = a.onUpdateCallback;
  56415. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]));
  56416. }
  56417. V(n);
  56418. }
  56419. function T(e, t) {
  56420. (e.opacity.value = t.opacity),
  56421. (e.diffuse.value = t.color),
  56422. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  56423. (e.map.value = t.map),
  56424. (e.specularMap.value = t.specularMap),
  56425. (e.alphaMap.value = t.alphaMap),
  56426. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity));
  56427. var i;
  56428. if (
  56429. (t.map
  56430. ? (i = t.map)
  56431. : t.specularMap
  56432. ? (i = t.specularMap)
  56433. : t.displacementMap
  56434. ? (i = t.displacementMap)
  56435. : t.normalMap
  56436. ? (i = t.normalMap)
  56437. : t.bumpMap
  56438. ? (i = t.bumpMap)
  56439. : t.roughnessMap
  56440. ? (i = t.roughnessMap)
  56441. : t.metalnessMap
  56442. ? (i = t.metalnessMap)
  56443. : t.alphaMap
  56444. ? (i = t.alphaMap)
  56445. : t.emissiveMap && (i = t.emissiveMap),
  56446. void 0 !== i)
  56447. ) {
  56448. i instanceof n.WebGLRenderTarget && (i = i.texture);
  56449. var r = i.offset,
  56450. o = i.repeat;
  56451. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y);
  56452. }
  56453. (e.envMap.value = t.envMap),
  56454. (e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  56455. (e.reflectivity.value = t.reflectivity),
  56456. (e.refractionRatio.value = t.refractionRatio);
  56457. }
  56458. function x(e, t) {
  56459. (e.diffuse.value = t.color), (e.opacity.value = t.opacity);
  56460. }
  56461. function S(e, t) {
  56462. (e.dashSize.value = t.dashSize),
  56463. (e.totalSize.value = t.dashSize + t.gapSize),
  56464. (e.scale.value = t.scale);
  56465. }
  56466. function M(e, t) {
  56467. if (
  56468. ((e.diffuse.value = t.color),
  56469. (e.opacity.value = t.opacity),
  56470. (e.size.value = t.size * Oe),
  56471. (e.scale.value = te.clientHeight / 2),
  56472. (e.map.value = t.map),
  56473. null !== t.map)
  56474. ) {
  56475. var i = t.map.offset,
  56476. n = t.map.repeat;
  56477. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y);
  56478. }
  56479. }
  56480. function R(e, t) {
  56481. (e.fogColor.value = t.color),
  56482. t instanceof n.Fog
  56483. ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far))
  56484. : t instanceof n.FogExp2 && (e.fogDensity.value = t.density);
  56485. }
  56486. function P(e, t) {
  56487. t.lightMap &&
  56488. ((e.lightMap.value = t.lightMap),
  56489. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56490. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap);
  56491. }
  56492. function O(e, t) {
  56493. (e.specular.value = t.specular),
  56494. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  56495. t.lightMap &&
  56496. ((e.lightMap.value = t.lightMap),
  56497. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56498. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56499. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56500. t.normalMap &&
  56501. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56502. t.displacementMap &&
  56503. ((e.displacementMap.value = t.displacementMap),
  56504. (e.displacementScale.value = t.displacementScale),
  56505. (e.displacementBias.value = t.displacementBias));
  56506. }
  56507. function L(e, t) {
  56508. (e.roughness.value = t.roughness),
  56509. (e.metalness.value = t.metalness),
  56510. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  56511. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  56512. t.lightMap &&
  56513. ((e.lightMap.value = t.lightMap),
  56514. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56515. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56516. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56517. t.normalMap &&
  56518. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56519. t.displacementMap &&
  56520. ((e.displacementMap.value = t.displacementMap),
  56521. (e.displacementScale.value = t.displacementScale),
  56522. (e.displacementBias.value = t.displacementBias)),
  56523. t.envMap && (e.envMapIntensity.value = t.envMapIntensity);
  56524. }
  56525. function D(e, t) {
  56526. (e.ambientLightColor.needsUpdate = t),
  56527. (e.directionalLights.needsUpdate = t),
  56528. (e.pointLights.needsUpdate = t),
  56529. (e.spotLights.needsUpdate = t),
  56530. (e.hemisphereLights.needsUpdate = t);
  56531. }
  56532. function N(e, t) {
  56533. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  56534. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements);
  56535. }
  56536. function B() {
  56537. var e = xe;
  56538. return (
  56539. e >= je.maxTextures &&
  56540. console.warn(
  56541. 'WebGLRenderer: trying to use ' +
  56542. e +
  56543. ' texture units while this GPU supports only ' +
  56544. je.maxTextures
  56545. ),
  56546. (xe += 1),
  56547. e
  56548. );
  56549. }
  56550. function F(e, t, i, r) {
  56551. var o, a;
  56552. if ('1i' === t) Ge.uniform1i(i, r);
  56553. else if ('1f' === t) Ge.uniform1f(i, r);
  56554. else if ('2f' === t) Ge.uniform2f(i, r[0], r[1]);
  56555. else if ('3f' === t) Ge.uniform3f(i, r[0], r[1], r[2]);
  56556. else if ('4f' === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  56557. else if ('1iv' === t) Ge.uniform1iv(i, r);
  56558. else if ('3iv' === t) Ge.uniform3iv(i, r);
  56559. else if ('1fv' === t) Ge.uniform1fv(i, r);
  56560. else if ('2fv' === t) Ge.uniform2fv(i, r);
  56561. else if ('3fv' === t) Ge.uniform3fv(i, r);
  56562. else if ('4fv' === t) Ge.uniform4fv(i, r);
  56563. else if ('Matrix2fv' === t) Ge.uniformMatrix2fv(i, !1, r);
  56564. else if ('Matrix3fv' === t) Ge.uniformMatrix3fv(i, !1, r);
  56565. else if ('Matrix4fv' === t) Ge.uniformMatrix4fv(i, !1, r);
  56566. else if ('i' === t) Ge.uniform1i(i, r);
  56567. else if ('f' === t) Ge.uniform1f(i, r);
  56568. else if ('v2' === t) Ge.uniform2f(i, r.x, r.y);
  56569. else if ('v3' === t) Ge.uniform3f(i, r.x, r.y, r.z);
  56570. else if ('v4' === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  56571. else if ('c' === t) Ge.uniform3f(i, r.r, r.g, r.b);
  56572. else if ('s' === t) {
  56573. var s = e.properties;
  56574. for (var l in s) {
  56575. var c = s[l],
  56576. h = i[l],
  56577. u = r[l];
  56578. F(c, c.type, h, u);
  56579. }
  56580. } else if ('sa' === t)
  56581. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  56582. for (var l in s) {
  56583. var c = s[l],
  56584. h = i[d][l],
  56585. u = r[d][l];
  56586. F(c, c.type, h, u);
  56587. }
  56588. else if ('iv1' === t) Ge.uniform1iv(i, r);
  56589. else if ('iv' === t) Ge.uniform3iv(i, r);
  56590. else if ('fv1' === t) Ge.uniform1fv(i, r);
  56591. else if ('fv' === t) Ge.uniform3fv(i, r);
  56592. else if ('v2v' === t) {
  56593. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  56594. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2)
  56595. (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y);
  56596. Ge.uniform2fv(i, e._array);
  56597. } else if ('v3v' === t) {
  56598. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  56599. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3)
  56600. (e._array[m + 0] = r[d].x),
  56601. (e._array[m + 1] = r[d].y),
  56602. (e._array[m + 2] = r[d].z);
  56603. Ge.uniform3fv(i, e._array);
  56604. } else if ('v4v' === t) {
  56605. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  56606. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4)
  56607. (e._array[v + 0] = r[d].x),
  56608. (e._array[v + 1] = r[d].y),
  56609. (e._array[v + 2] = r[d].z),
  56610. (e._array[v + 3] = r[d].w);
  56611. Ge.uniform4fv(i, e._array);
  56612. } else if ('m2' === t) Ge.uniformMatrix2fv(i, !1, r.elements);
  56613. else if ('m3' === t) Ge.uniformMatrix3fv(i, !1, r.elements);
  56614. else if ('m3v' === t) {
  56615. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  56616. for (var d = 0, g = r.length; d < g; d++)
  56617. r[d].flattenToArrayOffset(e._array, 9 * d);
  56618. Ge.uniformMatrix3fv(i, !1, e._array);
  56619. } else if ('m4' === t) Ge.uniformMatrix4fv(i, !1, r.elements);
  56620. else if ('m4v' === t) {
  56621. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  56622. for (var d = 0, g = r.length; d < g; d++)
  56623. r[d].flattenToArrayOffset(e._array, 16 * d);
  56624. Ge.uniformMatrix4fv(i, !1, e._array);
  56625. } else if ('t' === t) {
  56626. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return;
  56627. o instanceof n.CubeTexture || (Array.isArray(o.image) && 6 === o.image.length)
  56628. ? Y(o, a)
  56629. : o instanceof n.WebGLRenderTargetCube
  56630. ? X(o.texture, a)
  56631. : o instanceof n.WebGLRenderTarget
  56632. ? ve.setTexture(o.texture, a)
  56633. : ve.setTexture(o, a);
  56634. } else if ('tv' === t) {
  56635. void 0 === e._array && (e._array = []);
  56636. for (var d = 0, g = e.value.length; d < g; d++) e._array[d] = B();
  56637. Ge.uniform1iv(i, e._array);
  56638. for (var d = 0, g = e.value.length; d < g; d++)
  56639. (o = e.value[d]),
  56640. (a = e._array[d]),
  56641. o &&
  56642. (o instanceof n.CubeTexture ||
  56643. (o.image instanceof Array && 6 === o.image.length)
  56644. ? Y(o, a)
  56645. : o instanceof n.WebGLRenderTarget
  56646. ? ve.setTexture(o.texture, a)
  56647. : o instanceof n.WebGLRenderTargetCube
  56648. ? X(o.texture, a)
  56649. : ve.setTexture(o, a));
  56650. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t);
  56651. }
  56652. function V(e) {
  56653. for (var t = 0, i = e.length; t < i; t++) {
  56654. var n = e[t][0];
  56655. if (n.needsUpdate !== !1) {
  56656. var r = n.type,
  56657. o = e[t][1],
  56658. a = n.value;
  56659. F(n, r, o, a);
  56660. }
  56661. }
  56662. }
  56663. function U(e, t) {
  56664. var i,
  56665. r,
  56666. o,
  56667. a,
  56668. s,
  56669. l,
  56670. c = 0,
  56671. h = 0,
  56672. u = 0,
  56673. d = t.matrixWorldInverse,
  56674. p = 0,
  56675. f = 0,
  56676. g = 0,
  56677. m = 0,
  56678. v = 0;
  56679. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  56680. if (
  56681. ((o = e[i]),
  56682. (a = o.color),
  56683. (s = o.intensity),
  56684. (l = o.distance),
  56685. o instanceof n.AmbientLight)
  56686. )
  56687. (c += a.r * s), (h += a.g * s), (u += a.b * s);
  56688. else if (o instanceof n.DirectionalLight) {
  56689. var A = Ke.get(o);
  56690. A.color.copy(o.color).multiplyScalar(o.intensity),
  56691. A.direction.setFromMatrixPosition(o.matrixWorld),
  56692. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56693. A.direction.sub(Ve),
  56694. A.direction.transformDirection(d),
  56695. (A.shadow = o.castShadow),
  56696. o.castShadow &&
  56697. ((A.shadowBias = o.shadow.bias),
  56698. (A.shadowRadius = o.shadow.radius),
  56699. (A.shadowMapSize = o.shadow.mapSize),
  56700. (Ue.shadows[v++] = o)),
  56701. (Ue.directionalShadowMap[p] = o.shadow.map),
  56702. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  56703. (Ue.directional[p++] = A);
  56704. } else if (o instanceof n.SpotLight) {
  56705. var A = Ke.get(o);
  56706. A.position.setFromMatrixPosition(o.matrixWorld),
  56707. A.position.applyMatrix4(d),
  56708. A.color.copy(a).multiplyScalar(s),
  56709. (A.distance = l),
  56710. A.direction.setFromMatrixPosition(o.matrixWorld),
  56711. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56712. A.direction.sub(Ve),
  56713. A.direction.transformDirection(d),
  56714. (A.coneCos = Math.cos(o.angle)),
  56715. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  56716. (A.decay = 0 === o.distance ? 0 : o.decay),
  56717. (A.shadow = o.castShadow),
  56718. o.castShadow &&
  56719. ((A.shadowBias = o.shadow.bias),
  56720. (A.shadowRadius = o.shadow.radius),
  56721. (A.shadowMapSize = o.shadow.mapSize),
  56722. (Ue.shadows[v++] = o)),
  56723. (Ue.spotShadowMap[g] = o.shadow.map),
  56724. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  56725. (Ue.spot[g++] = A);
  56726. } else if (o instanceof n.PointLight) {
  56727. var A = Ke.get(o);
  56728. A.position.setFromMatrixPosition(o.matrixWorld),
  56729. A.position.applyMatrix4(d),
  56730. A.color.copy(o.color).multiplyScalar(o.intensity),
  56731. (A.distance = o.distance),
  56732. (A.decay = 0 === o.distance ? 0 : o.decay),
  56733. (A.shadow = o.castShadow),
  56734. o.castShadow &&
  56735. ((A.shadowBias = o.shadow.bias),
  56736. (A.shadowRadius = o.shadow.radius),
  56737. (A.shadowMapSize = o.shadow.mapSize),
  56738. (Ue.shadows[v++] = o)),
  56739. (Ue.pointShadowMap[f] = o.shadow.map),
  56740. void 0 === Ue.pointShadowMatrix[f] &&
  56741. (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  56742. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  56743. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  56744. (Ue.point[f++] = A);
  56745. } else if (o instanceof n.HemisphereLight) {
  56746. var A = Ke.get(o);
  56747. A.direction.setFromMatrixPosition(o.matrixWorld),
  56748. A.direction.transformDirection(d),
  56749. A.direction.normalize(),
  56750. A.skyColor.copy(o.color).multiplyScalar(s),
  56751. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  56752. (Ue.hemi[m++] = A);
  56753. }
  56754. (Ue.ambient[0] = c),
  56755. (Ue.ambient[1] = h),
  56756. (Ue.ambient[2] = u),
  56757. (Ue.directional.length = p),
  56758. (Ue.spot.length = g),
  56759. (Ue.point.length = f),
  56760. (Ue.hemi.length = m),
  56761. (Ue.shadows.length = v),
  56762. (Ue.hash = p + ',' + f + ',' + g + ',' + m + ',' + v);
  56763. }
  56764. function k(e, t, i) {
  56765. var r;
  56766. if (
  56767. (i
  56768. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  56769. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  56770. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  56771. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  56772. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  56773. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  56774. (t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping) ||
  56775. console.warn(
  56776. 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.',
  56777. t
  56778. ),
  56779. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  56780. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  56781. t.minFilter !== n.NearestFilter &&
  56782. t.minFilter !== n.LinearFilter &&
  56783. console.warn(
  56784. 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.',
  56785. t
  56786. )),
  56787. (r = We.get('EXT_texture_filter_anisotropic')))
  56788. ) {
  56789. if (t.type === n.FloatType && null === We.get('OES_texture_float_linear')) return;
  56790. if (t.type === n.HalfFloatType && null === We.get('OES_texture_half_float_linear'))
  56791. return;
  56792. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  56793. (Ge.texParameterf(
  56794. e,
  56795. r.TEXTURE_MAX_ANISOTROPY_EXT,
  56796. Math.min(t.anisotropy, ve.getMaxAnisotropy())
  56797. ),
  56798. (Xe.get(t).__currentAnisotropy = t.anisotropy));
  56799. }
  56800. }
  56801. function H(e, t, i) {
  56802. void 0 === e.__webglInit &&
  56803. ((e.__webglInit = !0),
  56804. t.addEventListener('dispose', s),
  56805. (e.__webglTexture = Ge.createTexture()),
  56806. ke.textures++),
  56807. Ye.activeTexture(Ge.TEXTURE0 + i),
  56808. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  56809. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  56810. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  56811. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  56812. var r = G(t.image, je.maxTextureSize);
  56813. W(t) && z(r) === !1 && (r = j(r));
  56814. var o = z(r),
  56815. a = ee(t.format),
  56816. l = ee(t.type);
  56817. k(Ge.TEXTURE_2D, t, o);
  56818. var c,
  56819. h = t.mipmaps;
  56820. if (t instanceof n.DataTexture)
  56821. if (h.length > 0 && o) {
  56822. for (var u = 0, d = h.length; u < d; u++)
  56823. (c = h[u]),
  56824. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  56825. t.generateMipmaps = !1;
  56826. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  56827. else if (t instanceof n.CompressedTexture)
  56828. for (var u = 0, d = h.length; u < d; u++)
  56829. (c = h[u]),
  56830. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  56831. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  56832. ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data)
  56833. : console.warn(
  56834. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()'
  56835. )
  56836. : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  56837. else if (h.length > 0 && o) {
  56838. for (var u = 0, d = h.length; u < d; u++)
  56839. (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  56840. t.generateMipmaps = !1;
  56841. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  56842. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  56843. (e.__version = t.version),
  56844. t.onUpdate && t.onUpdate(t);
  56845. }
  56846. function G(e, t) {
  56847. if (e.width > t || e.height > t) {
  56848. var i = t / Math.max(e.width, e.height),
  56849. n = document.createElement('canvas');
  56850. (n.width = Math.floor(e.width * i)), (n.height = Math.floor(e.height * i));
  56851. var r = n.getContext('2d');
  56852. return (
  56853. r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  56854. console.warn(
  56855. 'THREE.WebGLRenderer: image is too big (' +
  56856. e.width +
  56857. 'x' +
  56858. e.height +
  56859. '). Resized to ' +
  56860. n.width +
  56861. 'x' +
  56862. n.height,
  56863. e
  56864. ),
  56865. n
  56866. );
  56867. }
  56868. return e;
  56869. }
  56870. function z(e) {
  56871. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  56872. }
  56873. function W(e) {
  56874. return (
  56875. e.wrapS !== n.ClampToEdgeWrapping ||
  56876. e.wrapT !== n.ClampToEdgeWrapping ||
  56877. (e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter)
  56878. );
  56879. }
  56880. function j(e) {
  56881. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  56882. var t = document.createElement('canvas');
  56883. (t.width = n.Math.nearestPowerOfTwo(e.width)),
  56884. (t.height = n.Math.nearestPowerOfTwo(e.height));
  56885. var i = t.getContext('2d');
  56886. return (
  56887. i.drawImage(e, 0, 0, t.width, t.height),
  56888. console.warn(
  56889. 'THREE.WebGLRenderer: image is not power of two (' +
  56890. e.width +
  56891. 'x' +
  56892. e.height +
  56893. '). Resized to ' +
  56894. t.width +
  56895. 'x' +
  56896. t.height,
  56897. e
  56898. ),
  56899. t
  56900. );
  56901. }
  56902. return e;
  56903. }
  56904. function Y(e, t) {
  56905. var i = Xe.get(e);
  56906. if (6 === e.image.length)
  56907. if (e.version > 0 && i.__version !== e.version) {
  56908. i.__image__webglTextureCube ||
  56909. (e.addEventListener('dispose', s),
  56910. (i.__image__webglTextureCube = Ge.createTexture()),
  56911. ke.textures++),
  56912. Ye.activeTexture(Ge.TEXTURE0 + t),
  56913. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  56914. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  56915. for (
  56916. var r = e instanceof n.CompressedTexture,
  56917. o = e.image[0] instanceof n.DataTexture,
  56918. a = [],
  56919. l = 0;
  56920. l < 6;
  56921. l++
  56922. )
  56923. !ve.autoScaleCubemaps || r || o
  56924. ? (a[l] = o ? e.image[l].image : e.image[l])
  56925. : (a[l] = G(e.image[l], je.maxCubemapSize));
  56926. var c = a[0],
  56927. h = z(c),
  56928. u = ee(e.format),
  56929. d = ee(e.type);
  56930. k(Ge.TEXTURE_CUBE_MAP, e, h);
  56931. for (var l = 0; l < 6; l++)
  56932. if (r)
  56933. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  56934. (p = f[g]),
  56935. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  56936. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  56937. ? Ye.compressedTexImage2D(
  56938. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  56939. g,
  56940. u,
  56941. p.width,
  56942. p.height,
  56943. 0,
  56944. p.data
  56945. )
  56946. : console.warn(
  56947. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()'
  56948. )
  56949. : Ye.texImage2D(
  56950. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  56951. g,
  56952. u,
  56953. p.width,
  56954. p.height,
  56955. 0,
  56956. u,
  56957. d,
  56958. p.data
  56959. );
  56960. else
  56961. o
  56962. ? Ye.texImage2D(
  56963. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  56964. 0,
  56965. u,
  56966. a[l].width,
  56967. a[l].height,
  56968. 0,
  56969. u,
  56970. d,
  56971. a[l].data
  56972. )
  56973. : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  56974. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  56975. (i.__version = e.version),
  56976. e.onUpdate && e.onUpdate(e);
  56977. } else
  56978. Ye.activeTexture(Ge.TEXTURE0 + t),
  56979. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube);
  56980. }
  56981. function X(e, t) {
  56982. Ye.activeTexture(Ge.TEXTURE0 + t),
  56983. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture);
  56984. }
  56985. function Z(e, t, i, n) {
  56986. var r = ee(t.texture.format),
  56987. o = ee(t.texture.type);
  56988. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  56989. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  56990. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  56991. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  56992. }
  56993. function q(e, t) {
  56994. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  56995. t.depthBuffer && !t.stencilBuffer
  56996. ? (Ge.renderbufferStorage(
  56997. Ge.RENDERBUFFER,
  56998. Ge.DEPTH_COMPONENT16,
  56999. t.width,
  57000. t.height
  57001. ),
  57002. Ge.framebufferRenderbuffer(
  57003. Ge.FRAMEBUFFER,
  57004. Ge.DEPTH_ATTACHMENT,
  57005. Ge.RENDERBUFFER,
  57006. e
  57007. ))
  57008. : t.depthBuffer && t.stencilBuffer
  57009. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  57010. Ge.framebufferRenderbuffer(
  57011. Ge.FRAMEBUFFER,
  57012. Ge.DEPTH_STENCIL_ATTACHMENT,
  57013. Ge.RENDERBUFFER,
  57014. e
  57015. ))
  57016. : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  57017. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null);
  57018. }
  57019. function K(e) {
  57020. var t = Xe.get(e),
  57021. i = e instanceof n.WebGLRenderTargetCube;
  57022. if (i) {
  57023. t.__webglDepthbuffer = [];
  57024. for (var r = 0; r < 6; r++)
  57025. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  57026. (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()),
  57027. q(t.__webglDepthbuffer[r], e);
  57028. } else
  57029. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  57030. (t.__webglDepthbuffer = Ge.createRenderbuffer()),
  57031. q(t.__webglDepthbuffer, e);
  57032. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null);
  57033. }
  57034. function Q(e) {
  57035. var t = Xe.get(e),
  57036. i = Xe.get(e.texture);
  57037. e.addEventListener('dispose', l),
  57038. (i.__webglTexture = Ge.createTexture()),
  57039. ke.textures++;
  57040. var r = e instanceof n.WebGLRenderTargetCube,
  57041. o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  57042. if (r) {
  57043. t.__webglFramebuffer = [];
  57044. for (var a = 0; a < 6; a++) t.__webglFramebuffer[a] = Ge.createFramebuffer();
  57045. } else t.__webglFramebuffer = Ge.createFramebuffer();
  57046. if (r) {
  57047. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  57048. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  57049. for (var a = 0; a < 6; a++)
  57050. Z(
  57051. t.__webglFramebuffer[a],
  57052. e,
  57053. Ge.COLOR_ATTACHMENT0,
  57054. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a
  57055. );
  57056. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  57057. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null);
  57058. } else
  57059. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  57060. k(Ge.TEXTURE_2D, e.texture, o),
  57061. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  57062. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  57063. Ye.bindTexture(Ge.TEXTURE_2D, null);
  57064. e.depthBuffer && K(e);
  57065. }
  57066. function J(e) {
  57067. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D,
  57068. i = Xe.get(e.texture).__webglTexture;
  57069. Ye.bindTexture(t, i), Ge.generateMipmap(t), Ye.bindTexture(t, null);
  57070. }
  57071. function $(e) {
  57072. return e === n.NearestFilter ||
  57073. e === n.NearestMipMapNearestFilter ||
  57074. e === n.NearestMipMapLinearFilter
  57075. ? Ge.NEAREST
  57076. : Ge.LINEAR;
  57077. }
  57078. function ee(e) {
  57079. var t;
  57080. if (e === n.RepeatWrapping) return Ge.REPEAT;
  57081. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE;
  57082. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT;
  57083. if (e === n.NearestFilter) return Ge.NEAREST;
  57084. if (e === n.NearestMipMapNearestFilter) return Ge.NEAREST_MIPMAP_NEAREST;
  57085. if (e === n.NearestMipMapLinearFilter) return Ge.NEAREST_MIPMAP_LINEAR;
  57086. if (e === n.LinearFilter) return Ge.LINEAR;
  57087. if (e === n.LinearMipMapNearestFilter) return Ge.LINEAR_MIPMAP_NEAREST;
  57088. if (e === n.LinearMipMapLinearFilter) return Ge.LINEAR_MIPMAP_LINEAR;
  57089. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE;
  57090. if (e === n.UnsignedShort4444Type) return Ge.UNSIGNED_SHORT_4_4_4_4;
  57091. if (e === n.UnsignedShort5551Type) return Ge.UNSIGNED_SHORT_5_5_5_1;
  57092. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5;
  57093. if (e === n.ByteType) return Ge.BYTE;
  57094. if (e === n.ShortType) return Ge.SHORT;
  57095. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT;
  57096. if (e === n.IntType) return Ge.INT;
  57097. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT;
  57098. if (e === n.FloatType) return Ge.FLOAT;
  57099. if (((t = We.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  57100. return t.HALF_FLOAT_OES;
  57101. if (e === n.AlphaFormat) return Ge.ALPHA;
  57102. if (e === n.RGBFormat) return Ge.RGB;
  57103. if (e === n.RGBAFormat) return Ge.RGBA;
  57104. if (e === n.LuminanceFormat) return Ge.LUMINANCE;
  57105. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA;
  57106. if (e === n.AddEquation) return Ge.FUNC_ADD;
  57107. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT;
  57108. if (e === n.ReverseSubtractEquation) return Ge.FUNC_REVERSE_SUBTRACT;
  57109. if (e === n.ZeroFactor) return Ge.ZERO;
  57110. if (e === n.OneFactor) return Ge.ONE;
  57111. if (e === n.SrcColorFactor) return Ge.SRC_COLOR;
  57112. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR;
  57113. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA;
  57114. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA;
  57115. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA;
  57116. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA;
  57117. if (e === n.DstColorFactor) return Ge.DST_COLOR;
  57118. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR;
  57119. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE;
  57120. if (((t = We.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  57121. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  57122. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  57123. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  57124. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  57125. }
  57126. if (((t = We.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  57127. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  57128. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  57129. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  57130. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
  57131. }
  57132. if (
  57133. ((t = We.get('WEBGL_compressed_texture_etc1')),
  57134. null !== t && e === n.RGB_ETC1_Format)
  57135. )
  57136. return t.COMPRESSED_RGB_ETC1_WEBGL;
  57137. if (((t = We.get('EXT_blend_minmax')), null !== t)) {
  57138. if (e === n.MinEquation) return t.MIN_EXT;
  57139. if (e === n.MaxEquation) return t.MAX_EXT;
  57140. }
  57141. return 0;
  57142. }
  57143. console.log('THREE.WebGLRenderer', n.REVISION), (e = e || {});
  57144. var te = void 0 !== e.canvas ? e.canvas : document.createElement('canvas'),
  57145. ie = void 0 !== e.context ? e.context : null,
  57146. ne = void 0 !== e.alpha && e.alpha,
  57147. re = void 0 === e.depth || e.depth,
  57148. oe = void 0 === e.stencil || e.stencil,
  57149. ae = void 0 !== e.antialias && e.antialias,
  57150. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  57151. le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  57152. ce = [],
  57153. he = [],
  57154. ue = -1,
  57155. de = [],
  57156. pe = -1,
  57157. fe = new Float32Array(8),
  57158. ge = [],
  57159. me = [];
  57160. (this.domElement = te),
  57161. (this.context = null),
  57162. (this.autoClear = !0),
  57163. (this.autoClearColor = !0),
  57164. (this.autoClearDepth = !0),
  57165. (this.autoClearStencil = !0),
  57166. (this.sortObjects = !0),
  57167. (this.gammaFactor = 2),
  57168. (this.gammaInput = !1),
  57169. (this.gammaOutput = !1),
  57170. (this.physicallyCorrectLights = !1),
  57171. (this.toneMapping = n.LinearToneMapping),
  57172. (this.toneMappingExposure = 1),
  57173. (this.toneMappingWhitePoint = 1),
  57174. (this.maxMorphTargets = 8),
  57175. (this.maxMorphNormals = 4),
  57176. (this.autoScaleCubemaps = !0);
  57177. var ve = this,
  57178. Ae = null,
  57179. ye = null,
  57180. Ce = null,
  57181. Ie = -1,
  57182. Ee = '',
  57183. be = null,
  57184. we = new n.Vector4(),
  57185. _e = null,
  57186. Te = new n.Vector4(),
  57187. xe = 0,
  57188. Se = new n.Color(0),
  57189. Me = 0,
  57190. Re = te.width,
  57191. Pe = te.height,
  57192. Oe = 1,
  57193. Le = new n.Vector4(0, 0, Re, Pe),
  57194. De = !1,
  57195. Ne = new n.Vector4(0, 0, Re, Pe),
  57196. Be = new n.Frustum(),
  57197. Fe = new n.Matrix4(),
  57198. Ve = new n.Vector3(),
  57199. Ue = {
  57200. hash: '',
  57201. ambient: [0, 0, 0],
  57202. directional: [],
  57203. directionalShadowMap: [],
  57204. directionalShadowMatrix: [],
  57205. spot: [],
  57206. spotShadowMap: [],
  57207. spotShadowMatrix: [],
  57208. point: [],
  57209. pointShadowMap: [],
  57210. pointShadowMatrix: [],
  57211. hemi: [],
  57212. shadows: [],
  57213. shadowsPointLight: 0,
  57214. },
  57215. ke = {
  57216. geometries: 0,
  57217. textures: 0,
  57218. },
  57219. He = {
  57220. calls: 0,
  57221. vertices: 0,
  57222. faces: 0,
  57223. points: 0,
  57224. };
  57225. this.info = {
  57226. render: He,
  57227. memory: ke,
  57228. programs: null,
  57229. };
  57230. var Ge;
  57231. try {
  57232. var ze = {
  57233. alpha: ne,
  57234. depth: re,
  57235. stencil: oe,
  57236. antialias: ae,
  57237. premultipliedAlpha: se,
  57238. preserveDrawingBuffer: le,
  57239. };
  57240. if (
  57241. ((Ge = ie || te.getContext('webgl', ze) || te.getContext('experimental-webgl', ze)),
  57242. null === Ge)
  57243. )
  57244. throw null !== te.getContext('webgl')
  57245. ? 'Error creating WebGL context with your selected attributes.'
  57246. : 'Error creating WebGL context.';
  57247. void 0 === Ge.getShaderPrecisionFormat &&
  57248. (Ge.getShaderPrecisionFormat = function () {
  57249. return {
  57250. rangeMin: 1,
  57251. rangeMax: 1,
  57252. precision: 1,
  57253. };
  57254. }),
  57255. te.addEventListener('webglcontextlost', a, !1);
  57256. } catch (e) {
  57257. console.error('THREE.WebGLRenderer: ' + e);
  57258. }
  57259. var We = new n.WebGLExtensions(Ge);
  57260. We.get('OES_texture_float'),
  57261. We.get('OES_texture_float_linear'),
  57262. We.get('OES_texture_half_float'),
  57263. We.get('OES_texture_half_float_linear'),
  57264. We.get('OES_standard_derivatives'),
  57265. We.get('ANGLE_instanced_arrays'),
  57266. We.get('OES_element_index_uint') && (n.BufferGeometry.MaxIndex = 4294967296);
  57267. var je = new n.WebGLCapabilities(Ge, We, e),
  57268. Ye = new n.WebGLState(Ge, We, ee),
  57269. Xe = new n.WebGLProperties(),
  57270. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  57271. qe = new n.WebGLPrograms(this, je),
  57272. Ke = new n.WebGLLights();
  57273. this.info.programs = qe.programs;
  57274. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  57275. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He);
  57276. r(),
  57277. (this.context = Ge),
  57278. (this.capabilities = je),
  57279. (this.extensions = We),
  57280. (this.properties = Xe),
  57281. (this.state = Ye);
  57282. var $e = new n.WebGLShadowMap(this, Ue, Ze);
  57283. this.shadowMap = $e;
  57284. var et = new n.SpritePlugin(this, ge),
  57285. tt = new n.LensFlarePlugin(this, me);
  57286. (this.getContext = function () {
  57287. return Ge;
  57288. }),
  57289. (this.getContextAttributes = function () {
  57290. return Ge.getContextAttributes();
  57291. }),
  57292. (this.forceContextLoss = function () {
  57293. We.get('WEBGL_lose_context').loseContext();
  57294. }),
  57295. (this.getMaxAnisotropy = (function () {
  57296. var e;
  57297. return function () {
  57298. if (void 0 !== e) return e;
  57299. var t = We.get('EXT_texture_filter_anisotropic');
  57300. return (e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0);
  57301. };
  57302. })()),
  57303. (this.getPrecision = function () {
  57304. return je.precision;
  57305. }),
  57306. (this.getPixelRatio = function () {
  57307. return Oe;
  57308. }),
  57309. (this.setPixelRatio = function (e) {
  57310. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1));
  57311. }),
  57312. (this.getSize = function () {
  57313. return {
  57314. width: Re,
  57315. height: Pe,
  57316. };
  57317. }),
  57318. (this.setSize = function (e, t, i, devicePixelRatio) {
  57319. if (devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  57320. (Re = e),
  57321. (Pe = t),
  57322. (te.width = e * Oe),
  57323. (te.height = t * Oe),
  57324. i !== !1 && ((te.style.width = e + 'px'), (te.style.height = t + 'px')),
  57325. this.setViewport(0, 0, e, t);
  57326. }),
  57327. (this.setViewport = function (e, t, i, n) {
  57328. Ye.viewport(Ne.set(e, t, i, n));
  57329. }),
  57330. (this.setScissor = function (e, t, i, n) {
  57331. Ye.scissor(Le.set(e, t, i, n));
  57332. }),
  57333. (this.setScissorTest = function (e) {
  57334. Ye.setScissorTest((De = e));
  57335. }),
  57336. (this.getClearColor = function () {
  57337. return Se;
  57338. }),
  57339. (this.setClearColor = function (e, t) {
  57340. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me);
  57341. }),
  57342. (this.getClearAlpha = function () {
  57343. return Me;
  57344. }),
  57345. (this.setClearAlpha = function (e) {
  57346. (Me = e), i(Se.r, Se.g, Se.b, Me);
  57347. }),
  57348. (this.clear = function (e, t, i) {
  57349. var n = 0;
  57350. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  57351. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  57352. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  57353. Ge.clear(n);
  57354. }),
  57355. (this.clearColor = function () {
  57356. this.clear(!0, !1, !1);
  57357. }),
  57358. (this.clearDepth = function () {
  57359. this.clear(!1, !0, !1);
  57360. }),
  57361. (this.clearStencil = function () {
  57362. this.clear(!1, !1, !0);
  57363. }),
  57364. (this.clearTarget = function (e, t, i, n) {
  57365. this.setRenderTarget(e), this.clear(t, i, n);
  57366. }),
  57367. (this.resetGLState = o),
  57368. (this.dispose = function () {
  57369. te.removeEventListener('webglcontextlost', a, !1);
  57370. }),
  57371. (this.renderBufferImmediate = function (e, t, i) {
  57372. Ye.initAttributes();
  57373. var r = Xe.get(e);
  57374. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  57375. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  57376. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  57377. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  57378. var o = t.getAttributes();
  57379. if (
  57380. (e.hasPositions &&
  57381. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  57382. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  57383. Ye.enableAttribute(o.position),
  57384. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  57385. e.hasNormals)
  57386. ) {
  57387. if (
  57388. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  57389. 'MeshPhongMaterial' !== i.type &&
  57390. 'MeshStandardMaterial' !== i.type &&
  57391. i.shading === n.FlatShading)
  57392. )
  57393. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  57394. var l = e.normalArray,
  57395. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  57396. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  57397. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  57398. (l[a + 0] = c),
  57399. (l[a + 1] = h),
  57400. (l[a + 2] = u),
  57401. (l[a + 3] = c),
  57402. (l[a + 4] = h),
  57403. (l[a + 5] = u),
  57404. (l[a + 6] = c),
  57405. (l[a + 7] = h),
  57406. (l[a + 8] = u);
  57407. }
  57408. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  57409. Ye.enableAttribute(o.normal),
  57410. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0);
  57411. }
  57412. e.hasUvs &&
  57413. i.map &&
  57414. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  57415. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  57416. Ye.enableAttribute(o.uv),
  57417. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  57418. e.hasColors &&
  57419. i.vertexColors !== n.NoColors &&
  57420. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  57421. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  57422. Ye.enableAttribute(o.color),
  57423. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  57424. Ye.disableUnusedAttributes(),
  57425. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  57426. (e.count = 0);
  57427. }),
  57428. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  57429. E(o);
  57430. var l = w(e, i, o, a),
  57431. c = !1,
  57432. h = r.id + '_' + l.id + '_' + o.wireframe;
  57433. h !== Ee && ((Ee = h), (c = !0));
  57434. var u = a.morphTargetInfluences;
  57435. if (void 0 !== u) {
  57436. for (var d = [], p = 0, m = u.length; p < m; p++) {
  57437. var v = u[p];
  57438. d.push([v, p]);
  57439. }
  57440. d.sort(g), d.length > 8 && (d.length = 8);
  57441. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  57442. var v = d[p];
  57443. if (((fe[p] = v[0]), 0 !== v[0])) {
  57444. var y = v[1];
  57445. o.morphTargets === !0 &&
  57446. A.position &&
  57447. r.addAttribute('morphTarget' + p, A.position[y]),
  57448. o.morphNormals === !0 &&
  57449. A.normal &&
  57450. r.addAttribute('morphNormal' + p, A.normal[y]);
  57451. } else
  57452. o.morphTargets === !0 && r.removeAttribute('morphTarget' + p),
  57453. o.morphNormals === !0 && r.removeAttribute('morphNormal' + p);
  57454. }
  57455. var C = l.getUniforms();
  57456. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  57457. (c = !0);
  57458. }
  57459. var y = r.index,
  57460. I = r.attributes.position;
  57461. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  57462. var b;
  57463. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe),
  57464. c &&
  57465. (f(o, l, r),
  57466. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  57467. var _ = 0,
  57468. T = 1 / 0;
  57469. null !== y ? (T = y.count) : void 0 !== I && (T = I.count);
  57470. var x = r.drawRange.start,
  57471. S = r.drawRange.count,
  57472. M = null !== s ? s.start : 0,
  57473. R = null !== s ? s.count : 1 / 0,
  57474. P = Math.max(_, x, M),
  57475. O = Math.min(_ + T, x + S, M + R) - 1,
  57476. L = Math.max(0, O - P + 1);
  57477. if (a instanceof n.Mesh)
  57478. if (o.wireframe === !0)
  57479. Ye.setLineWidth(o.wireframeLinewidth * t()), b.setMode(Ge.LINES);
  57480. else
  57481. switch (a.drawMode) {
  57482. case n.TrianglesDrawMode:
  57483. b.setMode(Ge.TRIANGLES);
  57484. break;
  57485. case n.TriangleStripDrawMode:
  57486. b.setMode(Ge.TRIANGLE_STRIP);
  57487. break;
  57488. case n.TriangleFanDrawMode:
  57489. b.setMode(Ge.TRIANGLE_FAN);
  57490. }
  57491. else if (a instanceof n.Line) {
  57492. var D = o.linewidth;
  57493. void 0 === D && (D = 1),
  57494. Ye.setLineWidth(D * t()),
  57495. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP);
  57496. } else a instanceof n.Points && b.setMode(Ge.POINTS);
  57497. r instanceof n.InstancedBufferGeometry
  57498. ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L)
  57499. : b.render(P, L);
  57500. }),
  57501. (this.render = function (e, t, i, r) {
  57502. if (t instanceof n.Camera == !1)
  57503. return void console.error(
  57504. 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.'
  57505. );
  57506. var o = e.fog;
  57507. if (
  57508. ((Ee = ''),
  57509. (Ie = -1),
  57510. (be = null),
  57511. e.autoUpdate === !0 && e.updateMatrixWorld(),
  57512. null === t.parent && t.updateMatrixWorld(),
  57513. t.matrixWorldInverse.getInverse(t.matrixWorld),
  57514. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  57515. Be.setFromMatrix(Fe),
  57516. (ce.length = 0),
  57517. (ue = -1),
  57518. (pe = -1),
  57519. (ge.length = 0),
  57520. (me.length = 0),
  57521. y(e, t),
  57522. (he.length = ue + 1),
  57523. (de.length = pe + 1),
  57524. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  57525. U(ce, t),
  57526. $e.render(e, t),
  57527. (He.calls = 0),
  57528. (He.vertices = 0),
  57529. (He.faces = 0),
  57530. (He.points = 0),
  57531. void 0 === i && (i = null),
  57532. this.setRenderTarget(i),
  57533. (this.autoClear || r) &&
  57534. this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  57535. e.overrideMaterial)
  57536. ) {
  57537. var a = e.overrideMaterial;
  57538. C(he, t, o, a), C(de, t, o, a);
  57539. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o);
  57540. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  57541. var s = i.texture;
  57542. s.generateMipmaps &&
  57543. z(i) &&
  57544. s.minFilter !== n.NearestFilter &&
  57545. s.minFilter !== n.LinearFilter &&
  57546. J(i);
  57547. }
  57548. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0);
  57549. }),
  57550. (this.setFaceCulling = function (e, t) {
  57551. e === n.CullFaceNone
  57552. ? Ye.disable(Ge.CULL_FACE)
  57553. : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  57554. e === n.CullFaceBack
  57555. ? Ge.cullFace(Ge.BACK)
  57556. : e === n.CullFaceFront
  57557. ? Ge.cullFace(Ge.FRONT)
  57558. : Ge.cullFace(Ge.FRONT_AND_BACK),
  57559. Ye.enable(Ge.CULL_FACE));
  57560. }),
  57561. (this.setTexture = function (e, t) {
  57562. var i = Xe.get(e);
  57563. if (e.version > 0 && i.__version !== e.version) {
  57564. var n = e.image;
  57565. return void 0 === n
  57566. ? void console.warn(
  57567. 'THREE.WebGLRenderer: Texture marked for update but image is undefined',
  57568. e
  57569. )
  57570. : n.complete === !1
  57571. ? void console.warn(
  57572. 'THREE.WebGLRenderer: Texture marked for update but image is incomplete',
  57573. e
  57574. )
  57575. : void H(i, e, t);
  57576. }
  57577. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture);
  57578. }),
  57579. (this.getCurrentRenderTarget = function () {
  57580. return ye;
  57581. }),
  57582. (this.setRenderTargetFramebuffer = function (renderTarget, defaultFramebuffer) {
  57583. //add
  57584. const renderTargetProperties = Xe.get(renderTarget);
  57585. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  57586. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  57587. }),
  57588. (this.setFramebuffer = function (value) {
  57589. //add
  57590. if (Ce !== value && ye === null) Ge.bindFramebuffer(36160, value);
  57591. Ce = value;
  57592. }),
  57593. (this.setRenderTarget = function (e) {
  57594. (ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  57595. var t,
  57596. i = e instanceof n.WebGLRenderTargetCube;
  57597. if (e) {
  57598. var r = Xe.get(e);
  57599. (t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer),
  57600. we.copy(e.scissor),
  57601. (_e = e.scissorTest),
  57602. Te.copy(e.viewport);
  57603. } else
  57604. (t = null),
  57605. we.copy(Le).multiplyScalar(Oe),
  57606. (_e = De),
  57607. Te.copy(Ne).multiplyScalar(Oe);
  57608. if (
  57609. (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)),
  57610. Ye.scissor(we),
  57611. Ye.setScissorTest(_e),
  57612. Ye.viewport(Te),
  57613. i)
  57614. ) {
  57615. var o = Xe.get(e.texture);
  57616. Ge.framebufferTexture2D(
  57617. Ge.FRAMEBUFFER,
  57618. Ge.COLOR_ATTACHMENT0,
  57619. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace,
  57620. o.__webglTexture,
  57621. e.activeMipMapLevel
  57622. );
  57623. }
  57624. }),
  57625. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  57626. if (e instanceof n.WebGLRenderTarget == !1)
  57627. return void console.error(
  57628. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.'
  57629. );
  57630. var s = Xe.get(e).__webglFramebuffer;
  57631. if (s) {
  57632. var l = !1;
  57633. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0));
  57634. try {
  57635. var c = e.texture;
  57636. if (
  57637. c.format !== n.RGBAFormat &&
  57638. ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT)
  57639. )
  57640. return void console.error(
  57641. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.'
  57642. );
  57643. if (
  57644. !(
  57645. c.type === n.UnsignedByteType ||
  57646. ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  57647. (c.type === n.FloatType && We.get('WEBGL_color_buffer_float')) ||
  57648. (c.type === n.HalfFloatType && We.get('EXT_color_buffer_half_float'))
  57649. )
  57650. )
  57651. return void console.error(
  57652. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.'
  57653. );
  57654. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE
  57655. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  57656. : console.error(
  57657. 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.'
  57658. );
  57659. } finally {
  57660. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce);
  57661. }
  57662. }
  57663. });
  57664. }),
  57665. (n.WebGLRenderTarget = function (e, t, i) {
  57666. (this.uuid = n.Math.generateUUID()),
  57667. (this.width = e),
  57668. (this.height = t),
  57669. (this.scissor = new n.Vector4(0, 0, e, t)),
  57670. (this.scissorTest = !1),
  57671. (this.viewport = new n.Vector4(0, 0, e, t)),
  57672. (i = i || {}),
  57673. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  57674. (this.texture = new n.Texture(
  57675. void 0,
  57676. void 0,
  57677. i.wrapS,
  57678. i.wrapT,
  57679. i.magFilter,
  57680. i.minFilter,
  57681. i.format,
  57682. i.type,
  57683. i.anisotropy
  57684. )),
  57685. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  57686. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer);
  57687. }),
  57688. (n.WebGLRenderTarget.prototype = {
  57689. constructor: n.WebGLRenderTarget,
  57690. setSize: function (e, t) {
  57691. (this.width === e && this.height === t) ||
  57692. ((this.width = e), (this.height = t), this.dispose()),
  57693. this.viewport.set(0, 0, e, t),
  57694. this.scissor.set(0, 0, e, t);
  57695. },
  57696. clone: function () {
  57697. return new this.constructor().copy(this);
  57698. },
  57699. copy: function (e) {
  57700. return (
  57701. (this.width = e.width),
  57702. (this.height = e.height),
  57703. this.viewport.copy(e.viewport),
  57704. (this.texture = e.texture.clone()),
  57705. (this.depthBuffer = e.depthBuffer),
  57706. (this.stencilBuffer = e.stencilBuffer),
  57707. this
  57708. );
  57709. },
  57710. dispose: function () {
  57711. this.dispatchEvent({
  57712. type: 'dispose',
  57713. });
  57714. },
  57715. }),
  57716. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  57717. (n.WebGLRenderTargetCube = function (e, t, i) {
  57718. n.WebGLRenderTarget.call(this, e, t, i),
  57719. (this.activeCubeFace = 0),
  57720. (this.activeMipMapLevel = 0);
  57721. }),
  57722. (n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype)),
  57723. (n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube),
  57724. (n.WebGLBufferRenderer = function (e, t, i) {
  57725. function r(e) {
  57726. s = e;
  57727. }
  57728. function o(t, n) {
  57729. e.drawArrays(s, t, n),
  57730. i.calls++,
  57731. (i.vertices += n),
  57732. s === e.TRIANGLES && (i.faces += n / 3);
  57733. }
  57734. function a(r) {
  57735. var o = t.get('ANGLE_instanced_arrays');
  57736. if (null === o)
  57737. return void console.error(
  57738. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57739. );
  57740. var a = r.attributes.position,
  57741. l = 0;
  57742. a instanceof n.InterleavedBufferAttribute
  57743. ? ((l = a.data.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  57744. : ((l = a.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  57745. i.calls++,
  57746. (i.vertices += l * r.maxInstancedCount),
  57747. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3);
  57748. }
  57749. var s;
  57750. (this.setMode = r), (this.render = o), (this.renderInstances = a);
  57751. }),
  57752. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  57753. function n(e) {
  57754. s = e;
  57755. }
  57756. function r(i) {
  57757. i.array instanceof Uint32Array && t.get('OES_element_index_uint')
  57758. ? ((l = e.UNSIGNED_INT), (c = 4))
  57759. : ((l = e.UNSIGNED_SHORT), (c = 2));
  57760. }
  57761. function o(t, n) {
  57762. e.drawElements(s, n, l, t * c),
  57763. i.calls++,
  57764. (i.vertices += n),
  57765. s === e.TRIANGLES && (i.faces += n / 3);
  57766. }
  57767. function a(n, r, o) {
  57768. var a = t.get('ANGLE_instanced_arrays');
  57769. return null === a
  57770. ? void console.error(
  57771. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57772. )
  57773. : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  57774. i.calls++,
  57775. (i.vertices += o * n.maxInstancedCount),
  57776. void (s === e.TRIANGLES && (i.faces += (n.maxInstancedCount * o) / 3)));
  57777. }
  57778. var s, l, c;
  57779. (this.setMode = n), (this.setIndex = r), (this.render = o), (this.renderInstances = a);
  57780. }),
  57781. (n.WebGLExtensions = function (e) {
  57782. var t = {};
  57783. this.get = function (i) {
  57784. if (void 0 !== t[i]) return t[i];
  57785. var n;
  57786. switch (i) {
  57787. case 'EXT_texture_filter_anisotropic':
  57788. n =
  57789. e.getExtension('EXT_texture_filter_anisotropic') ||
  57790. e.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
  57791. e.getExtension('WEBKIT_EXT_texture_filter_anisotropic');
  57792. break;
  57793. case 'WEBGL_compressed_texture_s3tc':
  57794. n =
  57795. e.getExtension('WEBGL_compressed_texture_s3tc') ||
  57796. e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') ||
  57797. e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');
  57798. break;
  57799. case 'WEBGL_compressed_texture_pvrtc':
  57800. n =
  57801. e.getExtension('WEBGL_compressed_texture_pvrtc') ||
  57802. e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');
  57803. break;
  57804. case 'WEBGL_compressed_texture_etc1':
  57805. n = e.getExtension('WEBGL_compressed_texture_etc1');
  57806. break;
  57807. default:
  57808. n = e.getExtension(i);
  57809. }
  57810. return (
  57811. null === n &&
  57812. console.warn('THREE.WebGLRenderer: ' + i + ' extension not supported.'),
  57813. (t[i] = n),
  57814. n
  57815. );
  57816. };
  57817. }),
  57818. (n.WebGLCapabilities = function (e, t, i) {
  57819. function n(t) {
  57820. if ('highp' === t) {
  57821. if (
  57822. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 &&
  57823. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0
  57824. )
  57825. return 'highp';
  57826. t = 'mediump';
  57827. }
  57828. return 'mediump' === t &&
  57829. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 &&
  57830. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0
  57831. ? 'mediump'
  57832. : 'lowp';
  57833. }
  57834. (this.getMaxPrecision = n),
  57835. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  57836. (this.logarithmicDepthBuffer =
  57837. void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  57838. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  57839. (this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  57840. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  57841. (this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),
  57842. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  57843. (this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),
  57844. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  57845. (this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),
  57846. (this.vertexTextures = this.maxVertexTextures > 0),
  57847. (this.floatFragmentTextures = !!t.get('OES_texture_float')),
  57848. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures);
  57849. var r = n(this.precision);
  57850. r !== this.precision &&
  57851. (console.warn(
  57852. 'THREE.WebGLRenderer:',
  57853. this.precision,
  57854. 'not supported, using',
  57855. r,
  57856. 'instead.'
  57857. ),
  57858. (this.precision = r)),
  57859. this.logarithmicDepthBuffer &&
  57860. (this.logarithmicDepthBuffer = !!t.get('EXT_frag_depth'));
  57861. }),
  57862. (n.WebGLGeometries = function (e, t, i) {
  57863. function r(e) {
  57864. var t = e.geometry;
  57865. if (void 0 !== h[t.id]) return h[t.id];
  57866. t.addEventListener('dispose', o);
  57867. var r;
  57868. return (
  57869. t instanceof n.BufferGeometry
  57870. ? (r = t)
  57871. : t instanceof n.Geometry &&
  57872. (void 0 === t._bufferGeometry &&
  57873. (t._bufferGeometry = new n.BufferGeometry().setFromObject(e)),
  57874. (r = t._bufferGeometry)),
  57875. (h[t.id] = r),
  57876. i.memory.geometries++,
  57877. r
  57878. );
  57879. }
  57880. function o(e) {
  57881. var n = e.target,
  57882. r = h[n.id];
  57883. null !== r.index && s(r.index),
  57884. l(r.attributes),
  57885. n.removeEventListener('dispose', o),
  57886. delete h[n.id];
  57887. var a = t.get(n);
  57888. a.wireframe && s(a.wireframe), t.delete(n);
  57889. var c = t.get(r);
  57890. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--;
  57891. }
  57892. function a(e) {
  57893. return e instanceof n.InterleavedBufferAttribute
  57894. ? t.get(e.data).__webglBuffer
  57895. : t.get(e).__webglBuffer;
  57896. }
  57897. function s(t) {
  57898. var i = a(t);
  57899. void 0 !== i && (e.deleteBuffer(i), c(t));
  57900. }
  57901. function l(e) {
  57902. for (var t in e) s(e[t]);
  57903. }
  57904. function c(e) {
  57905. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e);
  57906. }
  57907. var h = {};
  57908. this.get = r;
  57909. }),
  57910. (n.WebGLLights = function () {
  57911. var e = {};
  57912. this.get = function (t) {
  57913. if (void 0 !== e[t.id]) return e[t.id];
  57914. var i;
  57915. switch (t.type) {
  57916. case 'DirectionalLight':
  57917. i = {
  57918. direction: new n.Vector3(),
  57919. color: new n.Color(),
  57920. shadow: !1,
  57921. shadowBias: 0,
  57922. shadowRadius: 1,
  57923. shadowMapSize: new n.Vector2(),
  57924. };
  57925. break;
  57926. case 'SpotLight':
  57927. i = {
  57928. position: new n.Vector3(),
  57929. direction: new n.Vector3(),
  57930. color: new n.Color(),
  57931. distance: 0,
  57932. coneCos: 0,
  57933. penumbraCos: 0,
  57934. decay: 0,
  57935. shadow: !1,
  57936. shadowBias: 0,
  57937. shadowRadius: 1,
  57938. shadowMapSize: new n.Vector2(),
  57939. };
  57940. break;
  57941. case 'PointLight':
  57942. i = {
  57943. position: new n.Vector3(),
  57944. color: new n.Color(),
  57945. distance: 0,
  57946. decay: 0,
  57947. shadow: !1,
  57948. shadowBias: 0,
  57949. shadowRadius: 1,
  57950. shadowMapSize: new n.Vector2(),
  57951. };
  57952. break;
  57953. case 'HemisphereLight':
  57954. i = {
  57955. direction: new n.Vector3(),
  57956. skyColor: new n.Color(),
  57957. groundColor: new n.Color(),
  57958. };
  57959. }
  57960. return (e[t.id] = i), i;
  57961. };
  57962. }),
  57963. (n.WebGLObjects = function (e, t, i) {
  57964. function r(t) {
  57965. var i = u.get(t);
  57966. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  57967. var r = i.index,
  57968. a = i.attributes;
  57969. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  57970. for (var s in a) o(a[s], e.ARRAY_BUFFER);
  57971. var l = i.morphAttributes;
  57972. for (var s in l)
  57973. for (var c = l[s], h = 0, d = c.length; h < d; h++) o(c[h], e.ARRAY_BUFFER);
  57974. return i;
  57975. }
  57976. function o(e, i) {
  57977. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  57978. o = t.get(r);
  57979. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i);
  57980. }
  57981. function a(t, i, n) {
  57982. (t.__webglBuffer = e.createBuffer()), e.bindBuffer(n, t.__webglBuffer);
  57983. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  57984. e.bufferData(n, i.array, r), (t.version = i.version);
  57985. }
  57986. function s(t, i, n) {
  57987. e.bindBuffer(n, t.__webglBuffer),
  57988. i.dynamic === !1 || i.updateRange.count === -1
  57989. ? e.bufferSubData(n, 0, i.array)
  57990. : 0 === i.updateRange.count
  57991. ? console.error(
  57992. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  57993. )
  57994. : (e.bufferSubData(
  57995. n,
  57996. i.updateRange.offset * i.array.BYTES_PER_ELEMENT,
  57997. i.array.subarray(
  57998. i.updateRange.offset,
  57999. i.updateRange.offset + i.updateRange.count
  58000. )
  58001. ),
  58002. (i.updateRange.count = 0)),
  58003. (t.version = i.version);
  58004. }
  58005. function l(e) {
  58006. return e instanceof n.InterleavedBufferAttribute
  58007. ? t.get(e.data).__webglBuffer
  58008. : t.get(e).__webglBuffer;
  58009. }
  58010. function c(i) {
  58011. var r = t.get(i);
  58012. if (void 0 !== r.wireframe) return r.wireframe;
  58013. var a = [],
  58014. s = i.index,
  58015. l = i.attributes,
  58016. c = l.position;
  58017. if (null !== s)
  58018. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  58019. var g = d[p + 0],
  58020. m = d[p + 1],
  58021. v = d[p + 2];
  58022. h(u, g, m) && a.push(g, m),
  58023. h(u, m, v) && a.push(m, v),
  58024. h(u, v, g) && a.push(v, g);
  58025. }
  58026. else
  58027. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  58028. var g = p + 0,
  58029. m = p + 1,
  58030. v = p + 2;
  58031. a.push(g, m, m, v, v, g);
  58032. }
  58033. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  58034. y = new n.BufferAttribute(new A(a), 1);
  58035. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y;
  58036. }
  58037. function h(e, t, i) {
  58038. if (t > i) {
  58039. var n = t;
  58040. (t = i), (i = n);
  58041. }
  58042. var r = e[t];
  58043. return void 0 === r ? ((e[t] = [i]), !0) : r.indexOf(i) === -1 && (r.push(i), !0);
  58044. }
  58045. var u = new n.WebGLGeometries(e, t, i);
  58046. (this.getAttributeBuffer = l), (this.getWireframeAttribute = c), (this.update = r);
  58047. }),
  58048. (n.WebGLProgram = (function () {
  58049. function e(e) {
  58050. switch (e) {
  58051. case n.LinearEncoding:
  58052. return ['Linear', '( value )'];
  58053. case n.sRGBEncoding:
  58054. return ['sRGB', '( value )'];
  58055. case n.RGBEEncoding:
  58056. return ['RGBE', '( value )'];
  58057. case n.RGBM7Encoding:
  58058. return ['RGBM', '( value, 7.0 )'];
  58059. case n.RGBM16Encoding:
  58060. return ['RGBM', '( value, 16.0 )'];
  58061. case n.RGBDEncoding:
  58062. return ['RGBD', '( value, 256.0 )'];
  58063. case n.GammaEncoding:
  58064. return ['Gamma', '( value, float( GAMMA_FACTOR ) )'];
  58065. default:
  58066. throw new Error('unsupported encoding: ' + e);
  58067. }
  58068. }
  58069. function t(t, i) {
  58070. var n = e(i);
  58071. return 'vec4 ' + t + '( vec4 value ) { return ' + n[0] + 'ToLinear' + n[1] + '; }';
  58072. }
  58073. function i(t, i) {
  58074. var n = e(i);
  58075. return 'vec4 ' + t + '( vec4 value ) { return LinearTo' + n[0] + n[1] + '; }';
  58076. }
  58077. function r(e, t) {
  58078. var i;
  58079. switch (t) {
  58080. case n.LinearToneMapping:
  58081. i = 'Linear';
  58082. break;
  58083. case n.ReinhardToneMapping:
  58084. i = 'Reinhard';
  58085. break;
  58086. case n.Uncharted2ToneMapping:
  58087. i = 'Uncharted2';
  58088. break;
  58089. case n.CineonToneMapping:
  58090. i = 'OptimizedCineon';
  58091. break;
  58092. default:
  58093. throw new Error('unsupported toneMapping: ' + t);
  58094. }
  58095. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }';
  58096. }
  58097. function o(e, t, i) {
  58098. e = e || {};
  58099. var n = [
  58100. e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading
  58101. ? '#extension GL_OES_standard_derivatives : enable'
  58102. : '',
  58103. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth')
  58104. ? '#extension GL_EXT_frag_depth : enable'
  58105. : '',
  58106. e.drawBuffers && i.get('WEBGL_draw_buffers')
  58107. ? '#extension GL_EXT_draw_buffers : require'
  58108. : '',
  58109. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod')
  58110. ? '#extension GL_EXT_shader_texture_lod : enable'
  58111. : '',
  58112. ];
  58113. return n.filter(c).join('\n');
  58114. }
  58115. function a(e) {
  58116. var t = [];
  58117. for (var i in e) {
  58118. var n = e[i];
  58119. n !== !1 && t.push('#define ' + i + ' ' + n);
  58120. }
  58121. return t.join('\n');
  58122. }
  58123. function s(e, t, i) {
  58124. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  58125. var a = e.getActiveUniform(t, o),
  58126. s = a.name,
  58127. l = e.getUniformLocation(t, s),
  58128. c = f.exec(s);
  58129. if (c) {
  58130. var h = c[1],
  58131. u = c[2],
  58132. d = n[h];
  58133. d || (d = n[h] = {}), (d[u] = l);
  58134. } else if ((c = g.exec(s))) {
  58135. var p = c[1],
  58136. v = c[2],
  58137. A = c[3],
  58138. y = n[p];
  58139. y || (y = n[p] = []);
  58140. var C = y[v];
  58141. C || (C = y[v] = {}), (C[A] = l);
  58142. } else if ((c = m.exec(s))) {
  58143. var p = c[1];
  58144. n[p] = l;
  58145. } else n[s] = l;
  58146. }
  58147. return n;
  58148. }
  58149. function l(e, t, i) {
  58150. for (
  58151. var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0;
  58152. o < r;
  58153. o++
  58154. ) {
  58155. var a = e.getActiveAttrib(t, o),
  58156. s = a.name;
  58157. n[s] = e.getAttribLocation(t, s);
  58158. }
  58159. return n;
  58160. }
  58161. function c(e) {
  58162. return '' !== e;
  58163. }
  58164. function h(e, t) {
  58165. return e
  58166. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  58167. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  58168. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  58169. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights);
  58170. }
  58171. function u(e) {
  58172. function t(e, t) {
  58173. var i = n.ShaderChunk[t];
  58174. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>');
  58175. return u(i);
  58176. }
  58177. var i = /#include +<([\w\d.]+)>/g;
  58178. return e.replace(i, t);
  58179. }
  58180. function d(e) {
  58181. function t(e, t, i, n) {
  58182. for (var r = '', o = parseInt(t); o < parseInt(i); o++)
  58183. r += n.replace(/\[ i \]/g, '[ ' + o + ' ]');
  58184. return r;
  58185. }
  58186. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  58187. return e.replace(i, t);
  58188. }
  58189. var p = 0,
  58190. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  58191. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  58192. m = /^([\w\d_]+)\[0\]$/;
  58193. return function (e, f, g, m) {
  58194. var v = e.context,
  58195. A = g.extensions,
  58196. y = g.defines,
  58197. C = g.__webglShader.vertexShader,
  58198. I = g.__webglShader.fragmentShader,
  58199. E = 'SHADOWMAP_TYPE_BASIC';
  58200. m.shadowMapType === n.PCFShadowMap
  58201. ? (E = 'SHADOWMAP_TYPE_PCF')
  58202. : m.shadowMapType === n.PCFSoftShadowMap && (E = 'SHADOWMAP_TYPE_PCF_SOFT');
  58203. var b = 'ENVMAP_TYPE_CUBE',
  58204. w = 'ENVMAP_MODE_REFLECTION',
  58205. _ = 'ENVMAP_BLENDING_MULTIPLY';
  58206. if (m.envMap) {
  58207. switch (g.envMap.mapping) {
  58208. case n.CubeReflectionMapping:
  58209. case n.CubeRefractionMapping:
  58210. b = 'ENVMAP_TYPE_CUBE';
  58211. break;
  58212. case n.CubeUVReflectionMapping:
  58213. case n.CubeUVRefractionMapping:
  58214. b = 'ENVMAP_TYPE_CUBE_UV';
  58215. break;
  58216. case n.EquirectangularReflectionMapping:
  58217. case n.EquirectangularRefractionMapping:
  58218. b = 'ENVMAP_TYPE_EQUIREC';
  58219. break;
  58220. case n.SphericalReflectionMapping:
  58221. b = 'ENVMAP_TYPE_SPHERE';
  58222. }
  58223. switch (g.envMap.mapping) {
  58224. case n.CubeRefractionMapping:
  58225. case n.EquirectangularRefractionMapping:
  58226. w = 'ENVMAP_MODE_REFRACTION';
  58227. }
  58228. switch (g.combine) {
  58229. case n.MultiplyOperation:
  58230. _ = 'ENVMAP_BLENDING_MULTIPLY';
  58231. break;
  58232. case n.MixOperation:
  58233. _ = 'ENVMAP_BLENDING_MIX';
  58234. break;
  58235. case n.AddOperation:
  58236. _ = 'ENVMAP_BLENDING_ADD';
  58237. }
  58238. }
  58239. var T,
  58240. x,
  58241. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  58242. M = o(A, m, e.extensions),
  58243. R = a(y),
  58244. P = v.createProgram();
  58245. g instanceof n.RawShaderMaterial
  58246. ? ((T = ''), (x = ''))
  58247. : ((T = [
  58248. 'precision ' + m.precision + ' float;',
  58249. 'precision ' + m.precision + ' int;',
  58250. '#define SHADER_NAME ' + g.__webglShader.name,
  58251. R,
  58252. m.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  58253. '#define GAMMA_FACTOR ' + S,
  58254. '#define MAX_BONES ' + m.maxBones,
  58255. m.map ? '#define USE_MAP' : '',
  58256. m.envMap ? '#define USE_ENVMAP' : '',
  58257. m.envMap ? '#define ' + w : '',
  58258. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58259. m.aoMap ? '#define USE_AOMAP' : '',
  58260. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58261. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58262. m.normalMap ? '#define USE_NORMALMAP' : '',
  58263. m.displacementMap && m.supportsVertexTextures
  58264. ? '#define USE_DISPLACEMENTMAP'
  58265. : '',
  58266. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58267. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58268. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58269. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58270. m.vertexColors ? '#define USE_COLOR' : '',
  58271. m.flatShading ? '#define FLAT_SHADED' : '',
  58272. m.skinning ? '#define USE_SKINNING' : '',
  58273. m.useVertexTexture ? '#define BONE_TEXTURE' : '',
  58274. m.morphTargets ? '#define USE_MORPHTARGETS' : '',
  58275. m.morphNormals && m.flatShading === !1 ? '#define USE_MORPHNORMALS' : '',
  58276. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58277. m.flipSided ? '#define FLIP_SIDED' : '',
  58278. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58279. m.shadowMapEnabled ? '#define ' + E : '',
  58280. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58281. m.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  58282. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58283. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58284. ? '#define USE_LOGDEPTHBUF_EXT'
  58285. : '',
  58286. 'uniform mat4 modelMatrix;',
  58287. 'uniform mat4 modelViewMatrix;',
  58288. 'uniform mat4 projectionMatrix;',
  58289. 'uniform mat4 viewMatrix;',
  58290. 'uniform mat3 normalMatrix;',
  58291. 'uniform vec3 cameraPosition;',
  58292. 'attribute vec3 position;',
  58293. 'attribute vec3 normal;',
  58294. 'attribute vec2 uv;',
  58295. '#ifdef USE_COLOR',
  58296. '\tattribute vec3 color;',
  58297. '#endif',
  58298. '#ifdef USE_MORPHTARGETS',
  58299. '\tattribute vec3 morphTarget0;',
  58300. '\tattribute vec3 morphTarget1;',
  58301. '\tattribute vec3 morphTarget2;',
  58302. '\tattribute vec3 morphTarget3;',
  58303. '\t#ifdef USE_MORPHNORMALS',
  58304. '\t\tattribute vec3 morphNormal0;',
  58305. '\t\tattribute vec3 morphNormal1;',
  58306. '\t\tattribute vec3 morphNormal2;',
  58307. '\t\tattribute vec3 morphNormal3;',
  58308. '\t#else',
  58309. '\t\tattribute vec3 morphTarget4;',
  58310. '\t\tattribute vec3 morphTarget5;',
  58311. '\t\tattribute vec3 morphTarget6;',
  58312. '\t\tattribute vec3 morphTarget7;',
  58313. '\t#endif',
  58314. '#endif',
  58315. '#ifdef USE_SKINNING',
  58316. '\tattribute vec4 skinIndex;',
  58317. '\tattribute vec4 skinWeight;',
  58318. '#endif',
  58319. '\n',
  58320. ]
  58321. .filter(c)
  58322. .join('\n')),
  58323. (x = [
  58324. M,
  58325. 'precision ' + m.precision + ' float;',
  58326. 'precision ' + m.precision + ' int;',
  58327. '#define SHADER_NAME ' + g.__webglShader.name,
  58328. R,
  58329. m.alphaTest ? '#define ALPHATEST ' + m.alphaTest : '',
  58330. '#define GAMMA_FACTOR ' + S,
  58331. m.useFog && m.fog ? '#define USE_FOG' : '',
  58332. m.useFog && m.fogExp ? '#define FOG_EXP2' : '',
  58333. m.map ? '#define USE_MAP' : '',
  58334. m.envMap ? '#define USE_ENVMAP' : '',
  58335. m.envMap ? '#define ' + b : '',
  58336. m.envMap ? '#define ' + w : '',
  58337. m.envMap ? '#define ' + _ : '',
  58338. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58339. m.aoMap ? '#define USE_AOMAP' : '',
  58340. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58341. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58342. m.normalMap ? '#define USE_NORMALMAP' : '',
  58343. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58344. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58345. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58346. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58347. m.vertexColors ? '#define USE_COLOR' : '',
  58348. m.flatShading ? '#define FLAT_SHADED' : '',
  58349. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58350. m.flipSided ? '#define FLIP_SIDED' : '',
  58351. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58352. m.shadowMapEnabled ? '#define ' + E : '',
  58353. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58354. m.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  58355. m.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  58356. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58357. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58358. ? '#define USE_LOGDEPTHBUF_EXT'
  58359. : '',
  58360. m.envMap && e.extensions.get('EXT_shader_texture_lod')
  58361. ? '#define TEXTURE_LOD_EXT'
  58362. : '',
  58363. 'uniform mat4 viewMatrix;',
  58364. 'uniform vec3 cameraPosition;',
  58365. m.toneMapping !== n.NoToneMapping ? '#define TONE_MAPPING' : '',
  58366. m.toneMapping !== n.NoToneMapping
  58367. ? n.ShaderChunk.tonemapping_pars_fragment
  58368. : '',
  58369. m.toneMapping !== n.NoToneMapping ? r('toneMapping', m.toneMapping) : '',
  58370. m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding
  58371. ? n.ShaderChunk.encodings_pars_fragment
  58372. : '',
  58373. m.mapEncoding ? t('mapTexelToLinear', m.mapEncoding) : '',
  58374. m.envMapEncoding ? t('envMapTexelToLinear', m.envMapEncoding) : '',
  58375. m.emissiveMapEncoding
  58376. ? t('emissiveMapTexelToLinear', m.emissiveMapEncoding)
  58377. : '',
  58378. m.outputEncoding ? i('linearToOutputTexel', m.outputEncoding) : '',
  58379. '\n',
  58380. ]
  58381. .filter(c)
  58382. .join('\n'))),
  58383. (C = u(C, m)),
  58384. (C = h(C, m)),
  58385. (I = u(I, m)),
  58386. (I = h(I, m)),
  58387. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)));
  58388. var O = T + C,
  58389. L = x + I,
  58390. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  58391. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  58392. v.attachShader(P, D),
  58393. v.attachShader(P, N),
  58394. void 0 !== g.index0AttributeName
  58395. ? v.bindAttribLocation(P, 0, g.index0AttributeName)
  58396. : m.morphTargets === !0 && v.bindAttribLocation(P, 0, 'position'),
  58397. v.linkProgram(P);
  58398. var B = v.getProgramInfoLog(P),
  58399. F = v.getShaderInfoLog(D),
  58400. V = v.getShaderInfoLog(N),
  58401. U = !0,
  58402. k = !0;
  58403. v.getProgramParameter(P, v.LINK_STATUS) === !1
  58404. ? ((U = !1),
  58405. console.error(
  58406. 'THREE.WebGLProgram: shader error: ',
  58407. v.getError(),
  58408. 'gl.VALIDATE_STATUS',
  58409. v.getProgramParameter(P, v.VALIDATE_STATUS),
  58410. 'gl.getProgramInfoLog',
  58411. B,
  58412. F,
  58413. V
  58414. ))
  58415. : '' !== B
  58416. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', B)
  58417. : ('' !== F && '' !== V) || (k = !1),
  58418. k &&
  58419. (this.diagnostics = {
  58420. runnable: U,
  58421. material: g,
  58422. programLog: B,
  58423. vertexShader: {
  58424. log: F,
  58425. prefix: T,
  58426. },
  58427. fragmentShader: {
  58428. log: V,
  58429. prefix: x,
  58430. },
  58431. }),
  58432. v.deleteShader(D),
  58433. v.deleteShader(N);
  58434. var H;
  58435. this.getUniforms = function () {
  58436. return void 0 === H && (H = s(v, P)), H;
  58437. };
  58438. var G;
  58439. return (
  58440. (this.getAttributes = function () {
  58441. return void 0 === G && (G = l(v, P)), G;
  58442. }),
  58443. (this.destroy = function () {
  58444. v.deleteProgram(P), (this.program = void 0);
  58445. }),
  58446. Object.defineProperties(this, {
  58447. uniforms: {
  58448. get: function () {
  58449. return (
  58450. console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'),
  58451. this.getUniforms()
  58452. );
  58453. },
  58454. },
  58455. attributes: {
  58456. get: function () {
  58457. return (
  58458. console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'),
  58459. this.getAttributes()
  58460. );
  58461. },
  58462. },
  58463. }),
  58464. (this.id = p++),
  58465. (this.code = f),
  58466. (this.usedTimes = 1),
  58467. (this.program = P),
  58468. (this.vertexShader = D),
  58469. (this.fragmentShader = N),
  58470. this
  58471. );
  58472. };
  58473. })()),
  58474. (n.WebGLPrograms = function (e, t) {
  58475. function i(e) {
  58476. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  58477. return 1024;
  58478. var i = t.maxVertexUniforms,
  58479. r = Math.floor((i - 20) / 4),
  58480. o = r;
  58481. return (
  58482. void 0 !== e &&
  58483. e instanceof n.SkinnedMesh &&
  58484. ((o = Math.min(e.skeleton.bones.length, o)),
  58485. o < e.skeleton.bones.length &&
  58486. console.warn(
  58487. 'WebGLRenderer: too many bones - ' +
  58488. e.skeleton.bones.length +
  58489. ', this GPU supports just ' +
  58490. o +
  58491. ' (try OpenGL instead of ANGLE)'
  58492. )),
  58493. o
  58494. );
  58495. }
  58496. function r(e, t) {
  58497. var i;
  58498. return (
  58499. e
  58500. ? e instanceof n.Texture
  58501. ? (i = e.encoding)
  58502. : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding)
  58503. : (i = n.LinearEncoding),
  58504. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  58505. i
  58506. );
  58507. }
  58508. var o = [],
  58509. a = {
  58510. MeshDepthMaterial: 'depth',
  58511. MeshNormalMaterial: 'normal',
  58512. MeshBasicMaterial: 'basic',
  58513. MeshLambertMaterial: 'lambert',
  58514. MeshPhongMaterial: 'phong',
  58515. MeshStandardMaterial: 'standard',
  58516. LineBasicMaterial: 'basic',
  58517. LineDashedMaterial: 'dashed',
  58518. PointsMaterial: 'points',
  58519. },
  58520. s = [
  58521. 'precision',
  58522. 'supportsVertexTextures',
  58523. 'map',
  58524. 'mapEncoding',
  58525. 'envMap',
  58526. 'envMapMode',
  58527. 'envMapEncoding',
  58528. 'lightMap',
  58529. 'aoMap',
  58530. 'emissiveMap',
  58531. 'emissiveMapEncoding',
  58532. 'bumpMap',
  58533. 'normalMap',
  58534. 'displacementMap',
  58535. 'specularMap',
  58536. 'roughnessMap',
  58537. 'metalnessMap',
  58538. 'alphaMap',
  58539. 'combine',
  58540. 'vertexColors',
  58541. 'fog',
  58542. 'useFog',
  58543. 'fogExp',
  58544. 'flatShading',
  58545. 'sizeAttenuation',
  58546. 'logarithmicDepthBuffer',
  58547. 'skinning',
  58548. 'maxBones',
  58549. 'useVertexTexture',
  58550. 'morphTargets',
  58551. 'morphNormals',
  58552. 'maxMorphTargets',
  58553. 'maxMorphNormals',
  58554. 'premultipliedAlpha',
  58555. 'numDirLights',
  58556. 'numPointLights',
  58557. 'numSpotLights',
  58558. 'numHemiLights',
  58559. 'shadowMapEnabled',
  58560. 'pointLightShadows',
  58561. 'toneMapping',
  58562. 'physicallyCorrectLights',
  58563. 'shadowMapType',
  58564. 'alphaTest',
  58565. 'doubleSided',
  58566. 'flipSided',
  58567. ];
  58568. (this.getParameters = function (o, s, l, c) {
  58569. var h = a[o.type],
  58570. u = i(c),
  58571. d = e.getPrecision();
  58572. null !== o.precision &&
  58573. ((d = t.getMaxPrecision(o.precision)),
  58574. d !== o.precision &&
  58575. console.warn(
  58576. 'THREE.WebGLProgram.getParameters:',
  58577. o.precision,
  58578. 'not supported, using',
  58579. d,
  58580. 'instead.'
  58581. ));
  58582. var p = {
  58583. shaderID: h,
  58584. precision: d,
  58585. supportsVertexTextures: t.vertexTextures,
  58586. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  58587. map: !!o.map,
  58588. mapEncoding: r(o.map, e.gammaInput),
  58589. envMap: !!o.envMap,
  58590. envMapMode: o.envMap && o.envMap.mapping,
  58591. envMapEncoding: r(o.envMap, e.gammaInput),
  58592. envMapCubeUV:
  58593. !!o.envMap &&
  58594. (o.envMap.mapping === n.CubeUVReflectionMapping ||
  58595. o.envMap.mapping === n.CubeUVRefractionMapping),
  58596. lightMap: !!o.lightMap,
  58597. aoMap: !!o.aoMap,
  58598. emissiveMap: !!o.emissiveMap,
  58599. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  58600. bumpMap: !!o.bumpMap,
  58601. normalMap: !!o.normalMap,
  58602. displacementMap: !!o.displacementMap,
  58603. roughnessMap: !!o.roughnessMap,
  58604. metalnessMap: !!o.metalnessMap,
  58605. specularMap: !!o.specularMap,
  58606. alphaMap: !!o.alphaMap,
  58607. combine: o.combine,
  58608. vertexColors: o.vertexColors,
  58609. fog: l,
  58610. useFog: o.fog,
  58611. fogExp: l instanceof n.FogExp2,
  58612. flatShading: o.shading === n.FlatShading,
  58613. sizeAttenuation: o.sizeAttenuation,
  58614. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  58615. skinning: o.skinning,
  58616. maxBones: u,
  58617. useVertexTexture:
  58618. t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  58619. morphTargets: o.morphTargets,
  58620. morphNormals: o.morphNormals,
  58621. maxMorphTargets: e.maxMorphTargets,
  58622. maxMorphNormals: e.maxMorphNormals,
  58623. numDirLights: s.directional.length,
  58624. numPointLights: s.point.length,
  58625. numSpotLights: s.spot.length,
  58626. numHemiLights: s.hemi.length,
  58627. pointLightShadows: s.shadowsPointLight,
  58628. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  58629. shadowMapType: e.shadowMap.type,
  58630. toneMapping: e.toneMapping,
  58631. physicallyCorrectLights: e.physicallyCorrectLights,
  58632. premultipliedAlpha: o.premultipliedAlpha,
  58633. alphaTest: o.alphaTest,
  58634. doubleSided: o.side === n.DoubleSide,
  58635. flipSided: o.side === n.BackSide,
  58636. };
  58637. return p;
  58638. }),
  58639. (this.getProgramCode = function (e, t) {
  58640. var i = [];
  58641. if (
  58642. (t.shaderID
  58643. ? i.push(t.shaderID)
  58644. : (i.push(e.fragmentShader), i.push(e.vertexShader)),
  58645. void 0 !== e.defines)
  58646. )
  58647. for (var n in e.defines) i.push(n), i.push(e.defines[n]);
  58648. for (var r = 0; r < s.length; r++) {
  58649. var o = s[r];
  58650. i.push(o), i.push(t[o]);
  58651. }
  58652. return i.join();
  58653. }),
  58654. (this.acquireProgram = function (t, i, r) {
  58655. for (var a, s = 0, l = o.length; s < l; s++) {
  58656. var c = o[s];
  58657. if (c.code === r) {
  58658. (a = c), ++a.usedTimes;
  58659. break;
  58660. }
  58661. }
  58662. return void 0 === a && ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)), a;
  58663. }),
  58664. (this.releaseProgram = function (e) {
  58665. if (0 === --e.usedTimes) {
  58666. var t = o.indexOf(e);
  58667. (o[t] = o[o.length - 1]), o.pop(), e.destroy();
  58668. }
  58669. }),
  58670. (this.programs = o);
  58671. }),
  58672. (n.WebGLProperties = function () {
  58673. var e = {};
  58674. (this.get = function (t) {
  58675. var i = t.uuid,
  58676. n = e[i];
  58677. return void 0 === n && ((n = {}), (e[i] = n)), n;
  58678. }),
  58679. (this.delete = function (t) {
  58680. delete e[t.uuid];
  58681. }),
  58682. (this.clear = function () {
  58683. e = {};
  58684. });
  58685. }),
  58686. (n.WebGLShader = (function () {
  58687. function e(e) {
  58688. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i];
  58689. return t.join('\n');
  58690. }
  58691. return function (t, i, n) {
  58692. var r = t.createShader(i);
  58693. return (
  58694. t.shaderSource(r, n),
  58695. t.compileShader(r),
  58696. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 &&
  58697. console.error("THREE.WebGLShader: Shader couldn't compile."),
  58698. '' !== t.getShaderInfoLog(r) &&
  58699. console.warn(
  58700. 'THREE.WebGLShader: gl.getShaderInfoLog()',
  58701. i === t.VERTEX_SHADER ? 'vertex' : 'fragment',
  58702. t.getShaderInfoLog(r),
  58703. e(n)
  58704. ),
  58705. r
  58706. );
  58707. };
  58708. })()),
  58709. (n.WebGLShadowMap = function (e, t, i) {
  58710. function r(e, t, i, r) {
  58711. var o = e.geometry,
  58712. a = null,
  58713. s = v,
  58714. l = e.customDepthMaterial;
  58715. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l;
  58716. else {
  58717. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets,
  58718. h = e instanceof n.SkinnedMesh && t.skinning,
  58719. u = 0;
  58720. c && (u |= f), h && (u |= g), (a = s[u]);
  58721. }
  58722. return (
  58723. (a.visible = t.visible),
  58724. (a.wireframe = t.wireframe),
  58725. (a.wireframeLinewidth = t.wireframeLinewidth),
  58726. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  58727. a
  58728. );
  58729. }
  58730. function o(e, t, i) {
  58731. if (e.visible !== !1) {
  58732. if (
  58733. e.layers.test(t.layers) &&
  58734. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  58735. e.castShadow &&
  58736. (e.frustumCulled === !1 || l.intersectsObject(e) === !0)
  58737. ) {
  58738. var r = e.material;
  58739. r.visible === !0 &&
  58740. (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  58741. p.push(e));
  58742. }
  58743. for (var a = e.children, s = 0, c = a.length; s < c; s++) o(a[s], t, i);
  58744. }
  58745. }
  58746. for (
  58747. var a = e.context,
  58748. s = e.state,
  58749. l = new n.Frustum(),
  58750. c = new n.Matrix4(),
  58751. h = new n.Vector2(),
  58752. u = new n.Vector3(),
  58753. d = new n.Vector3(),
  58754. p = [],
  58755. f = 1,
  58756. g = 2,
  58757. m = (f | g) + 1,
  58758. v = new Array(m),
  58759. A = new Array(m),
  58760. y = [
  58761. new n.Vector3(1, 0, 0),
  58762. new n.Vector3(-1, 0, 0),
  58763. new n.Vector3(0, 0, 1),
  58764. new n.Vector3(0, 0, -1),
  58765. new n.Vector3(0, 1, 0),
  58766. new n.Vector3(0, -1, 0),
  58767. ],
  58768. C = [
  58769. new n.Vector3(0, 1, 0),
  58770. new n.Vector3(0, 1, 0),
  58771. new n.Vector3(0, 1, 0),
  58772. new n.Vector3(0, 1, 0),
  58773. new n.Vector3(0, 0, 1),
  58774. new n.Vector3(0, 0, -1),
  58775. ],
  58776. I = [
  58777. new n.Vector4(),
  58778. new n.Vector4(),
  58779. new n.Vector4(),
  58780. new n.Vector4(),
  58781. new n.Vector4(),
  58782. new n.Vector4(),
  58783. ],
  58784. E = n.ShaderLib.depthRGBA,
  58785. b = n.UniformsUtils.clone(E.uniforms),
  58786. w = n.ShaderLib.distanceRGBA,
  58787. _ = n.UniformsUtils.clone(w.uniforms),
  58788. T = 0;
  58789. T !== m;
  58790. ++T
  58791. ) {
  58792. var x = 0 !== (T & f),
  58793. S = 0 !== (T & g),
  58794. M = new n.ShaderMaterial({
  58795. uniforms: b,
  58796. vertexShader: E.vertexShader,
  58797. fragmentShader: E.fragmentShader,
  58798. morphTargets: x,
  58799. skinning: S,
  58800. });
  58801. v[T] = M;
  58802. var R = new n.ShaderMaterial({
  58803. defines: {
  58804. USE_SHADOWMAP: '',
  58805. },
  58806. uniforms: _,
  58807. vertexShader: w.vertexShader,
  58808. fragmentShader: w.fragmentShader,
  58809. morphTargets: x,
  58810. skinning: S,
  58811. });
  58812. A[T] = R;
  58813. }
  58814. var P = this;
  58815. (this.enabled = !1),
  58816. (this.autoUpdate = !0),
  58817. (this.needsUpdate = !1),
  58818. (this.type = n.PCFShadowMap),
  58819. (this.cullFace = n.CullFaceFront),
  58820. (this.render = function (f, g) {
  58821. var m,
  58822. v,
  58823. A = t.shadows;
  58824. if (
  58825. 0 !== A.length &&
  58826. P.enabled !== !1 &&
  58827. (P.autoUpdate !== !1 || P.needsUpdate !== !1)
  58828. ) {
  58829. s.clearColor(1, 1, 1, 1),
  58830. s.disable(a.BLEND),
  58831. s.enable(a.CULL_FACE),
  58832. a.frontFace(a.CCW),
  58833. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  58834. s.setDepthTest(!0),
  58835. s.setScissorTest(!1);
  58836. for (var E = 0, b = A.length; E < b; E++) {
  58837. var w = A[E],
  58838. _ = w.shadow,
  58839. T = _.camera;
  58840. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  58841. (m = 6), (v = !0);
  58842. var x = h.x,
  58843. S = h.y;
  58844. I[0].set(2 * x, S, x, S),
  58845. I[1].set(0, S, x, S),
  58846. I[2].set(3 * x, S, x, S),
  58847. I[3].set(x, S, x, S),
  58848. I[4].set(3 * x, 0, x, S),
  58849. I[5].set(x, 0, x, S),
  58850. (h.x *= 4),
  58851. (h.y *= 2);
  58852. } else (m = 1), (v = !1);
  58853. if (null === _.map) {
  58854. var M = {
  58855. minFilter: n.NearestFilter,
  58856. magFilter: n.NearestFilter,
  58857. format: n.RGBAFormat,
  58858. };
  58859. (_.map = new n.WebGLRenderTarget(h.x, h.y, M)),
  58860. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  58861. T.updateProjectionMatrix();
  58862. }
  58863. var R = _.map,
  58864. O = _.matrix;
  58865. d.setFromMatrixPosition(w.matrixWorld),
  58866. T.position.copy(d),
  58867. e.setRenderTarget(R),
  58868. e.clear();
  58869. for (var L = 0; L < m; L++) {
  58870. if (v) {
  58871. u.copy(T.position), u.add(y[L]), T.up.copy(C[L]), T.lookAt(u);
  58872. var D = I[L];
  58873. s.viewport(D);
  58874. } else u.setFromMatrixPosition(w.target.matrixWorld), T.lookAt(u);
  58875. T.updateMatrixWorld(),
  58876. T.matrixWorldInverse.getInverse(T.matrixWorld),
  58877. O.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  58878. O.multiply(T.projectionMatrix),
  58879. O.multiply(T.matrixWorldInverse),
  58880. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  58881. l.setFromMatrix(c),
  58882. (p.length = 0),
  58883. o(f, g, T);
  58884. for (var N = 0, B = p.length; N < B; N++) {
  58885. var F = p[N],
  58886. V = i.update(F),
  58887. U = F.material;
  58888. if (U instanceof n.MultiMaterial)
  58889. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  58890. var W = k[G],
  58891. j = H[W.materialIndex];
  58892. if (j.visible === !0) {
  58893. var Y = r(F, j, v, d);
  58894. e.renderBufferDirect(T, null, V, Y, F, W);
  58895. }
  58896. }
  58897. else {
  58898. var Y = r(F, U, v, d);
  58899. e.renderBufferDirect(T, null, V, Y, F, null);
  58900. }
  58901. }
  58902. }
  58903. }
  58904. var X = e.getClearColor(),
  58905. Z = e.getClearAlpha();
  58906. e.setClearColor(X, Z),
  58907. s.enable(a.BLEND),
  58908. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  58909. (P.needsUpdate = !1);
  58910. }
  58911. });
  58912. }),
  58913. (n.WebGLState = function (e, t, i) {
  58914. var r = this,
  58915. o = new n.Vector4(),
  58916. a = new Uint8Array(16),
  58917. s = new Uint8Array(16),
  58918. l = new Uint8Array(16),
  58919. c = {},
  58920. h = null,
  58921. u = null,
  58922. d = null,
  58923. p = null,
  58924. f = null,
  58925. g = null,
  58926. m = null,
  58927. v = null,
  58928. A = !1,
  58929. y = null,
  58930. C = null,
  58931. I = null,
  58932. E = null,
  58933. b = null,
  58934. w = null,
  58935. _ = null,
  58936. T = null,
  58937. x = null,
  58938. S = null,
  58939. M = null,
  58940. R = null,
  58941. P = null,
  58942. O = null,
  58943. L = null,
  58944. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  58945. N = void 0,
  58946. B = {},
  58947. F = new n.Vector4(),
  58948. V = null,
  58949. U = null,
  58950. k = new n.Vector4(),
  58951. H = new n.Vector4(),
  58952. G = e.createTexture();
  58953. e.bindTexture(e.TEXTURE_2D, G),
  58954. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  58955. e.texImage2D(
  58956. e.TEXTURE_2D,
  58957. 0,
  58958. e.RGB,
  58959. 1,
  58960. 1,
  58961. 0,
  58962. e.RGB,
  58963. e.UNSIGNED_BYTE,
  58964. new Uint8Array(3)
  58965. ),
  58966. (this.init = function () {
  58967. this.clearColor(0, 0, 0, 1),
  58968. this.clearDepth(1),
  58969. this.clearStencil(0),
  58970. this.enable(e.DEPTH_TEST),
  58971. e.depthFunc(e.LEQUAL),
  58972. e.frontFace(e.CCW),
  58973. e.cullFace(e.BACK),
  58974. this.enable(e.CULL_FACE),
  58975. this.enable(e.BLEND),
  58976. e.blendEquation(e.FUNC_ADD),
  58977. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA);
  58978. }),
  58979. (this.initAttributes = function () {
  58980. for (var e = 0, t = a.length; e < t; e++) a[e] = 0;
  58981. }),
  58982. (this.enableAttribute = function (i) {
  58983. if (
  58984. ((a[i] = 1), 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)), 0 !== l[i])
  58985. ) {
  58986. var n = t.get('ANGLE_instanced_arrays');
  58987. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0);
  58988. }
  58989. }),
  58990. (this.enableAttributeAndDivisor = function (t, i, n) {
  58991. (a[t] = 1),
  58992. 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)),
  58993. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i));
  58994. }),
  58995. (this.disableUnusedAttributes = function () {
  58996. for (var t = 0, i = s.length; t < i; t++)
  58997. s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  58998. }),
  58999. (this.enable = function (t) {
  59000. c[t] !== !0 && (e.enable(t), (c[t] = !0));
  59001. }),
  59002. (this.disable = function (t) {
  59003. c[t] !== !1 && (e.disable(t), (c[t] = !1));
  59004. }),
  59005. (this.getCompressedTextureFormats = function () {
  59006. if (
  59007. null === h &&
  59008. ((h = []),
  59009. t.get('WEBGL_compressed_texture_pvrtc') ||
  59010. t.get('WEBGL_compressed_texture_s3tc') ||
  59011. t.get('WEBGL_compressed_texture_etc1'))
  59012. )
  59013. for (
  59014. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  59015. n < i.length;
  59016. n++
  59017. )
  59018. h.push(i[n]);
  59019. return h;
  59020. }),
  59021. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  59022. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  59023. (t === u && h === A) ||
  59024. (t === n.AdditiveBlending
  59025. ? h
  59026. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59027. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  59028. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  59029. : t === n.SubtractiveBlending
  59030. ? h
  59031. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59032. e.blendFuncSeparate(
  59033. e.ZERO,
  59034. e.ZERO,
  59035. e.ONE_MINUS_SRC_COLOR,
  59036. e.ONE_MINUS_SRC_ALPHA
  59037. ))
  59038. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  59039. : t === n.MultiplyBlending
  59040. ? h
  59041. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59042. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  59043. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  59044. : h
  59045. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59046. e.blendFuncSeparate(
  59047. e.ONE,
  59048. e.ONE_MINUS_SRC_ALPHA,
  59049. e.ONE,
  59050. e.ONE_MINUS_SRC_ALPHA
  59051. ))
  59052. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59053. e.blendFuncSeparate(
  59054. e.SRC_ALPHA,
  59055. e.ONE_MINUS_SRC_ALPHA,
  59056. e.ONE,
  59057. e.ONE_MINUS_SRC_ALPHA
  59058. )),
  59059. (u = t),
  59060. (A = h)),
  59061. t === n.CustomBlending
  59062. ? ((s = s || r),
  59063. (l = l || o),
  59064. (c = c || a),
  59065. (r === d && s === g) ||
  59066. (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  59067. (o === p && a === f && l === m && c === v) ||
  59068. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  59069. (p = o),
  59070. (f = a),
  59071. (m = l),
  59072. (v = c)))
  59073. : ((d = null), (p = null), (f = null), (g = null), (m = null), (v = null));
  59074. }),
  59075. (this.setDepthFunc = function (t) {
  59076. if (y !== t) {
  59077. if (t)
  59078. switch (t) {
  59079. case n.NeverDepth:
  59080. e.depthFunc(e.NEVER);
  59081. break;
  59082. case n.AlwaysDepth:
  59083. e.depthFunc(e.ALWAYS);
  59084. break;
  59085. case n.LessDepth:
  59086. e.depthFunc(e.LESS);
  59087. break;
  59088. case n.LessEqualDepth:
  59089. e.depthFunc(e.LEQUAL);
  59090. break;
  59091. case n.EqualDepth:
  59092. e.depthFunc(e.EQUAL);
  59093. break;
  59094. case n.GreaterEqualDepth:
  59095. e.depthFunc(e.GEQUAL);
  59096. break;
  59097. case n.GreaterDepth:
  59098. e.depthFunc(e.GREATER);
  59099. break;
  59100. case n.NotEqualDepth:
  59101. e.depthFunc(e.NOTEQUAL);
  59102. break;
  59103. default:
  59104. e.depthFunc(e.LEQUAL);
  59105. }
  59106. else e.depthFunc(e.LEQUAL);
  59107. y = t;
  59108. }
  59109. }),
  59110. (this.setDepthTest = function (t) {
  59111. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST);
  59112. }),
  59113. (this.setDepthWrite = function (t) {
  59114. C !== t && (e.depthMask(t), (C = t));
  59115. }),
  59116. (this.setColorWrite = function (t) {
  59117. I !== t && (e.colorMask(t, t, t, t), (I = t));
  59118. }),
  59119. (this.setStencilFunc = function (t, i, n) {
  59120. (b === t && w === i && _ === n) ||
  59121. (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n));
  59122. }),
  59123. (this.setStencilOp = function (t, i, n) {
  59124. (T === t && x === i && S === n) ||
  59125. (e.stencilOp(t, i, n), (T = t), (x = i), (S = n));
  59126. }),
  59127. (this.setStencilTest = function (t) {
  59128. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST);
  59129. }),
  59130. (this.setStencilWrite = function (t) {
  59131. E !== t && (e.stencilMask(t), (E = t));
  59132. }),
  59133. (this.setFlipSided = function (t) {
  59134. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t));
  59135. }),
  59136. (this.setLineWidth = function (t) {
  59137. t !== R && (e.lineWidth(t), (R = t));
  59138. }),
  59139. (this.setPolygonOffset = function (t, i, n) {
  59140. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  59141. !t || (P === i && O === n) || (e.polygonOffset(i, n), (P = i), (O = n));
  59142. }),
  59143. (this.getScissorTest = function () {
  59144. return L;
  59145. }),
  59146. (this.setScissorTest = function (t) {
  59147. (L = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST);
  59148. }),
  59149. (this.activeTexture = function (t) {
  59150. void 0 === t && (t = e.TEXTURE0 + D - 1), N !== t && (e.activeTexture(t), (N = t));
  59151. }),
  59152. (this.bindTexture = function (t, i) {
  59153. void 0 === N && r.activeTexture();
  59154. var n = B[N];
  59155. void 0 === n &&
  59156. ((n = {
  59157. type: void 0,
  59158. texture: void 0,
  59159. }),
  59160. (B[N] = n)),
  59161. (n.type === t && n.texture === i) ||
  59162. (e.bindTexture(t, i || G), (n.type = t), (n.texture = i));
  59163. }),
  59164. (this.compressedTexImage2D = function () {
  59165. try {
  59166. e.compressedTexImage2D.apply(e, arguments);
  59167. } catch (e) {
  59168. console.error(e);
  59169. }
  59170. }),
  59171. (this.texImage2D = function () {
  59172. try {
  59173. e.texImage2D.apply(e, arguments);
  59174. } catch (e) {
  59175. console.error(e);
  59176. }
  59177. }),
  59178. (this.clearColor = function (t, i, n, r) {
  59179. o.set(t, i, n, r), F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o));
  59180. }),
  59181. (this.clearDepth = function (t) {
  59182. V !== t && (e.clearDepth(t), (V = t));
  59183. }),
  59184. (this.clearStencil = function (t) {
  59185. U !== t && (e.clearStencil(t), (U = t));
  59186. }),
  59187. (this.scissor = function (t) {
  59188. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), k.copy(t));
  59189. }),
  59190. (this.viewport = function (t) {
  59191. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), H.copy(t));
  59192. }),
  59193. (this.reset = function () {
  59194. for (var t = 0; t < s.length; t++)
  59195. 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0));
  59196. (c = {}),
  59197. (h = null),
  59198. (N = void 0),
  59199. (B = {}),
  59200. (u = null),
  59201. (I = null),
  59202. (C = null),
  59203. (E = null),
  59204. (M = null);
  59205. });
  59206. }),
  59207. (n.LensFlarePlugin = function (e, t) {
  59208. function i() {
  59209. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  59210. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  59211. (o = p.createBuffer()),
  59212. (a = p.createBuffer()),
  59213. p.bindBuffer(p.ARRAY_BUFFER, o),
  59214. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  59215. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59216. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  59217. (u = p.createTexture()),
  59218. (d = p.createTexture()),
  59219. f.bindTexture(p.TEXTURE_2D, u),
  59220. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  59221. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59222. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59223. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59224. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59225. f.bindTexture(p.TEXTURE_2D, d),
  59226. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  59227. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59228. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59229. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59230. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59231. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0);
  59232. var i;
  59233. (i = h
  59234. ? {
  59235. vertexShader: [
  59236. 'uniform lowp int renderType;',
  59237. 'uniform vec3 screenPosition;',
  59238. 'uniform vec2 scale;',
  59239. 'uniform float rotation;',
  59240. 'uniform sampler2D occlusionMap;',
  59241. 'attribute vec2 position;',
  59242. 'attribute vec2 uv;',
  59243. 'varying vec2 vUV;',
  59244. 'varying float vVisibility;',
  59245. 'void main() {',
  59246. 'vUV = uv;',
  59247. 'vec2 pos = position;',
  59248. 'if ( renderType == 2 ) {',
  59249. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  59250. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  59251. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  59252. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  59253. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  59254. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  59255. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  59256. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  59257. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  59258. 'vVisibility = visibility.r / 9.0;',
  59259. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  59260. 'vVisibility *= visibility.b / 9.0;',
  59261. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  59262. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59263. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59264. '}',
  59265. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59266. '}',
  59267. ].join('\n'),
  59268. fragmentShader: [
  59269. 'uniform lowp int renderType;',
  59270. 'uniform sampler2D map;',
  59271. 'uniform float opacity;',
  59272. 'uniform vec3 color;',
  59273. 'varying vec2 vUV;',
  59274. 'varying float vVisibility;',
  59275. 'void main() {',
  59276. 'if ( renderType == 0 ) {',
  59277. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  59278. '} else if ( renderType == 1 ) {',
  59279. 'gl_FragColor = texture2D( map, vUV );',
  59280. '} else {',
  59281. 'vec4 texture = texture2D( map, vUV );',
  59282. 'texture.a *= opacity * vVisibility;',
  59283. 'gl_FragColor = texture;',
  59284. 'gl_FragColor.rgb *= color;',
  59285. '}',
  59286. '}',
  59287. ].join('\n'),
  59288. }
  59289. : {
  59290. vertexShader: [
  59291. 'uniform lowp int renderType;',
  59292. 'uniform vec3 screenPosition;',
  59293. 'uniform vec2 scale;',
  59294. 'uniform float rotation;',
  59295. 'attribute vec2 position;',
  59296. 'attribute vec2 uv;',
  59297. 'varying vec2 vUV;',
  59298. 'void main() {',
  59299. 'vUV = uv;',
  59300. 'vec2 pos = position;',
  59301. 'if ( renderType == 2 ) {',
  59302. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59303. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59304. '}',
  59305. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59306. '}',
  59307. ].join('\n'),
  59308. fragmentShader: [
  59309. 'precision mediump float;',
  59310. 'uniform lowp int renderType;',
  59311. 'uniform sampler2D map;',
  59312. 'uniform sampler2D occlusionMap;',
  59313. 'uniform float opacity;',
  59314. 'uniform vec3 color;',
  59315. 'varying vec2 vUV;',
  59316. 'void main() {',
  59317. 'if ( renderType == 0 ) {',
  59318. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  59319. '} else if ( renderType == 1 ) {',
  59320. 'gl_FragColor = texture2D( map, vUV );',
  59321. '} else {',
  59322. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  59323. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  59324. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  59325. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  59326. 'visibility = ( 1.0 - visibility / 4.0 );',
  59327. 'vec4 texture = texture2D( map, vUV );',
  59328. 'texture.a *= opacity * visibility;',
  59329. 'gl_FragColor = texture;',
  59330. 'gl_FragColor.rgb *= color;',
  59331. '}',
  59332. '}',
  59333. ].join('\n'),
  59334. }),
  59335. (s = r(i)),
  59336. (l = {
  59337. vertex: p.getAttribLocation(s, 'position'),
  59338. uv: p.getAttribLocation(s, 'uv'),
  59339. }),
  59340. (c = {
  59341. renderType: p.getUniformLocation(s, 'renderType'),
  59342. map: p.getUniformLocation(s, 'map'),
  59343. occlusionMap: p.getUniformLocation(s, 'occlusionMap'),
  59344. opacity: p.getUniformLocation(s, 'opacity'),
  59345. color: p.getUniformLocation(s, 'color'),
  59346. scale: p.getUniformLocation(s, 'scale'),
  59347. rotation: p.getUniformLocation(s, 'rotation'),
  59348. screenPosition: p.getUniformLocation(s, 'screenPosition'),
  59349. });
  59350. }
  59351. function r(t) {
  59352. var i = p.createProgram(),
  59353. n = p.createShader(p.FRAGMENT_SHADER),
  59354. r = p.createShader(p.VERTEX_SHADER),
  59355. o = 'precision ' + e.getPrecision() + ' float;\n';
  59356. return (
  59357. p.shaderSource(n, o + t.fragmentShader),
  59358. p.shaderSource(r, o + t.vertexShader),
  59359. p.compileShader(n),
  59360. p.compileShader(r),
  59361. p.attachShader(i, n),
  59362. p.attachShader(i, r),
  59363. p.linkProgram(i),
  59364. i
  59365. );
  59366. }
  59367. var o,
  59368. a,
  59369. s,
  59370. l,
  59371. c,
  59372. h,
  59373. u,
  59374. d,
  59375. p = e.context,
  59376. f = e.state;
  59377. this.render = function (r, g, m) {
  59378. if (0 !== t.length) {
  59379. var v = new n.Vector3(),
  59380. A = m.w / m.z,
  59381. y = 0.5 * m.z,
  59382. C = 0.5 * m.w,
  59383. I = 16 / m.w,
  59384. E = new n.Vector2(I * A, I),
  59385. b = new n.Vector3(1, 1, 0),
  59386. w = new n.Vector2(1, 1);
  59387. void 0 === s && i(),
  59388. p.useProgram(s),
  59389. f.initAttributes(),
  59390. f.enableAttribute(l.vertex),
  59391. f.enableAttribute(l.uv),
  59392. f.disableUnusedAttributes(),
  59393. p.uniform1i(c.occlusionMap, 0),
  59394. p.uniform1i(c.map, 1),
  59395. p.bindBuffer(p.ARRAY_BUFFER, o),
  59396. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  59397. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  59398. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59399. f.disable(p.CULL_FACE),
  59400. f.setDepthWrite(!1);
  59401. for (var _ = 0, T = t.length; _ < T; _++) {
  59402. (I = 16 / m.w), E.set(I * A, I);
  59403. var x = t[_];
  59404. if (
  59405. (v.set(
  59406. x.matrixWorld.elements[12],
  59407. x.matrixWorld.elements[13],
  59408. x.matrixWorld.elements[14]
  59409. ),
  59410. v.applyMatrix4(g.matrixWorldInverse),
  59411. v.applyProjection(g.projectionMatrix),
  59412. b.copy(v),
  59413. (w.x = b.x * y + y),
  59414. (w.y = b.y * C + C),
  59415. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  59416. ) {
  59417. f.activeTexture(p.TEXTURE0),
  59418. f.bindTexture(p.TEXTURE_2D, null),
  59419. f.activeTexture(p.TEXTURE1),
  59420. f.bindTexture(p.TEXTURE_2D, u),
  59421. p.copyTexImage2D(
  59422. p.TEXTURE_2D,
  59423. 0,
  59424. p.RGB,
  59425. m.x + w.x - 8,
  59426. m.y + w.y - 8,
  59427. 16,
  59428. 16,
  59429. 0
  59430. ),
  59431. p.uniform1i(c.renderType, 0),
  59432. p.uniform2f(c.scale, E.x, E.y),
  59433. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59434. f.disable(p.BLEND),
  59435. f.enable(p.DEPTH_TEST),
  59436. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59437. f.activeTexture(p.TEXTURE0),
  59438. f.bindTexture(p.TEXTURE_2D, d),
  59439. p.copyTexImage2D(
  59440. p.TEXTURE_2D,
  59441. 0,
  59442. p.RGBA,
  59443. m.x + w.x - 8,
  59444. m.y + w.y - 8,
  59445. 16,
  59446. 16,
  59447. 0
  59448. ),
  59449. p.uniform1i(c.renderType, 1),
  59450. f.disable(p.DEPTH_TEST),
  59451. f.activeTexture(p.TEXTURE1),
  59452. f.bindTexture(p.TEXTURE_2D, u),
  59453. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59454. x.positionScreen.copy(b),
  59455. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  59456. p.uniform1i(c.renderType, 2),
  59457. f.enable(p.BLEND);
  59458. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  59459. var R = x.lensFlares[S];
  59460. R.opacity > 0.001 &&
  59461. R.scale > 0.001 &&
  59462. ((b.x = R.x),
  59463. (b.y = R.y),
  59464. (b.z = R.z),
  59465. (I = (R.size * R.scale) / m.w),
  59466. (E.x = I * A),
  59467. (E.y = I),
  59468. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59469. p.uniform2f(c.scale, E.x, E.y),
  59470. p.uniform1f(c.rotation, R.rotation),
  59471. p.uniform1f(c.opacity, R.opacity),
  59472. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  59473. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  59474. e.setTexture(R.texture, 1),
  59475. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0));
  59476. }
  59477. }
  59478. }
  59479. f.enable(p.CULL_FACE),
  59480. f.enable(p.DEPTH_TEST),
  59481. f.setDepthWrite(!0),
  59482. e.resetGLState();
  59483. }
  59484. };
  59485. }),
  59486. (n.SpritePlugin = function (e, t) {
  59487. function i() {
  59488. var e = new Float32Array([
  59489. -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1,
  59490. ]),
  59491. t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  59492. (a = d.createBuffer()),
  59493. (s = d.createBuffer()),
  59494. d.bindBuffer(d.ARRAY_BUFFER, a),
  59495. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  59496. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59497. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  59498. (l = r()),
  59499. (c = {
  59500. position: d.getAttribLocation(l, 'position'),
  59501. uv: d.getAttribLocation(l, 'uv'),
  59502. }),
  59503. (h = {
  59504. uvOffset: d.getUniformLocation(l, 'uvOffset'),
  59505. uvScale: d.getUniformLocation(l, 'uvScale'),
  59506. rotation: d.getUniformLocation(l, 'rotation'),
  59507. scale: d.getUniformLocation(l, 'scale'),
  59508. color: d.getUniformLocation(l, 'color'),
  59509. map: d.getUniformLocation(l, 'map'),
  59510. opacity: d.getUniformLocation(l, 'opacity'),
  59511. modelViewMatrix: d.getUniformLocation(l, 'modelViewMatrix'),
  59512. projectionMatrix: d.getUniformLocation(l, 'projectionMatrix'),
  59513. fogType: d.getUniformLocation(l, 'fogType'),
  59514. fogDensity: d.getUniformLocation(l, 'fogDensity'),
  59515. fogNear: d.getUniformLocation(l, 'fogNear'),
  59516. fogFar: d.getUniformLocation(l, 'fogFar'),
  59517. fogColor: d.getUniformLocation(l, 'fogColor'),
  59518. alphaTest: d.getUniformLocation(l, 'alphaTest'),
  59519. });
  59520. var i = document.createElement('canvas');
  59521. (i.width = 8), (i.height = 8);
  59522. var o = i.getContext('2d');
  59523. (o.fillStyle = 'white'),
  59524. o.fillRect(0, 0, 8, 8),
  59525. (u = new n.Texture(i)),
  59526. (u.needsUpdate = !0);
  59527. }
  59528. function r() {
  59529. var t = d.createProgram(),
  59530. i = d.createShader(d.VERTEX_SHADER),
  59531. n = d.createShader(d.FRAGMENT_SHADER);
  59532. return (
  59533. d.shaderSource(
  59534. i,
  59535. [
  59536. 'precision ' + e.getPrecision() + ' float;',
  59537. 'uniform mat4 modelViewMatrix;',
  59538. 'uniform mat4 projectionMatrix;',
  59539. 'uniform float rotation;',
  59540. 'uniform vec2 scale;',
  59541. 'uniform vec2 uvOffset;',
  59542. 'uniform vec2 uvScale;',
  59543. 'attribute vec2 position;',
  59544. 'attribute vec2 uv;',
  59545. 'varying vec2 vUV;',
  59546. 'void main() {',
  59547. 'vUV = uvOffset + uv * uvScale;',
  59548. 'vec2 alignedPosition = position * scale;',
  59549. 'vec2 rotatedPosition;',
  59550. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  59551. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  59552. 'vec4 finalPosition;',
  59553. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  59554. 'finalPosition.xy += rotatedPosition;',
  59555. 'finalPosition = projectionMatrix * finalPosition;',
  59556. 'gl_Position = finalPosition;',
  59557. '}',
  59558. ].join('\n')
  59559. ),
  59560. d.shaderSource(
  59561. n,
  59562. [
  59563. 'precision ' + e.getPrecision() + ' float;',
  59564. 'uniform vec3 color;',
  59565. 'uniform sampler2D map;',
  59566. 'uniform float opacity;',
  59567. 'uniform int fogType;',
  59568. 'uniform vec3 fogColor;',
  59569. 'uniform float fogDensity;',
  59570. 'uniform float fogNear;',
  59571. 'uniform float fogFar;',
  59572. 'uniform float alphaTest;',
  59573. 'varying vec2 vUV;',
  59574. 'void main() {',
  59575. 'vec4 texture = texture2D( map, vUV );',
  59576. 'if ( texture.a < alphaTest ) discard;',
  59577. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  59578. 'if ( fogType > 0 ) {',
  59579. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  59580. 'float fogFactor = 0.0;',
  59581. 'if ( fogType == 1 ) {',
  59582. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  59583. '} else {',
  59584. 'const float LOG2 = 1.442695;',
  59585. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  59586. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  59587. '}',
  59588. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  59589. '}',
  59590. '}',
  59591. ].join('\n')
  59592. ),
  59593. d.compileShader(i),
  59594. d.compileShader(n),
  59595. d.attachShader(t, i),
  59596. d.attachShader(t, n),
  59597. d.linkProgram(t),
  59598. t
  59599. );
  59600. }
  59601. function o(e, t) {
  59602. return e.renderOrder !== t.renderOrder
  59603. ? e.renderOrder - t.renderOrder
  59604. : e.z !== t.z
  59605. ? t.z - e.z
  59606. : t.id - e.id;
  59607. }
  59608. var a,
  59609. s,
  59610. l,
  59611. c,
  59612. h,
  59613. u,
  59614. d = e.context,
  59615. p = e.state,
  59616. f = new n.Vector3(),
  59617. g = new n.Quaternion(),
  59618. m = new n.Vector3();
  59619. this.render = function (r, v) {
  59620. if (0 !== t.length) {
  59621. void 0 === l && i(),
  59622. d.useProgram(l),
  59623. p.initAttributes(),
  59624. p.enableAttribute(c.position),
  59625. p.enableAttribute(c.uv),
  59626. p.disableUnusedAttributes(),
  59627. p.disable(d.CULL_FACE),
  59628. p.enable(d.BLEND),
  59629. d.bindBuffer(d.ARRAY_BUFFER, a),
  59630. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  59631. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  59632. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59633. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  59634. p.activeTexture(d.TEXTURE0),
  59635. d.uniform1i(h.map, 0);
  59636. var A = 0,
  59637. y = 0,
  59638. C = r.fog;
  59639. C
  59640. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  59641. C instanceof n.Fog
  59642. ? (d.uniform1f(h.fogNear, C.near),
  59643. d.uniform1f(h.fogFar, C.far),
  59644. d.uniform1i(h.fogType, 1),
  59645. (A = 1),
  59646. (y = 1))
  59647. : C instanceof n.FogExp2 &&
  59648. (d.uniform1f(h.fogDensity, C.density),
  59649. d.uniform1i(h.fogType, 2),
  59650. (A = 2),
  59651. (y = 2)))
  59652. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0));
  59653. for (var I = 0, E = t.length; I < E; I++) {
  59654. var b = t[I];
  59655. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  59656. (b.z = -b.modelViewMatrix.elements[14]);
  59657. }
  59658. t.sort(o);
  59659. for (var w = [], I = 0, E = t.length; I < E; I++) {
  59660. var b = t[I],
  59661. _ = b.material;
  59662. d.uniform1f(h.alphaTest, _.alphaTest),
  59663. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  59664. b.matrixWorld.decompose(f, g, m),
  59665. (w[0] = m.x),
  59666. (w[1] = m.y);
  59667. var T = 0;
  59668. r.fog && _.fog && (T = y),
  59669. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  59670. null !== _.map
  59671. ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  59672. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  59673. : (d.uniform2f(h.uvOffset, 0, 0), d.uniform2f(h.uvScale, 1, 1)),
  59674. d.uniform1f(h.opacity, _.opacity),
  59675. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  59676. d.uniform1f(h.rotation, _.rotation),
  59677. d.uniform2fv(h.scale, w),
  59678. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  59679. p.setDepthTest(_.depthTest),
  59680. p.setDepthWrite(_.depthWrite),
  59681. _.map && _.map.image && _.map.image.width
  59682. ? e.setTexture(_.map, 0)
  59683. : e.setTexture(u, 0),
  59684. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0);
  59685. }
  59686. p.enable(d.CULL_FACE), e.resetGLState();
  59687. }
  59688. };
  59689. }),
  59690. Object.defineProperties(n.Box2.prototype, {
  59691. empty: {
  59692. value: function () {
  59693. return (
  59694. console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'),
  59695. this.isEmpty()
  59696. );
  59697. },
  59698. },
  59699. isIntersectionBox: {
  59700. value: function (e) {
  59701. return (
  59702. console.warn(
  59703. 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'
  59704. ),
  59705. this.intersectsBox(e)
  59706. );
  59707. },
  59708. },
  59709. }),
  59710. Object.defineProperties(n.Box3.prototype, {
  59711. empty: {
  59712. value: function () {
  59713. return (
  59714. console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'),
  59715. this.isEmpty()
  59716. );
  59717. },
  59718. },
  59719. isIntersectionBox: {
  59720. value: function (e) {
  59721. return (
  59722. console.warn(
  59723. 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'
  59724. ),
  59725. this.intersectsBox(e)
  59726. );
  59727. },
  59728. },
  59729. isIntersectionSphere: {
  59730. value: function (e) {
  59731. return (
  59732. console.warn(
  59733. 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  59734. ),
  59735. this.intersectsSphere(e)
  59736. );
  59737. },
  59738. },
  59739. }),
  59740. Object.defineProperties(n.Matrix3.prototype, {
  59741. multiplyVector3: {
  59742. value: function (e) {
  59743. return (
  59744. console.warn(
  59745. 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'
  59746. ),
  59747. e.applyMatrix3(this)
  59748. );
  59749. },
  59750. },
  59751. multiplyVector3Array: {
  59752. value: function (e) {
  59753. return (
  59754. console.warn(
  59755. 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59756. ),
  59757. this.applyToVector3Array(e)
  59758. );
  59759. },
  59760. },
  59761. }),
  59762. Object.defineProperties(n.Matrix4.prototype, {
  59763. extractPosition: {
  59764. value: function (e) {
  59765. return (
  59766. console.warn(
  59767. 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'
  59768. ),
  59769. this.copyPosition(e)
  59770. );
  59771. },
  59772. },
  59773. setRotationFromQuaternion: {
  59774. value: function (e) {
  59775. return (
  59776. console.warn(
  59777. 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'
  59778. ),
  59779. this.makeRotationFromQuaternion(e)
  59780. );
  59781. },
  59782. },
  59783. multiplyVector3: {
  59784. value: function (e) {
  59785. return (
  59786. console.warn(
  59787. 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'
  59788. ),
  59789. e.applyProjection(this)
  59790. );
  59791. },
  59792. },
  59793. multiplyVector4: {
  59794. value: function (e) {
  59795. return (
  59796. console.warn(
  59797. 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59798. ),
  59799. e.applyMatrix4(this)
  59800. );
  59801. },
  59802. },
  59803. multiplyVector3Array: {
  59804. value: function (e) {
  59805. return (
  59806. console.warn(
  59807. 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59808. ),
  59809. this.applyToVector3Array(e)
  59810. );
  59811. },
  59812. },
  59813. rotateAxis: {
  59814. value: function (e) {
  59815. console.warn(
  59816. 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'
  59817. ),
  59818. e.transformDirection(this);
  59819. },
  59820. },
  59821. crossVector: {
  59822. value: function (e) {
  59823. return (
  59824. console.warn(
  59825. 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59826. ),
  59827. e.applyMatrix4(this)
  59828. );
  59829. },
  59830. },
  59831. translate: {
  59832. value: function (e) {
  59833. console.error('THREE.Matrix4: .translate() has been removed.');
  59834. },
  59835. },
  59836. rotateX: {
  59837. value: function (e) {
  59838. console.error('THREE.Matrix4: .rotateX() has been removed.');
  59839. },
  59840. },
  59841. rotateY: {
  59842. value: function (e) {
  59843. console.error('THREE.Matrix4: .rotateY() has been removed.');
  59844. },
  59845. },
  59846. rotateZ: {
  59847. value: function (e) {
  59848. console.error('THREE.Matrix4: .rotateZ() has been removed.');
  59849. },
  59850. },
  59851. rotateByAxis: {
  59852. value: function (e, t) {
  59853. console.error('THREE.Matrix4: .rotateByAxis() has been removed.');
  59854. },
  59855. },
  59856. }),
  59857. Object.defineProperties(n.Plane.prototype, {
  59858. isIntersectionLine: {
  59859. value: function (e) {
  59860. return (
  59861. console.warn(
  59862. 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'
  59863. ),
  59864. this.intersectsLine(e)
  59865. );
  59866. },
  59867. },
  59868. }),
  59869. Object.defineProperties(n.Quaternion.prototype, {
  59870. multiplyVector3: {
  59871. value: function (e) {
  59872. return (
  59873. console.warn(
  59874. 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'
  59875. ),
  59876. e.applyQuaternion(this)
  59877. );
  59878. },
  59879. },
  59880. }),
  59881. Object.defineProperties(n.Ray.prototype, {
  59882. isIntersectionBox: {
  59883. value: function (e) {
  59884. return (
  59885. console.warn(
  59886. 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'
  59887. ),
  59888. this.intersectsBox(e)
  59889. );
  59890. },
  59891. },
  59892. isIntersectionPlane: {
  59893. value: function (e) {
  59894. return (
  59895. console.warn(
  59896. 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'
  59897. ),
  59898. this.intersectsPlane(e)
  59899. );
  59900. },
  59901. },
  59902. isIntersectionSphere: {
  59903. value: function (e) {
  59904. return (
  59905. console.warn(
  59906. 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  59907. ),
  59908. this.intersectsSphere(e)
  59909. );
  59910. },
  59911. },
  59912. }),
  59913. Object.defineProperties(n.Vector3.prototype, {
  59914. setEulerFromRotationMatrix: {
  59915. value: function () {
  59916. console.error(
  59917. 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.'
  59918. );
  59919. },
  59920. },
  59921. setEulerFromQuaternion: {
  59922. value: function () {
  59923. console.error(
  59924. 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.'
  59925. );
  59926. },
  59927. },
  59928. getPositionFromMatrix: {
  59929. value: function (e) {
  59930. return (
  59931. console.warn(
  59932. 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'
  59933. ),
  59934. this.setFromMatrixPosition(e)
  59935. );
  59936. },
  59937. },
  59938. getScaleFromMatrix: {
  59939. value: function (e) {
  59940. return (
  59941. console.warn(
  59942. 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'
  59943. ),
  59944. this.setFromMatrixScale(e)
  59945. );
  59946. },
  59947. },
  59948. getColumnFromMatrix: {
  59949. value: function (e, t) {
  59950. return (
  59951. console.warn(
  59952. 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'
  59953. ),
  59954. this.setFromMatrixColumn(e, t)
  59955. );
  59956. },
  59957. },
  59958. }),
  59959. (n.Face4 = function (e, t, i, r, o, a, s) {
  59960. return (
  59961. console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'),
  59962. new n.Face3(e, t, i, o, a, s)
  59963. );
  59964. }),
  59965. (n.Vertex = function (e, t, i) {
  59966. return (
  59967. console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'),
  59968. new n.Vector3(e, t, i)
  59969. );
  59970. }),
  59971. Object.defineProperties(n.Object3D.prototype, {
  59972. eulerOrder: {
  59973. get: function () {
  59974. return (
  59975. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  59976. this.rotation.order
  59977. );
  59978. },
  59979. set: function (e) {
  59980. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  59981. (this.rotation.order = e);
  59982. },
  59983. },
  59984. getChildByName: {
  59985. value: function (e) {
  59986. return (
  59987. console.warn(
  59988. 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'
  59989. ),
  59990. this.getObjectByName(e)
  59991. );
  59992. },
  59993. },
  59994. renderDepth: {
  59995. set: function (e) {
  59996. console.warn(
  59997. 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.'
  59998. );
  59999. },
  60000. },
  60001. translate: {
  60002. value: function (e, t) {
  60003. return (
  60004. console.warn(
  60005. 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'
  60006. ),
  60007. this.translateOnAxis(t, e)
  60008. );
  60009. },
  60010. },
  60011. useQuaternion: {
  60012. get: function () {
  60013. console.warn(
  60014. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60015. );
  60016. },
  60017. set: function (e) {
  60018. console.warn(
  60019. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60020. );
  60021. },
  60022. },
  60023. }),
  60024. Object.defineProperties(n, {
  60025. PointCloud: {
  60026. value: function (e, t) {
  60027. return (
  60028. console.warn('THREE.PointCloud has been renamed to THREE.Points.'),
  60029. new n.Points(e, t)
  60030. );
  60031. },
  60032. },
  60033. ParticleSystem: {
  60034. value: function (e, t) {
  60035. return (
  60036. console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'),
  60037. new n.Points(e, t)
  60038. );
  60039. },
  60040. },
  60041. }),
  60042. Object.defineProperties(n.Light.prototype, {
  60043. onlyShadow: {
  60044. set: function (e) {
  60045. console.warn('THREE.Light: .onlyShadow has been removed.');
  60046. },
  60047. },
  60048. shadowCameraFov: {
  60049. set: function (e) {
  60050. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'),
  60051. (this.shadow.camera.fov = e);
  60052. },
  60053. },
  60054. shadowCameraLeft: {
  60055. set: function (e) {
  60056. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'),
  60057. (this.shadow.camera.left = e);
  60058. },
  60059. },
  60060. shadowCameraRight: {
  60061. set: function (e) {
  60062. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'),
  60063. (this.shadow.camera.right = e);
  60064. },
  60065. },
  60066. shadowCameraTop: {
  60067. set: function (e) {
  60068. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'),
  60069. (this.shadow.camera.top = e);
  60070. },
  60071. },
  60072. shadowCameraBottom: {
  60073. set: function (e) {
  60074. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'),
  60075. (this.shadow.camera.bottom = e);
  60076. },
  60077. },
  60078. shadowCameraNear: {
  60079. set: function (e) {
  60080. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'),
  60081. (this.shadow.camera.near = e);
  60082. },
  60083. },
  60084. shadowCameraFar: {
  60085. set: function (e) {
  60086. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'),
  60087. (this.shadow.camera.far = e);
  60088. },
  60089. },
  60090. shadowCameraVisible: {
  60091. set: function (e) {
  60092. console.warn(
  60093. 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.'
  60094. );
  60095. },
  60096. },
  60097. shadowBias: {
  60098. set: function (e) {
  60099. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'),
  60100. (this.shadow.bias = e);
  60101. },
  60102. },
  60103. shadowDarkness: {
  60104. set: function (e) {
  60105. console.warn('THREE.Light: .shadowDarkness has been removed.');
  60106. },
  60107. },
  60108. shadowMapWidth: {
  60109. set: function (e) {
  60110. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'),
  60111. (this.shadow.mapSize.width = e);
  60112. },
  60113. },
  60114. shadowMapHeight: {
  60115. set: function (e) {
  60116. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'),
  60117. (this.shadow.mapSize.height = e);
  60118. },
  60119. },
  60120. }),
  60121. Object.defineProperties(n.BufferAttribute.prototype, {
  60122. length: {
  60123. get: function () {
  60124. return (
  60125. console.warn(
  60126. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  60127. ),
  60128. this.array.length
  60129. );
  60130. },
  60131. },
  60132. }),
  60133. Object.defineProperties(n.BufferGeometry.prototype, {
  60134. drawcalls: {
  60135. get: function () {
  60136. return (
  60137. console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'),
  60138. this.groups
  60139. );
  60140. },
  60141. },
  60142. offsets: {
  60143. get: function () {
  60144. return (
  60145. console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'),
  60146. this.groups
  60147. );
  60148. },
  60149. },
  60150. addIndex: {
  60151. value: function (e) {
  60152. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'),
  60153. this.setIndex(e);
  60154. },
  60155. },
  60156. addDrawCall: {
  60157. value: function (e, t, i) {
  60158. void 0 !== i &&
  60159. console.warn(
  60160. 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'
  60161. ),
  60162. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  60163. this.addGroup(e, t);
  60164. },
  60165. },
  60166. clearDrawCalls: {
  60167. value: function () {
  60168. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'),
  60169. this.clearGroups();
  60170. },
  60171. },
  60172. computeTangents: {
  60173. value: function () {
  60174. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.');
  60175. },
  60176. },
  60177. computeOffsets: {
  60178. value: function () {
  60179. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.');
  60180. },
  60181. },
  60182. }),
  60183. Object.defineProperties(n.Material.prototype, {
  60184. wrapAround: {
  60185. get: function () {
  60186. console.warn('THREE.' + this.type + ': .wrapAround has been removed.');
  60187. },
  60188. set: function (e) {
  60189. console.warn('THREE.' + this.type + ': .wrapAround has been removed.');
  60190. },
  60191. },
  60192. wrapRGB: {
  60193. get: function () {
  60194. return (
  60195. console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new n.Color()
  60196. );
  60197. },
  60198. },
  60199. }),
  60200. Object.defineProperties(n, {
  60201. PointCloudMaterial: {
  60202. value: function (e) {
  60203. return (
  60204. console.warn(
  60205. 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'
  60206. ),
  60207. new n.PointsMaterial(e)
  60208. );
  60209. },
  60210. },
  60211. ParticleBasicMaterial: {
  60212. value: function (e) {
  60213. return (
  60214. console.warn(
  60215. 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'
  60216. ),
  60217. new n.PointsMaterial(e)
  60218. );
  60219. },
  60220. },
  60221. ParticleSystemMaterial: {
  60222. value: function (e) {
  60223. return (
  60224. console.warn(
  60225. 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'
  60226. ),
  60227. new n.PointsMaterial(e)
  60228. );
  60229. },
  60230. },
  60231. }),
  60232. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  60233. metal: {
  60234. get: function () {
  60235. return (
  60236. console.warn(
  60237. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'
  60238. ),
  60239. !1
  60240. );
  60241. },
  60242. set: function (e) {
  60243. console.warn(
  60244. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead'
  60245. );
  60246. },
  60247. },
  60248. }),
  60249. Object.defineProperties(n.ShaderMaterial.prototype, {
  60250. derivatives: {
  60251. get: function () {
  60252. return (
  60253. console.warn(
  60254. 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60255. ),
  60256. this.extensions.derivatives
  60257. );
  60258. },
  60259. set: function (e) {
  60260. console.warn(
  60261. 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60262. ),
  60263. (this.extensions.derivatives = e);
  60264. },
  60265. },
  60266. }),
  60267. Object.defineProperties(n.WebGLRenderer.prototype, {
  60268. supportsFloatTextures: {
  60269. value: function () {
  60270. return (
  60271. console.warn(
  60272. "THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."
  60273. ),
  60274. this.extensions.get('OES_texture_float')
  60275. );
  60276. },
  60277. },
  60278. supportsHalfFloatTextures: {
  60279. value: function () {
  60280. return (
  60281. console.warn(
  60282. "THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."
  60283. ),
  60284. this.extensions.get('OES_texture_half_float')
  60285. );
  60286. },
  60287. },
  60288. supportsStandardDerivatives: {
  60289. value: function () {
  60290. return (
  60291. console.warn(
  60292. "THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."
  60293. ),
  60294. this.extensions.get('OES_standard_derivatives')
  60295. );
  60296. },
  60297. },
  60298. supportsCompressedTextureS3TC: {
  60299. value: function () {
  60300. return (
  60301. console.warn(
  60302. "THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."
  60303. ),
  60304. this.extensions.get('WEBGL_compressed_texture_s3tc')
  60305. );
  60306. },
  60307. },
  60308. supportsCompressedTexturePVRTC: {
  60309. value: function () {
  60310. return (
  60311. console.warn(
  60312. "THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."
  60313. ),
  60314. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  60315. );
  60316. },
  60317. },
  60318. supportsBlendMinMax: {
  60319. value: function () {
  60320. return (
  60321. console.warn(
  60322. "THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."
  60323. ),
  60324. this.extensions.get('EXT_blend_minmax')
  60325. );
  60326. },
  60327. },
  60328. supportsVertexTextures: {
  60329. value: function () {
  60330. return this.capabilities.vertexTextures;
  60331. },
  60332. },
  60333. supportsInstancedArrays: {
  60334. value: function () {
  60335. return (
  60336. console.warn(
  60337. "THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."
  60338. ),
  60339. this.extensions.get('ANGLE_instanced_arrays')
  60340. );
  60341. },
  60342. },
  60343. enableScissorTest: {
  60344. value: function (e) {
  60345. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'),
  60346. this.setScissorTest(e);
  60347. },
  60348. },
  60349. initMaterial: {
  60350. value: function () {
  60351. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.');
  60352. },
  60353. },
  60354. addPrePlugin: {
  60355. value: function () {
  60356. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.');
  60357. },
  60358. },
  60359. addPostPlugin: {
  60360. value: function () {
  60361. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.');
  60362. },
  60363. },
  60364. updateShadowMap: {
  60365. value: function () {
  60366. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.');
  60367. },
  60368. },
  60369. shadowMapEnabled: {
  60370. get: function () {
  60371. return this.shadowMap.enabled;
  60372. },
  60373. set: function (e) {
  60374. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'),
  60375. (this.shadowMap.enabled = e);
  60376. },
  60377. },
  60378. shadowMapType: {
  60379. get: function () {
  60380. return this.shadowMap.type;
  60381. },
  60382. set: function (e) {
  60383. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'),
  60384. (this.shadowMap.type = e);
  60385. },
  60386. },
  60387. shadowMapCullFace: {
  60388. get: function () {
  60389. return this.shadowMap.cullFace;
  60390. },
  60391. set: function (e) {
  60392. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'),
  60393. (this.shadowMap.cullFace = e);
  60394. },
  60395. },
  60396. }),
  60397. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  60398. wrapS: {
  60399. get: function () {
  60400. return (
  60401. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60402. this.texture.wrapS
  60403. );
  60404. },
  60405. set: function (e) {
  60406. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60407. (this.texture.wrapS = e);
  60408. },
  60409. },
  60410. wrapT: {
  60411. get: function () {
  60412. return (
  60413. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60414. this.texture.wrapT
  60415. );
  60416. },
  60417. set: function (e) {
  60418. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60419. (this.texture.wrapT = e);
  60420. },
  60421. },
  60422. magFilter: {
  60423. get: function () {
  60424. return (
  60425. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60426. this.texture.magFilter
  60427. );
  60428. },
  60429. set: function (e) {
  60430. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60431. (this.texture.magFilter = e);
  60432. },
  60433. },
  60434. minFilter: {
  60435. get: function () {
  60436. return (
  60437. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60438. this.texture.minFilter
  60439. );
  60440. },
  60441. set: function (e) {
  60442. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60443. (this.texture.minFilter = e);
  60444. },
  60445. },
  60446. anisotropy: {
  60447. get: function () {
  60448. return (
  60449. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60450. this.texture.anisotropy
  60451. );
  60452. },
  60453. set: function (e) {
  60454. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60455. (this.texture.anisotropy = e);
  60456. },
  60457. },
  60458. offset: {
  60459. get: function () {
  60460. return (
  60461. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60462. this.texture.offset
  60463. );
  60464. },
  60465. set: function (e) {
  60466. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60467. (this.texture.offset = e);
  60468. },
  60469. },
  60470. repeat: {
  60471. get: function () {
  60472. return (
  60473. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60474. this.texture.repeat
  60475. );
  60476. },
  60477. set: function (e) {
  60478. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60479. (this.texture.repeat = e);
  60480. },
  60481. },
  60482. format: {
  60483. get: function () {
  60484. return (
  60485. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60486. this.texture.format
  60487. );
  60488. },
  60489. set: function (e) {
  60490. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60491. (this.texture.format = e);
  60492. },
  60493. },
  60494. type: {
  60495. get: function () {
  60496. return (
  60497. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60498. this.texture.type
  60499. );
  60500. },
  60501. set: function (e) {
  60502. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60503. (this.texture.type = e);
  60504. },
  60505. },
  60506. generateMipmaps: {
  60507. get: function () {
  60508. return (
  60509. console.warn(
  60510. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60511. ),
  60512. this.texture.generateMipmaps
  60513. );
  60514. },
  60515. set: function (e) {
  60516. console.warn(
  60517. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60518. ),
  60519. (this.texture.generateMipmaps = e);
  60520. },
  60521. },
  60522. }),
  60523. (n.GeometryUtils = {
  60524. merge: function (e, t, i) {
  60525. console.warn(
  60526. 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.'
  60527. );
  60528. var r;
  60529. t instanceof n.Mesh &&
  60530. (t.matrixAutoUpdate && t.updateMatrix(), (r = t.matrix), (t = t.geometry)),
  60531. e.merge(t, r, i);
  60532. },
  60533. center: function (e) {
  60534. return (
  60535. console.warn(
  60536. 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'
  60537. ),
  60538. e.center()
  60539. );
  60540. },
  60541. }),
  60542. (n.ImageUtils = {
  60543. crossOrigin: void 0,
  60544. loadTexture: function (e, t, i, r) {
  60545. console.warn(
  60546. 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.'
  60547. );
  60548. var o = new n.TextureLoader();
  60549. o.setCrossOrigin(this.crossOrigin);
  60550. var a = o.load(e, i, void 0, r);
  60551. return t && (a.mapping = t), a;
  60552. },
  60553. loadTextureCube: function (e, t, i, r) {
  60554. console.warn(
  60555. 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.'
  60556. );
  60557. var o = new n.CubeTextureLoader();
  60558. o.setCrossOrigin(this.crossOrigin);
  60559. var a = o.load(e, i, void 0, r);
  60560. return t && (a.mapping = t), a;
  60561. },
  60562. loadCompressedTexture: function () {
  60563. console.error(
  60564. 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.'
  60565. );
  60566. },
  60567. loadCompressedTextureCube: function () {
  60568. console.error(
  60569. 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.'
  60570. );
  60571. },
  60572. }),
  60573. (n.Projector = function () {
  60574. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  60575. (this.projectVector = function (e, t) {
  60576. console.warn('THREE.Projector: .projectVector() is now vector.project().'),
  60577. e.project(t);
  60578. }),
  60579. (this.unprojectVector = function (e, t) {
  60580. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'),
  60581. e.unproject(t);
  60582. }),
  60583. (this.pickingRay = function (e, t) {
  60584. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().');
  60585. });
  60586. }),
  60587. (n.CanvasRenderer = function () {
  60588. console.error(
  60589. 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'
  60590. ),
  60591. (this.domElement = document.createElement('canvas')),
  60592. (this.clear = function () {}),
  60593. (this.render = function () {}),
  60594. (this.setClearColor = function () {}),
  60595. (this.setSize = function () {});
  60596. }),
  60597. (n.MeshFaceMaterial = n.MultiMaterial),
  60598. (n.CurveUtils = {
  60599. tangentQuadraticBezier: function (e, t, i, n) {
  60600. return 2 * (1 - e) * (i - t) + 2 * e * (n - i);
  60601. },
  60602. tangentCubicBezier: function (e, t, i, n, r) {
  60603. return (
  60604. -3 * t * (1 - e) * (1 - e) +
  60605. 3 * i * (1 - e) * (1 - e) -
  60606. 6 * e * i * (1 - e) +
  60607. 6 * e * n * (1 - e) -
  60608. 3 * e * e * n +
  60609. 3 * e * e * r
  60610. );
  60611. },
  60612. tangentSpline: function (e, t, i, n, r) {
  60613. var o = 6 * e * e - 6 * e,
  60614. a = 3 * e * e - 4 * e + 1,
  60615. s = -6 * e * e + 6 * e,
  60616. l = 3 * e * e - 2 * e;
  60617. return o + a + s + l;
  60618. },
  60619. interpolate: function (e, t, i, n, r) {
  60620. var o = 0.5 * (i - e),
  60621. a = 0.5 * (n - t),
  60622. s = r * r,
  60623. l = r * s;
  60624. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t;
  60625. },
  60626. }),
  60627. (n.SceneUtils = {
  60628. createMultiMaterialObject: function (e, t) {
  60629. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++)
  60630. i.add(new n.Mesh(e, t[r]));
  60631. return i;
  60632. },
  60633. detach: function (e, t, i) {
  60634. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e);
  60635. },
  60636. attach: function (e, t, i) {
  60637. var r = new n.Matrix4();
  60638. r.getInverse(i.matrixWorld), e.applyMatrix(r), t.remove(e), i.add(e);
  60639. },
  60640. }),
  60641. (n.ShapeUtils = {
  60642. area: function (e) {
  60643. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  60644. i += e[n].x * e[r].y - e[r].x * e[n].y;
  60645. return 0.5 * i;
  60646. },
  60647. triangulate: (function () {
  60648. function e(e, t, i, n, r, o) {
  60649. var a, s, l, c, h, u, d, p, f;
  60650. if (
  60651. ((s = e[o[t]].x),
  60652. (l = e[o[t]].y),
  60653. (c = e[o[i]].x),
  60654. (h = e[o[i]].y),
  60655. (u = e[o[n]].x),
  60656. (d = e[o[n]].y),
  60657. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  60658. )
  60659. return !1;
  60660. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  60661. for (
  60662. g = u - c, m = d - h, v = s - u, A = l - d, y = c - s, C = h - l, a = 0;
  60663. a < r;
  60664. a++
  60665. )
  60666. if (
  60667. ((p = e[o[a]].x),
  60668. (f = e[o[a]].y),
  60669. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  60670. ((I = p - s),
  60671. (E = f - l),
  60672. (b = p - c),
  60673. (w = f - h),
  60674. (_ = p - u),
  60675. (T = f - d),
  60676. (M = g * w - m * b),
  60677. (x = y * E - C * I),
  60678. (S = v * T - A * _),
  60679. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  60680. )
  60681. return !1;
  60682. return !0;
  60683. }
  60684. return function (t, i) {
  60685. var r = t.length;
  60686. if (r < 3) return null;
  60687. var o,
  60688. a,
  60689. s,
  60690. l = [],
  60691. c = [],
  60692. h = [];
  60693. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a;
  60694. else for (a = 0; a < r; a++) c[a] = r - 1 - a;
  60695. var u = r,
  60696. d = 2 * u;
  60697. for (a = u - 1; u > 2; ) {
  60698. if (d-- <= 0)
  60699. return (
  60700. console.warn(
  60701. 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'
  60702. ),
  60703. i ? h : l
  60704. );
  60705. if (
  60706. ((o = a),
  60707. u <= o && (o = 0),
  60708. (a = o + 1),
  60709. u <= a && (a = 0),
  60710. (s = a + 1),
  60711. u <= s && (s = 0),
  60712. e(t, o, a, s, u, c))
  60713. ) {
  60714. var p, f, g, m, v;
  60715. for (
  60716. p = c[o],
  60717. f = c[a],
  60718. g = c[s],
  60719. l.push([t[p], t[f], t[g]]),
  60720. h.push([c[o], c[a], c[s]]),
  60721. m = a,
  60722. v = a + 1;
  60723. v < u;
  60724. m++, v++
  60725. )
  60726. c[m] = c[v];
  60727. u--, (d = 2 * u);
  60728. }
  60729. }
  60730. return i ? h : l;
  60731. };
  60732. })(),
  60733. triangulateShape: function (e, t) {
  60734. function i(e, t, i) {
  60735. return e.x !== t.x
  60736. ? e.x < t.x
  60737. ? e.x <= i.x && i.x <= t.x
  60738. : t.x <= i.x && i.x <= e.x
  60739. : e.y < t.y
  60740. ? e.y <= i.y && i.y <= t.y
  60741. : t.y <= i.y && i.y <= e.y;
  60742. }
  60743. function r(e, t, n, r, o) {
  60744. var a = t.x - e.x,
  60745. s = t.y - e.y,
  60746. l = r.x - n.x,
  60747. c = r.y - n.y,
  60748. h = e.x - n.x,
  60749. u = e.y - n.y,
  60750. d = s * l - a * c,
  60751. p = s * h - a * u;
  60752. if (Math.abs(d) > Number.EPSILON) {
  60753. var f;
  60754. if (d > 0) {
  60755. if (p < 0 || p > d) return [];
  60756. if (((f = c * h - l * u), f < 0 || f > d)) return [];
  60757. } else {
  60758. if (p > 0 || p < d) return [];
  60759. if (((f = c * h - l * u), f > 0 || f < d)) return [];
  60760. }
  60761. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : [];
  60762. if (f === d) return !o || (0 !== p && p !== d) ? [t] : [];
  60763. if (0 === p) return [n];
  60764. if (p === d) return [r];
  60765. var g = f / d;
  60766. return [
  60767. {
  60768. x: e.x + g * a,
  60769. y: e.y + g * s,
  60770. },
  60771. ];
  60772. }
  60773. if (0 !== p || c * h !== l * u) return [];
  60774. var m = 0 === a && 0 === s,
  60775. v = 0 === l && 0 === c;
  60776. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e];
  60777. if (m) return i(n, r, e) ? [e] : [];
  60778. if (v) return i(e, t, n) ? [n] : [];
  60779. var A, y, C, I, E, b, w, _;
  60780. return (
  60781. 0 !== a
  60782. ? (e.x < t.x
  60783. ? ((A = e), (C = e.x), (y = t), (I = t.x))
  60784. : ((A = t), (C = t.x), (y = e), (I = e.x)),
  60785. n.x < r.x
  60786. ? ((E = n), (w = n.x), (b = r), (_ = r.x))
  60787. : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  60788. : (e.y < t.y
  60789. ? ((A = e), (C = e.y), (y = t), (I = t.y))
  60790. : ((A = t), (C = t.y), (y = e), (I = e.y)),
  60791. n.y < r.y
  60792. ? ((E = n), (w = n.y), (b = r), (_ = r.y))
  60793. : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  60794. C <= w
  60795. ? I < w
  60796. ? []
  60797. : I === w
  60798. ? o
  60799. ? []
  60800. : [E]
  60801. : I <= _
  60802. ? [E, y]
  60803. : [E, b]
  60804. : C > _
  60805. ? []
  60806. : C === _
  60807. ? o
  60808. ? []
  60809. : [A]
  60810. : I <= _
  60811. ? [A, y]
  60812. : [A, b]
  60813. );
  60814. }
  60815. function o(e, t, i, n) {
  60816. var r = t.x - e.x,
  60817. o = t.y - e.y,
  60818. a = i.x - e.x,
  60819. s = i.y - e.y,
  60820. l = n.x - e.x,
  60821. c = n.y - e.y,
  60822. h = r * s - o * a,
  60823. u = r * c - o * l;
  60824. if (Math.abs(h) > Number.EPSILON) {
  60825. var d = l * s - c * a;
  60826. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0;
  60827. }
  60828. return u > 0;
  60829. }
  60830. function a(e, t) {
  60831. function i(e, t) {
  60832. var i = A.length - 1,
  60833. n = e - 1;
  60834. n < 0 && (n = i);
  60835. var r = e + 1;
  60836. r > i && (r = 0);
  60837. var a = o(A[e], A[n], A[r], s[t]);
  60838. if (!a) return !1;
  60839. var l = s.length - 1,
  60840. c = t - 1;
  60841. c < 0 && (c = l);
  60842. var h = t + 1;
  60843. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a;
  60844. }
  60845. function n(e, t) {
  60846. var i, n, o;
  60847. for (i = 0; i < A.length; i++)
  60848. if (((n = i + 1), (n %= A.length), (o = r(e, t, A[i], A[n], !0)), o.length > 0))
  60849. return !0;
  60850. return !1;
  60851. }
  60852. function a(e, i) {
  60853. var n, o, a, s, l;
  60854. for (n = 0; n < y.length; n++)
  60855. for (o = t[y[n]], a = 0; a < o.length; a++)
  60856. if (
  60857. ((s = a + 1), (s %= o.length), (l = r(e, i, o[a], o[s], !0)), l.length > 0)
  60858. )
  60859. return !0;
  60860. return !1;
  60861. }
  60862. for (
  60863. var s,
  60864. l,
  60865. c,
  60866. h,
  60867. u,
  60868. d,
  60869. p,
  60870. f,
  60871. g,
  60872. m,
  60873. v,
  60874. A = e.concat(),
  60875. y = [],
  60876. C = [],
  60877. I = 0,
  60878. E = t.length;
  60879. I < E;
  60880. I++
  60881. )
  60882. y.push(I);
  60883. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  60884. if ((w--, w < 0)) {
  60885. console.log(
  60886. 'Infinite Loop! Holes left:' + y.length + ', Probably Hole outside Shape!'
  60887. );
  60888. break;
  60889. }
  60890. for (c = b; c < A.length; c++) {
  60891. (h = A[c]), (l = -1);
  60892. for (var I = 0; I < y.length; I++)
  60893. if (((d = y[I]), (p = h.x + ':' + h.y + ':' + d), void 0 === C[p])) {
  60894. s = t[d];
  60895. for (var _ = 0; _ < s.length; _++)
  60896. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  60897. (l = _),
  60898. y.splice(I, 1),
  60899. (f = A.slice(0, c + 1)),
  60900. (g = A.slice(c)),
  60901. (m = s.slice(l)),
  60902. (v = s.slice(0, l + 1)),
  60903. (A = f.concat(m).concat(v).concat(g)),
  60904. (b = c);
  60905. break;
  60906. }
  60907. if (l >= 0) break;
  60908. C[p] = !0;
  60909. }
  60910. if (l >= 0) break;
  60911. }
  60912. }
  60913. return A;
  60914. }
  60915. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  60916. Array.prototype.push.apply(f, t[g]);
  60917. for (s = 0, l = f.length; s < l; s++)
  60918. (u = f[s].x + ':' + f[s].y),
  60919. void 0 !== p[u] && console.warn('THREE.Shape: Duplicate point', u),
  60920. (p[u] = s);
  60921. var v = a(e, t),
  60922. A = n.ShapeUtils.triangulate(v, !1);
  60923. for (s = 0, l = A.length; s < l; s++)
  60924. for (h = A[s], c = 0; c < 3; c++)
  60925. (u = h[c].x + ':' + h[c].y), (d = p[u]), void 0 !== d && (h[c] = d);
  60926. return A.concat();
  60927. },
  60928. isClockWise: function (e) {
  60929. return n.ShapeUtils.area(e) < 0;
  60930. },
  60931. b2: (function () {
  60932. function e(e, t) {
  60933. var i = 1 - e;
  60934. return i * i * t;
  60935. }
  60936. function t(e, t) {
  60937. return 2 * (1 - e) * e * t;
  60938. }
  60939. function i(e, t) {
  60940. return e * e * t;
  60941. }
  60942. return function (n, r, o, a) {
  60943. return e(n, r) + t(n, o) + i(n, a);
  60944. };
  60945. })(),
  60946. b3: (function () {
  60947. function e(e, t) {
  60948. var i = 1 - e;
  60949. return i * i * i * t;
  60950. }
  60951. function t(e, t) {
  60952. var i = 1 - e;
  60953. return 3 * i * i * e * t;
  60954. }
  60955. function i(e, t) {
  60956. var i = 1 - e;
  60957. return 3 * i * e * e * t;
  60958. }
  60959. function n(e, t) {
  60960. return e * e * e * t;
  60961. }
  60962. return function (r, o, a, s, l) {
  60963. return e(r, o) + t(r, a) + i(r, s) + n(r, l);
  60964. };
  60965. })(),
  60966. }),
  60967. (n.Curve = function () {}),
  60968. (n.Curve.prototype = {
  60969. constructor: n.Curve,
  60970. getPoint: function (e) {
  60971. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null;
  60972. },
  60973. getPointAt: function (e) {
  60974. var t = this.getUtoTmapping(e);
  60975. return this.getPoint(t);
  60976. },
  60977. getPoints: function (e) {
  60978. e || (e = 5);
  60979. var t,
  60980. i = [];
  60981. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e));
  60982. return i;
  60983. },
  60984. getSpacedPoints: function (e) {
  60985. e || (e = 5);
  60986. var t,
  60987. i = [];
  60988. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e));
  60989. return i;
  60990. },
  60991. getLength: function () {
  60992. var e = this.getLengths();
  60993. return e[e.length - 1];
  60994. },
  60995. getLengths: function (e) {
  60996. if (
  60997. (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  60998. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  60999. )
  61000. return this.cacheArcLengths;
  61001. this.needsUpdate = !1;
  61002. var t,
  61003. i,
  61004. n = [],
  61005. r = this.getPoint(0),
  61006. o = 0;
  61007. for (n.push(0), i = 1; i <= e; i++)
  61008. (t = this.getPoint(i / e)), (o += t.distanceTo(r)), n.push(o), (r = t);
  61009. return (this.cacheArcLengths = n), n;
  61010. },
  61011. updateArcLengths: function () {
  61012. (this.needsUpdate = !0), this.getLengths();
  61013. },
  61014. getUtoTmapping: function (e, t) {
  61015. var i,
  61016. n = this.getLengths(),
  61017. r = 0,
  61018. o = n.length;
  61019. i = t ? t : e * n[o - 1];
  61020. for (var a, s = 0, l = o - 1; s <= l; )
  61021. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0)) s = r + 1;
  61022. else {
  61023. if (!(a > 0)) {
  61024. l = r;
  61025. break;
  61026. }
  61027. l = r - 1;
  61028. }
  61029. if (((r = l), n[r] === i)) {
  61030. var c = r / (o - 1);
  61031. return c;
  61032. }
  61033. var h = n[r],
  61034. u = n[r + 1],
  61035. d = u - h,
  61036. p = (i - h) / d,
  61037. c = (r + p) / (o - 1);
  61038. return c;
  61039. },
  61040. getTangent: function (e) {
  61041. var t = 1e-4,
  61042. i = e - t,
  61043. n = e + t;
  61044. i < 0 && (i = 0), n > 1 && (n = 1);
  61045. var r = this.getPoint(i),
  61046. o = this.getPoint(n),
  61047. a = o.clone().sub(r);
  61048. return a.normalize();
  61049. },
  61050. getTangentAt: function (e) {
  61051. var t = this.getUtoTmapping(e);
  61052. return this.getTangent(t);
  61053. },
  61054. }),
  61055. (n.Curve.create = function (e, t) {
  61056. return (
  61057. (e.prototype = Object.create(n.Curve.prototype)),
  61058. (e.prototype.constructor = e),
  61059. (e.prototype.getPoint = t),
  61060. e
  61061. );
  61062. }),
  61063. (n.CurvePath = function () {
  61064. (this.curves = []), (this.autoClose = !1);
  61065. }),
  61066. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  61067. (n.CurvePath.prototype.constructor = n.CurvePath),
  61068. (n.CurvePath.prototype.add = function (e) {
  61069. this.curves.push(e);
  61070. }),
  61071. (n.CurvePath.prototype.closePath = function () {
  61072. var e = this.curves[0].getPoint(0),
  61073. t = this.curves[this.curves.length - 1].getPoint(1);
  61074. e.equals(t) || this.curves.push(new n.LineCurve(t, e));
  61075. }),
  61076. (n.CurvePath.prototype.getPoint = function (e) {
  61077. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  61078. if (i[n] >= t) {
  61079. var r = i[n] - t,
  61080. o = this.curves[n],
  61081. a = 1 - r / o.getLength();
  61082. return o.getPointAt(a);
  61083. }
  61084. n++;
  61085. }
  61086. return null;
  61087. }),
  61088. (n.CurvePath.prototype.getLength = function () {
  61089. var e = this.getCurveLengths();
  61090. return e[e.length - 1];
  61091. }),
  61092. (n.CurvePath.prototype.getCurveLengths = function () {
  61093. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  61094. return this.cacheLengths;
  61095. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  61096. (t += this.curves[i].getLength()), e.push(t);
  61097. return (this.cacheLengths = e), e;
  61098. }),
  61099. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  61100. var t = this.getPoints(e);
  61101. return this.createGeometry(t);
  61102. }),
  61103. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  61104. var t = this.getSpacedPoints(e);
  61105. return this.createGeometry(t);
  61106. }),
  61107. (n.CurvePath.prototype.createGeometry = function (e) {
  61108. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  61109. var o = e[i];
  61110. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0));
  61111. }
  61112. return t;
  61113. }),
  61114. (n.Font = function (e) {
  61115. this.data = e;
  61116. }),
  61117. (n.Font.prototype = {
  61118. constructor: n.Font,
  61119. generateShapes: function (e, t, i) {
  61120. function r(e) {
  61121. for (
  61122. var i = String(e).split(''), n = t / a.resolution, r = 0, s = [], l = 0;
  61123. l < i.length;
  61124. l++
  61125. ) {
  61126. var c = o(i[l], n, r);
  61127. (r += c.offset), s.push(c.path);
  61128. }
  61129. return s;
  61130. }
  61131. function o(e, t, r) {
  61132. var o = a.glyphs[e] || a.glyphs['?'];
  61133. if (o) {
  61134. var s,
  61135. l,
  61136. c,
  61137. h,
  61138. u,
  61139. d,
  61140. p,
  61141. f,
  61142. g,
  61143. m,
  61144. v,
  61145. A = new n.Path(),
  61146. y = [],
  61147. C = n.ShapeUtils.b2,
  61148. I = n.ShapeUtils.b3;
  61149. if (o.o)
  61150. for (
  61151. var E = o._cachedOutline || (o._cachedOutline = o.o.split(' ')),
  61152. b = 0,
  61153. w = E.length;
  61154. b < w;
  61155. ) {
  61156. var _ = E[b++];
  61157. switch (_) {
  61158. case 'm':
  61159. (s = E[b++] * t + r), (l = E[b++] * t), A.moveTo(s, l);
  61160. break;
  61161. case 'l':
  61162. (s = E[b++] * t + r), (l = E[b++] * t), A.lineTo(s, l);
  61163. break;
  61164. case 'q':
  61165. if (
  61166. ((c = E[b++] * t + r),
  61167. (h = E[b++] * t),
  61168. (p = E[b++] * t + r),
  61169. (f = E[b++] * t),
  61170. A.quadraticCurveTo(p, f, c, h),
  61171. (v = y[y.length - 1]))
  61172. ) {
  61173. (u = v.x), (d = v.y);
  61174. for (var T = 1; T <= i; T++) {
  61175. var x = T / i;
  61176. C(x, u, p, c), C(x, d, f, h);
  61177. }
  61178. }
  61179. break;
  61180. case 'b':
  61181. if (
  61182. ((c = E[b++] * t + r),
  61183. (h = E[b++] * t),
  61184. (p = E[b++] * t + r),
  61185. (f = E[b++] * t),
  61186. (g = E[b++] * t + r),
  61187. (m = E[b++] * t),
  61188. A.bezierCurveTo(p, f, g, m, c, h),
  61189. (v = y[y.length - 1]))
  61190. ) {
  61191. (u = v.x), (d = v.y);
  61192. for (var T = 1; T <= i; T++) {
  61193. var x = T / i;
  61194. I(x, u, p, g, c), I(x, d, f, m, h);
  61195. }
  61196. }
  61197. }
  61198. }
  61199. return {
  61200. offset: o.ha * t,
  61201. path: A,
  61202. };
  61203. }
  61204. }
  61205. void 0 === t && (t = 100), void 0 === i && (i = 4);
  61206. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  61207. Array.prototype.push.apply(l, s[c].toShapes());
  61208. return l;
  61209. },
  61210. }),
  61211. (n.Path = function (e) {
  61212. n.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e);
  61213. }),
  61214. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  61215. (n.Path.prototype.constructor = n.Path),
  61216. (n.Path.prototype.fromPoints = function (e) {
  61217. this.moveTo(e[0].x, e[0].y);
  61218. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y);
  61219. }),
  61220. (n.Path.prototype.moveTo = function (e, t) {
  61221. this.actions.push({
  61222. action: 'moveTo',
  61223. args: [e, t],
  61224. });
  61225. }),
  61226. (n.Path.prototype.lineTo = function (e, t) {
  61227. var i = this.actions[this.actions.length - 1].args,
  61228. r = i[i.length - 2],
  61229. o = i[i.length - 1],
  61230. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t));
  61231. this.curves.push(a),
  61232. this.actions.push({
  61233. action: 'lineTo',
  61234. args: [e, t],
  61235. });
  61236. }),
  61237. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  61238. var o = this.actions[this.actions.length - 1].args,
  61239. a = o[o.length - 2],
  61240. s = o[o.length - 1],
  61241. l = new n.QuadraticBezierCurve(
  61242. new n.Vector2(a, s),
  61243. new n.Vector2(e, t),
  61244. new n.Vector2(i, r)
  61245. );
  61246. this.curves.push(l),
  61247. this.actions.push({
  61248. action: 'quadraticCurveTo',
  61249. args: [e, t, i, r],
  61250. });
  61251. }),
  61252. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  61253. var s = this.actions[this.actions.length - 1].args,
  61254. l = s[s.length - 2],
  61255. c = s[s.length - 1],
  61256. h = new n.CubicBezierCurve(
  61257. new n.Vector2(l, c),
  61258. new n.Vector2(e, t),
  61259. new n.Vector2(i, r),
  61260. new n.Vector2(o, a)
  61261. );
  61262. this.curves.push(h),
  61263. this.actions.push({
  61264. action: 'bezierCurveTo',
  61265. args: [e, t, i, r, o, a],
  61266. });
  61267. }),
  61268. (n.Path.prototype.splineThru = function (e) {
  61269. var t = Array.prototype.slice.call(arguments),
  61270. i = this.actions[this.actions.length - 1].args,
  61271. r = i[i.length - 2],
  61272. o = i[i.length - 1],
  61273. a = [new n.Vector2(r, o)];
  61274. Array.prototype.push.apply(a, e);
  61275. var s = new n.SplineCurve(a);
  61276. this.curves.push(s),
  61277. this.actions.push({
  61278. action: 'splineThru',
  61279. args: t,
  61280. });
  61281. }),
  61282. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  61283. var a = this.actions[this.actions.length - 1].args,
  61284. s = a[a.length - 2],
  61285. l = a[a.length - 1];
  61286. this.absarc(e + s, t + l, i, n, r, o);
  61287. }),
  61288. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  61289. this.absellipse(e, t, i, i, n, r, o);
  61290. }),
  61291. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  61292. var l = this.actions[this.actions.length - 1].args,
  61293. c = l[l.length - 2],
  61294. h = l[l.length - 1];
  61295. this.absellipse(e + c, t + h, i, n, r, o, a, s);
  61296. }),
  61297. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  61298. var c = [e, t, i, r, o, a, s, l || 0],
  61299. h = new n.EllipseCurve(e, t, i, r, o, a, s, l);
  61300. this.curves.push(h);
  61301. var u = h.getPoint(1);
  61302. c.push(u.x),
  61303. c.push(u.y),
  61304. this.actions.push({
  61305. action: 'ellipse',
  61306. args: c,
  61307. });
  61308. }),
  61309. (n.Path.prototype.getSpacedPoints = function (e) {
  61310. e || (e = 40);
  61311. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e));
  61312. return this.autoClose && t.push(t[0]), t;
  61313. }),
  61314. (n.Path.prototype.getPoints = function (e) {
  61315. e = e || 12;
  61316. for (
  61317. var t,
  61318. i,
  61319. r,
  61320. o,
  61321. a,
  61322. s,
  61323. l,
  61324. c,
  61325. h,
  61326. u,
  61327. d,
  61328. p = n.ShapeUtils.b2,
  61329. f = n.ShapeUtils.b3,
  61330. g = [],
  61331. m = 0,
  61332. v = this.actions.length;
  61333. m < v;
  61334. m++
  61335. ) {
  61336. var A = this.actions[m],
  61337. y = A.action,
  61338. C = A.args;
  61339. switch (y) {
  61340. case 'moveTo':
  61341. g.push(new n.Vector2(C[0], C[1]));
  61342. break;
  61343. case 'lineTo':
  61344. g.push(new n.Vector2(C[0], C[1]));
  61345. break;
  61346. case 'quadraticCurveTo':
  61347. (t = C[2]),
  61348. (i = C[3]),
  61349. (a = C[0]),
  61350. (s = C[1]),
  61351. g.length > 0
  61352. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61353. : ((h = this.actions[m - 1].args),
  61354. (l = h[h.length - 2]),
  61355. (c = h[h.length - 1]));
  61356. for (var I = 1; I <= e; I++) {
  61357. var E = I / e;
  61358. (u = p(E, l, a, t)), (d = p(E, c, s, i)), g.push(new n.Vector2(u, d));
  61359. }
  61360. break;
  61361. case 'bezierCurveTo':
  61362. (t = C[4]),
  61363. (i = C[5]),
  61364. (a = C[0]),
  61365. (s = C[1]),
  61366. (r = C[2]),
  61367. (o = C[3]),
  61368. g.length > 0
  61369. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61370. : ((h = this.actions[m - 1].args),
  61371. (l = h[h.length - 2]),
  61372. (c = h[h.length - 1]));
  61373. for (var I = 1; I <= e; I++) {
  61374. var E = I / e;
  61375. (u = f(E, l, a, r, t)), (d = f(E, c, s, o, i)), g.push(new n.Vector2(u, d));
  61376. }
  61377. break;
  61378. case 'splineThru':
  61379. h = this.actions[m - 1].args;
  61380. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  61381. w = [b],
  61382. _ = e * C[0].length;
  61383. w = w.concat(C[0]);
  61384. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  61385. g.push(T.getPointAt(I / _));
  61386. break;
  61387. case 'arc':
  61388. for (
  61389. var x,
  61390. S = C[0],
  61391. M = C[1],
  61392. R = C[2],
  61393. P = C[3],
  61394. O = C[4],
  61395. L = !!C[5],
  61396. D = O - P,
  61397. N = 2 * e,
  61398. I = 1;
  61399. I <= N;
  61400. I++
  61401. ) {
  61402. var E = I / N;
  61403. L || (E = 1 - E),
  61404. (x = P + E * D),
  61405. (u = S + R * Math.cos(x)),
  61406. (d = M + R * Math.sin(x)),
  61407. g.push(new n.Vector2(u, d));
  61408. }
  61409. break;
  61410. case 'ellipse':
  61411. var x,
  61412. B,
  61413. F,
  61414. S = C[0],
  61415. M = C[1],
  61416. V = C[2],
  61417. U = C[3],
  61418. P = C[4],
  61419. O = C[5],
  61420. L = !!C[6],
  61421. k = C[7],
  61422. D = O - P,
  61423. N = 2 * e;
  61424. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)));
  61425. for (var I = 1; I <= N; I++) {
  61426. var E = I / N;
  61427. if (
  61428. (L || (E = 1 - E),
  61429. (x = P + E * D),
  61430. (u = S + V * Math.cos(x)),
  61431. (d = M + U * Math.sin(x)),
  61432. 0 !== k)
  61433. ) {
  61434. var H = u,
  61435. G = d;
  61436. (u = (H - S) * B - (G - M) * F + S), (d = (H - S) * F + (G - M) * B + M);
  61437. }
  61438. g.push(new n.Vector2(u, d));
  61439. }
  61440. }
  61441. }
  61442. var z = g[g.length - 1];
  61443. return (
  61444. Math.abs(z.x - g[0].x) < Number.EPSILON &&
  61445. Math.abs(z.y - g[0].y) < Number.EPSILON &&
  61446. g.splice(g.length - 1, 1),
  61447. this.autoClose && g.push(g[0]),
  61448. g
  61449. );
  61450. }),
  61451. (n.Path.prototype.toShapes = function (e, t) {
  61452. function i(e) {
  61453. for (var t = [], i = new n.Path(), r = 0, o = e.length; r < o; r++) {
  61454. var a = e[r],
  61455. s = a.args,
  61456. l = a.action;
  61457. 'moveTo' === l && 0 !== i.actions.length && (t.push(i), (i = new n.Path())),
  61458. i[l].apply(i, s);
  61459. }
  61460. return 0 !== i.actions.length && t.push(i), t;
  61461. }
  61462. function r(e) {
  61463. for (var t = [], i = 0, r = e.length; i < r; i++) {
  61464. var o = e[i],
  61465. a = new n.Shape();
  61466. (a.actions = o.actions), (a.curves = o.curves), t.push(a);
  61467. }
  61468. return t;
  61469. }
  61470. function o(e, t) {
  61471. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  61472. var a = t[r],
  61473. s = t[o],
  61474. l = s.x - a.x,
  61475. c = s.y - a.y;
  61476. if (Math.abs(c) > Number.EPSILON) {
  61477. if (
  61478. (c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)
  61479. )
  61480. continue;
  61481. if (e.y === a.y) {
  61482. if (e.x === a.x) return !0;
  61483. } else {
  61484. var h = c * (e.x - a.x) - l * (e.y - a.y);
  61485. if (0 === h) return !0;
  61486. if (h < 0) continue;
  61487. n = !n;
  61488. }
  61489. } else {
  61490. if (e.y !== a.y) continue;
  61491. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0;
  61492. }
  61493. }
  61494. return n;
  61495. }
  61496. var a = n.ShapeUtils.isClockWise,
  61497. s = i(this.actions);
  61498. if (0 === s.length) return [];
  61499. if (t === !0) return r(s);
  61500. var l,
  61501. c,
  61502. h,
  61503. u = [];
  61504. if (1 === s.length)
  61505. return (
  61506. (c = s[0]),
  61507. (h = new n.Shape()),
  61508. (h.actions = c.actions),
  61509. (h.curves = c.curves),
  61510. u.push(h),
  61511. u
  61512. );
  61513. var d = !a(s[0].getPoints());
  61514. d = e ? !d : d;
  61515. var p,
  61516. f = [],
  61517. g = [],
  61518. m = [],
  61519. v = 0;
  61520. (g[v] = void 0), (m[v] = []);
  61521. for (var A = 0, y = s.length; A < y; A++)
  61522. (c = s[A]),
  61523. (p = c.getPoints()),
  61524. (l = a(p)),
  61525. (l = e ? !l : l),
  61526. l
  61527. ? (!d && g[v] && v++,
  61528. (g[v] = {
  61529. s: new n.Shape(),
  61530. p: p,
  61531. }),
  61532. (g[v].s.actions = c.actions),
  61533. (g[v].s.curves = c.curves),
  61534. d && v++,
  61535. (m[v] = []))
  61536. : m[v].push({
  61537. h: c,
  61538. p: p[0],
  61539. });
  61540. if (!g[0]) return r(s);
  61541. if (g.length > 1) {
  61542. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++) f[E] = [];
  61543. for (var E = 0, b = g.length; E < b; E++)
  61544. for (var w = m[E], _ = 0; _ < w.length; _++) {
  61545. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  61546. o(T.p, g[S].p) &&
  61547. (E !== S &&
  61548. I.push({
  61549. froms: E,
  61550. tos: S,
  61551. hole: _,
  61552. }),
  61553. x ? ((x = !1), f[S].push(T)) : (C = !0));
  61554. x && f[E].push(T);
  61555. }
  61556. I.length > 0 && (C || (m = f));
  61557. }
  61558. for (var M, A = 0, R = g.length; A < R; A++) {
  61559. (h = g[A].s), u.push(h), (M = m[A]);
  61560. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h);
  61561. }
  61562. return u;
  61563. }),
  61564. (n.Shape = function () {
  61565. n.Path.apply(this, arguments), (this.holes = []);
  61566. }),
  61567. (n.Shape.prototype = Object.create(n.Path.prototype)),
  61568. (n.Shape.prototype.constructor = n.Shape),
  61569. (n.Shape.prototype.extrude = function (e) {
  61570. return new n.ExtrudeGeometry(this, e);
  61571. }),
  61572. (n.Shape.prototype.makeGeometry = function (e) {
  61573. return new n.ShapeGeometry(this, e);
  61574. }),
  61575. (n.Shape.prototype.getPointsHoles = function (e) {
  61576. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  61577. t[i] = this.holes[i].getPoints(e);
  61578. return t;
  61579. }),
  61580. (n.Shape.prototype.extractAllPoints = function (e) {
  61581. return {
  61582. shape: this.getPoints(e),
  61583. holes: this.getPointsHoles(e),
  61584. };
  61585. }),
  61586. (n.Shape.prototype.extractPoints = function (e) {
  61587. return this.extractAllPoints(e);
  61588. }),
  61589. (n.LineCurve = function (e, t) {
  61590. (this.v1 = e), (this.v2 = t);
  61591. }),
  61592. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  61593. (n.LineCurve.prototype.constructor = n.LineCurve),
  61594. (n.LineCurve.prototype.getPoint = function (e) {
  61595. var t = this.v2.clone().sub(this.v1);
  61596. return t.multiplyScalar(e).add(this.v1), t;
  61597. }),
  61598. (n.LineCurve.prototype.getPointAt = function (e) {
  61599. return this.getPoint(e);
  61600. }),
  61601. (n.LineCurve.prototype.getTangent = function (e) {
  61602. var t = this.v2.clone().sub(this.v1);
  61603. return t.normalize();
  61604. }),
  61605. (n.QuadraticBezierCurve = function (e, t, i) {
  61606. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  61607. }),
  61608. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61609. (n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve),
  61610. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  61611. var t = n.ShapeUtils.b2;
  61612. return new n.Vector2(
  61613. t(e, this.v0.x, this.v1.x, this.v2.x),
  61614. t(e, this.v0.y, this.v1.y, this.v2.y)
  61615. );
  61616. }),
  61617. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  61618. var t = n.CurveUtils.tangentQuadraticBezier;
  61619. return new n.Vector2(
  61620. t(e, this.v0.x, this.v1.x, this.v2.x),
  61621. t(e, this.v0.y, this.v1.y, this.v2.y)
  61622. ).normalize();
  61623. }),
  61624. (n.CubicBezierCurve = function (e, t, i, n) {
  61625. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  61626. }),
  61627. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61628. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  61629. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  61630. var t = n.ShapeUtils.b3;
  61631. return new n.Vector2(
  61632. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61633. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61634. );
  61635. }),
  61636. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  61637. var t = n.CurveUtils.tangentCubicBezier;
  61638. return new n.Vector2(
  61639. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61640. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61641. ).normalize();
  61642. }),
  61643. (n.SplineCurve = function (e) {
  61644. this.points = void 0 == e ? [] : e;
  61645. }),
  61646. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  61647. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  61648. (n.SplineCurve.prototype.getPoint = function (e) {
  61649. var t = this.points,
  61650. i = (t.length - 1) * e,
  61651. r = Math.floor(i),
  61652. o = i - r,
  61653. a = t[0 === r ? r : r - 1],
  61654. s = t[r],
  61655. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61656. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61657. h = n.CurveUtils.interpolate;
  61658. return new n.Vector2(h(a.x, s.x, l.x, c.x, o), h(a.y, s.y, l.y, c.y, o));
  61659. }),
  61660. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  61661. (this.aX = e),
  61662. (this.aY = t),
  61663. (this.xRadius = i),
  61664. (this.yRadius = n),
  61665. (this.aStartAngle = r),
  61666. (this.aEndAngle = o),
  61667. (this.aClockwise = a),
  61668. (this.aRotation = s || 0);
  61669. }),
  61670. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  61671. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  61672. (n.EllipseCurve.prototype.getPoint = function (e) {
  61673. var t = this.aEndAngle - this.aStartAngle;
  61674. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI);
  61675. var i;
  61676. i =
  61677. this.aClockwise === !0
  61678. ? this.aEndAngle + (1 - e) * (2 * Math.PI - t)
  61679. : this.aStartAngle + e * t;
  61680. var r = this.aX + this.xRadius * Math.cos(i),
  61681. o = this.aY + this.yRadius * Math.sin(i);
  61682. if (0 !== this.aRotation) {
  61683. var a = Math.cos(this.aRotation),
  61684. s = Math.sin(this.aRotation),
  61685. l = r,
  61686. c = o;
  61687. (r = (l - this.aX) * a - (c - this.aY) * s + this.aX),
  61688. (o = (l - this.aX) * s + (c - this.aY) * a + this.aY);
  61689. }
  61690. return new n.Vector2(r, o);
  61691. }),
  61692. (n.ArcCurve = function (e, t, i, r, o, a) {
  61693. n.EllipseCurve.call(this, e, t, i, i, r, o, a);
  61694. }),
  61695. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  61696. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  61697. (n.LineCurve3 = n.Curve.create(
  61698. function (e, t) {
  61699. (this.v1 = e), (this.v2 = t);
  61700. },
  61701. function (e) {
  61702. var t = new n.Vector3();
  61703. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t;
  61704. }
  61705. )),
  61706. (n.QuadraticBezierCurve3 = n.Curve.create(
  61707. function (e, t, i) {
  61708. (this.v0 = e), (this.v1 = t), (this.v2 = i);
  61709. },
  61710. function (e) {
  61711. var t = n.ShapeUtils.b2;
  61712. return new n.Vector3(
  61713. t(e, this.v0.x, this.v1.x, this.v2.x),
  61714. t(e, this.v0.y, this.v1.y, this.v2.y),
  61715. t(e, this.v0.z, this.v1.z, this.v2.z)
  61716. );
  61717. }
  61718. )),
  61719. (n.CubicBezierCurve3 = n.Curve.create(
  61720. function (e, t, i, n) {
  61721. (this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n);
  61722. },
  61723. function (e) {
  61724. var t = n.ShapeUtils.b3;
  61725. return new n.Vector3(
  61726. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61727. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),
  61728. t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z)
  61729. );
  61730. }
  61731. )),
  61732. (n.SplineCurve3 = n.Curve.create(
  61733. function (e) {
  61734. console.warn(
  61735. 'THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'
  61736. ),
  61737. (this.points = void 0 == e ? [] : e);
  61738. },
  61739. function (e) {
  61740. var t = this.points,
  61741. i = (t.length - 1) * e,
  61742. r = Math.floor(i),
  61743. o = i - r,
  61744. a = t[0 == r ? r : r - 1],
  61745. s = t[r],
  61746. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61747. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61748. h = n.CurveUtils.interpolate;
  61749. return new n.Vector3(
  61750. h(a.x, s.x, l.x, c.x, o),
  61751. h(a.y, s.y, l.y, c.y, o),
  61752. h(a.z, s.z, l.z, c.z, o)
  61753. );
  61754. }
  61755. )),
  61756. (n.CatmullRomCurve3 = (function () {
  61757. function e() {}
  61758. var t = new n.Vector3(),
  61759. i = new e(),
  61760. r = new e(),
  61761. o = new e();
  61762. return (
  61763. (e.prototype.init = function (e, t, i, n) {
  61764. (this.c0 = e),
  61765. (this.c1 = i),
  61766. (this.c2 = -3 * e + 3 * t - 2 * i - n),
  61767. (this.c3 = 2 * e - 2 * t + i + n);
  61768. }),
  61769. (e.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  61770. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  61771. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  61772. (s *= o), (l *= o), this.init(t, i, s, l);
  61773. }),
  61774. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  61775. this.init(t, i, r * (i - e), r * (n - t));
  61776. }),
  61777. (e.prototype.calc = function (e) {
  61778. var t = e * e,
  61779. i = t * e;
  61780. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i;
  61781. }),
  61782. n.Curve.create(
  61783. function (e) {
  61784. (this.points = e || []), (this.closed = !1);
  61785. },
  61786. function (e) {
  61787. var a,
  61788. s,
  61789. l,
  61790. c,
  61791. h = this.points;
  61792. (c = h.length),
  61793. c < 2 && console.log('duh, you need at least 2 points'),
  61794. (a = (c - (this.closed ? 0 : 1)) * e),
  61795. (s = Math.floor(a)),
  61796. (l = a - s),
  61797. this.closed
  61798. ? (s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length)
  61799. : 0 === l && s === c - 1 && ((s = c - 2), (l = 1));
  61800. var u, d, p, f;
  61801. if (
  61802. (this.closed || s > 0
  61803. ? (u = h[(s - 1) % c])
  61804. : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  61805. (d = h[s % c]),
  61806. (p = h[(s + 1) % c]),
  61807. this.closed || s + 2 < c
  61808. ? (f = h[(s + 2) % c])
  61809. : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]), (f = t)),
  61810. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  61811. ) {
  61812. var g = 'chordal' === this.type ? 0.5 : 0.25,
  61813. m = Math.pow(u.distanceToSquared(d), g),
  61814. v = Math.pow(d.distanceToSquared(p), g),
  61815. A = Math.pow(p.distanceToSquared(f), g);
  61816. v < 1e-4 && (v = 1),
  61817. m < 1e-4 && (m = v),
  61818. A < 1e-4 && (A = v),
  61819. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  61820. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  61821. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A);
  61822. } else if ('catmullrom' === this.type) {
  61823. var y = void 0 !== this.tension ? this.tension : 0.5;
  61824. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  61825. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  61826. o.initCatmullRom(u.z, d.z, p.z, f.z, y);
  61827. }
  61828. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l));
  61829. return C;
  61830. }
  61831. )
  61832. );
  61833. })()),
  61834. (n.ClosedSplineCurve3 = function (e) {
  61835. console.warn(
  61836. 'THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'
  61837. ),
  61838. n.CatmullRomCurve3.call(this, e),
  61839. (this.type = 'catmullrom'),
  61840. (this.closed = !0);
  61841. }),
  61842. (n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype)),
  61843. (n.BoxGeometry = function (e, t, i, r, o, a) {
  61844. n.Geometry.call(this),
  61845. (this.type = 'BoxGeometry'),
  61846. (this.parameters = {
  61847. width: e,
  61848. height: t,
  61849. depth: i,
  61850. widthSegments: r,
  61851. heightSegments: o,
  61852. depthSegments: a,
  61853. }),
  61854. this.fromBufferGeometry(new n.BoxBufferGeometry(e, t, i, r, o, a)),
  61855. this.mergeVertices();
  61856. }),
  61857. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  61858. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  61859. (n.CubeGeometry = n.BoxGeometry),
  61860. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  61861. function s(e, t, i) {
  61862. var n = 0;
  61863. return (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n;
  61864. }
  61865. function l(e, t, i, r, o, a, s, l, h, u, I) {
  61866. for (
  61867. var E = a / h,
  61868. b = s / u,
  61869. w = a / 2,
  61870. _ = s / 2,
  61871. T = l / 2,
  61872. x = h + 1,
  61873. S = u + 1,
  61874. M = 0,
  61875. R = 0,
  61876. P = new n.Vector3(),
  61877. O = 0;
  61878. O < S;
  61879. O++
  61880. )
  61881. for (var L = O * b - _, D = 0; D < x; D++) {
  61882. var N = D * E - w;
  61883. (P[e] = N * r),
  61884. (P[t] = L * o),
  61885. (P[i] = T),
  61886. (p[m] = P.x),
  61887. (p[m + 1] = P.y),
  61888. (p[m + 2] = P.z),
  61889. (P[e] = 0),
  61890. (P[t] = 0),
  61891. (P[i] = l > 0 ? 1 : -1),
  61892. (f[m] = P.x),
  61893. (f[m + 1] = P.y),
  61894. (f[m + 2] = P.z),
  61895. (g[v] = D / h),
  61896. (g[v + 1] = 1 - O / u),
  61897. (m += 3),
  61898. (v += 2),
  61899. (M += 1);
  61900. }
  61901. for (O = 0; O < u; O++)
  61902. for (D = 0; D < h; D++) {
  61903. var B = y + D + x * O,
  61904. F = y + D + x * (O + 1),
  61905. V = y + (D + 1) + x * (O + 1),
  61906. U = y + (D + 1) + x * O;
  61907. (d[A] = B),
  61908. (d[A + 1] = F),
  61909. (d[A + 2] = U),
  61910. (d[A + 3] = F),
  61911. (d[A + 4] = V),
  61912. (d[A + 5] = U),
  61913. (A += 6),
  61914. (R += 6);
  61915. }
  61916. c.addGroup(C, R, I), (C += R), (y += M);
  61917. }
  61918. n.BufferGeometry.call(this),
  61919. (this.type = 'BoxBufferGeometry'),
  61920. (this.parameters = {
  61921. width: e,
  61922. height: t,
  61923. depth: i,
  61924. widthSegments: r,
  61925. heightSegments: o,
  61926. depthSegments: a,
  61927. });
  61928. var c = this;
  61929. (r = Math.floor(r) || 1), (o = Math.floor(o) || 1), (a = Math.floor(a) || 1);
  61930. var h = s(r, o, a),
  61931. u = (h / 4) * 6,
  61932. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  61933. p = new Float32Array(3 * h),
  61934. f = new Float32Array(3 * h),
  61935. g = new Float32Array(2 * h),
  61936. m = 0,
  61937. v = 0,
  61938. A = 0,
  61939. y = 0,
  61940. C = 0;
  61941. l('z', 'y', 'x', -1, -1, i, t, e, a, o, 0),
  61942. l('z', 'y', 'x', 1, -1, i, t, -e, a, o, 1),
  61943. l('x', 'z', 'y', 1, 1, e, i, t, r, a, 2),
  61944. l('x', 'z', 'y', 1, -1, e, i, -t, r, a, 3),
  61945. l('x', 'y', 'z', 1, -1, e, t, i, r, o, 4),
  61946. l('x', 'y', 'z', -1, -1, e, t, -i, r, o, 5),
  61947. this.setIndex(new n.BufferAttribute(d, 1)),
  61948. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  61949. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  61950. this.addAttribute('uv', new n.BufferAttribute(g, 2));
  61951. }),
  61952. (n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  61953. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  61954. (n.CircleGeometry = function (e, t, i, r) {
  61955. n.Geometry.call(this),
  61956. (this.type = 'CircleGeometry'),
  61957. (this.parameters = {
  61958. radius: e,
  61959. segments: t,
  61960. thetaStart: i,
  61961. thetaLength: r,
  61962. }),
  61963. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r));
  61964. }),
  61965. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  61966. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  61967. (n.CircleBufferGeometry = function (e, t, i, r) {
  61968. n.BufferGeometry.call(this),
  61969. (this.type = 'CircleBufferGeometry'),
  61970. (this.parameters = {
  61971. radius: e,
  61972. segments: t,
  61973. thetaStart: i,
  61974. thetaLength: r,
  61975. }),
  61976. (e = e || 50),
  61977. (t = void 0 !== t ? Math.max(3, t) : 8),
  61978. (i = void 0 !== i ? i : 0),
  61979. (r = void 0 !== r ? r : 2 * Math.PI);
  61980. var o = t + 2,
  61981. a = new Float32Array(3 * o),
  61982. s = new Float32Array(3 * o),
  61983. l = new Float32Array(2 * o);
  61984. (s[2] = 1), (l[0] = 0.5), (l[1] = 0.5);
  61985. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  61986. var d = i + (c / t) * r;
  61987. (a[h] = e * Math.cos(d)),
  61988. (a[h + 1] = e * Math.sin(d)),
  61989. (s[h + 2] = 1),
  61990. (l[u] = (a[h] / e + 1) / 2),
  61991. (l[u + 1] = (a[h + 1] / e + 1) / 2);
  61992. }
  61993. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0);
  61994. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  61995. this.addAttribute('position', new n.BufferAttribute(a, 3)),
  61996. this.addAttribute('normal', new n.BufferAttribute(s, 3)),
  61997. this.addAttribute('uv', new n.BufferAttribute(l, 2)),
  61998. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  61999. }),
  62000. (n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62001. (n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry),
  62002. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  62003. function c() {
  62004. var e = (r + 1) * (o + 1);
  62005. return a === !1 && (e += 2 * (r + 1) + 2 * r), e;
  62006. }
  62007. function h() {
  62008. var e = r * o * 2 * 3;
  62009. return a === !1 && (e += 2 * r * 3), e;
  62010. }
  62011. function u() {
  62012. var a,
  62013. c,
  62014. h = new n.Vector3(),
  62015. u = new n.Vector3(),
  62016. d = (t - e) / i;
  62017. for (c = 0; c <= o; c++) {
  62018. var p = [],
  62019. f = c / o,
  62020. b = f * (t - e) + e;
  62021. for (a = 0; a <= r; a++) {
  62022. var w = a / r;
  62023. (u.x = b * Math.sin(w * l + s)),
  62024. (u.y = -f * i + E),
  62025. (u.z = b * Math.cos(w * l + s)),
  62026. m.setXYZ(y, u.x, u.y, u.z),
  62027. h.copy(u),
  62028. ((0 === e && 0 === c) || (0 === t && c === o)) &&
  62029. ((h.x = Math.sin(w * l + s)), (h.z = Math.cos(w * l + s))),
  62030. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  62031. v.setXYZ(y, h.x, h.y, h.z),
  62032. A.setXY(y, w, 1 - f),
  62033. p.push(y),
  62034. y++;
  62035. }
  62036. I.push(p);
  62037. }
  62038. for (a = 0; a < r; a++)
  62039. for (c = 0; c < o; c++) {
  62040. var _ = I[c][a],
  62041. T = I[c + 1][a],
  62042. x = I[c + 1][a + 1],
  62043. S = I[c][a + 1];
  62044. g.setX(C, _),
  62045. C++,
  62046. g.setX(C, T),
  62047. C++,
  62048. g.setX(C, S),
  62049. C++,
  62050. g.setX(C, T),
  62051. C++,
  62052. g.setX(C, x),
  62053. C++,
  62054. g.setX(C, S),
  62055. C++;
  62056. }
  62057. }
  62058. function d(i) {
  62059. var o,
  62060. a,
  62061. c,
  62062. h = new n.Vector2(),
  62063. u = new n.Vector3(),
  62064. d = i === !0 ? e : t,
  62065. p = i === !0 ? 1 : -1;
  62066. for (a = y, o = 1; o <= r; o++)
  62067. m.setXYZ(y, 0, E * p, 0),
  62068. v.setXYZ(y, 0, p, 0),
  62069. i === !0 ? ((h.x = o / r), (h.y = 0)) : ((h.x = (o - 1) / r), (h.y = 1)),
  62070. A.setXY(y, h.x, h.y),
  62071. y++;
  62072. for (c = y, o = 0; o <= r; o++) {
  62073. var f = o / r;
  62074. (u.x = d * Math.sin(f * l + s)),
  62075. (u.y = E * p),
  62076. (u.z = d * Math.cos(f * l + s)),
  62077. m.setXYZ(y, u.x, u.y, u.z),
  62078. v.setXYZ(y, 0, p, 0),
  62079. A.setXY(y, f, i === !0 ? 1 : 0),
  62080. y++;
  62081. }
  62082. for (o = 0; o < r; o++) {
  62083. var I = a + o,
  62084. b = c + o;
  62085. i === !0
  62086. ? (g.setX(C, b), C++, g.setX(C, b + 1), C++, g.setX(C, I), C++)
  62087. : (g.setX(C, b + 1), C++, g.setX(C, b), C++, g.setX(C, I), C++);
  62088. }
  62089. }
  62090. n.BufferGeometry.call(this),
  62091. (this.type = 'CylinderBufferGeometry'),
  62092. (this.parameters = {
  62093. radiusTop: e,
  62094. radiusBottom: t,
  62095. height: i,
  62096. radialSegments: r,
  62097. heightSegments: o,
  62098. openEnded: a,
  62099. thetaStart: s,
  62100. thetaLength: l,
  62101. }),
  62102. (e = void 0 !== e ? e : 20),
  62103. (t = void 0 !== t ? t : 20),
  62104. (i = void 0 !== i ? i : 100),
  62105. (r = Math.floor(r) || 8),
  62106. (o = Math.floor(o) || 1),
  62107. (a = void 0 !== a && a),
  62108. (s = void 0 !== s ? s : 0),
  62109. (l = void 0 !== l ? l : 2 * Math.PI);
  62110. var p = c(),
  62111. f = h(),
  62112. g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f), 1),
  62113. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62114. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62115. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  62116. y = 0,
  62117. C = 0,
  62118. I = [],
  62119. E = i / 2;
  62120. u(),
  62121. a === !1 && (e > 0 && d(!0), t > 0 && d(!1)),
  62122. this.setIndex(g),
  62123. this.addAttribute('position', m),
  62124. this.addAttribute('normal', v),
  62125. this.addAttribute('uv', A);
  62126. }),
  62127. (n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62128. (n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry),
  62129. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  62130. n.Geometry.call(this),
  62131. (this.type = 'CylinderGeometry'),
  62132. (this.parameters = {
  62133. radiusTop: e,
  62134. radiusBottom: t,
  62135. height: i,
  62136. radialSegments: r,
  62137. heightSegments: o,
  62138. openEnded: a,
  62139. thetaStart: s,
  62140. thetaLength: l,
  62141. }),
  62142. this.fromBufferGeometry(new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)),
  62143. this.mergeVertices();
  62144. }),
  62145. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  62146. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  62147. (n.EdgesGeometry = function (e, t) {
  62148. function i(e, t) {
  62149. return e - t;
  62150. }
  62151. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1);
  62152. var r,
  62153. o = Math.cos(n.Math.degToRad(t)),
  62154. a = [0, 0],
  62155. s = {},
  62156. l = ['a', 'b', 'c'];
  62157. e instanceof n.BufferGeometry
  62158. ? ((r = new n.Geometry()), r.fromBufferGeometry(e))
  62159. : (r = e.clone()),
  62160. r.mergeVertices(),
  62161. r.computeFaceNormals();
  62162. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  62163. for (var p = h[u], f = 0; f < 3; f++) {
  62164. (a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i);
  62165. var g = a.toString();
  62166. void 0 === s[g]
  62167. ? (s[g] = {
  62168. vert1: a[0],
  62169. vert2: a[1],
  62170. face1: u,
  62171. face2: void 0,
  62172. })
  62173. : (s[g].face2 = u);
  62174. }
  62175. var m = [];
  62176. for (var g in s) {
  62177. var v = s[g];
  62178. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  62179. var A = c[v.vert1];
  62180. m.push(A.x),
  62181. m.push(A.y),
  62182. m.push(A.z),
  62183. (A = c[v.vert2]),
  62184. m.push(A.x),
  62185. m.push(A.y),
  62186. m.push(A.z);
  62187. }
  62188. }
  62189. this.addAttribute('position', new n.BufferAttribute(new Float32Array(m), 3));
  62190. }),
  62191. (n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62192. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  62193. (n.ExtrudeGeometry = function (e, t) {
  62194. return 'undefined' == typeof e
  62195. ? void (e = [])
  62196. : (n.Geometry.call(this),
  62197. (this.type = 'ExtrudeGeometry'),
  62198. (e = Array.isArray(e) ? e : [e]),
  62199. this.addShapeList(e, t),
  62200. void this.computeFaceNormals());
  62201. });
  62202. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  62203. (n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  62204. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  62205. for (var i = e.length, n = 0; n < i; n++) {
  62206. var r = e[n];
  62207. this.addShape(r, t);
  62208. }
  62209. }),
  62210. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  62211. function i(e, t, i) {
  62212. return (
  62213. t || console.error('THREE.ExtrudeGeometry: vec does not exist'),
  62214. t.clone().multiplyScalar(i).add(e)
  62215. );
  62216. }
  62217. function r(e, t, i) {
  62218. var r,
  62219. o,
  62220. a = 1,
  62221. s = e.x - t.x,
  62222. l = e.y - t.y,
  62223. c = i.x - e.x,
  62224. h = i.y - e.y,
  62225. u = s * s + l * l,
  62226. d = s * h - l * c;
  62227. if (Math.abs(d) > Number.EPSILON) {
  62228. var p = Math.sqrt(u),
  62229. f = Math.sqrt(c * c + h * h),
  62230. g = t.x - l / p,
  62231. m = t.y + s / p,
  62232. v = i.x - h / f,
  62233. A = i.y + c / f,
  62234. y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  62235. (r = g + s * y - e.x), (o = m + l * y - e.y);
  62236. var C = r * r + o * o;
  62237. if (C <= 2) return new n.Vector2(r, o);
  62238. a = Math.sqrt(C / 2);
  62239. } else {
  62240. var I = !1;
  62241. s > Number.EPSILON
  62242. ? c > Number.EPSILON && (I = !0)
  62243. : s < -Number.EPSILON
  62244. ? c < -Number.EPSILON && (I = !0)
  62245. : Math.sign(l) === Math.sign(h) && (I = !0),
  62246. I
  62247. ? ((r = -l), (o = s), (a = Math.sqrt(u)))
  62248. : ((r = s), (o = l), (a = Math.sqrt(u / 2)));
  62249. }
  62250. return new n.Vector2(r / a, o / a);
  62251. }
  62252. function o() {
  62253. if (C) {
  62254. var e = 0,
  62255. t = z * e;
  62256. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t);
  62257. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++)
  62258. (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t);
  62259. } else {
  62260. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0]);
  62261. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E);
  62262. }
  62263. }
  62264. function a() {
  62265. var e = 0;
  62266. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++)
  62267. (T = L[x]), s(T, e), (e += T.length);
  62268. }
  62269. function s(e, t) {
  62270. var i, n;
  62271. for (Y = e.length; --Y >= 0; ) {
  62272. (i = Y), (n = Y - 1), n < 0 && (n = e.length - 1);
  62273. var r = 0,
  62274. o = E + 2 * y;
  62275. for (r = 0; r < o; r++) {
  62276. var a = z * r,
  62277. s = z * (r + 1),
  62278. l = t + i + a,
  62279. c = t + n + a,
  62280. u = t + n + s,
  62281. d = t + i + s;
  62282. h(l, c, u, d, e, r, o, i, n);
  62283. }
  62284. }
  62285. }
  62286. function l(e, t, i) {
  62287. M.vertices.push(new n.Vector3(e, t, i));
  62288. }
  62289. function c(e, t, i) {
  62290. (e += R), (t += R), (i += R), M.faces.push(new n.Face3(e, t, i, null, null, 0));
  62291. var r = _.generateTopUV(M, e, t, i);
  62292. M.faceVertexUvs[0].push(r);
  62293. }
  62294. function h(e, t, i, r, o, a, s, l, c) {
  62295. (e += R),
  62296. (t += R),
  62297. (i += R),
  62298. (r += R),
  62299. M.faces.push(new n.Face3(e, t, r, null, null, 1)),
  62300. M.faces.push(new n.Face3(t, i, r, null, null, 1));
  62301. var h = _.generateSideWallUV(M, e, t, i, r);
  62302. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  62303. M.faceVertexUvs[0].push([h[1], h[2], h[3]]);
  62304. }
  62305. var u,
  62306. d,
  62307. p,
  62308. f,
  62309. g,
  62310. m = void 0 !== t.amount ? t.amount : 100,
  62311. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  62312. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  62313. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  62314. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  62315. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62316. E = void 0 !== t.steps ? t.steps : 1,
  62317. b = t.extrudePath,
  62318. w = !1,
  62319. _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  62320. b &&
  62321. ((u = b.getSpacedPoints(E)),
  62322. (w = !0),
  62323. (C = !1),
  62324. (d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  62325. (p = new n.Vector3()),
  62326. (f = new n.Vector3()),
  62327. (g = new n.Vector3())),
  62328. C || ((y = 0), (v = 0), (A = 0));
  62329. var T,
  62330. x,
  62331. S,
  62332. M = this,
  62333. R = this.vertices.length,
  62334. P = e.extractPoints(I),
  62335. O = P.shape,
  62336. L = P.holes,
  62337. D = !n.ShapeUtils.isClockWise(O);
  62338. if (D) {
  62339. for (O = O.reverse(), x = 0, S = L.length; x < S; x++)
  62340. (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  62341. D = !1;
  62342. }
  62343. var N = n.ShapeUtils.triangulateShape(O, L),
  62344. B = O;
  62345. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T));
  62346. for (
  62347. var F,
  62348. V,
  62349. U,
  62350. k,
  62351. H,
  62352. G,
  62353. z = O.length,
  62354. W = N.length,
  62355. j = [],
  62356. Y = 0,
  62357. X = B.length,
  62358. Z = X - 1,
  62359. q = Y + 1;
  62360. Y < X;
  62361. Y++, Z++, q++
  62362. )
  62363. Z === X && (Z = 0), q === X && (q = 0), (j[Y] = r(B[Y], B[Z], B[q]));
  62364. var K,
  62365. Q = [],
  62366. J = j.concat();
  62367. for (x = 0, S = L.length; x < S; x++) {
  62368. for (
  62369. T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1;
  62370. Y < X;
  62371. Y++, Z++, q++
  62372. )
  62373. Z === X && (Z = 0), q === X && (q = 0), (K[Y] = r(T[Y], T[Z], T[q]));
  62374. Q.push(K), (J = J.concat(K));
  62375. }
  62376. for (F = 0; F < y; F++) {
  62377. for (
  62378. U = F / y,
  62379. k = v * (1 - U),
  62380. V = A * Math.sin((U * Math.PI) / 2),
  62381. Y = 0,
  62382. X = B.length;
  62383. Y < X;
  62384. Y++
  62385. )
  62386. (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k);
  62387. for (x = 0, S = L.length; x < S; x++)
  62388. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62389. (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k);
  62390. }
  62391. for (V = A, Y = 0; Y < z; Y++)
  62392. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62393. w
  62394. ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  62395. p.copy(d.binormals[0]).multiplyScalar(H.y),
  62396. g.copy(u[0]).add(f).add(p),
  62397. l(g.x, g.y, g.z))
  62398. : l(H.x, H.y, 0);
  62399. var $;
  62400. for ($ = 1; $ <= E; $++)
  62401. for (Y = 0; Y < z; Y++)
  62402. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62403. w
  62404. ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  62405. p.copy(d.binormals[$]).multiplyScalar(H.y),
  62406. g.copy(u[$]).add(f).add(p),
  62407. l(g.x, g.y, g.z))
  62408. : l(H.x, H.y, (m / E) * $);
  62409. for (F = y - 1; F >= 0; F--) {
  62410. for (
  62411. U = F / y,
  62412. k = v * (1 - U),
  62413. V = A * Math.sin((U * Math.PI) / 2),
  62414. Y = 0,
  62415. X = B.length;
  62416. Y < X;
  62417. Y++
  62418. )
  62419. (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k);
  62420. for (x = 0, S = L.length; x < S; x++)
  62421. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62422. (H = i(T[Y], K[Y], V)),
  62423. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k);
  62424. }
  62425. o(), a();
  62426. }),
  62427. (n.ExtrudeGeometry.WorldUVGenerator = {
  62428. generateTopUV: function (e, t, i, r) {
  62429. var o = e.vertices,
  62430. a = o[t],
  62431. s = o[i],
  62432. l = o[r];
  62433. return [new n.Vector2(a.x, a.y), new n.Vector2(s.x, s.y), new n.Vector2(l.x, l.y)];
  62434. },
  62435. generateSideWallUV: function (e, t, i, r, o) {
  62436. var a = e.vertices,
  62437. s = a[t],
  62438. l = a[i],
  62439. c = a[r],
  62440. h = a[o];
  62441. return Math.abs(s.y - l.y) < 0.01
  62442. ? [
  62443. new n.Vector2(s.x, 1 - s.z),
  62444. new n.Vector2(l.x, 1 - l.z),
  62445. new n.Vector2(c.x, 1 - c.z),
  62446. new n.Vector2(h.x, 1 - h.z),
  62447. ]
  62448. : [
  62449. new n.Vector2(s.y, 1 - s.z),
  62450. new n.Vector2(l.y, 1 - l.z),
  62451. new n.Vector2(c.y, 1 - c.z),
  62452. new n.Vector2(h.y, 1 - h.z),
  62453. ];
  62454. },
  62455. }),
  62456. (n.ShapeGeometry = function (e, t) {
  62457. n.Geometry.call(this),
  62458. (this.type = 'ShapeGeometry'),
  62459. Array.isArray(e) === !1 && (e = [e]),
  62460. this.addShapeList(e, t),
  62461. this.computeFaceNormals();
  62462. }),
  62463. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  62464. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  62465. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  62466. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t);
  62467. return this;
  62468. }),
  62469. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  62470. void 0 === t && (t = {});
  62471. var i,
  62472. r,
  62473. o,
  62474. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62475. s = t.material,
  62476. l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  62477. c = this.vertices.length,
  62478. h = e.extractPoints(a),
  62479. u = h.shape,
  62480. d = h.holes,
  62481. p = !n.ShapeUtils.isClockWise(u);
  62482. if (p) {
  62483. for (u = u.reverse(), i = 0, r = d.length; i < r; i++)
  62484. (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  62485. p = !1;
  62486. }
  62487. var f = n.ShapeUtils.triangulateShape(u, d);
  62488. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o));
  62489. var g,
  62490. m,
  62491. v = u.length,
  62492. A = f.length;
  62493. for (i = 0; i < v; i++) (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0));
  62494. for (i = 0; i < A; i++) {
  62495. m = f[i];
  62496. var y = m[0] + c,
  62497. C = m[1] + c,
  62498. I = m[2] + c;
  62499. this.faces.push(new n.Face3(y, C, I, null, null, s)),
  62500. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I));
  62501. }
  62502. }),
  62503. (n.LatheBufferGeometry = function (e, t, i, r) {
  62504. n.BufferGeometry.call(this),
  62505. (this.type = 'LatheBufferGeometry'),
  62506. (this.parameters = {
  62507. points: e,
  62508. segments: t,
  62509. phiStart: i,
  62510. phiLength: r,
  62511. }),
  62512. (t = Math.floor(t) || 12),
  62513. (i = i || 0),
  62514. (r = r || 2 * Math.PI),
  62515. (r = n.Math.clamp(r, 0, 2 * Math.PI));
  62516. var o,
  62517. a,
  62518. s,
  62519. l = (t + 1) * e.length,
  62520. c = t * e.length * 2 * 3,
  62521. h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c), 1),
  62522. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  62523. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  62524. p = 0,
  62525. f = 0,
  62526. g = (1 / (e.length - 1), 1 / t),
  62527. m = new n.Vector3(),
  62528. v = new n.Vector2();
  62529. for (a = 0; a <= t; a++) {
  62530. var A = i + a * g * r,
  62531. y = Math.sin(A),
  62532. C = Math.cos(A);
  62533. for (s = 0; s <= e.length - 1; s++)
  62534. (m.x = e[s].x * y),
  62535. (m.y = e[s].y),
  62536. (m.z = e[s].x * C),
  62537. u.setXYZ(p, m.x, m.y, m.z),
  62538. (v.x = a / t),
  62539. (v.y = s / (e.length - 1)),
  62540. d.setXY(p, v.x, v.y),
  62541. p++;
  62542. }
  62543. for (a = 0; a < t; a++)
  62544. for (s = 0; s < e.length - 1; s++) {
  62545. o = s + a * e.length;
  62546. var I = o,
  62547. E = o + e.length,
  62548. b = o + e.length + 1,
  62549. w = o + 1;
  62550. h.setX(f, I),
  62551. f++,
  62552. h.setX(f, E),
  62553. f++,
  62554. h.setX(f, w),
  62555. f++,
  62556. h.setX(f, E),
  62557. f++,
  62558. h.setX(f, b),
  62559. f++,
  62560. h.setX(f, w),
  62561. f++;
  62562. }
  62563. if (
  62564. (this.setIndex(h),
  62565. this.addAttribute('position', u),
  62566. this.addAttribute('uv', d),
  62567. this.computeVertexNormals(),
  62568. r === 2 * Math.PI)
  62569. ) {
  62570. var _ = this.attributes.normal.array,
  62571. T = new n.Vector3(),
  62572. x = new n.Vector3(),
  62573. S = new n.Vector3();
  62574. for (o = t * e.length * 3, a = 0, s = 0; a < e.length; a++, s += 3)
  62575. (T.x = _[s + 0]),
  62576. (T.y = _[s + 1]),
  62577. (T.z = _[s + 2]),
  62578. (x.x = _[o + s + 0]),
  62579. (x.y = _[o + s + 1]),
  62580. (x.z = _[o + s + 2]),
  62581. S.addVectors(T, x).normalize(),
  62582. (_[s + 0] = _[o + s + 0] = S.x),
  62583. (_[s + 1] = _[o + s + 1] = S.y),
  62584. (_[s + 2] = _[o + s + 2] = S.z);
  62585. }
  62586. }),
  62587. (n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62588. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  62589. (n.LatheGeometry = function (e, t, i, r) {
  62590. n.Geometry.call(this),
  62591. (this.type = 'LatheGeometry'),
  62592. (this.parameters = {
  62593. points: e,
  62594. segments: t,
  62595. phiStart: i,
  62596. phiLength: r,
  62597. }),
  62598. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  62599. this.mergeVertices();
  62600. }),
  62601. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  62602. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  62603. (n.PlaneGeometry = function (e, t, i, r) {
  62604. n.Geometry.call(this),
  62605. (this.type = 'PlaneGeometry'),
  62606. (this.parameters = {
  62607. width: e,
  62608. height: t,
  62609. widthSegments: i,
  62610. heightSegments: r,
  62611. }),
  62612. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r));
  62613. }),
  62614. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  62615. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  62616. (n.PlaneBufferGeometry = function (e, t, i, r) {
  62617. n.BufferGeometry.call(this),
  62618. (this.type = 'PlaneBufferGeometry'),
  62619. (this.parameters = {
  62620. width: e,
  62621. height: t,
  62622. widthSegments: i,
  62623. heightSegments: r,
  62624. });
  62625. for (
  62626. var o = e / 2,
  62627. a = t / 2,
  62628. s = Math.floor(i) || 1,
  62629. l = Math.floor(r) || 1,
  62630. c = s + 1,
  62631. h = l + 1,
  62632. u = e / s,
  62633. d = t / l,
  62634. p = new Float32Array(c * h * 3),
  62635. f = new Float32Array(c * h * 3),
  62636. g = new Float32Array(c * h * 2),
  62637. m = 0,
  62638. v = 0,
  62639. A = 0;
  62640. A < h;
  62641. A++
  62642. )
  62643. for (var y = A * d - a, C = 0; C < c; C++) {
  62644. var I = C * u - o;
  62645. (p[m] = I),
  62646. (p[m + 1] = -y),
  62647. (f[m + 2] = 1),
  62648. (g[v] = C / s),
  62649. (g[v + 1] = 1 - A / l),
  62650. (m += 3),
  62651. (v += 2);
  62652. }
  62653. m = 0;
  62654. for (
  62655. var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0;
  62656. A < l;
  62657. A++
  62658. )
  62659. for (var C = 0; C < s; C++) {
  62660. var b = C + c * A,
  62661. w = C + c * (A + 1),
  62662. _ = C + 1 + c * (A + 1),
  62663. T = C + 1 + c * A;
  62664. (E[m] = b),
  62665. (E[m + 1] = w),
  62666. (E[m + 2] = T),
  62667. (E[m + 3] = w),
  62668. (E[m + 4] = _),
  62669. (E[m + 5] = T),
  62670. (m += 6);
  62671. }
  62672. this.setIndex(new n.BufferAttribute(E, 1)),
  62673. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  62674. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  62675. this.addAttribute('uv', new n.BufferAttribute(g, 2));
  62676. }),
  62677. (n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62678. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  62679. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  62680. n.BufferGeometry.call(this),
  62681. (this.type = 'RingBufferGeometry'),
  62682. (this.parameters = {
  62683. innerRadius: e,
  62684. outerRadius: t,
  62685. thetaSegments: i,
  62686. phiSegments: r,
  62687. thetaStart: o,
  62688. thetaLength: a,
  62689. }),
  62690. (e = e || 20),
  62691. (t = t || 50),
  62692. (o = void 0 !== o ? o : 0),
  62693. (a = void 0 !== a ? a : 2 * Math.PI),
  62694. (i = void 0 !== i ? Math.max(3, i) : 8),
  62695. (r = void 0 !== r ? Math.max(1, r) : 1);
  62696. var s,
  62697. l,
  62698. c,
  62699. h = (i + 1) * (r + 1),
  62700. u = i * r * 2 * 3,
  62701. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  62702. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62703. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62704. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  62705. m = 0,
  62706. v = 0,
  62707. A = e,
  62708. y = (t - e) / r,
  62709. C = new n.Vector3(),
  62710. I = new n.Vector2();
  62711. for (l = 0; l <= r; l++) {
  62712. for (c = 0; c <= i; c++)
  62713. (s = o + (c / i) * a),
  62714. (C.x = A * Math.cos(s)),
  62715. (C.y = A * Math.sin(s)),
  62716. p.setXYZ(m, C.x, C.y, C.z),
  62717. f.setXYZ(m, 0, 0, 1),
  62718. (I.x = (C.x / t + 1) / 2),
  62719. (I.y = (C.y / t + 1) / 2),
  62720. g.setXY(m, I.x, I.y),
  62721. m++;
  62722. A += y;
  62723. }
  62724. for (l = 0; l < r; l++) {
  62725. var E = l * (i + 1);
  62726. for (c = 0; c < i; c++) {
  62727. s = c + E;
  62728. var b = s,
  62729. w = s + i + 1,
  62730. _ = s + i + 2,
  62731. T = s + 1;
  62732. d.setX(v, b),
  62733. v++,
  62734. d.setX(v, w),
  62735. v++,
  62736. d.setX(v, _),
  62737. v++,
  62738. d.setX(v, b),
  62739. v++,
  62740. d.setX(v, _),
  62741. v++,
  62742. d.setX(v, T),
  62743. v++;
  62744. }
  62745. }
  62746. this.setIndex(d),
  62747. this.addAttribute('position', p),
  62748. this.addAttribute('normal', f),
  62749. this.addAttribute('uv', g);
  62750. }),
  62751. (n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62752. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  62753. (n.RingGeometry = function (e, t, i, r, o, a) {
  62754. n.Geometry.call(this),
  62755. (this.type = 'RingGeometry'),
  62756. (this.parameters = {
  62757. innerRadius: e,
  62758. outerRadius: t,
  62759. thetaSegments: i,
  62760. phiSegments: r,
  62761. thetaStart: o,
  62762. thetaLength: a,
  62763. }),
  62764. this.fromBufferGeometry(new n.RingBufferGeometry(e, t, i, r, o, a));
  62765. }),
  62766. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  62767. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  62768. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  62769. n.Geometry.call(this),
  62770. (this.type = 'SphereGeometry'),
  62771. (this.parameters = {
  62772. radius: e,
  62773. widthSegments: t,
  62774. heightSegments: i,
  62775. phiStart: r,
  62776. phiLength: o,
  62777. thetaStart: a,
  62778. thetaLength: s,
  62779. }),
  62780. this.fromBufferGeometry(new n.SphereBufferGeometry(e, t, i, r, o, a, s));
  62781. }),
  62782. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  62783. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  62784. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  62785. n.BufferGeometry.call(this),
  62786. (this.type = 'SphereBufferGeometry'),
  62787. (this.parameters = {
  62788. radius: e,
  62789. widthSegments: t,
  62790. heightSegments: i,
  62791. phiStart: r,
  62792. phiLength: o,
  62793. thetaStart: a,
  62794. thetaLength: s,
  62795. }),
  62796. (e = e || 50),
  62797. (t = Math.max(3, Math.floor(t) || 8)),
  62798. (i = Math.max(2, Math.floor(i) || 6)),
  62799. (r = void 0 !== r ? r : 0),
  62800. (o = void 0 !== o ? o : 2 * Math.PI),
  62801. (a = void 0 !== a ? a : 0),
  62802. (s = void 0 !== s ? s : Math.PI);
  62803. for (
  62804. var l = a + s,
  62805. c = (t + 1) * (i + 1),
  62806. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62807. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62808. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  62809. p = 0,
  62810. f = [],
  62811. g = new n.Vector3(),
  62812. m = 0;
  62813. m <= i;
  62814. m++
  62815. ) {
  62816. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  62817. var C = y / t,
  62818. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  62819. E = e * Math.cos(a + A * s),
  62820. b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  62821. g.set(I, E, b).normalize(),
  62822. h.setXYZ(p, I, E, b),
  62823. u.setXYZ(p, g.x, g.y, g.z),
  62824. d.setXY(p, C, 1 - A),
  62825. v.push(p),
  62826. p++;
  62827. }
  62828. f.push(v);
  62829. }
  62830. for (var w = [], m = 0; m < i; m++)
  62831. for (var y = 0; y < t; y++) {
  62832. var _ = f[m][y + 1],
  62833. T = f[m][y],
  62834. x = f[m + 1][y],
  62835. S = f[m + 1][y + 1];
  62836. (0 !== m || a > 0) && w.push(_, T, S),
  62837. (m !== i - 1 || l < Math.PI) && w.push(T, x, S);
  62838. }
  62839. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w, 1)),
  62840. this.addAttribute('position', h),
  62841. this.addAttribute('normal', u),
  62842. this.addAttribute('uv', d),
  62843. (this.boundingSphere = new n.Sphere(new n.Vector3(), e));
  62844. }),
  62845. (n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62846. (n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry),
  62847. (n.TextGeometry = function (e, t) {
  62848. t = t || {};
  62849. var i = t.font;
  62850. if (i instanceof n.Font == !1)
  62851. return (
  62852. console.error(
  62853. 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.'
  62854. ),
  62855. new n.Geometry()
  62856. );
  62857. var r = i.generateShapes(e, t.size, t.curveSegments);
  62858. (t.amount = void 0 !== t.height ? t.height : 50),
  62859. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  62860. void 0 === t.bevelSize && (t.bevelSize = 8),
  62861. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  62862. n.ExtrudeGeometry.call(this, r, t),
  62863. (this.type = 'TextGeometry');
  62864. }),
  62865. (n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype)),
  62866. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  62867. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  62868. n.BufferGeometry.call(this),
  62869. (this.type = 'TorusBufferGeometry'),
  62870. (this.parameters = {
  62871. radius: e,
  62872. tube: t,
  62873. radialSegments: i,
  62874. tubularSegments: r,
  62875. arc: o,
  62876. }),
  62877. (e = e || 100),
  62878. (t = t || 40),
  62879. (i = Math.floor(i) || 8),
  62880. (r = Math.floor(r) || 6),
  62881. (o = o || 2 * Math.PI);
  62882. var a,
  62883. s,
  62884. l = (i + 1) * (r + 1),
  62885. c = i * r * 2 * 3,
  62886. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  62887. u = new Float32Array(3 * l),
  62888. d = new Float32Array(3 * l),
  62889. p = new Float32Array(2 * l),
  62890. f = 0,
  62891. g = 0,
  62892. m = 0,
  62893. v = new n.Vector3(),
  62894. A = new n.Vector3(),
  62895. y = new n.Vector3();
  62896. for (a = 0; a <= i; a++)
  62897. for (s = 0; s <= r; s++) {
  62898. var C = (s / r) * o,
  62899. I = (a / i) * Math.PI * 2;
  62900. (A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  62901. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  62902. (A.z = t * Math.sin(I)),
  62903. (u[f] = A.x),
  62904. (u[f + 1] = A.y),
  62905. (u[f + 2] = A.z),
  62906. (v.x = e * Math.cos(C)),
  62907. (v.y = e * Math.sin(C)),
  62908. y.subVectors(A, v).normalize(),
  62909. (d[f] = y.x),
  62910. (d[f + 1] = y.y),
  62911. (d[f + 2] = y.z),
  62912. (p[g] = s / r),
  62913. (p[g + 1] = a / i),
  62914. (f += 3),
  62915. (g += 2);
  62916. }
  62917. for (a = 1; a <= i; a++)
  62918. for (s = 1; s <= r; s++) {
  62919. var E = (r + 1) * a + s - 1,
  62920. b = (r + 1) * (a - 1) + s - 1,
  62921. w = (r + 1) * (a - 1) + s,
  62922. _ = (r + 1) * a + s;
  62923. (h[m] = E),
  62924. (h[m + 1] = b),
  62925. (h[m + 2] = _),
  62926. (h[m + 3] = b),
  62927. (h[m + 4] = w),
  62928. (h[m + 5] = _),
  62929. (m += 6);
  62930. }
  62931. this.setIndex(new n.BufferAttribute(h, 1)),
  62932. this.addAttribute('position', new n.BufferAttribute(u, 3)),
  62933. this.addAttribute('normal', new n.BufferAttribute(d, 3)),
  62934. this.addAttribute('uv', new n.BufferAttribute(p, 2));
  62935. }),
  62936. (n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62937. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  62938. (n.TorusGeometry = function (e, t, i, r, o) {
  62939. n.Geometry.call(this),
  62940. (this.type = 'TorusGeometry'),
  62941. (this.parameters = {
  62942. radius: e,
  62943. tube: t,
  62944. radialSegments: i,
  62945. tubularSegments: r,
  62946. arc: o,
  62947. }),
  62948. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o));
  62949. }),
  62950. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  62951. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  62952. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  62953. function s(e, t, i, n, r) {
  62954. var o = Math.cos(e),
  62955. a = Math.sin(e),
  62956. s = (i / t) * e,
  62957. l = Math.cos(s);
  62958. (r.x = n * (2 + l) * 0.5 * o),
  62959. (r.y = n * (2 + l) * a * 0.5),
  62960. (r.z = n * Math.sin(s) * 0.5);
  62961. }
  62962. n.BufferGeometry.call(this),
  62963. (this.type = 'TorusKnotBufferGeometry'),
  62964. (this.parameters = {
  62965. radius: e,
  62966. tube: t,
  62967. tubularSegments: i,
  62968. radialSegments: r,
  62969. p: o,
  62970. q: a,
  62971. }),
  62972. (e = e || 100),
  62973. (t = t || 40),
  62974. (i = Math.floor(i) || 64),
  62975. (r = Math.floor(r) || 8),
  62976. (o = o || 2),
  62977. (a = a || 3);
  62978. var l,
  62979. c,
  62980. h = (r + 1) * (i + 1),
  62981. u = r * i * 2 * 3,
  62982. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  62983. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62984. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62985. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  62986. m = 0,
  62987. v = 0,
  62988. A = new n.Vector3(),
  62989. y = new n.Vector3(),
  62990. C = new n.Vector2(),
  62991. I = new n.Vector3(),
  62992. E = new n.Vector3(),
  62993. b = new n.Vector3(),
  62994. w = new n.Vector3(),
  62995. _ = new n.Vector3();
  62996. for (l = 0; l <= i; ++l) {
  62997. var T = (l / i) * o * Math.PI * 2;
  62998. for (
  62999. s(T, o, a, e, I),
  63000. s(T + 0.01, o, a, e, E),
  63001. w.subVectors(E, I),
  63002. _.addVectors(E, I),
  63003. b.crossVectors(w, _),
  63004. _.crossVectors(b, w),
  63005. b.normalize(),
  63006. _.normalize(),
  63007. c = 0;
  63008. c <= r;
  63009. ++c
  63010. ) {
  63011. var x = (c / r) * Math.PI * 2,
  63012. S = -t * Math.cos(x),
  63013. M = t * Math.sin(x);
  63014. (A.x = I.x + (S * _.x + M * b.x)),
  63015. (A.y = I.y + (S * _.y + M * b.y)),
  63016. (A.z = I.z + (S * _.z + M * b.z)),
  63017. p.setXYZ(m, A.x, A.y, A.z),
  63018. y.subVectors(A, I).normalize(),
  63019. f.setXYZ(m, y.x, y.y, y.z),
  63020. (C.x = l / i),
  63021. (C.y = c / r),
  63022. g.setXY(m, C.x, C.y),
  63023. m++;
  63024. }
  63025. }
  63026. for (c = 1; c <= i; c++)
  63027. for (l = 1; l <= r; l++) {
  63028. var R = (r + 1) * (c - 1) + (l - 1),
  63029. P = (r + 1) * c + (l - 1),
  63030. O = (r + 1) * c + l,
  63031. L = (r + 1) * (c - 1) + l;
  63032. d.setX(v, R),
  63033. v++,
  63034. d.setX(v, P),
  63035. v++,
  63036. d.setX(v, L),
  63037. v++,
  63038. d.setX(v, P),
  63039. v++,
  63040. d.setX(v, O),
  63041. v++,
  63042. d.setX(v, L),
  63043. v++;
  63044. }
  63045. this.setIndex(d),
  63046. this.addAttribute('position', p),
  63047. this.addAttribute('normal', f),
  63048. this.addAttribute('uv', g);
  63049. }),
  63050. (n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63051. (n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry),
  63052. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  63053. n.Geometry.call(this),
  63054. (this.type = 'TorusKnotGeometry'),
  63055. (this.parameters = {
  63056. radius: e,
  63057. tube: t,
  63058. tubularSegments: i,
  63059. radialSegments: r,
  63060. p: o,
  63061. q: a,
  63062. }),
  63063. void 0 !== s &&
  63064. console.warn(
  63065. 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'
  63066. ),
  63067. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e, t, i, r, o, a)),
  63068. this.mergeVertices();
  63069. }),
  63070. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  63071. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  63072. (n.TubeGeometry = function (e, t, i, r, o, a) {
  63073. function s(e, t, i) {
  63074. return R.vertices.push(new n.Vector3(e, t, i)) - 1;
  63075. }
  63076. n.Geometry.call(this),
  63077. (this.type = 'TubeGeometry'),
  63078. (this.parameters = {
  63079. path: e,
  63080. segments: t,
  63081. radius: i,
  63082. radialSegments: r,
  63083. closed: o,
  63084. taper: a,
  63085. }),
  63086. (t = t || 64),
  63087. (i = i || 1),
  63088. (r = r || 8),
  63089. (o = o || !1),
  63090. (a = a || n.TubeGeometry.NoTaper);
  63091. var l,
  63092. c,
  63093. h,
  63094. u,
  63095. d,
  63096. p,
  63097. f,
  63098. g,
  63099. m,
  63100. v,
  63101. A,
  63102. y,
  63103. C,
  63104. I,
  63105. E,
  63106. b,
  63107. w,
  63108. _,
  63109. T,
  63110. x,
  63111. S,
  63112. M = [],
  63113. R = this,
  63114. P = t + 1,
  63115. O = new n.Vector3(),
  63116. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  63117. D = L.tangents,
  63118. N = L.normals,
  63119. B = L.binormals;
  63120. for (this.tangents = D, this.normals = N, this.binormals = B, v = 0; v < P; v++)
  63121. for (
  63122. M[v] = [],
  63123. u = v / (P - 1),
  63124. m = e.getPointAt(u),
  63125. l = D[v],
  63126. c = N[v],
  63127. h = B[v],
  63128. p = i * a(u),
  63129. A = 0;
  63130. A < r;
  63131. A++
  63132. )
  63133. (d = (A / r) * 2 * Math.PI),
  63134. (f = -p * Math.cos(d)),
  63135. (g = p * Math.sin(d)),
  63136. O.copy(m),
  63137. (O.x += f * c.x + g * h.x),
  63138. (O.y += f * c.y + g * h.y),
  63139. (O.z += f * c.z + g * h.z),
  63140. (M[v][A] = s(O.x, O.y, O.z));
  63141. for (v = 0; v < t; v++)
  63142. for (A = 0; A < r; A++)
  63143. (y = o ? (v + 1) % t : v + 1),
  63144. (C = (A + 1) % r),
  63145. (I = M[v][A]),
  63146. (E = M[y][A]),
  63147. (b = M[y][C]),
  63148. (w = M[v][C]),
  63149. (_ = new n.Vector2(v / t, A / r)),
  63150. (T = new n.Vector2((v + 1) / t, A / r)),
  63151. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  63152. (S = new n.Vector2(v / t, (A + 1) / r)),
  63153. this.faces.push(new n.Face3(I, E, w)),
  63154. this.faceVertexUvs[0].push([_, T, S]),
  63155. this.faces.push(new n.Face3(E, b, w)),
  63156. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  63157. this.computeFaceNormals(), this.computeVertexNormals();
  63158. }),
  63159. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  63160. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  63161. (n.TubeGeometry.NoTaper = function (e) {
  63162. return 1;
  63163. }),
  63164. (n.TubeGeometry.SinusoidalTaper = function (e) {
  63165. return Math.sin(Math.PI * e);
  63166. }),
  63167. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  63168. function r() {
  63169. (f[0] = new n.Vector3()),
  63170. (g[0] = new n.Vector3()),
  63171. (a = Number.MAX_VALUE),
  63172. (s = Math.abs(p[0].x)),
  63173. (l = Math.abs(p[0].y)),
  63174. (c = Math.abs(p[0].z)),
  63175. s <= a && ((a = s), d.set(1, 0, 0)),
  63176. l <= a && ((a = l), d.set(0, 1, 0)),
  63177. c <= a && d.set(0, 0, 1),
  63178. m.crossVectors(p[0], d).normalize(),
  63179. f[0].crossVectors(p[0], m),
  63180. g[0].crossVectors(p[0], f[0]);
  63181. }
  63182. var o,
  63183. a,
  63184. s,
  63185. l,
  63186. c,
  63187. h,
  63188. u,
  63189. d = new n.Vector3(),
  63190. p = [],
  63191. f = [],
  63192. g = [],
  63193. m = new n.Vector3(),
  63194. v = new n.Matrix4(),
  63195. A = t + 1;
  63196. for (this.tangents = p, this.normals = f, this.binormals = g, h = 0; h < A; h++)
  63197. (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize();
  63198. for (r(), h = 1; h < A; h++)
  63199. (f[h] = f[h - 1].clone()),
  63200. (g[h] = g[h - 1].clone()),
  63201. m.crossVectors(p[h - 1], p[h]),
  63202. m.length() > Number.EPSILON &&
  63203. (m.normalize(),
  63204. (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))),
  63205. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  63206. g[h].crossVectors(p[h], f[h]);
  63207. if (i)
  63208. for (
  63209. o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  63210. o /= A - 1,
  63211. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  63212. h = 1;
  63213. h < A;
  63214. h++
  63215. )
  63216. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)), g[h].crossVectors(p[h], f[h]);
  63217. }),
  63218. (n.PolyhedronGeometry = function (e, t, i, r) {
  63219. function o(e) {
  63220. var t = e.normalize().clone();
  63221. t.index = u.vertices.push(t) - 1;
  63222. var i = l(e) / 2 / Math.PI + 0.5,
  63223. r = c(e) / Math.PI + 0.5;
  63224. return (t.uv = new n.Vector2(i, 1 - r)), t;
  63225. }
  63226. function a(e, t, i, r) {
  63227. var o = new n.Face3(
  63228. e.index,
  63229. t.index,
  63230. i.index,
  63231. [e.clone(), t.clone(), i.clone()],
  63232. void 0,
  63233. r
  63234. );
  63235. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3);
  63236. var a = l(C);
  63237. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)]);
  63238. }
  63239. function s(e, t) {
  63240. for (
  63241. var i = Math.pow(2, t),
  63242. n = o(u.vertices[e.a]),
  63243. r = o(u.vertices[e.b]),
  63244. s = o(u.vertices[e.c]),
  63245. l = [],
  63246. c = e.materialIndex,
  63247. h = 0;
  63248. h <= i;
  63249. h++
  63250. ) {
  63251. l[h] = [];
  63252. for (
  63253. var d = o(n.clone().lerp(s, h / i)),
  63254. p = o(r.clone().lerp(s, h / i)),
  63255. f = i - h,
  63256. g = 0;
  63257. g <= f;
  63258. g++
  63259. )
  63260. 0 === g && h === i ? (l[h][g] = d) : (l[h][g] = o(d.clone().lerp(p, g / f)));
  63261. }
  63262. for (var h = 0; h < i; h++)
  63263. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  63264. var m = Math.floor(g / 2);
  63265. g % 2 === 0
  63266. ? a(l[h][m + 1], l[h + 1][m], l[h][m], c)
  63267. : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c);
  63268. }
  63269. }
  63270. function l(e) {
  63271. return Math.atan2(e.z, -e.x);
  63272. }
  63273. function c(e) {
  63274. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z));
  63275. }
  63276. function h(e, t, i) {
  63277. return (
  63278. i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)),
  63279. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)),
  63280. e.clone()
  63281. );
  63282. }
  63283. n.Geometry.call(this),
  63284. (this.type = 'PolyhedronGeometry'),
  63285. (this.parameters = {
  63286. vertices: e,
  63287. indices: t,
  63288. radius: i,
  63289. detail: r,
  63290. }),
  63291. (i = i || 1),
  63292. (r = r || 0);
  63293. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  63294. o(new n.Vector3(e[d], e[d + 1], e[d + 2]));
  63295. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3, m++) {
  63296. var v = f[t[d]],
  63297. A = f[t[d + 1]],
  63298. y = f[t[d + 2]];
  63299. g[m] = new n.Face3(
  63300. v.index,
  63301. A.index,
  63302. y.index,
  63303. [v.clone(), A.clone(), y.clone()],
  63304. void 0,
  63305. m
  63306. );
  63307. }
  63308. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++) s(g[d], r);
  63309. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  63310. var I = this.faceVertexUvs[0][d],
  63311. E = I[0].x,
  63312. b = I[1].x,
  63313. w = I[2].x,
  63314. _ = Math.max(E, b, w),
  63315. T = Math.min(E, b, w);
  63316. _ > 0.9 &&
  63317. T < 0.1 &&
  63318. (E < 0.2 && (I[0].x += 1), b < 0.2 && (I[1].x += 1), w < 0.2 && (I[2].x += 1));
  63319. }
  63320. for (var d = 0, p = this.vertices.length; d < p; d++)
  63321. this.vertices[d].multiplyScalar(i);
  63322. this.mergeVertices(),
  63323. this.computeFaceNormals(),
  63324. (this.boundingSphere = new n.Sphere(new n.Vector3(), i));
  63325. }),
  63326. (n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype)),
  63327. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  63328. (n.DodecahedronGeometry = function (e, t) {
  63329. var i = (1 + Math.sqrt(5)) / 2,
  63330. r = 1 / i,
  63331. o = [
  63332. -1,
  63333. -1,
  63334. -1,
  63335. -1,
  63336. -1,
  63337. 1,
  63338. -1,
  63339. 1,
  63340. -1,
  63341. -1,
  63342. 1,
  63343. 1,
  63344. 1,
  63345. -1,
  63346. -1,
  63347. 1,
  63348. -1,
  63349. 1,
  63350. 1,
  63351. 1,
  63352. -1,
  63353. 1,
  63354. 1,
  63355. 1,
  63356. 0,
  63357. -r,
  63358. -i,
  63359. 0,
  63360. -r,
  63361. i,
  63362. 0,
  63363. r,
  63364. -i,
  63365. 0,
  63366. r,
  63367. i,
  63368. -r,
  63369. -i,
  63370. 0,
  63371. -r,
  63372. i,
  63373. 0,
  63374. r,
  63375. -i,
  63376. 0,
  63377. r,
  63378. i,
  63379. 0,
  63380. -i,
  63381. 0,
  63382. -r,
  63383. i,
  63384. 0,
  63385. -r,
  63386. -i,
  63387. 0,
  63388. r,
  63389. i,
  63390. 0,
  63391. r,
  63392. ],
  63393. a = [
  63394. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10,
  63395. 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6,
  63396. 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4,
  63397. 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19,
  63398. 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9,
  63399. ];
  63400. n.PolyhedronGeometry.call(this, o, a, e, t),
  63401. (this.type = 'DodecahedronGeometry'),
  63402. (this.parameters = {
  63403. radius: e,
  63404. detail: t,
  63405. });
  63406. }),
  63407. (n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63408. (n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry),
  63409. (n.IcosahedronGeometry = function (e, t) {
  63410. var i = (1 + Math.sqrt(5)) / 2,
  63411. r = [
  63412. -1,
  63413. i,
  63414. 0,
  63415. 1,
  63416. i,
  63417. 0,
  63418. -1,
  63419. -i,
  63420. 0,
  63421. 1,
  63422. -i,
  63423. 0,
  63424. 0,
  63425. -1,
  63426. i,
  63427. 0,
  63428. 1,
  63429. i,
  63430. 0,
  63431. -1,
  63432. -i,
  63433. 0,
  63434. 1,
  63435. -i,
  63436. i,
  63437. 0,
  63438. -1,
  63439. i,
  63440. 0,
  63441. 1,
  63442. -i,
  63443. 0,
  63444. -1,
  63445. -i,
  63446. 0,
  63447. 1,
  63448. ],
  63449. o = [
  63450. 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10,
  63451. 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2,
  63452. 10, 8, 6, 7, 9, 8, 1,
  63453. ];
  63454. n.PolyhedronGeometry.call(this, r, o, e, t),
  63455. (this.type = 'IcosahedronGeometry'),
  63456. (this.parameters = {
  63457. radius: e,
  63458. detail: t,
  63459. });
  63460. }),
  63461. (n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63462. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  63463. (n.OctahedronGeometry = function (e, t) {
  63464. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  63465. r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  63466. n.PolyhedronGeometry.call(this, i, r, e, t),
  63467. (this.type = 'OctahedronGeometry'),
  63468. (this.parameters = {
  63469. radius: e,
  63470. detail: t,
  63471. });
  63472. }),
  63473. (n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63474. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  63475. (n.TetrahedronGeometry = function (e, t) {
  63476. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  63477. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  63478. n.PolyhedronGeometry.call(this, i, r, e, t),
  63479. (this.type = 'TetrahedronGeometry'),
  63480. (this.parameters = {
  63481. radius: e,
  63482. detail: t,
  63483. });
  63484. }),
  63485. (n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63486. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  63487. (n.ParametricGeometry = function (e, t, i) {
  63488. n.Geometry.call(this),
  63489. (this.type = 'ParametricGeometry'),
  63490. (this.parameters = {
  63491. func: e,
  63492. slices: t,
  63493. stacks: i,
  63494. });
  63495. var r,
  63496. o,
  63497. a,
  63498. s,
  63499. l,
  63500. c = this.vertices,
  63501. h = this.faces,
  63502. u = this.faceVertexUvs[0],
  63503. d = t + 1;
  63504. for (r = 0; r <= i; r++)
  63505. for (l = r / i, o = 0; o <= t; o++) (s = o / t), (a = e(s, l)), c.push(a);
  63506. var p, f, g, m, v, A, y, C;
  63507. for (r = 0; r < i; r++)
  63508. for (o = 0; o < t; o++)
  63509. (p = r * d + o),
  63510. (f = r * d + o + 1),
  63511. (g = (r + 1) * d + o + 1),
  63512. (m = (r + 1) * d + o),
  63513. (v = new n.Vector2(o / t, r / i)),
  63514. (A = new n.Vector2((o + 1) / t, r / i)),
  63515. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  63516. (C = new n.Vector2(o / t, (r + 1) / i)),
  63517. h.push(new n.Face3(p, f, m)),
  63518. u.push([v, A, C]),
  63519. h.push(new n.Face3(f, g, m)),
  63520. u.push([A.clone(), y, C.clone()]);
  63521. this.computeFaceNormals(), this.computeVertexNormals();
  63522. }),
  63523. (n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype)),
  63524. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  63525. (n.WireframeGeometry = function (e) {
  63526. function t(e, t) {
  63527. return e - t;
  63528. }
  63529. n.BufferGeometry.call(this);
  63530. var i = [0, 0],
  63531. r = {},
  63532. o = ['a', 'b', 'c'];
  63533. if (e instanceof n.Geometry) {
  63534. for (
  63535. var a = e.vertices,
  63536. s = e.faces,
  63537. l = 0,
  63538. c = new Uint32Array(6 * s.length),
  63539. h = 0,
  63540. u = s.length;
  63541. h < u;
  63542. h++
  63543. )
  63544. for (var d = s[h], p = 0; p < 3; p++) {
  63545. (i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t);
  63546. var f = i.toString();
  63547. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++);
  63548. }
  63549. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63550. for (var p = 0; p < 2; p++) {
  63551. var m = a[c[2 * h + p]],
  63552. v = 6 * h + 3 * p;
  63553. (g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z);
  63554. }
  63555. this.addAttribute('position', new n.BufferAttribute(g, 3));
  63556. } else if (e instanceof n.BufferGeometry)
  63557. if (null !== e.index) {
  63558. var A = e.index.array,
  63559. a = e.attributes.position,
  63560. y = e.groups,
  63561. l = 0;
  63562. 0 === y.length && e.addGroup(0, A.length);
  63563. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  63564. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  63565. for (var p = 0; p < 3; p++) {
  63566. (i[0] = A[h + p]), (i[1] = A[h + ((p + 1) % 3)]), i.sort(t);
  63567. var f = i.toString();
  63568. void 0 === r[f] &&
  63569. ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++);
  63570. }
  63571. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63572. for (var p = 0; p < 2; p++) {
  63573. var v = 6 * h + 3 * p,
  63574. T = c[2 * h + p];
  63575. (g[v + 0] = a.getX(T)), (g[v + 1] = a.getY(T)), (g[v + 2] = a.getZ(T));
  63576. }
  63577. this.addAttribute('position', new n.BufferAttribute(g, 3));
  63578. } else {
  63579. for (
  63580. var a = e.attributes.position.array,
  63581. l = a.length / 3,
  63582. x = l / 3,
  63583. g = new Float32Array(2 * l * 3),
  63584. h = 0,
  63585. u = x;
  63586. h < u;
  63587. h++
  63588. )
  63589. for (var p = 0; p < 3; p++) {
  63590. var v = 18 * h + 6 * p,
  63591. S = 9 * h + 3 * p;
  63592. (g[v + 0] = a[S]), (g[v + 1] = a[S + 1]), (g[v + 2] = a[S + 2]);
  63593. var T = 9 * h + 3 * ((p + 1) % 3);
  63594. (g[v + 3] = a[T]), (g[v + 4] = a[T + 1]), (g[v + 5] = a[T + 2]);
  63595. }
  63596. this.addAttribute('position', new n.BufferAttribute(g, 3));
  63597. }
  63598. }),
  63599. (n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63600. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  63601. (n.AxisHelper = function (e) {
  63602. e = e || 1;
  63603. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  63604. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  63605. r = new n.BufferGeometry();
  63606. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  63607. r.addAttribute('color', new n.BufferAttribute(i, 3));
  63608. var o = new n.LineBasicMaterial({
  63609. vertexColors: n.VertexColors,
  63610. });
  63611. n.LineSegments.call(this, r, o);
  63612. }),
  63613. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  63614. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  63615. (n.ArrowHelper = (function () {
  63616. var e = new n.Geometry();
  63617. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0));
  63618. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1);
  63619. return (
  63620. t.translate(0, -0.5, 0),
  63621. function (i, r, o, a, s, l) {
  63622. n.Object3D.call(this),
  63623. void 0 === a && (a = 16776960),
  63624. void 0 === o && (o = 1),
  63625. void 0 === s && (s = 0.2 * o),
  63626. void 0 === l && (l = 0.2 * s),
  63627. this.position.copy(r),
  63628. (this.line = new n.Line(
  63629. e,
  63630. new n.LineBasicMaterial({
  63631. color: a,
  63632. })
  63633. )),
  63634. (this.line.matrixAutoUpdate = !1),
  63635. this.add(this.line),
  63636. (this.cone = new n.Mesh(
  63637. t,
  63638. new n.MeshBasicMaterial({
  63639. color: a,
  63640. })
  63641. )),
  63642. (this.cone.matrixAutoUpdate = !1),
  63643. this.add(this.cone),
  63644. this.setDirection(i),
  63645. this.setLength(o, s, l);
  63646. }
  63647. );
  63648. })()),
  63649. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  63650. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  63651. (n.ArrowHelper.prototype.setDirection = (function () {
  63652. var e,
  63653. t = new n.Vector3();
  63654. return function (i) {
  63655. i.y > 0.99999
  63656. ? this.quaternion.set(0, 0, 0, 1)
  63657. : i.y < -0.99999
  63658. ? this.quaternion.set(1, 0, 0, 0)
  63659. : (t.set(i.z, 0, -i.x).normalize(),
  63660. (e = Math.acos(i.y)),
  63661. this.quaternion.setFromAxisAngle(t, e));
  63662. };
  63663. })()),
  63664. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  63665. void 0 === t && (t = 0.2 * e),
  63666. void 0 === i && (i = 0.2 * t),
  63667. this.line.scale.set(1, Math.max(0, e - t), 1),
  63668. this.line.updateMatrix(),
  63669. this.cone.scale.set(i, t, i),
  63670. (this.cone.position.y = e),
  63671. this.cone.updateMatrix();
  63672. }),
  63673. (n.ArrowHelper.prototype.setColor = function (e) {
  63674. this.line.material.color.set(e), this.cone.material.color.set(e);
  63675. }),
  63676. (n.BoxHelper = function (e) {
  63677. var t = new Uint16Array([
  63678. 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7,
  63679. ]),
  63680. i = new Float32Array(24),
  63681. r = new n.BufferGeometry();
  63682. r.setIndex(new n.BufferAttribute(t, 1)),
  63683. r.addAttribute('position', new n.BufferAttribute(i, 3)),
  63684. n.LineSegments.call(
  63685. this,
  63686. r,
  63687. new n.LineBasicMaterial({
  63688. color: 16776960,
  63689. })
  63690. ),
  63691. void 0 !== e && this.update(e);
  63692. }),
  63693. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  63694. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  63695. (n.BoxHelper.prototype.update = (function () {
  63696. var e = new n.Box3();
  63697. return function (t) {
  63698. if ((e.setFromObject(t), !e.isEmpty())) {
  63699. var i = e.min,
  63700. n = e.max,
  63701. r = this.geometry.attributes.position,
  63702. o = r.array;
  63703. (o[0] = n.x),
  63704. (o[1] = n.y),
  63705. (o[2] = n.z),
  63706. (o[3] = i.x),
  63707. (o[4] = n.y),
  63708. (o[5] = n.z),
  63709. (o[6] = i.x),
  63710. (o[7] = i.y),
  63711. (o[8] = n.z),
  63712. (o[9] = n.x),
  63713. (o[10] = i.y),
  63714. (o[11] = n.z),
  63715. (o[12] = n.x),
  63716. (o[13] = n.y),
  63717. (o[14] = i.z),
  63718. (o[15] = i.x),
  63719. (o[16] = n.y),
  63720. (o[17] = i.z),
  63721. (o[18] = i.x),
  63722. (o[19] = i.y),
  63723. (o[20] = i.z),
  63724. (o[21] = n.x),
  63725. (o[22] = i.y),
  63726. (o[23] = i.z),
  63727. (r.needsUpdate = !0),
  63728. this.geometry.computeBoundingSphere();
  63729. }
  63730. };
  63731. })()),
  63732. (n.BoundingBoxHelper = function (e, t) {
  63733. var i = void 0 !== t ? t : 8947848;
  63734. (this.object = e),
  63735. (this.box = new n.Box3()),
  63736. n.Mesh.call(
  63737. this,
  63738. new n.BoxGeometry(1, 1, 1),
  63739. new n.MeshBasicMaterial({
  63740. color: i,
  63741. wireframe: !0,
  63742. })
  63743. );
  63744. }),
  63745. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  63746. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  63747. (n.BoundingBoxHelper.prototype.update = function () {
  63748. this.box.setFromObject(this.object),
  63749. this.box.size(this.scale),
  63750. this.box.center(this.position);
  63751. }),
  63752. (n.CameraHelper = function (e) {
  63753. function t(e, t, n) {
  63754. i(e, n), i(t, n);
  63755. }
  63756. function i(e, t) {
  63757. r.vertices.push(new n.Vector3()),
  63758. r.colors.push(new n.Color(t)),
  63759. void 0 === a[e] && (a[e] = []),
  63760. a[e].push(r.vertices.length - 1);
  63761. }
  63762. var r = new n.Geometry(),
  63763. o = new n.LineBasicMaterial({
  63764. color: 16777215,
  63765. vertexColors: n.FaceColors,
  63766. }),
  63767. a = {},
  63768. s = 16755200,
  63769. l = 16711680,
  63770. c = 43775,
  63771. h = 16777215,
  63772. u = 3355443;
  63773. t('n1', 'n2', s),
  63774. t('n2', 'n4', s),
  63775. t('n4', 'n3', s),
  63776. t('n3', 'n1', s),
  63777. t('f1', 'f2', s),
  63778. t('f2', 'f4', s),
  63779. t('f4', 'f3', s),
  63780. t('f3', 'f1', s),
  63781. t('n1', 'f1', s),
  63782. t('n2', 'f2', s),
  63783. t('n3', 'f3', s),
  63784. t('n4', 'f4', s),
  63785. t('p', 'n1', l),
  63786. t('p', 'n2', l),
  63787. t('p', 'n3', l),
  63788. t('p', 'n4', l),
  63789. t('u1', 'u2', c),
  63790. t('u2', 'u3', c),
  63791. t('u3', 'u1', c),
  63792. t('c', 't', h),
  63793. t('p', 'c', u),
  63794. t('cn1', 'cn2', u),
  63795. t('cn3', 'cn4', u),
  63796. t('cf1', 'cf2', u),
  63797. t('cf3', 'cf4', u),
  63798. n.LineSegments.call(this, r, o),
  63799. (this.camera = e),
  63800. this.camera.updateProjectionMatrix(),
  63801. (this.matrix = e.matrixWorld),
  63802. (this.matrixAutoUpdate = !1),
  63803. (this.pointMap = a),
  63804. this.update();
  63805. }),
  63806. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  63807. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  63808. (n.CameraHelper.prototype.update = (function () {
  63809. function e(e, n, a, s) {
  63810. r.set(n, a, s).unproject(o);
  63811. var l = i[e];
  63812. if (void 0 !== l) for (var c = 0, h = l.length; c < h; c++) t.vertices[l[c]].copy(r);
  63813. }
  63814. var t,
  63815. i,
  63816. r = new n.Vector3(),
  63817. o = new n.Camera();
  63818. return function () {
  63819. (t = this.geometry), (i = this.pointMap);
  63820. var n = 1,
  63821. r = 1;
  63822. o.projectionMatrix.copy(this.camera.projectionMatrix),
  63823. e('c', 0, 0, -1),
  63824. e('t', 0, 0, 1),
  63825. e('n1', -n, -r, -1),
  63826. e('n2', n, -r, -1),
  63827. e('n3', -n, r, -1),
  63828. e('n4', n, r, -1),
  63829. e('f1', -n, -r, 1),
  63830. e('f2', n, -r, 1),
  63831. e('f3', -n, r, 1),
  63832. e('f4', n, r, 1),
  63833. e('u1', 0.7 * n, 1.1 * r, -1),
  63834. e('u2', 0.7 * -n, 1.1 * r, -1),
  63835. e('u3', 0, 2 * r, -1),
  63836. e('cf1', -n, 0, 1),
  63837. e('cf2', n, 0, 1),
  63838. e('cf3', 0, -r, 1),
  63839. e('cf4', 0, r, 1),
  63840. e('cn1', -n, 0, -1),
  63841. e('cn2', n, 0, -1),
  63842. e('cn3', 0, -r, -1),
  63843. e('cn4', 0, r, -1),
  63844. (t.verticesNeedUpdate = !0);
  63845. };
  63846. })()),
  63847. (n.DirectionalLightHelper = function (e, t) {
  63848. n.Object3D.call(this),
  63849. (this.light = e),
  63850. this.light.updateMatrixWorld(),
  63851. (this.matrix = e.matrixWorld),
  63852. (this.matrixAutoUpdate = !1),
  63853. (t = t || 1);
  63854. var i = new n.Geometry();
  63855. i.vertices.push(
  63856. new n.Vector3(-t, t, 0),
  63857. new n.Vector3(t, t, 0),
  63858. new n.Vector3(t, -t, 0),
  63859. new n.Vector3(-t, -t, 0),
  63860. new n.Vector3(-t, t, 0)
  63861. );
  63862. var r = new n.LineBasicMaterial({
  63863. fog: !1,
  63864. });
  63865. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63866. (this.lightPlane = new n.Line(i, r)),
  63867. this.add(this.lightPlane),
  63868. (i = new n.Geometry()),
  63869. i.vertices.push(new n.Vector3(), new n.Vector3()),
  63870. (r = new n.LineBasicMaterial({
  63871. fog: !1,
  63872. })),
  63873. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63874. (this.targetLine = new n.Line(i, r)),
  63875. this.add(this.targetLine),
  63876. this.update();
  63877. }),
  63878. (n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype)),
  63879. (n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper),
  63880. (n.DirectionalLightHelper.prototype.dispose = function () {
  63881. this.lightPlane.geometry.dispose(),
  63882. this.lightPlane.material.dispose(),
  63883. this.targetLine.geometry.dispose(),
  63884. this.targetLine.material.dispose();
  63885. }),
  63886. (n.DirectionalLightHelper.prototype.update = (function () {
  63887. var e = new n.Vector3(),
  63888. t = new n.Vector3(),
  63889. i = new n.Vector3();
  63890. return function () {
  63891. e.setFromMatrixPosition(this.light.matrixWorld),
  63892. t.setFromMatrixPosition(this.light.target.matrixWorld),
  63893. i.subVectors(t, e),
  63894. this.lightPlane.lookAt(i),
  63895. this.lightPlane.material.color
  63896. .copy(this.light.color)
  63897. .multiplyScalar(this.light.intensity),
  63898. this.targetLine.geometry.vertices[1].copy(i),
  63899. (this.targetLine.geometry.verticesNeedUpdate = !0),
  63900. this.targetLine.material.color.copy(this.lightPlane.material.color);
  63901. };
  63902. })()),
  63903. (n.EdgesHelper = function (e, t, i) {
  63904. var r = void 0 !== t ? t : 16777215;
  63905. n.LineSegments.call(
  63906. this,
  63907. new n.EdgesGeometry(e.geometry, i),
  63908. new n.LineBasicMaterial({
  63909. color: r,
  63910. })
  63911. ),
  63912. (this.matrix = e.matrixWorld),
  63913. (this.matrixAutoUpdate = !1);
  63914. }),
  63915. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  63916. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  63917. (n.FaceNormalsHelper = function (e, t, i, r) {
  63918. (this.object = e), (this.size = void 0 !== t ? t : 1);
  63919. var o = void 0 !== i ? i : 16776960,
  63920. a = void 0 !== r ? r : 1,
  63921. s = 0,
  63922. l = this.object.geometry;
  63923. l instanceof n.Geometry
  63924. ? (s = l.faces.length)
  63925. : console.warn(
  63926. 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.'
  63927. );
  63928. var c = new n.BufferGeometry(),
  63929. h = new n.Float32Attribute(2 * s * 3, 3);
  63930. c.addAttribute('position', h),
  63931. n.LineSegments.call(
  63932. this,
  63933. c,
  63934. new n.LineBasicMaterial({
  63935. color: o,
  63936. linewidth: a,
  63937. })
  63938. ),
  63939. (this.matrixAutoUpdate = !1),
  63940. this.update();
  63941. }),
  63942. (n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  63943. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  63944. (n.FaceNormalsHelper.prototype.update = (function () {
  63945. var e = new n.Vector3(),
  63946. t = new n.Vector3(),
  63947. i = new n.Matrix3();
  63948. return function () {
  63949. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld);
  63950. for (
  63951. var n = this.object.matrixWorld,
  63952. r = this.geometry.attributes.position,
  63953. o = this.object.geometry,
  63954. a = o.vertices,
  63955. s = o.faces,
  63956. l = 0,
  63957. c = 0,
  63958. h = s.length;
  63959. c < h;
  63960. c++
  63961. ) {
  63962. var u = s[c],
  63963. d = u.normal;
  63964. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  63965. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  63966. r.setXYZ(l, e.x, e.y, e.z),
  63967. (l += 1),
  63968. r.setXYZ(l, t.x, t.y, t.z),
  63969. (l += 1);
  63970. }
  63971. return (r.needsUpdate = !0), this;
  63972. };
  63973. })()),
  63974. (n.GridHelper = function (e, t) {
  63975. var i = new n.Geometry(),
  63976. r = new n.LineBasicMaterial({
  63977. vertexColors: n.VertexColors,
  63978. });
  63979. (this.color1 = new n.Color(4473924)), (this.color2 = new n.Color(8947848));
  63980. for (var o = -e; o <= e; o += t) {
  63981. i.vertices.push(
  63982. new n.Vector3(-e, 0, o),
  63983. new n.Vector3(e, 0, o),
  63984. new n.Vector3(o, 0, -e),
  63985. new n.Vector3(o, 0, e)
  63986. );
  63987. var a = 0 === o ? this.color1 : this.color2;
  63988. i.colors.push(a, a, a, a);
  63989. }
  63990. n.LineSegments.call(this, i, r);
  63991. }),
  63992. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  63993. (n.GridHelper.prototype.constructor = n.GridHelper),
  63994. (n.GridHelper.prototype.setColors = function (e, t) {
  63995. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0);
  63996. }),
  63997. (n.HemisphereLightHelper = function (e, t) {
  63998. n.Object3D.call(this),
  63999. (this.light = e),
  64000. this.light.updateMatrixWorld(),
  64001. (this.matrix = e.matrixWorld),
  64002. (this.matrixAutoUpdate = !1),
  64003. (this.colors = [new n.Color(), new n.Color()]);
  64004. var i = new n.SphereGeometry(t, 4, 2);
  64005. i.rotateX(-Math.PI / 2);
  64006. for (var r = 0, o = 8; r < o; r++) i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  64007. var a = new n.MeshBasicMaterial({
  64008. vertexColors: n.FaceColors,
  64009. wireframe: !0,
  64010. });
  64011. (this.lightSphere = new n.Mesh(i, a)), this.add(this.lightSphere), this.update();
  64012. }),
  64013. (n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64014. (n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper),
  64015. (n.HemisphereLightHelper.prototype.dispose = function () {
  64016. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose();
  64017. }),
  64018. (n.HemisphereLightHelper.prototype.update = (function () {
  64019. var e = new n.Vector3();
  64020. return function () {
  64021. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  64022. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  64023. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  64024. (this.lightSphere.geometry.colorsNeedUpdate = !0);
  64025. };
  64026. })()),
  64027. (n.PointLightHelper = function (e, t) {
  64028. (this.light = e), this.light.updateMatrixWorld();
  64029. var i = new n.SphereGeometry(t, 4, 2),
  64030. r = new n.MeshBasicMaterial({
  64031. wireframe: !0,
  64032. fog: !1,
  64033. });
  64034. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  64035. n.Mesh.call(this, i, r),
  64036. (this.matrix = this.light.matrixWorld),
  64037. (this.matrixAutoUpdate = !1);
  64038. }),
  64039. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  64040. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  64041. (n.PointLightHelper.prototype.dispose = function () {
  64042. this.geometry.dispose(), this.material.dispose();
  64043. }),
  64044. (n.PointLightHelper.prototype.update = function () {
  64045. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
  64046. }),
  64047. (n.SkeletonHelper = function (e) {
  64048. this.bones = this.getBoneList(e);
  64049. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  64050. var r = this.bones[i];
  64051. r.parent instanceof n.Bone &&
  64052. (t.vertices.push(new n.Vector3()),
  64053. t.vertices.push(new n.Vector3()),
  64054. t.colors.push(new n.Color(0, 0, 1)),
  64055. t.colors.push(new n.Color(0, 1, 0)));
  64056. }
  64057. t.dynamic = !0;
  64058. var o = new n.LineBasicMaterial({
  64059. vertexColors: n.VertexColors,
  64060. depthTest: !1,
  64061. depthWrite: !1,
  64062. transparent: !0,
  64063. });
  64064. n.LineSegments.call(this, t, o),
  64065. (this.root = e),
  64066. (this.matrix = e.matrixWorld),
  64067. (this.matrixAutoUpdate = !1),
  64068. this.update();
  64069. }),
  64070. (n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype)),
  64071. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  64072. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  64073. var t = [];
  64074. e instanceof n.Bone && t.push(e);
  64075. for (var i = 0; i < e.children.length; i++)
  64076. t.push.apply(t, this.getBoneList(e.children[i]));
  64077. return t;
  64078. }),
  64079. (n.SkeletonHelper.prototype.update = function () {
  64080. for (
  64081. var e = this.geometry,
  64082. t = new n.Matrix4().getInverse(this.root.matrixWorld),
  64083. i = new n.Matrix4(),
  64084. r = 0,
  64085. o = 0;
  64086. o < this.bones.length;
  64087. o++
  64088. ) {
  64089. var a = this.bones[o];
  64090. a.parent instanceof n.Bone &&
  64091. (i.multiplyMatrices(t, a.matrixWorld),
  64092. e.vertices[r].setFromMatrixPosition(i),
  64093. i.multiplyMatrices(t, a.parent.matrixWorld),
  64094. e.vertices[r + 1].setFromMatrixPosition(i),
  64095. (r += 2));
  64096. }
  64097. (e.verticesNeedUpdate = !0), e.computeBoundingSphere();
  64098. }),
  64099. (n.SpotLightHelper = function (e) {
  64100. n.Object3D.call(this),
  64101. (this.light = e),
  64102. this.light.updateMatrixWorld(),
  64103. (this.matrix = e.matrixWorld),
  64104. (this.matrixAutoUpdate = !1);
  64105. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0);
  64106. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2);
  64107. var i = new n.MeshBasicMaterial({
  64108. wireframe: !0,
  64109. fog: !1,
  64110. });
  64111. (this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update();
  64112. }),
  64113. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64114. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  64115. (n.SpotLightHelper.prototype.dispose = function () {
  64116. this.cone.geometry.dispose(), this.cone.material.dispose();
  64117. }),
  64118. (n.SpotLightHelper.prototype.update = (function () {
  64119. var e = new n.Vector3(),
  64120. t = new n.Vector3();
  64121. return function () {
  64122. var i = this.light.distance ? this.light.distance : 1e4,
  64123. n = i * Math.tan(this.light.angle);
  64124. this.cone.scale.set(n, n, i),
  64125. e.setFromMatrixPosition(this.light.matrixWorld),
  64126. t.setFromMatrixPosition(this.light.target.matrixWorld),
  64127. this.cone.lookAt(t.sub(e)),
  64128. this.cone.material.color
  64129. .copy(this.light.color)
  64130. .multiplyScalar(this.light.intensity);
  64131. };
  64132. })()),
  64133. (n.VertexNormalsHelper = function (e, t, i, r) {
  64134. (this.object = e), (this.size = void 0 !== t ? t : 1);
  64135. var o = void 0 !== i ? i : 16711680,
  64136. a = void 0 !== r ? r : 1,
  64137. s = 0,
  64138. l = this.object.geometry;
  64139. l instanceof n.Geometry
  64140. ? (s = 3 * l.faces.length)
  64141. : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  64142. var c = new n.BufferGeometry(),
  64143. h = new n.Float32Attribute(2 * s * 3, 3);
  64144. c.addAttribute('position', h),
  64145. n.LineSegments.call(
  64146. this,
  64147. c,
  64148. new n.LineBasicMaterial({
  64149. color: o,
  64150. linewidth: a,
  64151. })
  64152. ),
  64153. (this.matrixAutoUpdate = !1),
  64154. this.update();
  64155. }),
  64156. (n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  64157. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  64158. (n.VertexNormalsHelper.prototype.update = (function () {
  64159. var e = new n.Vector3(),
  64160. t = new n.Vector3(),
  64161. i = new n.Matrix3();
  64162. return function () {
  64163. var r = ['a', 'b', 'c'];
  64164. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld);
  64165. var o = this.object.matrixWorld,
  64166. a = this.geometry.attributes.position,
  64167. s = this.object.geometry;
  64168. if (s instanceof n.Geometry)
  64169. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  64170. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  64171. var m = l[p[r[f]]],
  64172. v = p.vertexNormals[f];
  64173. e.copy(m).applyMatrix4(o),
  64174. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64175. a.setXYZ(h, e.x, e.y, e.z),
  64176. (h += 1),
  64177. a.setXYZ(h, t.x, t.y, t.z),
  64178. (h += 1);
  64179. }
  64180. else if (s instanceof n.BufferGeometry)
  64181. for (
  64182. var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count;
  64183. f < g;
  64184. f++
  64185. )
  64186. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  64187. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  64188. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64189. a.setXYZ(h, e.x, e.y, e.z),
  64190. (h += 1),
  64191. a.setXYZ(h, t.x, t.y, t.z),
  64192. (h += 1);
  64193. return (a.needsUpdate = !0), this;
  64194. };
  64195. })()),
  64196. (n.WireframeHelper = function (e, t) {
  64197. var i = void 0 !== t ? t : 16777215;
  64198. n.LineSegments.call(
  64199. this,
  64200. new n.WireframeGeometry(e.geometry),
  64201. new n.LineBasicMaterial({
  64202. color: i,
  64203. })
  64204. ),
  64205. (this.matrix = e.matrixWorld),
  64206. (this.matrixAutoUpdate = !1);
  64207. }),
  64208. (n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype)),
  64209. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  64210. (n.ImmediateRenderObject = function (e) {
  64211. n.Object3D.call(this), (this.material = e), (this.render = function (e) {});
  64212. }),
  64213. (n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype)),
  64214. (n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject),
  64215. (n.MorphBlendMesh = function (e, t) {
  64216. n.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = []);
  64217. var i = this.geometry.morphTargets.length,
  64218. r = '__default',
  64219. o = 0,
  64220. a = i - 1,
  64221. s = i / 1;
  64222. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1);
  64223. }),
  64224. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  64225. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  64226. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  64227. var r = {
  64228. start: t,
  64229. end: i,
  64230. length: i - t + 1,
  64231. fps: n,
  64232. duration: (i - t) / n,
  64233. lastFrame: 0,
  64234. currentFrame: 0,
  64235. active: !1,
  64236. time: 0,
  64237. direction: 1,
  64238. weight: 1,
  64239. directionBackwards: !1,
  64240. mirroredLoop: !1,
  64241. };
  64242. (this.animationsMap[e] = r), this.animationsList.push(r);
  64243. }),
  64244. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  64245. for (
  64246. var t,
  64247. i = /([a-z]+)_?(\d+)/i,
  64248. n = {},
  64249. r = this.geometry,
  64250. o = 0,
  64251. a = r.morphTargets.length;
  64252. o < a;
  64253. o++
  64254. ) {
  64255. var s = r.morphTargets[o],
  64256. l = s.name.match(i);
  64257. if (l && l.length > 1) {
  64258. var c = l[1];
  64259. n[c] ||
  64260. (n[c] = {
  64261. start: 1 / 0,
  64262. end: -(1 / 0),
  64263. });
  64264. var h = n[c];
  64265. o < h.start && (h.start = o), o > h.end && (h.end = o), t || (t = c);
  64266. }
  64267. }
  64268. for (var c in n) {
  64269. var h = n[c];
  64270. this.createAnimation(c, h.start, h.end, e);
  64271. }
  64272. this.firstAnimation = t;
  64273. }),
  64274. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  64275. var t = this.animationsMap[e];
  64276. t && ((t.direction = 1), (t.directionBackwards = !1));
  64277. }),
  64278. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  64279. var t = this.animationsMap[e];
  64280. t && ((t.direction = -1), (t.directionBackwards = !0));
  64281. }),
  64282. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  64283. var i = this.animationsMap[e];
  64284. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps));
  64285. }),
  64286. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  64287. var i = this.animationsMap[e];
  64288. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration));
  64289. }),
  64290. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  64291. var i = this.animationsMap[e];
  64292. i && (i.weight = t);
  64293. }),
  64294. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  64295. var i = this.animationsMap[e];
  64296. i && (i.time = t);
  64297. }),
  64298. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  64299. var t = 0,
  64300. i = this.animationsMap[e];
  64301. return i && (t = i.time), t;
  64302. }),
  64303. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  64304. var t = -1,
  64305. i = this.animationsMap[e];
  64306. return i && (t = i.duration), t;
  64307. }),
  64308. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  64309. var t = this.animationsMap[e];
  64310. t
  64311. ? ((t.time = 0), (t.active = !0))
  64312. : console.warn(
  64313. 'THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()'
  64314. );
  64315. }),
  64316. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  64317. var t = this.animationsMap[e];
  64318. t && (t.active = !1);
  64319. }),
  64320. (n.MorphBlendMesh.prototype.update = function (e) {
  64321. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  64322. var r = this.animationsList[t];
  64323. if (r.active) {
  64324. var o = r.duration / r.length;
  64325. (r.time += r.direction * e),
  64326. r.mirroredLoop
  64327. ? (r.time > r.duration || r.time < 0) &&
  64328. ((r.direction *= -1),
  64329. r.time > r.duration && ((r.time = r.duration), (r.directionBackwards = !0)),
  64330. r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  64331. : ((r.time = r.time % r.duration), r.time < 0 && (r.time += r.duration));
  64332. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  64333. s = r.weight;
  64334. a !== r.currentFrame &&
  64335. ((this.morphTargetInfluences[r.lastFrame] = 0),
  64336. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  64337. (this.morphTargetInfluences[a] = 0),
  64338. (r.lastFrame = r.currentFrame),
  64339. (r.currentFrame = a));
  64340. var l = (r.time % o) / o;
  64341. r.directionBackwards && (l = 1 - l),
  64342. r.currentFrame !== r.lastFrame
  64343. ? ((this.morphTargetInfluences[r.currentFrame] = l * s),
  64344. (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  64345. : (this.morphTargetInfluences[r.currentFrame] = s);
  64346. }
  64347. }
  64348. }),
  64349. 'undefined' != typeof i
  64350. ? ('undefined' != typeof t && t.exports && (i = t.exports = n), (i.THREE = n))
  64351. : (this.THREE = n);
  64352. window.THREE = n;
  64353. getObjLoader();
  64354. initByTHREE(THREE);
  64355. //getWebXRManager()
  64356. },
  64357. {},
  64358. ],
  64359. },
  64360. {},
  64361. [116]
  64362. );
  64363. /*
  64364. function getWebXRManager(){
  64365. class ArrayCamera extends THREE.PerspectiveCamera {
  64366. constructor(array = []) {
  64367. super();
  64368. this.isArrayCamera = true;
  64369. this.cameras = array;
  64370. }
  64371. }
  64372. function WebGLAnimation() {
  64373. let context = null;
  64374. let isAnimating = false;
  64375. let animationLoop = null;
  64376. let requestId = null;
  64377. function onAnimationFrame(time, frame) {
  64378. animationLoop(time, frame);
  64379. requestId = context.requestAnimationFrame(onAnimationFrame);
  64380. }
  64381. return {
  64382. start: function () {
  64383. if (isAnimating === true) return;
  64384. if (animationLoop === null) return;
  64385. requestId = context.requestAnimationFrame(onAnimationFrame);
  64386. isAnimating = true;
  64387. },
  64388. stop: function () {
  64389. context.cancelAnimationFrame(requestId);
  64390. isAnimating = false;
  64391. },
  64392. setAnimationLoop: function (callback) {
  64393. animationLoop = callback;
  64394. },
  64395. setContext: function (value) {
  64396. context = value;
  64397. }
  64398. };
  64399. }
  64400. function WebXRManager( renderer, gl ) {
  64401. var scope = this;
  64402. var session = null;
  64403. // var framebufferScaleFactor = 1.0;
  64404. var referenceSpace = null;
  64405. var referenceSpaceType = 'local-floor';
  64406. var pose = null;
  64407. var controllers = [];
  64408. var sortedInputSources = [];
  64409. function isPresenting() {
  64410. return session !== null && referenceSpace !== null;
  64411. }
  64412. //
  64413. var cameraL = new THREE.PerspectiveCamera();
  64414. cameraL.layers.enable( 1 );
  64415. cameraL.viewport = new THREE.Vector4();
  64416. var cameraR = new THREE.PerspectiveCamera();
  64417. cameraR.layers.enable( 2 );
  64418. cameraR.viewport = new THREE.Vector4();
  64419. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  64420. cameraVR.layers.enable( 1 );
  64421. cameraVR.layers.enable( 2 );
  64422. //
  64423. this.enabled = false;
  64424. this.getController = function ( id ) {
  64425. var controller = controllers[ id ];
  64426. if ( controller === undefined ) {
  64427. controller = new THREE.Group();
  64428. controller.matrixAutoUpdate = false;
  64429. controller.visible = false;
  64430. controllers[ id ] = controller;
  64431. }
  64432. return controller;
  64433. };
  64434. //
  64435. function onSessionEvent( event ) {
  64436. for ( var i = 0; i < controllers.length; i ++ ) {
  64437. if ( sortedInputSources[ i ] === event.inputSource ) {
  64438. controllers[ i ].dispatchEvent( { type: event.type } );
  64439. }
  64440. }
  64441. }
  64442. function onSessionEnd() {
  64443. renderer.setFramebuffer( null );
  64444. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  64445. animation.stop();
  64446. scope.dispatchEvent( { type: 'sessionend' } );
  64447. }
  64448. function onRequestReferenceSpace( value ) {
  64449. referenceSpace = value;
  64450. animation.setContext( session );
  64451. animation.start();
  64452. scope.dispatchEvent( { type: 'sessionstart' } );
  64453. }
  64454. this.setFramebufferScaleFactor = function ( ) {
  64455. // framebufferScaleFactor = value;
  64456. };
  64457. this.setReferenceSpaceType = function ( value ) {
  64458. referenceSpaceType = value;
  64459. };
  64460. this.getSession = function () {
  64461. return session;
  64462. };
  64463. this.setSession = function ( value ) {
  64464. session = value;
  64465. if ( session !== null ) {
  64466. session.addEventListener( 'select', onSessionEvent );
  64467. session.addEventListener( 'selectstart', onSessionEvent );
  64468. session.addEventListener( 'selectend', onSessionEvent );
  64469. session.addEventListener( 'end', onSessionEnd );
  64470. // eslint-disable-next-line no-undef
  64471. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  64472. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  64473. //
  64474. session.addEventListener( 'inputsourceschange', updateInputSources );
  64475. updateInputSources();
  64476. }
  64477. };
  64478. function updateInputSources() {
  64479. for ( var i = 0; i < controllers.length; i ++ ) {
  64480. sortedInputSources[ i ] = findInputSource( i );
  64481. }
  64482. }
  64483. function findInputSource( id ) {
  64484. var inputSources = session.inputSources;
  64485. for ( var i = 0; i < inputSources.length; i ++ ) {
  64486. var inputSource = inputSources[ i ];
  64487. var handedness = inputSource.handedness;
  64488. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  64489. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  64490. }
  64491. }
  64492. //
  64493. function updateCamera( camera, parent ) {
  64494. if ( parent === null ) {
  64495. camera.matrixWorld.copy( camera.matrix );
  64496. } else {
  64497. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  64498. }
  64499. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  64500. }
  64501. this.getCamera = function ( camera ) {
  64502. if ( isPresenting() ) {
  64503. var parent = camera.parent;
  64504. var cameras = cameraVR.cameras;
  64505. updateCamera( cameraVR, parent );
  64506. for ( var i = 0; i < cameras.length; i ++ ) {
  64507. updateCamera( cameras[ i ], parent );
  64508. }
  64509. // update camera and its children
  64510. camera.matrixWorld.copy( cameraVR.matrixWorld );
  64511. var children = camera.children;
  64512. for ( var i = 0, l = children.length; i < l; i ++ ) {
  64513. children[ i ].updateMatrixWorld( true );
  64514. }
  64515. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  64516. return cameraVR;
  64517. }
  64518. return camera;
  64519. };
  64520. this.isPresenting = isPresenting;
  64521. // Animation Loop
  64522. var onAnimationFrameCallback = null;
  64523. function onAnimationFrame( time, frame ) {
  64524. pose = frame.getViewerPose( referenceSpace );
  64525. if ( pose !== null ) {
  64526. var views = pose.views;
  64527. var baseLayer = session.renderState.baseLayer;
  64528. renderer.setFramebuffer( baseLayer.framebuffer );
  64529. for ( var i = 0; i < views.length; i ++ ) {
  64530. var view = views[ i ];
  64531. var viewport = baseLayer.getViewport( view );
  64532. var viewMatrix = view.transform.inverse.matrix;
  64533. var camera = cameraVR.cameras[ i ];
  64534. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  64535. camera.projectionMatrix.fromArray( view.projectionMatrix );
  64536. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  64537. if ( i === 0 ) {
  64538. cameraVR.matrix.copy( camera.matrix );
  64539. }
  64540. }
  64541. }
  64542. //
  64543. for ( var i = 0; i < controllers.length; i ++ ) {
  64544. var controller = controllers[ i ];
  64545. var inputSource = sortedInputSources[ i ];
  64546. if ( inputSource ) {
  64547. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  64548. if ( inputPose !== null ) {
  64549. controller.matrix.fromArray( inputPose.transform.matrix );
  64550. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  64551. controller.visible = true;
  64552. continue;
  64553. }
  64554. }
  64555. controller.visible = false;
  64556. }
  64557. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  64558. }
  64559. var animation = new WebGLAnimation();
  64560. animation.setAnimationLoop( onAnimationFrame );
  64561. this.setAnimationLoop = function ( callback ) {
  64562. onAnimationFrameCallback = callback;
  64563. };
  64564. this.dispose = function () {};
  64565. // DEPRECATED
  64566. this.getStandingMatrix = function () {
  64567. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  64568. return new THREE.Matrix4();
  64569. };
  64570. this.getDevice = function () {
  64571. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  64572. };
  64573. this.setDevice = function () {
  64574. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  64575. };
  64576. this.setFrameOfReferenceType = function () {
  64577. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  64578. };
  64579. this.submitFrame = function () {};
  64580. }
  64581. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  64582. THREE.WebXRManager = WebXRManager
  64583. }
  64584. function getWebXRManager(){
  64585. class ArrayCamera extends THREE.PerspectiveCamera {
  64586. constructor(array = []) {
  64587. super();
  64588. this.isArrayCamera = true;
  64589. this.cameras = array;
  64590. }
  64591. }
  64592. class WebXRController {
  64593. constructor() {
  64594. this._targetRay = null;
  64595. this._grip = null;
  64596. this._hand = null;
  64597. }
  64598. getHandSpace() {
  64599. if (this._hand === null) {
  64600. this._hand = new THREE.Group();
  64601. this._hand.matrixAutoUpdate = false;
  64602. this._hand.visible = false;
  64603. this._hand.joints = {};
  64604. this._hand.inputState = {
  64605. pinching: false
  64606. };
  64607. }
  64608. return this._hand;
  64609. }
  64610. getTargetRaySpace() {
  64611. if (this._targetRay === null) {
  64612. this._targetRay = new THREE.Group();
  64613. this._targetRay.matrixAutoUpdate = false;
  64614. this._targetRay.visible = false;
  64615. this._targetRay.hasLinearVelocity = false;
  64616. this._targetRay.linearVelocity = new THREE.Vector3();
  64617. this._targetRay.hasAngularVelocity = false;
  64618. this._targetRay.angularVelocity = new THREE.Vector3();
  64619. }
  64620. return this._targetRay;
  64621. }
  64622. getGripSpace() {
  64623. if (this._grip === null) {
  64624. this._grip = new THREE.Group();
  64625. this._grip.matrixAutoUpdate = false;
  64626. this._grip.visible = false;
  64627. this._grip.hasLinearVelocity = false;
  64628. this._grip.linearVelocity = new THREE.Vector3();
  64629. this._grip.hasAngularVelocity = false;
  64630. this._grip.angularVelocity = new THREE.Vector3();
  64631. }
  64632. return this._grip;
  64633. }
  64634. dispatchEvent(event) {
  64635. if (this._targetRay !== null) {
  64636. this._targetRay.dispatchEvent(event);
  64637. }
  64638. if (this._grip !== null) {
  64639. this._grip.dispatchEvent(event);
  64640. }
  64641. if (this._hand !== null) {
  64642. this._hand.dispatchEvent(event);
  64643. }
  64644. return this;
  64645. }
  64646. disconnect(inputSource) {
  64647. this.dispatchEvent({
  64648. type: 'disconnected',
  64649. data: inputSource
  64650. });
  64651. if (this._targetRay !== null) {
  64652. this._targetRay.visible = false;
  64653. }
  64654. if (this._grip !== null) {
  64655. this._grip.visible = false;
  64656. }
  64657. if (this._hand !== null) {
  64658. this._hand.visible = false;
  64659. }
  64660. return this;
  64661. }
  64662. update(inputSource, frame, referenceSpace) {
  64663. let inputPose = null;
  64664. let gripPose = null;
  64665. let handPose = null;
  64666. const targetRay = this._targetRay;
  64667. const grip = this._grip;
  64668. const hand = this._hand;
  64669. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  64670. if (hand && inputSource.hand) {
  64671. handPose = true;
  64672. for (const inputjoint of inputSource.hand.values()) {
  64673. // Update the joints groups with the XRJoint poses
  64674. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  64675. if (hand.joints[inputjoint.jointName] === undefined) {
  64676. // The transform of this joint will be updated with the joint pose on each frame
  64677. const joint = new THREE.Group();
  64678. joint.matrixAutoUpdate = false;
  64679. joint.visible = false;
  64680. hand.joints[inputjoint.jointName] = joint; // ??
  64681. hand.add(joint);
  64682. }
  64683. const joint = hand.joints[inputjoint.jointName];
  64684. if (jointPose !== null) {
  64685. joint.matrix.fromArray(jointPose.transform.matrix);
  64686. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  64687. joint.jointRadius = jointPose.radius;
  64688. }
  64689. joint.visible = jointPose !== null;
  64690. } // Custom events
  64691. // Check pinchz
  64692. const indexTip = hand.joints['index-finger-tip'];
  64693. const thumbTip = hand.joints['thumb-tip'];
  64694. const distance = indexTip.position.distanceTo(thumbTip.position);
  64695. const distanceToPinch = 0.02;
  64696. const threshold = 0.005;
  64697. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  64698. hand.inputState.pinching = false;
  64699. this.dispatchEvent({
  64700. type: 'pinchend',
  64701. handedness: inputSource.handedness,
  64702. target: this
  64703. });
  64704. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  64705. hand.inputState.pinching = true;
  64706. this.dispatchEvent({
  64707. type: 'pinchstart',
  64708. handedness: inputSource.handedness,
  64709. target: this
  64710. });
  64711. }
  64712. } else {
  64713. if (grip !== null && inputSource.gripSpace) {
  64714. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  64715. if (gripPose !== null) {
  64716. grip.matrix.fromArray(gripPose.transform.matrix);
  64717. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  64718. if (gripPose.linearVelocity) {
  64719. grip.hasLinearVelocity = true;
  64720. grip.linearVelocity.copy(gripPose.linearVelocity);
  64721. } else {
  64722. grip.hasLinearVelocity = false;
  64723. }
  64724. if (gripPose.angularVelocity) {
  64725. grip.hasAngularVelocity = true;
  64726. grip.angularVelocity.copy(gripPose.angularVelocity);
  64727. } else {
  64728. grip.hasAngularVelocity = false;
  64729. }
  64730. }
  64731. }
  64732. }
  64733. if (targetRay !== null) {
  64734. 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
  64735. if (inputPose === null && gripPose !== null) {
  64736. inputPose = gripPose;
  64737. }
  64738. if (inputPose !== null) {
  64739. targetRay.matrix.fromArray(inputPose.transform.matrix);
  64740. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  64741. if (inputPose.linearVelocity) {
  64742. targetRay.hasLinearVelocity = true;
  64743. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  64744. } else {
  64745. targetRay.hasLinearVelocity = false;
  64746. }
  64747. if (inputPose.angularVelocity) {
  64748. targetRay.hasAngularVelocity = true;
  64749. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  64750. } else {
  64751. targetRay.hasAngularVelocity = false;
  64752. }
  64753. this.dispatchEvent(_moveEvent);
  64754. }
  64755. }
  64756. }
  64757. if (targetRay !== null) {
  64758. targetRay.visible = inputPose !== null;
  64759. }
  64760. if (grip !== null) {
  64761. grip.visible = gripPose !== null;
  64762. }
  64763. if (hand !== null) {
  64764. hand.visible = handPose !== null;
  64765. }
  64766. return this;
  64767. }
  64768. }
  64769. function WebGLAnimation() {
  64770. let context = null;
  64771. let isAnimating = false;
  64772. let animationLoop = null;
  64773. let requestId = null;
  64774. function onAnimationFrame(time, frame) {
  64775. animationLoop(time, frame);
  64776. requestId = context.requestAnimationFrame(onAnimationFrame);
  64777. }
  64778. return {
  64779. start: function () {
  64780. if (isAnimating === true) return;
  64781. if (animationLoop === null) return;
  64782. requestId = context.requestAnimationFrame(onAnimationFrame);
  64783. isAnimating = true;
  64784. },
  64785. stop: function () {
  64786. context.cancelAnimationFrame(requestId);
  64787. isAnimating = false;
  64788. },
  64789. setAnimationLoop: function (callback) {
  64790. animationLoop = callback;
  64791. },
  64792. setContext: function (value) {
  64793. context = value;
  64794. }
  64795. };
  64796. }
  64797. class WebXRManager extends THREE.EventDispatcher {
  64798. constructor(renderer, gl) {
  64799. super();
  64800. const scope = this;
  64801. let session = null;
  64802. let framebufferScaleFactor = 1.0;
  64803. let referenceSpace = null;
  64804. let referenceSpaceType = 'local-floor';
  64805. let customReferenceSpace = null;
  64806. let pose = null;
  64807. let glBinding = null;
  64808. let glProjLayer = null;
  64809. let glBaseLayer = null;
  64810. let xrFrame = null;
  64811. const attributes = gl.getContextAttributes();
  64812. let initialRenderTarget = null;
  64813. let newRenderTarget = null;
  64814. const controllers = [];
  64815. const controllerInputSources = []; //
  64816. const cameraL = new THREE.PerspectiveCamera();
  64817. cameraL.layers.enable(1);
  64818. cameraL.viewport = new THREE.Vector4();
  64819. const cameraR = new THREE.PerspectiveCamera();
  64820. cameraR.layers.enable(2);
  64821. cameraR.viewport = new THREE.Vector4();
  64822. const cameras = [cameraL, cameraR];
  64823. const cameraVR = new ArrayCamera();
  64824. cameraVR.layers.enable(1);
  64825. cameraVR.layers.enable(2);
  64826. let _currentDepthNear = null;
  64827. let _currentDepthFar = null; //
  64828. this.cameraAutoUpdate = true;
  64829. this.enabled = false;
  64830. this.isPresenting = false;
  64831. this.getController = function (index) {
  64832. let controller = controllers[index];
  64833. if (controller === undefined) {
  64834. controller = new WebXRController();
  64835. controllers[index] = controller;
  64836. }
  64837. return controller.getTargetRaySpace();
  64838. };
  64839. this.getControllerGrip = function (index) {
  64840. let controller = controllers[index];
  64841. if (controller === undefined) {
  64842. controller = new WebXRController();
  64843. controllers[index] = controller;
  64844. }
  64845. return controller.getGripSpace();
  64846. };
  64847. this.getHand = function (index) {
  64848. let controller = controllers[index];
  64849. if (controller === undefined) {
  64850. controller = new WebXRController();
  64851. controllers[index] = controller;
  64852. }
  64853. return controller.getHandSpace();
  64854. }; //
  64855. function onSessionEvent(event) {
  64856. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  64857. if (controllerIndex === -1) {
  64858. return;
  64859. }
  64860. const controller = controllers[controllerIndex];
  64861. if (controller !== undefined) {
  64862. controller.dispatchEvent({
  64863. type: event.type,
  64864. data: event.inputSource
  64865. });
  64866. }
  64867. }
  64868. function onSessionEnd() {
  64869. session.removeEventListener('select', onSessionEvent);
  64870. session.removeEventListener('selectstart', onSessionEvent);
  64871. session.removeEventListener('selectend', onSessionEvent);
  64872. session.removeEventListener('squeeze', onSessionEvent);
  64873. session.removeEventListener('squeezestart', onSessionEvent);
  64874. session.removeEventListener('squeezeend', onSessionEvent);
  64875. session.removeEventListener('end', onSessionEnd);
  64876. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  64877. for (let i = 0; i < controllers.length; i++) {
  64878. const inputSource = controllerInputSources[i];
  64879. if (inputSource === null) continue;
  64880. controllerInputSources[i] = null;
  64881. controllers[i].disconnect(inputSource);
  64882. }
  64883. _currentDepthNear = null;
  64884. _currentDepthFar = null; // restore framebuffer/rendering state
  64885. renderer.setRenderTarget(initialRenderTarget);
  64886. glBaseLayer = null;
  64887. glProjLayer = null;
  64888. glBinding = null;
  64889. session = null;
  64890. newRenderTarget = null; //
  64891. animation.stop();
  64892. scope.isPresenting = false;
  64893. scope.dispatchEvent({
  64894. type: 'sessionend'
  64895. });
  64896. }
  64897. this.setFramebufferScaleFactor = function (value) {
  64898. framebufferScaleFactor = value;
  64899. if (scope.isPresenting === true) {
  64900. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  64901. }
  64902. };
  64903. this.setReferenceSpaceType = function (value) {
  64904. referenceSpaceType = value;
  64905. if (scope.isPresenting === true) {
  64906. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  64907. }
  64908. };
  64909. this.getReferenceSpace = function () {
  64910. return customReferenceSpace || referenceSpace;
  64911. };
  64912. this.setReferenceSpace = function (space) {
  64913. customReferenceSpace = space;
  64914. };
  64915. this.getBaseLayer = function () {
  64916. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  64917. };
  64918. this.getBinding = function () {
  64919. return glBinding;
  64920. };
  64921. this.getFrame = function () {
  64922. return xrFrame;
  64923. };
  64924. this.getSession = function () {
  64925. return session;
  64926. };
  64927. this.setSession = async function (value) {
  64928. session = value;
  64929. if (session !== null) {
  64930. initialRenderTarget = renderer.getCurrentRenderTarget();
  64931. session.addEventListener('select', onSessionEvent);
  64932. session.addEventListener('selectstart', onSessionEvent);
  64933. session.addEventListener('selectend', onSessionEvent);
  64934. session.addEventListener('squeeze', onSessionEvent);
  64935. session.addEventListener('squeezestart', onSessionEvent);
  64936. session.addEventListener('squeezeend', onSessionEvent);
  64937. session.addEventListener('end', onSessionEnd);
  64938. session.addEventListener('inputsourceschange', onInputSourcesChange);
  64939. if (attributes.xrCompatible !== true) {
  64940. await gl.makeXRCompatible();
  64941. }
  64942. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  64943. const layerInit = {
  64944. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  64945. alpha: attributes.alpha,
  64946. depth: attributes.depth,
  64947. stencil: attributes.stencil,
  64948. framebufferScaleFactor: framebufferScaleFactor
  64949. };
  64950. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  64951. session.updateRenderState({
  64952. baseLayer: glBaseLayer
  64953. });
  64954. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  64955. format: THREE.RGBAFormat,
  64956. type: THREE.UnsignedByteType,
  64957. encoding: renderer.outputEncoding
  64958. });
  64959. } else {
  64960. let depthFormat = null;
  64961. let depthType = null;
  64962. let glDepthFormat = null;
  64963. if (attributes.depth) {
  64964. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  64965. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  64966. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  64967. }
  64968. const projectionlayerInit = {
  64969. colorFormat: gl.RGBA8,
  64970. depthFormat: glDepthFormat,
  64971. scaleFactor: framebufferScaleFactor
  64972. };
  64973. glBinding = new XRWebGLBinding(session, gl);
  64974. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  64975. session.updateRenderState({
  64976. layers: [glProjLayer]
  64977. });
  64978. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  64979. format: THREE.RGBAFormat,
  64980. type: THREE.UnsignedByteType,
  64981. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  64982. stencilBuffer: attributes.stencil,
  64983. encoding: renderer.outputEncoding,
  64984. samples: attributes.antialias ? 4 : 0
  64985. });
  64986. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  64987. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  64988. }
  64989. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  64990. // Set foveation to maximum.
  64991. this.setFoveation(1.0);
  64992. customReferenceSpace = null;
  64993. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  64994. animation.setContext(session);
  64995. animation.start();
  64996. scope.isPresenting = true;
  64997. scope.dispatchEvent({
  64998. type: 'sessionstart'
  64999. });
  65000. }
  65001. };
  65002. function onInputSourcesChange(event) {
  65003. // Notify disconnected
  65004. for (let i = 0; i < event.removed.length; i++) {
  65005. const inputSource = event.removed[i];
  65006. const index = controllerInputSources.indexOf(inputSource);
  65007. if (index >= 0) {
  65008. controllerInputSources[index] = null;
  65009. controllers[index].dispatchEvent({
  65010. type: 'disconnected',
  65011. data: inputSource
  65012. });
  65013. }
  65014. } // Notify connected
  65015. for (let i = 0; i < event.added.length; i++) {
  65016. const inputSource = event.added[i];
  65017. let controllerIndex = controllerInputSources.indexOf(inputSource);
  65018. if (controllerIndex === -1) {
  65019. // Assign input source a controller that currently has no input source
  65020. for (let i = 0; i < controllers.length; i++) {
  65021. if (i >= controllerInputSources.length) {
  65022. controllerInputSources.push(inputSource);
  65023. controllerIndex = i;
  65024. break;
  65025. } else if (controllerInputSources[i] === null) {
  65026. controllerInputSources[i] = inputSource;
  65027. controllerIndex = i;
  65028. break;
  65029. }
  65030. } // If all controllers do currently receive input we ignore new ones
  65031. if (controllerIndex === -1) break;
  65032. }
  65033. const controller = controllers[controllerIndex];
  65034. if (controller) {
  65035. controller.dispatchEvent({
  65036. type: 'connected',
  65037. data: inputSource
  65038. });
  65039. }
  65040. }
  65041. } //
  65042. const cameraLPos = new THREE.Vector3();
  65043. const cameraRPos = new THREE.Vector3();
  65044. function setProjectionFromUnion(camera, cameraL, cameraR) {
  65045. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  65046. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  65047. const ipd = cameraLPos.distanceTo(cameraRPos);
  65048. const projL = cameraL.projectionMatrix.elements;
  65049. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  65050. // most likely identical top and bottom frustum extents.
  65051. // Use the left camera for these values.
  65052. const near = projL[14] / (projL[10] - 1);
  65053. const far = projL[14] / (projL[10] + 1);
  65054. const topFov = (projL[9] + 1) / projL[5];
  65055. const bottomFov = (projL[9] - 1) / projL[5];
  65056. const leftFov = (projL[8] - 1) / projL[0];
  65057. const rightFov = (projR[8] + 1) / projR[0];
  65058. const left = near * leftFov;
  65059. const right = near * rightFov; // Calculate the new camera's position offset from the
  65060. // left camera. xOffset should be roughly half `ipd`.
  65061. const zOffset = ipd / (-leftFov + rightFov);
  65062. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  65063. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  65064. camera.translateX(xOffset);
  65065. camera.translateZ(zOffset);
  65066. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  65067. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  65068. // the values so that the near plane's position does not change in world space,
  65069. // although must now be relative to the new union camera.
  65070. const near2 = near + zOffset;
  65071. const far2 = far + zOffset;
  65072. const left2 = left - xOffset;
  65073. const right2 = right + (ipd - xOffset);
  65074. const top2 = topFov * far / far2 * near2;
  65075. const bottom2 = bottomFov * far / far2 * near2;
  65076. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  65077. }
  65078. function updateCamera(camera, parent) {
  65079. if (parent === null) {
  65080. camera.matrixWorld.copy(camera.matrix);
  65081. } else {
  65082. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  65083. }
  65084. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  65085. }
  65086. this.updateCamera = function (camera) {
  65087. if (session === null) return;
  65088. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  65089. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  65090. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  65091. // Note that the new renderState won't apply until the next frame. See #18320
  65092. session.updateRenderState({
  65093. depthNear: cameraVR.near,
  65094. depthFar: cameraVR.far
  65095. });
  65096. _currentDepthNear = cameraVR.near;
  65097. _currentDepthFar = cameraVR.far;
  65098. }
  65099. const parent = camera.parent;
  65100. const cameras = cameraVR.cameras;
  65101. updateCamera(cameraVR, parent);
  65102. for (let i = 0; i < cameras.length; i++) {
  65103. updateCamera(cameras[i], parent);
  65104. }
  65105. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  65106. camera.position.copy(cameraVR.position);
  65107. camera.quaternion.copy(cameraVR.quaternion);
  65108. camera.scale.copy(cameraVR.scale);
  65109. camera.matrix.copy(cameraVR.matrix);
  65110. camera.matrixWorld.copy(cameraVR.matrixWorld);
  65111. const children = camera.children;
  65112. for (let i = 0, l = children.length; i < l; i++) {
  65113. children[i].updateMatrixWorld(true);
  65114. } // update projection matrix for proper view frustum culling
  65115. if (cameras.length === 2) {
  65116. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  65117. } else {
  65118. // assume single camera setup (AR)
  65119. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  65120. }
  65121. };
  65122. this.getCamera = function () {
  65123. return cameraVR;
  65124. };
  65125. this.getFoveation = function () {
  65126. if (glProjLayer !== null) {
  65127. return glProjLayer.fixedFoveation;
  65128. }
  65129. if (glBaseLayer !== null) {
  65130. return glBaseLayer.fixedFoveation;
  65131. }
  65132. return undefined;
  65133. };
  65134. this.setFoveation = function (foveation) {
  65135. // 0 = no foveation = full resolution
  65136. // 1 = maximum foveation = the edges render at lower resolution
  65137. if (glProjLayer !== null) {
  65138. glProjLayer.fixedFoveation = foveation;
  65139. }
  65140. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  65141. glBaseLayer.fixedFoveation = foveation;
  65142. }
  65143. }; // Animation Loop
  65144. let onAnimationFrameCallback = null;
  65145. function onAnimationFrame(time, frame) {
  65146. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  65147. xrFrame = frame;
  65148. if (pose !== null) {
  65149. const views = pose.views;
  65150. if (glBaseLayer !== null) {
  65151. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  65152. renderer.setRenderTarget(newRenderTarget);
  65153. }
  65154. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  65155. if (views.length !== cameraVR.cameras.length) {
  65156. cameraVR.cameras.length = 0;
  65157. cameraVRNeedsUpdate = true;
  65158. }
  65159. for (let i = 0; i < views.length; i++) {
  65160. const view = views[i];
  65161. let viewport = null;
  65162. if (glBaseLayer !== null) {
  65163. viewport = glBaseLayer.getViewport(view);
  65164. } else {
  65165. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  65166. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  65167. if (i === 0) {
  65168. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  65169. renderer.setRenderTarget(newRenderTarget);
  65170. }
  65171. }
  65172. let camera = cameras[i];
  65173. if (camera === undefined) {
  65174. camera = new THREE.PerspectiveCamera();
  65175. camera.layers.enable(i);
  65176. camera.viewport = new THREE.Vector4();
  65177. cameras[i] = camera;
  65178. }
  65179. camera.matrix.fromArray(view.transform.matrix);
  65180. camera.projectionMatrix.fromArray(view.projectionMatrix);
  65181. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  65182. if (i === 0) {
  65183. cameraVR.matrix.copy(camera.matrix);
  65184. }
  65185. if (cameraVRNeedsUpdate === true) {
  65186. cameraVR.cameras.push(camera);
  65187. }
  65188. }
  65189. } //
  65190. for (let i = 0; i < controllers.length; i++) {
  65191. const inputSource = controllerInputSources[i];
  65192. const controller = controllers[i];
  65193. if (inputSource !== null && controller !== undefined) {
  65194. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  65195. }
  65196. }
  65197. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  65198. xrFrame = null;
  65199. }
  65200. const animation = new WebGLAnimation();
  65201. animation.setAnimationLoop(onAnimationFrame);
  65202. this.setAnimationLoop = function (callback) {
  65203. onAnimationFrameCallback = callback;
  65204. };
  65205. this.dispose = function () {};
  65206. }
  65207. }
  65208. THREE.WebXRManager = WebXRManager
  65209. } */
  65210. /*
  65211. var addMagnifier = function(){
  65212. class Magnifier extends THREE.Object3D {
  65213. constructor () {
  65214. super()
  65215. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  65216. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  65217. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  65218. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  65219. format: THREE.RGBAFormat ,
  65220. //type: THREE.FloatType,
  65221. //minFilter: THREE.NearestFilter,
  65222. //magFilter: THREE.NearestFilter,
  65223. } )
  65224. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65225. side: THREE.DoubleSide ,
  65226. map: this.renderTarget.texture ,
  65227. transparent:true,
  65228. depthTest: !1,
  65229. depthWrite: !1,
  65230. }))
  65231. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65232. side: THREE.DoubleSide ,
  65233. map: Texture.load('images/crosshair.png') ,
  65234. transparent:true,
  65235. depthTest: !1,
  65236. depthWrite: !1,
  65237. }))
  65238. this.add(this.mesh)
  65239. this.add(this.overlayMesh)
  65240. player.model.add(this);
  65241. player.magnifier = this;
  65242. }
  65243. update(aimPos){
  65244. const magDistance_ = 0.3;
  65245. var playerPos = player.position
  65246. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  65247. this.camera.position.copy(aimPos.clone().add(vec))
  65248. this.camera.lookAt(aimPos)
  65249. var playerCamera = player.camera
  65250. this.quaternion.copy(playerCamera.quaternion);
  65251. var pos2d = player.mouse.clone();
  65252. var shift = 400;
  65253. var clientHeight = player.domElement.clientHeight
  65254. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  65255. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  65256. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  65257. this.position.copy(newPos)
  65258. var renderer = player.sceneRenderer.renderer
  65259. var oldAutoClear = renderer.autoClear
  65260. renderer.autoClear = false
  65261. //renderer.clear( true, true, true );
  65262. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  65263. renderer.autoClear = oldAutoClear
  65264. }
  65265. }
  65266. new Magnifier()
  65267. }
  65268. */
  65269. /*
  65270. 笔记:
  65271. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  65272. {
  65273. //到导览中某个点位(假设点位不重复)
  65274. var id = 73
  65275. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  65276. var i = player.model.heroLocations.indexOf(p)
  65277. var p1 = p.heroLocations.find(e=>e.panoId == id)
  65278. var j = p.heroLocations.indexOf(p1)
  65279. player.director.goToHighlight([i,j])
  65280. }
  65281. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  65282. */