main_2020_show.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. !function() {
  5. "use strict";
  6. function t(t, i) {
  7. return typeof t === i
  8. }
  9. function i(t, i) {
  10. return t instanceof i
  11. }
  12. function n(t) {
  13. return t && t.nodeType
  14. }
  15. function e(t) {
  16. return n(t) ? t : i(t, g) ? t[0] : void 0
  17. }
  18. function o(t, i, n) {
  19. return g.each(t, function(t, e) {
  20. n = i.call(e, n, t, e)
  21. }),
  22. n
  23. }
  24. function r(t, i, n) {
  25. var e, o, r;
  26. if (t === i)
  27. return !0;
  28. if (!t || !i || t.constructor !== i.constructor)
  29. return !1;
  30. for (e = 0,
  31. o = n.length; o > e; e += 1) {
  32. if (r = n[e],
  33. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  34. return !1;
  35. if (t[r] !== i[r])
  36. return !1
  37. }
  38. return !0
  39. }
  40. function s(t, i, n, e) {
  41. this.left = E(t),
  42. this.top = E(i),
  43. this.width = E(n),
  44. this.height = E(e),
  45. this.right = this.left + this.width,
  46. this.bottom = this.top + this.height
  47. }
  48. function h(t, i, n, e) {
  49. this.visible = t || 0,
  50. this.viewport = i || 0,
  51. this.possible = n || 0,
  52. this.rects = e && T({}, e) || null
  53. }
  54. function l(t, i) {
  55. this.els = t,
  56. this.viewport = i
  57. }
  58. function c(t, i, n) {
  59. var e;
  60. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  61. e ? e[n] : 0
  62. }
  63. function u(t, i) {
  64. return t.val - i.val
  65. }
  66. function a(t, i) {
  67. return i.val - t.val
  68. }
  69. function f(t) {
  70. var i = s.ofContent(t, !0)
  71. , n = s.ofViewport(t, !0)
  72. , e = i.width - n.width
  73. , o = i.height - n.height;
  74. this.content = i,
  75. this.viewport = n,
  76. this.width = 0 >= e ? null : n.left / e,
  77. this.height = 0 >= o ? null : n.top / o,
  78. this.left = n.left,
  79. this.top = n.top,
  80. this.right = i.right - n.right,
  81. this.bottom = i.bottom - n.bottom
  82. }
  83. function p(t) {
  84. this.el = t || window
  85. }
  86. function d(t, i) {
  87. this.context = t,
  88. this.viewport = i,
  89. this.init()
  90. }
  91. function v(t, i, n, e) {
  92. this.context = new l(t,i),
  93. this.property = n,
  94. this.descending = e,
  95. this.init()
  96. }
  97. function w(t) {
  98. t && t !== window && t !== document ? (this.context = t,
  99. this.$autoTarget = g(t)) : this.context = window,
  100. this.init()
  101. }
  102. var g = jQuery
  103. , m = g(window)
  104. , b = g(document)
  105. , T = g.extend
  106. , y = g.isFunction
  107. , k = Math.max
  108. , V = Math.min
  109. , E = Math.round
  110. , x = function() {
  111. var t = {}
  112. , i = 1;
  113. return function(n) {
  114. return n ? (t[n] || (t[n] = i,
  115. i += 1),
  116. t[n]) : 0
  117. }
  118. }();
  119. T(s.prototype, {
  120. equals: function(t) {
  121. return r(this, t, ["left", "top", "width", "height"])
  122. },
  123. area: function() {
  124. return this.width * this.height
  125. },
  126. relativeTo: function(t) {
  127. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  128. },
  129. intersection: function(t) {
  130. if (!i(t, s))
  131. return null;
  132. var n = k(this.left, t.left)
  133. , e = V(this.right, t.right)
  134. , o = k(this.top, t.top)
  135. , r = V(this.bottom, t.bottom)
  136. , h = e - n
  137. , l = r - o;
  138. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  139. },
  140. envelope: function(t) {
  141. if (!i(t, s))
  142. return this;
  143. var n = V(this.left, t.left)
  144. , e = k(this.right, t.right)
  145. , o = V(this.top, t.top)
  146. , r = k(this.bottom, t.bottom)
  147. , h = e - n
  148. , l = r - o;
  149. return new s(n,o,h,l)
  150. }
  151. }),
  152. T(s, {
  153. ofContent: function(t, i) {
  154. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  155. },
  156. ofViewport: function(t, i) {
  157. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  158. },
  159. ofElement: function(t) {
  160. var i = g(t);
  161. if (!i.is(":visible"))
  162. return null;
  163. var n = i.offset();
  164. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  165. }
  166. }),
  167. T(h.prototype, {
  168. equals: function(t) {
  169. return this.fracsEqual(t) && this.rectsEqual(t)
  170. },
  171. fracsEqual: function(t) {
  172. return r(this, t, ["visible", "viewport", "possible"])
  173. },
  174. rectsEqual: function(t) {
  175. return r(this.rects, t.rects, ["document", "element", "viewport"])
  176. }
  177. }),
  178. T(h, {
  179. of: function(t, i) {
  180. var e, o, r;
  181. return t = n(t) && s.ofElement(t) || t,
  182. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  183. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  184. r = V(t.width, i.width) * V(t.height, i.height),
  185. new h(o / t.area(),o / i.area(),o / r,{
  186. document: e,
  187. element: e.relativeTo(t),
  188. viewport: e.relativeTo(i)
  189. })) : new h
  190. }
  191. });
  192. var q = ["width", "height", "left", "right", "top", "bottom"]
  193. , S = ["possible", "visible", "viewport"];
  194. T(l.prototype, {
  195. sorted: function(t, i) {
  196. var n = this.viewport;
  197. return g.map(this.els, function(i) {
  198. return {
  199. el: i,
  200. val: c(i, n, t)
  201. }
  202. }).sort(i ? a : u)
  203. },
  204. best: function(t, i) {
  205. return this.els.length ? this.sorted(t, i)[0] : null
  206. }
  207. }),
  208. T(f.prototype, {
  209. equals: function(t) {
  210. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  211. }
  212. }),
  213. T(p.prototype, {
  214. equals: function(t) {
  215. return r(this, t, ["el"])
  216. },
  217. scrollState: function() {
  218. return new f(this.el)
  219. },
  220. scrollTo: function(t, i, n) {
  221. var e = g(this.el === window ? "html,body" : this.el);
  222. t = t || 0,
  223. i = i || 0,
  224. n = isNaN(n) ? 1e3 : n,
  225. e.stop(!0).animate({
  226. scrollLeft: t,
  227. scrollTop: i
  228. }, n)
  229. },
  230. scroll: function(t, i, n) {
  231. var e = this.el === window ? m : g(this.el);
  232. t = t || 0,
  233. i = i || 0,
  234. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  235. },
  236. scrollToRect: function(t, i, n, e) {
  237. i = i || 0,
  238. n = n || 0,
  239. this.scrollTo(t.left - i, t.top - n, e)
  240. },
  241. scrollToElement: function(t, i, n, e) {
  242. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  243. this.scrollToRect(o, i, n, e)
  244. }
  245. });
  246. var C = {
  247. init: function() {
  248. this.callbacks = g.Callbacks("memory unique"),
  249. this.currVal = null,
  250. this.prevVal = null,
  251. this.checkProxy = g.proxy(this.check, this),
  252. this.autoCheck()
  253. },
  254. bind: function(t) {
  255. this.callbacks.add(t)
  256. },
  257. unbind: function(t) {
  258. t ? this.callbacks.remove(t) : this.callbacks.empty()
  259. },
  260. trigger: function() {
  261. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  262. },
  263. check: function(t) {
  264. var i = this.updatedValue(t);
  265. return void 0 !== i && (this.prevVal = this.currVal,
  266. this.currVal = i,
  267. this.trigger(),
  268. !0)
  269. },
  270. $autoTarget: m,
  271. autoEvents: "load resize scroll",
  272. autoCheck: function(t) {
  273. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  274. }
  275. };
  276. T(d.prototype, C, {
  277. updatedValue: function() {
  278. var t = h.of(this.context, this.viewport);
  279. return this.currVal && this.currVal.equals(t) ? void 0 : t
  280. }
  281. }),
  282. T(v.prototype, C, {
  283. updatedValue: function() {
  284. var t = this.context.best(this.property, this.descending);
  285. return t && (t = t.val > 0 ? t.el : null,
  286. this.currVal !== t) ? t : void 0
  287. }
  288. }),
  289. T(w.prototype, C, {
  290. updatedValue: function() {
  291. var t = new f(this.context);
  292. return this.currVal && this.currVal.equals(t) ? void 0 : t
  293. }
  294. });
  295. var L = function(t, i) {
  296. var n = [].slice
  297. , e = jQuery
  298. , o = e.extend
  299. , r = e.isFunction
  300. , s = o({}, i)
  301. , h = function(i, n, o, s) {
  302. return o = r(o) ? o.apply(i, n) : o,
  303. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  304. }
  305. , l = function() {
  306. return h(this, n.call(arguments), s.defaultStatic, l)
  307. }
  308. , c = function(t) {
  309. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  310. }
  311. , u = function(t) {
  312. t && (o(l, t.statics),
  313. o(c, t.methods)),
  314. l.modplug = u
  315. };
  316. u.prev = {
  317. statics: e[t],
  318. methods: e.fn[t]
  319. },
  320. u(i),
  321. e[t] = l,
  322. e.fn[t] = c
  323. }
  324. , M = "fracs";
  325. L(M, {
  326. statics: {
  327. version: "0.15.0",
  328. Rect: s,
  329. Fractions: h,
  330. Group: l,
  331. ScrollState: f,
  332. Viewport: p,
  333. FracsCallbacks: d,
  334. GroupCallbacks: v,
  335. ScrollStateCallbacks: w,
  336. fracs: function(t, i) {
  337. return h.of(t, i)
  338. }
  339. },
  340. methods: {
  341. content: function(t) {
  342. return this.length ? s.ofContent(this[0], t) : null
  343. },
  344. envelope: function() {
  345. return o(this, function(t) {
  346. var i = s.ofElement(this);
  347. return t ? t.envelope(i) : i
  348. })
  349. },
  350. fracs: function(i, n, o) {
  351. t(i, "string") || (o = n,
  352. n = i,
  353. i = null),
  354. y(n) || (o = n,
  355. n = null),
  356. o = e(o);
  357. var r = M + ".fracs." + x(o);
  358. return "unbind" === i ? this.each(function() {
  359. var t = g(this).data(r);
  360. t && t.unbind(n)
  361. }) : "check" === i ? this.each(function() {
  362. var t = g(this).data(r);
  363. t && t.check()
  364. }) : y(n) ? this.each(function() {
  365. var t = g(this)
  366. , i = t.data(r);
  367. i || (i = new d(this,o),
  368. t.data(r, i)),
  369. i.bind(n)
  370. }) : this.length ? h.of(this[0], o) : null
  371. },
  372. intersection: function() {
  373. return o(this, function(t) {
  374. var i = s.ofElement(this);
  375. return t ? t.intersection(i) : i
  376. })
  377. },
  378. max: function(t, i, n) {
  379. return y(i) || (n = i,
  380. i = null),
  381. n = e(n),
  382. i ? (new v(this,n,t,!0).bind(i),
  383. this) : this.pushStack(new l(this,n).best(t, !0).el)
  384. },
  385. min: function(t, i, n) {
  386. return y(i) || (n = i,
  387. i = null),
  388. n = e(n),
  389. i ? (new v(this,n,t).bind(i),
  390. this) : this.pushStack(new l(this,n).best(t).el)
  391. },
  392. rect: function() {
  393. return this.length ? s.ofElement(this[0]) : null
  394. },
  395. scrollState: function(i, n) {
  396. var e = M + ".scrollState";
  397. return t(i, "string") || (n = i,
  398. i = null),
  399. "unbind" === i ? this.each(function() {
  400. var t = g(this).data(e);
  401. t && t.unbind(n)
  402. }) : "check" === i ? this.each(function() {
  403. var t = g(this).data(e);
  404. t && t.check()
  405. }) : y(n) ? this.each(function() {
  406. var t = g(this)
  407. , i = t.data(e);
  408. i || (i = new w(this),
  409. t.data(e, i)),
  410. i.bind(n)
  411. }) : this.length ? new f(this[0]) : null
  412. },
  413. scroll: function(t, i, n) {
  414. return this.each(function() {
  415. new p(this).scroll(t, i, n)
  416. })
  417. },
  418. scrollTo: function(t, i, n, o) {
  419. return g.isNumeric(t) && (o = n,
  420. n = i,
  421. i = t,
  422. t = null),
  423. t = e(t),
  424. this.each(function() {
  425. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  426. })
  427. },
  428. scrollToThis: function(t, i, n, o) {
  429. return o = new p(e(o)),
  430. o.scrollToElement(this[0], t, i, n),
  431. this
  432. },
  433. softLink: function(t, i, n, o) {
  434. return o = new p(e(o)),
  435. this.filter("a[href^=#]").each(function() {
  436. var e = g(this);
  437. e.on("click", function() {
  438. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  439. })
  440. })
  441. },
  442. sort: function(i, n, o) {
  443. return t(n, "boolean") || (o = n,
  444. n = null),
  445. o = e(o),
  446. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  447. return t.el
  448. }))
  449. },
  450. viewport: function(t) {
  451. return this.length ? s.ofViewport(this[0], t) : null
  452. }
  453. },
  454. defaultStatic: "fracs",
  455. defaultMethod: "fracs"
  456. })
  457. }();
  458. if ("undefined" == typeof jQuery)
  459. throw new Error("Bootstrap's JavaScript requires jQuery");
  460. +function(t) {
  461. "use strict";
  462. function e(e) {
  463. return this.each(function() {
  464. var o = t(this)
  465. , s = o.data("bs.tooltip")
  466. , n = "object" == typeof e && e;
  467. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  468. "string" == typeof e && s[e]())
  469. })
  470. }
  471. var i = function(t, e) {
  472. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  473. this.init("tooltip", t, e)
  474. };
  475. i.VERSION = "3.2.0",
  476. i.DEFAULTS = {
  477. animation: !0,
  478. placement: "top",
  479. selector: !1,
  480. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  481. trigger: "hover focus",
  482. title: "",
  483. delay: 0,
  484. html: !1,
  485. container: !1,
  486. viewport: {
  487. selector: "body",
  488. padding: 0
  489. }
  490. },
  491. i.prototype.init = function(e, i, o) {
  492. this.enabled = !0,
  493. this.type = e,
  494. this.$element = t(i),
  495. this.options = this.getOptions(o),
  496. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  497. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  498. var r = s[n];
  499. if ("click" == r)
  500. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  501. else if ("manual" != r) {
  502. var a = "hover" == r ? "mouseenter" : "focusin"
  503. , l = "hover" == r ? "mouseleave" : "focusout";
  504. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  505. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  506. }
  507. }
  508. this.options.selector ? this._options = t.extend({}, this.options, {
  509. trigger: "manual",
  510. selector: ""
  511. }) : this.fixTitle()
  512. }
  513. ,
  514. i.prototype.getDefaults = function() {
  515. return i.DEFAULTS
  516. }
  517. ,
  518. i.prototype.getOptions = function(e) {
  519. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  520. e.delay && "number" == typeof e.delay && (e.delay = {
  521. show: e.delay,
  522. hide: e.delay
  523. }),
  524. e
  525. }
  526. ,
  527. i.prototype.getDelegateOptions = function() {
  528. var e = {}
  529. , i = this.getDefaults();
  530. return this._options && t.each(this._options, function(t, o) {
  531. i[t] != o && (e[t] = o)
  532. }),
  533. e
  534. }
  535. ,
  536. i.prototype.enter = function(e) {
  537. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  538. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  539. t(e.currentTarget).data("bs." + this.type, i)),
  540. clearTimeout(i.timeout),
  541. i.hoverState = "in",
  542. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  543. // "in" == i.hoverState && i.show()
  544. }, i.options.delay.show)) : i.show()
  545. }
  546. ,
  547. i.prototype.leave = function(e) {
  548. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  549. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  550. t(e.currentTarget).data("bs." + this.type, i)),
  551. clearTimeout(i.timeout),
  552. i.hoverState = "out",
  553. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  554. "out" == i.hoverState && i.hide()
  555. }, i.options.delay.hide)) : i.hide()
  556. }
  557. ,
  558. i.prototype.show = function() {
  559. var e = t.Event("show.bs." + this.type);
  560. if (this.hasContent() && this.enabled) {
  561. this.$element.trigger(e);
  562. var i = t.contains(document.documentElement, this.$element[0]);
  563. if (e.isDefaultPrevented() || !i)
  564. return;
  565. var o = this
  566. , s = this.tip()
  567. , n = this.getUID(this.type);
  568. this.setContent(),
  569. s.attr("id", n),
  570. this.$element.attr("aria-describedby", n),
  571. this.options.animation && s.addClass("fade");
  572. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  573. , a = /\s?auto?\s?/i
  574. , l = a.test(r);
  575. l && (r = r.replace(a, "") || "top"),
  576. s.detach().css({
  577. top: 0,
  578. left: 0,
  579. display: "block"
  580. }).addClass(r).data("bs." + this.type, this),
  581. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  582. var p = this.getPosition()
  583. , h = s[0].offsetWidth
  584. , f = s[0].offsetHeight;
  585. if (l) {
  586. var u = r
  587. , c = this.$element.parent()
  588. , d = this.getPosition(c);
  589. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  590. s.removeClass(u).addClass(r)
  591. }
  592. var g = this.getCalculatedOffset(r, p, h, f);
  593. this.applyPlacement(g, r);
  594. var y = function() {
  595. o.$element.trigger("shown.bs." + o.type),
  596. o.hoverState = null
  597. };
  598. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  599. }
  600. }
  601. ,
  602. i.prototype.applyPlacement = function(e, i) {
  603. var o = this.tip()
  604. , s = o[0].offsetWidth
  605. , n = o[0].offsetHeight
  606. , r = parseInt(o.css("margin-top"), 10)
  607. , a = parseInt(o.css("margin-left"), 10);
  608. isNaN(r) && (r = 0),
  609. isNaN(a) && (a = 0),
  610. e.top = e.top + r,
  611. e.left = e.left + a,
  612. t.offset.setOffset(o[0], t.extend({
  613. using: function(t) {
  614. o.css({
  615. top: Math.round(t.top),
  616. left: Math.round(t.left)
  617. })
  618. }
  619. }, e), 0),
  620. o.addClass("in");
  621. var l = o[0].offsetWidth
  622. , p = o[0].offsetHeight;
  623. "top" == i && p != n && (e.top = e.top + n - p);
  624. var h = this.getViewportAdjustedDelta(i, e, l, p);
  625. h.left ? e.left += h.left : e.top += h.top;
  626. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  627. , u = h.left ? "left" : "top"
  628. , c = h.left ? "offsetWidth" : "offsetHeight";
  629. o.offset(e),
  630. this.replaceArrow(f, o[0][c], u)
  631. }
  632. ,
  633. i.prototype.replaceArrow = function(t, e, i) {
  634. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  635. }
  636. ,
  637. i.prototype.setContent = function() {
  638. var t = this.tip()
  639. , e = this.getTitle();
  640. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  641. t.removeClass("fade in top bottom left right")
  642. }
  643. ,
  644. i.prototype.hide = function() {
  645. function e() {
  646. "in" != i.hoverState && o.detach(),
  647. i.$element.trigger("hidden.bs." + i.type)
  648. }
  649. var i = this
  650. , o = this.tip()
  651. , s = t.Event("hide.bs." + this.type);
  652. if (this.$element.removeAttr("aria-describedby"),
  653. this.$element.trigger(s),
  654. !s.isDefaultPrevented())
  655. return o.removeClass("in"),
  656. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  657. this.hoverState = null,
  658. this
  659. }
  660. ,
  661. i.prototype.fixTitle = function() {
  662. var t = this.$element;
  663. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  664. }
  665. ,
  666. i.prototype.hasContent = function() {
  667. return this.getTitle()
  668. }
  669. ,
  670. i.prototype.getPosition = function(e) {
  671. e = e || this.$element;
  672. var i = e[0]
  673. , o = "BODY" == i.tagName;
  674. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  675. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  676. width: o ? t(window).width() : e.outerWidth(),
  677. height: o ? t(window).height() : e.outerHeight()
  678. }, o ? {
  679. top: 0,
  680. left: 0
  681. } : e.offset())
  682. }
  683. ,
  684. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  685. return "bottom" == t ? {
  686. top: e.top + e.height,
  687. left: e.left + e.width / 2 - i / 2
  688. } : "top" == t ? {
  689. top: e.top - o,
  690. left: e.left + e.width / 2 - i / 2
  691. } : "left" == t ? {
  692. top: e.top + e.height / 2 - o / 2,
  693. left: e.left - i
  694. } : {
  695. top: e.top + e.height / 2 - o / 2,
  696. left: e.left + e.width
  697. }
  698. }
  699. ,
  700. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  701. var s = {
  702. top: 0,
  703. left: 0
  704. };
  705. if (!this.$viewport)
  706. return s;
  707. var n = this.options.viewport && this.options.viewport.padding || 0
  708. , r = this.getPosition(this.$viewport);
  709. if (/right|left/.test(t)) {
  710. var a = e.top - n - r.scroll
  711. , l = e.top + n - r.scroll + o;
  712. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  713. } else {
  714. var p = e.left - n
  715. , h = e.left + n + i;
  716. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  717. }
  718. return s
  719. }
  720. ,
  721. i.prototype.getTitle = function() {
  722. var t, e = this.$element, i = this.options;
  723. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  724. }
  725. ,
  726. i.prototype.getUID = function(t) {
  727. do
  728. t += ~~(1e6 * Math.random());
  729. while (document.getElementById(t));return t
  730. }
  731. ,
  732. i.prototype.tip = function() {
  733. return this.$tip = this.$tip || t(this.options.template)
  734. }
  735. ,
  736. i.prototype.arrow = function() {
  737. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  738. }
  739. ,
  740. i.prototype.validate = function() {
  741. this.$element[0].parentNode || (this.hide(),
  742. this.$element = null,
  743. this.options = null)
  744. }
  745. ,
  746. i.prototype.enable = function() {
  747. this.enabled = !0
  748. }
  749. ,
  750. i.prototype.disable = function() {
  751. this.enabled = !1
  752. }
  753. ,
  754. i.prototype.toggleEnabled = function() {
  755. this.enabled = !this.enabled
  756. }
  757. ,
  758. i.prototype.toggle = function(e) {
  759. var i = this;
  760. e && (i = t(e.currentTarget).data("bs." + this.type),
  761. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  762. t(e.currentTarget).data("bs." + this.type, i))),
  763. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  764. }
  765. ,
  766. i.prototype.destroy = function() {
  767. clearTimeout(this.timeout),
  768. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  769. }
  770. ;
  771. var o = t.fn.tooltip;
  772. t.fn.tooltip = e,
  773. t.fn.tooltip.Constructor = i,
  774. t.fn.tooltip.noConflict = function() {
  775. return t.fn.tooltip = o,
  776. this
  777. }
  778. }(jQuery);
  779. !function(e, t, n) {
  780. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  781. }("Keen", this, function() {
  782. "use strict";
  783. function Keen() {
  784. return _init.apply(this, arguments)
  785. }
  786. function _init(e) {
  787. if (_isUndefined(e))
  788. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  789. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  790. throw new Error("Please provide a projectId");
  791. this.configure(e)
  792. }
  793. function _extend(e) {
  794. for (var t = 1; t < arguments.length; t++)
  795. for (var n in arguments[t])
  796. e[n] = arguments[t][n];
  797. return e
  798. }
  799. function _isUndefined(e) {
  800. return void 0 === e
  801. }
  802. function _type(e) {
  803. var t = e && e.constructor ? e.constructor.toString() : void 0;
  804. return t ? t.match(/function (.*)\(/)[1] : "Null"
  805. }
  806. function _each(e, t, n) {
  807. var r;
  808. if (!e)
  809. return 0;
  810. if (n = n ? n : e,
  811. "array" === _type(e)) {
  812. for (r = 0; r < e.length; r++)
  813. if (t.call(n, e[r], r, e) === !1)
  814. return 0
  815. } else
  816. for (r in e)
  817. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  818. return 0;
  819. return 1
  820. }
  821. function _parse_params(e) {
  822. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  823. return decodeURIComponent(e.replace(r, " "))
  824. }, a = e.split("?")[1]; t = i.exec(a); )
  825. n[o(t[1])] = o(t[2]);
  826. return n
  827. }
  828. function _set_protocol(e) {
  829. switch (e) {
  830. case "http":
  831. return "http";
  832. case "auto":
  833. return location.protocol.replace(/:/g, "");
  834. case "https":
  835. case void 0:
  836. default:
  837. return "https"
  838. }
  839. }
  840. function _set_request_type(e) {
  841. var t = e || "jsonp"
  842. , n = !1;
  843. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  844. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  845. }
  846. function _build_url(e) {
  847. return this.client.endpoint + "/projects/" + this.client.projectId + e
  848. }
  849. function _uploadEvent(e, t, n, r, i) {
  850. var o = _build_url.apply(this, ["/events/" + e])
  851. , a = {};
  852. n = n !== !1,
  853. this.client.globalProperties && (a = this.client.globalProperties(e));
  854. for (var c in t)
  855. t.hasOwnProperty(c) && (a[c] = t[c]);
  856. switch (this.client.requestType) {
  857. case "xhr":
  858. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  859. break;
  860. case "jsonp":
  861. var s = JSON.stringify(a)
  862. , l = Keen.Base64.encode(s);
  863. o = o + "?api_key=" + this.client.writeKey,
  864. o = o + "&data=" + l,
  865. o = o + "&modified=" + (new Date).getTime(),
  866. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  867. break;
  868. case "beacon":
  869. var s = JSON.stringify(a)
  870. , l = Keen.Base64.encode(s);
  871. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  872. o = o + "&data=" + encodeURIComponent(l),
  873. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  874. o += "&c=clv1",
  875. _request.beacon.apply(this, [o, null, r, i])
  876. }
  877. }
  878. Keen.prototype.configure = function(e) {
  879. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  880. e.protocol = _set_protocol(e.protocol),
  881. e.requestType = _set_request_type(e.requestType),
  882. this.client = {
  883. projectId: e.projectId,
  884. writeKey: e.writeKey,
  885. readKey: e.readKey,
  886. globalProperties: null,
  887. endpoint: e.protocol + "://" + e.host,
  888. requestType: e.requestType
  889. },
  890. Keen.trigger("client", this, e),
  891. this.trigger("ready"),
  892. this
  893. }
  894. ;
  895. var _request = {
  896. xhr: function(e, t, n, r, i, o, a, c) {
  897. if (!i)
  898. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  899. var s = new XMLHttpRequest;
  900. if (s.onreadystatechange = function() {
  901. if (4 == s.readyState)
  902. if (s.status >= 200 && s.status < 300) {
  903. var e;
  904. try {
  905. e = JSON.parse(s.responseText)
  906. } catch (e) {
  907. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  908. c && c(s, e)
  909. }
  910. a && e && a(e)
  911. } else
  912. Keen.log("HTTP request failed."),
  913. c && c(s, null)
  914. }
  915. ,
  916. s.open(e, t, o),
  917. i && s.setRequestHeader("Authorization", i),
  918. r && s.setRequestHeader("Content-Type", "application/json"),
  919. n)
  920. for (var l in n)
  921. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  922. var u = r ? JSON.stringify(r) : null;
  923. s.send(u)
  924. },
  925. jsonp: function(e, t, n, r) {
  926. if (!t)
  927. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  928. if (t && e.indexOf("api_key") < 0) {
  929. var i = e.indexOf("?") > 0 ? "&" : "?";
  930. e = e + i + "api_key=" + t
  931. }
  932. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  933. o += "a";
  934. var a = !1;
  935. window[o] = function(e) {
  936. a = !0,
  937. n && e && n(e),
  938. window[o] = void 0
  939. }
  940. ,
  941. e = e + "&jsonp=" + o;
  942. var c = document.createElement("script");
  943. c.id = "keen-jsonp",
  944. c.src = e,
  945. document.getElementsByTagName("head")[0].appendChild(c),
  946. c.onreadystatechange = function() {
  947. a === !1 && "loaded" === this.readyState && (a = !0,
  948. r && r())
  949. }
  950. ,
  951. c.onerror = function() {
  952. a === !1 && (a = !0,
  953. r && r())
  954. }
  955. },
  956. beacon: function(e, t, n, r) {
  957. if (t && e.indexOf("api_key") < 0) {
  958. var i = e.indexOf("?") > 0 ? "&" : "?";
  959. e = e + i + "api_key=" + t
  960. }
  961. var o = !1
  962. , a = document.createElement("img");
  963. a.onload = function() {
  964. if (o = !0,
  965. "naturalHeight"in this) {
  966. if (this.naturalHeight + this.naturalWidth === 0)
  967. return void this.onerror()
  968. } else if (this.width + this.height === 0)
  969. return void this.onerror();
  970. n && n({
  971. created: !0
  972. })
  973. }
  974. ,
  975. a.onerror = function() {
  976. o = !0,
  977. r && r()
  978. }
  979. ,
  980. a.src = e
  981. }
  982. }
  983. , Events = Keen.Events = {
  984. on: function(e, t) {
  985. this.listeners || (this.listeners = {});
  986. var n = this.listeners[e] || (this.listeners[e] = []);
  987. return n.push({
  988. callback: t
  989. }),
  990. this
  991. },
  992. off: function(e, t) {
  993. if (!e && !t)
  994. return this.listeners = void 0,
  995. delete this.listeners,
  996. this;
  997. for (var n = this.listeners[e] || [], r = n.length; r--; )
  998. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  999. t && 0 != n.length || (this.listeners[e] = void 0,
  1000. delete this.listeners[e]);
  1001. return this
  1002. },
  1003. trigger: function(e) {
  1004. if (!this.listeners)
  1005. return this;
  1006. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1007. n[r].callback.apply(this, t);
  1008. return this
  1009. }
  1010. };
  1011. _extend(Keen.prototype, Events),
  1012. _extend(Keen, Events),
  1013. Keen.loaded = !0,
  1014. Keen.utils = {
  1015. each: _each,
  1016. extend: _extend,
  1017. parseParams: _parse_params
  1018. },
  1019. Keen.ready = function(e) {
  1020. Keen.loaded ? e() : Keen.on("ready", e)
  1021. }
  1022. ,
  1023. Keen.log = function(e) {
  1024. "object" == typeof console && console.log("[Keen IO]", e)
  1025. }
  1026. ;
  1027. var Plugins = Keen.Plugins = {};
  1028. Keen.prototype.addEvent = function() {
  1029. _uploadEvent.apply(this, arguments)
  1030. }
  1031. ,
  1032. Keen.prototype.addEventSync = function(e, t, n, r) {
  1033. _uploadEvent.apply(this, [e, t, !1, n, r])
  1034. }
  1035. ,
  1036. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1037. var o = e
  1038. , a = o.metaKey
  1039. , c = o.target
  1040. , s = !1
  1041. , l = function() {};
  1042. return void 0 === r && (r = 500),
  1043. "A" === c.nodeName ? l = function() {
  1044. a || s || (s = !0,
  1045. window.location = c.href)
  1046. }
  1047. : "FORM" === c.nodeName && (l = function() {
  1048. s || (s = !0,
  1049. c.submit())
  1050. }
  1051. ),
  1052. i && (l = function() {
  1053. s || (s = !0,
  1054. i())
  1055. }
  1056. ),
  1057. _uploadEvent.call(this, t, n, l, l),
  1058. setTimeout(function() {
  1059. l()
  1060. }, r),
  1061. !!a && void 0
  1062. }
  1063. ,
  1064. Keen.prototype.setGlobalProperties = function(e) {
  1065. if (!this.client)
  1066. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1067. if (!e || "function" != typeof e)
  1068. throw new Error("Invalid value for global properties: " + e);
  1069. this.client.globalProperties = e
  1070. }
  1071. ,
  1072. Keen.Base64 = {
  1073. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1074. encode: function(e) {
  1075. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1076. for (e = this.utf8.encode(e); l < e.length; )
  1077. t = e.charCodeAt(l++),
  1078. n = e.charCodeAt(l++),
  1079. r = e.charCodeAt(l++),
  1080. i = t >> 2,
  1081. o = (3 & t) << 4 | n >> 4,
  1082. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1083. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1084. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1085. return s
  1086. },
  1087. decode: function(e) {
  1088. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1089. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1090. t = u.indexOf(e.charAt(l++)),
  1091. n = u.indexOf(e.charAt(l++)),
  1092. r = u.indexOf(e.charAt(l++)),
  1093. i = u.indexOf(e.charAt(l++)),
  1094. o = t << 2 | n >> 4,
  1095. a = (15 & n) << 4 | r >> 2,
  1096. c = (3 & r) << 6 | i,
  1097. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1098. return this.utf8.decode(s)
  1099. },
  1100. utf8: {
  1101. encode: function(e) {
  1102. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1103. t = e.charCodeAt(r++),
  1104. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1105. return n
  1106. },
  1107. decode: function(e) {
  1108. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1109. n = e.charCodeAt(i),
  1110. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1111. return r
  1112. }
  1113. }
  1114. },
  1115. "object" != typeof JSON && (JSON = {}),
  1116. function() {
  1117. function f(e) {
  1118. return 10 > e ? "0" + e : e
  1119. }
  1120. function quote(e) {
  1121. return escapable.lastIndex = 0,
  1122. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1123. var t = meta[e];
  1124. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1125. }) + '"' : '"' + e + '"'
  1126. }
  1127. function str(e, t) {
  1128. var n, r, i, o, a, c = gap, s = t[e];
  1129. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1130. "function" == typeof rep && (s = rep.call(t, e, s)),
  1131. typeof s) {
  1132. case "string":
  1133. return quote(s);
  1134. case "number":
  1135. return isFinite(s) ? String(s) : "null";
  1136. case "boolean":
  1137. case "null":
  1138. return String(s);
  1139. case "object":
  1140. if (!s)
  1141. return "null";
  1142. if (gap += indent,
  1143. a = [],
  1144. "[object Array]" === Object.prototype.toString.apply(s)) {
  1145. for (o = s.length,
  1146. n = 0; o > n; n += 1)
  1147. a[n] = str(n, s) || "null";
  1148. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1149. gap = c,
  1150. i
  1151. }
  1152. if (rep && "object" == typeof rep)
  1153. for (o = rep.length,
  1154. n = 0; o > n; n += 1)
  1155. "string" == typeof rep[n] && (r = rep[n],
  1156. i = str(r, s),
  1157. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1158. else
  1159. for (r in s)
  1160. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1161. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1162. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1163. gap = c,
  1164. i
  1165. }
  1166. }
  1167. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1168. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1169. }
  1170. ,
  1171. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1172. return this.valueOf()
  1173. }
  1174. );
  1175. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1176. "\b": "\\b",
  1177. "\t": "\\t",
  1178. "\n": "\\n",
  1179. "\f": "\\f",
  1180. "\r": "\\r",
  1181. '"': '\\"',
  1182. "\\": "\\\\"
  1183. }, rep;
  1184. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1185. var r;
  1186. if (gap = "",
  1187. indent = "",
  1188. "number" == typeof n)
  1189. for (r = 0; n > r; r += 1)
  1190. indent += " ";
  1191. else
  1192. "string" == typeof n && (indent = n);
  1193. if (rep = t,
  1194. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1195. throw new Error("JSON.stringify");
  1196. return str("", {
  1197. "": e
  1198. })
  1199. }
  1200. ),
  1201. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1202. function walk(e, t) {
  1203. var n, r, i = e[t];
  1204. if (i && "object" == typeof i)
  1205. for (n in i)
  1206. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1207. void 0 !== r ? i[n] = r : delete i[n]);
  1208. return reviver.call(e, t, i)
  1209. }
  1210. var j;
  1211. if (text = String(text),
  1212. cx.lastIndex = 0,
  1213. cx.test(text) && (text = text.replace(cx, function(e) {
  1214. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1215. })),
  1216. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1217. return j = eval("(" + text + ")"),
  1218. "function" == typeof reviver ? walk({
  1219. "": j
  1220. }, "") : j;
  1221. throw new SyntaxError("JSON.parse")
  1222. }
  1223. )
  1224. }(),
  1225. !function(e, t, n) {
  1226. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1227. }("domready", Keen.utils, function(e) {
  1228. function t(e) {
  1229. for (d = 1; e = r.shift(); )
  1230. e()
  1231. }
  1232. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1233. return o[l] && o[l](s, n = function() {
  1234. o.removeEventListener(s, n, i),
  1235. t()
  1236. }
  1237. , i),
  1238. c && o.attachEvent(u, n = function() {
  1239. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1240. t())
  1241. }
  1242. ),
  1243. e = c ? function(t) {
  1244. self != top ? d ? t() : r.push(t) : function() {
  1245. try {
  1246. a.doScroll("left")
  1247. } catch (n) {
  1248. return setTimeout(function() {
  1249. e(t)
  1250. }, 50)
  1251. }
  1252. t()
  1253. }()
  1254. }
  1255. : function(e) {
  1256. d ? e() : r.push(e)
  1257. }
  1258. });
  1259. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1260. if (loaded && cached) {
  1261. clients = cached.clients || {},
  1262. ready = cached.ready || [];
  1263. for (var instance in clients)
  1264. if (clients.hasOwnProperty(instance)) {
  1265. var client = clients[instance];
  1266. for (var method in Keen.prototype)
  1267. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1268. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1269. ,
  1270. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1271. ,
  1272. client._config && (client.configure.call(client, client._config),
  1273. delete client._config),
  1274. client._setGlobalProperties) {
  1275. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1276. client.setGlobalProperties.apply(client, globals[i]);
  1277. delete client._setGlobalProperties
  1278. }
  1279. if (client._addEvent) {
  1280. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1281. client.addEvent.apply(client, queue[i]);
  1282. delete client._addEvent
  1283. }
  1284. var callback = client._on || [];
  1285. if (client._on) {
  1286. for (var i = 0; i < callback.length; i++)
  1287. client.on.apply(client, callback[i]);
  1288. client.trigger("ready"),
  1289. delete client._on
  1290. }
  1291. }
  1292. for (var i = 0; i < ready.length; i++) {
  1293. var callback = ready[i];
  1294. Keen.on("ready", function() {
  1295. callback()
  1296. })
  1297. }
  1298. }
  1299. return Keen.loaded && setTimeout(function() {
  1300. Keen.utils.domready(function() {
  1301. Keen.trigger("ready")
  1302. })
  1303. }, 0),
  1304. Keen
  1305. });
  1306. !function() {
  1307. var t = window.analytics = window.analytics || [];
  1308. if (!t.initialize) {
  1309. if (t.invoked)
  1310. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1311. t.invoked = !0,
  1312. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1313. t.factory = function(e) {
  1314. return function() {
  1315. var n = Array.prototype.slice.call(arguments);
  1316. return n.unshift(e),
  1317. t.push(n),
  1318. t
  1319. }
  1320. }
  1321. ;
  1322. for (var e = 0; e < t.methods.length; e++) {
  1323. var n = t.methods[e];
  1324. t[n] = t.factory(n)
  1325. }
  1326. t.load = function(t) {
  1327. var e = document.createElement("script");
  1328. e.type = "text/javascript",
  1329. e.async = !0,
  1330. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1331. var n = document.getElementsByTagName("script")[0];
  1332. n.parentNode.insertBefore(e, n)
  1333. }
  1334. ,
  1335. t.SNIPPET_VERSION = "4.0.0"
  1336. }
  1337. }();
  1338. !function(i, e) {
  1339. "use strict";
  1340. var s = ""
  1341. , r = "?"
  1342. , o = "function"
  1343. , a = "undefined"
  1344. , n = "object"
  1345. , t = "major"
  1346. , d = "model"
  1347. , w = "name"
  1348. , l = "type"
  1349. , p = "vendor"
  1350. , m = "version"
  1351. , c = "architecture"
  1352. , u = "console"
  1353. , g = "mobile"
  1354. , f = "tablet"
  1355. , h = "smarttv"
  1356. , b = {
  1357. has: function(i, e) {
  1358. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1359. },
  1360. lowerize: function(i) {
  1361. return i.toLowerCase()
  1362. }
  1363. }
  1364. , y = {
  1365. rgx: function() {
  1366. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1367. var c = m[p]
  1368. , u = m[p + 1];
  1369. if (typeof i === a) {
  1370. i = {};
  1371. for (t in u)
  1372. d = u[t],
  1373. typeof d === n ? i[d[0]] = e : i[d] = e
  1374. }
  1375. for (s = r = 0; s < c.length; s++)
  1376. if (w = c[s].exec(this.getUA())) {
  1377. for (t = 0; t < u.length; t++)
  1378. l = w[++r],
  1379. d = u[t],
  1380. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1381. break
  1382. }
  1383. if (w)
  1384. break
  1385. }
  1386. return i
  1387. },
  1388. str: function(i, s) {
  1389. for (var o in s)
  1390. if (typeof s[o] === n && s[o].length > 0) {
  1391. for (var a = 0; a < s[o].length; a++)
  1392. if (b.has(s[o][a], i))
  1393. return o === r ? e : o
  1394. } else if (b.has(s[o], i))
  1395. return o === r ? e : o;
  1396. return i
  1397. }
  1398. }
  1399. , v = {
  1400. browser: {
  1401. oldsafari: {
  1402. major: {
  1403. 1: ["/8", "/1", "/3"],
  1404. 2: "/4",
  1405. "?": "/"
  1406. },
  1407. version: {
  1408. "1.0": "/8",
  1409. 1.2: "/1",
  1410. 1.3: "/3",
  1411. "2.0": "/412",
  1412. "2.0.2": "/416",
  1413. "2.0.3": "/417",
  1414. "2.0.4": "/419",
  1415. "?": "/"
  1416. }
  1417. }
  1418. },
  1419. device: {
  1420. sprint: {
  1421. model: {
  1422. "Evo Shift 4G": "7373KT"
  1423. },
  1424. vendor: {
  1425. HTC: "APA",
  1426. Sprint: "Sprint"
  1427. }
  1428. }
  1429. },
  1430. os: {
  1431. windows: {
  1432. version: {
  1433. ME: "4.90",
  1434. "NT 3.11": "NT3.51",
  1435. "NT 4.0": "NT4.0",
  1436. 2e3: "NT 5.0",
  1437. XP: ["NT 5.1", "NT 5.2"],
  1438. Vista: "NT 6.0",
  1439. 7: "NT 6.1",
  1440. 8: "NT 6.2",
  1441. 8.1: "NT 6.3",
  1442. RT: "ARM"
  1443. }
  1444. }
  1445. }
  1446. }
  1447. , k = {
  1448. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1449. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1450. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1451. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1452. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1453. }
  1454. , x = function(e) {
  1455. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1456. return this instanceof x ? (this.getBrowser = function() {
  1457. return y.rgx.apply(this, k.browser)
  1458. }
  1459. ,
  1460. this.getCPU = function() {
  1461. return y.rgx.apply(this, k.cpu)
  1462. }
  1463. ,
  1464. this.getDevice = function() {
  1465. return y.rgx.apply(this, k.device)
  1466. }
  1467. ,
  1468. this.getEngine = function() {
  1469. return y.rgx.apply(this, k.engine)
  1470. }
  1471. ,
  1472. this.getOS = function() {
  1473. return y.rgx.apply(this, k.os)
  1474. }
  1475. ,
  1476. this.getResult = function() {
  1477. return {
  1478. ua: this.getUA(),
  1479. browser: this.getBrowser(),
  1480. engine: this.getEngine(),
  1481. os: this.getOS(),
  1482. device: this.getDevice(),
  1483. cpu: this.getCPU()
  1484. }
  1485. }
  1486. ,
  1487. this.getUA = function() {
  1488. return r
  1489. }
  1490. ,
  1491. this.setUA = function(i) {
  1492. return r = i,
  1493. this
  1494. }
  1495. ,
  1496. void this.setUA(r)) : new x(e).getResult()
  1497. };
  1498. if (typeof exports !== a)
  1499. typeof module !== a && module.exports && (exports = module.exports = x),
  1500. exports.UAParser = x;
  1501. else if (i.UAParser = x,
  1502. typeof define === o && define.amd && define(function() {
  1503. return x
  1504. }),
  1505. typeof i.jQuery !== a) {
  1506. var A = i.jQuery
  1507. , _ = new x;
  1508. A.ua = _.getResult(),
  1509. A.ua.get = function() {
  1510. return _.getUA()
  1511. }
  1512. ,
  1513. A.ua.set = function(i) {
  1514. _.setUA(i);
  1515. var e = _.getResult();
  1516. for (var s in e)
  1517. A.ua[s] = e[s]
  1518. }
  1519. }
  1520. }(this);
  1521. window.Modernizr = function(n, e, t) {
  1522. function o(n) {
  1523. d.cssText = n
  1524. }
  1525. function r(n, e) {
  1526. return typeof n === e
  1527. }
  1528. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1529. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1530. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1531. return e in n && r(n.constructor.prototype[e], "undefined")
  1532. }
  1533. : function(n, e) {
  1534. return v.call(n, e)
  1535. }
  1536. ,
  1537. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1538. var e = this;
  1539. if ("function" != typeof e)
  1540. throw new TypeError;
  1541. var t = b.call(arguments, 1)
  1542. , o = function() {
  1543. if (this instanceof o) {
  1544. var r = function() {};
  1545. r.prototype = e.prototype;
  1546. var i = new r
  1547. , c = e.apply(i, t.concat(b.call(arguments)));
  1548. return Object(c) === c ? c : i
  1549. }
  1550. return e.apply(n, t.concat(b.call(arguments)))
  1551. };
  1552. return o
  1553. }
  1554. ),
  1555. y.webgl = function() {
  1556. return !!n.WebGLRenderingContext
  1557. }
  1558. ;
  1559. for (var h in y)
  1560. u(y, h) && (c = h.toLowerCase(),
  1561. f[c] = y[h](),
  1562. w.push((f[c] ? "" : "no-") + c));
  1563. return f.addTest = function(n, e) {
  1564. if ("object" == typeof n)
  1565. for (var o in n)
  1566. u(n, o) && f.addTest(o, n[o]);
  1567. else {
  1568. if (n = n.toLowerCase(),
  1569. f[n] !== t)
  1570. return f;
  1571. e = "function" == typeof e ? e() : e,
  1572. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1573. f[n] = e
  1574. }
  1575. return f
  1576. }
  1577. ,
  1578. o(""),
  1579. p = i = null,
  1580. f._version = a,
  1581. f
  1582. }(this, this.document);
  1583. !function(e, t, a) {
  1584. "use strict";
  1585. function n(t, h, m) {
  1586. function H(a) {
  1587. var n = 0
  1588. , i = Ee.length;
  1589. if (Ce.old = e.extend({}, Ce),
  1590. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1591. ke = Be[ge.horizontal ? "width" : "height"](),
  1592. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1593. Ee.length = 0,
  1594. Ce.start = 0,
  1595. Ce.end = q(ze - Ie, 0),
  1596. Re) {
  1597. n = Ne.length,
  1598. qe = Pe.children(ge.itemSelector),
  1599. Ne.length = 0;
  1600. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1601. ze = 0,
  1602. qe.each(function(t, a) {
  1603. var n = e(a)
  1604. , i = a.getBoundingClientRect()
  1605. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1606. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1607. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1608. , h = l + d + p
  1609. , m = !d || !p
  1610. , g = {};
  1611. g.el = a,
  1612. g.size = m ? l : h,
  1613. g.half = g.size / 2,
  1614. g.start = ze + (m ? d : 0),
  1615. g.center = g.start - E(Ie / 2 - g.size / 2),
  1616. g.end = g.start - Ie + g.size,
  1617. t || (ze += s),
  1618. ze += h,
  1619. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1620. t === v && (g.end += o,
  1621. ze += o,
  1622. f = m ? p : 0),
  1623. Ne.push(g),
  1624. r = g
  1625. }),
  1626. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1627. ze -= f,
  1628. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1629. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1630. }
  1631. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1632. Q(),
  1633. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1634. Te = d(Te, ge.minHandleSize, ke),
  1635. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1636. xe.end = ke - Te,
  1637. it || j()),
  1638. !we && Ie > 0) {
  1639. var p = Ce.start
  1640. , h = "";
  1641. if (Re)
  1642. e.each(Ne, function(e, t) {
  1643. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1644. Ee.push(p),
  1645. p += Ie,
  1646. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1647. });
  1648. else
  1649. for (; p - Ie < Ce.end; )
  1650. Ee.push(p),
  1651. p += Ie;
  1652. if (De[0] && i !== Ee.length) {
  1653. for (var m = 0; m < Ee.length; m++)
  1654. h += ge.pageBuilder.call(ye, m);
  1655. Ae = De.html(h).children(),
  1656. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1657. }
  1658. }
  1659. if (Oe.slideeSize = ze,
  1660. Oe.frameSize = Ie,
  1661. Oe.sbSize = ke,
  1662. Oe.handleSize = Te,
  1663. Re) {
  1664. a && null != ge.startAt && (W(ge.startAt),
  1665. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1666. var g = Ne[Oe.activeItem];
  1667. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1668. } else
  1669. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1670. pe("load")
  1671. }
  1672. function X(e, t, a) {
  1673. if (Re && at.released && !a) {
  1674. var n = $(e)
  1675. , i = e > Ce.start && e < Ce.end;
  1676. Le ? (i && (e = Ne[n.centerItem].center),
  1677. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1678. }
  1679. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1680. et.start = +new Date,
  1681. et.time = 0,
  1682. et.from = Ce.cur,
  1683. et.to = e,
  1684. et.delta = e - Ce.cur,
  1685. et.tweesing = at.tweese || at.init && !at.slidee,
  1686. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1687. at.tweese = 0,
  1688. e !== Ce.dest && (Ce.dest = e,
  1689. pe("change"),
  1690. it || Y()),
  1691. K(),
  1692. Q(),
  1693. Z(),
  1694. F()
  1695. }
  1696. function Y() {
  1697. if (ye.initialized) {
  1698. if (!it)
  1699. return it = w(Y),
  1700. void (at.released && pe("moveStart"));
  1701. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1702. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1703. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1704. et.to === Ce.cur ? (Ce.cur = et.to,
  1705. at.tweese = it = 0) : it = w(Y),
  1706. pe("move"),
  1707. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1708. !it && at.released && pe("moveEnd"),
  1709. j()
  1710. }
  1711. }
  1712. function j() {
  1713. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1714. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1715. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1716. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1717. }
  1718. function F() {
  1719. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1720. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1721. pe("activePage", _e.page))
  1722. }
  1723. function M() {
  1724. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1725. ot = at.init ? w(M) : 0,
  1726. tt.now = +new Date,
  1727. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1728. X(at.init ? tt.pos : E(tt.pos)),
  1729. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1730. tt.lastTime = tt.now
  1731. }
  1732. function L(e, t, n) {
  1733. if ("boolean" === i(t) && (n = t,
  1734. t = a),
  1735. t === a)
  1736. X(Ce[e], n);
  1737. else {
  1738. if (Le && "center" !== e)
  1739. return;
  1740. var r = ye.getPos(t);
  1741. r && X(r[e], n, !Le)
  1742. }
  1743. }
  1744. function R(e) {
  1745. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1746. }
  1747. function U(e) {
  1748. return R(l(e) && 0 > e ? e + Ne.length : e)
  1749. }
  1750. function W(e, t) {
  1751. var a = R(e);
  1752. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1753. qe.eq(a).addClass(ge.activeClass),
  1754. _e.active = Oe.activeItem = a,
  1755. Z(),
  1756. pe("active", a)),
  1757. a)
  1758. }
  1759. function $(e) {
  1760. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1761. var t = {}
  1762. , a = Me ? 0 : Ie / 2;
  1763. if (!we)
  1764. for (var n = 0, i = Ee.length; i > n; n++) {
  1765. if (e >= Ce.end || n === Ee.length - 1) {
  1766. t.activePage = Ee.length - 1;
  1767. break
  1768. }
  1769. if (e <= Ee[n] + a) {
  1770. t.activePage = n;
  1771. break
  1772. }
  1773. }
  1774. if (Re) {
  1775. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1776. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1777. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1778. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1779. s = c;
  1780. break
  1781. }
  1782. t.firstItem = l(r) ? r : 0,
  1783. t.centerItem = l(o) ? o : t.firstItem,
  1784. t.lastItem = l(s) ? s : t.centerItem
  1785. }
  1786. return t
  1787. }
  1788. function Q(t) {
  1789. e.extend(Oe, $(t))
  1790. }
  1791. function Z() {
  1792. var e = Ce.dest <= Ce.start
  1793. , t = Ce.dest >= Ce.end
  1794. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1795. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1796. Je.is("button,input") && Je.prop("disabled", e),
  1797. Ke.is("button,input") && Ke.prop("disabled", t),
  1798. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1799. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1800. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1801. Qe.is("button,input") && Qe.prop("disabled", e),
  1802. $e.is("button,input") && $e.prop("disabled", t)),
  1803. Re && null != Oe.activeItem) {
  1804. var n = 0 === Oe.activeItem
  1805. , i = Oe.activeItem >= Ne.length - 1
  1806. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1807. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1808. Ze.is("button,input") && Ze.prop("disabled", n),
  1809. Ge.is("button,input") && Ge.prop("disabled", i),
  1810. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1811. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1812. }
  1813. }
  1814. function G(e, t, a) {
  1815. if (e = U(e),
  1816. t = U(t),
  1817. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1818. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1819. var n = t > e ? e : a ? t : t - 1
  1820. , i = e > t ? e : a ? t + 1 : t
  1821. , r = e > t;
  1822. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1823. H()
  1824. }
  1825. }
  1826. function J(e, t) {
  1827. for (var a = 0, n = Ve[e].length; n > a; a++)
  1828. if (Ve[e][a] === t)
  1829. return a;
  1830. return -1
  1831. }
  1832. function K() {
  1833. at.released && !ye.isPaused && ye.resume()
  1834. }
  1835. function V(e) {
  1836. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1837. }
  1838. function _() {
  1839. at.history[0] = at.history[1],
  1840. at.history[1] = at.history[2],
  1841. at.history[2] = at.history[3],
  1842. at.history[3] = at.delta
  1843. }
  1844. function ee(e) {
  1845. at.released = 0,
  1846. at.source = e,
  1847. at.slidee = "slidee" === e
  1848. }
  1849. function te(t) {
  1850. var a = "touchstart" === t.type
  1851. , n = t.data.source
  1852. , i = "slidee" === n;
  1853. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1854. ee(n),
  1855. at.init = 0,
  1856. at.$source = e(t.target),
  1857. at.touch = a,
  1858. at.pointer = a ? t.originalEvent.touches[0] : t,
  1859. at.initX = at.pointer.pageX,
  1860. at.initY = at.pointer.pageY,
  1861. at.initPos = i ? Ce.cur : xe.cur,
  1862. at.start = +new Date,
  1863. at.time = 0,
  1864. at.path = 0,
  1865. at.delta = 0,
  1866. at.locked = 0,
  1867. at.history = [0, 0, 0, 0],
  1868. at.pathToLock = i ? a ? 30 : 10 : 0,
  1869. b.on(a ? z : I, ae),
  1870. ye.pause(1),
  1871. (i ? Pe : Se).addClass(ge.draggedClass),
  1872. pe("moveStart"),
  1873. i && (rt = setInterval(_, 10)))
  1874. }
  1875. function ae(e) {
  1876. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1877. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1878. at.pathX = at.pointer.pageX - at.initX,
  1879. at.pathY = at.pointer.pageY - at.initY,
  1880. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1881. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1882. at.released || !(at.path < 1)) {
  1883. if (!at.init) {
  1884. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1885. return ne();
  1886. at.init = 1
  1887. }
  1888. r(e),
  1889. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1890. at.$source.on(B, s)),
  1891. at.released && (ne(),
  1892. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1893. at.delta += at.swing,
  1894. at.tweese = x(at.swing) > 10)),
  1895. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1896. }
  1897. }
  1898. function ne() {
  1899. clearInterval(rt),
  1900. at.released = !0,
  1901. b.off(at.touch ? z : I, ae),
  1902. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1903. setTimeout(function() {
  1904. at.$source.off(B, s)
  1905. }),
  1906. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1907. ye.resume(1),
  1908. at.init = 0
  1909. }
  1910. function ie(t) {
  1911. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1912. }
  1913. function re() {
  1914. ye.stop(),
  1915. b.off("mouseup", re)
  1916. }
  1917. function se(e) {
  1918. switch (r(e),
  1919. this) {
  1920. case $e[0]:
  1921. case Qe[0]:
  1922. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1923. b.on("mouseup", re);
  1924. break;
  1925. case Ze[0]:
  1926. ye.prev();
  1927. break;
  1928. case Ge[0]:
  1929. ye.next();
  1930. break;
  1931. case Je[0]:
  1932. ye.prevPage();
  1933. break;
  1934. case Ke[0]:
  1935. ye.nextPage()
  1936. }
  1937. }
  1938. function oe(e) {
  1939. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1940. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1941. Re ? (p = +new Date,
  1942. nt.last < p - nt.resetTime && (nt.delta = 0),
  1943. nt.last = p,
  1944. nt.delta += nt.curDelta,
  1945. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1946. nt.delta %= 1),
  1947. nt.finalDelta) : nt.curDelta
  1948. }
  1949. function le(e) {
  1950. e.originalEvent[g] = ye;
  1951. var t = +new Date;
  1952. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1953. return void (O = t);
  1954. if (ge.scrollBy && Ce.start !== Ce.end) {
  1955. var a = oe(e.originalEvent);
  1956. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1957. ye.slideBy(ge.scrollBy * a)
  1958. }
  1959. }
  1960. function ce(e) {
  1961. ge.clickBar && e.target === Be[0] && (r(e),
  1962. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1963. }
  1964. function de(e) {
  1965. if (ge.keyboardNavBy)
  1966. switch (e.which) {
  1967. case ge.horizontal ? 37 : 38:
  1968. r(e),
  1969. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1970. break;
  1971. case ge.horizontal ? 39 : 40:
  1972. r(e),
  1973. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1974. }
  1975. }
  1976. function ue(e) {
  1977. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1978. }
  1979. function fe() {
  1980. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1981. }
  1982. function ve(e) {
  1983. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1984. }
  1985. function pe(e, t) {
  1986. if (Ve[e]) {
  1987. for (me = Ve[e].length,
  1988. T.length = 0,
  1989. he = 0; me > he; he++)
  1990. T.push(Ve[e][he]);
  1991. for (he = 0; me > he; he++)
  1992. T[he].call(ye, e, t)
  1993. }
  1994. }
  1995. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  1996. start: 0,
  1997. center: 0,
  1998. end: 0,
  1999. cur: 0,
  2000. dest: 0
  2001. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2002. start: 0,
  2003. end: 0,
  2004. cur: 0
  2005. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2006. firstItem: 0,
  2007. lastItem: 0,
  2008. centerItem: 0,
  2009. activeItem: null,
  2010. activePage: 0
  2011. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2012. released: 1
  2013. }, nt = {
  2014. last: 0,
  2015. delta: 0,
  2016. resetTime: 200
  2017. }, it = 0, rt = 0, st = 0, ot = 0;
  2018. we || (t = be[0]),
  2019. ye.initialized = 0,
  2020. ye.frame = t,
  2021. ye.slidee = Pe[0],
  2022. ye.pos = Ce,
  2023. ye.rel = Oe,
  2024. ye.items = Ne,
  2025. ye.pages = Ee,
  2026. ye.isPaused = 0,
  2027. ye.options = ge,
  2028. ye.dragging = at,
  2029. ye.reload = function() {
  2030. H()
  2031. }
  2032. ,
  2033. ye.getPos = function(e) {
  2034. if (Re) {
  2035. var t = R(e);
  2036. return -1 !== t && Ne[t]
  2037. }
  2038. var a = Pe.find(e).eq(0);
  2039. if (a[0]) {
  2040. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2041. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2042. return {
  2043. start: n,
  2044. center: n - Ie / 2 + i / 2,
  2045. end: n - Ie + i,
  2046. size: i
  2047. }
  2048. }
  2049. return !1
  2050. }
  2051. ,
  2052. ye.moveBy = function(e) {
  2053. tt.speed = e,
  2054. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2055. tt.startPos = Ce.cur,
  2056. ee("button"),
  2057. at.init = 1,
  2058. pe("moveStart"),
  2059. y(ot),
  2060. M())
  2061. }
  2062. ,
  2063. ye.stop = function() {
  2064. "button" === at.source && (at.init = 0,
  2065. at.released = 1)
  2066. }
  2067. ,
  2068. ye.prev = function() {
  2069. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2070. }
  2071. ,
  2072. ye.next = function() {
  2073. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2074. }
  2075. ,
  2076. ye.prevPage = function() {
  2077. ye.activatePage(Oe.activePage - 1)
  2078. }
  2079. ,
  2080. ye.nextPage = function() {
  2081. ye.activatePage(Oe.activePage + 1)
  2082. }
  2083. ,
  2084. ye.slideBy = function(e, t) {
  2085. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2086. }
  2087. ,
  2088. ye.slideTo = function(e, t) {
  2089. X(e, t)
  2090. }
  2091. ,
  2092. ye.toStart = function(e, t) {
  2093. L("start", e, t)
  2094. }
  2095. ,
  2096. ye.toEnd = function(e, t) {
  2097. L("end", e, t)
  2098. }
  2099. ,
  2100. ye.toCenter = function(e, t) {
  2101. L("center", e, t)
  2102. }
  2103. ,
  2104. ye.getIndex = R,
  2105. ye.activate = function(e, t) {
  2106. var a = W(e);
  2107. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2108. }
  2109. ,
  2110. ye.activatePage = function(e, t) {
  2111. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2112. }
  2113. ,
  2114. ye.resume = function(e) {
  2115. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2116. st ? st = clearTimeout(st) : pe("resume"),
  2117. st = setTimeout(function() {
  2118. switch (pe("cycle"),
  2119. ge.cycleBy) {
  2120. case "items":
  2121. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2122. break;
  2123. case "pages":
  2124. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2125. }
  2126. }, ge.cycleInterval))
  2127. }
  2128. ,
  2129. ye.pause = function(e) {
  2130. e < ye.isPaused || (ye.isPaused = e || 100,
  2131. st && (st = clearTimeout(st),
  2132. pe("pause")))
  2133. }
  2134. ,
  2135. ye.toggle = function() {
  2136. ye[st ? "pause" : "resume"]()
  2137. }
  2138. ,
  2139. ye.set = function(t, a) {
  2140. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2141. }
  2142. ,
  2143. ye.add = function(t, a) {
  2144. var n = e(t);
  2145. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2146. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2147. H()
  2148. }
  2149. ,
  2150. ye.remove = function(t) {
  2151. if (Re) {
  2152. var a = U(t);
  2153. if (a > -1) {
  2154. qe.eq(a).remove();
  2155. var n = a === Oe.activeItem;
  2156. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2157. H(),
  2158. n && (_e.active = null,
  2159. ye.activate(Oe.activeItem))
  2160. }
  2161. } else
  2162. e(t).remove(),
  2163. H()
  2164. }
  2165. ,
  2166. ye.moveAfter = function(e, t) {
  2167. G(e, t, 1)
  2168. }
  2169. ,
  2170. ye.moveBefore = function(e, t) {
  2171. G(e, t)
  2172. }
  2173. ,
  2174. ye.on = function(e, t) {
  2175. if ("object" === i(e))
  2176. for (var a in e)
  2177. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2178. else if ("function" === i(t))
  2179. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2180. Ve[n[r]] = Ve[n[r]] || [],
  2181. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2182. else if ("array" === i(t))
  2183. for (var o = 0, l = t.length; l > o; o++)
  2184. ye.on(e, t[o])
  2185. }
  2186. ,
  2187. ye.one = function(e, t) {
  2188. function a() {
  2189. t.apply(ye, arguments),
  2190. ye.off(e, a)
  2191. }
  2192. ye.on(e, a)
  2193. }
  2194. ,
  2195. ye.off = function(e, t) {
  2196. if (t instanceof Array)
  2197. for (var a = 0, n = t.length; n > a; a++)
  2198. ye.off(e, t[a]);
  2199. else
  2200. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2201. if (Ve[i[r]] = Ve[i[r]] || [],
  2202. null == t)
  2203. Ve[i[r]].length = 0;
  2204. else {
  2205. var o = J(i[r], t);
  2206. -1 !== o && Ve[i[r]].splice(o, 1)
  2207. }
  2208. }
  2209. ,
  2210. ye.destroy = function() {
  2211. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2212. b.off("keydown", de),
  2213. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2214. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2215. De.empty(),
  2216. we || (be.off("." + g),
  2217. He.restore(),
  2218. Xe.restore(),
  2219. Ye.restore(),
  2220. je.restore(),
  2221. e.removeData(t, g)),
  2222. Ne.length = Ee.length = 0,
  2223. _e = {},
  2224. ye.initialized = 0,
  2225. ye
  2226. }
  2227. ,
  2228. ye.init = function() {
  2229. if (!ye.initialized) {
  2230. ye.on(m);
  2231. var e = ["overflow", "position"]
  2232. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2233. He.save.apply(He, e),
  2234. Ye.save.apply(Ye, e),
  2235. Xe.save.apply(Xe, t),
  2236. je.save.apply(je, t);
  2237. var a = Se;
  2238. return we || (a = a.add(Pe),
  2239. be.css("overflow", "hidden"),
  2240. f || "static" !== be.css("position") || be.css("position", "relative")),
  2241. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2242. a.css({
  2243. position: "absolute"
  2244. })),
  2245. ge.forward && $e.on(S, se),
  2246. ge.backward && Qe.on(S, se),
  2247. ge.prev && Ze.on(B, se),
  2248. ge.next && Ge.on(B, se),
  2249. ge.prevPage && Je.on(B, se),
  2250. ge.nextPage && Ke.on(B, se),
  2251. Ue.on(C, le),
  2252. Be[0] && Be.on(B, ce),
  2253. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2254. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2255. We.on(P, {
  2256. source: "slidee"
  2257. }, te),
  2258. Se && Se.on(P, {
  2259. source: "handle"
  2260. }, te),
  2261. b.on("keydown", de),
  2262. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2263. be.on("scroll." + g, o)),
  2264. ye.initialized = 1,
  2265. H(!0),
  2266. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2267. ye
  2268. }
  2269. }
  2270. }
  2271. function i(e) {
  2272. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2273. }
  2274. function r(e, t) {
  2275. e.preventDefault(),
  2276. t && e.stopPropagation()
  2277. }
  2278. function s(t) {
  2279. r(t, 1),
  2280. e(this).off(t.type, s)
  2281. }
  2282. function o() {
  2283. this.scrollLeft = 0,
  2284. this.scrollTop = 0
  2285. }
  2286. function l(e) {
  2287. return !isNaN(parseFloat(e)) && isFinite(e)
  2288. }
  2289. function c(e, t) {
  2290. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2291. }
  2292. function d(e, t, a) {
  2293. return t > e ? t : e > a ? a : e
  2294. }
  2295. function u(e) {
  2296. var t = {};
  2297. return t.style = {},
  2298. t.save = function() {
  2299. if (e && e.nodeType) {
  2300. for (var a = 0; a < arguments.length; a++)
  2301. t.style[arguments[a]] = e.style[arguments[a]];
  2302. return t
  2303. }
  2304. }
  2305. ,
  2306. t.restore = function() {
  2307. if (e && e.nodeType) {
  2308. for (var a in t.style)
  2309. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2310. return t
  2311. }
  2312. }
  2313. ,
  2314. t
  2315. }
  2316. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2317. b.on(C, function(e) {
  2318. var t = e.originalEvent[g]
  2319. , a = +new Date;
  2320. (!t || t.options.scrollHijack < a - O) && (O = a)
  2321. }),
  2322. function(e) {
  2323. function t(e) {
  2324. var t = (new Date).getTime()
  2325. , n = Math.max(0, 16 - (t - a))
  2326. , i = setTimeout(e, n);
  2327. return a = t,
  2328. i
  2329. }
  2330. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2331. var a = (new Date).getTime()
  2332. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2333. y = function(t) {
  2334. n.call(e, t)
  2335. }
  2336. }(window),
  2337. function() {
  2338. function e(e) {
  2339. for (var n = 0, i = t.length; i > n; n++) {
  2340. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2341. if (null != a.style[r])
  2342. return r
  2343. }
  2344. }
  2345. var t = ["", "webkit", "moz", "ms", "o"]
  2346. , a = document.createElement("div");
  2347. f = e("transform"),
  2348. v = e("perspective") ? "translateZ(0) " : ""
  2349. }(),
  2350. t[m] = n,
  2351. e.fn[h] = function(t, a) {
  2352. var r, s;
  2353. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2354. s = Array.prototype.slice.call(arguments, 1)),
  2355. t = {}),
  2356. this.each(function(i, o) {
  2357. var l = e.data(o, g);
  2358. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2359. })
  2360. }
  2361. ,
  2362. n.defaults = {
  2363. slidee: null,
  2364. horizontal: !1,
  2365. itemNav: null,
  2366. itemSelector: null,
  2367. smart: !1,
  2368. activateOn: null,
  2369. activateMiddle: !1,
  2370. scrollSource: null,
  2371. scrollBy: 0,
  2372. scrollHijack: 300,
  2373. scrollTrap: !1,
  2374. dragSource: null,
  2375. mouseDragging: !1,
  2376. touchDragging: !1,
  2377. releaseSwing: !1,
  2378. swingSpeed: .2,
  2379. elasticBounds: !1,
  2380. interactive: null,
  2381. scrollBar: null,
  2382. dragHandle: !1,
  2383. dynamicHandle: !1,
  2384. minHandleSize: 50,
  2385. clickBar: !1,
  2386. syncSpeed: .5,
  2387. pagesBar: null,
  2388. activatePageOn: null,
  2389. pageBuilder: function(e) {
  2390. return "<li>" + (e + 1) + "</li>"
  2391. },
  2392. forward: null,
  2393. backward: null,
  2394. prev: null,
  2395. next: null,
  2396. prevPage: null,
  2397. nextPage: null,
  2398. cycleBy: null,
  2399. cycleInterval: 5e3,
  2400. pauseOnHover: !1,
  2401. startPaused: !1,
  2402. moveBy: 300,
  2403. speed: 0,
  2404. easing: "swing",
  2405. startAt: null,
  2406. keyboardNavBy: null,
  2407. draggedClass: "dragged",
  2408. activeClass: "active",
  2409. disabledClass: "disabled"
  2410. }
  2411. }(jQuery, window);
  2412. !function e(t, i, n) {
  2413. function r(a, s) {
  2414. if (!i[a]) {
  2415. if (!t[a]) {
  2416. var l = "function" == typeof require && require;
  2417. if (!s && l)
  2418. return l(a, !0);
  2419. if (o)
  2420. return o(a, !0);
  2421. var c = new Error("Cannot find module '" + a + "'");
  2422. throw c.code = "MODULE_NOT_FOUND",
  2423. c
  2424. }
  2425. var h = i[a] = {
  2426. exports: {}
  2427. };
  2428. t[a][0].call(h.exports, function(e) {
  2429. var i = t[a][1][e];
  2430. return r(i ? i : e)
  2431. }, h, h.exports, e, t, i, n)
  2432. }
  2433. return i[a].exports
  2434. }
  2435. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2436. r(n[a]);
  2437. return r
  2438. }({
  2439. 1: [function(e, t, i) {
  2440. (function(i) {
  2441. "use strict";
  2442. function n(e) {
  2443. this.player = null,
  2444. this.director = null,
  2445. this.modelManager = null,
  2446. this.container = null,
  2447. this.tagManager = null,
  2448. this.fadeInSpeed = e,
  2449. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2450. }
  2451. var r = e("three")
  2452. , o = e("./util/logger")
  2453. , a = (e("./util/common"),
  2454. e("./enum/PlayerEvents"))
  2455. , s = e("./enum/DirectorEvents")
  2456. , l = e("./settings")
  2457. , c = e("./enum/Viewmode")
  2458. , h = (e("./enum/WarpStyle"),
  2459. e("./enum/BlackoutStyle"),
  2460. e("./enum/ModelManagerEvents"))
  2461. , u = e("./enum/tagEvents")
  2462. , d = e("./util/transitions")
  2463. , p = e("./util/lerp")
  2464. , f = new o(i);
  2465. //window.THREE = r;
  2466. n.prototype.init = function(e, t, i, n, r) {
  2467. window.app = this;
  2468. this.player = t,
  2469. this.director = e,
  2470. this.modelManager = i,
  2471. this.tagManager = n,
  2472. this.container = r,
  2473. this.updateModel(),
  2474. this.bindEvents()
  2475. }
  2476. ,
  2477. n.prototype.bindEvents = function() {
  2478. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2479. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2480. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2481. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2482. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2483. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2484. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2485. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2486. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2487. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2488. }
  2489. ,
  2490. n.prototype.updateModel = function() {
  2491. //模型this.model
  2492. this.model = this.modelManager.getActiveModel()
  2493. }
  2494. ,
  2495. n.prototype.handleWarpStarted = function() {
  2496. this.hidePlayerReticule()
  2497. }
  2498. ,
  2499. n.prototype.ontagActivated = function() {
  2500. this.hidePlayerReticule()
  2501. }
  2502. ,
  2503. n.prototype.onNavigationTotag = function() {
  2504. this.hidePlayerReticule()
  2505. }
  2506. ,
  2507. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2508. var n = this.modelManager.getActiveModel()
  2509. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2510. n.fadePanoMarkers(r),
  2511. n.setMode(t)
  2512. }
  2513. ,
  2514. n.prototype.handlePlayerModeChanged = function(e, t) {
  2515. var i = this.modelManager.getActiveModel()
  2516. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2517. i.setSide(n),
  2518. i.setMode(t)
  2519. }
  2520. ,
  2521. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2522. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2523. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2524. }
  2525. ,
  2526. n.prototype.handleActionInterruption = function() {}
  2527. ,
  2528. n.prototype.handleStartInside = function(e) {
  2529. var t = l[this.player.mode]
  2530. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2531. this.fadeIn(this.fadeInSpeed),
  2532. this.model.alpha = 0,
  2533. this.model.skybox.material.uniforms.opacity.value = 1,
  2534. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2535. var n = this.player.reticule;
  2536. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2537. }
  2538. ,
  2539. n.prototype.handleStartOutside = function(e) {
  2540. this.fadeIn(e)
  2541. }
  2542. ,
  2543. n.prototype.fadeIn = function(e) {
  2544. null !== e && void 0 !== e || (e = 2e3,
  2545. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2546. $(this.container).fadeIn(e)
  2547. }
  2548. ,
  2549. n.prototype.hidePlayerReticule = function() {
  2550. this.player.reticule.hide()
  2551. }
  2552. ,
  2553. t.exports = n
  2554. }
  2555. ).call(this, "/js/DisplayController.js")
  2556. }
  2557. , {
  2558. "./enum/BlackoutStyle": 18,
  2559. "./enum/DirectorEvents": 23,
  2560. "./enum/tagEvents": 32,
  2561. "./enum/ModelManagerEvents": 33,
  2562. "./enum/PlayerEvents": 40,
  2563. "./enum/Viewmode": 51,
  2564. "./enum/WarpStyle": 52,
  2565. "./settings": 166,
  2566. "./util/common": 185,
  2567. "./util/lerp": 188,
  2568. "./util/logger": 189,
  2569. "./util/transitions": 195,
  2570. three: 217
  2571. }],
  2572. 2: [function(e, t, i) {
  2573. "use strict";
  2574. function n() {
  2575. this.baseStartTime = performance.timing.navigationStart,
  2576. this.loadingStartTime = null,
  2577. this.waitingStartTime = null,
  2578. this.appReadyTime = null
  2579. }
  2580. n.prototype.setBaseStartTime = function(e) {
  2581. this.baseStartTime = e || Date.now()
  2582. }
  2583. ,
  2584. n.prototype.setWaitingStartTime = function(e) {
  2585. this.waitingStartTime = e || Date.now()
  2586. }
  2587. ,
  2588. n.prototype.setLoadingStartTime = function(e) {
  2589. this.loadingStartTime = e || Date.now()
  2590. }
  2591. ,
  2592. n.prototype.setAppReadyTime = function(e) {
  2593. this.appReadyTime = e || Date.now()
  2594. }
  2595. ,
  2596. n.prototype.calcFullLoadingTime = function() {
  2597. var e = this.appReadyTime - this.baseStartTime;
  2598. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2599. e
  2600. }
  2601. ,
  2602. t.exports = n
  2603. }
  2604. , {}],
  2605. 3: [function(e, t, i) {
  2606. (function(i) {
  2607. "use strict";
  2608. function n() {
  2609. return 100 * Math.random()
  2610. }
  2611. var r = e("./util/logger")
  2612. , o = e("./util/browser")
  2613. , a = new r(i)
  2614. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2615. initialized: !1,
  2616. init: function(e, t) {
  2617. if (t = t || {},
  2618. !this.initialized) {
  2619. this.initialized = !0,
  2620. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2621. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2622. for (var i in e) {
  2623. var r = i.match("^sc_tilegen_([0-9]+)$");
  2624. r && (s.tilegen = n() < parseInt(r[1]));
  2625. var l = i.match("^sc_imgopt_([0-9]+)$");
  2626. l && (s.imgopt = n() < parseInt(l[1]))
  2627. }
  2628. for (var c in t)
  2629. s[c] = t[c],
  2630. a.debug("A/B override:", c, s[c])
  2631. }
  2632. },
  2633. changeIfTileGenerating: function(e) {
  2634. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2635. e += ""),
  2636. e
  2637. },
  2638. changeIfImageOptimzing: function(e) {
  2639. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2640. e += ""),
  2641. e
  2642. },
  2643. tilegen: !1,
  2644. imgopt: !1
  2645. };
  2646. t.exports = s
  2647. }
  2648. ).call(this, "/js/ab.js")
  2649. }
  2650. , {
  2651. "./util/browser": 182,
  2652. "./util/logger": 189
  2653. }],
  2654. 4: [function(e, t, i) {
  2655. (function(i) {
  2656. "use strict";
  2657. function n() {
  2658. return {
  2659. addons: [{
  2660. name: "keen:ua_parser",
  2661. input: {
  2662. ua_string: "user_agent"
  2663. },
  2664. output: "parsed_user_agent"
  2665. }]
  2666. }
  2667. }
  2668. function r(e, t, i, n) {
  2669. function r(t) {
  2670. l[t.sid] = !0;
  2671. var i = t.billboard.media && t.billboard.media.type
  2672. , n = {
  2673. tag_id: t.sid,
  2674. tags_visited: Object.keys(l).length,
  2675. tag_count: Object.keys(e.tags).length,
  2676. tag_view_count: ++E,
  2677. has_media: !!i
  2678. };
  2679. i && (n.media_type = i),
  2680. u("tag_opened", n)
  2681. }
  2682. var l = {}
  2683. , h = Date.now() - N
  2684. , f = null;
  2685. n && (f = Date.now() - window.navigationStart);
  2686. var g;
  2687. try {
  2688. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2689. } catch (e) {
  2690. g = !1
  2691. }
  2692. var v, A = e.supportsVR;
  2693. A || (v = "VR disabled at the model/account level",
  2694. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2695. u("model_loaded", {
  2696. duration: h,
  2697. duration_from_navigation_start: f,
  2698. has_hlr: g,
  2699. has_vr: A,
  2700. vr_reason: v
  2701. });
  2702. var I = 0;
  2703. e.panos.forEach(function(e) {
  2704. e.on("enter", function() {
  2705. c("pano_viewed", {
  2706. pano_id: e.id,
  2707. pano_view_count: ++I,
  2708. alignment_type: e.alignmentType,
  2709. interaction_source: O,
  2710. navigation_source: p
  2711. })
  2712. })
  2713. });
  2714. var E = 0;
  2715. for (var T in e.tags)
  2716. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2717. t.on("tour_auto", function(e) {
  2718. p = "tour_" + e
  2719. }),
  2720. t.on("tour_manual", function(e) {
  2721. O = "gui-" + e,
  2722. p = "tour_manual"
  2723. }),
  2724. i.on(C.InteractionKey, function() {
  2725. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2726. }),
  2727. i.on(C.InteractionDirect, function() {
  2728. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2729. }),
  2730. o(t),
  2731. a(),
  2732. s()
  2733. }
  2734. function o(e) {
  2735. I.on(T.OPENED, function() {
  2736. c("showcase_share_intent", {
  2737. pano_id: e.currentPano && e.currentPano.id
  2738. })
  2739. }),
  2740. I.on(T.LINK_CLICKED, function(t) {
  2741. c("showcase_share_action", {
  2742. channel: t.channel,
  2743. pano_id: e.currentPano && e.currentPano.id
  2744. })
  2745. }),
  2746. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2747. c("showcase_share_origin_link_clicked")
  2748. })
  2749. }
  2750. function a() {}
  2751. function s() {
  2752. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2753. gui_action: "click_vr_button"
  2754. })),
  2755. b.on(S.LAUNCH, function(e) {
  2756. c("showcase_gui", {
  2757. gui_action: "launch_vr",
  2758. vr_platform: e.vr_platform,
  2759. vr_app: e.vr_app
  2760. })
  2761. }),
  2762. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2763. gui_action: "vr_modal_prev"
  2764. })),
  2765. b.on(S.NEXT, function(e) {
  2766. c("showcase_gui", {
  2767. gui_action: e.nextAction
  2768. })
  2769. }),
  2770. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2771. gui_action: "vr_modal_close"
  2772. })),
  2773. b.on(S.falseICECHOSEN, function(e) {
  2774. c("showcase_gui", {
  2775. gui_action: e.name + " "
  2776. })
  2777. }),
  2778. b.on(S.STORE, function(e) {
  2779. c("showcase_gui", {
  2780. gui_action: "launch_store",
  2781. store: e
  2782. })
  2783. })
  2784. }
  2785. function l(e, t) {
  2786. if (f)
  2787. try {
  2788. f.addEvent(e, v.extendObject({
  2789. host: window.location.host,
  2790. keen: n(),
  2791. user_agent: "${keen.user_agent}",
  2792. referrer: {
  2793. url: v.normalizeUrl(document.referrer),
  2794. domain: v.domainFromUrl(document.referrer),
  2795. url_original: document.referrer
  2796. },
  2797. embedded: m.inIframe(),
  2798. is_mobile: m.isMobile(),
  2799. version: "2.25.6-0-gd87e5b1"
  2800. }, t))
  2801. } catch (e) {
  2802. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2803. }
  2804. }
  2805. function c(e, t) {
  2806. if (t = t || {},
  2807. L)
  2808. try {
  2809. window.analytics.track(e, v.extendObject(t, B), {
  2810. context: {
  2811. app: {
  2812. name: "showcase",
  2813. version: "2.25.6-0-gd87e5b1"
  2814. },
  2815. screen: {
  2816. width: window.screen.width,
  2817. height: window.screen.height,
  2818. density: window.devicePixelRatio
  2819. }
  2820. }
  2821. })
  2822. } catch (t) {
  2823. console.warn("Failed to send data to segment for " + e)
  2824. }
  2825. }
  2826. function h(e, t) {
  2827. if (t = t || {},
  2828. navigator.sendBeacon && L)
  2829. try {
  2830. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2831. event: e,
  2832. anonymousId: window.analytics.user().anonymousId(),
  2833. properties: v.extendObject(t, B),
  2834. writeKey: L,
  2835. sentAt: Date.now(),
  2836. type: "track",
  2837. context: {
  2838. userAgent: m.userAgent(),
  2839. library: {
  2840. name: "showcase-beacon",
  2841. version: "2.25.6-0-gd87e5b1"
  2842. },
  2843. app: {
  2844. name: "showcase",
  2845. version: "2.25.6-0-gd87e5b1"
  2846. }
  2847. }
  2848. }))
  2849. } catch (e) {
  2850. console.warn("Failed to send async segment request")
  2851. }
  2852. }
  2853. function u(e, t) {
  2854. t = t || {},
  2855. c(e, t)
  2856. }
  2857. function d(e, t) {
  2858. O = e === C.InteractionGui ? "gui-" + t : e,
  2859. p = "self_guided"
  2860. }
  2861. var p, f, g = (e("three"),
  2862. e("./util/ajax"),
  2863. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2864. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2865. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2866. t.exports = {
  2867. report: function(e, t, i, n) {
  2868. l("Session starts", {
  2869. model: e,
  2870. status: t,
  2871. loadtime: Date.now() - (N || Date.now()),
  2872. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2873. autoplay: i,
  2874. quickstart: n,
  2875. ab_tilegen: g.tilegen,
  2876. ab_imgopt: g.imgopt
  2877. })
  2878. },
  2879. impression: function(e) {
  2880. e = e || {};
  2881. var t = void 0 === e.isVisible || e.isVisible
  2882. , i = (void 0 !== e.immediate && e.immediate,
  2883. window.location.search.substr(1).split("&"));
  2884. u("impression", {
  2885. visible: t,
  2886. url_params: i
  2887. })
  2888. },
  2889. initKeen: function(e) {
  2890. return e.token && e.appId ? void (f = new Keen({
  2891. projectId: e.appId,
  2892. writeKey: e.token,
  2893. readKey: "",
  2894. requestType: "xhr"
  2895. })) : void P.warn("no keen token/appId")
  2896. },
  2897. initSegment: function(e) {
  2898. return e.token ? (L = e.token,
  2899. window.analytics.load(e.token),
  2900. B = {
  2901. model_id: e.model,
  2902. start_source: e.startSource,
  2903. autoplay: e.autoplay,
  2904. quickstart: e.quickstart,
  2905. language_tag: A.languageTag,
  2906. is_mobile: m.isMobile(),
  2907. iframe: m.inIframe(),
  2908. aspect_ratio: m.aspectRatio(),
  2909. session_id: F,
  2910. window: {
  2911. width: $("#player").width(),
  2912. height: $("#player").height()
  2913. },
  2914. platform: {
  2915. browser: {
  2916. name: $.ua.browser.name,
  2917. major: $.ua.browser.major,
  2918. version: $.ua.browser.version
  2919. },
  2920. os: {
  2921. name: $.ua.os.name,
  2922. version: $.ua.os.version
  2923. },
  2924. device: {
  2925. vendor: $.ua.device.vendor,
  2926. model: $.ua.device.model,
  2927. type: $.ua.device.type
  2928. }
  2929. }
  2930. },
  2931. D = Math.random() < A.analytics.sessionTrackingRate,
  2932. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2933. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2934. },
  2935. sessionStart: function(e) {
  2936. P.debug("analytics user_session_start"),
  2937. c("session_started"),
  2938. N = Date.now(),
  2939. window.addEventListener("unload", function() {
  2940. h("session_ended", {
  2941. duration: Date.now() - N
  2942. })
  2943. })
  2944. },
  2945. modelLoaded: function(e, t, i, n) {
  2946. r(e, t, i, n)
  2947. },
  2948. loadComplete: function(e) {
  2949. var t = {
  2950. time_to_app_start: e
  2951. };
  2952. c("load_times", t)
  2953. },
  2954. track: function(e, t) {
  2955. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2956. c(e, t))
  2957. },
  2958. trackAlways: function(e, t) {
  2959. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2960. c(e, t)
  2961. },
  2962. getSessionId: function() {
  2963. return F
  2964. },
  2965. updateInteraction: d
  2966. }
  2967. }
  2968. ).call(this, "/js/analytics.js")
  2969. }
  2970. , {
  2971. "./ab": 3,
  2972. "./enum/ControlEvents": 21,
  2973. "./enum/PlayerEvents": 40,
  2974. "./enum/VROption": 47,
  2975. "./enum/VRPlatforms": 49,
  2976. "./enum/Viewmode": 51,
  2977. "./gui/sharing/ShareEvents": 76,
  2978. "./gui/sharing/modal": 77,
  2979. "./gui/title/TitleEvents": 80,
  2980. "./gui/title/titleBar": 82,
  2981. "./gui/vr/vrEvent": 85,
  2982. "./gui/vr/vrModal": 87,
  2983. "./localization/localize": 108,
  2984. "./tag/Billboard/BillboardEvent": 120,
  2985. "./settings": 166,
  2986. "./util/ajax": 181,
  2987. "./util/browser": 182,
  2988. "./util/common": 185,
  2989. "./util/logger": 189,
  2990. three: 217
  2991. }],
  2992. 5: [function(e, t, i) {
  2993. "use strict";
  2994. function n() {
  2995. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2996. this.controls = null
  2997. }
  2998. var r = e("three")
  2999. , o = e("../constants")
  3000. , a = e("../util/cameraLight");
  3001. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3002. n.prototype.updateAspect = function(e) {
  3003. this.aspect = e,
  3004. this.updateProjectionMatrix()
  3005. }
  3006. ,
  3007. t.exports = n
  3008. }
  3009. , {
  3010. "../constants": 8,
  3011. "../util/cameraLight": 184,
  3012. three: 217
  3013. }],
  3014. 6: [function(e, t, i) {
  3015. "use strict";
  3016. function n() {
  3017. var e = $("#player").width() / $("#player").height();
  3018. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3019. this.controls = null,
  3020. this.updateAspect(e)
  3021. }
  3022. var r = e("three")
  3023. , o = e("../constants");
  3024. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3025. n.prototype.updateAspect = function(e) {
  3026. this.aspect = e,
  3027. this.top = o.orthoBase / e,
  3028. this.bottom = -o.orthoBase / e,
  3029. this.updateProjectionMatrix()
  3030. }
  3031. ,
  3032. t.exports = n
  3033. }
  3034. , {
  3035. "../constants": 8,
  3036. three: 217
  3037. }],
  3038. 7: [function(e, t, i) {
  3039. "use strict";
  3040. function n() {
  3041. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3042. this.controls = null
  3043. }
  3044. var r = e("three")
  3045. , o = e("../settings")
  3046. , a = e("../util/cameraLight");
  3047. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3048. n.prototype.updateAspect = function(e) {
  3049. this.aspect = e,
  3050. this.updateProjectionMatrix()
  3051. }
  3052. ,
  3053. t.exports = n
  3054. }
  3055. , {
  3056. "../settings": 166,
  3057. "../util/cameraLight": 184,
  3058. three: 217
  3059. }],
  3060. 8: [function(e, t, i) {
  3061. "use strict";
  3062. t.exports = {
  3063. signedUrlDefaultExpireTime: 24e4,
  3064. signedUrlCheckInterval: 1e4,
  3065. signedUrlRefreshBuffer: 15e3,
  3066. dollhouseFOV: 70,
  3067. dollhouseNear: 1,
  3068. dollhouseFar: 5e3,
  3069. insideFOV: 70,
  3070. insideFOVMax: 120,
  3071. insideNear: .1,
  3072. insideFar: 5e3,
  3073. insideLookSpeed: .12,
  3074. insideLookLimitUp: 40,
  3075. insideLookLimitDown: -40,
  3076. orthoNear: 1,
  3077. orthoFar: 5e3,
  3078. orthoBase: 10,
  3079. narrowLandscapeHeight: 290,
  3080. reallyNarrowLandscapeHeight: 250,
  3081. visionTilingStartDate: new Date("8/26/2016"),
  3082. visionTilingStartVersion: "1.1.407.13667",
  3083. windowHeightHighQualityThreshold: 900,
  3084. tourStepDelayDefault: 3500,
  3085. tourStepDelaySlideShow: 5e3,
  3086. workshopApsect: 9 / 16,
  3087. highQualityMaxZoom: 2,
  3088. ultraHighQualityMaxZoom: 3
  3089. }
  3090. }
  3091. , {}],
  3092. 9: [function(e, t, i) {
  3093. "use strict";
  3094. function n() {
  3095. this.activeControl = null,
  3096. this.controls = {},
  3097. this.cameras = {}
  3098. }
  3099. var r = e("./PanoramaControls")
  3100. , o = e("./DollhouseControls")
  3101. , a = e("./FloorplanControls")
  3102. , s = e("../cameras/PanoramaCamera")
  3103. , l = e("../cameras/DollhouseCamera")
  3104. , c = e("../cameras/FloorplanCamera")
  3105. , h = e("events").EventEmitter
  3106. , u = e("../enum/ControlEvents")
  3107. , d = e("../enum/ModelManagerEvents")
  3108. , p = e("../enum/Viewmode")
  3109. , f = e("../settings");
  3110. n.prototype = Object.create(h.prototype),
  3111. n.prototype.init = function(e, t) {
  3112. this.setUpControls(),
  3113. this.bindEvents(e, t)
  3114. }
  3115. ,
  3116. n.prototype.activateControls = function(e) {
  3117. this.activeControl && (this.activeControl.reset(),
  3118. this.activeControl.enabled = !1),
  3119. this.controls[e] && (this.controls[e].enabled = !0),
  3120. this.activeControl = this.controls[e]
  3121. }
  3122. ,
  3123. n.prototype.setUpControls = function() {
  3124. var e = {}
  3125. , t = {}
  3126. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3127. , n = [s, l, c]
  3128. , h = [r, o, a];
  3129. i.forEach(function(i, r) {
  3130. e[i] = new n[r],
  3131. t[i] = new h[r](e[i]),
  3132. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3133. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3134. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3135. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3136. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3137. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3138. }
  3139. .bind(this)),
  3140. this.controls = t,
  3141. this.cameras = e
  3142. }
  3143. ,
  3144. n.prototype.bindEvents = function(e, t) {
  3145. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3146. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3147. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3148. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3149. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3150. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3151. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3152. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3153. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3154. e.addEventListener("contextmenu", function(e) {
  3155. e.preventDefault()
  3156. }),
  3157. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3158. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3159. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3160. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3161. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3162. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3163. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3164. t.on(d.ActiveModelChanged, function(e) {
  3165. this.setModelForControls(e.model)
  3166. }
  3167. .bind(this))
  3168. }
  3169. ,
  3170. n.prototype.setModelForControls = function(e) {
  3171. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3172. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3173. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3174. this.controls[e].setBounds(t)
  3175. }
  3176. .bind(this))
  3177. }
  3178. ,
  3179. n.prototype.onMouseDown = function(e) {
  3180. e.preventDefault(),
  3181. this.activeControl && this.activeControl.onMouseDown(e)
  3182. }
  3183. ,
  3184. n.prototype.onMouseMove = function(e) {
  3185. e.preventDefault(),
  3186. this.activeControl && this.activeControl.onMouseMove(e)
  3187. }
  3188. ,
  3189. n.prototype.onMouseUp = function(e) {
  3190. e.preventDefault(),
  3191. this.activeControl && this.activeControl.onMouseUp(e)
  3192. }
  3193. ,
  3194. n.prototype.onMouseOver = function(e) {
  3195. e.preventDefault(),
  3196. this.activeControl && this.activeControl.onMouseOver(e)
  3197. }
  3198. ,
  3199. n.prototype.onMouseWheel = function(e) {
  3200. e.preventDefault(),
  3201. this.activeControl && this.activeControl.onMouseWheel(e)
  3202. }
  3203. ,
  3204. n.prototype.onTouchStart = function(e) {
  3205. e.preventDefault(),
  3206. this.activeControl && this.activeControl.onTouchStart(e);
  3207. var hotList = $('#hotListWrap')[0];
  3208. hotList.classList.remove('hotListActive');
  3209. $('#hotListContent ul .active').removeClass('active');
  3210. $('#hotList')[0].classList.remove('active')
  3211. }
  3212. ,
  3213. n.prototype.onTouchMove = function(e) {
  3214. e.preventDefault(),
  3215. this.activeControl && this.activeControl.onTouchMove(e)
  3216. }
  3217. ,
  3218. n.prototype.onTouchEnd = function(e) {
  3219. e.preventDefault(),
  3220. this.activeControl && this.activeControl.onTouchEnd(e)
  3221. }
  3222. ,
  3223. n.prototype.onPointerDown = function(e) {
  3224. if (e.preventDefault(),
  3225. this.activeControl)
  3226. switch (e.pointerType) {
  3227. case "mouse":
  3228. this.activeControl.onMouseDown(e);
  3229. break;
  3230. default:
  3231. this.activeControl.onPointerDown(e)
  3232. }
  3233. }
  3234. ,
  3235. n.prototype.onPointerMove = function(e) {
  3236. if (e.preventDefault(),
  3237. this.activeControl)
  3238. switch (e.pointerType) {
  3239. case "mouse":
  3240. this.activeControl.onMouseMove(e);
  3241. break;
  3242. default:
  3243. this.activeControl.onPointerMove(e)
  3244. }
  3245. }
  3246. ,
  3247. n.prototype.onPointerUp = function(e) {
  3248. if (e.preventDefault(),
  3249. this.activeControl)
  3250. switch (e.pointerType) {
  3251. case "mouse":
  3252. this.activeControl.onMouseUp(e);
  3253. break;
  3254. default:
  3255. this.activeControl.onPointerUp(e)
  3256. }
  3257. }
  3258. ,
  3259. n.prototype.onPointerCancel = function(e) {
  3260. e.preventDefault(),
  3261. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3262. }
  3263. ,
  3264. n.prototype.onKeyDown = function(e) {
  3265. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3266. this.activeControl && this.activeControl.onKeyDown(e))
  3267. }
  3268. ,
  3269. n.prototype.onKeyUp = function(e) {
  3270. e.preventDefault(),
  3271. this.activeControl && this.activeControl.onKeyUp(e)
  3272. }
  3273. ,
  3274. t.exports = n
  3275. }
  3276. , {
  3277. "../cameras/DollhouseCamera": 5,
  3278. "../cameras/FloorplanCamera": 6,
  3279. "../cameras/PanoramaCamera": 7,
  3280. "../enum/ControlEvents": 21,
  3281. "../enum/ModelManagerEvents": 33,
  3282. "../enum/Viewmode": 51,
  3283. "../settings": 166,
  3284. "./DollhouseControls": 10,
  3285. "./FloorplanControls": 11,
  3286. "./PanoramaControls": 13,
  3287. events: 202
  3288. }],
  3289. 10: [function(e, t, i) {
  3290. "use strict";
  3291. function n(e) {
  3292. a.call(this, e),
  3293. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3294. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3295. this.minDistance = o.dollhouseDefault.minDistance,
  3296. this.maxDistance = o.dollhouseDefault.maxDistance,
  3297. this.adjustedMinDistance = this.minDistance,
  3298. this.adjustedMaxDistance = this.maxDistance
  3299. }
  3300. var r = e("three")
  3301. , o = e("../settings")
  3302. , a = e("./OutsideControls");
  3303. n.prototype = Object.create(a.prototype),
  3304. n.prototype.pan = function(e, t) {
  3305. this.camera.updateMatrix();
  3306. var i = this.camera.position.clone().sub(this.target).length();
  3307. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3308. this.panLeft(2 * e * i / $("#player").height()),
  3309. this.panUp(-2 * t * i / $("#player").height())
  3310. }
  3311. ,
  3312. n.prototype.updateZoom = function() {
  3313. var e = this.offset.length();
  3314. return e * this.scale
  3315. }
  3316. ,
  3317. n.prototype.setZoomBounds = function(e) {
  3318. var t = e.min.distanceTo(e.max);
  3319. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3320. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3321. this.minDistance = this.adjustedMinDistance,
  3322. this.maxDistance = this.adjustedMaxDistance
  3323. }
  3324. ,
  3325. n.prototype.resetRanges = function(e, t) {
  3326. e ? (this.minDistance = Math.min(e, this.minDistance),
  3327. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3328. this.maxDistance = this.adjustedMaxDistance),
  3329. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3330. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3331. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3332. }
  3333. ,
  3334. n.prototype.toJSON = function() {
  3335. return a.prototype.toJSON.call(this)
  3336. }
  3337. ,
  3338. t.exports = n
  3339. }
  3340. , {
  3341. "../settings": 166,
  3342. "./OutsideControls": 12,
  3343. three: 217
  3344. }],
  3345. 11: [function(e, t, i) {
  3346. "use strict";
  3347. function n(e) {
  3348. a.call(this, e),
  3349. this.minDistance = 15,
  3350. this.maxDistance = 50,
  3351. this.noRotateUpDown = !0,
  3352. this.minPolarAngle = 0,
  3353. this.maxPolarAngle = 0,
  3354. this.mouseActions[l.LEFT] = s.PAN,
  3355. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3356. this.mouseActions[l.RIGHT] = s.ROTATE,
  3357. this.touchActions[1] = s.PAN,
  3358. this.touchActions[2] = s.ROTATE_DOLLY,
  3359. this.absoluteScale = 1,
  3360. this.currentScale = 1
  3361. }
  3362. var r = e("three")
  3363. , o = e("../settings")
  3364. , a = e("./OutsideControls")
  3365. , s = e("../enum/ControlActions")
  3366. , l = e("../enum/MouseButton")
  3367. , c = e("../util/math")
  3368. , h = e("../util/browser");
  3369. n.prototype = Object.create(a.prototype),
  3370. n.prototype.zoomToContain = function(e) {
  3371. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3372. this.currentScale = this.absoluteScale
  3373. }
  3374. ,
  3375. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3376. var t = Math.max(modelSize.x, modelSize.z)
  3377. , i = Math.min(modelSize.x, modelSize.z)
  3378. , n = Math.max(t, i * this.camera.aspect)
  3379. , r = Math.max(i, t * this.camera.aspect);
  3380. var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
  3381. return absoluteScale
  3382. },
  3383. n.prototype.rotateToView = function(modelSize, direction) {
  3384. let i = 0, n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3385. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3386. i = parseFloat(_settings.floorPlanAngle)
  3387. }else{
  3388. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3389. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3390. {
  3391. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3392. {
  3393. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3394. }
  3395. //(第二种情况) 不做处理
  3396. }
  3397. else if(direction.x > 0)
  3398. {
  3399. i = Math.PI / 2;
  3400. }
  3401. else
  3402. {
  3403. i = -Math.PI / 2;
  3404. }
  3405. }
  3406. this.rotateLeft(i);
  3407. this.update(0);
  3408. }
  3409. ,
  3410. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3411. this.rotateLeft(angle + this.lon);
  3412. this.update(0);
  3413. }
  3414. ,
  3415. n.prototype.pan = function(e, t) {
  3416. this.camera.updateMatrix(),
  3417. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3418. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3419. }
  3420. ,
  3421. n.prototype.updateZoom = function() {
  3422. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3423. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3424. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3425. this.camera.left = -o.orthoBase * this.currentScale,
  3426. this.camera.right = o.orthoBase * this.currentScale,
  3427. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3428. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3429. this.camera.updateProjectionMatrix(),
  3430. this.offset.length()
  3431. }
  3432. ,
  3433. n.prototype.toJSON = function() {
  3434. var e = new r.Quaternion
  3435. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3436. , i = new r.Quaternion;
  3437. return function() {
  3438. var n = a.prototype.toJSON.call(this);
  3439. return e.copy(n.camera_quaternion),
  3440. i.copy(t),
  3441. i.multiply(e),
  3442. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3443. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3444. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3445. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3446. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3447. n
  3448. }
  3449. }(),
  3450. t.exports = n
  3451. }
  3452. , {
  3453. "../enum/ControlActions": 20,
  3454. "../enum/MouseButton": 34,
  3455. "../settings": 166,
  3456. "../util/browser": 182,
  3457. "../util/math": 190,
  3458. "./OutsideControls": 12,
  3459. three: 217
  3460. }],
  3461. 12: [function(e, t, i) {
  3462. "use strict";
  3463. function n(e) {
  3464. this.camera = e,
  3465. this.camera.controls = this,
  3466. this.enabled = !1,
  3467. this.target = new r.Vector3,
  3468. this.targetBounds = new r.Box3,
  3469. this.zoomSpeed = 1,
  3470. this.minDistance = 0,
  3471. this.maxDistance = 1 / 0,
  3472. this.noRotateUpDown = !1,
  3473. this.rotateSpeed = 1,
  3474. this.keyboardZoomSpeed = 0,
  3475. this.keyPanSpeed = 7,
  3476. this.autoRotate = !1,
  3477. this.autoRotateSpeed = 2,
  3478. this.autoPan = !1,
  3479. this.autoPanPosition = new r.Vector3,
  3480. this.minPolarAngle = r.Math.degToRad(25),
  3481. this.maxPolarAngle = r.Math.degToRad(65),
  3482. this.rotationAcceleration = new r.Vector2,
  3483. this.rotationSpeed = new r.Vector2,
  3484. this.panAcceleration = new r.Vector2,
  3485. this.panSpeed = new r.Vector2,
  3486. this.rotateStart = new r.Vector2,
  3487. this.rotateEnd = new r.Vector2,
  3488. this.rotateDelta = new r.Vector2,
  3489. this.panStart = new r.Vector2,
  3490. this.panEnd = new r.Vector2,
  3491. this.panDelta = new r.Vector2,
  3492. this.panOffset = new r.Vector3,
  3493. this.offset = new r.Vector3,
  3494. this.dollyStart = new r.Vector2,
  3495. this.dollyEnd = new r.Vector2,
  3496. this.dollyDelta = new r.Vector2,
  3497. this.phiDelta = 0,
  3498. this.thetaDelta = 0,
  3499. this.scale = 1,
  3500. this.panVector = new r.Vector3,
  3501. this.lastPosition = new r.Vector3,
  3502. this.state = c.NONE,
  3503. this.mouseActions = {},
  3504. this.mouseActions[h.LEFT] = c.ROTATE,
  3505. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3506. this.mouseActions[h.RIGHT] = c.PAN,
  3507. this.touchActions = {},
  3508. this.touchActions[1] = c.ROTATE,
  3509. this.touchActions[2] = c.PAN_DOLLY,
  3510. this.lastMoveTime = 0,
  3511. this.pointersLimit = 2,
  3512. this.pointers = []
  3513. }
  3514. var r = e("three")
  3515. , o = e("../settings")
  3516. , a = e("../util/common")
  3517. , s = e("../util/math")
  3518. , l = e("../enum/Vectors")
  3519. , c = e("../enum/ControlActions")
  3520. , h = e("../enum/MouseButton")
  3521. , u = e("../enum/Keys")
  3522. , d = e("../enum/ControlEvents")
  3523. , p = e("events").EventEmitter
  3524. , f = 1e-6;
  3525. n.prototype = Object.create(p.prototype),
  3526. n.prototype.setBounds = function(e) {
  3527. this.targetBounds = e
  3528. }
  3529. ,
  3530. n.prototype.isEngaged = function() {
  3531. return this.state !== c.NONE
  3532. }
  3533. ,
  3534. n.prototype.rotateLeft = function(e) {
  3535. void 0 === e && (e = this.getAutoRotationAngle()),
  3536. this.thetaDelta -= e
  3537. }
  3538. ,
  3539. n.prototype.rotateUp = function(e) {
  3540. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3541. this.phiDelta -= e)
  3542. }
  3543. ,
  3544. n.prototype.panLeft = function(e) {
  3545. var t = this.camera.matrix.elements;
  3546. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3547. this.panOffset.multiplyScalar(-e),
  3548. this.panVector.add(this.panOffset)
  3549. }
  3550. ,
  3551. n.prototype.panUp = function(e) {
  3552. var t = this.camera.matrix.elements;
  3553. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3554. this.panOffset.multiplyScalar(-e),
  3555. this.panVector.add(this.panOffset)
  3556. }
  3557. ,
  3558. n.prototype.startRotating = function(e, t) {
  3559. e && this.navRotationAcc("x", e),
  3560. t && this.navRotationAcc("y", t)
  3561. }
  3562. ,
  3563. n.prototype.stopRotating = function(e) {
  3564. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3565. this.navRotationAcc("x", 0),
  3566. this.navRotationAcc("y", 0)
  3567. }
  3568. ,
  3569. n.prototype.setAutoPanPosition = function(e, t) {
  3570. var i = new r.Vector3
  3571. , n = new r.Vector3;
  3572. return function(e, t) {
  3573. i.copy(this.camera.position),
  3574. void 0 === e && null === e || i.setX(e),
  3575. void 0 === t && null === t || i.setZ(t);
  3576. var r = this.camera.position.distanceTo(this.target)
  3577. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3578. this.targetClamped = !1,
  3579. n.copy(i).addScaledVector(o, r),
  3580. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3581. i.copy(n).addScaledVector(o, -r),
  3582. this.targetClamped = !0),
  3583. this.autoPanPosition.x = i.x,
  3584. this.autoPanPosition.z = i.z,
  3585. this.autoPan && this.stopAutoPanning()
  3586. }
  3587. }(),
  3588. n.prototype.stopAutoPanning = function() {
  3589. var e = this.autoPan;
  3590. this.autoPan = !1,
  3591. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3592. }
  3593. ,
  3594. n.prototype.dollyIn = function(e) {
  3595. void 0 === e && (e = this.getZoomScale()),
  3596. this.scale /= e
  3597. }
  3598. ,
  3599. n.prototype.dollyOut = function(e) {
  3600. void 0 === e && (e = this.getZoomScale()),
  3601. this.scale *= e
  3602. }
  3603. ,
  3604. n.prototype.updatePan = function(e) {
  3605. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3606. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3607. this.autoPan) {
  3608. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3609. t.setY(0).clampLength(0, 50 * e),
  3610. this.target.add(t),
  3611. this.camera.position.add(t),
  3612. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3613. this.stopAutoPanning())
  3614. }
  3615. }
  3616. ,
  3617. n.prototype.update = function(e) {
  3618. e || (e = 1 / 60),
  3619. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3620. this.rotateLeft(-this.rotationSpeed.x),
  3621. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3622. this.updatePan(e);
  3623. var t = this.camera.position;
  3624. this.offset.copy(t).sub(this.target);
  3625. var i = Math.atan2(this.offset.x, this.offset.z)
  3626. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3627. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3628. i += this.thetaDelta,
  3629. n += this.phiDelta,
  3630. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3631. n = Math.max(f, Math.min(Math.PI - f, n));
  3632. var r = this.updateZoom();
  3633. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3634. this.target.add(this.panVector),
  3635. this.targetBounds.clampPoint(this.target, this.target),
  3636. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3637. this.offset.y = r * Math.cos(n),
  3638. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3639. t.copy(this.target).add(this.offset),
  3640. this.camera.lookAt(this.target),
  3641. this.thetaDelta = 0,
  3642. this.phiDelta = 0,
  3643. this.scale = 1,
  3644. this.panVector.set(0, 0, 0),
  3645. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3646. }
  3647. ,
  3648. n.prototype.getAutoRotationAngle = function() {
  3649. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3650. }
  3651. ,
  3652. n.prototype.getZoomScale = function() {
  3653. return Math.pow(.95, this.zoomSpeed)
  3654. }
  3655. ,
  3656. n.prototype.onMouseDown = function(e) {
  3657. if (this.enabled) {
  3658. switch (e.preventDefault(),
  3659. this.stopAutoPanning(),
  3660. this.mouseDown = !0,
  3661. this.state = this.mouseActions[e.button],
  3662. this.state) {
  3663. case c.ROTATE:
  3664. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3665. this.rotationSpeed.set(0, 0);
  3666. break;
  3667. case c.DOLLY:
  3668. this.dollyStart.set(e.clientX, e.clientY);
  3669. break;
  3670. case c.PAN:
  3671. this.panStart.set(e.clientX, e.clientY)
  3672. }
  3673. this.emit(d.InputStart, "mouse")
  3674. }
  3675. }
  3676. ,
  3677. n.prototype.onMouseMove = function(e) {
  3678. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3679. switch (e.preventDefault(),
  3680. this.state) {
  3681. case c.ROTATE:
  3682. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3683. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3684. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3685. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3686. this.rotateStart.copy(this.rotateEnd);
  3687. break;
  3688. case c.DOLLY:
  3689. this.dollyEnd.set(e.clientX, e.clientY),
  3690. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3691. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3692. t.call(this),
  3693. this.dollyStart.copy(this.dollyEnd);
  3694. break;
  3695. case c.PAN:
  3696. this.panEnd.set(e.clientX, e.clientY),
  3697. this.panDelta.subVectors(this.panEnd, this.panStart),
  3698. this.pan(this.panDelta.x, this.panDelta.y),
  3699. this.panStart.copy(this.panEnd)
  3700. }
  3701. this.emit(d.Move, "mouse"),
  3702. this.lastMoveTime = e.timeStamp,
  3703. this.update()
  3704. }
  3705. }
  3706. ,
  3707. n.prototype.onMouseUp = function(e) {
  3708. this.enabled && (this.mouseDown = !1,
  3709. this.state = c.NONE,
  3710. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3711. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3712. this.update(),
  3713. this.rotationAcceleration.set(0, 0),
  3714. this.rotateDelta.set(0, 0)))
  3715. }
  3716. ,
  3717. n.prototype.onMouseOver = function(e) {
  3718. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3719. }
  3720. ,
  3721. n.prototype.onMouseWheel = function(e) {
  3722. if (this.enabled && o.useWheel) {
  3723. this.emit(d.Move, "wheel");
  3724. var t = e.wheelDelta || -e.detail
  3725. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3726. i.call(this),
  3727. this.update()
  3728. }
  3729. }
  3730. ,
  3731. n.prototype.onKeyDown = function(e) {
  3732. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3733. this.handleKeyDown(e.which)))
  3734. }
  3735. ,
  3736. n.prototype.navRotationAcc = function(e, t) {
  3737. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3738. }
  3739. ,
  3740. n.prototype.navPanAcc = function(e, t) {
  3741. this.stopAutoPanning(),
  3742. this.panAcceleration[e] = t
  3743. }
  3744. ,
  3745. n.prototype.handleKeyDown = function(e) {
  3746. var t = !0;
  3747. switch (e) {
  3748. case u.UPARROW:
  3749. case u.I:
  3750. this.navRotationAcc("y", 1);
  3751. break;
  3752. case u.DOWNARROW:
  3753. case u.K:
  3754. this.navRotationAcc("y", -1);
  3755. break;
  3756. case u.LEFTARROW:
  3757. case u.J:
  3758. this.navRotationAcc("x", -1);
  3759. break;
  3760. case u.RIGHTARROW:
  3761. case u.L:
  3762. this.navRotationAcc("x", 1);
  3763. break;
  3764. case u.W:
  3765. this.navPanAcc("y", 1);
  3766. break;
  3767. case u.S:
  3768. this.navPanAcc("y", -1);
  3769. break;
  3770. case u.A:
  3771. this.navPanAcc("x", -1);
  3772. break;
  3773. case u.D:
  3774. this.navPanAcc("x", 1);
  3775. break;
  3776. default:
  3777. t = !1
  3778. }
  3779. t && this.emit(d.Move, "key")
  3780. }
  3781. ,
  3782. n.prototype.onKeyUp = function(e) {
  3783. this.enabled && (e.preventDefault(),
  3784. e.stopPropagation(),
  3785. this.handleKeyUp(e.which))
  3786. }
  3787. ,
  3788. n.prototype.handleKeyUp = function(e) {
  3789. switch (e) {
  3790. case u.I:
  3791. case u.K:
  3792. case u.UPARROW:
  3793. case u.DOWNARROW:
  3794. this.keyboardZoomSpeed = 0,
  3795. this.rotationAcceleration.y = 0;
  3796. break;
  3797. case u.J:
  3798. case u.L:
  3799. case u.LEFTARROW:
  3800. case u.RIGHTARROW:
  3801. this.rotationAcceleration.x = 0;
  3802. break;
  3803. case u.S:
  3804. case u.W:
  3805. this.panAcceleration.y = 0;
  3806. break;
  3807. case u.A:
  3808. case u.D:
  3809. this.panAcceleration.x = 0
  3810. }
  3811. }
  3812. ,
  3813. n.prototype.onTouchStart = function(e) {
  3814. if (this.enabled || this.state === c.NONE) {
  3815. e.preventDefault(),
  3816. e.stopPropagation(),
  3817. this.stopAutoPanning();
  3818. var t = function() {
  3819. if (2 === e.touches.length) {
  3820. var t = e.touches[0].pageX - e.touches[1].pageX
  3821. , i = e.touches[0].pageY - e.touches[1].pageY;
  3822. this.dollyStart.set(t, i)
  3823. }
  3824. }
  3825. .bind(this)
  3826. , i = function() {
  3827. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3828. }
  3829. .bind(this)
  3830. , n = function() {
  3831. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3832. }
  3833. .bind(this);
  3834. switch (this.state = this.touchActions[e.touches.length],
  3835. this.state) {
  3836. case c.PAN_DOLLY:
  3837. t();
  3838. case c.PAN:
  3839. i();
  3840. break;
  3841. case c.ROTATE_DOLLY:
  3842. t();
  3843. case c.ROTATE:
  3844. n()
  3845. }
  3846. this.rotationSpeed.set(0, 0),
  3847. this.emit(d.InputStart, "touch")
  3848. }
  3849. }
  3850. ,
  3851. n.prototype.onTouchMove = function(e) {
  3852. if (this.enabled && this.state !== c.NONE) {
  3853. e.preventDefault(),
  3854. e.stopPropagation();
  3855. var t = function() {
  3856. var t = e.touches[0].pageX - e.touches[1].pageX
  3857. , i = e.touches[0].pageY - e.touches[1].pageY;
  3858. this.dollyEnd.set(t, i);
  3859. var n = this.dollyStart.length() - this.dollyEnd.length();
  3860. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3861. this.dollyStart.copy(this.dollyEnd)
  3862. }
  3863. .bind(this)
  3864. , i = function() {
  3865. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3866. this.panDelta.subVectors(this.panEnd, this.panStart),
  3867. this.pan(this.panDelta.x, this.panDelta.y),
  3868. this.panStart.copy(this.panEnd),
  3869. this.rotateDelta.set(0, 0)
  3870. }
  3871. .bind(this)
  3872. , n = function() {
  3873. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3874. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3875. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3876. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3877. this.rotateStart.copy(this.rotateEnd)
  3878. }
  3879. .bind(this)
  3880. , r = function() {
  3881. if (2 === e.touches.length) {
  3882. var i = window.devicePixelRatio || 1
  3883. , r = e.touches[1].pageX - e.touches[0].pageX
  3884. , s = e.touches[1].pageY - e.touches[0].pageY
  3885. , l = Math.sqrt(r * r + s * s)
  3886. , h = Math.abs(this.dollyStart.length() - l);
  3887. if (h > o.input.touchMoveThreshold * i)
  3888. this.state = c.DOLLY,
  3889. t();
  3890. else {
  3891. var u = a.average(e.touches, "pageX")
  3892. , d = a.average(e.touches, "pageY")
  3893. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3894. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3895. this.rotateStart.set(u, d),
  3896. n())
  3897. }
  3898. }
  3899. }
  3900. .bind(this);
  3901. switch (this.state) {
  3902. case c.PAN_DOLLY:
  3903. t();
  3904. case c.PAN:
  3905. i();
  3906. break;
  3907. case c.ROTATE_DOLLY:
  3908. r();
  3909. break;
  3910. case c.DOLLY:
  3911. t();
  3912. break;
  3913. case c.ROTATE:
  3914. n();
  3915. break;
  3916. default:
  3917. this.state = c.NONE
  3918. }
  3919. this.lastMoveTime = e.timeStamp,
  3920. this.emit(d.Move, "touch")
  3921. }
  3922. }
  3923. ,
  3924. n.prototype.onTouchEnd = function(e) {
  3925. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3926. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3927. this.state = c.NONE,
  3928. this.update(),
  3929. this.rotationAcceleration.set(0, 0),
  3930. this.rotateDelta.set(0, 0))
  3931. }
  3932. ,
  3933. n.prototype.onPointerDown = function(e) {
  3934. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3935. id: e.pointerId,
  3936. pageX: e.pageX,
  3937. pageY: e.pageY
  3938. }),
  3939. e.touches = this.pointers,
  3940. this.onTouchStart(e)),
  3941. this.emit(d.InputStart, "pointer"))
  3942. }
  3943. ,
  3944. n.prototype.onPointerMove = function(e) {
  3945. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3946. e.pointerId === t.id && (t.pageX = e.pageX,
  3947. t.pageY = e.pageY)
  3948. }),
  3949. e.touches = this.pointers,
  3950. this.onTouchMove(e))
  3951. }
  3952. ,
  3953. n.prototype.onPointerUp = function(e) {
  3954. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3955. e.pointerId === t.id && this.pointers.splice(i, 1)
  3956. }
  3957. .bind(this)),
  3958. e.touches = this.pointers,
  3959. this.onTouchEnd(e))
  3960. }
  3961. ,
  3962. n.prototype.reset = function() {
  3963. this.state = c.NONE,
  3964. this.stopAutoPanning(),
  3965. this.rotationSpeed.set(0, 0),
  3966. this.rotationAcceleration.set(0, 0),
  3967. this.panSpeed.set(0, 0),
  3968. this.panAcceleration.set(0, 0)
  3969. }
  3970. ,
  3971. n.prototype.toJSON = function() {
  3972. var e = {
  3973. camera_position: {
  3974. x: s.toPrecision(this.camera.position.x, 4),
  3975. y: s.toPrecision(this.camera.position.y, 4),
  3976. z: s.toPrecision(this.camera.position.z, 4)
  3977. },
  3978. camera_quaternion: {
  3979. x: s.toPrecision(this.camera.quaternion.x, 4),
  3980. y: s.toPrecision(this.camera.quaternion.y, 4),
  3981. z: s.toPrecision(this.camera.quaternion.z, 4),
  3982. w: s.toPrecision(this.camera.quaternion.w, 4)
  3983. }
  3984. };
  3985. return e
  3986. }
  3987. ,
  3988. t.exports = n
  3989. }
  3990. , {
  3991. "../enum/ControlActions": 20,
  3992. "../enum/ControlEvents": 21,
  3993. "../enum/Keys": 30,
  3994. "../enum/MouseButton": 34,
  3995. "../enum/Vectors": 50,
  3996. "../settings": 166,
  3997. "../util/common": 185,
  3998. "../util/math": 190,
  3999. events: 202,
  4000. three: 217
  4001. }],
  4002. 13: [function(e, t, i) {
  4003. (function(i) {
  4004. "use strict";
  4005. function n(e) {
  4006. this.camera = e,
  4007. this.camera.controls = this,
  4008. this.target = new r.Vector3(0,0,0),
  4009. this.lookVector = new r.Vector3,
  4010. this.lookSpeed = .05,
  4011. this.rotationAcc = new r.Vector2,
  4012. this.rotationSpeed = new r.Vector2,
  4013. this.lat = 0,
  4014. this.lon = 0,
  4015. this.phi = 0,
  4016. this.theta = 0,
  4017. this.enabled = !1,
  4018. this.locked = !1,
  4019. this.pointer = new r.Vector2(0,0),
  4020. this.rotationHistory = [],
  4021. this.rotationDifference = new r.Vector2,
  4022. this.pointerDragOn = !1,
  4023. this.pointerDragStart = new r.Vector2(0,0),
  4024. this.pinchDistance = 0,
  4025. this.moveStart = new r.Vector2,
  4026. this.moveTolerance = .01,
  4027. this.pointersLimit = 2,
  4028. this.pointers = []
  4029. }
  4030. var r = e("three")
  4031. , o = e("../util/logger")
  4032. , a = e("../settings")
  4033. , s = e("../util/common")
  4034. , l = e("../util/math")
  4035. , c = (e("../enum/Vectors"),
  4036. e("../enum/MouseButton"))
  4037. , h = e("../enum/Keys")
  4038. , u = e("../enum/ControlEvents")
  4039. , d = e("events").EventEmitter;
  4040. new o(i);
  4041. n.prototype = Object.create(d.prototype),
  4042. n.prototype.usable = function() {
  4043. return this.enabled && !this.locked
  4044. }
  4045. ,
  4046. /* n.prototype.lookAt = function(e) {
  4047. var t = this.camera.position.clone().sub(e)
  4048. , i = Math.atan(t.z / t.x);
  4049. i += t.x < 0 ? Math.PI : 0,
  4050. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4051. this.lon = r.Math.radToDeg(i) + 180;
  4052. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4053. , o = Math.atan(t.y / n);
  4054. this.lat = -r.Math.radToDeg(o)
  4055. }
  4056. */
  4057. n.prototype.lookAt = function(aim, dir) {
  4058. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4059. var i = Math.atan(t.z / t.x);
  4060. i += t.x < 0 ? Math.PI : 0;
  4061. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4062. this.lon = r.Math.radToDeg(i) + 180;
  4063. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4064. o = Math.atan(t.y / n);
  4065. this.lat = -r.Math.radToDeg(o);
  4066. }
  4067. ,
  4068. n.prototype.startRotationFrom = function(e, t) {
  4069. l.convertScreenPositionToNDC(e, t, this.pointer),
  4070. this.pointerDragOn = !0,
  4071. this.pointerDragStart.copy(this.pointer),
  4072. this.moveStart.copy(this.pointer),
  4073. this.rotationHistory = [],
  4074. this.rotationSpeed.set(0, 0)
  4075. }
  4076. ,
  4077. n.prototype.onMouseOver = function(e) {
  4078. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4079. }
  4080. ,
  4081. n.prototype.onTouchStart = function(e) {
  4082. if (this.usable()) {
  4083. switch (e.preventDefault(),
  4084. e.stopPropagation(),
  4085. e.touches.length) {
  4086. case 1:
  4087. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4088. break;
  4089. case 2:
  4090. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4091. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4092. this.pinchDistance = Math.sqrt(t * t + i * i)
  4093. }
  4094. this.emit(u.InputStart, "touch")
  4095. }
  4096. }
  4097. ,
  4098. n.prototype.onPointerDown = function(e) {
  4099. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4100. id: e.pointerId,
  4101. clientX: e.clientX,
  4102. clientY: e.clientY
  4103. }),
  4104. e.touches = this.pointers,
  4105. this.onTouchStart(e),
  4106. this.emit(u.InputStart, "pointer"))
  4107. }
  4108. ,
  4109. n.prototype.onMouseDown = function(e) {
  4110. if (this.usable()) {
  4111. switch (e.preventDefault(),
  4112. e.stopPropagation(),
  4113. e.button) {
  4114. case c.LEFT:
  4115. this.startRotationFrom(e.clientX, e.clientY)
  4116. }
  4117. SoundManager.pause('tour') // 周恩光 点击场景时停止语音
  4118. this.emit(u.InputStart, "mouse")
  4119. }
  4120. }
  4121. ,
  4122. n.prototype.updateRotation = function() {
  4123. if (this.usable() && this.pointerDragOn) {
  4124. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4125. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4126. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4127. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4128. , o = Math.atan2(e.y, i)
  4129. , a = Math.atan2(t.y, n);
  4130. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4131. e.y = 0,
  4132. t.y = 0;
  4133. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4134. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4135. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4136. this.pointerDragStart.copy(this.pointer)
  4137. }
  4138. }
  4139. ,
  4140. n.prototype.onMouseMove = function(e) {
  4141. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4142. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4143. }
  4144. ,
  4145. n.prototype.onTouchMove = function(e) {
  4146. if (this.usable())
  4147. switch (this.emit(u.Move, "touch"),
  4148. e.touches.length) {
  4149. case 1:
  4150. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4151. break;
  4152. case 2:
  4153. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4154. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4155. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4156. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4157. this.emit(u.Pinch, n),
  4158. this.pinchDistance -= n)
  4159. }
  4160. }
  4161. ,
  4162. n.prototype.onPointerMove = function(e) {
  4163. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4164. e.pointerId === t.id && (t.clientX = e.clientX,
  4165. t.clientY = e.clientY)
  4166. }),
  4167. e.touches = this.pointers,
  4168. this.onTouchMove(e))
  4169. }
  4170. ,
  4171. n.prototype.endRotation = function() {
  4172. this.pointerDragOn = !1;
  4173. var e = s.averageVectors(this.rotationHistory);
  4174. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4175. }
  4176. ,
  4177. n.prototype.onTouchEnd = function(e) {
  4178. this.usable() && (e.preventDefault(),
  4179. e.stopPropagation(),
  4180. this.endRotation())
  4181. }
  4182. ,
  4183. n.prototype.onMouseUp = function(e) {
  4184. this.usable() && (e.preventDefault(),
  4185. e.stopPropagation(),
  4186. this.endRotation())
  4187. }
  4188. ,
  4189. n.prototype.onPointerUp = function(e) {
  4190. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4191. e.pointerId === t.id && this.pointers.splice(i, 1)
  4192. }
  4193. .bind(this)),
  4194. e.touches = this.pointers,
  4195. this.onTouchEnd(e))
  4196. }
  4197. ,
  4198. n.prototype.update = function(e) {
  4199. this.lon,
  4200. this.lat;
  4201. for (this.updateRotation(),
  4202. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4203. this.rotationHistory.shift();
  4204. this.lon += this.rotationDifference.x,
  4205. this.lat += this.rotationDifference.y,
  4206. this.rotationDifference.set(0, 0),
  4207. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4208. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4209. this.lon += this.rotationSpeed.x * e,
  4210. this.lat += this.rotationSpeed.y * e
  4211. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4212. var insideLookLimitDown = a.insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4213. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4214. 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 );
  4215. this.phi = r.Math.degToRad(90 - this.lat),
  4216. this.theta = r.Math.degToRad(this.lon),
  4217. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4218. this.lookVector.y = Math.cos(this.phi),
  4219. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4220. this.target.copy(this.lookVector).add(this.camera.position),
  4221. this.camera.lookAt(this.target)
  4222. }
  4223. ,
  4224. n.prototype.onMouseWheel = function(e) {
  4225. if (this.usable()) {
  4226. var t = e.wheelDelta || -e.detail;
  4227. this.emit(u.InteractionDirect),
  4228. this.emit(u.Scroll, t)
  4229. }
  4230. }
  4231. ,
  4232. n.prototype.onKeyDown = function(e) {
  4233. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4234. this.handleKeyDown(e.which)))
  4235. }
  4236. ,
  4237. n.prototype.handleKeyDown = function(e) {
  4238. var t = function(e, t) {
  4239. this.rotationAcc[e] = t
  4240. }
  4241. .bind(this);
  4242. this.emit(u.InteractionKey);
  4243. var i = !0;
  4244. switch (e) {
  4245. case h.LEFTARROW:
  4246. case h.J:
  4247. t("x", -1);
  4248. break;
  4249. case h.RIGHTARROW:
  4250. case h.L:
  4251. t("x", 1);
  4252. break;
  4253. case h.I:
  4254. t("y", 1);
  4255. break;
  4256. case h.K:
  4257. t("y", -1);
  4258. break;
  4259. default:
  4260. i = !1
  4261. }
  4262. i && this.emit(u.Move, "key")
  4263. }
  4264. ,
  4265. n.prototype.onKeyUp = function(e) {
  4266. this.usable() && (e.preventDefault(),
  4267. e.stopPropagation(),
  4268. this.handleKeyUp(e.which))
  4269. }
  4270. ,
  4271. n.prototype.handleKeyUp = function(e) {
  4272. switch (e) {
  4273. case h.LEFTARROW:
  4274. case h.J:
  4275. case h.RIGHTARROW:
  4276. case h.L:
  4277. this.rotationAcc.x = 0;
  4278. break;
  4279. case h.I:
  4280. case h.K:
  4281. this.rotationAcc.y = 0
  4282. }
  4283. }
  4284. ,
  4285. n.prototype.startRotating = function(e, t) {
  4286. e && (this.rotationAcc.x = e),
  4287. t && (this.rotationAcc.y = t)
  4288. }
  4289. ,
  4290. n.prototype.stopRotating = function(e) {
  4291. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4292. this.rotationAcc.set(0, 0)
  4293. }
  4294. ,
  4295. n.prototype.reset = function() {
  4296. this.pointerDragOn = !1,
  4297. this.rotationAcc.set(0, 0),
  4298. this.rotationSpeed.set(0, 0),
  4299. this.pointers = []
  4300. }
  4301. ,
  4302. n.prototype.toJSON = function() {
  4303. var e = {
  4304. camera_position: {
  4305. x: l.toPrecision(this.camera.position.x, 4),
  4306. y: l.toPrecision(this.camera.position.y, 4),
  4307. z: l.toPrecision(this.camera.position.z, 4)
  4308. },
  4309. camera_quaternion: {
  4310. x: l.toPrecision(this.camera.quaternion.x, 4),
  4311. y: l.toPrecision(this.camera.quaternion.y, 4),
  4312. z: l.toPrecision(this.camera.quaternion.z, 4),
  4313. w: l.toPrecision(this.camera.quaternion.w, 4)
  4314. }
  4315. };
  4316. return e
  4317. }
  4318. ,
  4319. n.prototype.setStateFromJSON = function(e) {
  4320. this.camera.position.copy(e.camera_position),
  4321. this.camera.quaternion.copy(e.camera_quaternion)
  4322. }
  4323. ,
  4324. t.exports = n
  4325. }
  4326. ).call(this, "/js/controls/PanoramaControls.js")
  4327. }
  4328. , {
  4329. "../enum/ControlEvents": 21,
  4330. "../enum/Keys": 30,
  4331. "../enum/MouseButton": 34,
  4332. "../enum/Vectors": 50,
  4333. "../settings": 166,
  4334. "../util/common": 185,
  4335. "../util/logger": 189,
  4336. "../util/math": 190,
  4337. events: 202,
  4338. three: 217
  4339. }],
  4340. 14: [function(e, t, i) {
  4341. (function(i) {
  4342. "use strict";
  4343. var n = e("three")
  4344. , r = e("../enum/Viewmode")
  4345. , o = e("../util/logger")
  4346. , a = new o(i);
  4347. t.exports = {
  4348. serialize: function(e) {
  4349. return encodeURI(JSON.stringify(e))
  4350. },
  4351. deserialize: function(e) {
  4352. function t(e) {
  4353. function t(e, t) {
  4354. return e && "number" == typeof t && !isNaN(t)
  4355. }
  4356. return e.reduce(t, !0)
  4357. }
  4358. try {
  4359. var i = JSON.parse(decodeURI(e))
  4360. , o = {
  4361. mode: r.fromInt(i.camera_mode),
  4362. panoId: i.scan_id,
  4363. position: (new n.Vector3).copy(i.camera_position),
  4364. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4365. zoom: i.ortho_zoom,
  4366. floorVisibility: i.floor_visibility
  4367. }
  4368. , s = o.position;
  4369. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4370. var l = o.quaternion;
  4371. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4372. o
  4373. } catch (i) {
  4374. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4375. try {
  4376. var c = e.split(",")
  4377. , h = {
  4378. x: parseFloat(c[2]),
  4379. y: parseFloat(c[3]),
  4380. z: parseFloat(c[4])
  4381. }
  4382. , u = {
  4383. x: parseFloat(c[5]),
  4384. y: parseFloat(c[6]),
  4385. z: parseFloat(c[7]),
  4386. w: parseFloat(c[8])
  4387. };
  4388. return t([h.x, h.y, h.z]) || (h.x = 0,
  4389. h.y = 0,
  4390. h.z = 0),
  4391. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4392. u.y = 0,
  4393. u.z = 0,
  4394. u.w = 1),
  4395. {
  4396. mode: r.fromInt(c[0]),
  4397. panoId: c[1],
  4398. position: (new n.Vector3).copy(h),
  4399. quaternion: (new n.Quaternion).copy(u)
  4400. }
  4401. } catch (t) {
  4402. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4403. }
  4404. }
  4405. return null
  4406. }
  4407. }
  4408. }
  4409. ).call(this, "/js/controls/serializer.js")
  4410. }
  4411. , {
  4412. "../enum/Viewmode": 51,
  4413. "../util/logger": 189,
  4414. three: 217
  4415. }],
  4416. 15: [function(e, t, i) {
  4417. (function(i) {
  4418. "use strict";
  4419. function n() {
  4420. this.endlessLoop = a.warp.loop,
  4421. this.clock = new r.Clock(!0),
  4422. this.model = null,
  4423. this.player = null,
  4424. this.currentItem = null,
  4425. this.destinationItem = null,
  4426. this.tourIsPlaying = !1,
  4427. this.transitionStage = y.None,
  4428. this.nextFunc = null,
  4429. this.onTheBus = !1,
  4430. this.tourInProgress = !1,
  4431. this.reachSource = null,
  4432. this.interrupted = !1,
  4433. this.nItems = 0,
  4434. this.walkingSectionPaused = !1
  4435. }
  4436. var r = e("three")
  4437. , o = e("./util/logger")
  4438. , a = e("./settings")
  4439. , s = e("./util/transitions")
  4440. , l = e("events").EventEmitter
  4441. , c = e("./enum/Viewmode")
  4442. , h = e("./analytics")
  4443. , u = e("./enum/WarpStyle")
  4444. , s = e("./util/transitions")
  4445. , d = (e("./model/ModelManager"),
  4446. e("./enum/ModelManagerEvents"))
  4447. , p = e("./enum/DirectorEvents")
  4448. , f = e("./enum/PlayerEvents")
  4449. , g = (e("./enum/ControlEvents"),
  4450. e("./enum/BlackoutStyle"))
  4451. , m = e("./enum/PathDiscardMode")
  4452. , v = e("./enum/PathDisplayMode")
  4453. , A = (e("./player"),
  4454. new o(i))
  4455. , y = Object.freeze({
  4456. None: 0,
  4457. Moving: 1,
  4458. Aiming: 2,
  4459. Interlude: 3
  4460. })
  4461. , C = Object.freeze({
  4462. Forward: 1,
  4463. NoChange: 0,
  4464. Backwards: -1
  4465. })
  4466. , I = s.getUniqueId();
  4467. n.prototype = Object.create(l.prototype),
  4468. n.prototype.init = function(e, t) {
  4469. this.player = e,
  4470. this.modelManager = t,
  4471. this.updateModel(),
  4472. this.resetAll(),
  4473. this.bindEvents()
  4474. }
  4475. ,
  4476. n.prototype.resetAll = function() {
  4477. if (this.currentItem = null,
  4478. this.destinationItem = null,
  4479. this.tourIsPlaying = !1,
  4480. //this.bgmReplay(),//xzw
  4481. this.transitionStage = y.None,
  4482. this.nextFunc = null,
  4483. this.onTheBus = !1,
  4484. this.reachSource = null,
  4485. this.interrupted = !1,
  4486. this.model) {
  4487. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4488. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4489. } else
  4490. this.defaultWarpStyle = u.BLACK,
  4491. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4492. this.resetSpecialTransition()
  4493. }
  4494. ,
  4495. n.prototype.updateModel = function() {
  4496. this.model = this.modelManager.getActiveModel(),
  4497. this.nItems = this.model.heroLocations.length
  4498. }
  4499. ,
  4500. n.prototype.bindEvents = function() {
  4501. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4502. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4503. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4504. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4505. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4506. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4507. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4508. this.player.once(f.Move, function() {
  4509. s.cancelById(I)
  4510. })
  4511. }
  4512. ,
  4513. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4514. return /* e === u.WALK && ( */this.interrupt(g.NONE),
  4515. this.pauseWalkingSection(),
  4516. this.player.fastForwardActivePanoFlight(),
  4517. !0/* ) */
  4518. }
  4519. ,
  4520. n.prototype.handlePlayerMove = function(e) {
  4521. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4522. this.emit("update.controls")
  4523. }
  4524. ,
  4525. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4526. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4527. this.emit("update.controls"))
  4528. }
  4529. ,
  4530. n.prototype.handlePlayerModeChanged = function(e, t) {
  4531. this.intermediateState() || e === t || (this.onTheBus = !1,
  4532. this.emit("update.controls"))
  4533. }
  4534. ,
  4535. n.prototype.handlePlayerInputStart = function(e) {
  4536. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4537. }
  4538. ,
  4539. n.prototype.handlePlayerFlyingStarted = function() {
  4540. this.clearWalkingSectionPaused()
  4541. }
  4542. ,
  4543. n.prototype.describe = function() {
  4544. return {
  4545. nItems: this.nItems,
  4546. currentItem: this.currentItem,
  4547. destinationItem: this.destinationItem,
  4548. tourIsPlaying: this.tourIsPlaying,
  4549. onTheBus: this.onTheBus,
  4550. endlessLoop: this.endlessLoop,
  4551. viewMode: this.player.mode,
  4552. inTransition: this._inTransition(),
  4553. transitionStage: this.transitionStage,
  4554. tourInProgress: this.tourInProgress
  4555. }
  4556. }
  4557. ,
  4558. n.prototype._inTransition = function() {
  4559. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4560. }
  4561. ,
  4562. n.prototype.bounceable = function() {
  4563. var e = this.clock.getDelta();
  4564. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4565. }
  4566. ,
  4567. n.prototype.itemCompare = function(item1, item2, type){//add
  4568. if(type == 'equal'){//==
  4569. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4570. }else if(type == 'less'){//<
  4571. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4572. }
  4573. }
  4574. n.prototype.currentMoveDirection = function() {
  4575. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4576. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.itemCompare(this.destinationItem, this.currentItem,'equal') ? y.NoChange : this.itemCompare(this.currentItem, this.destinationItem,'less') ? y.Forward : y.Backwards
  4577. }
  4578. ,
  4579. n.prototype.clearPath = function() {
  4580. this._inTransition() || this.player.path.discardPathObject()
  4581. }
  4582. ,
  4583. n.prototype.allFloors = function() {
  4584. this.model.toggleAllFloors()
  4585. }
  4586. ,
  4587. n.prototype.actionComplete = function(e) {
  4588. if (this.interrupted = !1,
  4589. this.transitionStage = y.None,
  4590. this.resetSpecialTransition(),
  4591. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4592. this.tourIsPlaying || (this.player.disablePreRendering(),
  4593. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4594. this.emit("update.controls"),
  4595. this.nextFunc) {
  4596. var t = this.nextFunc;
  4597. this.nextFunc = null,
  4598. t()
  4599. }
  4600. }
  4601. ,
  4602. n.prototype.awaitCompletion = function(e, t) {
  4603. this.nextFunc = t,
  4604. e()
  4605. }
  4606. ,
  4607. n.prototype.updateSuccessFunction = function(e) {
  4608. this.nextFunc = e
  4609. }
  4610. ,
  4611. n.prototype.interrupt = function(e, t) {
  4612. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4613. this.tourIsPlaying = !1,
  4614. //this.bgmReplay(),//xzw
  4615. this.interrupted = !0,
  4616. this.nextFunc = null,
  4617. this.emit(p.ActionInterrupted),
  4618. null !== e && void 0 !== e || (e = g.BEGINNING),
  4619. this.player.interruptAndFastForward(e, t),
  4620. !0)
  4621. }
  4622. ,
  4623. n.prototype.wouldInterrupt = function() {
  4624. return this.transitionStage !== y.None
  4625. }
  4626. ,
  4627. n.prototype.intermediateState = function() {
  4628. return this.transitionStage !== y.None
  4629. }
  4630. ,
  4631. n.prototype.isInterrupted = function() {
  4632. return this.interrupted
  4633. }
  4634. ,
  4635. n.prototype.pauseWalkingSection = function() {
  4636. this.walkingSectionPaused = !0
  4637. }
  4638. ,
  4639. n.prototype.clearWalkingSectionPaused = function() {
  4640. this.walkingSectionPaused = !1
  4641. }
  4642. ,
  4643. n.prototype.autoTour = function() {
  4644. var e = Date.now();
  4645. this.model.auxDataPromise.then(function() {
  4646. e = Date.now() - e;
  4647. var t = a.warp.auto
  4648. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4649. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4650. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4651. done: function() {
  4652. this.playTour()
  4653. }
  4654. .bind(this),
  4655. name: "_atr",
  4656. id: I
  4657. })
  4658. }
  4659. .bind(this))
  4660. }
  4661. ,
  4662. n.prototype.atDestinationPano = function() {
  4663. if (!this.player.currentPano || null === this.destinationItem)
  4664. return !1;
  4665. var e = this.player.currentPano.id;
  4666. if (void 0 === e)
  4667. return !1;
  4668. var t = this.model.heroLocations;
  4669. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4670. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4671. return destination && destination.panoId == e
  4672. }
  4673. ,
  4674. n.prototype.redirectToItem = function(e, t) {
  4675. if (null === e || void 0 === e)
  4676. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4677. if (!this.wouldInterrupt())
  4678. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4679. if (this.player.mode === c.TRANSITIONING)
  4680. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4681. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4682. var i = function() {
  4683. s.setTimeout(function() {
  4684. this.setDestinationItem(e),
  4685. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4686. }
  4687. .bind(this), 0)
  4688. }
  4689. .bind(this);
  4690. this.interrupt(g.END, 0),
  4691. this.updateSuccessFunction(i)
  4692. }
  4693. ,
  4694. n.prototype.useSpecialTransition = function(e) {
  4695. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4696. this.nextWarpStyle = u.BLACK
  4697. }
  4698. ,
  4699. n.prototype.resetSpecialTransition = function() {
  4700. this.nextWarpStyle = this.defaultWarpStyle
  4701. }
  4702. ,
  4703. n.prototype.arrivedAtDestination = function(e) {
  4704. if (this.player.flying || this.player.isWarping())
  4705. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4706. else {
  4707. this.transitionStage = y.Aiming;
  4708. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4709. this.player.model.fadePanoMarkers(0),
  4710. this.awaitCompletion(function() {
  4711. this.resetSpecialTransition(),
  4712. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4713. }
  4714. .bind(this), t)
  4715. }
  4716. }
  4717. ,
  4718. n.prototype.goToDestination = function(e, t, i, n) {
  4719. //音频
  4720. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4721. if(musicInfo && musicInfo.music){
  4722. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4723. console.log('自动导览有音乐,暂停背景音乐');
  4724. document.querySelector('#openMusic').style.display='block'
  4725. document.querySelector('#closeMusic').style.display='none'
  4726. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4727. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4728. let audioSrc2 = common.getFileNameFromUrl(src)
  4729. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4730. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4731. SoundManager.play('tour',null,0) // currentTime = 0;
  4732. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4733. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4734. }
  4735. }else{//很可能是该folder的起始
  4736. SoundManager.play('tour', manage.dealURL(src))
  4737. }
  4738. }
  4739. if (this.onTheBus = !0,
  4740. this.emit("update.controls"),
  4741. this.player.updateLastView(),
  4742. !n && this.atDestinationPano()){
  4743. /*
  4744. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4745. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4746. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4747. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4748. } */
  4749. return void this.arrivedAtDestination(!0);
  4750. }
  4751. if (this.player.flying || this.player.isWarping())
  4752. A.warn("Cannot go to new destination while player is flying or warping.");
  4753. else {
  4754. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4755. , o = null
  4756. , a1 = null;
  4757. if (r.isPano()) {
  4758. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4759. //var walk = window.DATA.black ? 'black' : 'walk';
  4760. //若是点击item,直接瞬间过渡。
  4761. var s = e ? 'black' : this.getMomentTour(this.destinationItem)
  4762. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4763. o = this.arrivedAtDestination.bind(this, !0)
  4764. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4765. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4766. }
  4767. } else{
  4768. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4769. o = this.arrivedAtDestination.bind(this, !1);
  4770. }
  4771. this.transitionStage = y.Moving,
  4772. this.model.fadePanoMarkers(0),
  4773. this.awaitCompletion(function() {
  4774. a1();
  4775. }
  4776. .bind(this), o),
  4777. this.emit("update.controls")
  4778. }
  4779. }
  4780. ,
  4781. n.prototype.tourInterlude = function() {
  4782. if (h.trackAlways("reach_highlight", {
  4783. reach_source: this.reachSource
  4784. }),
  4785. this.model.fadePanoMarkers(0),
  4786. this.emit("update.controls"),
  4787. this.tourIsPlaying)
  4788. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4789. this.stopTour(true),
  4790. this.emit(p.TourEnd),
  4791. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4792. this.transitionStage = y.Interlude,
  4793. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4794. }
  4795. .bind(this), this.goNext.bind(this))
  4796. }
  4797. ,
  4798. n.prototype.playTour = function() {
  4799. if (!this.bounceable())
  4800. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4801. this.tourInProgress = !0,
  4802. this.reachSource = "play",
  4803. this.tourIsPlaying = !0,
  4804. this.wasZoomEnabled = this.player.zoomEnabled,
  4805. this.player.zoomEnabled = !1,
  4806. this.resetSpecialTransition(),
  4807. this.emit("update.controls"),
  4808. this.emit(p.TourStart),
  4809. this.player.enablePreRendering(),
  4810. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4811. this.goToDestination()) : this.goNext()))
  4812. }
  4813. ,
  4814. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4815. } */
  4816. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4817. SoundManager.pause('tour'), // 周恩光 自动导览暂停时同时停止语音
  4818. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4819. this.tourIsPlaying = !1,
  4820. this.interrupt(),
  4821. this.clearWalkingSectionPaused(),
  4822. this.resetSpecialTransition(),
  4823. this.emit("update.controls"))
  4824. }
  4825. ,
  4826. n.prototype.endTourProgress = function() {
  4827. this.tourInProgress = !1,
  4828. this.emit("update.controls"),
  4829. this.emit(p.TourEnd)
  4830. }
  4831. ,
  4832. n.prototype.goToHighlight = function(e) {
  4833. if (this.wouldInterrupt())
  4834. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4835. else {
  4836. if (A.debug("<tour.goto " + e + ">"),
  4837. this.isInterrupted())
  4838. return;
  4839. this.clearWalkingSectionPaused(),
  4840. this.setDestinationItem(e),
  4841. this.useSpecialTransition("Hilight")
  4842. this.goToDestination(true),//add true
  4843. h.trackAlways("reach_highlight", {
  4844. reach_source: "thumb"
  4845. })
  4846. }
  4847. }
  4848. ,
  4849. n.prototype.prevHighlight = function() {
  4850. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4851. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4852. this.reachSource = "prev",
  4853. this.goPrev()))
  4854. }
  4855. ,
  4856. n.prototype.nextHighlight = function() {
  4857. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4858. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4859. this.reachSource = "next",
  4860. this.goNext()))
  4861. }
  4862. ,
  4863. n.prototype.changeMode = function(e) {
  4864. var t = $.Deferred()
  4865. , i = t.resolve.bind(t)
  4866. , n = t.reject.bind(t);
  4867. this.emit(p.StartModeChange);
  4868. var r = function() {
  4869. return this.clearWalkingSectionPaused(),
  4870. !!this.wouldInterrupt() && (this.interrupt(),
  4871. !0)
  4872. }
  4873. .bind(this);
  4874. if (!r()) {
  4875. switch (e) {
  4876. case c.PANORAMA:
  4877. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4878. break;
  4879. case c.DOLLHOUSE:
  4880. case c.FLOORPLAN:
  4881. this.player.flyToNewMode({
  4882. mode: e
  4883. }).done(i).fail(n);
  4884. break;
  4885. case c.OUTDOOR:
  4886. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4887. }
  4888. return t.promise()
  4889. }
  4890. }
  4891. ,
  4892. n.prototype.atEndOfTour = function() {
  4893. //return this.currentItem >= this.nItems - 1
  4894. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4895. if(end){
  4896. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4897. if(heroLocations){
  4898. end = this.currentItem[1] >= heroLocations.length - 1
  4899. }
  4900. }
  4901. return end;
  4902. }
  4903. ,
  4904. n.prototype.firstDestination = function() {
  4905. //return 0 < this.nItems ? 0 : null
  4906. return 0 < this.nItems ? [0,0]: null
  4907. }
  4908. ,
  4909. n.prototype.finalDestination = function() {
  4910. //return 0 < this.nItems ? this.nItems - 1 : null
  4911. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4912. }
  4913. ,
  4914. n.prototype.goPrev = function() {
  4915. this.tourAdvance(-1)
  4916. }
  4917. ,
  4918. n.prototype.goNext = function() {
  4919. this.tourAdvance(1)
  4920. }
  4921. ,
  4922. n.prototype.setDestinationItem = function(e) {
  4923. this.destinationItem = e,
  4924. this.emit("update.controls")
  4925. }
  4926. ,
  4927. n.prototype.setCurrentItem = function(e) {
  4928. this.currentItem = e,
  4929. this.emit("update.controls")
  4930. }
  4931. ,
  4932. n.prototype.nextItem = function(currentItem) {
  4933. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4934. if(currentItem == void 0)return this.firstDestination()
  4935. var currentLocation = this.model.heroLocations[currentItem[0]];
  4936. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4937. var item;
  4938. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4939. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4940. }else{
  4941. item = [currentItem[0] , currentItem[1]+1]
  4942. }
  4943. if(item[0] >= this.nItems ){
  4944. item = this.firstDestination()
  4945. }
  4946. return item;
  4947. //暂时不理会endlessLoop,默认为false
  4948. }
  4949. ,
  4950. n.prototype.prevItem = function(currentItem) {
  4951. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4952. if(currentItem == void 0)return this.firstDestination()
  4953. var item;
  4954. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4955. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4956. else{
  4957. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4958. if(this.currentItem[1] == 0){//子目录中第一个
  4959. return [currentItem[0] - 1, lastChildNum-1]
  4960. }else{
  4961. return [currentItem[0], currentItem[1]-1]
  4962. }
  4963. }
  4964. }
  4965. ,
  4966. n.prototype.tourAdvance = function(e) {//e是1或-1
  4967. A.debug("tourAdvance(" + e + ")")
  4968. if(null === this.currentItem || void 0 === this.currentItem){
  4969. this.setDestinationItem(this.firstDestination())
  4970. }else{
  4971. var item
  4972. if(e == 1){
  4973. item = this.nextItem(this.currentItem)
  4974. }else if(e == -1){
  4975. item = this.prevItem(this.currentItem)
  4976. }
  4977. this.setDestinationItem(item)
  4978. }
  4979. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4980. this.useSpecialTransition("reverse-looping to end")
  4981. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4982. this.useSpecialTransition("looping back to start")
  4983. }
  4984. /* var momentTour = this.getMomentTour(this.destinationItem);
  4985. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4986. var zoomLevel = this.player.zoomLevel;
  4987. this.player.zoomEnabled = true;
  4988. var zoom = function(e, d) {
  4989. this.player.zoomTo((1-e)*zoomLevel, true)
  4990. }.bind(this)
  4991. s.start(zoom, 1500, function(){
  4992. }, 0, d.easeOutQuad, "zoom")
  4993. } */
  4994. this.goToDestination()
  4995. }
  4996. ,
  4997. n.prototype.getMomentTour = function(destinationItem) {//add
  4998. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  4999. if(!destinationItem) return wholeMomentTour
  5000. else{
  5001. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5002. if(currentLocation.momentTour)return currentLocation.momentTour;
  5003. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5004. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5005. }
  5006. }
  5007. ,
  5008. t.exports = n
  5009. }
  5010. ).call(this, "/js/director.js")
  5011. }
  5012. , {
  5013. "./analytics": 4,
  5014. "./enum/BlackoutStyle": 18,
  5015. "./enum/ControlEvents": 21,
  5016. "./enum/DirectorEvents": 23,
  5017. "./enum/ModelManagerEvents": 33,
  5018. "./enum/PathDiscardMode": 38,
  5019. "./enum/PathDisplayMode": 39,
  5020. "./enum/PlayerEvents": 40,
  5021. "./enum/Viewmode": 51,
  5022. "./enum/WarpStyle": 52,
  5023. "./model/ModelManager": 140,
  5024. "./player": 155,
  5025. "./settings": 166,
  5026. "./util/logger": 189,
  5027. "./util/transitions": 195,
  5028. events: 202,
  5029. three: 217
  5030. }],
  5031. 16: [function(e, t, i) {
  5032. "use strict";
  5033. var n = e("three")
  5034. , r = e("./enum/Viewmode")
  5035. , o = (e("./settings"),
  5036. e("./util/transitions"))
  5037. , a = e("./enum/PlayerEvents")
  5038. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5039. , l = new n.ShaderPass(n.VerticalBlurShader);
  5040. l.renderToScreen = !0;
  5041. var c = $("#player").width() / $("#player").height();
  5042. isNaN(c) && (c = 1);
  5043. initTransitionPass(n)
  5044. var h = {
  5045. currentBlur: 0,
  5046. aspect: c,
  5047. blurStrength: 1,
  5048. hblurPass: s,
  5049. vblurPass: l,
  5050. transitionMaskPass : new n.TransitionPass()
  5051. ,
  5052. bindEvents: function(e) {
  5053. e.on(a.ModeChanged, function(e, t) {
  5054. e === r.PANORAMA && (o.cancel(h.blur),
  5055. o.cancel(h.addBlur),
  5056. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5057. })
  5058. },
  5059. blur: function(e) {
  5060. h.currentBlur = e;
  5061. var t = e * h.blurStrength;
  5062. l.uniforms.v.value = t / 512 * h.aspect,
  5063. s.uniforms.h.value = t / 512
  5064. },
  5065. addBlur: function(e) {
  5066. e = Math.max(e, h.currentBlur),
  5067. h.blur(e)
  5068. },
  5069. removeBlur: function(e) {
  5070. e = Math.min(1 - e, h.currentBlur),
  5071. h.blur(e)
  5072. }
  5073. };
  5074. h.blur(0),
  5075. t.exports = h
  5076. }
  5077. , {
  5078. "./enum/PlayerEvents": 40,
  5079. "./enum/Viewmode": 51,
  5080. "./settings": 166,
  5081. "./util/transitions": 195,
  5082. three: 217
  5083. }],
  5084. 17: [function(e, t, i) {
  5085. "use strict";
  5086. t.exports = {
  5087. UNKNOWN: 0,
  5088. ALIGNED: 1,
  5089. UNALIGNED: 2,
  5090. PLACED: 3
  5091. }
  5092. }
  5093. , {}],
  5094. 18: [function(e, t, i) {
  5095. "use strict";
  5096. t.exports = {
  5097. NONE: 0,
  5098. MIDDLE: 1,
  5099. END: 2,
  5100. BEGINNING: 3,
  5101. FADEIN: 4
  5102. }
  5103. }
  5104. , {}],
  5105. 19: [function(e, t, i) {
  5106. "use strict";
  5107. var n = e("three");
  5108. t.exports = {
  5109. newBlue: new n.Color(4967932),
  5110. altBlue: new n.Color(47355),
  5111. tagDefault: new n.Color(223357),
  5112. classicBlue: new n.Color(53759),
  5113. mpYellow: new n.Color(16502016),
  5114. mpOrange: new n.Color(16428055),
  5115. mpBlue: new n.Color(12096),
  5116. mpLtGrey: new n.Color(13751252),
  5117. mpDkGrey: new n.Color(10000019),
  5118. mpRed: new n.Color(12525854),
  5119. mpOrangeDesat: new n.Color(16764529),
  5120. mpBlueDesat: new n.Color(4034734),
  5121. mpRedDesat: new n.Color(14705505),
  5122. white: new n.Color(16777215),
  5123. black: new n.Color(0),
  5124. _desat: function(e, t) {
  5125. var i = t || .3
  5126. , r = (new n.Color).copy(e).getHSL();
  5127. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5128. },
  5129. _darken: function(e, t) {
  5130. var i = t || .2
  5131. , r = e.getHSL();
  5132. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5133. }
  5134. }
  5135. }
  5136. , {
  5137. three: 217
  5138. }],
  5139. 20: [function(e, t, i) {
  5140. "use strict";
  5141. t.exports = {
  5142. NONE: -1,
  5143. ROTATE: 0,
  5144. DOLLY: 1,
  5145. PAN: 2,
  5146. ROTATE_DOLLY: 3,
  5147. PAN_DOLLY: 4
  5148. }
  5149. }
  5150. , {}],
  5151. 21: [function(e, t, i) {
  5152. "use strict";
  5153. t.exports = {
  5154. Move: "move",
  5155. InteractionDirect: "interaction.direct",
  5156. InteractionKey: "interaction.key",
  5157. InteractionGui: "interaction.gui",
  5158. FlyInDirection: "fly.direction",
  5159. InputStart: "input.start",
  5160. Pinch: "input.pinch",
  5161. Scroll: "input.scroll",
  5162. AutoPanInterrupt: "autopan.interrupt",
  5163. AutoPanComplete: "autopan.complete",
  5164. AutoPanClamped: "autopan.clamped",
  5165. LongTap: "longtap"
  5166. }
  5167. }
  5168. , {}],
  5169. 22: [function(e, t, i) {
  5170. "use strict";
  5171. t.exports = Object.freeze({
  5172. FORWARD: "FORWARD",
  5173. LEFT: "LEFT",
  5174. RIGHT: "RIGHT",
  5175. BACK: "BACK",
  5176. UP: "UP",
  5177. DOWN: "DOWN"
  5178. })
  5179. }
  5180. , {}],
  5181. 23: [function(e, t, i) {
  5182. "use strict";
  5183. t.exports = {
  5184. ActionInterrupted: "action.interrupted",
  5185. TourStart: "tour.start",
  5186. TourEnd: "tour.end",
  5187. StartModeChange: "mode.startChange"
  5188. }
  5189. }
  5190. , {}],
  5191. 24: [function(e, t, i) {
  5192. "use strict";
  5193. t.exports = Object.freeze({
  5194. None: 0,
  5195. Queued: 1,
  5196. ForceQueued: 2,
  5197. Downloading: 3,
  5198. Downloaded: 4,
  5199. DownloadFailed: 5
  5200. })
  5201. }
  5202. , {}],
  5203. 25: [function(e, t, i) {
  5204. "use strict";
  5205. t.exports = {
  5206. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5207. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5208. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5209. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5210. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5211. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5212. }
  5213. }
  5214. , {}],
  5215. 26: [function(e, t, i) {
  5216. "use strict";
  5217. t.exports = {
  5218. Texture2D: 0,
  5219. TextureCube: 1
  5220. }
  5221. }
  5222. , {}],
  5223. 27: [function(e, t, i) {
  5224. "use strict";
  5225. t.exports = {
  5226. SMALL: "small",
  5227. LARGE: "large"
  5228. }
  5229. }
  5230. , {}],
  5231. 28: [function(e, t, i) {
  5232. "use strict";
  5233. var n = e("./Viewmode")
  5234. , r = {
  5235. LANDING: {},
  5236. NAVIGATION: "navigation",
  5237. MORE_HELP: "moreHelp",
  5238. TOUR_INTERACTION: {}
  5239. };
  5240. r.LANDING[n.PANORAMA] = "panorama.landing",
  5241. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5242. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5243. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5244. r.TOUR_INTERACTION.standard = "standard.tour",
  5245. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5246. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5247. t.exports = r
  5248. }
  5249. , {
  5250. "./Viewmode": 51
  5251. }],
  5252. 29: [function(e, t, i) {
  5253. "use strict";
  5254. var n = {
  5255. UP: 1,
  5256. DOWN: -1,
  5257. LEFT: "L",
  5258. RIGHT: "R",
  5259. FORWARD: "F",
  5260. BACK: "B",
  5261. reverse: {},
  5262. opposite: function(e) {
  5263. return this.reverse[e.toString()]
  5264. }
  5265. };
  5266. !function() {
  5267. n.reverse[n.UP] = n.DOWN,
  5268. n.reverse[n.DOWN] = n.UP,
  5269. n.reverse[n.LEFT] = n.RIGHT,
  5270. n.reverse[n.RIGHT] = n.LEFT,
  5271. n.reverse[n.FORWARD] = n.BACK,
  5272. n.reverse[n.BACK] = n.FORWARD
  5273. }(),
  5274. t.exports = n
  5275. }
  5276. , {}],
  5277. 30: [function(e, t, i) {
  5278. "use strict";
  5279. var n = e("../util/browser")
  5280. , r = {
  5281. ZERO: 48,
  5282. ONE: 49,
  5283. TWO: 50,
  5284. THREE: 51,
  5285. FOUR: 52,
  5286. FIVE: 53,
  5287. SIX: 54,
  5288. SEVEN: 55,
  5289. EIGHT: 56,
  5290. NINE: 57,
  5291. LEFTARROW: 37,
  5292. UPARROW: 38,
  5293. RIGHTARROW: 39,
  5294. DOWNARROW: 40,
  5295. A: 65,
  5296. B: 66,
  5297. C: 67,
  5298. D: 68,
  5299. E: 69,
  5300. F: 70,
  5301. G: 71,
  5302. H: 72,
  5303. I: 73,
  5304. J: 74,
  5305. K: 75,
  5306. L: 76,
  5307. M: 77,
  5308. N: 78,
  5309. O: 79,
  5310. P: 80,
  5311. Q: 81,
  5312. R: 82,
  5313. S: 83,
  5314. T: 84,
  5315. U: 85,
  5316. V: 86,
  5317. W: 87,
  5318. X: 88,
  5319. Y: 89,
  5320. Z: 90,
  5321. SPACE: 32,
  5322. RETURN: 13,
  5323. SEMICOLON: 186,
  5324. PLUSEQUALS: 187,
  5325. DASHUNDERSCORE: 189,
  5326. OPENBRACKET: 219
  5327. };
  5328. n.detectFirefox() && (r.SEMICOLON = 59,
  5329. r.PLUSEQUALS = 61,
  5330. r.DASHUNDERSCORE = 173),
  5331. t.exports = r
  5332. }
  5333. , {
  5334. "../util/browser": 182
  5335. }],
  5336. 31: [function(e, t, i) {
  5337. "use strict";
  5338. t.exports = {
  5339. EN_US: "en-US",
  5340. ES_MX: "es-MX",
  5341. FR_FR: "fr-FR",
  5342. DE_DE: "de-DE",
  5343. RU_RU: "ru-RU",
  5344. CN_CN: "cn-CN",
  5345. JP_JP: "jp-JP"
  5346. }
  5347. }
  5348. , {}],
  5349. 32: [function(e, t, i) {
  5350. "use strict";
  5351. t.exports = {
  5352. TagActivated: "tag.activated",
  5353. TagDismissed: "tag.dismissed",
  5354. TagNavigation: "tag.navigation"
  5355. }
  5356. }
  5357. , {}],
  5358. 33: [function(e, t, i) {
  5359. "use strict";
  5360. t.exports = {
  5361. ModelAdded: "model-added",
  5362. ActiveModelChanged: "active-model-changed"
  5363. }
  5364. }
  5365. , {}],
  5366. 34: [function(e, t, i) {
  5367. "use strict";
  5368. t.exports = {
  5369. LEFT: 0,
  5370. MIDDLE: 1,
  5371. RIGHT: 2
  5372. }
  5373. }
  5374. , {}],
  5375. 35: [function(e, t, i) {
  5376. "use strict";
  5377. t.exports = {
  5378. PanoRenderComplete: "panorama.render.complete",
  5379. TileRenderFailure: "panorama.tile.render.failed",
  5380. TileRenderSuccess: "panorama.tile.render.success",
  5381. TileUploadAttempted: "panorama.tile.upload.attempted",
  5382. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5383. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5384. }
  5385. }
  5386. , {}],
  5387. 36: [function(e, t, i) {
  5388. "use strict";
  5389. t.exports = {
  5390. BASE: 1,
  5391. STANDARD: 2,
  5392. HIGH: 3,
  5393. ULTRAHIGH: 4
  5394. }
  5395. }
  5396. , {}],
  5397. 37: [function(e, t, i) {
  5398. "use strict";
  5399. t.exports = {
  5400. LoadComplete: "panorama.load.complete",
  5401. LoadFailed: "panorama.load.failed",
  5402. TileLoaded: "panorama.tile.loaded"
  5403. }
  5404. }
  5405. , {}],
  5406. 38: [function(e, t, i) {
  5407. "use strict";
  5408. t.exports = Object.freeze({
  5409. Standard: 0,
  5410. Slow: 1,
  5411. Retain: 2
  5412. })
  5413. }
  5414. , {}],
  5415. 39: [function(e, t, i) {
  5416. "use strict";
  5417. t.exports = Object.freeze({
  5418. Show: 0,
  5419. Hide: 1,
  5420. Retain: 2
  5421. })
  5422. }
  5423. , {}],
  5424. 40: [function(e, t, i) {
  5425. "use strict";
  5426. t.exports = {
  5427. Move: "move",
  5428. MoveComplete: "move.complete",
  5429. ModeChanged: "mode.changed",
  5430. ModeChanging: "mode.changing",
  5431. PanoChosen: "pano.chosen",
  5432. ClosestPanoChanging: "closest.pano.changing",
  5433. WarpStarted: "warp.started",
  5434. WarpInterrupted: "warp.interrupted",
  5435. WarpEnded: "warp.ended",
  5436. FlyinFinished: "flyin.finished",
  5437. FlyingStarted: "flying.started",
  5438. FlyingInterrupted: "flying.interrupted",
  5439. FlyingEnded: "flying.ended",
  5440. Ready: "ready",
  5441. StartInside: "start.inside",
  5442. StartOutside: "start.outside",
  5443. ViewChanged: "view.changed",
  5444. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5445. InputStart: "input.start"
  5446. }
  5447. }
  5448. , {}],
  5449. 41: [function(e, t, i) {
  5450. "use strict";
  5451. t.exports = Object.freeze({
  5452. DEFAULT: 0,
  5453. PANOMARKERS: 1,
  5454. RETICULE: 2,
  5455. TAG: 3
  5456. })
  5457. }
  5458. , {}],
  5459. 42: [function(e, t, i) {
  5460. "use strict";
  5461. t.exports = {
  5462. visibleFloor: 1,
  5463. ghostFloor: 3,
  5464. boundingSkybox: 1,
  5465. panoMarker: 2,
  5466. reticule: 3,
  5467. tagStem: 4,
  5468. tagDisc: 5,
  5469. ribbon: 100
  5470. }
  5471. }
  5472. , {}],
  5473. 43: [function(e, t, i) {
  5474. "use strict";
  5475. t.exports = {
  5476. ContextCreated: "scene-renderer-context-created",
  5477. AfterRender: "after-render",
  5478. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5479. }
  5480. }
  5481. , {}],
  5482. 44: [function(e, t, i) {
  5483. "use strict";
  5484. t.exports = {
  5485. IDLE: "idle",
  5486. BROWSE: "browse",
  5487. EXAMINE: "examine"
  5488. }
  5489. }
  5490. , {}],
  5491. 45: [function(e, t, i) {
  5492. "use strict";
  5493. t.exports = {
  5494. TileDownloadSuccess: "tiledownloader.download.success",
  5495. TileDownloadFailure: "tiledownloader.download.failure",
  5496. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5497. }
  5498. }
  5499. , {}],
  5500. 46: [function(e, t, i) {
  5501. "use strict";
  5502. t.exports = {
  5503. CardboardAndroid: "googlevr",
  5504. GearVR: "gearvr",
  5505. CardboardIOS: "googlevrios",
  5506. Cardboard: "googlevr"
  5507. }
  5508. }
  5509. , {}],
  5510. 47: [function(e, t, i) {
  5511. "use strict";
  5512. t.exports = {
  5513. NONE: 0,
  5514. CONTEXTUAL: 1,
  5515. ANDROID: 2
  5516. }
  5517. }
  5518. , {}],
  5519. 48: [function(e, t, i) {
  5520. "use strict";
  5521. var n = {
  5522. Title: 0,
  5523. Cardboard: 1
  5524. }
  5525. , r = {
  5526. Title: 0,
  5527. Cardboard: 1,
  5528. Gear: 2
  5529. };
  5530. !function() {
  5531. [n, r].forEach(function(e) {
  5532. e.pageCount = Object.keys(e).length
  5533. })
  5534. }(),
  5535. t.exports.ios = n,
  5536. t.exports.standard = r
  5537. }
  5538. , {}],
  5539. 49: [function(e, t, i) {
  5540. "use strict";
  5541. t.exports = {
  5542. Android: "android",
  5543. IOS: "ios",
  5544. Desktop: "desktop",
  5545. UnsupportedAndroid: "android-unsupported"
  5546. }
  5547. }
  5548. , {}],
  5549. 50: [function(e, t, i) {
  5550. "use strict";
  5551. var n = e("three");
  5552. t.exports = {
  5553. UP: new n.Vector3(0,1,0),
  5554. DOWN: new n.Vector3(0,-1,0),
  5555. LEFT: new n.Vector3(-1,0,0),
  5556. RIGHT: new n.Vector3(1,0,0),
  5557. FORWARD: new n.Vector3(0,0,-1),
  5558. BACK: new n.Vector3(0,0,1)
  5559. }
  5560. }
  5561. , {
  5562. three: 217
  5563. }],
  5564. 51: [function(e, t, i) {
  5565. "use strict";
  5566. var n = e("../exception/ViewmodeConvertException")
  5567. , r = e("./coreViewmodes")
  5568. , o = e("../util/common")
  5569. , a = {
  5570. MESH: "mesh",
  5571. OUTDOOR: "outdoor",
  5572. TRANSITIONING: "transitioning",
  5573. toInt: function(e) {
  5574. switch (e) {
  5575. case this.PANORAMA:
  5576. return 1;
  5577. case this.DOLLHOUSE:
  5578. return 2;
  5579. case this.FLOORPLAN:
  5580. return 3;
  5581. case this.OUTDOOR:
  5582. return 4;
  5583. case this.TRANSITIONING:
  5584. return -1
  5585. }
  5586. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5587. },
  5588. fromInt: function(e) {
  5589. switch (e) {
  5590. case "1":
  5591. case 1:
  5592. return this.PANORAMA;
  5593. case "2":
  5594. case 2:
  5595. return this.DOLLHOUSE;
  5596. case "3":
  5597. case 3:
  5598. return this.FLOORPLAN;
  5599. case "4":
  5600. case 4:
  5601. return this.OUTDOOR
  5602. }
  5603. throw new n("No known conversion for int to viewmode for int: " + e)
  5604. },
  5605. convertWorkshopModeInt: function(e) {
  5606. switch (e) {
  5607. case "0":
  5608. case 0:
  5609. case undefined: //xzw add
  5610. return this.PANORAMA;
  5611. case "1":
  5612. case 1:
  5613. return this.FLOORPLAN;
  5614. case "2":
  5615. case 2:
  5616. return this.DOLLHOUSE;
  5617. case "3":
  5618. case 3:
  5619. return this.MESH
  5620. }
  5621. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5622. }
  5623. };
  5624. o.extendObject(a, r),
  5625. t.exports = a
  5626. }
  5627. , {
  5628. "../exception/ViewmodeConvertException": 58,
  5629. "../util/common": 185,
  5630. "./coreViewmodes": 54
  5631. }],
  5632. 52: [function(e, t, i) {
  5633. "use strict";
  5634. t.exports = {
  5635. BLACK: "black",
  5636. STD: "std",
  5637. WALK: "walk"
  5638. }
  5639. }
  5640. , {}],
  5641. 53: [function(e, t, i) {
  5642. "use strict";
  5643. t.exports = {
  5644. ZoomIn: "zoom.in",
  5645. ZoomOut: "zoom.out",
  5646. ZoomMax: "zoom.max",
  5647. ZoomMin: "zoom.min"
  5648. }
  5649. }
  5650. , {}],
  5651. 54: [function(e, t, i) {
  5652. "use strict";
  5653. t.exports = {
  5654. PANORAMA: "panorama",
  5655. DOLLHOUSE: "dollhouse",
  5656. FLOORPLAN: "floorplan"
  5657. }
  5658. }
  5659. , {}],
  5660. 55: [function(e, t, i) {
  5661. "use strict";
  5662. function n(e) {
  5663. this.message = e
  5664. }
  5665. t.exports = n
  5666. }
  5667. , {}],
  5668. 56: [function(e, t, i) {
  5669. "use strict";
  5670. function n(e) {
  5671. r.call(this, e)
  5672. }
  5673. var r = e("./BasicException");
  5674. n.prototype = Object.create(r.prototype),
  5675. t.exports = n
  5676. }
  5677. , {
  5678. "./BasicException": 55
  5679. }],
  5680. 57: [function(e, t, i) {
  5681. "use strict";
  5682. function n(e) {
  5683. r.call(this, e)
  5684. }
  5685. var r = e("./BasicException");
  5686. n.prototype = Object.create(r.prototype),
  5687. t.exports = n
  5688. }
  5689. , {
  5690. "./BasicException": 55
  5691. }],
  5692. 58: [function(e, t, i) {
  5693. "use strict";
  5694. function n(e) {
  5695. r.call(this, e)
  5696. }
  5697. var r = e("./BasicException");
  5698. n.prototype = Object.create(r.prototype),
  5699. t.exports = n
  5700. }
  5701. , {
  5702. "./BasicException": 55
  5703. }],
  5704. 59: [function(e, t, i) {
  5705. (function(i) {
  5706. "use strict";
  5707. function n(e) {
  5708. var t = {};
  5709. if (e) {
  5710. var i = e.flags;
  5711. if (i)
  5712. for (var n in i)
  5713. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5714. return t
  5715. }
  5716. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5717. null
  5718. }
  5719. var r = e("./util/ajax")
  5720. , o = e("./util/showcase")
  5721. , a = e("./util/logger")
  5722. , s = ""
  5723. , l = new a(i)
  5724. , c = {};
  5725. t.exports = {
  5726. loadFeatureFlags: function(e) {
  5727. var t = $.Deferred();
  5728. return r.get(e.urlBase + s, {
  5729. responseType: "json",
  5730. prefetchFrom: "user",
  5731. auth: o.getAuthorizationHeader()
  5732. }).done(function(e) {
  5733. c = n(e),
  5734. c ? t.resolve(c) : t.reject("loading-failed")
  5735. }).fail(function() {
  5736. l.debug("Retrieval of feature flags failed."),
  5737. t.reject("loading-failed")
  5738. }),
  5739. t.promise()
  5740. },
  5741. getFlags: function() {
  5742. return c
  5743. },
  5744. updateDependentSettings: function(e, t) {
  5745. e = e || c,
  5746. e.labels && (t.labels.enabled = !0),
  5747. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5748. e.showcase_sdk && (t.sdkInit = !0),
  5749. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5750. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5751. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5752. e.hide_sc_sharing && (t.share.enabled = !1)
  5753. }
  5754. }
  5755. }
  5756. ).call(this, "/js/featureflags.js")
  5757. }
  5758. , {
  5759. "./util/ajax": 181,
  5760. "./util/logger": 189,
  5761. "./util/showcase": 193
  5762. }],
  5763. 60: [function(e, t, i) {
  5764. "use strict";
  5765. var n = (e("../util/common"),
  5766. {
  5767. status: 0,
  5768. set: function(e) {
  5769. if (isNaN(e))
  5770. return !1;
  5771. var t = $('.progressbar');
  5772. 0 > e && (e = 0);
  5773. e > 100 && (e = 100);
  5774. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5775. var barperc = e*width;
  5776. var perc = Math.round(e);
  5777. var labelpos = (parseInt(barperc)-15);
  5778. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5779. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5780. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5781. this.status = e
  5782. },
  5783. done: function(e) {
  5784. return e || this.status ? (this.status = null,
  5785. this.set(100)) : this
  5786. }
  5787. });
  5788. t.exports.circleLoader = n
  5789. }
  5790. , {
  5791. "../util/common": 185
  5792. }],
  5793. 61: [function(e, t, i) {
  5794. "use strict";
  5795. t.exports = Object.freeze({
  5796. CLOSE: "modal.closer.close"
  5797. })
  5798. }
  5799. , {}],
  5800. 62: [function(e, t, i) {
  5801. "use strict";
  5802. function n(e, t) {
  5803. t && (t.stopPropagation(),
  5804. t.preventDefault()),
  5805. e && this.emit(l.CLOSE, e),
  5806. g.reset()
  5807. }
  5808. function r(e, t) {
  5809. function i() {
  5810. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5811. t !== f && (f = t,
  5812. t ? (e.classList.add("closeByFooter"),
  5813. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5814. h.classList.remove("closeByFooter")))
  5815. }
  5816. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5817. }
  5818. var o = e("../../settings")
  5819. , a = (e("../../tag/Media/MediaEvent"),
  5820. e("../../util/browser"))
  5821. , s = e("../../util/common")
  5822. , l = e("./ModalCloserEvent")
  5823. , c = e("events").EventEmitter
  5824. , h = document.getElementsByClassName("footer")[0]
  5825. , u = h.querySelectorAll(".close")[0]
  5826. , d = null
  5827. , p = null
  5828. , f = null
  5829. , g = (a.isMobile(),
  5830. {
  5831. open: function(e) {
  5832. e && (r(e),
  5833. d && u.removeEventListener("click", d, !0),
  5834. d = n.bind(this, e.id),
  5835. u.addEventListener("click", d, !0),
  5836. p && window.removeEventListener("resize", p, !0),
  5837. p = r.bind(this, e),
  5838. window.addEventListener("resize", p, !0))
  5839. },
  5840. reset: function() {
  5841. h.classList.remove("closeByFooter"),
  5842. u.removeEventListener("click", d, !0),
  5843. window.removeEventListener("resize", p, !0),
  5844. d = p = f = null
  5845. }
  5846. });
  5847. s.extendObject(g, c.prototype),
  5848. t.exports = g
  5849. }
  5850. , {
  5851. "../../tag/Media/MediaEvent": 131,
  5852. "../../settings": 166,
  5853. "../../util/browser": 182,
  5854. "../../util/common": 185,
  5855. "./ModalCloserEvent": 61,
  5856. events: 202
  5857. }],
  5858. 63: [function(e, t, i) {
  5859. "use strict";
  5860. function n(e, t, i) {
  5861. var n = new r.GUI({
  5862. width: 400
  5863. })
  5864. , u = n.addFolder("Flydown from Dollhouse");
  5865. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5866. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5867. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5868. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5869. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5870. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5871. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5872. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5873. var d = n.addFolder("Transition between panos");
  5874. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5875. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5876. h.transition.flyTime = 0,
  5877. d.__controllers.forEach(function(e) {
  5878. e.updateDisplay()
  5879. })
  5880. }),
  5881. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5882. h.transition.flySpeed = 0,
  5883. d.__controllers.forEach(function(e) {
  5884. e.updateDisplay()
  5885. })
  5886. }),
  5887. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5888. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5889. d.add(h.transition, "movementEasing", Object.keys(a));
  5890. var p = n.addFolder("Path Display");
  5891. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5892. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5893. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5894. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5895. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5896. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5897. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5898. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5899. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5900. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5901. h.path.color = l[h.path.color],
  5902. h.path.colorUp = l._desat(h.path.color),
  5903. h.path.colorDown = l.darken(h.path.color)
  5904. }),
  5905. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5906. h.reticuleColor = l[h.reticuleColor]
  5907. });
  5908. var f = n.addFolder("Warping")
  5909. , g = f.addFolder("Warp/Teleport");
  5910. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5911. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5912. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5913. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5914. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5915. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5916. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5917. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5918. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5919. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5920. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5921. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5922. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5923. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5924. h.path.typ = c[h.path.typ]
  5925. }),
  5926. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5927. t.endlessLoop = h.warp.loop
  5928. }),
  5929. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5930. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5931. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5932. var m = f.addFolder("Long Warp Only");
  5933. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5934. h.warp.flySpeed = 0,
  5935. m.__controllers.forEach(function(e) {
  5936. e.updateDisplay()
  5937. })
  5938. }),
  5939. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5940. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5941. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5942. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5943. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5944. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5945. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5946. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5947. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5948. var v = n.addFolder("Warp Esoterica");
  5949. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5950. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5951. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5952. h.warp.minWarpTime = 0,
  5953. v.__controllers.forEach(function(e) {
  5954. e.updateDisplay()
  5955. })
  5956. }),
  5957. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5958. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5959. v.add(h.warp, "movementEasing", Object.keys(a));
  5960. var A = n.addFolder("Misc");
  5961. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5962. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5963. }),
  5964. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5965. i.cameras[s.PANORAMA].fov = h.insideFOV
  5966. }),
  5967. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5968. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5969. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5970. var y = n.addFolder("Navigation");
  5971. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5972. h.navigation.panoScores || e.panos.forEach(function(e) {
  5973. e.floor.remove(e.text3d),
  5974. e.text3d = null
  5975. })
  5976. }),
  5977. y.add(h.navigation, "mouseDirection"),
  5978. y.add(h.navigation, "filterStrictness", 0, 1),
  5979. y.add(h.navigation, "angleFactor", -60, 0),
  5980. y.add(h.navigation, "directionFactor", 1, 20),
  5981. y.add(h.navigation, "distanceFactor", -5, 5),
  5982. y.add(h.navigation, "optionalityFactor", .1, 10);
  5983. var C = n.addFolder("tags")
  5984. , I = C.addFolder("Tag Creation");
  5985. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5986. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5987. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5988. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5989. var E = C.addFolder("Visibility");
  5990. E.add(h.tags.visibility, "anyDistance"),
  5991. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5992. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5993. E.add(h.tags.visibility, "hideViaFloor"),
  5994. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5995. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5996. var b = C.addFolder("Disc Parameters");
  5997. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5998. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5999. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6000. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6001. }),
  6002. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6003. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6004. }),
  6005. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6006. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6007. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6008. var w = C.addFolder("Navigate");
  6009. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6010. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6011. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6012. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6013. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6014. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6015. var _ = n.addFolder("Debug");
  6016. _.add(h, "wireframe").onFinishChange(function() {
  6017. e.chunks.forEach(function(t) {
  6018. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6019. t.wireframeTwin.material.depthWrite = !1,
  6020. t.wireframeTwin.material.depthTest = !1,
  6021. t.wireframeTwin.material.opacity = .5,
  6022. t.wireframeTwin.material.transparent = !0),
  6023. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6024. })
  6025. }),
  6026. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6027. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6028. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6029. e.skybox.wireframe = null)
  6030. }),
  6031. _.add(h, "showSweeps").onFinishChange(function() {
  6032. e.setSweepVisibility(h.showSweeps)
  6033. }),
  6034. _.add(h, "showMesh").onFinishChange(function() {
  6035. e.chunks.forEach(function(e) {
  6036. e.visible = h.showMesh
  6037. })
  6038. }),
  6039. _.add(h, "showFloors").onFinishChange(function() {
  6040. e.floors.forEach(function(e) {
  6041. e.collider.children.forEach(function(e) {
  6042. e.material.visible = h.showFloors
  6043. })
  6044. })
  6045. }),
  6046. _.add(h, "showSkyboxes").onFinishChange(function() {
  6047. e.panos.forEach(function(e) {
  6048. e.skyboxMesh.visible = h.showSkyboxes
  6049. })
  6050. }),
  6051. _.add(h, "showNeighbors").onChange(function() {}),
  6052. _.add(e, "alpha", 0, 1)
  6053. }
  6054. var r = e("../lib/dat.gui")
  6055. , o = e("three")
  6056. , a = e("../util/easing")
  6057. , s = e("../enum/Viewmode")
  6058. , l = e("../enum/Colors")
  6059. , c = e("../enum/WarpStyle")
  6060. , h = e("../settings");
  6061. e("../tag/tag");
  6062. r.GUI.prototype.removeFolder = function(e) {
  6063. var t = this.__folders[e];
  6064. t && (t.close(),
  6065. this.__ul.removeChild(t.domElement.parentNode),
  6066. delete this.__folders[e],
  6067. this.onResize())
  6068. }
  6069. ,
  6070. t.exports.toggle = n
  6071. }
  6072. , {
  6073. "../enum/Colors": 19,
  6074. "../enum/Viewmode": 51,
  6075. "../enum/WarpStyle": 52,
  6076. "../lib/dat.gui": 93,
  6077. "../tag/tag": 123,
  6078. "../settings": 166,
  6079. "../util/easing": 186,
  6080. three: 217
  6081. }],
  6082. 64: [function(e, t, i) {
  6083. (function(i) {
  6084. "use strict";
  6085. function n(e, t, i, n) {
  6086. $(".gui-error .error-problem-text").text(e),
  6087. $(".gui-error .error-solution-text").text(t),
  6088. $(".gui-error .error-explanation").text(i),
  6089. $(".gui-error .error-actions").html(n),
  6090. $(window).resize(),
  6091. $(".gui-error").fadeIn(),
  6092. $("#bottom-logo").fadeIn()
  6093. }
  6094. function r(e) {
  6095. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="static/images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="static/images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="static/images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="static/images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  6096. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6097. s.isMobile() || $("[rel=tiletip]").tooltip({
  6098. placement: "bottom",
  6099. delay: {
  6100. show: 50,
  6101. hide: 0
  6102. },
  6103. trigger: "hover",
  6104. viewport: {
  6105. selector: "body",
  6106. padding: 10
  6107. }
  6108. })
  6109. }
  6110. function o() {
  6111. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6112. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6113. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6114. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6115. e.preventDefault(),
  6116. e.stopPropagation(),
  6117. r(" ")
  6118. })
  6119. }
  6120. function a(e) {
  6121. if ($("head title").text(c.pageTitle),
  6122. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6123. $("#gui-loading").fadeOut(250),
  6124. $("#quick-blackout").hide(),
  6125. l.track("showcase_error", {
  6126. error_key: e
  6127. }),
  6128. h.locale || h.init(),
  6129. "webgl-unsupported" === e)
  6130. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6131. else if ("webgl-ios" === e)
  6132. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6133. else if ("webgl-safari" === e)
  6134. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6135. else if ("webgl-generic" === e)
  6136. o();
  6137. else if ("missing-urls" === e)
  6138. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6139. else if ("loading-failed" === e)
  6140. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6141. else {
  6142. if ("loading-failed-maintenance" !== e)
  6143. return void d.error("Unhandled error: " + e);
  6144. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6145. }
  6146. }
  6147. var s = e("./../util/browser")
  6148. , l = e("./../analytics")
  6149. , c = e("./../settings")
  6150. , h = e("../localization/localize")
  6151. , u = e("./../util/logger")
  6152. , d = new u(i)
  6153. , p = '"https://support.port.com/hc/articles/208220058"';
  6154. t.exports.error = a
  6155. }
  6156. ).call(this, "/js/gui/error.js")
  6157. }
  6158. , {
  6159. "../localization/localize": 108,
  6160. "./../analytics": 4,
  6161. "./../settings": 166,
  6162. "./../util/browser": 182,
  6163. "./../util/logger": 189
  6164. }],
  6165. 65: [function(e, t, i) {
  6166. (function(i) {
  6167. "use strict";
  6168. function n() {
  6169. Ue = [],
  6170. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6171. Ue.push(".hideTarget", ".pinTop.right")
  6172. }
  6173. function r() {
  6174. for (var e in je)
  6175. if (je.hasOwnProperty(e)) {
  6176. var t = je[e];
  6177. if (!t.visible)
  6178. for (var i = 0; i < t.elements.length; i++)
  6179. $(t.elements[i]).hide()
  6180. }
  6181. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6182. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6183. n()
  6184. }
  6185. function o(e, t) {
  6186. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6187. $("#gui-zoomin").toggle(i),
  6188. $("#gui-zoomout").toggle(i)
  6189. }
  6190. function a() {
  6191. c(),
  6192. $(".pinBottom").toggleClass("open"),
  6193. $("#drawer").toggleClass("open"),
  6194. $(".footer").toggleClass("open"),
  6195. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6196. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6197. ie.resetDrawer()),
  6198. setTimeout(function() {
  6199. $("#pullTab").toggleClass("opened");
  6200. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6201. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6202. }
  6203. function s(e) {
  6204. var t;
  6205. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6206. t = e.position().top + e.outerHeight(),
  6207. e.attr("style", "display: none"));
  6208. var i = $("#player").outerHeight()
  6209. , n = i - 130;
  6210. return n < t + 25
  6211. }
  6212. function l(e) {
  6213. "touchstart" === e.type && e.preventDefault(),
  6214. e.stopPropagation()
  6215. }
  6216. function c() {
  6217. W && (W.reload(),
  6218. W.init())
  6219. }
  6220. function h(e) {
  6221. ne.show(e),
  6222. r()
  6223. }
  6224. function u(e) {
  6225. ne.progress(e)
  6226. }
  6227. function d(e, t, i) {
  6228. var n = t.player;
  6229. $("#gui-thumb").fadeOut(2500),
  6230. ne.hide(function() {
  6231. Ge = !1
  6232. }),
  6233. me.init(e, i),
  6234. de.finishSetup(Object.keys(e.tags).length),
  6235. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6236. var s = function() {
  6237. i.dismissExaminedTag(),
  6238. i.disableHovering()
  6239. };
  6240. Ae.on(ye.OPENED, s),
  6241. Ce.on(Me.OPENED, s),
  6242. he.on(ue.OPENED, s),
  6243. fe.on(ge.OPENED, s);
  6244. var l = i.enableHovering.bind(i);
  6245. if (Ae.on(ye.CLOSED, l),
  6246. Ce.on(Me.CLOSED, l),
  6247. he.on(ue.CLOSED, l),
  6248. fe.on(ge.CLOSED, l),
  6249. Q.labels.enabled && Object.keys(e.labels).length,
  6250. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6251. C(e.currentFloor, n.mode)),
  6252. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6253. r(),
  6254. o(t, t.player),
  6255. $("#gui").fadeIn(1500),
  6256. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6257. a(),
  6258. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6259. }, 2e3),
  6260. !K.isMobile())
  6261. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6262. $(c[h]).addClass("hasHover");
  6263. O(e),
  6264. de.setupToggling();
  6265. //xzw:
  6266. window.editHotPanel && editHotPanel();
  6267. //czj
  6268. navBorderRadius(e);
  6269. //czj 编辑界面
  6270. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6271. window.EditTools && new EditTools(n.sceneRenderer);
  6272. }
  6273. function navBorderRadius(e){
  6274. var pullTab = $("#pullTab"),
  6275. mobileRadius = {
  6276. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6277. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6278. },
  6279. topRadius = {
  6280. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6281. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6282. };
  6283. function BorderRadius(bottom,top){
  6284. $("#gui-modes-map > div:visible:last").css(bottom);
  6285. if(pullTab.is(':visible')){
  6286. $(".viewContainer > div:visible:first").css(top);
  6287. }else{
  6288. $("#gui-modes-map > div:visible:first").css(top);
  6289. }
  6290. }
  6291. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6292. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6293. }else{
  6294. BorderRadius(topRadius.bottom,topRadius.top);
  6295. }
  6296. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6297. if(window.DATA.model.special || window.DATA.special){
  6298. window.specialScene && specialScene.special().afterImplement();
  6299. }
  6300. }
  6301. function p(e) {
  6302. e || (e = 0),
  6303. We = !1,
  6304. window.setTimeout(function() {
  6305. We || (ze = !0,
  6306. $("#gui-spinner").stop(!0, !0).show())
  6307. }
  6308. .bind(this), e)
  6309. }
  6310. function f() {
  6311. $("#gui-spinner").stop(!0, !0),
  6312. $("#gui-spinner").fadeOut(1e3),
  6313. We = !0,
  6314. ze = !1
  6315. }
  6316. function g(e, t) {
  6317. var i = e.mode
  6318. , n = t || e.currentPano;
  6319. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6320. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6321. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6322. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6323. Q.show360Views.enabled && !n.isAligned() ? (
  6324. $(".gui-floor").addClass("hidden"),
  6325. $("#gui-modes-outside").addClass("desktop-only")) : (
  6326. $(".gui-floor").removeClass("hidden"),
  6327. $("#gui-modes-outside").removeClass("desktop-only")),
  6328. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6329. Be = i,
  6330. $("#gui-modes-outside").addClass("hidden"),
  6331. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6332. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6333. }
  6334. function m(e, t) {
  6335. var i = t.player;
  6336. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6337. l(e),
  6338. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6339. J.track("USER", {
  6340. event_type: "showcase_gui",
  6341. gui_action: "click_inside_mode_button"
  6342. }),
  6343. t.changeMode(_e.PANORAMA);
  6344. }),
  6345. $("#gui-modes-outside").find("a").on("click", function(e) {
  6346. l(e),
  6347. J.track("showcase_gui", {
  6348. gui_action: "click_outside_mode_button"
  6349. }),
  6350. t.changeMode(Be)
  6351. }),
  6352. $("#gui-modes-floorplan").on("click", function(e) {
  6353. l(e),
  6354. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6355. gui_action: "click_floorplan_mode_button"
  6356. }),
  6357. t.changeMode(_e.FLOORPLAN));
  6358. }),
  6359. $("#gui-modes-dollhouse").on("click", function(e) {
  6360. l(e),
  6361. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6362. gui_action: "click_dollhouse_mode_button"
  6363. }),
  6364. t.changeMode(_e.DOLLHOUSE));
  6365. })
  6366. }
  6367. function v(e, t) {
  6368. function i() {
  6369. document.getElementById("vr").classList.remove("hidden"),
  6370. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6371. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6372. $(".improper-embed").toggleClass("hidden", !1),
  6373. r())
  6374. }, function(e) {
  6375. r()
  6376. }) : r()
  6377. }
  6378. function n(i) {
  6379. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6380. Ie.init(e.data, t, i, q),
  6381. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6382. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6383. }
  6384. function r() {
  6385. De.info("WebVR support not found, VR button activates native app VR modal"),
  6386. Ae.init(e.data, q),
  6387. Ae.on(ye.OPENED, function() {
  6388. var e = document.getElementById("vr-modal");
  6389. return function() {
  6390. Ze("vr"),
  6391. le.open(e)
  6392. }
  6393. }()),
  6394. Ae.on(ye.CLOSED, le.reset)
  6395. }
  6396. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6397. /*********************** 方奕卓 VR功能事件监听 ********************/
  6398. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6399. switch (Q.vr.option) {
  6400. case Pe.CONTEXTUAL:
  6401. i();
  6402. break;
  6403. case Pe.ANDROID:
  6404. K.detectAndroid() && i();
  6405. break;
  6406. case Pe.NONE:
  6407. }
  6408. }
  6409. }
  6410. function A(e, t) {
  6411. $("#play").on("mousedown touchstart", function(e) {
  6412. l(e);
  6413. Ze("tour");
  6414. ve.play();
  6415. J.trackAlways("showcase_gui", {
  6416. gui_action: "play_highlights"
  6417. })
  6418. }),
  6419. window.startAndPlay = function(e) {
  6420. // l(e);
  6421. Ze("tour");
  6422. ve.play();
  6423. J.trackAlways("showcase_gui", {
  6424. gui_action: "play_highlights"
  6425. })
  6426. };
  6427. $("#pause").on("mousedown touchstart", function(e) {
  6428. l(e),
  6429. ve.pause(),
  6430. J.trackAlways("showcase_gui", {
  6431. gui_action: "pause_highlights"
  6432. })
  6433. }),
  6434. $("#gui-zoomin").find("a").on("click", function(e) {
  6435. l(e),
  6436. t.player.zoomInIncrementally()
  6437. }),
  6438. $("#gui-zoomout").find("a").on("click", function(e) {
  6439. l(e),
  6440. t.player.zoomOutIncrementally()
  6441. })
  6442. }
  6443. function y(e, t) {
  6444. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6445. if(getQueryVariable('m') === '372') continue;
  6446. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6447. $(".gui-floor").find(".container").prepend(r)
  6448. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6449. }
  6450. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6451. i.on("click", function(e) {
  6452. l(e),
  6453. Ze("floor"),
  6454. i.toggleClass("open")
  6455. }),
  6456. $(".floorChoice").on("click", function(e) {
  6457. l(e);
  6458. var n = $(this).data("index");
  6459. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6460. t.player.gotoFloor(n),
  6461. J.track("showcase_gui", {
  6462. gui_action: "click_floor_select_button",
  6463. interaction_source: "gui"
  6464. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6465. Ze("move"),
  6466. t.allFloors(),
  6467. J.track("showcase_gui", {
  6468. gui_action: "click_toggle_all_floors_button",
  6469. interaction_source: "gui"
  6470. })),
  6471. i.removeClass("open")
  6472. })
  6473. }
  6474. function C(e, t) {
  6475. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? ($(".allFloorBtn").show(),$(".gui-floor-icon").hide(),$(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),$(".gui-floor-icon").show(),$(".gui-floor-title").hide()),
  6476. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6477. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6478. $(".floorChoice").removeClass("active"),
  6479. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6480. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6481. $(".floorChoice").removeClass("active"),
  6482. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6483. }
  6484. function I(e) {
  6485. return e.describe().inTransition
  6486. }
  6487. function b(e, t, i) {
  6488. Fe = e.heroLocations.length;
  6489. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6490. , r = 100 / Fe + "%"
  6491. , o = $("#thumb-container")
  6492. , a = $("#progressBar");
  6493. $("#status").find(".totalSteps").text(Fe);
  6494. for (var s = 0; s < Fe; s++) {
  6495. var c = e.heroLocations[s]
  6496. , h = $(n);
  6497. var thumbUrl
  6498. if(c.heroLocations){//有子项,选第一张截图
  6499. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6500. }else{
  6501. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6502. }
  6503. h.attr("data-index", s)
  6504. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6505. if (c.name) {
  6506. var u = $('<div class="overlay"></div>').text(c.name);
  6507. h.prepend(u)
  6508. }
  6509. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6510. var d = e.panos.get(c.panoId)
  6511. , p = d && !d.isAligned()
  6512. , f = p ? '<div><img class="mark360View" src="static/images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="static/images/mark-inside-white.png"></div>';
  6513. h.prepend(f)
  6514. }
  6515. o.append(h),
  6516. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6517. }
  6518. j = 144 * Fe,
  6519. Y = 111 * Fe,
  6520. $(".thumbImg").on("mouseover", function() {
  6521. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6522. }),
  6523. $(".thumbImg").on("mouseout", function() {
  6524. t.clearPath()
  6525. }),
  6526. $(".thumbImg").on("click", function(e) {
  6527. l(e);
  6528. var i = $(this);
  6529. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6530. J.trackAlways("showcase_gui", {
  6531. gui_action: "click_highlight"
  6532. }),
  6533. t.goToHighlight([i.data("index"),0])//改
  6534. }),
  6535. $(".previous").find("a").on("click", function(e) {
  6536. l(e),
  6537. J.trackAlways("showcase_gui", {
  6538. gui_action: "prev_highlight"
  6539. }),
  6540. t.prevHighlight()
  6541. }),
  6542. $(".next").find("a").on("click", function(e) {
  6543. l(e),
  6544. J.trackAlways("showcase_gui", {
  6545. gui_action: "next_highlight"
  6546. }),
  6547. t.nextHighlight()
  6548. }),
  6549. $("#drawer").on("mouseleave", function(e) {
  6550. l(e);
  6551. var t;
  6552. try {
  6553. t = new MouseEvent("mouseup",{
  6554. clientX: e.clientX,
  6555. clientY: e.clientY,
  6556. screenX: e.screenX,
  6557. screenY: e.screenY
  6558. })
  6559. } catch (i) {
  6560. t = document.createEvent("MouseEvents"),
  6561. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  6562. }
  6563. document.dispatchEvent(t)
  6564. }),
  6565. W = new Sly($("#scrollFrame"),{
  6566. horizontal: !0,
  6567. itemNav: "centered",
  6568. smart: !0,
  6569. scrollTrap: !0,
  6570. scrollBy: 1,
  6571. mouseDragging: !0,
  6572. touchDragging: !0,
  6573. speed: 300,
  6574. dragHandle: !0,
  6575. dynamicHandle: !0,
  6576. clickBar: !0,
  6577. scrollBar: $("#scroller"),
  6578. activateOn: null
  6579. }).init(),
  6580. W.on("active", function(e, t) {
  6581. Ve = t,
  6582. Ze("tour"),
  6583. $(".step").removeClass("active"),
  6584. $("#status").find(".curIdx").text(t + 1);
  6585. for (var i = 0; i <= t; i++)
  6586. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6587. }),
  6588. w()
  6589. }
  6590. function w() {
  6591. var e = $("#player").width() - 20
  6592. , t = $("#scroller")
  6593. , i = $("#drawer")
  6594. , n = $(".pinBottom");
  6595. if ($("#player").width() < 488 || $("#player").height() < 488)
  6596. t.addClass("hidden"),
  6597. i.addClass("noScroll"),
  6598. n.addClass("noScroll");
  6599. else {
  6600. var r = j > e
  6601. , o = !i.hasClass("noScroll")
  6602. , a = r !== o;
  6603. a && (t.toggleClass("hidden"),
  6604. i.toggleClass("noScroll"),
  6605. n.toggleClass("noScroll"))
  6606. }
  6607. }
  6608. function _(e) {
  6609. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6610. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6611. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6612. }
  6613. function T(e) {
  6614. function t(t, i) {
  6615. return !!e.player_options[t] && e[i || t]
  6616. }
  6617. $(".model-title").text(e.name);
  6618. var i = Q.pageTitle;
  6619. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6620. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6621. document.title = i ,
  6622. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6623. delay: {
  6624. show: 50,
  6625. hide: 0
  6626. },
  6627. trigger: "hover",
  6628. html: !1,
  6629. viewport: {
  6630. selector: "body",
  6631. padding: 10
  6632. }
  6633. }),
  6634. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6635. // 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"),
  6636. de.populate({
  6637. name: t("model_name", "name"),
  6638. coBrand: t("presented_by"),
  6639. description: t("model_summary", "summary") || "暂无内容",
  6640. contactName: t("contact_name"),
  6641. address: t("address"),
  6642. phone: t("contact_phone"),
  6643. formattedPhone: e.formatted_contact_phone,
  6644. email: t("contact_email"),
  6645. url: t("external_url"),
  6646. socialSharing: e.enable_social_sharing && e.is_public
  6647. })
  6648. }
  6649. function x(e, t, i, n, r, o) {
  6650. function a() {
  6651. o.setLoadingStartTime(),
  6652. H(),
  6653. r ? (re.showMessage(t, i, je.coBrand.visible),
  6654. l()) : h(l)
  6655. }
  6656. var s = $.Deferred()
  6657. , l = s.resolve.bind(s);
  6658. return Ge = !0,
  6659. O(e),
  6660. e.data.player_options && _(e.data.player_options),
  6661. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6662. Re.localizeGUI(),
  6663. T(e.data),
  6664. r || $(".quick").addClass("hidden"),
  6665. //e.data.image && !r && E(e.data.image),
  6666. n ? (J.impression(),
  6667. a()) : (o.setWaitingStartTime(),
  6668. oe.show(r, a)),
  6669. s
  6670. }
  6671. function S(e, t, i, n, r, a, s) {
  6672. q = s,
  6673. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6674. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6675. ae.init(),
  6676. re.init(e, a),
  6677. Oe.init(e, t, n),
  6678. $(".icon").on("mouseover", function() {
  6679. t.player && t.player.reticule.hide()
  6680. }),
  6681. m(e, t),
  6682. A(e, t),
  6683. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6684. Ce.on(Me.OPENED, function() {
  6685. var e = document.getElementById("share-modal");
  6686. return function() {
  6687. Ze("share"),
  6688. le.open(e)
  6689. }
  6690. }()),
  6691. Ce.on(Me.CLOSED, le.reset)),
  6692. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6693. je.tourControls.visible = !1),
  6694. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6695. z(),
  6696. g(i),
  6697. v(e, r),
  6698. e.on("floor.changed", C),
  6699. e.on("waiting", R.bind(this, e)),
  6700. e.on("waiting-done", P.bind(this, e)),
  6701. i.on(xe.ModeChanged, function(e, n) {
  6702. g(i),
  6703. o(t, i),
  6704. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6705. he.updateMode(n)
  6706. }),
  6707. n.on(Se.Move, Ze.bind(this, "move")),
  6708. i.on(xe.Ready, function() {
  6709. ie.init(n, i, i.tagManager, t),
  6710. i.on(xe.ModeChanged, function(e, t) {
  6711. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6712. })
  6713. }),
  6714. i.on(xe.PanoChosen, function(e, t) {
  6715. g(i, t),
  6716. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6717. }),
  6718. le.on(ce.CLOSE, function(e) {
  6719. switch (e) {
  6720. case "vr-modal":
  6721. Ae.dismiss();
  6722. break;
  6723. case "share-modal":
  6724. Ce.hide();
  6725. break;
  6726. case "terms-modal":
  6727. fe.hide()
  6728. }
  6729. });
  6730. var l = $("#play").eq(0)
  6731. , c = $("#pause").eq(0)
  6732. , h = $(".pinBottom").toArray()
  6733. , u = $("#drawer").eq(0)
  6734. , d = $("#playHead").eq(0)
  6735. , p = $("#progressBar").eq(0)
  6736. , f = $("#thumb-container").eq(0)
  6737. , y = f.children()
  6738. , I = p.children();
  6739. t.on("update.controls", function() {
  6740. var n = t.describe();
  6741. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6742. c.show()),
  6743. n.tourInProgress && (h.forEach(function(e) {
  6744. e.classList.add("playing")
  6745. }),
  6746. u.addClass("playing"),
  6747. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6748. c.hide()),
  6749. n.tourInProgress || (ve.stopTour(),
  6750. h.forEach(function(e) {
  6751. e.classList.remove("playing")
  6752. }),
  6753. u.removeClass("playing"),
  6754. d.removeClass("playing")));
  6755. var r, a, s;
  6756. if (null !== n.currentItem) {
  6757. var p, f;
  6758. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6759. n.onTheBus ? (p = "active",
  6760. f = "recent") : (f = "active",
  6761. p = "recent");
  6762. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6763. for (r = 0; r < e.heroLocations.length; r += 1)
  6764. s = y.eq(r),
  6765. a = I.eq(r),
  6766. s.removeClass(f),
  6767. a.removeClass(f),
  6768. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  6769. a.addClass(p),
  6770. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  6771. a.addClass(p)) : (s.removeClass(p),
  6772. a.removeClass(p))
  6773. } else
  6774. for (r = 0; r < e.heroLocations.length; r += 1)
  6775. s = y.eq(r),
  6776. a = I.eq(r),
  6777. s.removeClass("active recent"),
  6778. a.removeClass("active recent");
  6779. o(t, i)
  6780. }),
  6781. document.addEventListener("keydown", function(n) {
  6782. switch (J.updateInteraction(Se.InteractionKey),
  6783. n.which) {
  6784. case we.ZERO:
  6785. Q.debug && e.toggleAlpha();
  6786. break;
  6787. case we.NINE:
  6788. Q.debug && se.toggle();
  6789. break;
  6790. case we.ONE:
  6791. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6792. break;
  6793. case we.TWO:
  6794. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6795. break;
  6796. case we.THREE:
  6797. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6798. break;
  6799. case we.FOUR:
  6800. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6801. break;
  6802. case we.SPACE:
  6803. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6804. break;
  6805. case we.RETURN:
  6806. Q.debug && e.toggleExplodeUp();
  6807. break;
  6808. case we.P:
  6809. k();
  6810. break;
  6811. case we.U:
  6812. B();
  6813. break;
  6814. case we.X:
  6815. Q.debug && e.toggleExplode();
  6816. break;
  6817. case we.PLUSEQUALS:
  6818. t.player.activatePersistentZooming(!0),
  6819. ie.hideUi();
  6820. break;
  6821. case we.DASHUNDERSCORE:
  6822. t.player.activatePersistentZooming(!1),
  6823. ie.hideUi();
  6824. break;
  6825. case we.SEVEN:
  6826. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6827. break;
  6828. case we.EIGHT:
  6829. t.player.decreaseZoomSpeed();
  6830. break;
  6831. case we.NINE:
  6832. t.player.increaseZoomSpeed()
  6833. }
  6834. return i && i.reticule.hide(),
  6835. !0
  6836. }
  6837. .bind(this)),
  6838. document.addEventListener("keyup", function(e) {
  6839. switch (e.which) {
  6840. case we.PLUSEQUALS:
  6841. t.player.deactivatePersistentZooming();
  6842. break;
  6843. case we.DASHUNDERSCORE:
  6844. t.player.deactivatePersistentZooming()
  6845. }
  6846. }
  6847. .bind(this)),
  6848. F(e),
  6849. L(e, t.player),
  6850. M(i),
  6851. te.setAutoPlay(e.heroCount()),
  6852. he.init(i, a.mode),
  6853. he.on(ue.OPENED, Ze.bind(this, "help")),
  6854. fe.init(),
  6855. fe.on(ge.OPENED, function() {
  6856. var e = document.getElementById("terms-modal");
  6857. return function() {
  6858. Ze("terms"),
  6859. le.open(e)
  6860. }
  6861. }()),
  6862. fe.on(ge.CLOSED, le.reset),
  6863. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6864. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6865. Q.profiling.enabled && se.show(),
  6866. ve.init(t)
  6867. }
  6868. function M(e) {
  6869. var t = function(e, t) {
  6870. $(e).find("a").each(function(e, i) {
  6871. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6872. i.style.pointerEvents = t ? "auto" : "none"
  6873. })
  6874. }
  6875. , i = function() {
  6876. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6877. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6878. };
  6879. e.on(Ne.ZoomMax, function() {
  6880. t("#gui-zoomin", !1),
  6881. t("#gui-zoomout", !0)
  6882. }),
  6883. e.on(Ne.ZoomMin, function() {
  6884. t("#gui-zoomin", !0),
  6885. t("#gui-zoomout", !1)
  6886. }),
  6887. e.on(Ne.ZoomIn, function() {
  6888. t("#gui-zoomout", !0)
  6889. }),
  6890. e.on(Ne.ZoomOut, function() {
  6891. t("#gui-zoomin", !0)
  6892. }),
  6893. i()
  6894. }
  6895. function R(e) {
  6896. O(e)
  6897. }
  6898. function P(e) {
  6899. O(e)
  6900. }
  6901. function O(e) {
  6902. var t = e.waitQueue.length;
  6903. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6904. }
  6905. function L(e, t) {
  6906. He = {
  6907. gui: null,
  6908. visible: !1,
  6909. model: e,
  6910. player: t
  6911. }
  6912. }
  6913. function D(e, t) {
  6914. function i() {
  6915. var i = t.toJSON();
  6916. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6917. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6918. }
  6919. var n = {}
  6920. , r = new Le.GUI({
  6921. autoPlace: !0,
  6922. width: "60%"
  6923. });
  6924. i(),
  6925. t.on(xe.ViewChanged, i),
  6926. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6927. r.domElement.id = "datLinks";
  6928. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6929. return o.forEach(function(e) {
  6930. if (!K.detectSafari()) {
  6931. var t = document.createElement("button");
  6932. t.classList.add("btn-deep-link"),
  6933. t.innerText = Re.MENU_COPY,
  6934. e.nextSibling.appendChild(t);
  6935. var i = function() {
  6936. alert(Re.LINK_ALERT_COPY),
  6937. t.hide()
  6938. };
  6939. t.addEventListener("click", function(e) {
  6940. try {
  6941. var t = e.target.parentNode.childNodes[0];
  6942. t.select();
  6943. var n = document.execCommand("copy");
  6944. t.blur(),
  6945. n || i()
  6946. } catch (e) {
  6947. i()
  6948. }
  6949. })
  6950. }
  6951. }),
  6952. $(r.__closeButton).hide(),
  6953. r
  6954. }
  6955. function N(e) {
  6956. He.gui || (He.gui = D(He.model, He.player)),
  6957. He.visible = e,
  6958. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6959. }
  6960. function B() {
  6961. N(!He.visible)
  6962. }
  6963. function F(e) {
  6964. ke = {
  6965. gui: null,
  6966. visible: !1,
  6967. model: e
  6968. }
  6969. }
  6970. function V(e) {
  6971. var t = new Le.GUI;
  6972. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6973. e.setSweepVisibility(Q.showSweeps)
  6974. }),
  6975. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6976. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6977. Q.transition.flySpeed = 0,
  6978. t.__controllers.forEach(function(e) {
  6979. e.updateDisplay()
  6980. })
  6981. }),
  6982. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6983. $(t.__closeButton).hide(),
  6984. t
  6985. }
  6986. function U(e) {
  6987. ke.gui || (ke.gui = V(ke.model)),
  6988. ke.visible = e,
  6989. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6990. }
  6991. function k() {
  6992. U(!ke.visible)
  6993. }
  6994. function H() {
  6995. function e(e) {
  6996. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  6997. }
  6998. $("body").css("touch-action", "none"),
  6999. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7000. // e.preventDefault()
  7001. });
  7002. var t = document.getElementById("terms-text")
  7003. , i = document.getElementById("more-help-wrapper")
  7004. , n = (document.getElementById("navigation-help-wrapper"),
  7005. document.getElementById("help-dialog"),
  7006. document.getElementById("tag-billboards"));
  7007. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7008. document.body.addEventListener("DOMMouseScroll", e)),
  7009. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7010. e.stopPropagation()
  7011. })
  7012. }
  7013. function G(e, t) {
  7014. for (var i = []; e; )
  7015. i.push(e),
  7016. e = e.parentNode;
  7017. for (; t && i.indexOf(t) === -1; )
  7018. t = t.parentNode;
  7019. return t
  7020. }
  7021. function z() {
  7022. var e, t = function(t) {
  7023. e = 0 === t.button || 1 === t.which ? t.target : null
  7024. }, i = function(t) {
  7025. e !== t.target && (e = G(e, t.target));
  7026. var i = document.getElementById("gui-parent");
  7027. if (G(i, e) !== i && (e = null),
  7028. e) {
  7029. var n;
  7030. try {
  7031. n = new MouseEvent("click",t)
  7032. } catch (e) {
  7033. n = document.createEvent("MouseEvents"),
  7034. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  7035. }
  7036. n.syntheticClick = !0,
  7037. e.dispatchEvent(n),
  7038. e = null
  7039. }
  7040. };
  7041. document.body.addEventListener("mousedown", t, !0),
  7042. document.body.addEventListener("mouseup", i, !0),
  7043. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7044. e.syntheticClick || (e.stopPropagation(),
  7045. "A" === e.target.nodeName && e.preventDefault())
  7046. }, !0)
  7047. }
  7048. var W, j, Y, X, Z, q, K = (e("three"),
  7049. e("../util/ajax"),
  7050. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7051. e("../util/camera"),
  7052. e("../util/logger")), te = (e("../objects/Snapshot"),
  7053. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  7054. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7055. e("../enum/PathDisplayMode"),
  7056. e("../enum/DirectorEvents"),
  7057. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7058. e("../enum/WarpStyle"),
  7059. e("../enum/AlignmentType"),
  7060. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7061. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7062. coBrand: {
  7063. visible: !0,
  7064. elements: [".co-brand", "#loaderCoBrand"]
  7065. },
  7066. help: {
  7067. visible: !0,
  7068. elements: [".nav-help", "#nav-help"]
  7069. },
  7070. tourControls: {
  7071. visible: !0,
  7072. elements: [".next", ".previous", "#play"]
  7073. },
  7074. highlight: {
  7075. visible: !0,
  7076. elements: ["#drawer", "#pullTab"]
  7077. },
  7078. share: {
  7079. visible: !0,
  7080. elements: [".socialButton", "#share"]
  7081. },
  7082. fullScreen: {
  7083. visible: !0,
  7084. elements: ["#gui-fullscreen"]
  7085. },
  7086. floors: {
  7087. visible: !0,
  7088. elements: [".gui-floor"]
  7089. }
  7090. }, Ye = function() {
  7091. var e = document.getElementById("drawer");
  7092. return function() {
  7093. $("#player").height() < 400 && e.classList.contains("open") && a()
  7094. }
  7095. }(), Xe = function() {
  7096. var e = document.getElementById("meta-info");
  7097. return function() {
  7098. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7099. }
  7100. }(), Ze = function(e) {
  7101. function t() {
  7102. u.classList.contains("expand") && de.toggleMeta(!0)
  7103. }
  7104. function i() {
  7105. fe.hide()
  7106. }
  7107. function n() {
  7108. he.close()
  7109. }
  7110. function r() {
  7111. Ae.dismiss()
  7112. }
  7113. function o() {
  7114. p.hasClass("open") && a(!0)
  7115. }
  7116. function l() {
  7117. Ce.hide()
  7118. }
  7119. function c() {
  7120. f.hasClass("open") && f.removeClass("open")
  7121. }
  7122. function h() {
  7123. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7124. }
  7125. var u = document.getElementById("meta-info")
  7126. , d = document.getElementById("interaction-modal")
  7127. , p = $("#drawer").eq(0)
  7128. , f = $(".gui-floor").eq(0)
  7129. , g = $(".vr-popup").eq(0);
  7130. return function(e) {
  7131. switch (e) {
  7132. case "info":
  7133. i(),
  7134. n(),
  7135. Ye(),
  7136. l(),
  7137. c(),
  7138. r(),
  7139. h();
  7140. break;
  7141. case "terms":
  7142. t(),
  7143. n(),
  7144. o(),
  7145. l(),
  7146. c(),
  7147. r(),
  7148. h();
  7149. break;
  7150. case "help":
  7151. t(),
  7152. i(),
  7153. l(),
  7154. c(),
  7155. r(),
  7156. h();
  7157. break;
  7158. case "vr":
  7159. t(),
  7160. i(),
  7161. l(),
  7162. c(),
  7163. n(),
  7164. h(),
  7165. s(g) && o();
  7166. break;
  7167. case "highlights":
  7168. Xe(),
  7169. i(),
  7170. l(),
  7171. c();
  7172. break;
  7173. case "share":
  7174. t(),
  7175. i(),
  7176. n(),
  7177. c(),
  7178. r(),
  7179. h();
  7180. break;
  7181. case "floor":
  7182. i(),
  7183. l(),
  7184. r();
  7185. break;
  7186. case "view":
  7187. c(),
  7188. l(),
  7189. i(),
  7190. r();
  7191. break;
  7192. case "tour":
  7193. i(),
  7194. l(),
  7195. c(),
  7196. r();
  7197. break;
  7198. case "move":
  7199. i(),
  7200. l(),
  7201. c(),
  7202. r();
  7203. break;
  7204. case "resize":
  7205. t(),
  7206. Ye(),
  7207. c();
  7208. break;
  7209. case "tag":
  7210. i(),
  7211. n(),
  7212. l(),
  7213. c(),
  7214. r()
  7215. }
  7216. }
  7217. }();
  7218. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7219. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7220. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7221. setTimeout(function() {
  7222. $(".icon:visible").hide().show(0)
  7223. }, 100)
  7224. }),
  7225. $("#gui-fullscreen").find("a").on("click", function(e) {
  7226. l(e),
  7227. K.requestFullscreen($("body")[0]),
  7228. J.track("showcase_gui", {
  7229. gui_action: "click_enter_fullscreen",
  7230. interaction_source: "gui"
  7231. })
  7232. //czj
  7233. //W.reload()
  7234. }),
  7235. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7236. l(e),
  7237. K.exitFullscreen(),
  7238. J.track("showcase_gui", {
  7239. gui_action: "click_exit_fullscreen",
  7240. interaction_source: "gui"
  7241. })
  7242. })
  7243. $(window).on("resize", function(e) {
  7244. var t = e.target.innerHeight
  7245. , i = e.target.innerWidth;
  7246. t === X && i === Z || (je.highlight.visible && w(),
  7247. Ze("resize"),
  7248. $(".pinTop.right").removeClass("hideUnderMeta"),
  7249. c(),
  7250. X = t,
  7251. Z = i)
  7252. }).resize(),
  7253. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7254. $("#pullTab").on("click", function(e) {
  7255. l(e),
  7256. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7257. gui_action: "hide_highlight_reel"
  7258. }),
  7259. $(this).addClass("open").children("img").attr("src","static/images/auto.png")) : (J.trackAlways("showcase_gui", {
  7260. gui_action: "show_highlight_reel"
  7261. }),
  7262. $(this).removeClass("open").children("img").attr("src","static/images/auto-suspend.png"));
  7263. a()
  7264. });
  7265. /***********************方奕卓 热点列表事件监听 ************************/
  7266. if(window.DATA.showHotListSta) {
  7267. $('#hotList').css('display', '');
  7268. $('#hotList').on('click',function(e){
  7269. l(e);
  7270. var hotList = $('#hotListWrap')[0];
  7271. var isActive = hotList.classList.contains('hotListActive');
  7272. if(isActive){
  7273. hotList.classList.remove('hotListActive');
  7274. this.classList.remove('active')
  7275. }else{
  7276. hotList.classList.add('hotListActive');
  7277. this.classList.add('active')
  7278. }
  7279. }),
  7280. $('#hotListContent ul').on('mouseover', function(e){
  7281. if(browser.isMobile()) return
  7282. l(e);
  7283. var target = e.target;
  7284. var hotList = document.getElementById('hotListWrap');
  7285. if(target.tagName === 'SPAN'){
  7286. var targetParent = target.parentElement.parentElement;
  7287. if(target.offsetWidth + 150 >= targetParent.clientWidth){
  7288. hotList.style.width = target.offsetWidth + 150 + 'px';
  7289. }else{
  7290. hotList.style.width = '';
  7291. }
  7292. }else if(target.tagName === 'LI'){
  7293. var targetParent = target.parentElement;
  7294. if(target.children[0].offsetWidth + 150 >= targetParent.clientWidth){
  7295. hotList.style.width = target.children[0].offsetWidth + 150 + 'px';
  7296. }else{
  7297. hotList.style.width = ''
  7298. }
  7299. }else {
  7300. hotList.style.width = '';
  7301. }
  7302. });
  7303. $('#hotListContent ul').on('click', function(e){
  7304. l(e);
  7305. this.preElem && this.preElem.classList.remove('active');
  7306. if(e.target.tagName === 'SPAN'){
  7307. e.stopPropagation();//阻止事件冒泡即可
  7308. e.target.parentElement.classList.add('active');
  7309. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7310. this.preElem = e.target.parentElement;
  7311. }else{
  7312. e.target.classList.add('active');
  7313. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7314. this.preElem = e.target;
  7315. }
  7316. })
  7317. $('#hotListClose').on('click', function(e){
  7318. l(e);
  7319. var hotList = $('#hotListWrap')[0];
  7320. hotList.classList.remove('hotListActive');
  7321. $('#hotListContent ul .active').removeClass('active');
  7322. $('#hotList')[0].classList.remove('active')
  7323. })
  7324. }
  7325. /*****************************************************************/
  7326. $("#more-menu-button").on("click", function(e) {
  7327. l(e);
  7328. var t = $("#more-menu");
  7329. t.toggleClass("open")
  7330. }),
  7331. t.exports.init = S,
  7332. t.exports.startLoading = x,
  7333. t.exports.endLoading = d,
  7334. t.exports.onProgress = u
  7335. }
  7336. ).call(this, "/js/gui/gui.js")
  7337. }
  7338. , {
  7339. "../analytics": 4,
  7340. "../controls/serializer": 14,
  7341. "../enum/AlignmentType": 17,
  7342. "../enum/BlackoutStyle": 18,
  7343. "../enum/ControlEvents": 21,
  7344. "../enum/DirectorEvents": 23,
  7345. "../enum/Keys": 30,
  7346. "../enum/PathDiscardMode": 38,
  7347. "../enum/PathDisplayMode": 39,
  7348. "../enum/PlayerEvents": 40,
  7349. "../enum/VROption": 47,
  7350. "../enum/Vectors": 50,
  7351. "../enum/Viewmode": 51,
  7352. "../enum/WarpStyle": 52,
  7353. "../enum/ZoomEvents": 53,
  7354. "../lib/dat.gui": 93,
  7355. "../localization/localize": 108,
  7356. "../tag/Media/MediaEvent": 131,
  7357. "../objects/Snapshot": 153,
  7358. "../settings": 166,
  7359. "../util/ajax": 181,
  7360. "../util/browser": 182,
  7361. "../util/camera": 183,
  7362. "../util/logger": 189,
  7363. "../util/showcase": 193,
  7364. "../util/transitions": 195,
  7365. "./closer/ModalCloserEvent": 61,
  7366. "./closer/modalCloser": 62,
  7367. "./help/HelpEvent": 66,
  7368. "./help/help": 67,
  7369. "./helpManager": 68,
  7370. "./immersiveMode": 69,
  7371. "./konami": 70,
  7372. "./landingScreen": 71,
  7373. "./loadingScreen": 72,
  7374. "./memoryUsage": 73,
  7375. "./playButton": 74,
  7376. "./populateModal": 75,
  7377. "./sharing/ShareEvents": 76,
  7378. "./sharing/modal": 77,
  7379. "./terms/TermsEvent": 78,
  7380. "./terms/terms": 79,
  7381. "./title/TitleEvents": 80,
  7382. "./title/tagToggle": 81,
  7383. "./title/titleBar": 82,
  7384. "./tourInteraction": 84,
  7385. "./vr/vrEvent": 85,
  7386. "./vr/vrModal": 87,
  7387. "./webvr/WebVrEvent": 88,
  7388. "./webvr/webVRgui": 89,
  7389. three: 217
  7390. }],
  7391. 66: [function(e, t, i) {
  7392. "use strict";
  7393. t.exports = Object.freeze({
  7394. OPENED: "help.opened",
  7395. CLOSED: "help.closed"
  7396. })
  7397. }
  7398. , {}],
  7399. 67: [function(e, t, i) {
  7400. "use strict";
  7401. function n() {
  7402. g.on("click", function(e) {
  7403. if (S && S !== l.TRANSITIONING) {
  7404. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7405. t && !M ? R.close() : r()
  7406. }
  7407. }),
  7408. w.on("click", function(e) {
  7409. R.close()
  7410. }),
  7411. E.on("click", function(e) {
  7412. S && S !== l.TRANSITIONING && (s(),
  7413. o())
  7414. }),
  7415. b.on("click", function(e) {
  7416. s(),
  7417. a()
  7418. })
  7419. }
  7420. function r() {
  7421. S && S !== l.TRANSITIONING && (M = !0,
  7422. setTimeout(function() {
  7423. M = !1
  7424. }, d.help.modalStayDuration),
  7425. R.emit(h.OPENED),
  7426. m.addClass("open " + S),
  7427. g.addClass("open"),
  7428. s(),
  7429. o(),
  7430. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7431. y.classList.add("fadeIn"))
  7432. }
  7433. function o() {
  7434. E.addClass("underline-tab"),
  7435. u.fill(_, c.NAVIGATION, S),
  7436. m.addClass(S)
  7437. }
  7438. function a() {
  7439. b.addClass("underline-tab"),
  7440. u.fill(T, c.MORE_HELP),
  7441. m.addClass("more-help")
  7442. }
  7443. function s(e, t) {
  7444. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7445. I.forEach(function(e) {
  7446. e.classList.remove("underline-tab")
  7447. })
  7448. }
  7449. var l = e("../../enum/Viewmode")
  7450. , c = e("../../enum/HelpModalType")
  7451. , h = e("./HelpEvent")
  7452. , u = (e("../helpManager"),
  7453. e("./../populateModal"))
  7454. , d = e("../../settings")
  7455. , p = e("../../util/common")
  7456. , f = e("events").EventEmitter
  7457. , g = $(".footer-help").eq(0)
  7458. , m = $("#help-dialog").eq(0)
  7459. , v = document.querySelector("#quick-logo")
  7460. , A = document.querySelector("#loaderCoBrand")
  7461. , y = document.querySelector("#help-dialog")
  7462. , C = document.querySelector(".footer")
  7463. , I = $(".help-tabs").children().toArray()
  7464. , E = $(".navigation-tab").eq(0)
  7465. , b = $(".more-help-tab").eq(0)
  7466. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7467. m.find(".close").eq(0))
  7468. , _ = m.find(".interactions").toArray()
  7469. , T = m.find(".ui-instructions").toArray()
  7470. , x = l.PANORAMA
  7471. , S = l.PANORAMA
  7472. , M = !1
  7473. , R = {
  7474. init: function(e, t) {
  7475. S = t,
  7476. x = t,
  7477. [y, A, v, C].forEach(function(e) {
  7478. e.classList.add(u.deviceType)
  7479. }),
  7480. n()
  7481. },
  7482. close: function() {
  7483. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7484. g.removeClass("open"),
  7485. m.removeClass("open"),
  7486. y.classList.contains("fadeIn"))) {
  7487. y.classList.remove("fadeIn");
  7488. var e = S === l.TRANSITIONING ? x : S;
  7489. u.clear(_, c.NAVIGATION, e)
  7490. }
  7491. },
  7492. updateMode: function(e) {
  7493. x = S,
  7494. S = e
  7495. }
  7496. };
  7497. p.extendObject(R, f.prototype),
  7498. t.exports = R
  7499. }
  7500. , {
  7501. "../../enum/HelpModalType": 28,
  7502. "../../enum/Viewmode": 51,
  7503. "../../settings": 166,
  7504. "../../util/common": 185,
  7505. "../helpManager": 68,
  7506. "./../populateModal": 75,
  7507. "./HelpEvent": 66,
  7508. events: 202
  7509. }],
  7510. 68: [function(e, t, i) {
  7511. (function(i) {
  7512. "use strict";
  7513. var n = e("../util/browser")
  7514. , r = e("./../util/logger")
  7515. , o = e("./../settings")
  7516. , a = new r(i)
  7517. , s = function() {
  7518. var e;
  7519. try {
  7520. return e = window.localStorage.getItem("visitCount") || "0",
  7521. e = (parseFloat(e) + 1).toString(),
  7522. window.localStorage.setItem("visitCount", e),
  7523. a.debug("visitCount = " + e),
  7524. e
  7525. } catch (t) {
  7526. e = "1",
  7527. a.debug("couldn't set local storage")
  7528. }
  7529. }()
  7530. , l = !1;
  7531. t.exports = {
  7532. isHelpDisabled: function() {
  7533. return "0" === n.valueFromHash("help", null) || l
  7534. },
  7535. isLargeHelpEnabled: function() {
  7536. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7537. },
  7538. isSmallHelpEnabled: function() {
  7539. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7540. },
  7541. isHelpEnabled: function() {
  7542. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7543. },
  7544. setAutoPlay: function(e) {
  7545. l = o.warp.auto >= 0 && e > 1
  7546. }
  7547. }
  7548. }
  7549. ).call(this, "/js/gui/helpManager.js")
  7550. }
  7551. , {
  7552. "../util/browser": 182,
  7553. "./../settings": 166,
  7554. "./../util/logger": 189
  7555. }],
  7556. 69: [function(e, t, i) {
  7557. "use strict";
  7558. function n(e, t, i, n) {
  7559. F = n,
  7560. r(e, t, i, F),
  7561. o(),
  7562. N = t.mode
  7563. }
  7564. function r(e, t, i, n) {
  7565. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7566. e.controls[t].on(v.Move, a),
  7567. e.controls[t].on(v.LongTap, c)
  7568. }),
  7569. M.on("mousewheel DOMMouseScroll", a),
  7570. i.on(m.TagActivated, a),
  7571. i.on(m.TagNavigation, a),
  7572. t.on(A.FlyingEnded, s),
  7573. t.on(A.ModeChanging, function(e, t) {
  7574. B = t !== C.PANORAMA && e !== C.PANORAMA
  7575. }),
  7576. t.on(A.ModeChanged, function(e, i) {
  7577. N = t.mode,
  7578. i !== C.TRANSITIONING ? l() : a("modeChange")
  7579. }),
  7580. n.on(y.TourStart, function() {
  7581. L = !0,
  7582. a()
  7583. }),
  7584. n.on(y.TourEnd, function() {
  7585. L = !1,
  7586. l()
  7587. }),
  7588. n.on(y.ActionInterrupted, function() {
  7589. L = !1
  7590. }),
  7591. R.addEventListener("touchend", function() {
  7592. $("#pullTab").hasClass("opened") && !L && l()
  7593. }, !0)
  7594. }
  7595. function o() {
  7596. p.isMobile() ? (b.forEach(function(e) {
  7597. e.classList.add("mobile")
  7598. }),
  7599. w.click(l)) : (b.forEach(function(e) {
  7600. e.addEventListener("mouseleave", function() {
  7601. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7602. }, !0)
  7603. }),
  7604. M.mouseleave(function() {
  7605. b[0].classList.contains("detectHover") && l()
  7606. }))
  7607. }
  7608. function a(e) {
  7609. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7610. P = !0,
  7611. g.close(),
  7612. h(e),
  7613. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7614. _.hasClass("playing") || (b.forEach(function(e) {
  7615. e.classList.add("detectHover")
  7616. }),
  7617. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7618. }
  7619. function s() {
  7620. _.hasClass("playing") || (clearTimeout(O),
  7621. O = setTimeout(l, f.immersive.timeToShowAgain))
  7622. }
  7623. function l() {
  7624. clearTimeout(O),
  7625. P = !1,
  7626. I.forEach(function(e) {
  7627. e.classList.remove("drawerOpen")
  7628. }),
  7629. L || E.forEach(function(e) {
  7630. e.classList.remove("duringTour")
  7631. }),
  7632. b.forEach(function(e) {
  7633. e.classList.remove("detectHover")
  7634. })
  7635. }
  7636. function c() {
  7637. P ? l() : a(),
  7638. D = !0,
  7639. setTimeout(function() {
  7640. D = !1
  7641. }, f.immersive.uiStayDuration)
  7642. }
  7643. function h(e) {
  7644. !d(e) && L ? E.forEach(function(e) {
  7645. e.classList.remove("drawerOpen"),
  7646. e.classList.add("duringTour")
  7647. }) : _.hasClass("open") ? E.forEach(function(e) {
  7648. e.classList.remove("duringTour"),
  7649. e.classList.add("drawerOpen")
  7650. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7651. e.classList.add("fadeOut")
  7652. })
  7653. }
  7654. function u() {
  7655. T.hasClass("duringTour") || (L = !1,
  7656. a("gui"),
  7657. l())
  7658. }
  7659. function d(e) {
  7660. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7661. }
  7662. var p = e("../util/browser")
  7663. , f = e("../settings")
  7664. , g = e("./help/help")
  7665. , m = e("../enum/tagEvents")
  7666. , v = e("../enum/ControlEvents")
  7667. , A = e("../enum/PlayerEvents")
  7668. , y = e("../enum/DirectorEvents")
  7669. , A = e("../enum/PlayerEvents")
  7670. , C = e("../enum/Viewmode")
  7671. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7672. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7673. , b = $("#hover-bottom, #hover-top").toArray()
  7674. , w = ($("#pullTab").eq(0),
  7675. $("#playHead").eq(0),
  7676. $(".pinBottom-container").eq(0))
  7677. , _ = $("#drawer").eq(0)
  7678. , T = $("#drawer-container").eq(0)
  7679. , x = $("#meta-info").eq(0)
  7680. , S = $(".pinTop.left").eq(0)
  7681. , M = $("#player").eq(0)
  7682. , R = document.getElementById("pullTab")
  7683. , P = !1
  7684. , O = null
  7685. , L = !1
  7686. , D = !1
  7687. , N = null
  7688. , B = !1
  7689. , F = null;
  7690. t.exports.init = n,
  7691. t.exports.hideUi = a,
  7692. t.exports.resetDrawer = u
  7693. }
  7694. , {
  7695. "../enum/ControlEvents": 21,
  7696. "../enum/DirectorEvents": 23,
  7697. "../enum/tagEvents": 32,
  7698. "../enum/PlayerEvents": 40,
  7699. "../enum/Viewmode": 51,
  7700. "../settings": 166,
  7701. "../util/browser": 182,
  7702. "./help/help": 67
  7703. }],
  7704. 70: [function(e, t, i) {
  7705. (function(i) {
  7706. "use strict";
  7707. function n(e, t, i) {
  7708. l.debug("konami has the modelInstance");
  7709. var n = [];
  7710. $(window).on("keydown", function(e) {
  7711. n.push(e.which),
  7712. n.length > o.secretPanelWord.length && n.shift(),
  7713. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7714. o.debug = !0)
  7715. }),
  7716. $(window).on("keydown", function n(r) {
  7717. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7718. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7719. })
  7720. }
  7721. var r = e("./../util/logger")
  7722. , o = e("./../settings")
  7723. , a = e("./debug")
  7724. , s = e("./../util/common")
  7725. , l = (e("./gui"),
  7726. new r(i));
  7727. o.console && $("body").append('<div id="debug-console"></div>'),
  7728. t.exports.init = n
  7729. }
  7730. ).call(this, "/js/gui/konami.js")
  7731. }
  7732. , {
  7733. "./../settings": 166,
  7734. "./../util/common": 185,
  7735. "./../util/logger": 189,
  7736. "./debug": 63,
  7737. "./gui": 65
  7738. }],
  7739. 71: [function(e, t, i) {
  7740. "use strict";
  7741. function n(e, t) {
  7742. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7743. }
  7744. function r(e) {
  7745. var t = $.Deferred();
  7746. e || t.resolve();
  7747. var i = c.startupFlyinDelay;
  7748. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7749. setTimeout(t.resolve.bind(t), i),
  7750. t
  7751. }
  7752. function o(e, t, i) {
  7753. var n = 0;
  7754. c.quickstart.enabled && (a(i),
  7755. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7756. var r = function() {
  7757. e.once(g.Move, l),
  7758. t.once(f.TourStart, l)
  7759. };
  7760. s(n, r)
  7761. }
  7762. function a(e) {
  7763. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7764. v.before(y),
  7765. A = $(".quick-brand").toArray()),*/
  7766. m.addClass("fadeOut"),
  7767. setTimeout(function() {
  7768. A.forEach(function(e) {
  7769. e.classList.add("fadeIn")
  7770. })
  7771. }, c.quickstart.showTextDelay),
  7772. setTimeout(function() {
  7773. A.forEach(function(e) {
  7774. e.classList.add("fadeOut")
  7775. })
  7776. }, c.quickstart.fadeOutDelay),
  7777. !0
  7778. }
  7779. function s(e, t) {
  7780. setTimeout(function() {
  7781. if (h.isHelpEnabled()) {
  7782. if (t(),
  7783. u.init(),
  7784. C.addClass("fadeIn landing " + u.deviceType),
  7785. h.isSmallHelpEnabled())
  7786. return void C.addClass("small");
  7787. u.fill(I, d.LANDING[E]),
  7788. C.addClass(E)
  7789. }
  7790. }, e)
  7791. //csz 用户引导界面
  7792. var helpData = {
  7793. "pc":["static/images/pc_step1.png","static/images/pc_step2.png","static/images/pc_step3.png"],
  7794. "mobile":["static/images/phone_step1.png","static/images/phone_step2.png","static/images/phone_step3.png"]
  7795. }
  7796. var navIcon = $(".nav-icon .icon");
  7797. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7798. function paging(id){
  7799. id.on("click",function(){
  7800. var navPage = null;
  7801. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7802. if(navPage > 3 || navPage < 1) return false
  7803. console.log('123-',navPage);
  7804. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7805. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7806. }else{
  7807. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7808. }
  7809. })
  7810. };
  7811. paging($(".next-button"));
  7812. paging($(".prev-button"));
  7813. }
  7814. function l() {
  7815. u.clear(I, d.LANDING[E]),
  7816. C.removeClass("fadeIn")
  7817. }
  7818. var c = e("../settings")
  7819. , h = (e("./help/help"),
  7820. e("./helpManager"))
  7821. , u = e("./populateModal")
  7822. , d = e("../enum/HelpModalType")
  7823. , p = e("../enum/Viewmode")
  7824. , f = e("../enum/DirectorEvents")
  7825. , g = e("../enum/PlayerEvents")
  7826. , m = $("#quick-blackout").eq(0)
  7827. , v = $("#quick-logo").eq(0)
  7828. , A = $(".quick-brand").toArray()
  7829. , y = $("#loaderCoBrand").eq(0)
  7830. , C = $("#interaction-modal").eq(0)
  7831. , I = C.find(".interaction").toArray()
  7832. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7833. "");
  7834. t.exports.delayLanding = r,
  7835. t.exports.showMessage = o,
  7836. t.exports.init = n,
  7837. t.exports.dismissModal = l
  7838. }
  7839. , {
  7840. "../enum/DirectorEvents": 23,
  7841. "../enum/HelpModalType": 28,
  7842. "../enum/PlayerEvents": 40,
  7843. "../enum/Viewmode": 51,
  7844. "../settings": 166,
  7845. "./help/help": 67,
  7846. "./helpManager": 68,
  7847. "./populateModal": 75
  7848. }],
  7849. 72: [function(e, t, i) {
  7850. "use strict";
  7851. var n = e("./circleLoader").circleLoader;
  7852. t.exports = {
  7853. element: $("#gui-loading"),
  7854. hide: function(e) {
  7855. n.done(),
  7856. this.element.fadeOut(1500, e)
  7857. },
  7858. show: function(e) {
  7859. this.element.fadeIn(500, function() {
  7860. this.element.css("display", "table"),
  7861. e && e()
  7862. }
  7863. .bind(this))
  7864. },
  7865. progress: function(e) {
  7866. n.set(e)
  7867. }
  7868. }
  7869. }
  7870. , {
  7871. "./circleLoader": 60
  7872. }],
  7873. 73: [function(e, t, i) {
  7874. "use strict";
  7875. var n = e("../settings")
  7876. , r = $("#memory-info")
  7877. , o = r.find("#memory-gpu")
  7878. , a = !1;
  7879. t.exports = {
  7880. show: function() {
  7881. n.profiling.enabled && (r.show(),
  7882. a = !0)
  7883. },
  7884. hide: function() {
  7885. r.hide(),
  7886. a = !1
  7887. },
  7888. toggle: function() {
  7889. a ? this.hide() : this.show()
  7890. },
  7891. update: function(e) {
  7892. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7893. }
  7894. }
  7895. }
  7896. , {
  7897. "../settings": 166
  7898. }],
  7899. 74: [function(e, t, i) {
  7900. "use strict";
  7901. var n = e("../util/browser")
  7902. , r = e("../analytics");
  7903. e("../settings");
  7904. t.exports = {
  7905. show: function(e, t) {
  7906. $("#gui-message").fadeOut(500, function() {
  7907. t()
  7908. })
  7909. }
  7910. }
  7911. }
  7912. , {
  7913. "../analytics": 4,
  7914. "../settings": 166,
  7915. "../util/browser": 182
  7916. }],
  7917. 75: [function(e, t, i) {
  7918. "use strict";
  7919. function n(e, t, i, n) {
  7920. function r(e) {
  7921. return e.classList.contains(a)
  7922. }
  7923. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7924. //for (var a in o) {
  7925. //var s = e.find(r);
  7926. //for (var l in o[a]) {
  7927. //var c = o[a][l];
  7928. //if ("top-info" === l || "bottom-info" === l) {
  7929. //var h = n ? c : "";
  7930. //czj 注释掉第一次打开的用户引导
  7931. //s.querySelector("." + l).textContent = h
  7932. //} else {
  7933. //var u = n ? c : "";
  7934. //, d = s.querySelector("." + l);
  7935. //d.src = u,
  7936. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7937. //}
  7938. //}
  7939. //}
  7940. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7941. // p.forEach(function(e) {
  7942. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7943. // })
  7944. }
  7945. var r = e("../util/browser")
  7946. , o = e("../localization/localize")
  7947. , a = e("../enum/HelpModalType")
  7948. , s = (e("../enum/HelpModalSize"),
  7949. e("../enum/Viewmode"));
  7950. t.exports = {
  7951. init: function() {
  7952. if (!this.hasInitialized) {
  7953. this.hasInitialized = !0,
  7954. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7955. this.assets = {},
  7956. this.assets[a.LANDING[s.PANORAMA]] = {
  7957. desktop: {
  7958. left: {
  7959. "top-info": o.ROTATE,
  7960. "big-image": "static/images/nav_help_mouse_drag_left.png",
  7961. keyboard: "static/images/nav_help_keyboard_left_right.png"
  7962. },
  7963. middle: {
  7964. "top-info": o.MOVE,
  7965. "big-image": "static/images/nav_help_mouse_click.png",
  7966. keyboard: "static/images/nav_help_keyboard_up_down.png"
  7967. },
  7968. right: {
  7969. "top-info": o.ZOOM,
  7970. "big-image": "static/images/nav_help_mouse_zoom.png",
  7971. keyboard: "static/images/nav_help_zoom_keys.png"
  7972. }
  7973. },
  7974. mobile: {
  7975. left: {
  7976. "top-info": o.ROTATE,
  7977. "big-image": "static/images/nav_help_gesture_drag.png"
  7978. },
  7979. middle: {
  7980. "top-info": o.MOVE,
  7981. "big-image": "static/images/nav_help_gesture_tap.png"
  7982. },
  7983. right: {
  7984. "top-info": o.ZOOM,
  7985. "big-image": "static/images/nav_help_gesture_pinch.png"
  7986. }
  7987. }
  7988. },
  7989. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7990. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7991. desktop: {
  7992. left: {
  7993. "top-info": o.ROTATE,
  7994. "big-image": "static/images/nav_help_mouse_drag_left.png",
  7995. keyboard: "static/images/nav_help_keyboard_left_right.png"
  7996. },
  7997. middle: {
  7998. "top-info": o.MOVE,
  7999. "big-image": "static/images/nav_help_mouse_position_right.png"
  8000. }
  8001. },
  8002. mobile: {
  8003. left: {
  8004. "top-info": o.ROTATE,
  8005. "big-image": "static/images/nav_help_gesture_drag.png"
  8006. },
  8007. middle: {
  8008. "top-info": o.MOVE,
  8009. "big-image": "static/images/nav_help_gesture_position_two_finger.png"
  8010. }
  8011. }
  8012. },
  8013. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8014. desktop: {
  8015. left: {
  8016. "top-info": o.MOVE,
  8017. "big-image": "static/images/nav_help_mouse_position_left.png"
  8018. },
  8019. middle: {
  8020. "top-info": o.ROTATE,
  8021. "big-image": "static/images/nav_help_mouse_drag_right.png",
  8022. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8023. }
  8024. },
  8025. mobile: {
  8026. left: {
  8027. "top-info": o.MOVE,
  8028. "big-image": "static/images/nav_help_gesture_position.png"
  8029. },
  8030. middle: {
  8031. "top-info": o.ROTATE,
  8032. "big-image": "static/images/nav_help_gesture_drag_two_finger.png"
  8033. }
  8034. }
  8035. };
  8036. var e = {
  8037. "top-info": o.INSIDE,
  8038. "big-image": "static/images/nav_help_click_inside.png",
  8039. keyboard: "static/images/nav_help_inside_key.png"
  8040. };
  8041. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8042. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8043. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8044. var t = {
  8045. "top-info": o.INSIDE,
  8046. "big-image": "static/images/nav_help_tap_inside.png"
  8047. };
  8048. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8049. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8050. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8051. this.assets[a.NAVIGATION] = {},
  8052. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8053. desktop: {
  8054. left: {
  8055. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8056. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8057. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8058. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8059. },
  8060. middle: {
  8061. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8062. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8063. "big-image": "static/images/nav_help_mouse_click.png",
  8064. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8065. },
  8066. right: {
  8067. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8068. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8069. "big-image": "static/images/nav_help_mouse_zoom.png",
  8070. keyboard: "static/images/nav_help_zoom_keys.png"
  8071. }
  8072. },
  8073. mobile: {
  8074. left: {
  8075. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8076. "big-image": "static/images/nav_help_gesture_drag.png"
  8077. },
  8078. middle: {
  8079. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8080. "big-image": "static/images/nav_help_gesture_tap.png"
  8081. },
  8082. right: {
  8083. "top-info": o.HELP_MOBILE_3,
  8084. "big-image": "static/images/nav_help_gesture_pinch.png"
  8085. }
  8086. }
  8087. },
  8088. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8089. desktop: {
  8090. left: {
  8091. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8092. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8093. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8094. keyboard: "static/images/nav_help_keyboard_all.png"
  8095. },
  8096. middle: {
  8097. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8098. "big-image": "static/images/nav_help_mouse_position_right.png"
  8099. },
  8100. right: {
  8101. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8102. "big-image": "static/images/nav_help_mouse_zoom.png"
  8103. }
  8104. },
  8105. mobile: {
  8106. left: {
  8107. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8108. "big-image": "static/images/nav_help_gesture_drag.png"
  8109. },
  8110. middle: {
  8111. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8112. "big-image": "static/images/nav_help_gesture_position_two_finger.png"
  8113. },
  8114. right: {
  8115. "top-info": o.HELP_MOBILE_3,
  8116. "big-image": "static/images/nav_help_gesture_pinch.png"
  8117. }
  8118. }
  8119. },
  8120. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8121. desktop: {
  8122. left: {
  8123. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8124. "big-image": "static/images/nav_help_mouse_position_left.png"
  8125. },
  8126. middle: {
  8127. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8128. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8129. "big-image": "static/images/nav_help_mouse_drag_right.png",
  8130. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8131. },
  8132. right: {
  8133. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8134. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8135. "big-image": "static/images/nav_help_mouse_zoom.png",
  8136. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8137. }
  8138. },
  8139. mobile: {
  8140. left: {
  8141. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8142. "big-image": "static/images/nav_help_gesture_position.png"
  8143. },
  8144. middle: {
  8145. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8146. "big-image": "static/images/nav_help_gesture_drag_two_finger.png"
  8147. },
  8148. right: {
  8149. "top-info": o.HELP_MOBILE_3,
  8150. "big-image": "static/images/nav_help_gesture_pinch.png"
  8151. }
  8152. }
  8153. },
  8154. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8155. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8156. "top-info": o.HELP_DESKTOP_360_2A,
  8157. "bottom-info": o.HELP_DESKTOP_360_2B,
  8158. "big-image": "static/images/nav_help_click_inside.png",
  8159. keyboard: "static/images/nav_help_inside_key.png"
  8160. },
  8161. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8162. "top-info": o.HELP_MOBILE_360_2,
  8163. "big-image": "static/images/nav_help_tap_inside.png"
  8164. },
  8165. this.assets[a.MORE_HELP] = {
  8166. desktop: {
  8167. "more-help-hlr": {
  8168. "top-info": o.HELP_MORE_HLR_A,
  8169. "big-image": "static/images/nav_help_expand.svg",
  8170. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8171. },
  8172. "more-help-dollhouse": {
  8173. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8174. "big-image": "static/images/nav_help_dollhouse.svg",
  8175. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8176. },
  8177. "more-help-floors": {
  8178. "top-info": o.HELP_MORE_FLOORS_A,
  8179. "big-image": "static/images/nav_help_floor picker.svg",
  8180. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8181. },
  8182. "more-help-tag": {
  8183. "top-info": o.HELP_MORE_TAG_A,
  8184. "big-image": "static/images/nav_help_tag.svg",
  8185. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8186. },
  8187. "more-help-zoom": {
  8188. "top-info": o.HELP_MORE_ZOOM_A,
  8189. "big-image": "static/images/nav_help_zoom.svg",
  8190. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8191. },
  8192. "more-help-tour": {
  8193. "top-info": o.HELP_MORE_TOUR_A,
  8194. "big-image": "static/images/nav_help_play.png",
  8195. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8196. },
  8197. "more-help-inside": {
  8198. "top-info": o.HELP_MORE_INSIDE_A,
  8199. "big-image": "static/images/nav_help_inside.svg",
  8200. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8201. },
  8202. "more-help-vr": {
  8203. "top-info": o.HELP_MORE_VR_A,
  8204. "big-image": "static/images/nav_help_vr.svg",
  8205. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8206. },
  8207. "more-help-360": {
  8208. "top-info": o.HELP_MORE_360_A,
  8209. "big-image": "static/images/nav_help_360.svg",
  8210. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8211. },
  8212. "more-help-fullscreen": {
  8213. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8214. "big-image": "static/images/nav_help_fullscreen.svg",
  8215. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8216. }
  8217. },
  8218. mobile: {
  8219. "more-help-hlr": {
  8220. "top-info": o.HELP_MORE_HLR_A,
  8221. "big-image": "static/images/nav_help_expand.svg",
  8222. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8223. },
  8224. "more-help-dollhouse": {
  8225. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8226. "big-image": "static/images/nav_help_dollhouse.svg",
  8227. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8228. },
  8229. "more-help-floors": {
  8230. "top-info": o.HELP_MORE_FLOORS_A,
  8231. "big-image": "static/images/nav_help_floor picker.svg",
  8232. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8233. },
  8234. "more-help-tag": {
  8235. "top-info": o.HELP_MORE_TAG_A,
  8236. "big-image": "static/images/nav_help_tag.svg",
  8237. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8238. },
  8239. "more-help-tour": {
  8240. "top-info": o.HELP_MORE_TOUR_A,
  8241. "big-image": "static/images/nav_help_play.png",
  8242. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8243. },
  8244. "more-help-inside": {
  8245. "top-info": o.HELP_MORE_INSIDE_A,
  8246. "big-image": "static/images/nav_help_inside.svg",
  8247. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8248. },
  8249. "more-help-vr": {
  8250. "top-info": o.HELP_MORE_VR_A,
  8251. "big-image": "static/images/webvr.svg",
  8252. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8253. },
  8254. "more-help-360": {
  8255. "top-info": o.HELP_MORE_360_A,
  8256. "big-image": "static/images/nav_help_360.svg",
  8257. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8258. }
  8259. }
  8260. },
  8261. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8262. desktop: {
  8263. left: {
  8264. "top-info": o.ROTATE,
  8265. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8266. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8267. },
  8268. middle: {
  8269. "top-info": o.MOVE,
  8270. "big-image": "static/images/nav_help_mouse_click.png",
  8271. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8272. },
  8273. right: {
  8274. "top-info": o.PLAY,
  8275. "big-image": "static/images/Desktop-help-play-button.svg",
  8276. keyboard: "static/images/Desktop-help-spacebar-2.svg"
  8277. }
  8278. },
  8279. mobile: {
  8280. left: {
  8281. "top-info": o.ROTATE,
  8282. "big-image": "static/images/nav_help_gesture_drag.png"
  8283. },
  8284. middle: {
  8285. "top-info": o.MOVE,
  8286. "big-image": "static/images/nav_help_gesture_tap.png"
  8287. },
  8288. right: {
  8289. "top-info": o.PLAY,
  8290. "big-image": "static/images/mobile-help-play-button.svg"
  8291. }
  8292. }
  8293. },
  8294. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8295. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8296. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8297. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8298. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8299. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8300. }
  8301. },
  8302. fill: function(e, t, i) {
  8303. n.call(this, e, t, i, !0)
  8304. },
  8305. clear: function(e, t, i) {
  8306. n.call(this, e, t, i, !1)
  8307. }
  8308. }
  8309. }
  8310. , {
  8311. "../enum/HelpModalSize": 27,
  8312. "../enum/HelpModalType": 28,
  8313. "../enum/Viewmode": 51,
  8314. "../localization/localize": 108,
  8315. "../util/browser": 182
  8316. }],
  8317. 76: [function(e, t, i) {
  8318. "use strict";
  8319. t.exports = Object.freeze({
  8320. OPENED: "share.open",
  8321. CLOSED: "share.closed",
  8322. LINK_CLICKED: "share.linked"
  8323. })
  8324. }
  8325. , {}],
  8326. 77: [function(e, t, i) {
  8327. "use strict";
  8328. function n(e) {
  8329. function t(t, i) {
  8330. var n = window.screenY + ($("#player").height() - i) / 2
  8331. , r = window.screenX + ($("#player").width() - t) / 2
  8332. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8333. I.emit(l.LINK_CLICKED, {
  8334. channel: e
  8335. }),
  8336. window.open(C[e], "shareWindow", o)
  8337. }
  8338. switch (e) {
  8339. case y.FACEBOOK:
  8340. t(580, 420);
  8341. break;
  8342. case y.TWITTER:
  8343. t(550, 440);
  8344. break;
  8345. case y.MAIL:
  8346. I.emit(l.LINK_CLICKED, {
  8347. channel: "email"
  8348. }),
  8349. window.open(C[e], "_blank");
  8350. break;
  8351. case y.LINKEDIN:
  8352. }
  8353. }
  8354. function r(e) {
  8355. I.emit(l.LINK_CLICKED, {
  8356. channel: "copylink"
  8357. });
  8358. var t = document.createRange();
  8359. t.selectNodeContents(v);
  8360. var i = window.getSelection();
  8361. i.removeAllRanges(),
  8362. i.addRange(t),
  8363. document.execCommand("copy"),
  8364. A.classList.remove("hidden"),
  8365. v.classList.add("highlighted")
  8366. }
  8367. function o(e) {
  8368. e && (e.stopPropagation(),
  8369. e.target === v) || (window.getSelection().removeAllRanges(),
  8370. v.classList.remove("highlighted"),
  8371. A.classList.add("hidden"))
  8372. }
  8373. var a = e("../../util/browser")
  8374. , s = e("../../localization/localize")
  8375. , l = e("./ShareEvents")
  8376. , c = e("../../util/common")
  8377. , h = e("events").EventEmitter
  8378. , u = document.getElementById("sharing")
  8379. , d = document.getElementById("share-modal")
  8380. , p = document.getElementById("share-close")
  8381. , f = document.getElementById("facebook-share")
  8382. , g = document.getElementById("twitter-share")
  8383. , m = document.getElementById("mail-share")
  8384. , v = document.getElementById("share-url-text")
  8385. , A = document.getElementById("copy-success")
  8386. , y = Object.freeze({
  8387. FACEBOOK: "facebook",
  8388. TWITTER: "twitter",
  8389. MAIL: "mail",
  8390. LINKEDIN: "linkedin"
  8391. })
  8392. , C = {};
  8393. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8394. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8395. C[y.MAIL] = "mailto:?subject=";
  8396. var I = {
  8397. init: function(e) {
  8398. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8399. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8400. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8401. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8402. u.addEventListener("click", this.toggle.bind(this)),
  8403. p.addEventListener("click", this.hide.bind(this)),
  8404. v.addEventListener("click", r),
  8405. d.addEventListener("click", o),
  8406. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8407. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8408. m.addEventListener("click", n.bind(this, y.MAIL)),
  8409. v.textContent = window.location.href + "&utm_source=4",
  8410. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8411. u.classList.remove("hidden")
  8412. },
  8413. show: function() {
  8414. this.emit(l.OPENED),
  8415. d.classList.add("fadeIn")
  8416. },
  8417. hide: function() {
  8418. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8419. document.selection && document.selection.empty(),
  8420. window.getSelection().removeAllRanges(),
  8421. o(),
  8422. d.classList.remove("fadeIn"))
  8423. },
  8424. toggle: function() {
  8425. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8426. }
  8427. };
  8428. c.extendObject(I, h.prototype),
  8429. t.exports = I
  8430. }
  8431. , {
  8432. "../../localization/localize": 108,
  8433. "../../util/browser": 182,
  8434. "../../util/common": 185,
  8435. "./ShareEvents": 76,
  8436. events: 202
  8437. }],
  8438. 78: [function(e, t, i) {
  8439. "use strict";
  8440. t.exports = Object.freeze({
  8441. OPENED: "terms.opened",
  8442. CLOSED: "terms.closed"
  8443. })
  8444. }
  8445. , {}],
  8446. 79: [function(e, t, i) {
  8447. "use strict";
  8448. var n = e("./TermsEvent")
  8449. , r = e("../../localization/localize")
  8450. , o = e("../../analytics")
  8451. , a = e("../../util/ajax")
  8452. , s = e("../../util/common")
  8453. , l = e("events").EventEmitter
  8454. , c = document.getElementById("terms-modal")
  8455. , h = {
  8456. init: function() {
  8457. $(".footer-terms").on("click", function(e) {
  8458. e.preventDefault(),
  8459. this.show()
  8460. }
  8461. .bind(this)),
  8462. $("#terms-modal .close").on("click", this.hide.bind(this))
  8463. },
  8464. show: function() {
  8465. this.emit(n.OPENED),
  8466. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8467. var t = $("#terms-text").html(e);
  8468. o.track("showcase_gui", {
  8469. gui_action: "click_terms_button",
  8470. interaction_source: "gui"
  8471. }),
  8472. t.find("a").attr("target", "_blank")
  8473. }).fail(function() {
  8474. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8475. }),
  8476. c.classList.add("fadeIn")
  8477. },
  8478. hide: function(e) {
  8479. e && e.preventDefault(),
  8480. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8481. c.classList.remove("fadeIn")
  8482. }
  8483. };
  8484. s.extendObject(h, l.prototype),
  8485. t.exports = h
  8486. }
  8487. , {
  8488. "../../analytics": 4,
  8489. "../../localization/localize": 108,
  8490. "../../util/ajax": 181,
  8491. "../../util/common": 185,
  8492. "./TermsEvent": 78,
  8493. events: 202
  8494. }],
  8495. 80: [function(e, t, i) {
  8496. "use strict";
  8497. t.exports = Object.freeze({
  8498. OPEN_INFO: "title.open.info",
  8499. CLOSE_INFO: "title.close.info",
  8500. SHOW_INFO: "title.show.info",
  8501. HIDE_INFO: "title.hide.info",
  8502. LINK_CLICKED: "title.link.click",
  8503. CONTACT_LINK_CLICKED: "title.contact.click",
  8504. ORIGIN_LINK_CLICKED: "title.origin.click"
  8505. })
  8506. }
  8507. , {}],
  8508. 81: [function(e, t, i) {
  8509. "use strict";
  8510. function n(e, t) {
  8511. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8512. }
  8513. function r(e, t) {
  8514. function i(i) {
  8515. e.shouldShowtags = "show" === this.value,
  8516. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8517. }
  8518. document.getElementById("tag-toggles").classList.remove("hidden"),
  8519. document.getElementById("radio-tag-show").checked = !0;
  8520. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8521. n[r].addEventListener("change", i)
  8522. }
  8523. var o = e("../../settings");
  8524. t.exports.init = n
  8525. }
  8526. , {
  8527. "../../settings": 166
  8528. }],
  8529. 82: [function(e, t, i) {
  8530. (function(i) {
  8531. "use strict";
  8532. function n(e, t) {
  8533. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8534. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8535. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8536. document.getElementById("gui-name").classList.add("noCoBrand"),
  8537. document.getElementById("cobrandTitle").classList.add("hidden")),
  8538. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8539. !1)
  8540. }
  8541. function r(e) {
  8542. return e ? (L = !0,
  8543. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8544. }
  8545. function o(e, t, i, n) {
  8546. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8547. return void T.classList.add("hidden");
  8548. L = !0;
  8549. var r = []
  8550. , o = c(r, "<br>");
  8551. if (e && o('<span id="contactName">' + e + "</span>"),
  8552. t) {
  8553. var a = n || t
  8554. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8555. o(s)
  8556. }
  8557. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8558. r[0] = "",
  8559. x.innerHTML = r.join("")
  8560. }
  8561. function a(e) {
  8562. if ("string" == typeof e)
  8563. try {
  8564. e = JSON.parse(e)
  8565. } catch (e) {
  8566. return y.warn("Unable to parse address data"),
  8567. void S.parentElement.classList.add("hidden")
  8568. }
  8569. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8570. return void S.parentElement.classList.add("hidden");
  8571. L = !0;
  8572. var t = []
  8573. , i = c(t, " ");
  8574. e.address_1 && i(e.address_1),
  8575. e.address_2 && i(e.address_2),
  8576. e.city && i(e.city, ", "),
  8577. e.state && i(e.state, ", "),
  8578. e.zip && i(e.zip, e.state ? " " : ", "),
  8579. t[0] = "",
  8580. S.innerText = t.join("")
  8581. }
  8582. function s(e) {
  8583. var t = document.createElement("a");
  8584. return t.id = "url",
  8585. t.target = "_blank",
  8586. t.href = e,
  8587. t.innerText = e,
  8588. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8589. t
  8590. }
  8591. function l(e) {
  8592. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8593. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8594. P.appendChild(s(e)),
  8595. O.forEach(function(e) {
  8596. e.classList.add("share-link")
  8597. }),
  8598. !0)
  8599. }
  8600. function c(e, t) {
  8601. var i = e
  8602. , n = t;
  8603. return function(e, t) {
  8604. i.push(t || n, e)
  8605. }
  8606. }
  8607. function h() {
  8608. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8609. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8610. var e = [].slice.call(_.querySelectorAll("a"));
  8611. e.forEach(function(e) {
  8612. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8613. });
  8614. var t = [].slice.call(T.querySelectorAll("a"));
  8615. t.forEach(function(e) {
  8616. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8617. contact_type: e.getAttribute("id")
  8618. }))
  8619. })
  8620. }
  8621. var u = e("../../util/browser")
  8622. , d = e("../../util/common")
  8623. , p = e("../../util/logger")
  8624. , f = e("../../localization/localize")
  8625. , g = e("./titleBarSettings")
  8626. , m = e("../../settings")
  8627. , v = e("./TitleEvents")
  8628. , A = e("events").EventEmitter
  8629. , y = new p(i)
  8630. , C = document.querySelector(".pinTop.left")
  8631. , I = document.getElementsByClassName("title-container")[0]
  8632. , E = document.getElementById("title-toggle").querySelector("i")
  8633. , b = document.getElementById("meta-info-wrapper")
  8634. , w = document.getElementById("meta-info")
  8635. , _ = document.getElementById("meta-description")
  8636. , T = document.getElementsByClassName("contact-info")[0]
  8637. , x = document.getElementById("contact-data")
  8638. , S = document.getElementById("addressTxt")
  8639. , M = document.getElementById("tag-toggles")
  8640. , R = document.getElementById("share-origin")
  8641. , P = document.getElementById("share-link-wrapper")
  8642. , O = [w, b, I]
  8643. , L = !1
  8644. , D = !1
  8645. , N = {
  8646. populate: function(e) {
  8647. if (n(window.DATA.name, e.coBrand)) {
  8648. if (r(e.description),
  8649. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8650. a(e.address),
  8651. L) {
  8652. var t = document.createElement("br");
  8653. M.insertBefore(t, M.firstElementChild)
  8654. }
  8655. e.socialSharing && m.share.enabled && (D = l(e.url))
  8656. }
  8657. },
  8658. finishSetup: function(e) {
  8659. L = L || !!e,
  8660. h(),
  8661. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8662. },
  8663. toggleMeta: function(e, t) {
  8664. var title = document.getElementById("model-title");
  8665. t && t.preventDefault();
  8666. var i = w.classList.contains("expand");
  8667. e && !i || (i ? (O.forEach(function(e) {
  8668. e.classList.remove("expand")
  8669. }),
  8670. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8671. e.classList.add("expand");
  8672. }),
  8673. title.classList.add("expand"),
  8674. this.emit(v.OPEN_INFO)))
  8675. },
  8676. setupToggling: function() {
  8677. b.style.height = w.offsetHeight + "px",
  8678. w.addEventListener("transitionend", function() {
  8679. b.style.height = w.offsetHeight + "px"
  8680. })
  8681. },
  8682. toggleTitle: function(e) {
  8683. e && e.preventDefault(),
  8684. C.classList.contains("closed") ? (C.classList.add("open"),
  8685. E.classList.remove("icon-dpad-right"),
  8686. E.classList.add("icon-dpad-left"),
  8687. this.emit(v.SHOW_INFO),
  8688. setTimeout(function() {
  8689. C.classList.remove("closed"),
  8690. C.classList.remove("open")
  8691. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8692. E.classList.remove("icon-dpad-left"),
  8693. E.classList.add("icon-dpad-right"),
  8694. this.emit(v.HIDE_INFO))
  8695. }
  8696. };
  8697. d.extendObject(N, A.prototype),
  8698. t.exports = N
  8699. }
  8700. ).call(this, "/js/gui/title/titleBar.js")
  8701. }
  8702. , {
  8703. "../../localization/localize": 108,
  8704. "../../settings": 166,
  8705. "../../util/browser": 182,
  8706. "../../util/common": 185,
  8707. "../../util/logger": 189,
  8708. "./TitleEvents": 80,
  8709. "./titleBarSettings": 83,
  8710. events: 202
  8711. }],
  8712. 83: [function(e, t, i) {
  8713. "use strict";
  8714. t.exports = Object.freeze({
  8715. minTooltipCharacters: 19,
  8716. removeAnimationClasses: 500
  8717. })
  8718. }
  8719. , {}],
  8720. 84: [function(e, t, i) {
  8721. "use strict";
  8722. function n(e) {
  8723. C = e,
  8724. P.forEach(function(e) {
  8725. b.addEventListener(e, u.bind(this, !1), !0),
  8726. w.addEventListener(e, u.bind(this, !0), !0),
  8727. E.addEventListener(e, o, !0)
  8728. S.forEach(function(t) {//会触发导览停止
  8729. t.addEventListener(e, a, !0)
  8730. })
  8731. $("#drawer img").on(e, a)
  8732. })
  8733. document.addEventListener("keydown", u.bind(this, !1), !0)
  8734. C.on(v.TourStart, function() {
  8735. E.classList.add("playing")
  8736. })
  8737. }
  8738. function r() {
  8739. C.playTour(),
  8740. I && clearTimeout(I),
  8741. d(),
  8742. _.removeClass("fadeIn")
  8743. }
  8744. function o() {
  8745. E.classList.contains("playing") && (C.stopTour(),
  8746. _.addClass("fadeIn"),
  8747. setTimeout(function() {
  8748. _.removeClass("fadeIn")
  8749. }, p.tourInteraction.showPauseButton),
  8750. O || (clearTimeout(I),
  8751. I = setTimeout(h, p.tourInteraction.showModal)),
  8752. setTimeout(function() {
  8753. E.classList.remove("playing")
  8754. }, p.tourInteraction.allowNextClick))
  8755. }
  8756. function a() {
  8757. // 周恩光 在自动导览时拖动导览片段触发,会暂停自动导览
  8758. // C.tourInProgress && (C.stopTour(),
  8759. // C.endTourProgress(),
  8760. // E.classList.remove("playing"))
  8761. }
  8762. function s() {
  8763. T.is(":visible") ? r() : o()
  8764. }
  8765. function l() {
  8766. x.hasClass("playing") && (clearTimeout(I),
  8767. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8768. }
  8769. function c() {
  8770. E.classList.remove("playing"),
  8771. h()
  8772. }
  8773. function h() {//去掉导览结束时的提示
  8774. /* if (!p.tourInteraction.disabled) {
  8775. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8776. M.addClass("fadeIn tour " + m.deviceType);
  8777. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8778. if (!p.tourInteraction.smallModal) {
  8779. var t;
  8780. 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,
  8781. m.fill(R, A.TOUR_INTERACTION[t]),
  8782. M.addClass(t)
  8783. }
  8784. M.addClass(e)
  8785. } */
  8786. }
  8787. function u(e, t) {
  8788. if(window.myKeyBlank) return
  8789. if (t) {
  8790. var i = "keydown" === t.type
  8791. , n = t.which === f.SPACE || C.tourIsPlaying;
  8792. i && n || e || (O = !0),
  8793. C.atEndOfTour() && d(),
  8794. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8795. d(),
  8796. t.which !== f.SPACE && a()),
  8797. i && n && s()
  8798. }
  8799. }
  8800. function d() {
  8801. M.removeClass("fadeIn")
  8802. }
  8803. var p = (e("../util/browser"),
  8804. e("../settings"))
  8805. , f = e("../enum/Keys")
  8806. , g = e("../enum/Viewmode")
  8807. , m = (e("./helpManager"),
  8808. e("./populateModal"))
  8809. , v = e("../enum/DirectorEvents")
  8810. , A = e("../enum/HelpModalType")
  8811. , y = e("../enum/HelpModalSize")
  8812. , C = null
  8813. , I = null
  8814. , E = document.getElementById("pause-overlay")
  8815. , b = document.getElementById("player")
  8816. , w = document.getElementById("gui")
  8817. , _ = $("#pause-icon").eq(0)
  8818. , T = $("#play").eq(0)
  8819. , x = $("#playHead").eq(0)
  8820. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8821. , M = $("#interaction-modal").eq(0)
  8822. , R = $("#interaction-modal .interaction").toArray()
  8823. , P = ["touchstart", "mousedown", "pointerdown"]
  8824. , O = !1;
  8825. t.exports.init = n,
  8826. t.exports.play = r,
  8827. t.exports.pause = o,
  8828. t.exports.pauseWithoutCTA = a,
  8829. t.exports.togglePlay = s,
  8830. t.exports.stopTour = l,
  8831. t.exports.dismissModal = d
  8832. }
  8833. , {
  8834. "../enum/DirectorEvents": 23,
  8835. "../enum/HelpModalSize": 27,
  8836. "../enum/HelpModalType": 28,
  8837. "../enum/Keys": 30,
  8838. "../enum/Viewmode": 51,
  8839. "../settings": 166,
  8840. "../util/browser": 182,
  8841. "./helpManager": 68,
  8842. "./populateModal": 75
  8843. }],
  8844. 85: [function(e, t, i) {
  8845. "use strict";
  8846. t.exports = Object.freeze({
  8847. OPENED: "vr.modal.opened",
  8848. LAUNCH: "vr.modal.launch",
  8849. CLOSED: "vr.modal.closed",
  8850. NEXT: "vr.modal.next",
  8851. PREV: "vr.modal.prev",
  8852. STORE: "vr.modal.store",
  8853. falseICECHOSEN: "vr.modal.device"
  8854. })
  8855. }
  8856. , {}],
  8857. 86: [function(e, t, i) {
  8858. "use strict";
  8859. function n(e, t, i) {
  8860. function n(e, t, n, r) {
  8861. function o() {
  8862. return p + "&m=" + t + "&display=" + e
  8863. }
  8864. function s() {
  8865. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8866. , t = "&utm_source=" + u
  8867. , n = "&utm_showcase_session_id=" + i;
  8868. return e + t + n
  8869. }
  8870. function l() {
  8871. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8872. }
  8873. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8874. }
  8875. function r(e, t, i, r) {
  8876. var o = "https://api.branch.io/v1/url"
  8877. , a = n(e, t, i, r)
  8878. , s = {
  8879. responseType: "json",
  8880. data: {
  8881. branch_key: h.appConfig.branch_key,
  8882. data: {
  8883. m: t,
  8884. full_url: a,
  8885. $desktop_url: m,
  8886. $og_app_id: "331853976762864119",
  8887. $og_title: i,
  8888. $og_description: r,
  8889. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8890. $canonical_url: window.location.href
  8891. }
  8892. }
  8893. };
  8894. c.post(o, s).done(function(t) {
  8895. f[e] = t.url
  8896. }).fail(function(t) {
  8897. f[e] = t
  8898. }
  8899. .bind(this, a))
  8900. }
  8901. function o(e, t, i) {
  8902. for (var r in s) {
  8903. var o = s[r]
  8904. , a = n(o, e, t, i);
  8905. f[o] = a
  8906. }
  8907. }
  8908. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8909. , d = g + "/vr/dlist/?ret=" + u
  8910. , p = g + "/vr/show/?ret=" + u
  8911. , m = "";
  8912. switch (e) {
  8913. case l.IOS:
  8914. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8915. break;
  8916. default:
  8917. o(t.sid, t.name, t.summary)
  8918. }
  8919. }
  8920. function r(e) {
  8921. var t = f[e];
  8922. window.open(t, "_blank")
  8923. }
  8924. function o(e) {
  8925. var t = u[e];
  8926. window.open(t, "_blank")
  8927. }
  8928. var a = e("../../util/browser")
  8929. , s = e("../../enum/VRApps")
  8930. , l = e("../../enum/VRPlatforms")
  8931. , c = e("../../util/ajax")
  8932. , h = e("../../settings")
  8933. , u = {};
  8934. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8935. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8936. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8937. for (var d in s) {
  8938. var p = s[d];
  8939. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8940. }
  8941. var f = {}
  8942. , g = function() {
  8943. var e = window.location.host;
  8944. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8945. "https://" + e
  8946. }();
  8947. t.exports.init = n,
  8948. t.exports.launch = r,
  8949. t.exports.launchStore = o
  8950. }
  8951. , {
  8952. "../../enum/VRApps": 46,
  8953. "../../enum/VRPlatforms": 49,
  8954. "../../settings": 166,
  8955. "../../util/ajax": 181,
  8956. "../../util/browser": 182
  8957. }],
  8958. 87: [function(e, t, i) {
  8959. "use strict";
  8960. function n(e) {
  8961. var t;
  8962. switch (e) {
  8963. case m.IOS:
  8964. return t = p.iosVersion(),
  8965. t.major > 9 || 9 === t.major && t.minor >= 1;
  8966. case m.Android:
  8967. return t = p.androidVersion(),
  8968. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8969. }
  8970. return !1
  8971. }
  8972. function r(e, t) {
  8973. function i(e) {
  8974. K.emit(A.STORE, {
  8975. type: e
  8976. }),
  8977. f.launchStore(e)
  8978. }
  8979. function r(e) {
  8980. switch (e !== _.pageCount && (a(e),
  8981. N.text(e + 1 + " / " + _.pageCount)),
  8982. e) {
  8983. case _.Title:
  8984. O.css("display", "none"),
  8985. L.text(u[e]),
  8986. o(s);
  8987. break;
  8988. case _.Cardboard:
  8989. O.css("display", "block"),
  8990. L.text(u[e]),
  8991. M.filter(".cardboard").off(),
  8992. M.filter(".gearvr").off(),
  8993. c(e, s),
  8994. h(H, X, Z);
  8995. break;
  8996. case _.Gear:
  8997. L.text(u[e]),
  8998. c(e, s),
  8999. T.addClass("lastPage"),
  9000. h(G, X, Z);
  9001. break;
  9002. case _.pageCount:
  9003. T.removeClass("fadeIn"),
  9004. K.emit(A.CLOSED)
  9005. }
  9006. B.filter("[src='']").hide()
  9007. }
  9008. var s = function() {
  9009. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9010. w = ".show-supported",
  9011. m.Android) : (T.addClass("unsupported"),
  9012. w = ".show-unsupported",
  9013. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9014. w = ".show-ios",
  9015. _ = v.ios,
  9016. m.IOS) : (T.addClass("desktop"),
  9017. w = ".show-desktop",
  9018. m.Desktop)
  9019. }();
  9020. f.init(s, e, t),
  9021. s !== m.Desktop && T.addClass("mobile");
  9022. var l = function(e) {
  9023. K.emit(A.LAUNCH, {
  9024. vr_platform: s,
  9025. vr_app: e
  9026. }),
  9027. f.launch(e)
  9028. };
  9029. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9030. q.gear = l.bind(this, g.GearVR),
  9031. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9032. d(),
  9033. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9034. $(w).show();
  9035. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9036. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9037. s === m.IOS && (u.splice(1, 1),
  9038. y.splice(1, 1)),
  9039. $("#vr").on("click", function(e) {
  9040. e.preventDefault();
  9041. player.FlyToMode("panorama", ()=>{
  9042. if(!window.vrEnabled) { // 开启VR
  9043. window.vrEnabled = true;
  9044. this.classList.add('active');
  9045. $('#gui div').not('#vrOff').addClass('vrHide');
  9046. $('#vrOffImg').css({'display':'inline-block'});
  9047. }else{
  9048. }
  9049. })
  9050. });
  9051. $('#vrOff').on('click', function(){
  9052. window.vrEnabled = false;
  9053. $('#gui div').not('#vrOff').removeClass('vrHide');
  9054. $('#vrOffImg').css({'display':'none'});
  9055. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9056. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9057. })
  9058. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9059. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9060. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9061. $("span.modelLink").text(I),
  9062. O.on("click", function(e) {
  9063. K.emit(A.PREV),
  9064. b--,
  9065. r(b)
  9066. }),
  9067. L.on("click", function(e) {
  9068. L.text();
  9069. K.emit(A.NEXT, {
  9070. nextAction: y[b]
  9071. }),
  9072. b++,
  9073. r(b)
  9074. }),
  9075. T.find(".close").on("click", K.dismiss)
  9076. }
  9077. function o(e) {
  9078. switch (e) {
  9079. case m.Android:
  9080. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9081. M.filter(".gearvr").off().on("click", q.gear),
  9082. s(H, G, "logo-button", "same-line");
  9083. break;
  9084. case m.UnsupportedAndroid:
  9085. s("", z, "", "");
  9086. break;
  9087. case m.IOS:
  9088. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9089. s(H, "", "logo-button", "");
  9090. break;
  9091. case m.Desktop:
  9092. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9093. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9094. s(H, G, "logo-button", "same-line"),
  9095. Q.cardboard()
  9096. }
  9097. }
  9098. function a(e) {
  9099. $(".p1, .p2, .p3").hide(),
  9100. x.insertAfter(S),
  9101. T.removeClass("front-page"),
  9102. T.removeClass("details-page"),
  9103. T.removeClass("lastPage"),
  9104. M.removeClass("logo-button"),
  9105. M.removeClass("same-line"),
  9106. S.removeClass("headsetOptions"),
  9107. R.attr("src", ""),
  9108. R.filter(".second").removeClass("gear"),
  9109. R.css("display", "inline-block"),
  9110. R.off(),
  9111. P.filter(".second").css("display", ""),
  9112. D.css("display", "none"),
  9113. $(".p" + (e + 1) + w).show(),
  9114. R.filter(".third").insertBefore(P.filter(".third"))
  9115. }
  9116. function s(e, t, i, n) {
  9117. T.addClass("front-page"),
  9118. R.filter(".first").attr("src", e),
  9119. R.filter(".second").attr("src", t),
  9120. M.filter(".first").addClass(i),
  9121. M.filter(".second").addClass(i),
  9122. M.addClass(n),
  9123. ".show-desktop" === w && S.insertAfter(x)
  9124. }
  9125. function l(e, t, i) {
  9126. S.addClass("headsetOptions"),
  9127. M.off(),
  9128. R.filter(".second").attr("src", t),
  9129. D.css("display", "block"),
  9130. P.filter(".second").css("display", "none"),
  9131. D.on("click", function() {
  9132. a(_.Title),
  9133. o(m.Desktop)
  9134. }),
  9135. e && (K.emit(A.falseICECHOSEN, {
  9136. name: g.GearVR
  9137. }),
  9138. R.filter(".first").attr("src", e),
  9139. R.filter(".second").addClass("gear"),
  9140. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9141. Q.gearvr()),
  9142. i && (K.emit(A.falseICECHOSEN, {
  9143. name: g.Cardboard
  9144. }),
  9145. R.filter(".third").attr("src", i),
  9146. R.filter(".third").show(),
  9147. R.filter(".third").insertAfter(R.filter(".second")),
  9148. R.filter(".third").addClass("link"),
  9149. R.filter(".second").addClass("link"),
  9150. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9151. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9152. Q.cardboard())
  9153. }
  9154. function c(e, t) {
  9155. switch (t) {
  9156. case m.IOS:
  9157. X = Y,
  9158. Z = j;
  9159. break;
  9160. case m.Desktop:
  9161. e === _.Cardboard ? (X = F,
  9162. Z = U,
  9163. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9164. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9165. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9166. Z = "");
  9167. break;
  9168. default:
  9169. e === _.Cardboard ? (X = z,
  9170. Z = j) : (X = k,
  9171. Z = W)
  9172. }
  9173. }
  9174. function h(e, t, i) {
  9175. T.find(".inner").addClass("details-page"),
  9176. T.addClass("details-page"),
  9177. R.filter(".first").attr("src", e),
  9178. R.filter(".second").attr("src", t),
  9179. R.filter(".third").attr("src", i)
  9180. }
  9181. function u() {
  9182. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9183. K.emit(A.CLOSED))
  9184. }
  9185. function d() {
  9186. var e = p.aspectRatio() > 1 && p.isMobile();
  9187. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9188. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9189. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9190. }
  9191. var p = e("../../util/browser")
  9192. , f = e("./vrLink")
  9193. , g = e("../../enum/VRApps")
  9194. , m = e("../../enum/VRPlatforms")
  9195. , v = e("../../enum/VRPages")
  9196. , A = e("./vrEvent")
  9197. , y = (e("../../settings"),
  9198. e("../../constants"))
  9199. , C = e("../../localization/localize")
  9200. , I = e("../../util/common")
  9201. , E = e("events").EventEmitter
  9202. , b = 0
  9203. , w = null
  9204. , _ = v.standard
  9205. , T = $(".vr-popup")
  9206. , x = T.find(".vr-popup-body")
  9207. , S = T.find(".vr-images")
  9208. , M = T.find(".img-container")
  9209. , R = T.find(".vr-sm-image")
  9210. , P = M.find(".vr-img-caption")
  9211. , O = $(".vr-buttons").find(".prev-button")
  9212. , L = $(".vr-buttons").find(".next-button")
  9213. , D = S.find(".front-close")
  9214. , N = $(".vr-page")
  9215. , B = T.find("img")
  9216. , F = "static/images/apple-store.png"
  9217. , V = "static/images/badge-oculus.png"
  9218. , U = "static/images/badge-cardboard.png"
  9219. , k = "static/images/logo-samsung.png"
  9220. , H = "static/images/headset-cardboard.png"
  9221. , G = "static/images/headset-gearvr.png"
  9222. , z = "static/images/ico-android-robot.png"
  9223. , W = "static/images/ico-gearvr.png"
  9224. , j = "static/images/ico-vr.png"
  9225. , Y = "static/images/apple-logo-white.svg"
  9226. , X = null
  9227. , Z = null
  9228. , q = {}
  9229. , K = {
  9230. init: r,
  9231. dismiss: u,
  9232. isDeviceSupported: n
  9233. };
  9234. I.extendObject(K, E.prototype),
  9235. $(window).resize(d);
  9236. var Q = function() {
  9237. var e = P.filter(".first").find(".cardboard")
  9238. , t = P.filter(".first").find(".gearvr");
  9239. return {
  9240. cardboard: function() {
  9241. t.addClass("hidden"),
  9242. e.removeClass("hidden")
  9243. },
  9244. gearvr: function() {
  9245. e.addClass("hidden"),
  9246. t.removeClass("hidden")
  9247. }
  9248. }
  9249. }();
  9250. t.exports = K
  9251. }
  9252. , {
  9253. "../../constants": 8,
  9254. "../../enum/VRApps": 46,
  9255. "../../enum/VRPages": 48,
  9256. "../../enum/VRPlatforms": 49,
  9257. "../../localization/localize": 108,
  9258. "../../settings": 166,
  9259. "../../util/browser": 182,
  9260. "../../util/common": 185,
  9261. "./vrEvent": 85,
  9262. "./vrLink": 86,
  9263. events: 202
  9264. }],
  9265. 88: [function(e, t, i) {
  9266. "use strict";
  9267. t.exports = Object.freeze({
  9268. OPENED: "webvr.modal.opened",
  9269. SHOW_TERMS: "webvr.footer.show.terms"
  9270. })
  9271. }
  9272. , {}],
  9273. 89: [function(e, t, i) {
  9274. (function(i) {
  9275. "use strict";
  9276. function n(e, t, i, n) {
  9277. function r(e) {
  9278. e.preventDefault(),
  9279. a(e.currentTarget.id)
  9280. }
  9281. function a(e) {
  9282. ne[e](),
  9283. Object.keys(ne).map(function(t, i) {
  9284. $("#" + t).toggleClass("tabs-underlined", t === e)
  9285. })
  9286. }
  9287. y = i,
  9288. v = t,
  9289. w.init(E.Android, e, n),
  9290. m();
  9291. var l = new RegExp("daydream","i")
  9292. , c = l.test(y.displayName);
  9293. c ? (a("tabdaydream"),
  9294. B.filter(".device-headset-side").attr("src", H),
  9295. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9296. B.filter(".device-headset-side").attr("src", Y),
  9297. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9298. $("#vr").on("click", function(e) {
  9299. e.preventDefault(),
  9300. g("click_webvr_button"),
  9301. L.is(":hidden") && (ie.emit(_.OPENED),
  9302. o())
  9303. }),
  9304. $(".webvr-popup .close").on("click", function(e) {
  9305. e.preventDefault(),
  9306. D.hasClass("hidden") ? (g("webvr_help_close"),
  9307. p()) : s()
  9308. }),
  9309. $("#tabcardboard").on("click", r),
  9310. $("#tabdaydream").on("click", r),
  9311. $("#tabnative").on("click", r),
  9312. $(".webvr-popup .open-with-app").on("click", function(e) {
  9313. e.preventDefault(),
  9314. g("webvr_learn_more"),
  9315. a("tabnative"),
  9316. p()
  9317. }),
  9318. $(".webvr-popup .help").on("click", function(e) {
  9319. e.preventDefault(),
  9320. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9321. p()
  9322. }),
  9323. $(".webvr-popup .terms").on("click", function(e) {
  9324. e.preventDefault(),
  9325. g("webvr_click_terms"),
  9326. s(),
  9327. ie.emit(_.SHOW_TERMS)
  9328. }),
  9329. F.on("click", function(e) {
  9330. e.preventDefault(),
  9331. g(ee),
  9332. window.open(J, "_blank")
  9333. }),
  9334. V.on("click", function(e) {
  9335. e.preventDefault(),
  9336. g("webvr_phone_link"),
  9337. window.open(te, "_blank")
  9338. }),
  9339. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9340. e.preventDefault(),
  9341. g("webvr_cardboard_link"),
  9342. w.launch(b.CardboardAndroid)
  9343. }),
  9344. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9345. e.preventDefault(),
  9346. g("webvr_oculus_link"),
  9347. w.launch(b.GearVR)
  9348. })
  9349. }
  9350. function r() {
  9351. function e() {
  9352. y.isPresenting || (f(),
  9353. window.removeEventListener("vrdisplaypresentchange", e))
  9354. }
  9355. R.info("Headset mounted"),
  9356. v.suspend();
  9357. var t = document.createElement("canvas");
  9358. for (t.getContext("webgl"),
  9359. t.className = "webvr-canvas",
  9360. document.bgColor = "#000",
  9361. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9362. document.body.removeChild(document.body.firstChild);
  9363. document.body.appendChild(t),
  9364. g("webvr_enter_app"),
  9365. y.requestPresent([{
  9366. source: t,
  9367. predistorted: !0
  9368. }]).catch(function(t) {
  9369. R.error("Failed to present: " + t),
  9370. g("webvr_exit_calibrate"),
  9371. e()
  9372. }),
  9373. A.then(function() {
  9374. window.dispatchEvent(new Event("vrapp-start"))
  9375. }),
  9376. window.addEventListener("vrdisplaypresentchange", e)
  9377. }
  9378. function o() {
  9379. O.fadeOut(I.guiAnimationSpeed),
  9380. L.fadeIn(I.guiAnimationSpeed),
  9381. a()
  9382. }
  9383. function a() {
  9384. if (!A) {
  9385. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9386. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9387. A = new Promise(function(e, i) {
  9388. var n = document.createElement("script");
  9389. n.type = "text/javascript",
  9390. n.src = t,
  9391. n.onload = e,
  9392. document.head.appendChild(n)
  9393. }
  9394. )
  9395. }
  9396. D.find(".enter-button").on("click", r)
  9397. }
  9398. function s() {
  9399. g("webvr_modal_close"),
  9400. D.find(".enter-button").off("click", r),
  9401. L.fadeOut(I.guiAnimationSpeed, function() {
  9402. D.toggleClass("hidden", !1),
  9403. N.toggleClass("hidden", !0),
  9404. C.exitFullscreen()
  9405. }),
  9406. O.fadeIn(I.guiAnimationSpeed)
  9407. }
  9408. function l() {
  9409. k.toggleClass("hidden", !1),
  9410. U.toggleClass("hidden", !0)
  9411. }
  9412. function c() {
  9413. k.toggleClass("hidden", !0),
  9414. U.toggleClass("hidden", !1)
  9415. }
  9416. function h() {
  9417. B.filter(".device-headset").attr("src", G),
  9418. B.filter(".device-phone").attr("src", z),
  9419. J = Z,
  9420. ee = K,
  9421. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9422. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9423. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9424. c()
  9425. }
  9426. function u() {
  9427. B.filter(".badge-cardboard").attr("src", j),
  9428. B.filter(".badge-oculus").attr("src", X),
  9429. l()
  9430. }
  9431. function d() {
  9432. B.filter(".device-headset").attr("src", Y),
  9433. B.filter(".device-phone").attr("src", W),
  9434. J = q,
  9435. ee = Q,
  9436. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9437. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9438. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9439. c()
  9440. }
  9441. function p() {
  9442. D.toggleClass("hidden"),
  9443. N.toggleClass("hidden")
  9444. }
  9445. function f() {
  9446. R.info("exiting webVR"),
  9447. g("webvr_exit_app"),
  9448. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9449. }
  9450. function g(e) {
  9451. var t = C.isLandscape() ? "landscape" : "portrait";
  9452. T.trackAlways("showcase_gui", {
  9453. gui_action: e,
  9454. orientation: t
  9455. })
  9456. }
  9457. function m() {
  9458. var e = C.isLandscape();
  9459. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9460. }
  9461. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9462. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9463. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "static/images/device-daydream-side.png", G = "static/images/device-daydream.png", z = "static/images/device-pixel.png", W = "static/images/ico-android-robot.png", j = "static/images/badge-cardboard.png", Y = "static/images/headset-cardboard.png", X = "static/images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9464. init: n
  9465. }, ne = {
  9466. tabcardboard: d,
  9467. tabdaydream: h,
  9468. tabnative: u
  9469. };
  9470. S.extendObject(ie, P.prototype),
  9471. $(window).resize(m),
  9472. t.exports = ie
  9473. }
  9474. ).call(this, "/js/gui/webvr/webVRgui.js")
  9475. }
  9476. , {
  9477. "../../analytics": 4,
  9478. "../../constants": 8,
  9479. "../../enum/VRApps": 46,
  9480. "../../enum/VRPlatforms": 49,
  9481. "../../localization/localize": 108,
  9482. "../../settings": 166,
  9483. "../../util/browser": 182,
  9484. "../../util/common": 185,
  9485. "../../util/logger": 189,
  9486. "./../gui": 65,
  9487. "./../vr/vrLink": 86,
  9488. "./WebVrEvent": 88,
  9489. events: 202
  9490. }],
  9491. 90: [function(e, t, i) {
  9492. "use strict";
  9493. function n(e, t, i, n, o) {
  9494. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9495. this.roomId = o || "",
  9496. this.labelId = e,
  9497. this.position = (new r.Vector3).copy(t),
  9498. this.text = i
  9499. }
  9500. var r = e("three")
  9501. , o = e("../util/browser");
  9502. n.prototype.build = function() {
  9503. var e = window.document.createElement("div");
  9504. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9505. var t = window.document.createElement("div");
  9506. t.setAttribute("class", "gui-floorplan-label-text");
  9507. var i = window.document.createTextNode(this.text);
  9508. t.appendChild(i),
  9509. e.appendChild(t),
  9510. window.document.body.appendChild(e),
  9511. this.labelGui = e,
  9512. this.textBlock = t,
  9513. $(this.labelGui).hide();
  9514. var n = window.getComputedStyle(this.labelGui);
  9515. this.initialTransform = n.transform || n.webkitTransform
  9516. }
  9517. ,
  9518. t.exports = n
  9519. }
  9520. , {
  9521. "../util/browser": 182,
  9522. three: 217
  9523. }],
  9524. 91: [function(e, t, i) {
  9525. "use strict";
  9526. function n() {
  9527. this.player = null,
  9528. this.modelManager = null,
  9529. this.container = null
  9530. }
  9531. var r = e("three")
  9532. , o = (e("../util/common"),
  9533. e("../enum/PlayerEvents"))
  9534. , a = (e("../enum/DirectorEvents"),
  9535. e("../enum/ModelManagerEvents"))
  9536. , s = e("../settings")
  9537. , l = e("../enum/Viewmode")
  9538. , c = (e("../enum/WarpStyle"),
  9539. e("../util/transitions"),
  9540. e("../util/lerp"),
  9541. e("../util/browser"));
  9542. //场景初始化
  9543. n.prototype.init = function(e, t, i) {
  9544. this.player = e,
  9545. this.modelManager = t,
  9546. this.container = i,
  9547. this.updateModel(),
  9548. this.bindEvents()
  9549. }
  9550. ,
  9551. n.prototype.bindEvents = function() {
  9552. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9553. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9554. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9555. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9556. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9557. }
  9558. ,
  9559. n.prototype.updateModel = function() {
  9560. this.model = this.modelManager.getActiveModel()
  9561. }
  9562. ,
  9563. n.prototype.handlePlayerViewChanged = function() {
  9564. this.updateLabelVisibility(),
  9565. this.updateLabelDisplay()
  9566. }
  9567. ,
  9568. n.prototype.getLabelsForFloor = function(e, t) {
  9569. return t = t || [],
  9570. t.length = 0,
  9571. this.model.labels.forEach(function(i) {
  9572. this.labelVisibleForFloor(i, e) && t.push(i)
  9573. }
  9574. .bind(this)),
  9575. t
  9576. }
  9577. ,
  9578. n.prototype.getLabelsForCurrentFloor = function(e) {
  9579. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9580. }
  9581. ,
  9582. n.prototype.labelVisibleForFloor = function(e, t) {
  9583. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9584. if (!this.model.showingLabels || !e.labelGui || !i)
  9585. return !1;
  9586. var n = e.floorId === this.model.floors.size() - 1;
  9587. return this.model.allFloorsVisible ? n : e.floorId === t
  9588. }
  9589. ,
  9590. n.prototype.updateLabelVisibility = function(e) {
  9591. this.model.labels.forEach(function(e) {
  9592. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9593. }
  9594. .bind(this))
  9595. }
  9596. ,
  9597. n.prototype.showAllLabels = function(e, t) {
  9598. this.model.labels.forEach(function(i) {
  9599. this.showLabel(i, e, t)
  9600. }
  9601. .bind(this))
  9602. }
  9603. ,
  9604. n.prototype.hideAllLabels = function(e, t) {
  9605. this.model.labels.forEach(function(i) {
  9606. this.hideLabel(i, e, t)
  9607. }
  9608. .bind(this))
  9609. }
  9610. ,
  9611. n.prototype.showLabel = function(e, t, i) {
  9612. this.model.showingLabels && (e.visible || (e.visible = !0,
  9613. e.labelGui.style.display = "block",
  9614. e.labelGui.style.opacity = 0,
  9615. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9616. }
  9617. ,
  9618. n.prototype.hideLabel = function(e, t, i) {
  9619. e.visible && (e.visible = !1,
  9620. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9621. }
  9622. ,
  9623. n.prototype.supportedMode = function() {
  9624. return this.player.mode === l.FLOORPLAN
  9625. }
  9626. ,
  9627. n.prototype.updateLabelDisplay = function() {
  9628. var e = (new r.Vector3,
  9629. new r.Vector3,
  9630. []);
  9631. return function() {
  9632. var t = this.player.getLabelScaleFactor()
  9633. , i = .6
  9634. , n = 1.2
  9635. , r = (1 - t) * n + i
  9636. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9637. this.getLabelsForCurrentFloor(e);
  9638. for (var a = 0; a < e.length; a++) {
  9639. var l = e[a];
  9640. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9641. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9642. }
  9643. }
  9644. }(),
  9645. n.prototype.updateProjectedGuiElement = function() {
  9646. var e = new r.Vector3;
  9647. new r.Vector3;
  9648. return function(t, i, n, r, o) {
  9649. i.style.fontSize = 100 * o + "%";
  9650. var a = $("#player").width()
  9651. , s = $("#player").height()
  9652. , l = .5 * a
  9653. , c = .5 * s;
  9654. e.copy(n),
  9655. e.project(this.player.camera);
  9656. var h = e.x * l + l
  9657. , u = -(e.y * c) + c;
  9658. h -= t.offsetWidth / 2,
  9659. u -= t.offsetHeight / 2,
  9660. t.style.left = h + "px",
  9661. t.style.top = u + "px"
  9662. }
  9663. }(),
  9664. n.prototype.handleStartInside = function(e) {
  9665. this.updateLabelVisibility()
  9666. }
  9667. ,
  9668. n.prototype.handleStartOutside = function() {
  9669. this.updateLabelVisibility()
  9670. }
  9671. ,
  9672. t.exports = n
  9673. }
  9674. , {
  9675. "../enum/DirectorEvents": 23,
  9676. "../enum/ModelManagerEvents": 33,
  9677. "../enum/PlayerEvents": 40,
  9678. "../enum/Viewmode": 51,
  9679. "../enum/WarpStyle": 52,
  9680. "../settings": 166,
  9681. "../util/browser": 182,
  9682. "../util/common": 185,
  9683. "../util/lerp": 188,
  9684. "../util/transitions": 195,
  9685. three: 217
  9686. }],
  9687. 92: [function(e, t, i) {
  9688. "use strict";
  9689. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9690. if (null == this)
  9691. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9692. if ("function" != typeof e)
  9693. throw new TypeError("predicate must be a function");
  9694. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9695. if (t = i[o],
  9696. e.call(r, t, o, i))
  9697. return o;
  9698. return -1
  9699. }
  9700. ),
  9701. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9702. value: function(e) {
  9703. if (null == this)
  9704. throw new TypeError('"this" is null or not defined');
  9705. var t = Object(this)
  9706. , i = t.length >>> 0;
  9707. if ("function" != typeof e)
  9708. throw new TypeError("predicate must be a function");
  9709. for (var n = arguments[1], r = 0; r < i; ) {
  9710. var o = t[r];
  9711. if (e.call(n, o, r, t))
  9712. return o;
  9713. r++
  9714. }
  9715. }
  9716. })
  9717. }
  9718. , {}],
  9719. 93: [function(e, t, i) {
  9720. "use strict";
  9721. var n = n || {};
  9722. t.exports = n,
  9723. n.gui = n.gui || {},
  9724. n.utils = n.utils || {},
  9725. n.controllers = n.controllers || {},
  9726. n.dom = n.dom || {},
  9727. n.color = n.color || {},
  9728. n.utils.css = function() {
  9729. return {
  9730. load: function(e, t) {
  9731. t = t || document;
  9732. var i = t.createElement("link");
  9733. i.type = "text/css",
  9734. i.rel = "stylesheet",
  9735. i.href = e,
  9736. t.getElementsByTagName("head")[0].appendChild(i)
  9737. },
  9738. inject: function(e, t) {
  9739. t = t || document;
  9740. var i = document.createElement("style");
  9741. i.type = "text/css",
  9742. i.innerHTML = e,
  9743. t.getElementsByTagName("head")[0].appendChild(i)
  9744. }
  9745. }
  9746. }(),
  9747. n.utils.common = function() {
  9748. var e = Array.prototype.forEach
  9749. , t = Array.prototype.slice;
  9750. return {
  9751. BREAK: {},
  9752. extend: function(e) {
  9753. return this.each(t.call(arguments, 1), function(t) {
  9754. for (var i in t)
  9755. this.isUndefined(t[i]) || (e[i] = t[i])
  9756. }, this),
  9757. e
  9758. },
  9759. defaults: function(e) {
  9760. return this.each(t.call(arguments, 1), function(t) {
  9761. for (var i in t)
  9762. this.isUndefined(e[i]) && (e[i] = t[i])
  9763. }, this),
  9764. e
  9765. },
  9766. compose: function() {
  9767. var e = t.call(arguments);
  9768. return function() {
  9769. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9770. i = [e[n].apply(this, i)];
  9771. return i[0]
  9772. }
  9773. },
  9774. each: function(t, i, n) {
  9775. if (t)
  9776. if (e && t.forEach && t.forEach === e)
  9777. t.forEach(i, n);
  9778. else if (t.length === t.length + 0) {
  9779. for (var r = 0, o = t.length; r < o; r++)
  9780. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9781. return
  9782. } else
  9783. for (var r in t)
  9784. if (i.call(n, t[r], r) === this.BREAK)
  9785. return
  9786. },
  9787. defer: function(e) {
  9788. setTimeout(e, 0)
  9789. },
  9790. toArray: function(e) {
  9791. return e.toArray ? e.toArray() : t.call(e)
  9792. },
  9793. isUndefined: function(e) {
  9794. return void 0 === e
  9795. },
  9796. isNull: function(e) {
  9797. return null === e
  9798. },
  9799. isNaN: function(e) {
  9800. return e !== e
  9801. },
  9802. isArray: Array.isArray || function(e) {
  9803. return e.constructor === Array
  9804. }
  9805. ,
  9806. isObject: function(e) {
  9807. return e === Object(e)
  9808. },
  9809. isNumber: function(e) {
  9810. return e === e + 0
  9811. },
  9812. isString: function(e) {
  9813. return e === e + ""
  9814. },
  9815. isBoolean: function(e) {
  9816. return e === !1 || e === !0
  9817. },
  9818. isFunction: function(e) {
  9819. return "[object Function]" === Object.prototype.toString.call(e)
  9820. }
  9821. }
  9822. }(),
  9823. n.controllers.Controller = function(e) {
  9824. var t = function(e, t) {
  9825. this.initialValue = e[t],
  9826. this.domElement = document.createElement("div"),
  9827. this.object = e,
  9828. this.property = t,
  9829. this.__onChange = void 0,
  9830. this.__onFinishChange = void 0
  9831. };
  9832. return e.extend(t.prototype, {
  9833. onChange: function(e) {
  9834. return this.__onChange = e,
  9835. this
  9836. },
  9837. onFinishChange: function(e) {
  9838. return this.__onFinishChange = e,
  9839. this
  9840. },
  9841. setValue: function(e) {
  9842. return this.object[this.property] = e,
  9843. this.__onChange && this.__onChange.call(this, e),
  9844. this.updateDisplay(),
  9845. this
  9846. },
  9847. getValue: function() {
  9848. return this.object[this.property]
  9849. },
  9850. updateDisplay: function() {
  9851. return this
  9852. },
  9853. isModified: function() {
  9854. return this.initialValue !== this.getValue()
  9855. }
  9856. }),
  9857. t
  9858. }(n.utils.common),
  9859. n.dom.dom = function(e) {
  9860. function t(t) {
  9861. if ("0" === t || e.isUndefined(t))
  9862. return 0;
  9863. var i = t.match(r);
  9864. return e.isNull(i) ? 0 : parseFloat(i[1])
  9865. }
  9866. var i = {
  9867. HTMLEvents: ["change"],
  9868. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9869. KeyboardEvents: ["keydown"]
  9870. }
  9871. , n = {};
  9872. e.each(i, function(t, i) {
  9873. e.each(t, function(e) {
  9874. n[e] = i
  9875. })
  9876. });
  9877. var r = /(\d+(\.\d+)?)px/
  9878. , o = {
  9879. makeSelectable: function(e, t) {
  9880. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9881. return !1
  9882. }
  9883. : function() {}
  9884. ,
  9885. e.style.MozUserSelect = t ? "auto" : "none",
  9886. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9887. e.unselectable = t ? "on" : "off")
  9888. },
  9889. makeFullscreen: function(t, i, n) {
  9890. e.isUndefined(i) && (i = !0),
  9891. e.isUndefined(n) && (n = !0),
  9892. t.style.position = "absolute",
  9893. i && (t.style.left = 0,
  9894. t.style.right = 0),
  9895. n && (t.style.top = 0,
  9896. t.style.bottom = 0)
  9897. },
  9898. fakeEvent: function(t, i, r, o) {
  9899. r = r || {};
  9900. var a = n[i];
  9901. if (!a)
  9902. throw new Error("Event type " + i + " not supported.");
  9903. var s = document.createEvent(a);
  9904. switch (a) {
  9905. case "MouseEvents":
  9906. var l = r.x || r.clientX || 0
  9907. , c = r.y || r.clientY || 0;
  9908. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9909. break;
  9910. case "KeyboardEvents":
  9911. var h = s.initKeyboardEvent || s.initKeyEvent;
  9912. e.defaults(r, {
  9913. cancelable: !0,
  9914. ctrlKey: !1,
  9915. altKey: !1,
  9916. shiftKey: !1,
  9917. metaKey: !1,
  9918. keyCode: void 0,
  9919. charCode: void 0
  9920. }),
  9921. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9922. break;
  9923. default:
  9924. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9925. }
  9926. e.defaults(s, o),
  9927. t.dispatchEvent(s)
  9928. },
  9929. bind: function(e, t, i, n) {
  9930. return n = n || !1,
  9931. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9932. o
  9933. },
  9934. unbind: function(e, t, i, n) {
  9935. return n = n || !1,
  9936. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9937. o
  9938. },
  9939. addClass: function(e, t) {
  9940. if (void 0 === e.className)
  9941. e.className = t;
  9942. else if (e.className !== t) {
  9943. var i = e.className.split(/ +/);
  9944. i.indexOf(t) == -1 && (i.push(t),
  9945. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9946. }
  9947. return o
  9948. },
  9949. removeClass: function(e, t) {
  9950. if (t)
  9951. if (void 0 === e.className)
  9952. ;
  9953. else if (e.className === t)
  9954. e.removeAttribute("class");
  9955. else {
  9956. var i = e.className.split(/ +/)
  9957. , n = i.indexOf(t);
  9958. n != -1 && (i.splice(n, 1),
  9959. e.className = i.join(" "))
  9960. }
  9961. else
  9962. e.className = void 0;
  9963. return o
  9964. },
  9965. hasClass: function(e, t) {
  9966. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9967. },
  9968. getWidth: function(e) {
  9969. var i = getComputedStyle(e);
  9970. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9971. },
  9972. getHeight: function(e) {
  9973. var i = getComputedStyle(e);
  9974. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9975. },
  9976. getOffset: function(e) {
  9977. var t = {
  9978. left: 0,
  9979. top: 0
  9980. };
  9981. if (e.offsetParent)
  9982. do
  9983. t.left += e.offsetLeft,
  9984. t.top += e.offsetTop;
  9985. while (e = e.offsetParent);return t
  9986. },
  9987. isActive: function(e) {
  9988. return e === document.activeElement && (e.type || e.href)
  9989. }
  9990. };
  9991. return o
  9992. }(n.utils.common),
  9993. n.controllers.OptionController = function(e, t, i) {
  9994. var n = function(e, r, o) {
  9995. n.superclass.call(this, e, r);
  9996. var a = this;
  9997. if (this.__select = document.createElement("select"),
  9998. i.isArray(o)) {
  9999. var s = {};
  10000. i.each(o, function(e) {
  10001. s[e] = e
  10002. }),
  10003. o = s
  10004. }
  10005. i.each(o, function(e, t) {
  10006. var i = document.createElement("option");
  10007. i.innerHTML = t,
  10008. i.setAttribute("value", e),
  10009. a.__select.appendChild(i)
  10010. }),
  10011. this.updateDisplay(),
  10012. t.bind(this.__select, "change", function() {
  10013. var e = this.options[this.selectedIndex].value;
  10014. a.setValue(e)
  10015. }),
  10016. this.domElement.appendChild(this.__select)
  10017. };
  10018. return n.superclass = e,
  10019. i.extend(n.prototype, e.prototype, {
  10020. setValue: function(e) {
  10021. var t = n.superclass.prototype.setValue.call(this, e);
  10022. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10023. t
  10024. },
  10025. updateDisplay: function() {
  10026. return this.__select.value = this.getValue(),
  10027. n.superclass.prototype.updateDisplay.call(this)
  10028. }
  10029. }),
  10030. n
  10031. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10032. n.controllers.NumberController = function(e, t) {
  10033. function i(e) {
  10034. return e = e.toString(),
  10035. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10036. }
  10037. var n = function(e, r, o) {
  10038. n.superclass.call(this, e, r),
  10039. o = o || {},
  10040. this.__min = o.min,
  10041. this.__max = o.max,
  10042. this.__step = o.step,
  10043. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  10044. this.__precision = i(this.__impliedStep)
  10045. };
  10046. return n.superclass = e,
  10047. t.extend(n.prototype, e.prototype, {
  10048. setValue: function(e) {
  10049. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10050. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10051. n.superclass.prototype.setValue.call(this, e)
  10052. },
  10053. min: function(e) {
  10054. return this.__min = e,
  10055. this
  10056. },
  10057. max: function(e) {
  10058. return this.__max = e,
  10059. this
  10060. },
  10061. step: function(e) {
  10062. return this.__step = e,
  10063. this.__impliedStep = e,
  10064. this.__precision = i(e),
  10065. this
  10066. }
  10067. }),
  10068. n
  10069. }(n.controllers.Controller, n.utils.common),
  10070. n.controllers.NumberControllerBox = function(e, t, i) {
  10071. function n(e, t) {
  10072. var i = Math.pow(10, t);
  10073. return Math.round(e * i) / i
  10074. }
  10075. var r = function(e, n, o) {
  10076. function a() {
  10077. var e = parseFloat(d.__input.value);
  10078. i.isNaN(e) || d.setValue(e)
  10079. }
  10080. function s() {
  10081. a(),
  10082. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10083. }
  10084. function l(e) {
  10085. t.bind(window, "mousemove", c),
  10086. t.bind(window, "mouseup", h),
  10087. u = e.clientY
  10088. }
  10089. function c(e) {
  10090. var t = u - e.clientY;
  10091. d.setValue(d.getValue() + t * d.__impliedStep),
  10092. u = e.clientY
  10093. }
  10094. function h() {
  10095. t.unbind(window, "mousemove", c),
  10096. t.unbind(window, "mouseup", h)
  10097. }
  10098. this.__truncationSuspended = !1,
  10099. r.superclass.call(this, e, n, o);
  10100. var u, d = this;
  10101. this.__input = document.createElement("input"),
  10102. this.__input.setAttribute("type", "text"),
  10103. t.bind(this.__input, "change", a),
  10104. t.bind(this.__input, "blur", s),
  10105. t.bind(this.__input, "mousedown", l),
  10106. t.bind(this.__input, "keydown", function(e) {
  10107. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10108. this.blur(),
  10109. d.__truncationSuspended = !1)
  10110. }),
  10111. this.updateDisplay(),
  10112. this.domElement.appendChild(this.__input)
  10113. };
  10114. return r.superclass = e,
  10115. i.extend(r.prototype, e.prototype, {
  10116. updateDisplay: function() {
  10117. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10118. r.superclass.prototype.updateDisplay.call(this)
  10119. }
  10120. }),
  10121. r
  10122. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10123. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10124. function o(e, t, i, n, r) {
  10125. return n + (r - n) * ((e - t) / (i - t))
  10126. }
  10127. var a = function(e, i, n, r, s) {
  10128. function l(e) {
  10129. t.bind(window, "mousemove", c),
  10130. t.bind(window, "mouseup", h),
  10131. c(e)
  10132. }
  10133. function c(e) {
  10134. e.preventDefault();
  10135. var i = t.getOffset(u.__background)
  10136. , n = t.getWidth(u.__background);
  10137. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10138. !1
  10139. }
  10140. function h() {
  10141. t.unbind(window, "mousemove", c),
  10142. t.unbind(window, "mouseup", h),
  10143. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10144. }
  10145. a.superclass.call(this, e, i, {
  10146. min: n,
  10147. max: r,
  10148. step: s
  10149. });
  10150. var u = this;
  10151. this.__background = document.createElement("div"),
  10152. this.__foreground = document.createElement("div"),
  10153. t.bind(this.__background, "mousedown", l),
  10154. t.addClass(this.__background, "slider"),
  10155. t.addClass(this.__foreground, "slider-fg"),
  10156. this.updateDisplay(),
  10157. this.__background.appendChild(this.__foreground),
  10158. this.domElement.appendChild(this.__background)
  10159. };
  10160. return a.superclass = e,
  10161. a.useDefaultStyles = function() {
  10162. i.inject(r)
  10163. }
  10164. ,
  10165. n.extend(a.prototype, e.prototype, {
  10166. updateDisplay: function() {
  10167. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10168. return this.__foreground.style.width = 100 * e + "%",
  10169. a.superclass.prototype.updateDisplay.call(this)
  10170. }
  10171. }),
  10172. a
  10173. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\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}"),
  10174. n.controllers.FunctionController = function(e, t, i) {
  10175. var n = function(e, i, r) {
  10176. n.superclass.call(this, e, i);
  10177. var o = this;
  10178. this.__button = document.createElement("div"),
  10179. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10180. t.bind(this.__button, "click", function(e) {
  10181. return e.preventDefault(),
  10182. o.fire(),
  10183. !1
  10184. }),
  10185. t.addClass(this.__button, "button"),
  10186. this.domElement.appendChild(this.__button)
  10187. };
  10188. return n.superclass = e,
  10189. i.extend(n.prototype, e.prototype, {
  10190. fire: function() {
  10191. this.__onChange && this.__onChange.call(this),
  10192. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10193. this.getValue().call(this.object)
  10194. }
  10195. }),
  10196. n
  10197. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10198. n.controllers.BooleanController = function(e, t, i) {
  10199. var n = function(e, i) {
  10200. function r() {
  10201. o.setValue(!o.__prev)
  10202. }
  10203. n.superclass.call(this, e, i);
  10204. var o = this;
  10205. this.__prev = this.getValue(),
  10206. this.__checkbox = document.createElement("input"),
  10207. this.__checkbox.setAttribute("type", "checkbox"),
  10208. t.bind(this.__checkbox, "change", r, !1),
  10209. this.domElement.appendChild(this.__checkbox),
  10210. this.updateDisplay()
  10211. };
  10212. return n.superclass = e,
  10213. i.extend(n.prototype, e.prototype, {
  10214. setValue: function(e) {
  10215. var t = n.superclass.prototype.setValue.call(this, e);
  10216. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10217. this.__prev = this.getValue(),
  10218. t
  10219. },
  10220. updateDisplay: function() {
  10221. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10222. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10223. n.superclass.prototype.updateDisplay.call(this)
  10224. }
  10225. }),
  10226. n
  10227. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10228. n.color.toString = function(e) {
  10229. return function(t) {
  10230. if (1 == t.a || e.isUndefined(t.a)) {
  10231. for (var i = t.hex.toString(16); i.length < 6; )
  10232. i = "0" + i;
  10233. return "#" + i
  10234. }
  10235. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10236. }
  10237. }(n.utils.common),
  10238. n.color.interpret = function(e, t) {
  10239. var i, n, r = function() {
  10240. n = !1;
  10241. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10242. return t.each(o, function(r) {
  10243. if (r.litmus(e))
  10244. return t.each(r.conversions, function(r, o) {
  10245. if (i = r.read(e),
  10246. n === !1 && i !== !1)
  10247. return n = i,
  10248. i.conversionName = o,
  10249. i.conversion = r,
  10250. t.BREAK
  10251. }),
  10252. t.BREAK
  10253. }),
  10254. n
  10255. }, o = [{
  10256. litmus: t.isString,
  10257. conversions: {
  10258. THREE_CHAR_HEX: {
  10259. read: function(e) {
  10260. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10261. return null !== t && {
  10262. space: "HEX",
  10263. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10264. }
  10265. },
  10266. write: e
  10267. },
  10268. SIX_CHAR_HEX: {
  10269. read: function(e) {
  10270. var t = e.match(/^#([A-F0-9]{6})$/i);
  10271. return null !== t && {
  10272. space: "HEX",
  10273. hex: parseInt("0x" + t[1].toString())
  10274. }
  10275. },
  10276. write: e
  10277. },
  10278. CSS_RGB: {
  10279. read: function(e) {
  10280. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10281. return null !== t && {
  10282. space: "RGB",
  10283. r: parseFloat(t[1]),
  10284. g: parseFloat(t[2]),
  10285. b: parseFloat(t[3])
  10286. }
  10287. },
  10288. write: e
  10289. },
  10290. CSS_RGBA: {
  10291. read: function(e) {
  10292. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10293. return null !== t && {
  10294. space: "RGB",
  10295. r: parseFloat(t[1]),
  10296. g: parseFloat(t[2]),
  10297. b: parseFloat(t[3]),
  10298. a: parseFloat(t[4])
  10299. }
  10300. },
  10301. write: e
  10302. }
  10303. }
  10304. }, {
  10305. litmus: t.isNumber,
  10306. conversions: {
  10307. HEX: {
  10308. read: function(e) {
  10309. return {
  10310. space: "HEX",
  10311. hex: e,
  10312. conversionName: "HEX"
  10313. }
  10314. },
  10315. write: function(e) {
  10316. return e.hex
  10317. }
  10318. }
  10319. }
  10320. }, {
  10321. litmus: t.isArray,
  10322. conversions: {
  10323. RGB_ARRAY: {
  10324. read: function(e) {
  10325. return 3 == e.length && {
  10326. space: "RGB",
  10327. r: e[0],
  10328. g: e[1],
  10329. b: e[2]
  10330. }
  10331. },
  10332. write: function(e) {
  10333. return [e.r, e.g, e.b]
  10334. }
  10335. },
  10336. RGBA_ARRAY: {
  10337. read: function(e) {
  10338. return 4 == e.length && {
  10339. space: "RGB",
  10340. r: e[0],
  10341. g: e[1],
  10342. b: e[2],
  10343. a: e[3]
  10344. }
  10345. },
  10346. write: function(e) {
  10347. return [e.r, e.g, e.b, e.a]
  10348. }
  10349. }
  10350. }
  10351. }, {
  10352. litmus: t.isObject,
  10353. conversions: {
  10354. RGBA_OBJ: {
  10355. read: function(e) {
  10356. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10357. space: "RGB",
  10358. r: e.r,
  10359. g: e.g,
  10360. b: e.b,
  10361. a: e.a
  10362. }
  10363. },
  10364. write: function(e) {
  10365. return {
  10366. r: e.r,
  10367. g: e.g,
  10368. b: e.b,
  10369. a: e.a
  10370. }
  10371. }
  10372. },
  10373. RGB_OBJ: {
  10374. read: function(e) {
  10375. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10376. space: "RGB",
  10377. r: e.r,
  10378. g: e.g,
  10379. b: e.b
  10380. }
  10381. },
  10382. write: function(e) {
  10383. return {
  10384. r: e.r,
  10385. g: e.g,
  10386. b: e.b
  10387. }
  10388. }
  10389. },
  10390. HSVA_OBJ: {
  10391. read: function(e) {
  10392. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10393. space: "HSV",
  10394. h: e.h,
  10395. s: e.s,
  10396. v: e.v,
  10397. a: e.a
  10398. }
  10399. },
  10400. write: function(e) {
  10401. return {
  10402. h: e.h,
  10403. s: e.s,
  10404. v: e.v,
  10405. a: e.a
  10406. }
  10407. }
  10408. },
  10409. HSV_OBJ: {
  10410. read: function(e) {
  10411. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10412. space: "HSV",
  10413. h: e.h,
  10414. s: e.s,
  10415. v: e.v
  10416. }
  10417. },
  10418. write: function(e) {
  10419. return {
  10420. h: e.h,
  10421. s: e.s,
  10422. v: e.v
  10423. }
  10424. }
  10425. }
  10426. }
  10427. }];
  10428. return r
  10429. }(n.color.toString, n.utils.common),
  10430. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10431. function g(e, t, i, o) {
  10432. if (void 0 === t[i])
  10433. throw new Error("Object " + t + ' has no property "' + i + '"');
  10434. var a;
  10435. if (o.color)
  10436. a = new h(t,i);
  10437. else {
  10438. var s = [t, i].concat(o.factoryArgs);
  10439. a = n.apply(e, s)
  10440. }
  10441. o.before instanceof r && (o.before = o.before.__li),
  10442. A(e, a),
  10443. p.addClass(a.domElement, "c");
  10444. var l = document.createElement("span");
  10445. p.addClass(l, "property-name"),
  10446. l.innerHTML = a.property;
  10447. var c = document.createElement("div");
  10448. c.appendChild(l),
  10449. c.appendChild(a.domElement);
  10450. var u = m(e, c, o.before);
  10451. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10452. p.addClass(u, typeof a.getValue()),
  10453. v(e, u, a),
  10454. e.__controllers.push(a),
  10455. a
  10456. }
  10457. function m(e, t, i) {
  10458. var n = document.createElement("li");
  10459. return t && n.appendChild(t),
  10460. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10461. e.onResize(),
  10462. n
  10463. }
  10464. function v(e, t, i) {
  10465. if (i.__li = t,
  10466. i.__gui = e,
  10467. f.extend(i, {
  10468. options: function(t) {
  10469. return arguments.length > 1 ? (i.remove(),
  10470. g(e, i.object, i.property, {
  10471. before: i.__li.nextElementSibling,
  10472. factoryArgs: [f.toArray(arguments)]
  10473. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10474. g(e, i.object, i.property, {
  10475. before: i.__li.nextElementSibling,
  10476. factoryArgs: [t]
  10477. })) : void 0
  10478. },
  10479. name: function(e) {
  10480. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10481. i
  10482. },
  10483. listen: function() {
  10484. return i.__gui.listen(i),
  10485. i
  10486. },
  10487. remove: function() {
  10488. return i.__gui.remove(i),
  10489. i
  10490. }
  10491. }),
  10492. i instanceof l) {
  10493. var n = new s(i.object,i.property,{
  10494. min: i.__min,
  10495. max: i.__max,
  10496. step: i.__step
  10497. });
  10498. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10499. var t = i[e]
  10500. , r = n[e];
  10501. i[e] = n[e] = function() {
  10502. var e = Array.prototype.slice.call(arguments);
  10503. return t.apply(i, e),
  10504. r.apply(n, e)
  10505. }
  10506. }),
  10507. p.addClass(t, "has-slider"),
  10508. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10509. } else if (i instanceof s) {
  10510. var r = function(t) {
  10511. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10512. g(e, i.object, i.property, {
  10513. before: i.__li.nextElementSibling,
  10514. factoryArgs: [i.__min, i.__max, i.__step]
  10515. })) : t
  10516. };
  10517. i.min = f.compose(r, i.min),
  10518. i.max = f.compose(r, i.max)
  10519. } else
  10520. i instanceof o ? (p.bind(t, "click", function() {
  10521. p.fakeEvent(i.__checkbox, "click")
  10522. }),
  10523. p.bind(i.__checkbox, "click", function(e) {
  10524. e.stopPropagation()
  10525. })) : i instanceof a ? (p.bind(t, "click", function() {
  10526. p.fakeEvent(i.__button, "click")
  10527. }),
  10528. p.bind(t, "mouseover", function() {
  10529. p.addClass(i.__button, "hover")
  10530. }),
  10531. p.bind(t, "mouseout", function() {
  10532. p.removeClass(i.__button, "hover")
  10533. })) : i instanceof h && (p.addClass(t, "color"),
  10534. i.updateDisplay = f.compose(function(e) {
  10535. return t.style.borderLeftColor = i.__color.toString(),
  10536. e
  10537. }, i.updateDisplay),
  10538. i.updateDisplay());
  10539. i.setValue = f.compose(function(t) {
  10540. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10541. t
  10542. }, i.setValue)
  10543. }
  10544. function A(e, t) {
  10545. var i = e.getRoot()
  10546. , n = i.__rememberedObjects.indexOf(t.object);
  10547. if (n != -1) {
  10548. var r = i.__rememberedObjectIndecesToControllers[n];
  10549. if (void 0 === r && (r = {},
  10550. i.__rememberedObjectIndecesToControllers[n] = r),
  10551. r[t.property] = t,
  10552. i.load && i.load.remembered) {
  10553. var o, a = i.load.remembered;
  10554. if (a[e.preset])
  10555. o = a[e.preset];
  10556. else {
  10557. if (!a[L])
  10558. return;
  10559. o = a[L]
  10560. }
  10561. if (o[n] && void 0 !== o[n][t.property]) {
  10562. var s = o[n][t.property];
  10563. t.initialValue = s,
  10564. t.setValue(s)
  10565. }
  10566. }
  10567. }
  10568. }
  10569. function y(e, t) {
  10570. return document.location.href + "." + t
  10571. }
  10572. function C(e) {
  10573. var t = e.__save_row = document.createElement("li");
  10574. p.addClass(e.domElement, "has-save"),
  10575. e.__ul.insertBefore(t, e.__ul.firstChild),
  10576. p.addClass(t, "save-row");
  10577. var i = document.createElement("span");
  10578. i.innerHTML = "&nbsp;",
  10579. p.addClass(i, "button gears");
  10580. var n = document.createElement("span");
  10581. n.innerHTML = "Save",
  10582. p.addClass(n, "button"),
  10583. p.addClass(n, "save");
  10584. var r = document.createElement("span");
  10585. r.innerHTML = "New",
  10586. p.addClass(r, "button"),
  10587. p.addClass(r, "save-as");
  10588. var o = document.createElement("span");
  10589. o.innerHTML = "Revert",
  10590. p.addClass(o, "button"),
  10591. p.addClass(o, "revert");
  10592. var a = e.__preset_select = document.createElement("select");
  10593. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10594. w(e, i, i == e.preset)
  10595. }) : w(e, L, !1),
  10596. p.bind(a, "change", function() {
  10597. for (var t = 0; t < e.__preset_select.length; t++)
  10598. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10599. e.preset = this.value
  10600. }),
  10601. t.appendChild(a),
  10602. t.appendChild(i),
  10603. t.appendChild(n),
  10604. t.appendChild(r),
  10605. t.appendChild(o),
  10606. D) {
  10607. var s = document.getElementById("dg-save-locally")
  10608. , l = document.getElementById("dg-local-explain");
  10609. s.style.display = "block";
  10610. var c = document.getElementById("dg-local-storage");
  10611. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10612. var h = function() {
  10613. l.style.display = e.useLocalStorage ? "block" : "none"
  10614. };
  10615. h(),
  10616. p.bind(c, "change", function() {
  10617. e.useLocalStorage = !e.useLocalStorage,
  10618. h()
  10619. })
  10620. }
  10621. var u = document.getElementById("dg-new-constructor");
  10622. p.bind(u, "keydown", function(e) {
  10623. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10624. }),
  10625. p.bind(i, "click", function() {
  10626. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10627. S.show(),
  10628. u.focus(),
  10629. u.select()
  10630. }),
  10631. p.bind(n, "click", function() {
  10632. e.save()
  10633. }),
  10634. p.bind(r, "click", function() {
  10635. var t = prompt("Enter a new preset name.");
  10636. t && e.saveAs(t)
  10637. }),
  10638. p.bind(o, "click", function() {
  10639. e.revert()
  10640. })
  10641. }
  10642. function I(e) {
  10643. function t(t) {
  10644. return t.preventDefault(),
  10645. r = t.clientX,
  10646. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10647. p.bind(window, "mousemove", i),
  10648. p.bind(window, "mouseup", n),
  10649. !1
  10650. }
  10651. function i(t) {
  10652. return t.preventDefault(),
  10653. e.width += r - t.clientX,
  10654. e.onResize(),
  10655. r = t.clientX,
  10656. !1
  10657. }
  10658. function n() {
  10659. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10660. p.unbind(window, "mousemove", i),
  10661. p.unbind(window, "mouseup", n)
  10662. }
  10663. e.__resize_handle = document.createElement("div"),
  10664. f.extend(e.__resize_handle.style, {
  10665. width: "6px",
  10666. marginLeft: "-3px",
  10667. height: "200px",
  10668. cursor: "ew-resize",
  10669. position: "absolute"
  10670. });
  10671. var r;
  10672. p.bind(e.__resize_handle, "mousedown", t),
  10673. p.bind(e.__closeButton, "mousedown", t),
  10674. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10675. }
  10676. function E(e, t) {
  10677. e.domElement.style.width = t + "px",
  10678. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10679. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10680. }
  10681. function b(e, t) {
  10682. var i = {};
  10683. return f.each(e.__rememberedObjects, function(n, r) {
  10684. var o = {}
  10685. , a = e.__rememberedObjectIndecesToControllers[r];
  10686. f.each(a, function(e, i) {
  10687. o[i] = t ? e.initialValue : e.getValue()
  10688. }),
  10689. i[r] = o
  10690. }),
  10691. i
  10692. }
  10693. function w(e, t, i) {
  10694. var n = document.createElement("option");
  10695. n.innerHTML = t,
  10696. n.value = t,
  10697. e.__preset_select.appendChild(n),
  10698. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10699. }
  10700. function _(e) {
  10701. for (var t = 0; t < e.__preset_select.length; t++)
  10702. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10703. }
  10704. function T(e, t) {
  10705. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10706. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10707. }
  10708. function x(e) {
  10709. 0 != e.length && u(function() {
  10710. x(e)
  10711. }),
  10712. f.each(e, function(e) {
  10713. e.updateDisplay()
  10714. })
  10715. }
  10716. e.inject(i);
  10717. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10718. try {
  10719. return "localStorage"in window && null !== window.localStorage
  10720. } catch (e) {
  10721. return !1
  10722. }
  10723. }(), N = !0, B = !1, F = [], V = function(e) {
  10724. function t() {
  10725. var e = i.getRoot();
  10726. e.width += 1,
  10727. f.defer(function() {
  10728. e.width -= 1
  10729. })
  10730. }
  10731. var i = this;
  10732. this.domElement = document.createElement("div"),
  10733. this.__ul = document.createElement("ul"),
  10734. this.domElement.appendChild(this.__ul),
  10735. p.addClass(this.domElement, R),
  10736. this.__folders = {},
  10737. this.__controllers = [],
  10738. this.__rememberedObjects = [],
  10739. this.__rememberedObjectIndecesToControllers = [],
  10740. this.__listening = [],
  10741. e = e || {},
  10742. e = f.defaults(e, {
  10743. autoPlace: !0,
  10744. width: V.DEFAULT_WIDTH
  10745. }),
  10746. e = f.defaults(e, {
  10747. resizable: e.autoPlace,
  10748. hideable: e.autoPlace
  10749. }),
  10750. f.isUndefined(e.load) ? e.load = {
  10751. preset: L
  10752. } : e.preset && (e.load.preset = e.preset),
  10753. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10754. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10755. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10756. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10757. if (Object.defineProperties(this, {
  10758. parent: {
  10759. get: function() {
  10760. return e.parent
  10761. }
  10762. },
  10763. scrollable: {
  10764. get: function() {
  10765. return e.scrollable
  10766. }
  10767. },
  10768. autoPlace: {
  10769. get: function() {
  10770. return e.autoPlace
  10771. }
  10772. },
  10773. preset: {
  10774. get: function() {
  10775. return i.parent ? i.getRoot().preset : e.load.preset
  10776. },
  10777. set: function(t) {
  10778. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10779. _(this),
  10780. i.revert()
  10781. }
  10782. },
  10783. width: {
  10784. get: function() {
  10785. return e.width
  10786. },
  10787. set: function(t) {
  10788. e.width = t,
  10789. E(i, t)
  10790. }
  10791. },
  10792. name: {
  10793. get: function() {
  10794. return e.name
  10795. },
  10796. set: function(t) {
  10797. e.name = t,
  10798. a && (a.innerHTML = e.name)
  10799. }
  10800. },
  10801. closed: {
  10802. get: function() {
  10803. return e.closed
  10804. },
  10805. set: function(t) {
  10806. e.closed = t,
  10807. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10808. this.onResize(),
  10809. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10810. }
  10811. },
  10812. load: {
  10813. get: function() {
  10814. return e.load
  10815. }
  10816. },
  10817. useLocalStorage: {
  10818. get: function() {
  10819. return r
  10820. },
  10821. set: function(e) {
  10822. D && (r = e,
  10823. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10824. localStorage.setItem(y(i, "isLocal"), e))
  10825. }
  10826. }
  10827. }),
  10828. f.isUndefined(e.parent)) {
  10829. if (e.closed = !1,
  10830. p.addClass(this.domElement, V.CLASS_MAIN),
  10831. p.makeSelectable(this.domElement, !1),
  10832. D && r) {
  10833. i.useLocalStorage = !0;
  10834. var o = localStorage.getItem(y(this, "gui"));
  10835. o && (e.load = JSON.parse(o))
  10836. }
  10837. this.__closeButton = document.createElement("div"),
  10838. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10839. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10840. this.domElement.appendChild(this.__closeButton),
  10841. p.bind(this.__closeButton, "click", function() {
  10842. i.closed = !i.closed
  10843. })
  10844. } else {
  10845. void 0 === e.closed && (e.closed = !0);
  10846. var a = document.createTextNode(e.name);
  10847. p.addClass(a, "controller-name");
  10848. var s = m(i, a)
  10849. , l = function(e) {
  10850. return e.preventDefault(),
  10851. i.closed = !i.closed,
  10852. !1
  10853. };
  10854. p.addClass(this.__ul, V.CLASS_CLOSED),
  10855. p.addClass(s, "title"),
  10856. p.bind(s, "click", l),
  10857. e.closed || (this.closed = !1)
  10858. }
  10859. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10860. p.addClass(M, R),
  10861. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10862. document.body.appendChild(M),
  10863. N = !1),
  10864. M.appendChild(this.domElement),
  10865. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10866. this.parent || E(i, e.width)),
  10867. p.bind(window, "resize", function() {
  10868. i.onResize()
  10869. }),
  10870. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10871. i.onResize()
  10872. }),
  10873. p.bind(this.__ul, "transitionend", function() {
  10874. i.onResize()
  10875. }),
  10876. p.bind(this.__ul, "oTransitionEnd", function() {
  10877. i.onResize()
  10878. }),
  10879. this.onResize(),
  10880. e.resizable && I(this),
  10881. n = function() {
  10882. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10883. }
  10884. ,
  10885. this.saveToLocalStorageIfPossible = n;
  10886. i.getRoot();
  10887. e.parent || t()
  10888. };
  10889. return V.toggleHide = function() {
  10890. B = !B,
  10891. f.each(F, function(e) {
  10892. e.domElement.style.zIndex = B ? -999 : 999,
  10893. e.domElement.style.opacity = B ? 0 : 1
  10894. })
  10895. }
  10896. ,
  10897. V.CLASS_AUTO_PLACE = "a",
  10898. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10899. V.CLASS_MAIN = "main",
  10900. V.CLASS_CONTROLLER_ROW = "cr",
  10901. V.CLASS_TOO_TALL = "taller-than-window",
  10902. V.CLASS_CLOSED = "closed",
  10903. V.CLASS_CLOSE_BUTTON = "close-button",
  10904. V.CLASS_DRAG = "drag",
  10905. V.DEFAULT_WIDTH = 245,
  10906. V.TEXT_CLOSED = "Close Controls",
  10907. V.TEXT_OPEN = "Open Controls",
  10908. p.bind(window, "keydown", function(e) {
  10909. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10910. }, !1),
  10911. f.extend(V.prototype, {
  10912. add: function(e, t) {
  10913. return g(this, e, t, {
  10914. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10915. })
  10916. },
  10917. addColor: function(e, t) {
  10918. return g(this, e, t, {
  10919. color: !0
  10920. })
  10921. },
  10922. remove: function(e) {
  10923. this.__ul.removeChild(e.__li),
  10924. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10925. var t = this;
  10926. f.defer(function() {
  10927. t.onResize()
  10928. })
  10929. },
  10930. destroy: function() {
  10931. this.autoPlace && M.removeChild(this.domElement)
  10932. },
  10933. addFolder: function(e) {
  10934. if (void 0 !== this.__folders[e])
  10935. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10936. var t = {
  10937. name: e,
  10938. parent: this
  10939. };
  10940. t.autoPlace = this.autoPlace,
  10941. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10942. t.load = this.load.folders[e]);
  10943. var i = new V(t);
  10944. this.__folders[e] = i;
  10945. var n = m(this, i.domElement);
  10946. return p.addClass(n, "folder"),
  10947. i
  10948. },
  10949. open: function() {
  10950. this.closed = !1
  10951. },
  10952. close: function() {
  10953. this.closed = !0
  10954. },
  10955. onResize: function() {
  10956. var e = this.getRoot();
  10957. if (e.scrollable) {
  10958. var t = p.getOffset(e.__ul).top
  10959. , i = 0;
  10960. f.each(e.__ul.childNodes, function(t) {
  10961. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10962. }),
  10963. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10964. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10965. e.__ul.style.height = "auto")
  10966. }
  10967. e.__resize_handle && f.defer(function() {
  10968. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10969. }),
  10970. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10971. },
  10972. remember: function() {
  10973. if (f.isUndefined(S) && (S = new d,
  10974. S.domElement.innerHTML = t),
  10975. this.parent)
  10976. throw new Error("You can only call remember on a top level GUI.");
  10977. var e = this;
  10978. f.each(Array.prototype.slice.call(arguments), function(t) {
  10979. 0 == e.__rememberedObjects.length && C(e),
  10980. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10981. }),
  10982. this.autoPlace && E(this, this.width)
  10983. },
  10984. getRoot: function() {
  10985. for (var e = this; e.parent; )
  10986. e = e.parent;
  10987. return e
  10988. },
  10989. getSaveObject: function() {
  10990. var e = this.load;
  10991. return e.closed = this.closed,
  10992. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10993. e.remembered || (e.remembered = {}),
  10994. e.remembered[this.preset] = b(this)),
  10995. e.folders = {},
  10996. f.each(this.__folders, function(t, i) {
  10997. e.folders[i] = t.getSaveObject()
  10998. }),
  10999. e
  11000. },
  11001. save: function() {
  11002. this.load.remembered || (this.load.remembered = {}),
  11003. this.load.remembered[this.preset] = b(this),
  11004. T(this, !1),
  11005. this.saveToLocalStorageIfPossible()
  11006. },
  11007. saveAs: function(e) {
  11008. this.load.remembered || (this.load.remembered = {},
  11009. this.load.remembered[L] = b(this, !0)),
  11010. this.load.remembered[e] = b(this),
  11011. this.preset = e,
  11012. w(this, e, !0),
  11013. this.saveToLocalStorageIfPossible()
  11014. },
  11015. revert: function(e) {
  11016. f.each(this.__controllers, function(t) {
  11017. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11018. }, this),
  11019. f.each(this.__folders, function(e) {
  11020. e.revert(e)
  11021. }),
  11022. e || T(this.getRoot(), !1)
  11023. },
  11024. listen: function(e) {
  11025. var t = 0 == this.__listening.length;
  11026. this.__listening.push(e),
  11027. t && x(this.__listening)
  11028. }
  11029. }),
  11030. V
  11031. }(n.utils.css, '<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>', ".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", n.controllers.factory = function(e, t, i, n, r, o, a) {
  11032. return function(s, l) {
  11033. var c = s[l];
  11034. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  11035. min: arguments[2],
  11036. max: arguments[3]
  11037. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11038. }
  11039. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11040. var n = function(e, i) {
  11041. function r() {
  11042. a.setValue(a.__input.value)
  11043. }
  11044. function o() {
  11045. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11046. }
  11047. n.superclass.call(this, e, i);
  11048. var a = this;
  11049. this.__input = document.createElement("input"),
  11050. this.__input.setAttribute("type", "text"),
  11051. t.bind(this.__input, "keyup", r),
  11052. t.bind(this.__input, "change", r),
  11053. t.bind(this.__input, "blur", o),
  11054. t.bind(this.__input, "keydown", function(e) {
  11055. 13 === e.keyCode && this.blur()
  11056. }),
  11057. this.updateDisplay(),
  11058. this.domElement.appendChild(this.__input)
  11059. };
  11060. return n.superclass = e,
  11061. i.extend(n.prototype, e.prototype, {
  11062. updateDisplay: function() {
  11063. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11064. n.superclass.prototype.updateDisplay.call(this)
  11065. }
  11066. }),
  11067. n
  11068. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  11069. function o(e, t, i, n) {
  11070. e.style.background = "",
  11071. r.each(l, function(r) {
  11072. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11073. })
  11074. }
  11075. function a(e) {
  11076. e.style.background = "",
  11077. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11078. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11079. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11080. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11081. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11082. }
  11083. var s = function(e, l) {
  11084. function c(e) {
  11085. p(e),
  11086. t.bind(window, "mousemove", p),
  11087. t.bind(window, "mouseup", h)
  11088. }
  11089. function h() {
  11090. t.unbind(window, "mousemove", p),
  11091. t.unbind(window, "mouseup", h)
  11092. }
  11093. function u() {
  11094. var e = n(this.value);
  11095. e !== !1 ? (g.__color.__state = e,
  11096. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11097. }
  11098. function d() {
  11099. t.unbind(window, "mousemove", f),
  11100. t.unbind(window, "mouseup", d)
  11101. }
  11102. function p(e) {
  11103. e.preventDefault();
  11104. var i = t.getWidth(g.__saturation_field)
  11105. , n = t.getOffset(g.__saturation_field)
  11106. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11107. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11108. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11109. r > 1 ? r = 1 : r < 0 && (r = 0),
  11110. g.__color.v = o,
  11111. g.__color.s = r,
  11112. g.setValue(g.__color.toOriginal()),
  11113. !1
  11114. }
  11115. function f(e) {
  11116. e.preventDefault();
  11117. var i = t.getHeight(g.__hue_field)
  11118. , n = t.getOffset(g.__hue_field)
  11119. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11120. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11121. g.__color.h = 360 * r,
  11122. g.setValue(g.__color.toOriginal()),
  11123. !1
  11124. }
  11125. s.superclass.call(this, e, l),
  11126. this.__color = new i(this.getValue()),
  11127. this.__temp = new i(0);
  11128. var g = this;
  11129. this.domElement = document.createElement("div"),
  11130. t.makeSelectable(this.domElement, !1),
  11131. this.__selector = document.createElement("div"),
  11132. this.__selector.className = "selector",
  11133. this.__saturation_field = document.createElement("div"),
  11134. this.__saturation_field.className = "saturation-field",
  11135. this.__field_knob = document.createElement("div"),
  11136. this.__field_knob.className = "field-knob",
  11137. this.__field_knob_border = "2px solid ",
  11138. this.__hue_knob = document.createElement("div"),
  11139. this.__hue_knob.className = "hue-knob",
  11140. this.__hue_field = document.createElement("div"),
  11141. this.__hue_field.className = "hue-field",
  11142. this.__input = document.createElement("input"),
  11143. this.__input.type = "text",
  11144. this.__input_textShadow = "0 1px 1px ",
  11145. t.bind(this.__input, "keydown", function(e) {
  11146. 13 === e.keyCode && u.call(this)
  11147. }),
  11148. t.bind(this.__input, "blur", u),
  11149. t.bind(this.__selector, "mousedown", function(e) {
  11150. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11151. t.removeClass(g.__selector, "drag")
  11152. })
  11153. });
  11154. var m = document.createElement("div");
  11155. r.extend(this.__selector.style, {
  11156. width: "122px",
  11157. height: "102px",
  11158. padding: "3px",
  11159. backgroundColor: "#222",
  11160. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11161. }),
  11162. r.extend(this.__field_knob.style, {
  11163. position: "absolute",
  11164. width: "12px",
  11165. height: "12px",
  11166. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11167. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11168. borderRadius: "12px",
  11169. zIndex: 1
  11170. }),
  11171. r.extend(this.__hue_knob.style, {
  11172. position: "absolute",
  11173. width: "15px",
  11174. height: "2px",
  11175. borderRight: "4px solid #fff",
  11176. zIndex: 1
  11177. }),
  11178. r.extend(this.__saturation_field.style, {
  11179. width: "100px",
  11180. height: "100px",
  11181. border: "1px solid #555",
  11182. marginRight: "3px",
  11183. display: "inline-block",
  11184. cursor: "pointer"
  11185. }),
  11186. r.extend(m.style, {
  11187. width: "100%",
  11188. height: "100%",
  11189. background: "none"
  11190. }),
  11191. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11192. r.extend(this.__hue_field.style, {
  11193. width: "15px",
  11194. height: "100px",
  11195. display: "inline-block",
  11196. border: "1px solid #555",
  11197. cursor: "ns-resize"
  11198. }),
  11199. a(this.__hue_field),
  11200. r.extend(this.__input.style, {
  11201. outline: "none",
  11202. textAlign: "center",
  11203. color: "#fff",
  11204. border: 0,
  11205. fontWeight: "bold",
  11206. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11207. }),
  11208. t.bind(this.__saturation_field, "mousedown", c),
  11209. t.bind(this.__field_knob, "mousedown", c),
  11210. t.bind(this.__hue_field, "mousedown", function(e) {
  11211. f(e),
  11212. t.bind(window, "mousemove", f),
  11213. t.bind(window, "mouseup", d)
  11214. }),
  11215. this.__saturation_field.appendChild(m),
  11216. this.__selector.appendChild(this.__field_knob),
  11217. this.__selector.appendChild(this.__saturation_field),
  11218. this.__selector.appendChild(this.__hue_field),
  11219. this.__hue_field.appendChild(this.__hue_knob),
  11220. this.domElement.appendChild(this.__input),
  11221. this.domElement.appendChild(this.__selector),
  11222. this.updateDisplay()
  11223. };
  11224. s.superclass = e,
  11225. r.extend(s.prototype, e.prototype, {
  11226. updateDisplay: function() {
  11227. var e = n(this.getValue());
  11228. if (e !== !1) {
  11229. var t = !1;
  11230. r.each(i.COMPONENTS, function(i) {
  11231. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11232. return t = !0,
  11233. {}
  11234. }, this),
  11235. t && r.extend(this.__color.__state, e)
  11236. }
  11237. r.extend(this.__temp.__state, this.__color.__state),
  11238. this.__temp.a = 1;
  11239. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11240. , s = 255 - a;
  11241. r.extend(this.__field_knob.style, {
  11242. marginLeft: 100 * this.__color.s - 7 + "px",
  11243. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11244. backgroundColor: this.__temp.toString(),
  11245. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11246. }),
  11247. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11248. this.__temp.s = 1,
  11249. this.__temp.v = 1,
  11250. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11251. r.extend(this.__input.style, {
  11252. backgroundColor: this.__input.value = this.__color.toString(),
  11253. color: "rgb(" + a + "," + a + "," + a + ")",
  11254. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11255. })
  11256. }
  11257. });
  11258. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11259. return s
  11260. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11261. function r(e, t, i) {
  11262. Object.defineProperty(e, t, {
  11263. get: function() {
  11264. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11265. this.__state[t])
  11266. },
  11267. set: function(e) {
  11268. "RGB" !== this.__state.space && (a(this, t, i),
  11269. this.__state.space = "RGB"),
  11270. this.__state[t] = e
  11271. }
  11272. })
  11273. }
  11274. function o(e, t) {
  11275. Object.defineProperty(e, t, {
  11276. get: function() {
  11277. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11278. this.__state[t])
  11279. },
  11280. set: function(e) {
  11281. "HSV" !== this.__state.space && (s(this),
  11282. this.__state.space = "HSV"),
  11283. this.__state[t] = e
  11284. }
  11285. })
  11286. }
  11287. function a(e, i, r) {
  11288. if ("HEX" === e.__state.space)
  11289. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11290. else {
  11291. if ("HSV" !== e.__state.space)
  11292. throw "Corrupted color state";
  11293. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11294. }
  11295. }
  11296. function s(e) {
  11297. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11298. n.extend(e.__state, {
  11299. s: i.s,
  11300. v: i.v
  11301. }),
  11302. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11303. }
  11304. var l = function() {
  11305. if (this.__state = e.apply(this, arguments),
  11306. this.__state === !1)
  11307. throw "Failed to interpret color arguments";
  11308. this.__state.a = this.__state.a || 1
  11309. };
  11310. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11311. n.extend(l.prototype, {
  11312. toString: function() {
  11313. return i(this)
  11314. },
  11315. toOriginal: function() {
  11316. return this.__state.conversion.write(this)
  11317. }
  11318. }),
  11319. r(l.prototype, "r", 2),
  11320. r(l.prototype, "g", 1),
  11321. r(l.prototype, "b", 0),
  11322. o(l.prototype, "h"),
  11323. o(l.prototype, "s"),
  11324. o(l.prototype, "v"),
  11325. Object.defineProperty(l.prototype, "a", {
  11326. get: function() {
  11327. return this.__state.a
  11328. },
  11329. set: function(e) {
  11330. this.__state.a = e
  11331. }
  11332. }),
  11333. Object.defineProperty(l.prototype, "hex", {
  11334. get: function() {
  11335. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11336. this.__state.hex
  11337. },
  11338. set: function(e) {
  11339. this.__state.space = "HEX",
  11340. this.__state.hex = e
  11341. }
  11342. }),
  11343. l
  11344. }(n.color.interpret, n.color.math = function() {
  11345. var e;
  11346. return {
  11347. hsv_to_rgb: function(e, t, i) {
  11348. var n = Math.floor(e / 60) % 6
  11349. , r = e / 60 - Math.floor(e / 60)
  11350. , o = i * (1 - t)
  11351. , a = i * (1 - r * t)
  11352. , s = i * (1 - (1 - r) * t)
  11353. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11354. return {
  11355. r: 255 * l[0],
  11356. g: 255 * l[1],
  11357. b: 255 * l[2]
  11358. }
  11359. },
  11360. rgb_to_hsv: function(e, t, i) {
  11361. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11362. return 0 == a ? {
  11363. h: NaN,
  11364. s: 0,
  11365. v: 0
  11366. } : (r = s / a,
  11367. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11368. n /= 6,
  11369. n < 0 && (n += 1),
  11370. {
  11371. h: 360 * n,
  11372. s: r,
  11373. v: a / 255
  11374. })
  11375. },
  11376. rgb_to_hex: function(e, t, i) {
  11377. var n = this.hex_with_component(0, 2, e);
  11378. return n = this.hex_with_component(n, 1, t),
  11379. n = this.hex_with_component(n, 0, i)
  11380. },
  11381. component_from_hex: function(e, t) {
  11382. return e >> 8 * t & 255
  11383. },
  11384. hex_with_component: function(t, i, n) {
  11385. return n << (e = 8 * i) | t & ~(255 << e)
  11386. }
  11387. }
  11388. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11389. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11390. window.setTimeout(e, 1e3 / 60)
  11391. }
  11392. }(), n.dom.CenteredDiv = function(e, t) {
  11393. var i = function() {
  11394. this.backgroundElement = document.createElement("div"),
  11395. t.extend(this.backgroundElement.style, {
  11396. backgroundColor: "rgba(0,0,0,0.8)",
  11397. top: 0,
  11398. left: 0,
  11399. display: "none",
  11400. zIndex: "1000",
  11401. opacity: 0,
  11402. WebkitTransition: "opacity 0.2s linear"
  11403. }),
  11404. e.makeFullscreen(this.backgroundElement),
  11405. this.backgroundElement.style.position = "fixed",
  11406. this.domElement = document.createElement("div"),
  11407. t.extend(this.domElement.style, {
  11408. position: "fixed",
  11409. display: "none",
  11410. zIndex: "1001",
  11411. opacity: 0,
  11412. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11413. }),
  11414. document.body.appendChild(this.backgroundElement),
  11415. document.body.appendChild(this.domElement);
  11416. var i = this;
  11417. e.bind(this.backgroundElement, "click", function() {
  11418. i.hide()
  11419. })
  11420. };
  11421. return i.prototype.show = function() {
  11422. var e = this;
  11423. this.backgroundElement.style.display = "block",
  11424. this.domElement.style.display = "block",
  11425. this.domElement.style.opacity = 0,
  11426. this.domElement.style.webkitTransform = "scale(1.1)",
  11427. this.layout(),
  11428. t.defer(function() {
  11429. e.backgroundElement.style.opacity = 1,
  11430. e.domElement.style.opacity = 1,
  11431. e.domElement.style.webkitTransform = "scale(1)"
  11432. })
  11433. }
  11434. ,
  11435. i.prototype.hide = function() {
  11436. var t = this
  11437. , i = function() {
  11438. t.domElement.style.display = "none",
  11439. t.backgroundElement.style.display = "none",
  11440. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11441. e.unbind(t.domElement, "transitionend", i),
  11442. e.unbind(t.domElement, "oTransitionEnd", i)
  11443. };
  11444. e.bind(this.domElement, "webkitTransitionEnd", i),
  11445. e.bind(this.domElement, "transitionend", i),
  11446. e.bind(this.domElement, "oTransitionEnd", i),
  11447. this.backgroundElement.style.opacity = 0,
  11448. this.domElement.style.opacity = 0,
  11449. this.domElement.style.webkitTransform = "scale(1.1)"
  11450. }
  11451. ,
  11452. i.prototype.layout = function() {
  11453. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11454. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11455. }
  11456. ,
  11457. i
  11458. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11459. }
  11460. , {}],
  11461. 94: [function(e, t, i) {
  11462. (function(e) {
  11463. "use strict";
  11464. function i(t) {
  11465. function i(e) {
  11466. for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], i = 0; i < 64; i++) {
  11467. var n = _((t[i] * e + 50) / 100);
  11468. n < 1 ? n = 1 : n > 255 && (n = 255),
  11469. T[G[i]] = n
  11470. }
  11471. for (var r = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {
  11472. var a = _((r[o] * e + 50) / 100);
  11473. a < 1 ? a = 1 : a > 255 && (a = 255),
  11474. x[G[o]] = a
  11475. }
  11476. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11477. for (var h = 0; h < 8; h++)
  11478. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11479. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11480. l++
  11481. }
  11482. function n(e, t) {
  11483. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11484. for (var a = 1; a <= e[o]; a++)
  11485. r[t[n]] = [],
  11486. r[t[n]][0] = i,
  11487. r[t[n]][1] = o,
  11488. n++,
  11489. i++;
  11490. i *= 2
  11491. }
  11492. return r
  11493. }
  11494. function r() {
  11495. C = n(z, W),
  11496. I = n(X, Z),
  11497. E = n(j, Y),
  11498. b = n(q, K)
  11499. }
  11500. function o() {
  11501. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11502. for (var n = e; n < t; n++)
  11503. P[32767 + n] = i,
  11504. R[32767 + n] = [],
  11505. R[32767 + n][1] = i,
  11506. R[32767 + n][0] = n;
  11507. for (var r = -(t - 1); r <= -e; r++)
  11508. P[32767 + r] = i,
  11509. R[32767 + r] = [],
  11510. R[32767 + r][1] = i,
  11511. R[32767 + r][0] = t - 1 + r;
  11512. e <<= 1,
  11513. t <<= 1
  11514. }
  11515. }
  11516. function a() {
  11517. for (var e = 0; e < 256; e++)
  11518. H[e] = 19595 * e,
  11519. H[e + 256 >> 0] = 38470 * e,
  11520. H[e + 512 >> 0] = 7471 * e + 32768,
  11521. H[e + 768 >> 0] = -11059 * e,
  11522. H[e + 1024 >> 0] = -21709 * e,
  11523. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11524. H[e + 1536 >> 0] = -27439 * e,
  11525. H[e + 1792 >> 0] = -5329 * e
  11526. }
  11527. function s(e) {
  11528. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11529. t & 1 << i && (N |= 1 << B),
  11530. i--,
  11531. B--,
  11532. B < 0 && (255 == N ? (l(255),
  11533. l(0)) : l(N),
  11534. B = 7,
  11535. N = 0)
  11536. }
  11537. function l(e) {
  11538. D.push(e)
  11539. }
  11540. function c(e) {
  11541. l(e >> 8 & 255),
  11542. l(255 & e)
  11543. }
  11544. function h(e, t) {
  11545. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11546. for (h = 0; h < d; ++h) {
  11547. i = e[u],
  11548. n = e[u + 1],
  11549. r = e[u + 2],
  11550. o = e[u + 3],
  11551. a = e[u + 4],
  11552. s = e[u + 5],
  11553. l = e[u + 6],
  11554. c = e[u + 7];
  11555. var f = i + c
  11556. , g = i - c
  11557. , m = n + l
  11558. , v = n - l
  11559. , A = r + s
  11560. , y = r - s
  11561. , C = o + a
  11562. , I = o - a
  11563. , E = f + C
  11564. , b = f - C
  11565. , w = m + A
  11566. , _ = m - A;
  11567. e[u] = E + w,
  11568. e[u + 4] = E - w;
  11569. var T = .707106781 * (_ + b);
  11570. e[u + 2] = b + T,
  11571. e[u + 6] = b - T,
  11572. E = I + y,
  11573. w = y + v,
  11574. _ = v + g;
  11575. var x = .382683433 * (E - _)
  11576. , S = .5411961 * E + x
  11577. , M = 1.306562965 * _ + x
  11578. , R = .707106781 * w
  11579. , P = g + R
  11580. , L = g - R;
  11581. e[u + 5] = L + S,
  11582. e[u + 3] = L - S,
  11583. e[u + 1] = P + M,
  11584. e[u + 7] = P - M,
  11585. u += 8
  11586. }
  11587. for (u = 0,
  11588. h = 0; h < d; ++h) {
  11589. i = e[u],
  11590. n = e[u + 8],
  11591. r = e[u + 16],
  11592. o = e[u + 24],
  11593. a = e[u + 32],
  11594. s = e[u + 40],
  11595. l = e[u + 48],
  11596. c = e[u + 56];
  11597. var D = i + c
  11598. , N = i - c
  11599. , B = n + l
  11600. , F = n - l
  11601. , V = r + s
  11602. , U = r - s
  11603. , k = o + a
  11604. , H = o - a
  11605. , G = D + k
  11606. , z = D - k
  11607. , W = B + V
  11608. , j = B - V;
  11609. e[u] = G + W,
  11610. e[u + 32] = G - W;
  11611. var Y = .707106781 * (j + z);
  11612. e[u + 16] = z + Y,
  11613. e[u + 48] = z - Y,
  11614. G = H + U,
  11615. W = U + F,
  11616. j = F + N;
  11617. var X = .382683433 * (G - j)
  11618. , Z = .5411961 * G + X
  11619. , q = 1.306562965 * j + X
  11620. , K = .707106781 * W
  11621. , Q = N + K
  11622. , J = N - K;
  11623. e[u + 40] = J + Z,
  11624. e[u + 24] = J - Z,
  11625. e[u + 8] = Q + q,
  11626. e[u + 56] = Q - q,
  11627. u++
  11628. }
  11629. var $;
  11630. for (h = 0; h < p; ++h)
  11631. $ = e[h] * t[h],
  11632. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11633. return O
  11634. }
  11635. function u() {
  11636. c(65504),
  11637. c(16),
  11638. l(74),
  11639. l(70),
  11640. l(73),
  11641. l(70),
  11642. l(0),
  11643. l(1),
  11644. l(1),
  11645. l(0),
  11646. c(1),
  11647. c(1),
  11648. l(0),
  11649. l(0)
  11650. }
  11651. function d(e, t) {
  11652. c(65472),
  11653. c(17),
  11654. l(8),
  11655. c(t),
  11656. c(e),
  11657. l(3),
  11658. l(1),
  11659. l(17),
  11660. l(0),
  11661. l(2),
  11662. l(17),
  11663. l(1),
  11664. l(3),
  11665. l(17),
  11666. l(1)
  11667. }
  11668. function p() {
  11669. c(65499),
  11670. c(132),
  11671. l(0);
  11672. for (var e = 0; e < 64; e++)
  11673. l(T[e]);
  11674. l(1);
  11675. for (var t = 0; t < 64; t++)
  11676. l(x[t])
  11677. }
  11678. function f() {
  11679. c(65476),
  11680. c(418),
  11681. l(0);
  11682. for (var e = 0; e < 16; e++)
  11683. l(z[e + 1]);
  11684. for (var t = 0; t <= 11; t++)
  11685. l(W[t]);
  11686. l(16);
  11687. for (var i = 0; i < 16; i++)
  11688. l(j[i + 1]);
  11689. for (var n = 0; n <= 161; n++)
  11690. l(Y[n]);
  11691. l(1);
  11692. for (var r = 0; r < 16; r++)
  11693. l(X[r + 1]);
  11694. for (var o = 0; o <= 11; o++)
  11695. l(Z[o]);
  11696. l(17);
  11697. for (var a = 0; a < 16; a++)
  11698. l(q[a + 1]);
  11699. for (var s = 0; s <= 161; s++)
  11700. l(K[s])
  11701. }
  11702. function g() {
  11703. c(65498),
  11704. c(12),
  11705. l(3),
  11706. l(1),
  11707. l(0),
  11708. l(2),
  11709. l(17),
  11710. l(3),
  11711. l(17),
  11712. l(0),
  11713. l(63),
  11714. l(0)
  11715. }
  11716. function m(e, t, i, n, r) {
  11717. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11718. L[G[f]] = p[f];
  11719. var g = L[0] - i;
  11720. i = L[0],
  11721. 0 == g ? s(n[0]) : (o = 32767 + g,
  11722. s(n[P[o]]),
  11723. s(R[o]));
  11724. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11725. ;
  11726. if (0 == m)
  11727. return s(a),
  11728. i;
  11729. for (var v, A = 1; A <= m; ) {
  11730. for (var y = A; 0 == L[A] && A <= m; ++A)
  11731. ;
  11732. var C = A - y;
  11733. if (C >= c) {
  11734. v = C >> 4;
  11735. for (var I = 1; I <= v; ++I)
  11736. s(l);
  11737. C &= 15
  11738. }
  11739. o = 32767 + L[A],
  11740. s(r[(C << 4) + P[o]]),
  11741. s(R[o]),
  11742. A++
  11743. }
  11744. return m != u && s(a),
  11745. i
  11746. }
  11747. function v() {
  11748. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11749. k[t] = e(t)
  11750. }
  11751. function A(e) {
  11752. if (e <= 0 && (e = 1),
  11753. e > 100 && (e = 100),
  11754. w != e) {
  11755. var t = 0;
  11756. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11757. i(t),
  11758. w = e
  11759. }
  11760. }
  11761. function y() {
  11762. var e = (new Date).getTime();
  11763. t || (t = 50),
  11764. v(),
  11765. r(),
  11766. o(),
  11767. a(),
  11768. A(t);
  11769. (new Date).getTime() - e
  11770. }
  11771. var C, I, E, b, w, _ = (Math.round,
  11772. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11773. this.encode = function(t, i) {
  11774. var n = ((new Date).getTime(),
  11775. i.quality);
  11776. n && A(n),
  11777. D = new Array,
  11778. N = 0,
  11779. B = 7,
  11780. c(65496),
  11781. u(),
  11782. p(),
  11783. d(t.width, t.height),
  11784. f(),
  11785. g();
  11786. var r = 0
  11787. , o = 0
  11788. , a = 0;
  11789. N = 0,
  11790. B = 7,
  11791. this.encode.displayName = "_encode_";
  11792. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  11793. for (l = 0; l < G; ) {
  11794. for (w = G * z + l,
  11795. _ = w,
  11796. T = -1,
  11797. x = 0,
  11798. R = 0; R < 64; R++)
  11799. x = (k ? 63 - R : R) >> 3,
  11800. T = 4 * (7 & R),
  11801. _ = w + x * G + T,
  11802. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11803. l + T >= G && (_ -= l + T - G + 4),
  11804. h = P[_++],
  11805. v = P[_++],
  11806. y = P[_++],
  11807. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11808. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11809. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11810. r = m(F, S, r, C, E),
  11811. o = m(V, M, o, I, b),
  11812. a = m(U, M, a, I, b),
  11813. l += 32
  11814. }
  11815. z += W
  11816. }
  11817. if (B >= 0) {
  11818. var j = [];
  11819. j[1] = B + 1,
  11820. j[0] = (1 << B + 1) - 1,
  11821. s(j)
  11822. }
  11823. return c(65497),
  11824. new e(D)
  11825. }
  11826. ,
  11827. y()
  11828. }
  11829. function n(e, t) {
  11830. t = t || {},
  11831. t.quality = t.quality || 50;
  11832. var n = t.quality
  11833. , r = new i(n)
  11834. , o = r.encode(e, t);
  11835. return {
  11836. data: o,
  11837. width: e.width,
  11838. height: e.height
  11839. }
  11840. }
  11841. t.exports.encode = n
  11842. }
  11843. ).call(this, e("buffer").Buffer)
  11844. }
  11845. , {
  11846. buffer: 198
  11847. }],
  11848. 95: [function(e, t, i) {
  11849. "use strict";
  11850. !function() {
  11851. if ("performance"in window == !1 && (window.performance = {}),
  11852. Date.now = Date.now || function() {
  11853. return (new Date).getTime()
  11854. }
  11855. ,
  11856. "now"in window.performance == !1) {
  11857. var e = Date.now();
  11858. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11859. window.performance.now = function() {
  11860. return Date.now() - e
  11861. }
  11862. }
  11863. }()
  11864. }
  11865. , {}],
  11866. 96: [function(e, t, i) {
  11867. "use strict";
  11868. var n = e("three");
  11869. n.EffectComposer = function(e, t) {
  11870. if (this.renderer = e,
  11871. void 0 === t) {
  11872. var i = {
  11873. minFilter: n.LinearFilter,
  11874. magFilter: n.LinearFilter,
  11875. format: n.RGBAFormat,
  11876. stencilBuffer: !1
  11877. }
  11878. , r = e.getSize();
  11879. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11880. }
  11881. this.renderTarget1 = t,
  11882. this.renderTarget2 = t.clone(),
  11883. this.writeBuffer = this.renderTarget1,
  11884. this.readBuffer = this.renderTarget2,
  11885. this.passes = [],
  11886. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11887. this.copyPass = new n.ShaderPass(n.CopyShader)
  11888. }
  11889. ,
  11890. n.EffectComposer.prototype = {
  11891. swapBuffers: function() {
  11892. var e = this.readBuffer;
  11893. this.readBuffer = this.writeBuffer,
  11894. this.writeBuffer = e
  11895. },
  11896. addPass: function(e) {
  11897. this.passes.push(e)
  11898. },
  11899. insertPass: function(e, t) {
  11900. this.passes.splice(t, 0, e)
  11901. },
  11902. render: function(e) {
  11903. this.writeBuffer = this.renderTarget1,
  11904. this.readBuffer = this.renderTarget2;
  11905. var t, i, r = !1, o = this.passes.length;
  11906. for (i = 0; i < o; i++)
  11907. if (t = this.passes[i],
  11908. t.enabled) {
  11909. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11910. t.needsSwap) {
  11911. if (r) {
  11912. var a = this.renderer.context;
  11913. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11914. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11915. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11916. }
  11917. this.swapBuffers()
  11918. }
  11919. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11920. }
  11921. },
  11922. reset: function(e) {
  11923. if (void 0 === e) {
  11924. var t = this.renderer.getSize();
  11925. e = this.renderTarget1.clone(),
  11926. e.setSize(t.width, t.height)
  11927. }
  11928. this.renderTarget1.dispose(),
  11929. this.renderTarget2.dispose(),
  11930. this.renderTarget1 = e,
  11931. this.renderTarget2 = e.clone(),
  11932. this.writeBuffer = this.renderTarget1,
  11933. this.readBuffer = this.renderTarget2
  11934. },
  11935. setSize: function(e, t) {
  11936. this.renderTarget1.setSize(e, t),
  11937. this.renderTarget2.setSize(e, t)
  11938. this.passes.forEach(a=>{//add
  11939. a.setSize && a.setSize(e, t)
  11940. })
  11941. }
  11942. }
  11943. }
  11944. , {
  11945. three: 217
  11946. }],
  11947. 97: [function(e, t, i) {
  11948. "use strict";
  11949. var n = e("three");
  11950. n.MaskPass = function(e, t) {
  11951. this.scene = e,
  11952. this.camera = t,
  11953. this.enabled = !0,
  11954. this.clear = !0,
  11955. this.needsSwap = !1,
  11956. this.inverse = !1
  11957. }
  11958. ,
  11959. n.MaskPass.prototype = {
  11960. render: function(e, t, i, n) {
  11961. var r = e.context;
  11962. r.colorMask(!1, !1, !1, !1),
  11963. r.depthMask(!1);
  11964. var o, a;
  11965. this.inverse ? (o = 0,
  11966. a = 1) : (o = 1,
  11967. a = 0),
  11968. r.enable(r.STENCIL_TEST),
  11969. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11970. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11971. r.clearStencil(a),
  11972. e.render(this.scene, this.camera, i, this.clear),
  11973. e.render(this.scene, this.camera, t, this.clear),
  11974. r.colorMask(!0, !0, !0, !0),
  11975. r.depthMask(!0),
  11976. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11977. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11978. }
  11979. },
  11980. n.ClearMaskPass = function() {
  11981. this.enabled = !0
  11982. }
  11983. ,
  11984. n.ClearMaskPass.prototype = {
  11985. render: function(e, t, i, n) {
  11986. var r = e.context;
  11987. r.disable(r.STENCIL_TEST)
  11988. }
  11989. }
  11990. }
  11991. , {
  11992. three: 217
  11993. }],
  11994. 98: [function(e, t, i) {
  11995. "use strict";
  11996. var n = e("three");
  11997. n.RenderPass = function(e, t, i, r, o) {
  11998. this.scene = e,
  11999. this.camera = t,
  12000. this.overrideMaterial = i,
  12001. this.clearColor = r,
  12002. this.clearAlpha = void 0 !== o ? o : 1,
  12003. this.oldClearColor = new n.Color,
  12004. this.oldClearAlpha = 1,
  12005. this.enabled = !0,
  12006. this.clear = !0,
  12007. this.needsSwap = !1
  12008. }
  12009. ,
  12010. n.RenderPass.prototype = {
  12011. render: function(e, t, i, n) {
  12012. this.scene.overrideMaterial = this.overrideMaterial,
  12013. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12014. this.oldClearAlpha = e.getClearAlpha(),
  12015. e.setClearColor(this.clearColor, this.clearAlpha)),
  12016. e.render(this.scene, this.camera, i, this.clear),
  12017. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12018. this.scene.overrideMaterial = null
  12019. }
  12020. }
  12021. }
  12022. , {
  12023. three: 217
  12024. }],
  12025. 99: [function(e, t, i) {
  12026. "use strict";
  12027. var n = e("three");
  12028. n.ShaderPass = function(e, t) {
  12029. this.textureID = void 0 !== t ? t : "tDiffuse",
  12030. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12031. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12032. this.material = new n.ShaderMaterial({
  12033. defines: e.defines || {},
  12034. uniforms: this.uniforms,
  12035. vertexShader: e.vertexShader,
  12036. fragmentShader: e.fragmentShader
  12037. })),
  12038. this.renderToScreen = !1,
  12039. this.enabled = !0,
  12040. this.needsSwap = !0,
  12041. this.clear = !1,
  12042. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12043. this.scene = new n.Scene,
  12044. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12045. this.scene.add(this.quad)
  12046. }
  12047. ,
  12048. n.ShaderPass.prototype = {
  12049. render: function(e, t, i, n) {
  12050. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12051. this.quad.material = this.material,
  12052. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12053. }
  12054. }
  12055. }
  12056. , {
  12057. three: 217
  12058. }],
  12059. 100: [function(e, t, i) {
  12060. "use strict";
  12061. var n = e("three");
  12062. n.CopyShader = {
  12063. uniforms: {
  12064. tDiffuse: {
  12065. type: "t",
  12066. value: null
  12067. },
  12068. opacity: {
  12069. type: "f",
  12070. value: 1
  12071. }
  12072. },
  12073. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12074. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12075. }
  12076. }
  12077. , {
  12078. three: 217
  12079. }],
  12080. 101: [function(e, t, i) {
  12081. "use strict";
  12082. var n = e("three");
  12083. n.HorizontalBlurShader = {
  12084. uniforms: {
  12085. tDiffuse: {
  12086. type: "t",
  12087. value: null
  12088. },
  12089. h: {
  12090. type: "f",
  12091. value: 1 / 512
  12092. }
  12093. },
  12094. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12095. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  12096. }
  12097. }
  12098. , {
  12099. three: 217
  12100. }],
  12101. 102: [function(e, t, i) {
  12102. "use strict";
  12103. var n = e("three");
  12104. n.VerticalBlurShader = {
  12105. uniforms: {
  12106. tDiffuse: {
  12107. type: "t",
  12108. value: null
  12109. },
  12110. v: {
  12111. type: "f",
  12112. value: 1 / 512
  12113. }
  12114. },
  12115. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12116. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  12117. }
  12118. }
  12119. , {
  12120. three: 217
  12121. }],
  12122. 103: [function(e, t, i) {
  12123. "use strict";
  12124. var n = e("three");
  12125. !function() {
  12126. if ("performance"in window == 0 && (window.performance = {}),
  12127. "now"in window.performance == 0) {
  12128. var e = Date.now();
  12129. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12130. window.performance.now = function() {
  12131. return Date.now() - e
  12132. }
  12133. }
  12134. }(),
  12135. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12136. var t, i = this.extensions, r = this.context;
  12137. if (e === n.RepeatWrapping)
  12138. return r.REPEAT;
  12139. if (e === n.ClampToEdgeWrapping)
  12140. return r.CLAMP_TO_EDGE;
  12141. if (e === n.MirroredRepeatWrapping)
  12142. return r.MIRRORED_REPEAT;
  12143. if (e === n.NearestFilter)
  12144. return r.NEAREST;
  12145. if (e === n.NearestMipMapNearestFilter)
  12146. return r.NEAREST_MIPMAP_NEAREST;
  12147. if (e === n.NearestMipMapLinearFilter)
  12148. return r.NEAREST_MIPMAP_LINEAR;
  12149. if (e === n.LinearFilter)
  12150. return r.LINEAR;
  12151. if (e === n.LinearMipMapNearestFilter)
  12152. return r.LINEAR_MIPMAP_NEAREST;
  12153. if (e === n.LinearMipMapLinearFilter)
  12154. return r.LINEAR_MIPMAP_LINEAR;
  12155. if (e === n.UnsignedByteType)
  12156. return r.UNSIGNED_BYTE;
  12157. if (e === n.UnsignedShort4444Type)
  12158. return r.UNSIGNED_SHORT_4_4_4_4;
  12159. if (e === n.UnsignedShort5551Type)
  12160. return r.UNSIGNED_SHORT_5_5_5_1;
  12161. if (e === n.UnsignedShort565Type)
  12162. return r.UNSIGNED_SHORT_5_6_5;
  12163. if (e === n.ByteType)
  12164. return r.BYTE;
  12165. if (e === n.ShortType)
  12166. return r.SHORT;
  12167. if (e === n.UnsignedShortType)
  12168. return r.UNSIGNED_SHORT;
  12169. if (e === n.IntType)
  12170. return r.INT;
  12171. if (e === n.UnsignedIntType)
  12172. return r.UNSIGNED_INT;
  12173. if (e === n.FloatType)
  12174. return r.FLOAT;
  12175. if (t = i.get("OES_texture_half_float"),
  12176. null !== t && e === n.HalfFloatType)
  12177. return t.HALF_FLOAT_OES;
  12178. if (e === n.AlphaFormat)
  12179. return r.ALPHA;
  12180. if (e === n.RGBFormat)
  12181. return r.RGB;
  12182. if (e === n.RGBAFormat)
  12183. return r.RGBA;
  12184. if (e === n.LuminanceFormat)
  12185. return r.LUMINANCE;
  12186. if (e === n.LuminanceAlphaFormat)
  12187. return r.LUMINANCE_ALPHA;
  12188. if (e === n.AddEquation)
  12189. return r.FUNC_ADD;
  12190. if (e === n.SubtractEquation)
  12191. return r.FUNC_SUBTRACT;
  12192. if (e === n.ReverseSubtractEquation)
  12193. return r.FUNC_REVERSE_SUBTRACT;
  12194. if (e === n.ZeroFactor)
  12195. return r.ZERO;
  12196. if (e === n.OneFactor)
  12197. return r.ONE;
  12198. if (e === n.SrcColorFactor)
  12199. return r.SRC_COLOR;
  12200. if (e === n.OneMinusSrcColorFactor)
  12201. return r.ONE_MINUS_SRC_COLOR;
  12202. if (e === n.SrcAlphaFactor)
  12203. return r.SRC_ALPHA;
  12204. if (e === n.OneMinusSrcAlphaFactor)
  12205. return r.ONE_MINUS_SRC_ALPHA;
  12206. if (e === n.DstAlphaFactor)
  12207. return r.DST_ALPHA;
  12208. if (e === n.OneMinusDstAlphaFactor)
  12209. return r.ONE_MINUS_DST_ALPHA;
  12210. if (e === n.DstColorFactor)
  12211. return r.DST_COLOR;
  12212. if (e === n.OneMinusDstColorFactor)
  12213. return r.ONE_MINUS_DST_COLOR;
  12214. if (e === n.SrcAlphaSaturateFactor)
  12215. return r.SRC_ALPHA_SATURATE;
  12216. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12217. null !== t) {
  12218. if (e === n.RGB_S3TC_DXT1_Format)
  12219. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12220. if (e === n.RGBA_S3TC_DXT1_Format)
  12221. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12222. if (e === n.RGBA_S3TC_DXT3_Format)
  12223. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12224. if (e === n.RGBA_S3TC_DXT5_Format)
  12225. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12226. }
  12227. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12228. null !== t) {
  12229. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12230. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12231. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12232. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12233. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12234. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12235. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12236. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12237. }
  12238. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12239. null !== t && e === n.RGB_ETC1_Format)
  12240. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12241. if (t = i.get("EXT_blend_minmax"),
  12242. null !== t) {
  12243. if (e === n.MinEquation)
  12244. return t.MIN_EXT;
  12245. if (e === n.MaxEquation)
  12246. return t.MAX_EXT
  12247. }
  12248. return 0
  12249. }
  12250. ,
  12251. n.WebGLState = function(e, t, i) {
  12252. var r = this
  12253. , o = new n.Vector4
  12254. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12255. , s = new Uint8Array(a)
  12256. , l = new Uint8Array(a)
  12257. , c = new Uint8Array(a)
  12258. , h = {}
  12259. , u = null
  12260. , d = null
  12261. , p = null
  12262. , f = null
  12263. , g = null
  12264. , m = null
  12265. , v = null
  12266. , A = null
  12267. , y = !1
  12268. , C = null
  12269. , I = null
  12270. , E = null
  12271. , b = null
  12272. , w = null
  12273. , _ = null
  12274. , T = null
  12275. , x = null
  12276. , S = null
  12277. , M = null
  12278. , R = null
  12279. , P = null
  12280. , O = null
  12281. , L = null
  12282. , D = null
  12283. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12284. , B = void 0
  12285. , F = {}
  12286. , V = new n.Vector4
  12287. , U = null
  12288. , k = null
  12289. , H = new n.Vector4
  12290. , G = new n.Vector4;
  12291. this.init = function() {
  12292. this.clearColor(0, 0, 0, 1),
  12293. this.clearDepth(1),
  12294. this.clearStencil(0),
  12295. this.enable(e.DEPTH_TEST),
  12296. e.depthFunc(e.LEQUAL),
  12297. e.frontFace(e.CCW),
  12298. e.cullFace(e.BACK),
  12299. this.enable(e.CULL_FACE),
  12300. this.enable(e.BLEND),
  12301. e.blendEquation(e.FUNC_ADD),
  12302. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12303. }
  12304. ,
  12305. this.initAttributes = function() {
  12306. for (var e = 0, t = s.length; e < t; e++)
  12307. s[e] = 0
  12308. }
  12309. ,
  12310. this.enableAttribute = function(i) {
  12311. if (s[i] = 1,
  12312. 0 === l[i] && (e.enableVertexAttribArray(i),
  12313. l[i] = 1),
  12314. 0 !== c[i]) {
  12315. var n = t.get("ANGLE_instanced_arrays");
  12316. n.vertexAttribDivisorANGLE(i, 0),
  12317. c[i] = 0
  12318. }
  12319. }
  12320. ,
  12321. this.enableAttributeAndDivisor = function(t, i, n) {
  12322. s[t] = 1,
  12323. 0 === l[t] && (e.enableVertexAttribArray(t),
  12324. l[t] = 1),
  12325. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12326. c[t] = i)
  12327. }
  12328. ,
  12329. this.disableUnusedAttributes = function() {
  12330. for (var t = 0, i = l.length; t < i; t++)
  12331. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12332. l[t] = 0)
  12333. }
  12334. ,
  12335. this.enable = function(t) {
  12336. h[t] !== !0 && (e.enable(t),
  12337. h[t] = !0)
  12338. }
  12339. ,
  12340. this.disable = function(t) {
  12341. h[t] !== !1 && (e.disable(t),
  12342. h[t] = !1)
  12343. }
  12344. ,
  12345. this.getCompressedTextureFormats = function() {
  12346. if (null === u && (u = [],
  12347. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12348. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12349. u.push(i[n]);
  12350. return u
  12351. }
  12352. ,
  12353. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12354. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12355. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12356. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12357. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12358. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12359. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12360. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12361. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12362. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12363. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12364. d = t,
  12365. y = h),
  12366. t === n.CustomBlending ? (s = s || r,
  12367. l = l || o,
  12368. c = c || a,
  12369. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12370. p = r,
  12371. m = s),
  12372. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12373. f = o,
  12374. g = a,
  12375. v = l,
  12376. A = c)) : (p = null,
  12377. f = null,
  12378. g = null,
  12379. m = null,
  12380. v = null,
  12381. A = null)
  12382. }
  12383. ,
  12384. this.setDepthFunc = function(t) {
  12385. if (C !== t) {
  12386. if (t)
  12387. switch (t) {
  12388. case n.NeverDepth:
  12389. e.depthFunc(e.NEVER);
  12390. break;
  12391. case n.AlwaysDepth:
  12392. e.depthFunc(e.ALWAYS);
  12393. break;
  12394. case n.LessDepth:
  12395. e.depthFunc(e.LESS);
  12396. break;
  12397. case n.LessEqualDepth:
  12398. e.depthFunc(e.LEQUAL);
  12399. break;
  12400. case n.EqualDepth:
  12401. e.depthFunc(e.EQUAL);
  12402. break;
  12403. case n.GreaterEqualDepth:
  12404. e.depthFunc(e.GEQUAL);
  12405. break;
  12406. case n.GreaterDepth:
  12407. e.depthFunc(e.GREATER);
  12408. break;
  12409. case n.NotEqualDepth:
  12410. e.depthFunc(e.NOTEQUAL);
  12411. break;
  12412. default:
  12413. e.depthFunc(e.LEQUAL)
  12414. }
  12415. else
  12416. e.depthFunc(e.LEQUAL);
  12417. C = t
  12418. }
  12419. }
  12420. ,
  12421. this.setDepthTest = function(t) {
  12422. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12423. }
  12424. ,
  12425. this.setDepthWrite = function(t) {
  12426. I !== t && (e.depthMask(t),
  12427. I = t)
  12428. }
  12429. ,
  12430. this.setColorWrite = function(t) {
  12431. E !== t && (e.colorMask(t, t, t, t),
  12432. E = t)
  12433. }
  12434. ,
  12435. this.setStencilFunc = function(t, i, n) {
  12436. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12437. w = t,
  12438. _ = i,
  12439. T = n)
  12440. }
  12441. ,
  12442. this.setStencilOp = function(t, i, n) {
  12443. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12444. x = t,
  12445. S = i,
  12446. M = n)
  12447. }
  12448. ,
  12449. this.setStencilTest = function(t) {
  12450. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12451. }
  12452. ,
  12453. this.setStencilWrite = function(t) {
  12454. b !== t && (e.stencilMask(t),
  12455. b = t)
  12456. }
  12457. ,
  12458. this.setFlipSided = function(t) {
  12459. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12460. R = t)
  12461. }
  12462. ,
  12463. this.setLineWidth = function(t) {
  12464. t !== P && (e.lineWidth(t),
  12465. P = t)
  12466. }
  12467. ,
  12468. this.setPolygonOffset = function(t, i, n) {
  12469. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12470. !t || O === i && L === n || (e.polygonOffset(i, n),
  12471. O = i,
  12472. L = n)
  12473. }
  12474. ,
  12475. this.getScissorTest = function() {
  12476. return D
  12477. }
  12478. ,
  12479. this.setScissorTest = function(t) {
  12480. D = t,
  12481. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12482. }
  12483. ,
  12484. this.activeTexture = function(t) {
  12485. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12486. B !== t && (e.activeTexture(t),
  12487. B = t)
  12488. }
  12489. ,
  12490. this.bindTexture = function(t, i) {
  12491. void 0 === B && r.activeTexture();
  12492. var n = F[B];
  12493. void 0 === n && (n = {
  12494. type: void 0,
  12495. texture: void 0
  12496. },
  12497. F[B] = n),
  12498. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12499. n.type = t,
  12500. n.texture = i)
  12501. }
  12502. ,
  12503. this.compressedTexImage2D = function() {
  12504. try {
  12505. e.compressedTexImage2D.apply(e, arguments)
  12506. } catch (e) {
  12507. console.error(e)
  12508. }
  12509. }
  12510. ,
  12511. this.texImage2D = function() {
  12512. try {
  12513. e.texImage2D.apply(e, arguments)
  12514. } catch (e) {
  12515. console.error(e)
  12516. }
  12517. }
  12518. ,
  12519. this.clearColor = function(t, i, n, r) {
  12520. o.set(t, i, n, r),
  12521. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12522. V.copy(o))
  12523. }
  12524. ,
  12525. this.clearDepth = function(t) {
  12526. U !== t && (e.clearDepth(t),
  12527. U = t)
  12528. }
  12529. ,
  12530. this.clearStencil = function(t) {
  12531. k !== t && (e.clearStencil(t),
  12532. k = t)
  12533. }
  12534. ,
  12535. this.scissor = function(t) {
  12536. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12537. H.copy(t))
  12538. }
  12539. ,
  12540. this.viewport = function(t) {
  12541. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12542. G.copy(t))
  12543. }
  12544. ,
  12545. this.reset = function() {
  12546. for (var t = 0; t < l.length; t++)
  12547. 1 === l[t] && (e.disableVertexAttribArray(t),
  12548. l[t] = 0);
  12549. h = {},
  12550. u = null,
  12551. B = void 0,
  12552. F = {},
  12553. d = null,
  12554. E = null,
  12555. I = null,
  12556. b = null,
  12557. R = null
  12558. }
  12559. }
  12560. }
  12561. , {
  12562. three: 217
  12563. }],
  12564. 104: [function(e, t, i) {
  12565. (function(i, n) {
  12566. "use strict";
  12567. function r(e) {
  12568. this.urls = e;
  12569. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12570. this.builder = a.loadProto(t),
  12571. this.decoder = this.builder.build("binary_mesh")
  12572. }
  12573. var o = e("three")
  12574. , a = e("protobufjs")
  12575. , s = e("../util/logger")
  12576. , l = (e("../util/common"),
  12577. e("../util/ajax"))
  12578. , c = e("../objects/Chunk")
  12579. , h = new s(n);
  12580. r.prototype = {
  12581. constructor: r,
  12582. load: function(e, t, i, n) {
  12583. return h.time("download"),
  12584. l.get(e, {
  12585. responseType: "arraybuffer"
  12586. }).done(function(r) {
  12587. h.timeEnd("download"),
  12588. this.parse(r, e, t, i, n)
  12589. }
  12590. .bind(this)).fail(n)
  12591. },
  12592. parse: function(e, t, i, n, r) {
  12593. var o = this.readProtobuf(e);
  12594. if (!o)
  12595. return r();
  12596. try {
  12597. h.time("convert to webgl"),
  12598. this.convertProtobufToSceneObject(o, t, i, n, r),
  12599. h.timeEnd("convert to webgl")
  12600. } catch (e) {
  12601. return h.error("failed parsing .dam"),
  12602. h.error(e.message),
  12603. r()
  12604. }
  12605. },
  12606. readProtobuf: function(e) {
  12607. var t;
  12608. try {
  12609. h.time("parse proto"),
  12610. t = this.decoder.decode(e),
  12611. h.timeEnd("parse proto")
  12612. } catch (e) {
  12613. return h.error("failed parsing proto for .dam"),
  12614. h.error(e.message),
  12615. null
  12616. }
  12617. return t
  12618. },
  12619. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12620. function a(e) {
  12621. var i = new o.BufferGeometry;
  12622. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12623. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12624. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12625. i.applyMatrix(s),
  12626. i.computeBoundingBox(),
  12627. new c({
  12628. geometry: i,
  12629. textureName: e.material_name,
  12630. name: e.chunk_name,
  12631. meshUrl: t
  12632. })
  12633. }
  12634. if (0 === e.chunk.length)
  12635. return h.warn("No chunks in damfile..."),
  12636. i([]);
  12637. var s = new o.Matrix4;
  12638. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12639. var l = e.chunk.map(a);
  12640. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12641. r())
  12642. }
  12643. },
  12644. t.exports = r
  12645. }
  12646. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12647. }
  12648. , {
  12649. "../objects/Chunk": 144,
  12650. "../util/ajax": 181,
  12651. "../util/common": 185,
  12652. "../util/logger": 189,
  12653. buffer: 198,
  12654. protobufjs: 214,
  12655. three: 217
  12656. }],
  12657. 105: [function(e, t, i) {
  12658. (function(i) {
  12659. "use strict";
  12660. var n = (e("three"),
  12661. e("../settings"),
  12662. e("../util/browser"),
  12663. e("./DamLoader"))
  12664. , r = e("../util/logger")
  12665. , o = (e("../ab"),
  12666. new r(i));
  12667. t.exports = {
  12668. getLoaders: function() {
  12669. return [["_50k", ".dam", n], ["", ".dam", n]]
  12670. },
  12671. load: function(e, t, i, n, r, a) {
  12672. var s = this.getLoaders();
  12673. a = a || 0;
  12674. var l = s[a];
  12675. if (!l)
  12676. return void (r && r("No suitable model file found..."));
  12677. var c = l[0]
  12678. , h = l[1]
  12679. , u = new l[2](t)
  12680. , d = t.get(e + c + h);
  12681. d ? (o.debug("Trying " + c + h),
  12682. u.load(d, i, n, function() {
  12683. this.load(e, t, i, n, r, ++a)
  12684. }
  12685. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12686. this.load(e, t, i, n, r, ++a))
  12687. }
  12688. }
  12689. }
  12690. ).call(this, "/js/loaders/ModelLoader.js")
  12691. }
  12692. , {
  12693. "../ab": 3,
  12694. "../settings": 166,
  12695. "../util/browser": 182,
  12696. "../util/logger": 189,
  12697. "./DamLoader": 104,
  12698. three: 217
  12699. }],
  12700. 106: [function(e, t, i) {
  12701. (function(i) {
  12702. "use strict";
  12703. var n = e("../util/common")
  12704. , r = e("../util/texture")
  12705. , o = e("../util/browser")
  12706. , a = e("../util/logger")
  12707. , s = e("../settings")
  12708. , l = new a(i);
  12709. t.exports = {
  12710. load: function(e, t) {
  12711. function i(e, i) {
  12712. e || (t.push(i),
  12713. p++,
  12714. d.notify(p, a),
  12715. p === a && d.resolve())
  12716. }
  12717. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12718. return $.when();
  12719. var a = n.countUnique(e.chunks.map(function(e) {
  12720. return e.textureName
  12721. }))
  12722. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12723. , h = "_50k" === c ? "high" : "low";
  12724. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12725. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12726. h = "low"));
  12727. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12728. , d = $.Deferred()
  12729. , p = 0;
  12730. return e.chunks.forEach(function(t) {
  12731. if (!t.material.map && t.textureName) {
  12732. var n = e.urls.get(u + t.textureName);
  12733. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12734. }
  12735. }),
  12736. d.promise()
  12737. }
  12738. }
  12739. }
  12740. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12741. }
  12742. , {
  12743. "../settings": 166,
  12744. "../util/browser": 182,
  12745. "../util/common": 185,
  12746. "../util/logger": 189,
  12747. "../util/texture": 194
  12748. }],
  12749. 107: [function(e, t, i) {
  12750. (function(i, n) {
  12751. "use strict";
  12752. function r(e) {
  12753. this.model = e,
  12754. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12755. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12756. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12757. , n = o.loadProto(t);
  12758. this.decoder = n.build("VisionModeldata")
  12759. }
  12760. var o = e("protobufjs")
  12761. , a = e("../util/ajax")
  12762. , s = (e("../util/common"),
  12763. e("../util/math"))
  12764. , l = e("../util/logger")
  12765. , c = new l(n);
  12766. r.prototype.load = function() {
  12767. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12768. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12769. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12770. $.when([]))
  12771. }
  12772. ,
  12773. r.prototype.loadVisionModelData = function() {
  12774. return a.get(this.modelDataPath, {
  12775. responseType: "arraybuffer"
  12776. }).then(function(e) {
  12777. var t;
  12778. try {
  12779. t = this.decoder.decode(e)
  12780. } catch (e) {
  12781. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12782. this.loadSweepLocationsCSV()
  12783. }
  12784. var i = t.sweepLocations.map(function(e) {
  12785. return {
  12786. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12787. position: {
  12788. x: e.pose.translation.x,
  12789. y: e.pose.translation.y,
  12790. z: e.pose.translation.z
  12791. },
  12792. quaternion: {
  12793. x: e.pose.rotation.x,
  12794. y: e.pose.rotation.y,
  12795. z: e.pose.rotation.z,
  12796. w: e.pose.rotation.w
  12797. },
  12798. puck: {
  12799. x: e.puck.x,
  12800. y: e.puck.y,
  12801. z: e.puck.z
  12802. },
  12803. floor: e.group,
  12804. neighbours: e.visibles,
  12805. alignmentType: e.alignment_type
  12806. }
  12807. }).map(function(e) {
  12808. return e.position = s.convertVisionVector(e.position),
  12809. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12810. e.puck = s.convertVisionVector(e.puck),
  12811. e
  12812. });
  12813. return i.forEach(function(e) {
  12814. e.neighbours = e.neighbours.map(function(e) {
  12815. return i[e].uuid
  12816. })
  12817. }),
  12818. i
  12819. }
  12820. .bind(this), function() {
  12821. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12822. this.loadSweepLocationsCSV()
  12823. }
  12824. .bind(this))
  12825. }
  12826. ,
  12827. r.prototype.loadSweepLocationsCSV = function() {
  12828. return a.get(this.sweepLocationsPath).then(function(e) {
  12829. var t = e.split("\n").map(function(e) {
  12830. return e.split(", ")
  12831. }).filter(function(e) {
  12832. return e.length > 1
  12833. }).map(function(e) {
  12834. return {
  12835. uuid: e[0],
  12836. position: {
  12837. x: parseFloat(e[1]),
  12838. y: parseFloat(e[2]),
  12839. z: parseFloat(e[3])
  12840. },
  12841. quaternion: {
  12842. x: parseFloat(e[4]),
  12843. y: parseFloat(e[5]),
  12844. z: parseFloat(e[6]),
  12845. w: parseFloat(e[7])
  12846. }
  12847. }
  12848. }).map(function(e) {
  12849. return e.position = s.convertVisionVector(e.position),
  12850. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12851. e
  12852. });
  12853. return t
  12854. }).fail(function() {
  12855. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12856. })
  12857. }
  12858. ,
  12859. t.exports = r
  12860. }
  12861. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12862. }
  12863. , {
  12864. "../util/ajax": 181,
  12865. "../util/common": 185,
  12866. "../util/logger": 189,
  12867. "../util/math": 190,
  12868. buffer: 198,
  12869. protobufjs: 214
  12870. }],
  12871. 108: [function(e, t, i) {
  12872. (function(i) {
  12873. "use strict";
  12874. function n() {
  12875. this.locale = null
  12876. }
  12877. var r = e("../settings")
  12878. , o = e("../util/common")
  12879. , a = e("../util/logger")
  12880. , s = e("../enum/Locale")
  12881. , l = new a(i);
  12882. n.prototype.init = function() {
  12883. var t;
  12884. switch (r.languageTag) {
  12885. case null:
  12886. case "en":
  12887. case s.EN_US:
  12888. this.locale = s.EN_US,
  12889. t = e("./strings-en-US");
  12890. break;
  12891. case "es":
  12892. case s.ES_MX:
  12893. this.locale = s.ES_MX,
  12894. t = e("./strings-es-MX");
  12895. break;
  12896. case "fr":
  12897. case s.FR_FR:
  12898. this.locale = s.FR_FR,
  12899. t = e("./strings-fr-FR");
  12900. break;
  12901. case "de":
  12902. case s.DE_DE:
  12903. this.locale = s.DE_DE,
  12904. t = e("./strings-de-DE");
  12905. break;
  12906. case "ru":
  12907. case s.RU_RU:
  12908. this.locale = s.RU_RU,
  12909. t = e("./strings-ru-RU");
  12910. break;
  12911. case "cn":
  12912. case s.CN_CN:
  12913. this.locale = s.CN_CN,
  12914. t = e("./strings-cn-CN");
  12915. break;
  12916. case "jp":
  12917. case s.JP_JP:
  12918. this.locale = s.JP_JP,
  12919. t = e("./strings-jp-JP");
  12920. break;
  12921. default:
  12922. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12923. this.locale = s.EN_US,
  12924. t = e("./strings-en-US")
  12925. }
  12926. l.info("Using locale '" + this.locale + "'"),
  12927. o.extendObject(this, t)
  12928. }
  12929. ,
  12930. n.prototype.localizeGUI = function() {
  12931. var e = document.querySelector("#gui-parent");
  12932. this.localizeTree(e),
  12933. this.localizeLoadingText()
  12934. }
  12935. ,
  12936. n.prototype.localizeLoadingText = function() {
  12937. // var e = document.querySelector("#loader-cont")
  12938. // , t = e.getAttribute("title");
  12939. // e.removeAttribute("title"),
  12940. // e.setAttribute("data-status", t),
  12941. // e.classList.add(this.locale),
  12942. document.querySelector("#help-dialog").classList.add(this.locale),
  12943. document.querySelector("#interaction-modal").classList.add(this.locale),
  12944. document.querySelector("#gui").classList.add(this.locale);
  12945. }
  12946. ,
  12947. n.prototype.localizeTree = function(e) {
  12948. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12949. if (e.nodeType === Node.TEXT_NODE)
  12950. t = e.data.match(n),
  12951. t && (i = t[1],
  12952. e.data = this.localizeText(i) || i);
  12953. else if (e.nodeType === Node.ELEMENT_NODE) {
  12954. var r = e.getAttribute("title");
  12955. r && (t = r.match(n),
  12956. t && (i = t[1],
  12957. e.setAttribute("title", this.localizeText(i) || i)))
  12958. }
  12959. for (e = e.firstChild; e; )
  12960. this.localizeTree(e),
  12961. e = e.nextSibling
  12962. }
  12963. ,
  12964. n.prototype.localizeText = function(t) {
  12965. var i = this[t];
  12966. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12967. i = e("./strings-en-US")[t]),
  12968. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12969. i
  12970. }
  12971. ,
  12972. t.exports = new n
  12973. }
  12974. ).call(this, "/js/localization/localize.js")
  12975. }
  12976. , {
  12977. "../enum/Locale": 31,
  12978. "../settings": 166,
  12979. "../util/common": 185,
  12980. "../util/logger": 189,
  12981. "./strings-cn-CN": 109,
  12982. "./strings-de-DE": 110,
  12983. "./strings-en-US": 111,
  12984. "./strings-es-MX": 112,
  12985. "./strings-fr-FR": 113,
  12986. "./strings-jp-JP": 114,
  12987. "./strings-ru-RU": 115
  12988. }],
  12989. 109: [function(e, t, i) {
  12990. "use strict";
  12991. t.exports = {
  12992. PAGE_TITLE: "",
  12993. LOADING: "正在加载",
  12994. PRESENTED_BY_CAPS: "呈现者:",
  12995. POWERED_BY: "技术支持:",
  12996. POWERED_BY_CAPS: "技术支持:",
  12997. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12998. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12999. PRESENTED_BY: "呈现者:",
  13000. MORE: "更多 ",
  13001. LESS: "更少 ",
  13002. TAG_CONTENT: "tag™ 内容",
  13003. SHOW: "显示",
  13004. HIDE: "隐藏",
  13005. DOLLHOUSE: "场景屋",
  13006. FLOOR_PLAN: "楼层平面图",
  13007. OPEN_HIGHLIGHTS: "打开精彩片段",
  13008. CLOSE_HIGHLIGHTS: "关闭",
  13009. PREVIOUS: "上一个",
  13010. PLAY: "播放",
  13011. PAUSE: "暂停",
  13012. NEXT: "下一个",
  13013. EXPLORE_3D_SPACE: "探索 3D 空间",
  13014. VIEW_DOLLHOUSE: "观看场景屋",
  13015. SOCIAL_SHARING: "分享这个空间",
  13016. VIEW_IN_VR: "以 VR 观看",
  13017. VIEW_FULLSCREEN: "全屏观看",
  13018. EXIT_FULLSCREEN: " 退出全屏",
  13019. ZOOM_IN: "放大",
  13020. ZOOM_OUT: "缩小",
  13021. FLOOR_NAME: "楼层",
  13022. FLOOR_ALL: "ALL",
  13023. FLOOR_Lang: ["Floor",""],
  13024. TERMS: "条款",
  13025. PORT_TERMS: "port 条款",
  13026. TERMS_OF_USE: "使用条款",
  13027. CLOSE_TERMS: "关闭",
  13028. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13029. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13030. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13031. WEBVR_ENTER_WEBVR: "进入 VR",
  13032. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13033. WEBVR_LEARN_MORE: "了解更多",
  13034. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13035. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13036. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13037. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13038. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13039. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13040. VR_LEARN_MORE_CAPS: "了解更多",
  13041. VR_PREVIOUS_CAPS: "上一个’,",
  13042. VR_NEXT_CAPS: "下一个",
  13043. VR_GOT_IT_CAPS: "明白了",
  13044. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13045. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13046. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13047. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13048. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13049. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13050. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13051. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13052. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13053. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13054. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13055. VR_APP: "port VR 应用程序",
  13056. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13057. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13058. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13059. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13060. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13061. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13062. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13063. VR_ANDROID_DVICES: "Android 设备",
  13064. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13065. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13066. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13067. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13068. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13069. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13070. VR_DOWNLOAD_HERE: "在此下载",
  13071. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13072. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13073. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13074. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13075. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13076. SHARE_TO: "分享到",
  13077. SHARE_LINK: "直接链接",
  13078. SHARE_EXPLORE: "探索",
  13079. SHARE_AT: "在",
  13080. SHARE_WITH: "使用",
  13081. SHARE_3D: "以 3D",
  13082. SHARE_COPIED: "已复制!",
  13083. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13084. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13085. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13086. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13087. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13088. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13089. ERROR_GENERIC_ACTIONS_3: " 或",
  13090. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13091. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13092. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13093. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13094. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13095. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13096. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13097. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13098. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13099. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13100. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13101. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13102. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13103. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13104. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13105. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13106. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13107. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13108. LINK_TO_LOCATION: "地点链接",
  13109. MENU_COPY: "复制",
  13110. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13111. ROTATE: "旋转",
  13112. MOVE: "移动",
  13113. INSIDE: "内部",
  13114. ZOOM: "缩放",
  13115. HELP: "小帮手",
  13116. HELP_NAVIGATION_TAB: "导航",
  13117. HELP_MORE_HELP_TAB: "更多帮助",
  13118. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13119. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13120. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13121. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13122. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13123. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13124. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13125. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13126. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13127. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13128. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13129. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13130. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13131. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13132. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13133. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13134. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13135. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13136. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13137. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13138. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13139. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13140. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13141. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13142. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13143. HELP_MORE_HLR_A: "精彩片段集锦",
  13144. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13145. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13146. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13147. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13148. HELP_MORE_FLOORS_A: "楼层选择器",
  13149. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13150. HELP_MORE_TAG_A: "tag™ 贴文",
  13151. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13152. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13153. HELP_MORE_ZOOM_A: "缩放控件",
  13154. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13155. HELP_MORE_TOUR_A: "导览控件",
  13156. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13157. HELP_MORE_INSIDE_A: "内部视图",
  13158. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13159. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13160. HELP_MORE_VR_A: "VR 模式",
  13161. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13162. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13163. HELP_MORE_360_A: "360° 视图",
  13164. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13165. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13166. HELP_MORE_FULLSCREEN_A: "全屏",
  13167. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13168. CLOSE: "关闭"
  13169. }
  13170. }
  13171. , {}],
  13172. 110: [function(e, t, i) {
  13173. "use strict";
  13174. t.exports = {
  13175. PAGE_TITLE: "",
  13176. LOADING: "Lädt",
  13177. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13178. POWERED_BY: "Angetrieben von",
  13179. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13180. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13181. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13182. PRESENTED_BY: "Präsentiert von ",
  13183. MORE: "Mehr ",
  13184. LESS: "Weniger ",
  13185. TAG_CONTENT: "tag™ Inhalt",
  13186. SHOW: "Anzeigen",
  13187. HIDE: "Verbergen",
  13188. DOLLHOUSE: "Puppenhaus",
  13189. FLOOR_PLAN: "Grundriss",
  13190. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13191. CLOSE_HIGHLIGHTS: "Schließen",
  13192. PREVIOUS: "Vorheriges",
  13193. PLAY: "Abspielen",
  13194. PAUSE: "Pausieren",
  13195. NEXT: "Nächstes",
  13196. EXPLORE_3D_SPACE: "Innenraum betreten",
  13197. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13198. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13199. VIEW_IN_VR: "In VR ansehen",
  13200. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13201. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13202. ZOOM_IN: "Vergrößern",
  13203. ZOOM_OUT: "Verkleinern",
  13204. FLOOR_NAME: "Etage ",
  13205. FLOOR_ALL: "Alle",
  13206. TERMS: "Bedingungen",
  13207. PORT_TERMS: "port Bedingungen",
  13208. TERMS_OF_USE: "Nutzungsbedingungen",
  13209. TERMS_TEXT_FILE: "terms-de-DE.html",
  13210. CLOSE_TERMS: "Schließen",
  13211. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13212. HELP: "Hilfe",
  13213. HELP_NAVIGATION_TAB: "Navigation",
  13214. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13215. CLOSE: "Schließen",
  13216. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13217. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13218. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13219. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13220. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13221. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13222. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13223. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13224. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13225. HELP_DESKTOP_DOLLHOUSE_2A: "Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.",
  13226. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13227. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13228. HELP_DESKTOP_FLOORPLAN_1A: "Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.",
  13229. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13230. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13231. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13232. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13233. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13234. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13235. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13236. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13237. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13238. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13239. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13240. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13241. HELP_MORE_HLR_A: "Liste das Highlight",
  13242. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13243. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13244. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13245. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13246. HELP_MORE_FLOORS_A: "Etage auswählen",
  13247. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13248. HELP_MORE_TAG_A: "tag™ Posts",
  13249. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13250. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13251. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13252. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13253. HELP_MORE_TOUR_A: "Tour Steuerung",
  13254. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13255. HELP_MORE_INSIDE_A: "Innenansicht",
  13256. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13257. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13258. HELP_MORE_VR_A: "VR Modus",
  13259. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13260. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13261. HELP_MORE_360_A: "360° Views Ansicht ",
  13262. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13263. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13264. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13265. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13266. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13267. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13268. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13269. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13270. WEBVR_LEARN_MORE: "Mehr Infos",
  13271. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13272. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13273. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13274. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13275. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13276. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13277. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13278. VR_APP: "port VR App",
  13279. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13280. VR_COMPATIBLE_ANDROID_LONG: "Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13281. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13282. VR_APP_FOR_ANDROID: "port VR app für Android",
  13283. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13284. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13285. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13286. VR_PREVIOUS_CAPS: "ZURÜCK",
  13287. VR_NEXT_CAPS: "WEITER",
  13288. VR_GOT_IT_CAPS: "VERSTANDEN",
  13289. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13290. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13291. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13292. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13293. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13294. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13295. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13296. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13297. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13298. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13299. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13300. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13301. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13302. VR_ANDROID_DVICES: "Android Geräte",
  13303. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13304. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13305. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13306. VR_DOWNLOAD_HERE: "Hier runterladen",
  13307. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13308. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13309. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13310. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13311. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13312. SHARE_TO: "Teilen auf",
  13313. SHARE_LINK: "Direkter Link",
  13314. SHARE_EXPLORE: "Umsehen",
  13315. SHARE_AT: "auf",
  13316. SHARE_WITH: "mit",
  13317. SHARE_3D: "in 3D",
  13318. SHARE_COPIED: "Kopiert!",
  13319. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13320. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13321. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13322. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13323. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13324. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13325. ERROR_GENERIC_ACTIONS_3: " oder ",
  13326. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13327. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13328. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13329. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13330. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13331. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13332. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13333. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13334. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13335. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13336. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13337. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13338. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13339. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13340. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13341. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13342. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13343. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13344. LINK_TO_LOCATION: "Link zu",
  13345. MENU_COPY: "Kopieren",
  13346. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13347. ROTATE: "Drehen",
  13348. INSIDE: "Drinnen",
  13349. MOVE: "Bewegen",
  13350. ZOOM: "Vergrößern"
  13351. }
  13352. }
  13353. , {}],
  13354. 111: [function(e, t, i) {
  13355. "use strict";
  13356. t.exports = {
  13357. PAGE_TITLE: "",
  13358. LOADING: "Loading",
  13359. PRESENTED_BY_CAPS: "PRESENTED BY",
  13360. POWERED_BY: "powered by ",
  13361. POWERED_BY_CAPS: "POWERED BY",
  13362. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13363. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13364. PRESENTED_BY: "Presented by ",
  13365. MORE: "More ",
  13366. LESS: "Less ",
  13367. TAG_CONTENT: "tag™ Content",
  13368. SHOW: "Show",
  13369. HIDE: "Hide",
  13370. DOLLHOUSE: "Dollhouse",
  13371. FLOOR_PLAN: "Floor plan",
  13372. OPEN_HIGHLIGHTS: "Open Highlights",
  13373. CLOSE_HIGHLIGHTS: "Close",
  13374. PREVIOUS: "Previous",
  13375. PLAY: "Play",
  13376. PAUSE: "Pause",
  13377. NEXT: "Next",
  13378. EXPLORE_3D_SPACE: "Explore 3D Space",
  13379. VIEW_DOLLHOUSE: "View dollhouse",
  13380. SOCIAL_SHARING: "Share this Space",
  13381. VIEW_IN_VR: "View in VR",
  13382. VIEW_FULLSCREEN: "全屏",
  13383. EXIT_FULLSCREEN: "退出全屏",
  13384. ZOOM_IN: "Zoom in",
  13385. ZOOM_OUT: "Zoom out",
  13386. FLOOR_NAME: "Floor ",
  13387. FLOOR_ALL: "全部",
  13388. TERMS: "Terms",
  13389. PORT_TERMS: "port terms",
  13390. TERMS_OF_USE: "Terms of Use",
  13391. TERMS_TEXT_FILE: "terms-en-US.html",
  13392. CLOSE_TERMS: "Close",
  13393. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13394. HELP: "Help",
  13395. HELP_NAVIGATION_TAB: "Navigation",
  13396. HELP_MORE_HELP_TAB: "More Help",
  13397. CLOSE: "Close",
  13398. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13399. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13400. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13401. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13402. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13403. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13404. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13405. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13406. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13407. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13408. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13409. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13410. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13411. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13412. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13413. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13414. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13415. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13416. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13417. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13418. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13419. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13420. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13421. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13422. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13423. HELP_MORE_HLR_A: "Highlight Reel",
  13424. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13425. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13426. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13427. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13428. HELP_MORE_FLOORS_A: "Floor Selector",
  13429. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13430. HELP_MORE_TAG_A: "tag™ Posts",
  13431. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13432. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13433. HELP_MORE_ZOOM_A: "Zoom Controls",
  13434. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13435. HELP_MORE_TOUR_A: "Tour Controls",
  13436. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13437. HELP_MORE_INSIDE_A: "Inside View",
  13438. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13439. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13440. HELP_MORE_VR_A: "VR Mode",
  13441. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13442. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13443. HELP_MORE_360_A: "360° Views",
  13444. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13445. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13446. HELP_MORE_FULLSCREEN_A: "Full screen",
  13447. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13448. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13449. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13450. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13451. WEBVR_ENTER_WEBVR: "ENTER VR",
  13452. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13453. WEBVR_LEARN_MORE: "Learn more",
  13454. WEBVR_VIEW_SPACE: "View Space in VR",
  13455. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13456. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13457. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13458. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13459. VR_PREVIOUS_CAPS: "PREVIOUS",
  13460. VR_NEXT_CAPS: "NEXT",
  13461. VR_GOT_IT_CAPS: "GOT IT",
  13462. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13463. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13464. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13465. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13466. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13467. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13468. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13469. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13470. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13471. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13472. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13473. VR_APP: "port VR App",
  13474. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13475. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13476. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13477. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13478. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13479. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13480. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13481. VR_ANDROID_DVICES: "Android Devices",
  13482. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13483. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13484. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13485. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13486. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13487. VR_APP_OPEN: "Open with the port VR app instead",
  13488. VR_DOWNLOAD_HERE: "Download here",
  13489. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13490. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13491. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13492. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13493. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13494. SHARE_TO: "Share to",
  13495. SHARE_LINK: "Direct Link",
  13496. SHARE_EXPLORE: "Explore ",
  13497. SHARE_AT: "at",
  13498. SHARE_WITH: "with",
  13499. SHARE_3D: " in 3D",
  13500. SHARE_COPIED: "Copied!",
  13501. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13502. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13503. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13504. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13505. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13506. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13507. ERROR_GENERIC_ACTIONS_3: " or ",
  13508. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13509. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13510. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13511. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13512. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13513. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13514. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13515. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13516. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13517. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13518. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13519. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13520. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13521. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13522. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13523. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13524. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13525. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13526. LINK_TO_LOCATION: "Link to location",
  13527. MENU_COPY: "Copy",
  13528. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13529. ROTATE: "Rotate",
  13530. INSIDE: "Inside",
  13531. MOVE: "Move",
  13532. ZOOM: "Zoom"
  13533. }
  13534. }
  13535. , {}],
  13536. 112: [function(e, t, i) {
  13537. "use strict";
  13538. t.exports = {
  13539. PAGE_TITLE: "",
  13540. LOADING: "Cargando",
  13541. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13542. POWERED_BY: "potenciando por ",
  13543. POWERED_BY_CAPS: "POTENCIADO POR ",
  13544. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13545. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13546. PRESENTED_BY: "Presentado por ",
  13547. MORE: "Más ",
  13548. LESS: "Menos ",
  13549. TAG_CONTENT: "Contenido de tag™",
  13550. SHOW: "Mostrar",
  13551. HIDE: "Ocultar",
  13552. DOLLHOUSE: "Dollhouse",
  13553. FLOOR_PLAN: "Planos",
  13554. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13555. CLOSE_HIGHLIGHTS: "Cerrar",
  13556. PREVIOUS: "Anterior",
  13557. PLAY: "Play",
  13558. PAUSE: "Pausa",
  13559. NEXT: "Siguiente",
  13560. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13561. VIEW_DOLLHOUSE: "Ver dollhouse",
  13562. SOCIAL_SHARING: "Compartir este espacio",
  13563. VIEW_IN_VR: "Ver en realidad virtual",
  13564. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13565. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13566. ZOOM_IN: "Acercar",
  13567. ZOOM_OUT: "Alejar",
  13568. FLOOR_NAME: "Piso ",
  13569. FLOOR_ALL: "Todas",
  13570. TERMS: "Condiciones",
  13571. PORT_TERMS: "port términos de uso",
  13572. TERMS_OF_USE: "Términos de uso",
  13573. TERMS_TEXT_FILE: "terms-es-MX.html",
  13574. CLOSE_TERMS: "Cerrar",
  13575. TERMS_FAIL: "No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.",
  13576. HELP: "Ayuda",
  13577. HELP_NAVIGATION_TAB: "Navegación",
  13578. HELP_MORE_HELP_TAB: "Más Ayuda",
  13579. CLOSE: "Cerrar",
  13580. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13581. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13582. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13583. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13584. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13585. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13586. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13587. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13588. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13589. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13590. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13591. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13592. HELP_DESKTOP_FLOORPLAN_1A: "Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.",
  13593. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13594. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13595. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13596. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13597. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13598. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13599. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13600. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13601. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13602. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13603. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13604. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13605. HELP_MORE_HLR_A: "Galería destacada",
  13606. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13607. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13608. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13609. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13610. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13611. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13612. HELP_MORE_TAG_A: "tag™ Posts",
  13613. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13614. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13615. HELP_MORE_ZOOM_A: "Controles de zoom",
  13616. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13617. HELP_MORE_TOUR_A: "Controles de recorrido",
  13618. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13619. HELP_MORE_INSIDE_A: "Vista interior",
  13620. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13621. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13622. HELP_MORE_VR_A: "Modo de realidad virtual",
  13623. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13624. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13625. HELP_MORE_360_A: "360° Views",
  13626. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13627. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13628. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13629. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13630. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13631. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13632. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13633. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13634. WEBVR_LEARN_MORE: "Más información",
  13635. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13636. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13637. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13638. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13639. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13640. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13641. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13642. VR_APP: "port VR App",
  13643. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13644. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13645. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13646. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13647. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13648. VR_PREVIOUS_CAPS: "ANTERIOR",
  13649. VR_NEXT_CAPS: "SIGUIENTE",
  13650. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13651. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13652. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13653. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13654. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13655. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13656. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13657. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13658. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13659. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13660. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13661. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13662. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13663. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13664. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13665. VR_ANDROID_DVICES: "Dispositivos Android",
  13666. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13667. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13668. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13669. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13670. VR_DOWNLOAD_HERE: "Descargar aquí",
  13671. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13672. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13673. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13674. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13675. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13676. SHARE_TO: "Compartir en",
  13677. SHARE_LINK: "Enlace directo",
  13678. SHARE_EXPLORE: "Explorar ",
  13679. SHARE_AT: "en",
  13680. SHARE_WITH: "con",
  13681. SHARE_3D: " en 3D",
  13682. SHARE_COPIED: "¡Copiado!",
  13683. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13684. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13685. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13686. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13687. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13688. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13689. ERROR_GENERIC_ACTIONS_3: " o ",
  13690. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13691. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13692. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13693. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13694. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13695. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13696. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13697. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13698. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13699. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13700. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13701. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13702. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13703. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13704. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13705. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13706. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13707. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13708. LINK_TO_LOCATION: "Enlace a la ubicación",
  13709. MENU_COPY: "Copiar",
  13710. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13711. ROTATE: "Girar",
  13712. INSIDE: "Interior",
  13713. MOVE: "Moverse",
  13714. ZOOM: "Acercar o alejar"
  13715. }
  13716. }
  13717. , {}],
  13718. 113: [function(e, t, i) {
  13719. "use strict";
  13720. t.exports = {
  13721. PAGE_TITLE: "",
  13722. LOADING: "Chargement",
  13723. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13724. POWERED_BY: "alimenté par ",
  13725. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13726. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13727. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13728. PRESENTED_BY: "Présenté par ",
  13729. MORE: "Plus ",
  13730. LESS: "Moins ",
  13731. TAG_CONTENT: "Contenu tag™",
  13732. SHOW: "Montrer",
  13733. HIDE: "Cacher",
  13734. DOLLHOUSE: "Dollhouse",
  13735. FLOOR_PLAN: "Plan de sol",
  13736. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13737. CLOSE_HIGHLIGHTS: "Fermer",
  13738. PREVIOUS: "Précédent",
  13739. PLAY: "Lecture",
  13740. PAUSE: "Pause",
  13741. NEXT: "Suivant",
  13742. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13743. VIEW_DOLLHOUSE: "Voir dollhouse",
  13744. SOCIAL_SHARING: "Partager cet espace",
  13745. VIEW_IN_VR: "Voir en VR",
  13746. VIEW_FULLSCREEN: "Plein écran",
  13747. EXIT_FULLSCREEN: "Fermer plein écran",
  13748. ZOOM_IN: "Zoom avant",
  13749. ZOOM_OUT: "Zoom arrière",
  13750. FLOOR_NAME: "Étage ",
  13751. FLOOR_ALL: "Tous",
  13752. TERMS: "Mentions légales",
  13753. PORT_TERMS: "port mentions légales",
  13754. TERMS_OF_USE: "Conditions d'utilisation",
  13755. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13756. CLOSE_TERMS: "Fermer",
  13757. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13758. HELP: "Aide",
  13759. HELP_NAVIGATION_TAB: "Navigation",
  13760. HELP_MORE_HELP_TAB: "Aide",
  13761. CLOSE: "Fermer",
  13762. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13763. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13764. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13765. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13766. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13767. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13768. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13769. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13770. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13771. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13772. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13773. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13774. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13775. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13776. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13777. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13778. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13779. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13780. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13781. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13782. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13783. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13784. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13785. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13786. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13787. HELP_MORE_HLR_A: "Carrousel",
  13788. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13789. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13790. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13791. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13792. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13793. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13794. HELP_MORE_TAG_A: "tag™ Posts",
  13795. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13796. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13797. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13798. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13799. HELP_MORE_TOUR_A: "Commandes de la visite",
  13800. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13801. HELP_MORE_INSIDE_A: "Vue intérieure",
  13802. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13803. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13804. HELP_MORE_VR_A: "Mode RV",
  13805. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13806. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13807. HELP_MORE_360_A: "Vues 360°",
  13808. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13809. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13810. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13811. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13812. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13813. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13814. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13815. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13816. WEBVR_LEARN_MORE: "En savoir plus",
  13817. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13818. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13819. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13820. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13821. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13822. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13823. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13824. VR_NEXT_CAPS: "SUIVANT",
  13825. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13826. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13827. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13828. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13829. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13830. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13831. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13832. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13833. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13834. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13835. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13836. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13837. VR_APP: "port VR App",
  13838. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13839. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13840. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13841. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13842. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13843. VR_COMPATIBLE_ANDROID_LONG: "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",
  13844. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13845. VR_ANDROID_DVICES: "Appareils Android",
  13846. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13847. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13848. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13849. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13850. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13851. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13852. VR_DOWNLOAD_HERE: "Télécharger ici",
  13853. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13854. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13855. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13856. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13857. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13858. SHARE_TO: "Partager sur",
  13859. SHARE_LINK: "Lien direct",
  13860. SHARE_EXPLORE: "Explorer ",
  13861. SHARE_AT: "à",
  13862. SHARE_WITH: "avec",
  13863. SHARE_3D: " en 3D",
  13864. SHARE_COPIED: "Copié!",
  13865. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13866. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13867. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13868. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13869. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13870. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13871. ERROR_GENERIC_ACTIONS_3: " ou ",
  13872. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13873. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13874. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13875. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13876. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13877. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13878. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13879. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13880. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13881. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13882. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13883. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13884. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13885. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13886. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13887. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13888. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13889. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13890. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13891. MENU_COPY: "Copie",
  13892. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13893. ROTATE: "Faire pivoter",
  13894. INSIDE: "Intérieure",
  13895. MOVE: "Se déplacer",
  13896. ZOOM: "Zoom"
  13897. }
  13898. }
  13899. , {}],
  13900. 114: [function(e, t, i) {
  13901. "use strict";
  13902. t.exports = {
  13903. PAGE_TITLE: "",
  13904. LOADING: "読み込み中",
  13905. PRESENTED_BY_CAPS: "PRESENTED BY",
  13906. POWERED_BY: "powered by",
  13907. POWERED_BY_CAPS: "POWERED BY",
  13908. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13909. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13910. PRESENTED_BY: "Presented by ",
  13911. MORE: "全て表示 ",
  13912. LESS: "閉じる ",
  13913. TAG_CONTENT: "tag™コンテンツ ",
  13914. SHOW: "表示",
  13915. HIDE: "非表示",
  13916. DOLLHOUSE: "ドールハウス",
  13917. FLOOR_PLAN: "フロアプラン",
  13918. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13919. CLOSE_HIGHLIGHTS: "閉じる",
  13920. PREVIOUS: "前へ",
  13921. PLAY: "再生",
  13922. PAUSE: "一時停止",
  13923. NEXT: "次へ",
  13924. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13925. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13926. SOCIAL_SHARING: "このSpaceを共有する",
  13927. VIEW_IN_VR: "VRで表示",
  13928. VIEW_FULLSCREEN: "フルスクリーン表示",
  13929. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13930. ZOOM_IN: "ズームイン",
  13931. ZOOM_OUT: "ズームアウト",
  13932. FLOOR_NAME: "フロア ",
  13933. FLOOR_ALL: "すべて",
  13934. TERMS: "規約",
  13935. PORT_TERMS: "port規約",
  13936. TERMS_OF_USE: "利用規約",
  13937. CLOSE_TERMS: "閉じる",
  13938. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13939. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13940. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13941. WEBVR_ENTER_WEBVR: "VRに入る",
  13942. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13943. WEBVR_LEARN_MORE: "もっと詳しく",
  13944. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13945. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13946. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13947. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13948. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13949. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13950. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13951. VR_PREVIOUS_CAPS: "前へ",
  13952. VR_NEXT_CAPS: "次へ",
  13953. VR_GOT_IT_CAPS: "了解",
  13954. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13955. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13956. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13957. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13958. VR_WHAT_YOU_NEED: "必要なもの",
  13959. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13960. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13961. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13962. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13963. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13964. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13965. VR_APP: "port VRアプリ",
  13966. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13967. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13968. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13969. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13970. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13971. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13972. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13973. VR_ANDROID_DVICES: "Androidデバイス",
  13974. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13975. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13976. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13977. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13978. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13979. VR_APP_OPEN: "port VRアプリで開く",
  13980. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13981. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13982. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13983. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13984. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13985. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13986. SHARE_TO: "共有先",
  13987. SHARE_LINK: "ダイレクトリンク",
  13988. SHARE_EXPLORE: "探索",
  13989. SHARE_AT: "場所",
  13990. SHARE_WITH: "使用アプリ",
  13991. SHARE_3D: "3Dで",
  13992. SHARE_COPIED: "コピーされました!",
  13993. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13994. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13995. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13996. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13997. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13998. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13999. ERROR_GENERIC_ACTIONS_3: "または",
  14000. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14001. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14002. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14003. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14004. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14005. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14006. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14007. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14008. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14009. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14010. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14011. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14012. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14013. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14014. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14015. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14016. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14017. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14018. LINK_TO_LOCATION: "ロケーションへのリンク",
  14019. MENU_COPY: "コピー",
  14020. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14021. ROTATE: "回転",
  14022. MOVE: "移動",
  14023. INSIDE: "内側",
  14024. ZOOM: "ズーム",
  14025. HELP: "ヘルプ",
  14026. HELP_NAVIGATION_TAB: "ナビゲーション",
  14027. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14028. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14029. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14030. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14031. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14032. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14033. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14034. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14035. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14036. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14037. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14038. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14039. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14040. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14041. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14042. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14043. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14044. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14045. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14046. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14047. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14048. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14049. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14050. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14051. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14052. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14053. HELP_MORE_HLR_A: "ハイライト",
  14054. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14055. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14056. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14057. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14058. HELP_MORE_FLOORS_A: "フロアセレクター",
  14059. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14060. HELP_MORE_TAG_A: "tag™ Posts",
  14061. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14062. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14063. HELP_MORE_ZOOM_A: "ズームコントロール",
  14064. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14065. HELP_MORE_TOUR_A: "ツアーコントロール",
  14066. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14067. HELP_MORE_INSIDE_A: "内側ビュー",
  14068. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14069. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14070. HELP_MORE_VR_A: "VRモード",
  14071. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14072. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14073. HELP_MORE_360_A: "360° Views",
  14074. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14075. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14076. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14077. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14078. CLOSE: "閉じる"
  14079. }
  14080. }
  14081. , {}],
  14082. 115: [function(e, t, i) {
  14083. "use strict";
  14084. t.exports = {
  14085. PAGE_TITLE: "",
  14086. LOADING: "Загрузка",
  14087. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14088. POWERED_BY: "разработано на платформе ",
  14089. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14090. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14091. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14092. PRESENTED_BY: "Представлено ",
  14093. MORE: "Больше ",
  14094. LESS: "Меньше ",
  14095. TAG_CONTENT: "tag™ Контент",
  14096. SHOW: "Показать",
  14097. HIDE: "Скрыть",
  14098. DOLLHOUSE: "Dollhouse",
  14099. FLOOR_PLAN: "Планировка",
  14100. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14101. CLOSE_HIGHLIGHTS: "Закрыть",
  14102. PREVIOUS: "Предыдущий",
  14103. PLAY: "Воспроизвести",
  14104. PAUSE: "Пауза",
  14105. NEXT: "Следующий",
  14106. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14107. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14108. SOCIAL_SHARING: "Поделиться этой моделью",
  14109. VIEW_IN_VR: "Посмотреть в VR",
  14110. VIEW_FULLSCREEN: "Полный экран",
  14111. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14112. ZOOM_IN: "Увеличить",
  14113. ZOOM_OUT: "Уменьшить",
  14114. FLOOR_NAME: "Этаж ",
  14115. FLOOR_ALL: "Все",
  14116. TERMS: "Условия",
  14117. PORT_TERMS: "Правила пользования",
  14118. TERMS_OF_USE: "Условия использования",
  14119. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14120. CLOSE_TERMS: "Закрыть",
  14121. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14122. HELP: "Помощь",
  14123. HELP_NAVIGATION_TAB: "Навигация",
  14124. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14125. CLOSE: "Закрыть",
  14126. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14127. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14128. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14129. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14130. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14131. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14132. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14133. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14134. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14135. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14136. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14137. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14138. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14139. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14140. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14141. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14142. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14143. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14144. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14145. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14146. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14147. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14148. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14149. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14150. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14151. HELP_MORE_HLR_A: "Фотоколлаж",
  14152. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14153. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14154. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14155. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14156. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14157. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14158. HELP_MORE_TAG_A: "tag™ Posts",
  14159. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14160. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14161. HELP_MORE_ZOOM_A: "Масштаб",
  14162. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14163. HELP_MORE_TOUR_A: "Управление Туром",
  14164. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14165. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14166. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14167. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14168. HELP_MORE_VR_A: "Режим VR",
  14169. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14170. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14171. HELP_MORE_360_A: "360° Views",
  14172. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14173. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14174. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14175. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14176. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14177. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14178. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14179. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14180. WEBVR_LEARN_MORE: "Узнать больше",
  14181. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14182. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14183. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14184. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14185. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14186. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14187. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14188. VR_APP: "port VR App",
  14189. VR_APP_OPEN: "Или открыть через приложение port VR",
  14190. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14191. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14192. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14193. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14194. VR_VIEW_SPACE: "Запустить модель в VR",
  14195. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14196. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14197. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14198. VR_GOT_IT_CAPS: "ЯСНО",
  14199. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14200. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14201. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14202. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14203. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14204. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14205. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14206. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14207. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14208. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14209. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14210. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14211. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14212. VR_ANDROID_DVICES: "Android устройства",
  14213. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14214. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14215. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14216. VR_DOWNLOAD_HERE: "Скачать здесь",
  14217. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14218. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14219. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14220. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14221. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14222. SHARE_TO: "Поделиться",
  14223. SHARE_LINK: "Прямая ссылка",
  14224. SHARE_EXPLORE: "просмотреть",
  14225. SHARE_AT: "на",
  14226. SHARE_WITH: "с",
  14227. SHARE_3D: "в 3D",
  14228. SHARE_COPIED: "Скопировано!",
  14229. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14230. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14231. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14232. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14233. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14234. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14235. ERROR_GENERIC_ACTIONS_3: " или ",
  14236. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14237. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14238. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14239. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14240. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14241. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14242. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14243. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14244. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14245. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14246. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14247. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14248. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14249. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14250. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14251. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14252. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14253. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14254. LINK_TO_LOCATION: "Ссылка на местоположение",
  14255. MENU_COPY: "Копировать",
  14256. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14257. ROTATE: "Вращать",
  14258. MOVE: "Передвигаться",
  14259. INSIDE: "Вид изнутри",
  14260. ZOOM: "Масштаб"
  14261. }
  14262. }
  14263. , {}],
  14264. 116: [function(e, t, i) {//main.js
  14265. (function(t) {
  14266. "use strict";
  14267. var modelProgressBase = 0.4;
  14268. var progressUpdate = function(e){ // 0 <= e <= 1
  14269. console.log('e1:'+e)
  14270. e = Math.round(modelProgressBase * e * 100);
  14271. console.log('e2:'+e)
  14272. var t = $('.progressbar');
  14273. t.find('.bar').css('width',e+'%');
  14274. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14275. t.find('.perc').text(e +'%'); //具体数字的百分比
  14276. }
  14277. $('#gui-loading').fadeIn(200);
  14278. progressUpdate(0.1)
  14279. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14280. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14281. var data = matcher(e);
  14282. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14283. data.user = {
  14284. "is_authenticated": false,
  14285. "flags": ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  14286. }
  14287. try{//处理一下导览数据
  14288. data.model.images = data.model.images.filter(e=>{
  14289. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14290. if(e.locations && e.locations.length == 0)return;
  14291. return e
  14292. })
  14293. }catch(e){console.log(e) }
  14294. window.DATA = data;
  14295. data.model.summary = data.summary
  14296. data.model.name = data.name
  14297. for(let i in data){
  14298. data[i] == "false" && (data[i] = false)
  14299. }
  14300. progressUpdate(0.7);
  14301. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14302. if(data.weixinDesc){
  14303. g_weixinObj.desc = data.weixinDesc;
  14304. }
  14305. if(data.shareImgUrl){
  14306. g_weixinObj.imgUrl = data.shareImgUrl
  14307. }
  14308. window.wx && manage.weixinShare();
  14309. //初始画面
  14310. data.camera_start && data.camera_start.thumbImg && E(data.camera_start.thumbImg)
  14311. function E(e) {
  14312. $("<img/>").attr("src", e).on("load", function() {
  14313. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14314. $(this).remove()
  14315. })
  14316. }
  14317. //背景
  14318. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14319. settings.bgImg = settings.bgImg || data.bgImg || null
  14320. if(settings.bgImg){
  14321. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14322. "background-position": "center center"
  14323. })
  14324. }
  14325. {//初始化导览时间
  14326. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14327. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14328. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14329. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14330. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14331. }
  14332. }
  14333. {//其他
  14334. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14335. }
  14336. }).fail(e=>{
  14337. alert("缺少someData文件,请检查场景码是否正确。")
  14338. })
  14339. function StartLoad(){//当加载完data后
  14340. function i() {
  14341. var e = window.number//Y.getModelIDFromQueryString();
  14342. if (!e)
  14343. return b(null, "loading-failed");
  14344. var t = Y.parseSidUrl(e)
  14345. , i = l()
  14346. , a = c()
  14347. , s = o()
  14348. , u = V.quickstart.enabled
  14349. , g = null
  14350. , m = null
  14351. , v = null
  14352. , w = null
  14353. , T = null
  14354. , x = null
  14355. , S = null
  14356. , M = null
  14357. , R = null
  14358. , P = null
  14359. , O = null
  14360. , L = null
  14361. , N = new ue;
  14362. r(s);
  14363. h({ //MP开头写法
  14364. urlBase: t.urlBase
  14365. }).then(function() {
  14366. return re.init(),
  14367. d(t, e) //getModel and load
  14368. }).then(function(e) {
  14369. progressUpdate(0.9)
  14370. return P = e,
  14371. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14372. startSource: i,
  14373. autoplay: V.autoplay,
  14374. quickstart: u
  14375. }),
  14376. P.urls.init()
  14377. }).then(function() {
  14378. return P.loadPanos()
  14379. }).then(function() {
  14380. m = X.getStartCameraOptions(P, P.panos),
  14381. S = A(P),
  14382. O = y(u, m.mode),
  14383. v = O.controls,
  14384. w = O.player,
  14385. T = O.director,
  14386. x = O.tagManager,
  14387. M = O.tileDownloader,
  14388. R = O.qualityManager,
  14389. L = O.panoRenderer,
  14390. C(P, S, O, s),
  14391. w.director = T,//xzw add
  14392. P.supportsTiles && M.start(),
  14393. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14394. u = !1);
  14395. var e = null;
  14396. if (u) {
  14397. de.warn("Quickstart engaged. Hold on to your knickers.");
  14398. var t = v.controls[D.PANORAMA];
  14399. g = new ie(R,S.scene,S.camera,t,s),
  14400. _(S, s, P),
  14401. e = g.load(m).then(function() {
  14402. S.addComponent(g),
  14403. S.once(le.AfterRender, function() {
  14404. de.warn("First render after quickstart load finished.")
  14405. })
  14406. })
  14407. }
  14408. window.flyToFirst = function(){//xzw add
  14409. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14410. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14411. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14412. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14413. };
  14414. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14415. }).then(function() {
  14416. return f(P, U.onProgress, i, !u, a)
  14417. }).then(function() {
  14418. if (m.quickstart = u,
  14419. I(P, S, O, s),
  14420. S.started || _(S, s, P),
  14421. H.modelLoaded(P, w, v, V.autoplay),
  14422. E(w, P, m, V.autoplay).done(function() {
  14423. T.autoTour()
  14424. }),
  14425. !P.supportsTiles) {
  14426. var e = new Z(P,w);
  14427. e.start()
  14428. }
  14429. u && (S.removeComponent(g),
  14430. g.destroy(),
  14431. m.pano.enter()),
  14432. U.init(P, T, w, v, S, m, H.getSessionId()),
  14433. U.endLoading(P, T, x),
  14434. S.once(le.AfterRender, function() {
  14435. N.setAppReadyTime();
  14436. var e = N.calcFullLoadingTime();
  14437. de.warn("Total load time: " + e / 1e3),
  14438. H.loadComplete(e),
  14439. $('.jumpvideo').fadeIn()
  14440. de.warn("First render after model load finished.")
  14441. }),
  14442. S.on(le.MemoryUsageUpdated, n)
  14443. }).fail(b.bind(this, e))
  14444. }
  14445. function n(e) {
  14446. ce.update(e)
  14447. }
  14448. function r(e) {
  14449. de.info("Version", "2.25.6-0-gd87e5b1"),
  14450. q.defaultMaxListeners = 1e3,
  14451. a(e),
  14452. s()
  14453. }
  14454. function o() {
  14455. return document.getElementById("player")
  14456. }
  14457. function a(e) {
  14458. e.addEventListener("dragenter", T, !1),
  14459. e.addEventListener("dragover", T, !1)
  14460. }
  14461. function s() {
  14462. F.valueFromHash("title", !0) || $(document).ready(function() {
  14463. var e = $(".model-title");
  14464. e.hide()
  14465. })
  14466. }
  14467. function l() {
  14468. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14469. }
  14470. function c() {
  14471. return {
  14472. panoElementsToLoad: 6,
  14473. modelElementsToLoad: 0,
  14474. totalElementsLoaded: 0,
  14475. totalElementsToLoad: 0,
  14476. totalPercentageLoaded: 0,
  14477. progressCallback: null
  14478. }
  14479. }
  14480. function h(e) {
  14481. return K.loadFeatureFlags(e).done(function(e) {
  14482. K.updateDependentSettings(e, V)
  14483. })
  14484. }
  14485. // function u(e) {
  14486. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14487. // responseType: "json",
  14488. // prefetchFrom: "config"
  14489. // }).then(function(e) {
  14490. // return e ? void j.extendObject(V.appConfig, e) : {}
  14491. // }, function(e) {
  14492. // return de.warn("Failed loading runtime config, using defaults."),
  14493. // $.when({})
  14494. // })
  14495. // }
  14496. function d(e, t) {
  14497. var i = B.getModel({
  14498. url: t,
  14499. floors: F.valueFromHash("f", !0),
  14500. autoload: !1
  14501. })
  14502. ;
  14503. return $.when(i, n).then(null, function(e) {
  14504. return this
  14505. })
  14506. }
  14507. function p(e, t, i, n, r) {
  14508. de.info("Model data loaded"),
  14509. de.debug("UUID: " + e.data.job.uuid),
  14510. J.init(K.getFlags()),
  14511. i && H.initKeen({
  14512. token: i,
  14513. appId: n
  14514. }),
  14515. H.initSegment({
  14516. model: e.sid,
  14517. version: "2.25.6-0-gd87e5b1",
  14518. startSource: r.startSource,
  14519. token: t,
  14520. autoplay: r.autoplay,
  14521. quickstart: r.quickstart
  14522. })
  14523. }
  14524. function f(e, t, i, n, r) {
  14525. return r.progressCallback = t,
  14526. H.sessionStart(),
  14527. e.load(n).progress(g.bind(this, r))
  14528. }
  14529. function g(e, t) {
  14530. e.modelElementsToLoad = t[1],
  14531. v(e),
  14532. m(e)
  14533. }
  14534. function m(e) {
  14535. e.totalElementsLoaded++,
  14536. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14537. //----许钟文-----------------模型进度条向后调整
  14538. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14539. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14540. console.log('pro:'+e.totalPercentageLoaded)
  14541. //---------------------------
  14542. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14543. }
  14544. function v(e) {
  14545. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14546. }
  14547. function A(e) {
  14548. var t = new x.PerspectiveCamera;
  14549. t.layers.enable(he.PANOMARKERS),
  14550. t.layers.enable(he.RETICULE),
  14551. t.layers.enable(he.TAG);
  14552. var i = new x.Scene
  14553. , n = new x.AmbientLight(16777215);
  14554. i.add(n),
  14555. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14556. side: x.DoubleSide
  14557. })),
  14558. i.plane.position.y = 0,
  14559. i.plane.rotateX(-Math.PI / 2),
  14560. i.plane.material.visible = !1,
  14561. i.add(i.plane),
  14562. i.updateMatrixWorld(),
  14563. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14564. if (e.metadata && e.metadata.camera_position) {
  14565. var t = e.metadata.camera_position
  14566. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14567. n.position = t.clone(),
  14568. i.add(n);
  14569. var r = e.metadata.camera_quaternion
  14570. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14571. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14572. }
  14573. }),
  14574. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14575. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14576. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14577. //背景
  14578. if(!settings.transparentBg && !settings.bgImg){
  14579. i.skybox = new W
  14580. i.add(i.skybox)
  14581. }
  14582. var r = new te(i,t,z);
  14583. return r
  14584. }
  14585. function y(e, t) {
  14586. var i = e ? 1 : 1e3
  14587. , n = J.tilegen || J.imgopt ? 6 : 2;
  14588. n = F.valueFromHash("tileconc", n);
  14589. var r = new ne
  14590. , o = new ae({
  14591. concurrentDownloads: n
  14592. })
  14593. , a = new se
  14594. , s = new P
  14595. , l = new M
  14596. , c = new S(t)
  14597. , h = new R
  14598. , u = new O(i)
  14599. , d = new L
  14600. , p = new oe;
  14601. return {
  14602. qualityManager: r,
  14603. panoRenderer: a,
  14604. tileDownloader: o,
  14605. player: c,
  14606. director: l,
  14607. modelManager: s,
  14608. tagManager: p,
  14609. displayController: u,
  14610. labelDisplayController: d,
  14611. controls: h
  14612. }
  14613. }
  14614. function C(e, t, i, n) {
  14615. var r = i.controls
  14616. , o = i.qualityManager
  14617. , a = i.panoRenderer
  14618. , s = i.tileDownloader
  14619. , l = i.modelManager;
  14620. r.init(n, l),
  14621. ee.init(i.director, r, i.player, l, t),
  14622. o.init(l),
  14623. s.init(o),
  14624. a.init(t, s, o),
  14625. l.init(s, a, o),
  14626. l.addModel(e),
  14627. t.addComponent(G)
  14628. }
  14629. function I(e, t, i, n) {
  14630. var r = i.qualityManager
  14631. , o = i.panoRenderer
  14632. , a = i.tileDownloader
  14633. , s = i.modelManager
  14634. , l = i.player
  14635. , c = i.director
  14636. , h = i.tagManager
  14637. , u = i.displayController
  14638. , d = i.labelDisplayController
  14639. , p = i.controls;
  14640. t.scene.add(e),
  14641. t.qualityManager = r;
  14642. var f = {
  14643. camera: t.camera,
  14644. director: c,
  14645. modelManager: s,
  14646. tileDownloader: a,
  14647. panoRenderer: o,
  14648. qualityManager: r,
  14649. tagManager: h,
  14650. container: n,
  14651. controls: p
  14652. };
  14653. l.init(f),
  14654. l.setScene(t.scene),
  14655. h.init(s, l),
  14656. c.init(l, s),
  14657. u.init(c, l, s, h, n),
  14658. d.init(l, s, n),
  14659. z.bindEvents(l),
  14660. t.addComponent(h),
  14661. t.addComponent(l),
  14662. t.addComponent(o),
  14663. l.sceneRenderer = t; //xzw add 方便resize
  14664. }
  14665. function E(e, t, i, n) {
  14666. return de.info("Starting player in " + i.mode),
  14667. H.report(t.sid, "started-playing", n, i.quickstart),
  14668. e.start(i)
  14669. }
  14670. function b(e, t) {
  14671. de.error(t),
  14672. k.error(t),
  14673. H.report(e, "error-" + t)
  14674. }
  14675. function w(e) {
  14676. var t = F.details();
  14677. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14678. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14679. H.report(e, "error-webgl-generic"))
  14680. }
  14681. function _(e, t, i) {
  14682. try {
  14683. e.start(t)
  14684. } catch (e) {
  14685. throw de.warn(e.message),
  14686. w(i.sid),
  14687. e
  14688. }
  14689. }
  14690. function T(e) {
  14691. e.stopPropagation(),
  14692. e.preventDefault()
  14693. }
  14694. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14695. if (window.DATA.hoticon){
  14696. g_HotImage = {
  14697. point: ('static/'+ window.DATA.hoticon.default )|| "https://super.4dage.com/static/images/4dagePoint2.png",
  14698. point2: ('static/'+ window.DATA.hoticon.higt) || "https://super.4dage.com/static/images/4dagePoint.png"
  14699. } ;
  14700. }
  14701. //czj 判断someData 有没有backgroundMusic 添加音乐
  14702. if (window.DATA.backgroundMusic) {
  14703. if(window.isLocal){
  14704. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14705. }else{
  14706. SoundManager.setSrc('bgm','http://project.4dage.com:8017'+ window.DATA.backgroundMusic )
  14707. // SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14708. }
  14709. $("#volume").show();
  14710. }else if (g_version === "one"){
  14711. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  14712. $("#volume").show();
  14713. }
  14714. //隐藏公司logo
  14715. if(window.DATA.loadlogo){
  14716. showLogo();
  14717. }
  14718. e("./lib/three75-shim"),
  14719. e("./lib/array-polyfill"),
  14720. e("./lib/performance-polyfill"),
  14721. e("./lib/shaders/CopyShader.js"),
  14722. e("./lib/shaders/HorizontalBlurShader.js"),
  14723. e("./lib/shaders/VerticalBlurShader.js"),
  14724. e("./lib/postprocessing/EffectComposer.js"),
  14725. e("./lib/postprocessing/RenderPass.js"),
  14726. e("./lib/postprocessing/MaskPass.js"),
  14727. e("./lib/postprocessing/ShaderPass.js"),
  14728. window.Promise || (window.Promise = e("promise-polyfill"));
  14729. var x = e("three")
  14730. , _x = e("three")
  14731. , S = (e("./util/sentry"),
  14732. e("./player"))
  14733. , M = e("./director")
  14734. , R = e("./controls/CameraControls")
  14735. , P = e("./model/ModelManager")
  14736. , O = e("./DisplayController")
  14737. , L = e("./label/LabelDisplayController")
  14738. , D = e("./enum/Viewmode")
  14739. , N = e("./util/logger")
  14740. , B = e("./showcase")
  14741. , F = e("./util/browser")
  14742. , V = e("./settings")
  14743. , U = e("./gui/gui")
  14744. , k = e("./gui/error")
  14745. , H = e("./analytics")
  14746. , G = e("./util/transitions")
  14747. , z = e("./effects")
  14748. , W = e("./objects/Skybox")
  14749. , j = e("./util/common")
  14750. , Y = (e("./util/PanoramaCollection"),
  14751. e("./util/math"),
  14752. e("./util/showcase"))
  14753. , X = e("./util/camera")
  14754. , Z = (e("./objects/Panorama"),
  14755. e("./cameras/PanoramaCamera"),
  14756. e("./preloaders"))
  14757. , q = e("events").EventEmitter
  14758. , K = e("./featureflags")
  14759. , Q = (e("./util/lerp"),
  14760. e("./util/ajax"))
  14761. , J = e("./ab")
  14762. , ee = e("./sdk/automation.js")
  14763. , te = e("./scene/SceneRenderer")
  14764. , ie = e("./scene/QuickstartManager")
  14765. , ne = e("./tile/QualityManager.js")
  14766. , re = e("./localization/localize")
  14767. , oe = e("./tag/tagManager")
  14768. , ae = e("./tile/TileDownloader")
  14769. , se = e("./tile/PanoRenderer")
  14770. , le = (e("./enum/PanoSizeClass"),
  14771. e("./enum/PanoramaEvents"),
  14772. e("./enum/SceneRendererEvents"))
  14773. , ce = e("./gui/memoryUsage")
  14774. , he = e("./enum/RenderLayers")
  14775. , ue = e("./TimingData")
  14776. , de = new N(t);
  14777. N.level = V.logLevel,
  14778. N.consoleEnabled = V.console,
  14779. i()
  14780. }
  14781. }
  14782. ).call(this, "/js/main.js")
  14783. }
  14784. , {
  14785. "./DisplayController": 1,
  14786. "./TimingData": 2,
  14787. "./ab": 3,
  14788. "./analytics": 4,
  14789. "./cameras/PanoramaCamera": 7,
  14790. "./controls/CameraControls": 9,
  14791. "./director": 15,
  14792. "./effects": 16,
  14793. "./enum/PanoSizeClass": 36,
  14794. "./enum/PanoramaEvents": 37,
  14795. "./enum/RenderLayers": 41,
  14796. "./enum/SceneRendererEvents": 43,
  14797. "./enum/Viewmode": 51,
  14798. "./featureflags": 59,
  14799. "./gui/error": 64,
  14800. "./gui/gui": 65,
  14801. "./gui/memoryUsage": 73,
  14802. "./label/LabelDisplayController": 91,
  14803. "./lib/array-polyfill": 92,
  14804. "./lib/performance-polyfill": 95,
  14805. "./lib/postprocessing/EffectComposer.js": 96,
  14806. "./lib/postprocessing/MaskPass.js": 97,
  14807. "./lib/postprocessing/RenderPass.js": 98,
  14808. "./lib/postprocessing/ShaderPass.js": 99,
  14809. "./lib/shaders/CopyShader.js": 100,
  14810. "./lib/shaders/HorizontalBlurShader.js": 101,
  14811. "./lib/shaders/VerticalBlurShader.js": 102,
  14812. "./lib/three75-shim": 103,
  14813. "./localization/localize": 108,
  14814. "./tag/tagManager": 124,
  14815. "./model/ModelManager": 140,
  14816. "./objects/Panorama": 148,
  14817. "./objects/Skybox": 152,
  14818. "./player": 155,
  14819. "./preloaders": 156,
  14820. "./scene/QuickstartManager": 157,
  14821. "./scene/SceneRenderer": 158,
  14822. "./sdk/automation.js": 164,
  14823. "./settings": 166,
  14824. "./showcase": 168,
  14825. "./tile/PanoRenderer": 169,
  14826. "./tile/QualityManager.js": 170,
  14827. "./tile/TileDownloader": 171,
  14828. "./util/PanoramaCollection": 178,
  14829. "./util/ajax": 181,
  14830. "./util/browser": 182,
  14831. "./util/camera": 183,
  14832. "./util/common": 185,
  14833. "./util/lerp": 188,
  14834. "./util/logger": 189,
  14835. "./util/math": 190,
  14836. "./util/sentry": 192,
  14837. "./util/showcase": 193,
  14838. "./util/transitions": 195,
  14839. events: 202,
  14840. "promise-polyfill": 213,
  14841. three: 217
  14842. }],
  14843. 117: [function(e, t, i) {
  14844. "use strict";
  14845. function n(e) {
  14846. e = e || {}
  14847. r.RawShaderMaterial.call(this, a.extendObject({
  14848. fragmentShader: o.cube.fragmentShader,
  14849. vertexShader: o.cube.vertexShader,
  14850. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14851. name: "CubemapMaterial",
  14852. }, e))
  14853. }
  14854. var r = e("three")
  14855. , o = e("../shaders")
  14856. , a = e("../util/common");
  14857. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14858. n.prototype.constructor = n,
  14859. t.exports = n
  14860. }
  14861. , {
  14862. "../shaders": 167,
  14863. "../util/common": 185,
  14864. three: 217
  14865. }],
  14866. 118: [function(e, t, i) {
  14867. "use strict";
  14868. function n(e) {
  14869. e = e || {}
  14870. r.RawShaderMaterial.call(this, a.extendObject({
  14871. fragmentShader: o.model.fragmentShader,
  14872. vertexShader: o.model.vertexShader,
  14873. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14874. name: "ModelTextureMaterial",
  14875. }, e))
  14876. }
  14877. var r = e("three")
  14878. , o = e("../shaders")
  14879. , a = e("../util/common");
  14880. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14881. n.prototype.constructor = n,
  14882. n.prototype.setProjectedPanos = function(e, t, i) {
  14883. i && (this.uniforms.progress.value = 0),
  14884. e.ensureSkyboxReadyForRender(),
  14885. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14886. this.uniforms.pano0Position.value.copy(e.position),
  14887. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14888. t.ensureSkyboxReadyForRender(),
  14889. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14890. this.uniforms.pano1Position.value.copy(t.position),
  14891. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14892. }
  14893. /* n.prototype.setEyeDir = function(dir, pos) {//加
  14894. this.uniforms.eyeDir.value.copy(dir)
  14895. this.uniforms.eyePos.value.copy(pos)
  14896. }
  14897. n.prototype.setBendCameraQua = function(matrix) {//加
  14898. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  14899. } */
  14900. ,
  14901. t.exports = n
  14902. }
  14903. , {
  14904. "../shaders": 167,
  14905. "../util/common": 185,
  14906. three: 217
  14907. }],
  14908. 119: [function(e, t, i) {
  14909. (function(i) {
  14910. "use strict";
  14911. function n(e, t, i, n) {
  14912. this.div = null,
  14913. this.body = null,
  14914. this.label = e,
  14915. this.description = t,
  14916. this.parsedDescription = [],
  14917. this.media = i || {
  14918. type: null
  14919. },
  14920. this.loadingSpinner = null,
  14921. this.parser = new r({
  14922. supportLinks: !u.valueFromHash("mls"),
  14923. keepLinkLabels: !0
  14924. }),
  14925. this.state = I.CLOSED,
  14926. this.orientation = "",
  14927. this.initialTransform = "",
  14928. this.hovering = !1,
  14929. this.openTransition = null,
  14930. this.closeTransition = null,
  14931. this.openPromise = null,
  14932. this.closePromise = null,
  14933. this.animationTransition = null,
  14934. this.animationScale = 0
  14935. }
  14936. var r = e("../Parser/DescriptionParser")
  14937. , o = e("../Media/Link")
  14938. , a = e("../Media/Image")
  14939. , s = e("../Media/EmbedlyPlayer")
  14940. , l = e("../Media/EmbedlyEmbed")
  14941. , c = e("../../util/transitions")
  14942. , h = e("../../util/lerp")
  14943. , u = e("../../util/browser")
  14944. , d = e("./BillboardEvent")
  14945. , p = e("../Media/MediaEvent")
  14946. , f = e("../Parser/DescriptionChunkType")
  14947. , g = e("events").EventEmitter
  14948. , m = e("./billboardSettings")
  14949. , v = e("./overlaySettings")
  14950. , A = e("../../util/logger")
  14951. , y = new A(i)
  14952. , C = document.getElementById("tag-billboards");
  14953. C.addEventListener("touchend", function(e) {
  14954. C.style.pointerEvents = "none"
  14955. }),
  14956. C.addEventListener("touchcancel", function(e) {
  14957. C.style.pointerEvents = "none"
  14958. });
  14959. var I = {
  14960. CLOSED: "closed",
  14961. OPENING: "opening",
  14962. OPEN: "open",
  14963. CLOSING: "closing",
  14964. ACTIVE: "active"
  14965. };
  14966. n.prototype = Object.create(g.prototype),
  14967. n.prototype.build = function(e) {
  14968. this.parsedDescription = this.parser.parse(this.description);
  14969. var t = document.createElement("div");
  14970. t.className = "tag-container has-hotzone",
  14971. this.div = t,
  14972. this.body = document.createElement("div"),
  14973. this.body.className = "tag-body";
  14974. var i = document.createElement("div");
  14975. i.classList.add("tag-content");
  14976. var n = document.createElement("div");
  14977. n.classList.add("tag-text-content");
  14978. var r = document.createElement("div");
  14979. r.className = "tag-label",
  14980. r.textContent = this.label,
  14981. n.appendChild(r);
  14982. var o = document.createElement("div");
  14983. o.className = "tag-desc",
  14984. n.appendChild(o),
  14985. i.appendChild(n),
  14986. this.body.appendChild(i),
  14987. this.appendDescriptionElements(this.parsedDescription, o),
  14988. this.appendMedia(),
  14989. t.appendChild(this.body),
  14990. C.appendChild(t),
  14991. this.bindEvents(t, this.body)
  14992. }
  14993. ,
  14994. n.prototype.bindEvents = function(e, t) {
  14995. var i = function(e) {
  14996. return function(t) {
  14997. if (!this.div.classList.contains("overlay")) {
  14998. var i, n = document.getElementById("player");
  14999. try {
  15000. i = new MouseEvent(e,t)
  15001. } catch (n) {
  15002. i = document.createEvent("MouseEvents"),
  15003. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  15004. }
  15005. n.dispatchEvent(i)
  15006. }
  15007. }
  15008. };
  15009. t.addEventListener("mousedown", function(e) {
  15010. e.stopPropagation()
  15011. }),
  15012. t.addEventListener("mouseup", function(e) {
  15013. e.stopPropagation()
  15014. }),
  15015. e.addEventListener("touchstart", function(e) {
  15016. C.style.pointerEvents = "auto"
  15017. }),
  15018. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15019. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15020. t.addEventListener("mouseover", function(t) {
  15021. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15022. }
  15023. .bind(this)),
  15024. e.addEventListener("mouseenter", function(e) {
  15025. this.state !== I.CLOSING && (this.hovering = !0,
  15026. this.emit(d.ENTER))
  15027. }
  15028. .bind(this)),
  15029. e.addEventListener("mouseleave", function(e) {
  15030. this.hovering = !1,
  15031. this.emit(d.LEAVE)
  15032. }
  15033. .bind(this)),
  15034. e.addEventListener("gesturestart", function(e) {
  15035. e.preventDefault()
  15036. });
  15037. var n = e.querySelector(".tag-text-content")
  15038. , r = 0;
  15039. n.addEventListener("touchstart", function(e) {
  15040. r = e.changedTouches[0].clientY
  15041. }),
  15042. n.addEventListener("touchmove", function(t) {
  15043. function i(e) {
  15044. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15045. }
  15046. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15047. }),
  15048. e.addEventListener("touchmove", function(e) {
  15049. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15050. })
  15051. }
  15052. ,
  15053. n.prototype.appendDescriptionElements = function(e, t) {
  15054. e.length > 0 && this.div.classList.add("has-text"),
  15055. e.forEach(function(e, i) {
  15056. switch (e.type) {
  15057. case f.TEXT:
  15058. t.appendChild(this.createTextElement(e.text));
  15059. break;
  15060. case f.LINK:
  15061. t.appendChild(this.createLinkElement(e.link))
  15062. }
  15063. }
  15064. .bind(this))
  15065. }
  15066. ,
  15067. n.prototype.appendLoadingSpinner = function() {
  15068. this.loadingSpinner = document.createElement("div"),
  15069. this.loadingSpinner.classList.add("loading-spinner");
  15070. var e = document.createElement("div");
  15071. e.classList.add("gui-spinner-icon"),
  15072. this.loadingSpinner.appendChild(e),
  15073. this.body.appendChild(this.loadingSpinner)
  15074. }
  15075. ,
  15076. n.prototype.onMediaLoadFinished = function() {
  15077. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15078. this.applyOrientation(this.orientation),
  15079. this.loadingSpinner = null)
  15080. }
  15081. ,
  15082. n.prototype.appendMedia = function() {
  15083. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15084. this.appendLoadingSpinner();
  15085. var e = document.createElement("div");
  15086. e.classList.add("tag-media-content");
  15087. var t = document.createElement("i");
  15088. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15089. t.classList.add(e)
  15090. }),
  15091. this.body.appendChild(t),
  15092. this.body.appendChild(e),
  15093. this.media.type) {
  15094. case f.IMAGE:
  15095. e.appendChild(this.createImageElement(this.media, this.body));
  15096. break;
  15097. case f.VIDEO:
  15098. e.appendChild(this.createVideoElement(this.media, this.body));
  15099. break;
  15100. case f.RICH:
  15101. e.appendChild(this.createEmbedElement(this.media, this.body))
  15102. }
  15103. }
  15104. }
  15105. ,
  15106. n.prototype.createTextElement = function(e) {
  15107. var t = document.createElement("span");
  15108. return t.textContent = e,
  15109. t
  15110. }
  15111. ;
  15112. n.prototype.createLinkElement = function(e) {
  15113. var t = new o(e);
  15114. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15115. t.createDomElement()
  15116. }
  15117. ,
  15118. n.prototype.createImageElement = function(e, t) {
  15119. function i() {
  15120. function e() {
  15121. m || (r.classList.remove("view-image"),
  15122. c.classList.add("overlay"),
  15123. i(),
  15124. window.addEventListener("resize", b),
  15125. c.addEventListener("click", a),
  15126. g.addEventListener("click", l),
  15127. f.addEventListener("click", s),
  15128. m = !0,
  15129. o.emit(p.IMAGE_OPENED))
  15130. }
  15131. function i() {
  15132. t.classList.add("show-info"),
  15133. h.classList.remove("collapsible"),
  15134. h.style.height = "";
  15135. var e = parseFloat(getComputedStyle(I).lineHeight)
  15136. , i = y + e
  15137. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15138. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15139. , s = a
  15140. , l = s * n.aspect;
  15141. l > r && (l = r,
  15142. s = l / n.aspect),
  15143. s > a && (s = a,
  15144. l = s * n.aspect),
  15145. l += C,
  15146. s += C + i,
  15147. t.style.width = l + "px",
  15148. t.style.height = s + "px",
  15149. u.style.paddingTop = e + C + "px",
  15150. o.description.length > 0 && (h.classList.add("collapsible"),
  15151. h.style.height = h.clientHeight + 12 + "px",
  15152. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15153. }
  15154. function a(e) {
  15155. e.target === c && s()
  15156. }
  15157. function s() {
  15158. m && (m = !1,
  15159. r.classList.add("view-image"),
  15160. c.classList.remove("overlay"),
  15161. h.style.height = "",
  15162. u.style.paddingTop = "",
  15163. t.style.width = "",
  15164. t.style.height = "",
  15165. window.removeEventListener("resize", b),
  15166. c.removeEventListener("click", a),
  15167. g.removeEventListener("click", l),
  15168. f.removeEventListener("click", s),
  15169. o.emit(p.IMAGE_CLOSED),
  15170. o.close(!0))
  15171. }
  15172. function l(e) {
  15173. t.classList.toggle("show-info")
  15174. }
  15175. var c = o.div
  15176. , h = c.getElementsByClassName("tag-content")[0]
  15177. , u = c.getElementsByClassName("tag-media-content")[0]
  15178. , f = t.getElementsByClassName("close")[0]
  15179. , g = h.getElementsByClassName("tag-label")[0];
  15180. c.classList.add("has-image"),
  15181. r.classList.add("view-image"),
  15182. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15183. o.applyOrientation(o.orientation);
  15184. var m = !1
  15185. , A = getComputedStyle(h)
  15186. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15187. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15188. , I = h.querySelector(".tag-label")
  15189. , E = h.querySelector(".tag-desc")
  15190. , b = function() {
  15191. var e, t, n = 0;
  15192. return function() {
  15193. clearInterval(e),
  15194. clearTimeout(t),
  15195. e = setInterval(function() {
  15196. var e = c.clientHeight;
  15197. n !== e && (i(),
  15198. n = e)
  15199. }, 100),
  15200. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15201. }
  15202. }();
  15203. n.on(p.IMAGE_OPENING, e),
  15204. o.on(d.ACTIVATE, e),
  15205. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15206. o.on(d.CLOSING, s)
  15207. }
  15208. var n = new a
  15209. , r = n.createDomElement();
  15210. this.once(d.OPENED, function() {
  15211. n.load(e.src).then(i).catch(function(t) {
  15212. y.warn("Failed to load image:", e.src),
  15213. y.warn("with error:", t)
  15214. }).then(this.onMediaLoadFinished.bind(this))
  15215. });
  15216. var o = this;
  15217. return r
  15218. }
  15219. ,
  15220. n.prototype.createVideoElement = function(e, t) {
  15221. var i = new s({
  15222. autoPlay: !0,
  15223. autoResume: !0,
  15224. startMuted: !1,
  15225. loop: !1
  15226. })
  15227. , n = i.createDomElement();
  15228. return this.once(d.OPENED, function() {
  15229. i.load(e.src).then(function() {
  15230. this.div.classList.add("has-video"),
  15231. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15232. i.play()),
  15233. this.on(d.OPENING, i.show.bind(i)),
  15234. this.on(d.OPENED, i.play.bind(i)),
  15235. this.on(d.CLOSING, i.pause.bind(i)),
  15236. this.on(d.CLOSED, i.hide.bind(i))
  15237. }
  15238. .bind(this)).catch(function(t) {
  15239. y.warn("Failed to embed video:", e.src),
  15240. y.warn("with error:", t)
  15241. }).then(this.onMediaLoadFinished.bind(this))
  15242. }
  15243. .bind(this)),
  15244. n
  15245. }
  15246. ,
  15247. n.prototype.createEmbedElement = function(e, t) {
  15248. var i = new l
  15249. , n = i.createDomElement();
  15250. return this.once(d.OPENED, function() {
  15251. i.load(e.src).then(function() {
  15252. this.div.classList.add("has-embed"),
  15253. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15254. this.applyOrientation(this.orientation),
  15255. this.on(d.OPENING, i.show.bind(i)),
  15256. this.on(d.CLOSED, i.hide.bind(i))
  15257. }
  15258. .bind(this)).catch(function(t) {
  15259. y.warn("Failed to embed:", e.src),
  15260. y.warn("with error:", t)
  15261. }).then(this.onMediaLoadFinished.bind(this))
  15262. }
  15263. .bind(this)),
  15264. n
  15265. }
  15266. ,
  15267. n.prototype.open = function(e) {
  15268. return this.openPromise = $.Deferred(),
  15269. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15270. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15271. this.state !== I.OPEN && (this.emit(d.OPENING),
  15272. e && this.emit(d.ACTIVATING),
  15273. this.state = I.OPENING,
  15274. this.animateOpen(function() {
  15275. e && this.setActiveState(),
  15276. this.openPromise.resolve()
  15277. }
  15278. .bind(this)))
  15279. }
  15280. .bind(this), m.animation.openDelay),
  15281. c.cancel(this.closeTransition),
  15282. this.closePromise && this.closePromise.reject(),
  15283. this.closeTransition = void 0,
  15284. this.openPromise.promise())
  15285. }
  15286. ,
  15287. n.prototype.close = function(e) {
  15288. return this.closePromise = $.Deferred(),
  15289. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15290. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15291. this.state = I.CLOSING,
  15292. this.animateClose())
  15293. }
  15294. .bind(this), m.animation.closeDelay)),
  15295. c.cancel(this.openTransition),
  15296. this.openPromise && this.openPromise.reject(),
  15297. this.openTransition = void 0,
  15298. this.closePromise.resolve(),
  15299. this.closePromise.promise())
  15300. }
  15301. ,
  15302. n.prototype.setActiveState = function() {
  15303. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15304. this.emit(d.ACTIVATE),
  15305. this.div.classList.remove("has-hotzone"))
  15306. }
  15307. ,
  15308. n.prototype.animateOpen = function(e) {
  15309. if (this.state === I.OPENING) {
  15310. if (c.cancel(this.animationTransition),
  15311. u.detectSamsungNative())
  15312. return this.boardOrientation = null,
  15313. this.div.style.visibility = "visible",
  15314. this.emit(d.OPENED),
  15315. this.state = I.OPEN,
  15316. void (e && e());
  15317. this.div.style.webkitTransform = "scale(0)",
  15318. this.div.style.transform = "scale(0)",
  15319. this.div.style.visibility = "visible",
  15320. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15321. this.emit(d.OPENED),
  15322. this.state = I.OPEN,
  15323. e && e()
  15324. }
  15325. .bind(this))
  15326. }
  15327. }
  15328. ,
  15329. n.prototype.animateClose = function(e) {
  15330. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15331. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15332. this.emit(d.CLOSED),
  15333. this.state = I.CLOSED,
  15334. this.div.style.visibility = "hidden",
  15335. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15336. e && e()
  15337. }
  15338. .bind(this)))
  15339. }
  15340. ,
  15341. n.prototype.needsUpdate = function() {
  15342. return this.state !== I.CLOSED
  15343. }
  15344. ,
  15345. n.prototype.update = function(e, t) {
  15346. if (this.needsUpdate()) {
  15347. var i = (this.updateOrientation(e),
  15348. this.calcScale(t))
  15349. , n = {
  15350. x: (e.x + 1) * $("#player").width() / 2,
  15351. y: (e.y + 1) * $("#player").height() / 2
  15352. };
  15353. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15354. this.div.style.webkitTransform = this.div.screenTransform,
  15355. this.div.style.transform = this.div.screenTransform
  15356. }
  15357. }
  15358. ,
  15359. n.prototype.getDimensions = function() {
  15360. return this.div.getBoundingClientRect()
  15361. }
  15362. ,
  15363. n.prototype.calcScale = function(e) {
  15364. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15365. }
  15366. ,
  15367. n.prototype.updateOrientation = function(e) {
  15368. if (this.state !== I.ACTIVE) {
  15369. var t = 1 / 3
  15370. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15371. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15372. , r = "";
  15373. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15374. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15375. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15376. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15377. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15378. }
  15379. }
  15380. ,
  15381. n.prototype.applyOrientation = function(e) {
  15382. this.div.style.transform = this.div.style.webkitTransform = "",
  15383. this.div.classList.remove("tag-container-" + this.orientation),
  15384. this.div.classList.add("tag-container-" + e);
  15385. var t = window.getComputedStyle(this.div);
  15386. this.initialTransform = t.transform || t.webkitTransform,
  15387. "none" === this.initialTransform && (this.initialTransform = "");
  15388. var i = t.transform.slice(7, -1).split(",")
  15389. , n = -i[4]
  15390. , r = -i[5];
  15391. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15392. this.div.style.transformOrigin = n + "px " + r + "px",
  15393. this.orientation = e
  15394. }
  15395. ,
  15396. t.exports = n
  15397. }
  15398. ).call(this, "/js/tag/Billboard/Billboard.js")
  15399. }
  15400. , {
  15401. "../../util/browser": 182,
  15402. "../../util/lerp": 188,
  15403. "../../util/logger": 189,
  15404. "../../util/transitions": 195,
  15405. "../Media/EmbedlyEmbed": 125,
  15406. "../Media/EmbedlyPlayer": 126,
  15407. "../Media/Image": 128,
  15408. "../Media/Link": 129,
  15409. "../Media/MediaEvent": 131,
  15410. "../Parser/DescriptionChunkType": 133,
  15411. "../Parser/DescriptionParser": 134,
  15412. "./BillboardEvent": 120,
  15413. "./billboardSettings": 121,
  15414. "./overlaySettings": 122,
  15415. events: 202
  15416. }],
  15417. 120: [function(e, t, i) {
  15418. "use strict";
  15419. t.exports = Object.freeze({
  15420. ENTER: "billboard.enter",
  15421. LEAVE: "billboard.leave",
  15422. OPENING: "billboard.opening",
  15423. OPENED: "billboard.open",
  15424. CLOSING: "billboard.closing",
  15425. CLOSED: "billboard.closed",
  15426. ACTIVATING: "billboard.activating",
  15427. ACTIVATE: "billboard.activate"
  15428. })
  15429. }
  15430. , {}],
  15431. 121: [function(e, t, i) {
  15432. "use strict";
  15433. t.exports = Object.freeze({
  15434. animation: Object.freeze({
  15435. hoverOnClosing: !1,
  15436. openDelay: 100,
  15437. closeDelay: 50,
  15438. openDuration: 200,
  15439. closeDuration: 100
  15440. }),
  15441. boardToDiscRatio: 1.2
  15442. })
  15443. }
  15444. , {}],
  15445. 122: [function(e, t, i) {
  15446. "use strict";
  15447. t.exports = Object.freeze({
  15448. boundaryWidth: 30,
  15449. boundaryHeight: 0
  15450. })
  15451. }
  15452. , {}],
  15453. 123: [function(e, t, i) {//tag
  15454. (function(i) {
  15455. "use strict";
  15456. function n(e, t, i) {
  15457. var n = i.version || "0";
  15458. "0" !== n && I.info("tag defined using version " + n),
  15459. this.model = e,
  15460. this.sid = t,
  15461. this.color = (new r.Color).set(i.color || l.tagDefault),
  15462. this.hoverColor = l._darken(this.color, .2),
  15463. this.floor = null,
  15464. this.floorIndex = i.floor,
  15465. this.mode = s.PANORAMA,
  15466. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15467. this.obj3d = null,
  15468. this.disc = null,
  15469. this.materials = {
  15470. disc: null,
  15471. pole: null
  15472. },
  15473. this.position = (new r.Vector3).copy(i.position),
  15474. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15475. this.discWorldPosition = null,
  15476. this.discScale = .05,
  15477. this.poleEnabled = i.stem.enabled,
  15478. this.billboard = new o(i.label,i.description,i.media,this),
  15479. this.visibleTransition = null,
  15480. this.hoveringDisc = !1
  15481. }
  15482. var r = e("three")
  15483. , o = e("./Billboard/Billboard")
  15484. , a = e("../settings")
  15485. , s = e("../enum/Viewmode")
  15486. , l = e("../enum/Colors")
  15487. , c = e("../enum/RenderLayers")
  15488. , h = e("../enum/RenderOrder")
  15489. , u = (e("../util/common"),
  15490. e("../util/math"))
  15491. , d = e("../util/texture")
  15492. , p = e("../objects/Panorama")
  15493. , f = e("../shaders")
  15494. , g = e("../util/transitions")
  15495. , m = e("../util/lerp")
  15496. , v = e("../util/easing")
  15497. , A = e("./Billboard/BillboardEvent")
  15498. , y = e("events").EventEmitter
  15499. , C = e("../util/logger")
  15500. , I = new C(i)
  15501. , E = d.loadBase64("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==")
  15502. , b = d.loadBase64("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")
  15503. , w = new r.PlaneBufferGeometry(1,1);
  15504. n.prototype = Object.create(y.prototype),
  15505. n.raycaster = new r.Raycaster,
  15506. n.prototype.bindEvents = function() {
  15507. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15508. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15509. }
  15510. ,
  15511. n.prototype.build = function() {
  15512. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15513. this.floor && (this.billboard.build(this.model.sid),
  15514. this.obj3d = this.buildObject3D(),
  15515. this.floor.add(this.obj3d)),
  15516. this
  15517. }
  15518. ,
  15519. n.prototype.buildObject3D = function() {
  15520. var e = new r.Object3D;
  15521. e.position.copy(this.position);
  15522. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15523. t.bg.value = b,
  15524. t.mask.value = E,
  15525. t.color.value.copy(this.color),
  15526. this.materials.disc = new r.RawShaderMaterial({
  15527. transparent: !0,
  15528. vertexShader: f.tagDisc.vertexShader,
  15529. fragmentShader: f.tagDisc.fragmentShader,
  15530. uniforms: t
  15531. }),
  15532. this.disc = new r.Mesh(w,this.materials.disc),
  15533. this.disc.layers.set(c.TAG),
  15534. this.disc.position.copy(this.discPosition),
  15535. this.disc.renderOrder = h.tagDisc,
  15536. this.disc.tag = this;
  15537. var i = this.buildPole();
  15538. return i.layers.set(c.TAG),
  15539. i.renderOrder = h.tagStem,
  15540. e.add(i),
  15541. e.layers.set(c.TAG),
  15542. e.add(this.disc)
  15543. }
  15544. ,
  15545. n.prototype.buildPole = function() {
  15546. var e = new r.BufferGeometry
  15547. , t = new Float32Array(6);
  15548. return t[0] = t[1] = t[2] = 0,
  15549. t[3] = this.discPosition.x,
  15550. t[4] = this.discPosition.y,
  15551. t[5] = this.discPosition.z,
  15552. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15553. this.materials.pole = new r.LineBasicMaterial({
  15554. linewidth: a.tags.pole.width,
  15555. color: a.tags.pole.color,
  15556. opacity: 0,
  15557. visible: this.poleEnabled,
  15558. transparent: !0,
  15559. depthWrite: !1
  15560. }),
  15561. new r.Line(e,this.materials.pole)
  15562. }
  15563. ,
  15564. n.prototype.setFreeState = function(e) {
  15565. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15566. this.materials.disc.uniforms.color.value = this.color
  15567. }
  15568. .bind(this))
  15569. }
  15570. ,
  15571. n.prototype.setHoverState = function(e) {
  15572. this.billboard.open(e),
  15573. this.materials.disc.uniforms.color.value = this.hoverColor
  15574. }
  15575. ,
  15576. n.prototype.hide = function(e, t) {
  15577. var i = $.Deferred();
  15578. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15579. return i.resolve().promise();
  15580. e = e || 0,
  15581. t = t || 0,
  15582. g.cancel(this.visibleTransition);
  15583. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15584. , r = t + e
  15585. , o = t / r;
  15586. return this.visibleTransition = g.start(function(e) {
  15587. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15588. , i = m.property(e.materials.pole, "opacity", 0);
  15589. return function(n) {
  15590. t(n),
  15591. e.materials.pole && i(n)
  15592. }
  15593. }(this), r * n, function() {
  15594. i.resolve()
  15595. }, o, v[a.warp.blendEasing]),
  15596. i.promise()
  15597. }
  15598. ,
  15599. n.prototype.show = function(e, t) {
  15600. var i = $.Deferred();
  15601. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15602. return i.resolve().promise();
  15603. e = e || 0,
  15604. t = t || 0,
  15605. g.cancel(this.visibleTransition);
  15606. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15607. , r = t + e
  15608. , o = t / r;
  15609. return this.visibleTransition = g.start(function(e) {
  15610. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15611. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15612. return function(n) {
  15613. t(n),
  15614. e.materials.pole && i(n)
  15615. }
  15616. }(this), r * n, function() {
  15617. i.resolve()
  15618. }, o, v[a.warp.blendEasing]),
  15619. i.promise()
  15620. }
  15621. ,
  15622. n.prototype.closestPanoTowardTag = function(e, t) {
  15623. var i = []
  15624. , o = []
  15625. , l = this.disc.getWorldPosition();
  15626. if (e === s.PANORAMA) {
  15627. var c = .5
  15628. , h = t.position.clone().sub(l).normalize();
  15629. i.push(p.filters.isPanoAligned()),
  15630. i.push(p.filters.inPanoDirection(l, h, c)),
  15631. i.push(p.filters.isNeighbourPanoTo(t)),
  15632. o.push(p.scoreFunctions.direction(l, h))
  15633. }
  15634. var u = new r.Vector3
  15635. , d = function(e) {
  15636. u.copy(l).sub(e.position);
  15637. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15638. , i = a.tags.navigate.tiltTolerance;
  15639. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15640. }
  15641. , f = function(e) {
  15642. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15643. };
  15644. i.push(f, d),
  15645. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15646. var g = this.model.panos.sortByScore(i, o);
  15647. if (a.tags.navigate.lineOfSight) {
  15648. for (var m = 0; m < g.length; m++) {
  15649. var v = g[m].pano
  15650. , A = v.position.distanceTo(l);
  15651. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15652. return null;
  15653. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15654. var y = n.raycaster.intersectObjects(this.model.colliders);
  15655. if (0 === y.length || y[0].distance > A)
  15656. return v
  15657. }
  15658. return null
  15659. }
  15660. return g.length > 0 && g[0].pano
  15661. }
  15662. ,
  15663. n.prototype.examine = function(e) {
  15664. var t = e.mode
  15665. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15666. , n = this.disc.getWorldPosition();
  15667. this.billboard.setActiveState();
  15668. var o = function() {
  15669. var t = this.billboard.getDimensions()
  15670. , n = new r.Vector3;
  15671. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15672. n.unproject(e.camera),
  15673. e.flyToPano({
  15674. pano: i,
  15675. lookAtPoint: n
  15676. })
  15677. }
  15678. .bind(this);
  15679. if (t === s.PANORAMA)
  15680. if (i !== e.currentPano) {
  15681. var l = {
  15682. pano: i,
  15683. lookAtPoint: n,
  15684. duration: null,
  15685. maxDistanceOverride: null,
  15686. skipWarpingCheck: !1
  15687. };
  15688. e.flyToPano(l, o)
  15689. } else
  15690. setTimeout(function() {
  15691. this.billboard.open().then(function() {
  15692. o()
  15693. })
  15694. }
  15695. .bind(this), 0);
  15696. else {
  15697. var c = {
  15698. pano: i
  15699. };
  15700. if (n) {
  15701. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15702. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15703. }
  15704. c.callback = o,
  15705. c.duration = 1500,
  15706. c.mode = s.PANORAMA,
  15707. e.flyToNewMode(c)
  15708. }
  15709. }
  15710. ,
  15711. n.prototype.update = function(e, t) {
  15712. var i = new r.Vector3;
  15713. return function(e, t) {
  15714. this.discWorldPosition = this.disc.getWorldPosition(),
  15715. this.updateDisc(e, t),
  15716. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15717. i.z < 1 && (i.y *= -1,
  15718. this.billboard.update(i, this.getDiscRadius(i, t))))
  15719. }
  15720. }(),
  15721. n.prototype.updateDisc = function(e, t) {
  15722. var i = new r.Vector3
  15723. , o = new r.Vector3
  15724. , l = new r.Vector3
  15725. , c = new r.Vector3
  15726. , h = new r.Vector3;
  15727. return function(e, t) {
  15728. var u = a.tags.visibility
  15729. , d = a.tags.disc.scale
  15730. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15731. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15732. this.obj3d.visible) {
  15733. this.disc.quaternion.copy(t.quaternion);
  15734. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15735. i.copy(this.discWorldPosition).project(t),
  15736. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15737. l.set(f / 2, 0, 0).add(o),
  15738. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15739. h.copy(c).unproject(t);
  15740. var g = h.distanceTo(this.discWorldPosition)
  15741. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15742. this.discScale = g * m,
  15743. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15744. }
  15745. }
  15746. }(),
  15747. n.prototype.getDiscRadius = function(e, t) {
  15748. var i = new r.Vector3;
  15749. return function(e, t) {
  15750. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15751. Math.abs(e.x - i.x) * $("#player").width()
  15752. }
  15753. }(),
  15754. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15755. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15756. }
  15757. ,
  15758. n.prototype.offScreen = function(e, t) {
  15759. var i = e.getWorldPosition().project(t);
  15760. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15761. }
  15762. ,
  15763. n.viewportScale = function() {
  15764. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15765. n.viewportHeight = $("#player").height(),
  15766. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15767. n.currentViewportScale
  15768. }
  15769. ,
  15770. t.exports = n
  15771. }
  15772. ).call(this, "/js/tag/tag.js")
  15773. }
  15774. , {
  15775. "../enum/Colors": 19,
  15776. "../enum/RenderLayers": 41,
  15777. "../enum/RenderOrder": 42,
  15778. "../enum/Viewmode": 51,
  15779. "../objects/Panorama": 148,
  15780. "../settings": 166,
  15781. "../shaders": 167,
  15782. "../util/common": 185,
  15783. "../util/easing": 186,
  15784. "../util/lerp": 188,
  15785. "../util/logger": 189,
  15786. "../util/math": 190,
  15787. "../util/texture": 194,
  15788. "../util/transitions": 195,
  15789. "./Billboard/Billboard": 119,
  15790. "./Billboard/BillboardEvent": 120,
  15791. events: 202,
  15792. three: 217
  15793. }],
  15794. 124: [function(e, t, i) {
  15795. (function(i) {
  15796. "use strict";
  15797. function n() {
  15798. this.tagState = y.IDLE,
  15799. this.intersectTag = null,
  15800. this.hoveredTag = null,
  15801. this.activeTag = null,
  15802. this.tagDiscs = [],
  15803. this.raycaster = new r.Raycaster,
  15804. this.modelManager = null,
  15805. this.player = null,
  15806. this.totaltags = 0,
  15807. this.navigatingViaTag = !1,
  15808. this.enabled = !1
  15809. }
  15810. var r = e("three")
  15811. , o = e("../util/logger")
  15812. , a = e("../util/common")
  15813. , s = e("../controls/serializer")
  15814. , l = e("../objects/Snapshot")
  15815. , c = e("../settings")
  15816. , h = e("./Billboard/BillboardEvent")
  15817. , u = e("./Media/MediaEvent")
  15818. , d = e("./Media/LinkType")
  15819. , p = e("../enum/Viewmode")
  15820. , f = e("../enum/WarpStyle")
  15821. , g = e("../enum/BlackoutStyle")
  15822. , m = e("../enum/ModelManagerEvents")
  15823. , v = e("../enum/tagEvents")
  15824. , A = e("../enum/PlayerEvents")
  15825. , y = (e("../util/lerp"),
  15826. e("../enum/TagStates"))
  15827. , C = e("events").EventEmitter
  15828. , I = new o(i);
  15829. a.extend(n, C),
  15830. n.prototype.init = function(e, t) {
  15831. this.modelManager = e,
  15832. this.player = t,
  15833. this.updateModel(),
  15834. this.bindEvents()
  15835. }
  15836. ,
  15837. n.prototype.update = function(e) {
  15838. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15839. }
  15840. ,
  15841. n.prototype.updateTags = function(e, t, i, n) {
  15842. for (var r in this.model.tags)
  15843. this.model.tags[r].update(e, t, i, n)
  15844. }
  15845. ,
  15846. n.prototype.updateModel = function() {
  15847. this.model = this.modelManager.getActiveModel(),
  15848. this.gettagsFromModel(),
  15849. this.totaltags = Object.keys(this.model.tags).length
  15850. }
  15851. ,
  15852. n.prototype.gettagsFromModel = function() {
  15853. this.tagDiscs = [];
  15854. for (var e in this.model.tags) {
  15855. var t = this.model.tags[e].disc;
  15856. t && this.tagDiscs.push(t)
  15857. }
  15858. }
  15859. ,
  15860. n.prototype.bindEvents = function() {
  15861. function e() {
  15862. Object.keys(this.model.tags).forEach(function(e) {
  15863. var t = this.model.tags[e];
  15864. t.bindEvents(),
  15865. t.billboard.on(u.LINK_CLICK, function(e) {
  15866. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15867. }
  15868. .bind(this)),
  15869. t.billboard.on(u.IMAGE_OPENED, function() {
  15870. this.tagState = y.EXAMINE,
  15871. this.emit(u.IMAGE_OPENED)
  15872. }
  15873. .bind(this)),
  15874. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15875. }
  15876. .bind(this))
  15877. }
  15878. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15879. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15880. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15881. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15882. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15883. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15884. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15885. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15886. e.call(this)
  15887. }
  15888. ,
  15889. n.prototype.navigateViaLink = function(e) {
  15890. var t = s.deserialize(e);
  15891. if (t)
  15892. if (t.mode === p.PANORAMA) {
  15893. try {
  15894. this.player.model.panos.get(t.panoId)
  15895. } catch (e) {
  15896. return void I.warn("Unable to find panorama location", t.panoId)
  15897. }
  15898. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15899. } else {
  15900. var i = {
  15901. cameraMode: t.mode,
  15902. position: t.position,
  15903. quaternion: t.quaternion,
  15904. scanId: t.panoId,
  15905. orthoZoom: t.zoom,
  15906. floorVisibility: t.floorVisibility,
  15907. thumbUrl: null,
  15908. name: null
  15909. };
  15910. this.player.flyToNewMode({
  15911. mode: t.mode,
  15912. duration: c.warp.outsideTime,
  15913. warpDest: new l(i),
  15914. force: !0
  15915. })
  15916. }
  15917. }
  15918. ,
  15919. n.prototype.handleWarpStart = function(e, t, i, n) {
  15920. this.dismissExaminedTag(),
  15921. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15922. e && (i = g.END),
  15923. this.hideShowTagsForBlackoutStyle(i, n))
  15924. }
  15925. ,
  15926. n.prototype.handleWarpInterruption = function(e, t, i) {
  15927. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15928. this.hideShowTagsForBlackoutStyle(t, i)
  15929. }
  15930. ,
  15931. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15932. var i = 0
  15933. , n = 0
  15934. , r = t / 2;
  15935. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15936. e) {
  15937. case g.END:
  15938. this.hideAlltags(r);
  15939. break;
  15940. case g.BEGINNING:
  15941. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15942. break;
  15943. case g.NONE:
  15944. break;
  15945. case g.MIDDLE:
  15946. i = r,
  15947. n = r,
  15948. this.hideAlltags(n),
  15949. setTimeout(function() {
  15950. this.showAlltags(i)
  15951. }
  15952. .bind(this), n);
  15953. break;
  15954. case g.FADEIN:
  15955. setTimeout(function() {
  15956. this.showAlltags(r)
  15957. }
  15958. .bind(this), r)
  15959. }
  15960. }
  15961. ,
  15962. n.prototype.onPlayerModeChanging = function(e, t) {
  15963. t !== p.PANORAMA && this.dismissExaminedTag(),
  15964. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15965. var i = t !== p.OUTDOOR;
  15966. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15967. }
  15968. ,
  15969. n.prototype.onPanoChange = function(e, t) {
  15970. var i = this.navigatingViaTag;
  15971. if (this.navigatingViaTag = !1,
  15972. !i) {
  15973. this.dismissExaminedTag();
  15974. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15975. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15976. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15977. }
  15978. }
  15979. ,
  15980. n.prototype.onPlayerReady = function(e, t, i) {
  15981. this.startAlltags(e, t ? i : null)
  15982. }
  15983. ,
  15984. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15985. this.updateClosestTags(e)
  15986. }
  15987. ,
  15988. n.prototype.dismissExaminedTag = function() {
  15989. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15990. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15991. this.hoveredTag = null)
  15992. }
  15993. ,
  15994. n.prototype.startAlltags = function(e, t) {
  15995. this.model.shouldShowtags = c.tags.enabled,
  15996. this.enabled = !0,
  15997. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  15998. t && setTimeout(function() {
  15999. this.activateTag(this.model.getTagBySid(t))
  16000. }
  16001. .bind(this), c.tags.startup.fadeInDuration / 2))
  16002. }
  16003. ,
  16004. n.prototype.showAlltags = function(e, t, i) {
  16005. function n() {
  16006. o++,
  16007. o === this.totaltags && (this.model.tagsShown = !0,
  16008. r.resolve())
  16009. }
  16010. var r = $.Deferred();
  16011. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16012. return r.resolve().promise();
  16013. var o = 0;
  16014. for (var a in this.model.tags) {
  16015. var s = this.model.tags[a];
  16016. s.show(e, t).done(n.bind(this))
  16017. }
  16018. return r.promise()
  16019. }
  16020. ,
  16021. n.prototype.hideAlltags = function(e, t) {
  16022. function i() {
  16023. r++,
  16024. r === this.totaltags && (this.model.tagsShown = !1,
  16025. n.resolve())
  16026. }
  16027. var n = $.Deferred()
  16028. , r = 0;
  16029. for (var o in this.model.tags) {
  16030. var a = this.model.tags[o];
  16031. a.hide(e, t).done(i.bind(this)),
  16032. a === this.activeTag && this.dismissActiveTag()
  16033. }
  16034. return n.promise()
  16035. }
  16036. ,
  16037. n.prototype.enableHovering = function() {
  16038. this.enabled = !0
  16039. }
  16040. ,
  16041. n.prototype.disableHovering = function() {
  16042. this.enabled = !1
  16043. }
  16044. ,
  16045. n.prototype.activateTag = function(e, t) {
  16046. t = t || y.EXAMINE,
  16047. this.activeTag = e,
  16048. this.activeTag.hoveringDisc = !0,
  16049. this.activeTag.setHoverState(t === y.EXAMINE),
  16050. this.tagState = t,
  16051. this.emit(v.TagActivated, e)
  16052. }
  16053. ,
  16054. n.prototype.dismissActiveTag = function() {
  16055. this.activeTag.hoveringDisc = !1,
  16056. this.activeTag.setFreeState(!0);
  16057. var e = this.activeTag;
  16058. this.activeTag = null,
  16059. this.tagState = y.IDLE,
  16060. this.emit(v.TagDismissed, e)
  16061. }
  16062. ,
  16063. n.prototype.clickedOnTag = function(e) {
  16064. var t = function() {
  16065. this.navigatingViaTag = !0,
  16066. this.activeTag.examine(this.player),
  16067. this.emit(v.TagNavigation, this.activeTag)
  16068. }
  16069. .bind(this);
  16070. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16071. this.activeTag = this.intersectTag,
  16072. t(),
  16073. !0) : (this.dismissActiveTag(),
  16074. !1)
  16075. }
  16076. ,
  16077. n.prototype.intersecttag = function() {
  16078. var e = new r.Vector3
  16079. , t = new r.Vector3
  16080. , i = new r.Vector3;
  16081. return function(n, r, o) {
  16082. if (!this.enabled)
  16083. return null;
  16084. var a = null
  16085. , s = this.tagDiscs.filter(function(e) {
  16086. return e.parent.visible
  16087. });
  16088. if (s.length > 0) {
  16089. var l = this.model.floors.reduce(function(e, t) {
  16090. return t.hidden ? e : e.concat(t.collider.children)
  16091. }, s);
  16092. e.set(n.x, n.y, -1).unproject(o),
  16093. t.set(n.x, n.y, 1).unproject(o),
  16094. i.copy(t).sub(e).normalize(),
  16095. this.raycaster.set(e, i);
  16096. var c = this.raycaster.intersectObjects(l);
  16097. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16098. }
  16099. return this.intersectTag = a,
  16100. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16101. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16102. this.hoveredTag = a
  16103. }
  16104. .bind(this)),
  16105. a.billboard.on(h.LEAVE, function() {
  16106. this.hoveredTag = null
  16107. }
  16108. .bind(this))),
  16109. this.activateTag(a, y.BROWSE))),
  16110. a
  16111. }
  16112. }(),
  16113. n.prototype.rankedtagInDirection = function() {
  16114. var e = []
  16115. , t = []
  16116. , i = new r.Vector3
  16117. , n = new r.Vector3
  16118. , o = new r.Vector3;
  16119. return function(r, a, s, l) {
  16120. var c = 0;
  16121. t.length = 0;
  16122. for (var h = 0; h < this.closesttags.length; h++) {
  16123. var u = this.closesttags[h];
  16124. n.copy(u.position),
  16125. n.add(u.discPosition),
  16126. i.copy(a),
  16127. i.sub(n).negate(),
  16128. i.normalize();
  16129. var d = i.dot(l);
  16130. if (d >= 0) {
  16131. o.copy(n),
  16132. o.project(s);
  16133. var p = this.intersecttag(o, !1, s);
  16134. if (p) {
  16135. if (c >= e.length)
  16136. for (var f = 0; f < 64; f++)
  16137. e.push({
  16138. tag: u,
  16139. dot: d
  16140. });
  16141. var g = e[c];
  16142. g.tag = u,
  16143. g.dot = d,
  16144. g.position = math.projectPositionToCanvas(n, s),
  16145. t.push(g),
  16146. c++
  16147. }
  16148. }
  16149. }
  16150. return t.sort(function(e, t) {
  16151. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16152. }),
  16153. r < t.length ? t[r].tag : null
  16154. }
  16155. }(),
  16156. n.prototype.updateClosestTags = function() {
  16157. var e = new r.Vector3
  16158. , t = 30;
  16159. return function(i) {
  16160. this.closesttags || (this.closesttags = []),
  16161. this.closesttags.length = 0;
  16162. var n = this.model.tags;
  16163. if (n)
  16164. for (var r in n)
  16165. if (n.hasOwnProperty(r)) {
  16166. var o = n[r]
  16167. , a = o.position;
  16168. e.copy(i),
  16169. e.sub(a).negate();
  16170. var s = e.lengthSq();
  16171. s < t && this.closesttags.push(o)
  16172. }
  16173. }
  16174. }(),
  16175. t.exports = n
  16176. }
  16177. ).call(this, "/js/tag/tagManager.js")
  16178. }
  16179. , {
  16180. "../controls/serializer": 14,
  16181. "../enum/BlackoutStyle": 18,
  16182. "../enum/tagEvents": 32,
  16183. "../enum/ModelManagerEvents": 33,
  16184. "../enum/PlayerEvents": 40,
  16185. "../enum/TagStates": 44,
  16186. "../enum/Viewmode": 51,
  16187. "../enum/WarpStyle": 52,
  16188. "../objects/Snapshot": 153,
  16189. "../settings": 166,
  16190. "../util/common": 185,
  16191. "../util/lerp": 188,
  16192. "../util/logger": 189,
  16193. "./Billboard/BillboardEvent": 120,
  16194. "./Media/LinkType": 130,
  16195. "./Media/MediaEvent": 131,
  16196. events: 202,
  16197. three: 217
  16198. }],
  16199. 125: [function(e, t, i) {
  16200. (function(i) {
  16201. "use strict";
  16202. function n() {
  16203. this.embedWrapper = null,
  16204. this.embedElement = null
  16205. }
  16206. var r = e("../../util/ajax")
  16207. , o = e("./mediaSettings")
  16208. , a = e("../../settings")
  16209. , s = e("../../util/logger")
  16210. , l = new s(i);
  16211. n.prototype.createDomElement = function() {
  16212. return this.embedWrapper = document.createElement("div"),
  16213. this.embedWrapper.classList.add("tag-embed"),
  16214. this.embedWrapper.classList.add("hidden"),
  16215. this.embedWrapper
  16216. }
  16217. ,
  16218. n.prototype.load = function(e) {
  16219. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16220. return new Promise(function(e, i) {
  16221. r.get(t).then(function(t) {
  16222. if (t = JSON.parse(t),
  16223. t.html && t.html.indexOf("<script") === -1) {
  16224. this.embedWrapper.innerHTML = t.html;
  16225. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16226. if (this.embedWrapper.style.width = n + "px",
  16227. t.height) {
  16228. var r = t.height / t.width;
  16229. this.embedWrapper.style.height = n * r + "px"
  16230. }
  16231. this.embedElement = this.embedWrapper.firstChild;
  16232. var a = [];
  16233. try {
  16234. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16235. } catch (e) {
  16236. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16237. }
  16238. a.forEach(function(e) {
  16239. e.setAttribute("target", "_blank")
  16240. }),
  16241. this.embedElement.classList.add("hidden"),
  16242. this.embedWrapper.classList.remove("hidden"),
  16243. e()
  16244. } else
  16245. i("Not a valid embed")
  16246. }
  16247. .bind(this), function(e) {
  16248. i(e.response)
  16249. })
  16250. }
  16251. .bind(this))
  16252. }
  16253. ,
  16254. n.prototype.show = function() {
  16255. this.embedElement && this.embedElement.classList.remove("hidden")
  16256. }
  16257. ,
  16258. n.prototype.hide = function() {
  16259. this.embedElement && this.embedElement.classList.add("hidden")
  16260. }
  16261. ,
  16262. t.exports = n
  16263. }
  16264. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16265. }
  16266. , {
  16267. "../../settings": 166,
  16268. "../../util/ajax": 181,
  16269. "../../util/logger": 189,
  16270. "./mediaSettings": 132
  16271. }],
  16272. 126: [function(e, t, i) {
  16273. (function(i) {
  16274. "use strict";
  16275. function n(e) {
  16276. o.call(this),
  16277. this.options = e,
  16278. this.playerControls = null,
  16279. this.state = s.NOT_READY
  16280. }
  16281. var r = e("../../util/browser")
  16282. , o = e("./EmbedlyEmbed")
  16283. , a = e("../../util/logger")
  16284. , s = (new a(i),
  16285. Object.freeze({
  16286. NOT_READY: "player.not.ready",
  16287. CUED: "player.cued",
  16288. PLAYING: "player.playing",
  16289. PAUSED: "player.paused"
  16290. }));
  16291. n.prototype = Object.create(o.prototype),
  16292. n.prototype.createDomElement = function() {
  16293. return this.embedWrapper = document.createElement("div"),
  16294. this.embedWrapper.classList.add("tag-video"),
  16295. this.embedWrapper.classList.add("hidden"),
  16296. this.embedWrapper
  16297. }
  16298. ,
  16299. n.prototype.load = function(e) {
  16300. var t = function() {
  16301. function e(e) {
  16302. this.playerState = s.CUED,
  16303. this.options.startMuted && this.playerControls.mute()
  16304. }
  16305. function t(e) {
  16306. this.playerState = e
  16307. }
  16308. function i(e) {
  16309. this.playerControls.setCurrentTime(0),
  16310. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16311. }
  16312. this.playerControls = new playerjs.Player(this.embedElement),
  16313. this.playerControls.on("ready", e.bind(this)),
  16314. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16315. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16316. this.playerControls.on("ended", i.bind(this))
  16317. }
  16318. .bind(this);
  16319. return o.prototype.load.call(this, e).then(t.bind(this))
  16320. }
  16321. ,
  16322. n.prototype.play = function() {
  16323. var e = r.isMobile();
  16324. return function() {
  16325. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16326. }
  16327. }(),
  16328. n.prototype.pause = function() {
  16329. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16330. }
  16331. ,
  16332. t.exports = n
  16333. }
  16334. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16335. }
  16336. , {
  16337. "../../util/browser": 182,
  16338. "../../util/logger": 189,
  16339. "./EmbedlyEmbed": 125
  16340. }],
  16341. 127: [function(e, t, i) {
  16342. (function(i) {
  16343. "use strict";
  16344. function n(e) {
  16345. function t() {
  16346. return a.debug("requesting file from embedly:", e.href),
  16347. r.get(e.href, {
  16348. responseType: e.responseType
  16349. }).then(function(t) {
  16350. return a.debug("requesting file finished:", e.href),
  16351. t
  16352. })
  16353. }
  16354. function i() {}
  16355. return s = new Promise(function(e, n) {
  16356. s.catch(i).then(function() {
  16357. t().then(e, n)
  16358. })
  16359. }
  16360. )
  16361. }
  16362. var r = e("../../util/ajax")
  16363. , o = (e("./mediaSettings"),
  16364. e("../../util/logger"))
  16365. , a = new o(i)
  16366. , s = Promise.resolve();
  16367. t.exports.enqueue = n
  16368. }
  16369. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16370. }
  16371. , {
  16372. "../../util/ajax": 181,
  16373. "../../util/logger": 189,
  16374. "./mediaSettings": 132
  16375. }],
  16376. 128: [function(e, t, i) {
  16377. (function(i) {
  16378. "use strict";
  16379. function n() {
  16380. this.imageWrapper = null,
  16381. this.width = 0,
  16382. this.height = 0,
  16383. this.aspect = 1
  16384. }
  16385. var r = e("./MediaEvent")
  16386. , o = e("./EmbedlyQueue")
  16387. , a = e("events").EventEmitter
  16388. , s = e("../../util/logger")
  16389. , l = e("../../settings");
  16390. new s(i);
  16391. n.prototype = Object.create(a.prototype),
  16392. n.prototype.createDomElement = function() {
  16393. return this.imageWrapper = document.createElement("div"),
  16394. this.imageWrapper.classList.add("tag-image"),
  16395. this.imageWrapper.classList.add("hidden"),
  16396. this.imageWrapper.addEventListener("click", function(e) {
  16397. e.stopPropagation(),
  16398. this.emit(r.IMAGE_OPENING),
  16399. this.imageWrapper.style.pointerEvents = "none"
  16400. }
  16401. .bind(this)),
  16402. this.imageWrapper
  16403. }
  16404. ,
  16405. n.prototype.onClosed = function() {
  16406. this.imageWrapper.style.pointerEvents = "auto"
  16407. }
  16408. ,
  16409. n.prototype.load = function(e) {
  16410. var t = Math.max(window.screen.height, window.screen.width)
  16411. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16412. return new Promise(function(e, t) {
  16413. function n(t) {
  16414. var i = t.target;
  16415. this.width = i.naturalWidth,
  16416. this.height = i.naturalHeight,
  16417. this.aspect = this.width / this.height;
  16418. var n = t.target.src;
  16419. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16420. this.imageWrapper.style.width = this.width + "px",
  16421. this.imageWrapper.style.height = this.height + "px",
  16422. this.imageWrapper.classList.remove("hidden"),
  16423. e()
  16424. }
  16425. o.enqueue({
  16426. href: i,
  16427. responseType: "arraybuffer"
  16428. }).then(function(e) {
  16429. var t = new Uint8Array(e)
  16430. , i = new Blob([t])
  16431. , r = new window.Image;
  16432. r.addEventListener("load", n.bind(this));
  16433. var o = URL.createObjectURL(i);
  16434. r.src = o
  16435. }
  16436. .bind(this), t)
  16437. }
  16438. .bind(this))
  16439. }
  16440. ,
  16441. t.exports = n
  16442. }
  16443. ).call(this, "/js/tag/Media/Image.js")
  16444. }
  16445. , {
  16446. "../../settings": 166,
  16447. "../../util/logger": 189,
  16448. "./EmbedlyQueue": 127,
  16449. "./MediaEvent": 131,
  16450. events: 202
  16451. }],
  16452. 129: [function(e, t, i) {
  16453. "use strict";
  16454. function n(e) {
  16455. this.label = e.label,
  16456. this.href = e.url,
  16457. this.type = this.updateLinkForType(),
  16458. this.domElement = null,
  16459. this.id = c++
  16460. }
  16461. var r = e("./LinkType")
  16462. , o = e("./MediaEvent")
  16463. , a = e("../../util/browser")
  16464. , s = e("../../analytics")
  16465. , l = e("events").EventEmitter
  16466. , c = 0;
  16467. n.prototype = Object.create(l.prototype),
  16468. n.prototype.updateLinkForType = function() {
  16469. function e(e) {
  16470. var t = new RegExp("[#&?]start=([^#&?]*)")
  16471. , i = t.exec(e);
  16472. return i[1]
  16473. }
  16474. function t(e) {
  16475. return e + "&play=1"
  16476. }
  16477. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16478. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  16479. r.NAVIGATION) : (this.href = t(this.href),
  16480. r.MODEL) : r.EXT_LINK
  16481. }
  16482. ;
  16483. var h = {};
  16484. n.prototype.createDomElement = function() {
  16485. function e(e) {
  16486. switch (e.stopPropagation(),
  16487. h[this.id] = !0,
  16488. s.trackAlways("click_tag_link", {
  16489. link_type: this.type,
  16490. link_count: c,
  16491. links_clicked: Object.keys(h).length
  16492. }),
  16493. this.type) {
  16494. case r.MODEL:
  16495. window.location.replace(this.href);
  16496. break;
  16497. case r.EXT_LINK:
  16498. window.open(this.href, "_blank")
  16499. }
  16500. this.emit(o.LINK_CLICK, {
  16501. type: this.type,
  16502. url: this.href
  16503. })
  16504. }
  16505. if (this.domElement = document.createElement("a"),
  16506. this.domElement.classList.add("tag-link"),
  16507. this.domElement.textContent = this.label,
  16508. this.type === r.EXT_LINK) {
  16509. this.domElement.textContent += " ";
  16510. var t = document.createElement("i");
  16511. t.classList.add("icon-ext-link"),
  16512. t.title = "Link to external web site",
  16513. this.domElement.appendChild(t)
  16514. }
  16515. return this.domElement.addEventListener("click", e.bind(this)),
  16516. this.domElement
  16517. }
  16518. ,
  16519. t.exports = n
  16520. }
  16521. , {
  16522. "../../analytics": 4,
  16523. "../../util/browser": 182,
  16524. "./LinkType": 130,
  16525. "./MediaEvent": 131,
  16526. events: 202
  16527. }],
  16528. 130: [function(e, t, i) {
  16529. "use strict";
  16530. t.exports = {
  16531. NAVIGATION: "navigation",
  16532. MODEL: "model",
  16533. EXT_LINK: "ext-link"
  16534. }
  16535. }
  16536. , {}],
  16537. 131: [function(e, t, i) {
  16538. "use strict";
  16539. t.exports = Object.freeze({
  16540. LINK_CLICK: "mtmedia.link",
  16541. IMAGE_LOADED: "mtmedia.image.loaded",
  16542. IMAGE_OPENING: "mtmedia.image.opening",
  16543. IMAGE_OPENED: "mtmedia.image.opened",
  16544. IMAGE_CLOSING: "mtmedia.image.closing",
  16545. IMAGE_CLOSED: "mtmedia.image.closed",
  16546. VIDEO_START: "mtmedia.video.start",
  16547. VIDEO_PAUSE: "mtmedia.video.pause",
  16548. VIDEO_ENDED: "mtmedia.video.end"
  16549. })
  16550. }
  16551. , {}],
  16552. 132: [function(e, t, i) {
  16553. "use strict";
  16554. t.exports = Object.freeze({
  16555. maxEmbedWidth: 350,
  16556. defaultAspectRatio: .75
  16557. })
  16558. }
  16559. , {}],
  16560. 133: [function(e, t, i) {
  16561. "use strict";
  16562. t.exports = Object.freeze({
  16563. TEXT: "text",
  16564. LINK: "link",
  16565. IMAGE: "photo",
  16566. VIDEO: "video",
  16567. RICH: "rich"
  16568. })
  16569. }
  16570. , {}],
  16571. 134: [function(e, t, i) {
  16572. "use strict";
  16573. function n(e) {
  16574. this.capabilities = {
  16575. links: {
  16576. enable: e.supportLinks,
  16577. keepLabels: e.keepLinkLabels
  16578. }
  16579. }
  16580. }
  16581. var r = e("./DescriptionChunkType");
  16582. n.prototype.parse = function(e, t) {
  16583. var i = []
  16584. , n = e.split("[").map(function(e, t) {
  16585. return 0 === t ? e : "[" + e
  16586. });
  16587. return n.forEach(function(e) {
  16588. var n = this.findMarkdown(e);
  16589. if (n) {
  16590. if (n.url.indexOf("javascript:") !== -1)
  16591. return;
  16592. this.addLinkChunk(i, n, t),
  16593. this.addTextChunk(i, e.slice(n.markdown.length))
  16594. } else
  16595. this.addTextChunk(i, e)
  16596. }
  16597. .bind(this)),
  16598. i
  16599. }
  16600. ,
  16601. n.prototype.findMarkdown = function(e) {
  16602. var t = /\[([^\]]*)\]\((.*)\)/
  16603. , i = e.match(t);
  16604. if (i) {
  16605. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16606. 0 !== r); )
  16607. o++;
  16608. var a = n.length - o;
  16609. return {
  16610. markdown: i[0].substring(0, i[0].length - a),
  16611. label: i[1],
  16612. url: i[2].substring(0, o)
  16613. }
  16614. }
  16615. }
  16616. ,
  16617. n.prototype.addTextChunk = function(e, t) {
  16618. 0 !== t.length && e.push({
  16619. type: r.TEXT,
  16620. text: t
  16621. })
  16622. }
  16623. ,
  16624. n.prototype.addLinkChunk = function(e, t) {
  16625. if (!this.capabilities.links.enable)
  16626. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16627. var i = {
  16628. label: t.label,
  16629. url: t.url
  16630. };
  16631. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16632. e.push({
  16633. type: r.LINK,
  16634. link: i
  16635. })
  16636. }
  16637. ,
  16638. t.exports = n
  16639. }
  16640. , {
  16641. "./DescriptionChunkType": 133
  16642. }],
  16643. 135: [function(e, t, i) {
  16644. (function(i) {
  16645. "use strict";
  16646. var n = e("../util/logger")
  16647. , r = new n(i)
  16648. , o = {
  16649. parseIdsFromChunkName: function(e, t) {
  16650. t.floorId = o.parseFloor(e),
  16651. t.roomId = o.parseRoom(e)
  16652. },
  16653. parseFloor: function(e) {
  16654. var t = e.match(/_group([0-9]+)/);
  16655. if (!t)
  16656. return 0;
  16657. try {
  16658. return parseInt(t[1], 10)
  16659. } catch (e) {
  16660. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16661. 0
  16662. }
  16663. },
  16664. parseRoom: function(e) {
  16665. var t = e.match(/_sub([0-9]+)/);
  16666. if (!t)
  16667. return -1;
  16668. try {
  16669. return parseInt(t[1], 10)
  16670. } catch (e) {
  16671. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16672. 0
  16673. }
  16674. }
  16675. };
  16676. t.exports = o
  16677. }
  16678. ).call(this, "/js/model/Chunks.js")
  16679. }
  16680. , {
  16681. "../util/logger": 189
  16682. }],
  16683. 136: [function(e, t, i) {
  16684. (function(i) {
  16685. "use strict";
  16686. function n(e) {
  16687. s.call(this),
  16688. this.model = e,
  16689. this.exploded = !1
  16690. }
  16691. var r = e("../objects/Floor")
  16692. , o = (e("../settings"),
  16693. e("../util/logger"))
  16694. , a = e("../util/transitions")
  16695. , s = e("../util/IndexedCollection")
  16696. , l = e("../util/common")
  16697. , c = e("../util/easing");
  16698. new o(i);
  16699. l.inherit(n, s),
  16700. n.prototype.add = function(e) {
  16701. s.prototype.add.call(this, e),
  16702. this.model.add(e)
  16703. }
  16704. ,
  16705. n.prototype.getIndex = function(e) {
  16706. return e.floorIndex
  16707. }
  16708. ,
  16709. n.prototype.build = function() {
  16710. this.list.forEach(function(e) {
  16711. e.build()
  16712. })
  16713. }
  16714. ,
  16715. n.prototype.size = function() {
  16716. return this.length
  16717. }
  16718. ,
  16719. n.prototype.sort = function() {
  16720. s.prototype.sort.call(this, function(e, t) {
  16721. return e.floorIndex - t.floorIndex
  16722. })
  16723. }
  16724. ,
  16725. n.prototype.nextFloor = function(e, t) {
  16726. return this.index[e.floorIndex + t] || null
  16727. }
  16728. ,
  16729. n.prototype.getFloorAtPoint = function(e) {
  16730. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16731. var r = this.list[n]
  16732. , o = r.distanceToPoint(e);
  16733. (!t || i > o) && (i = o,
  16734. t = r)
  16735. }
  16736. return t
  16737. }
  16738. ,
  16739. n.prototype.getOrMakeFloor = function(e) {
  16740. var t = this.index[e];
  16741. return t || (t = new r(this.model,e),
  16742. this.add(t)),
  16743. t
  16744. }
  16745. ,
  16746. n.prototype.hide = function() {
  16747. this.list.forEach(function(e) {
  16748. e.hide()
  16749. })
  16750. }
  16751. ,
  16752. n.prototype.show = function() {
  16753. this.list.forEach(function(e) {
  16754. e.show()
  16755. })
  16756. }
  16757. ,
  16758. n.prototype.names = function() {
  16759. return this.list.reduce(function(e, t) {
  16760. return e.concat(t.name)
  16761. }, [])
  16762. }
  16763. ,
  16764. n.prototype.toggleExplodeHorizontal = function() {
  16765. function e(e, t) {
  16766. r.copy(e.position),
  16767. e.position.x = i[e.floorIndex] * t,
  16768. e.position.y = 1 * e.floorIndex * t,
  16769. r.sub(e.position).multiplyScalar(-1),
  16770. e.panos.forEach(function(e) {
  16771. e.translate(r)
  16772. })
  16773. }
  16774. var t, i = [], n = 0;
  16775. this.list.forEach(function(e, r, o) {
  16776. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16777. n += t,
  16778. i[r] = n
  16779. }),
  16780. i = i.map(function(e) {
  16781. return e - n / 2
  16782. });
  16783. var r = this.list[0].position.clone();
  16784. this.exploded ? this.list.forEach(function(t) {
  16785. a.start(function(i) {
  16786. e(t, 1 - i)
  16787. }, 1500, null, 0, c.easeOutExpo)
  16788. }) : this.list.forEach(function(t) {
  16789. a.start(function(i) {
  16790. e(t, i)
  16791. }, 1500, null, 0, c.easeOutExpo)
  16792. }),
  16793. this.exploded = !this.exploded
  16794. }
  16795. ,
  16796. n.prototype.toggleExplodeVertical = function() {
  16797. function e(e, i) {
  16798. var n = n.copy(e.position);
  16799. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16800. n.sub(e.position).multiplyScalar(-1),
  16801. e.panos.forEach(function(e) {
  16802. e.translate(n)
  16803. })
  16804. }
  16805. var t = this.model.size;
  16806. this.list[0].position.clone();
  16807. this.exploded ? this.list.forEach(function(t) {
  16808. a.start(function(i) {
  16809. e(t, 1 - i)
  16810. }, 1500, null, 0, c.easeOutExpo)
  16811. }) : this.list.forEach(function(t) {
  16812. a.start(function(i) {
  16813. e(t, i)
  16814. }, 1500, null, 0, c.easeOutExpo)
  16815. }),
  16816. this.exploded = !this.exploded
  16817. }
  16818. ,
  16819. t.exports = n
  16820. }
  16821. ).call(this, "/js/model/FloorCollection.js")
  16822. }
  16823. , {
  16824. "../objects/Floor": 146,
  16825. "../settings": 166,
  16826. "../util/IndexedCollection": 175,
  16827. "../util/common": 185,
  16828. "../util/easing": 186,
  16829. "../util/logger": 189,
  16830. "../util/transitions": 195
  16831. }],
  16832. 137: [function(e, t, i) {
  16833. (function(i) {
  16834. "use strict";
  16835. function n() {
  16836. c.call(this)
  16837. }
  16838. var r = e("../settings")
  16839. , o = e("../util/logger")
  16840. , a = e("../enum/Viewmode")
  16841. , s = e("../objects/Snapshot")
  16842. , l = (e("../util/math"),
  16843. e("../util/common"))
  16844. , c = e("../util/IndexedCollection")
  16845. , h = new o(i);
  16846. l.inherit(n, c),
  16847. n.prototype.getImage = function(e) {
  16848. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16849. }
  16850. ,
  16851. n.prototype.filterByModesAndReel = function(e, t) {
  16852. for (var i = [], n = 0; n < t.length; n += 1) {
  16853. var r = t[n]
  16854. , o = this.index[r.sid];
  16855. o && i.push(o)
  16856. }
  16857. var s = e[a.DOLLHOUSE]
  16858. , l = e[a.FLOORPLAN];
  16859. i = i.filter(function(e) {
  16860. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16861. return !0;
  16862. var t;
  16863. try {
  16864. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16865. } catch (e) {
  16866. return h.debug(e.message),
  16867. !1
  16868. }
  16869. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16870. }),
  16871. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16872. this.list = i,
  16873. this.reIndex()
  16874. }
  16875. ,
  16876. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16877. if (0 === this.list.length)
  16878. return [];
  16879. var locations = [];
  16880. var deal = (info, container)=>{
  16881. var src = info.thumbnail_signed_src,
  16882. o = info.name || "";
  16883. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  16884. if (!r.show360Views.enabled && info.metadata.scan_id) {
  16885. let a = panos.get(info.metadata.scan_id);
  16886. if (a && !a.isAligned()) return
  16887. }
  16888. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  16889. if (cameraMode === a.MESH) return
  16890. if(window.isLocal)src = manage.dealURL(src)
  16891. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  16892. var l = {
  16893. cameraMode: cameraMode,
  16894. position: info.metadata.camera_position,
  16895. quaternion: info.metadata.camera_quaternion,
  16896. zoom: info.metadata.zoom,
  16897. panoId: info.metadata.scan_id,
  16898. orthoZoom: info.metadata.ortho_zoom,
  16899. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  16900. thumbUrl: src,
  16901. name: n.filterImageName(o),
  16902. sid: info.sid
  16903. }
  16904. var item = new s(l);
  16905. item.momentTour = info.momentTour
  16906. item.dontRot = info.dontRot
  16907. item.rotTime = info.rotTime
  16908. container.push(item)
  16909. return item
  16910. }
  16911. }
  16912. this.list.forEach(image=>{
  16913. if(image.images){
  16914. var folder = $.extend({}, image )
  16915. folder.heroLocations = [];
  16916. image.images.list.forEach(child=>{
  16917. deal(child, folder.heroLocations);
  16918. })
  16919. folder.musicInfo = folder.musicInfo || {}
  16920. locations.push(folder)
  16921. delete folder.images;
  16922. delete folder.locations;
  16923. }else{
  16924. var item = deal(image, locations);
  16925. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16926. }
  16927. })
  16928. return locations
  16929. }
  16930. ,
  16931. n.prototype.getIndex = function(e) {
  16932. return e.sid
  16933. }
  16934. ,
  16935. n.filterImageName = function(e) {
  16936. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16937. }
  16938. ,
  16939. t.exports = n
  16940. }
  16941. ).call(this, "/js/model/ImageCollection.js")
  16942. }
  16943. , {
  16944. "../enum/Viewmode": 51,
  16945. "../objects/Snapshot": 153,
  16946. "../settings": 166,
  16947. "../util/IndexedCollection": 175,
  16948. "../util/common": 185,
  16949. "../util/logger": 189,
  16950. "../util/math": 190
  16951. }],
  16952. 138: [function(e, t, i) {
  16953. (function(i) {
  16954. "use strict";
  16955. function n() {
  16956. u.call(this)
  16957. }
  16958. var r = e("../label/Label")
  16959. , o = e("../settings")
  16960. , a = e("../util/logger")
  16961. , s = e("../util/math")
  16962. , l = e("../util/ajax")
  16963. , c = e("./RoomCollection")
  16964. , h = e("../util/common")
  16965. , u = e("../util/IndexedCollection");
  16966. new a(i);
  16967. h.inherit(n, u),
  16968. n.prototype.getIndex = function(e) {
  16969. return e.labelId
  16970. }
  16971. ,
  16972. n.prototype.associateWithRooms = function(e) {
  16973. this.forEach(function(t) {
  16974. e.forEach(function(e) {
  16975. e.roomId === t.roomId && (t.room = e)
  16976. })
  16977. })
  16978. }
  16979. ,
  16980. n.prototype.createFromLabelData = function(e) {
  16981. e.forEach(function(e) {
  16982. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16983. t = c.generateRoomId(e.floorId, t);
  16984. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16985. i.position = s.convertWorkshopVector(i.position),
  16986. this.add(i),
  16987. i.build()
  16988. }
  16989. .bind(this))
  16990. }
  16991. ,
  16992. n.prototype.load = function(e, t) {
  16993. return l.get(e, {
  16994. responseType: "json",
  16995. auth: t ? o.authorizationHeader : null
  16996. }).done(function(e) {
  16997. var t = [];
  16998. for (var i in e) {
  16999. var n = e[i];
  17000. t.push(n)
  17001. }
  17002. this.createFromLabelData(t)
  17003. }
  17004. .bind(this))
  17005. }
  17006. ,
  17007. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17008. var t = -1;
  17009. if (e) {
  17010. if(typeof e == 'number'){//add
  17011. t = parseInt(e)
  17012. }else{
  17013. var i = e.split("_");
  17014. t = parseInt(i[0])
  17015. }
  17016. }
  17017. return t
  17018. },
  17019. t.exports = n
  17020. }
  17021. ).call(this, "/js/model/LabelCollection.js")
  17022. }
  17023. , {
  17024. "../label/Label": 90,
  17025. "../settings": 166,
  17026. "../util/IndexedCollection": 175,
  17027. "../util/ajax": 181,
  17028. "../util/common": 185,
  17029. "../util/logger": 189,
  17030. "../util/math": 190,
  17031. "./RoomCollection": 141
  17032. }],
  17033. 139: [function(e, t, i) {
  17034. (function(i) {
  17035. "use strict";
  17036. function n(e, t) {
  17037. o.Object3D.call(this)
  17038. this.sid = window.number;//t.sid,
  17039. this.data = t,
  17040. this.options = e,
  17041. this.urls = new s(e.urlFiles),
  17042. this.isPublic = void 0 !== t.is_public && t.is_public,
  17043. //创建heroLocations
  17044. this.images = new _(this),
  17045. this.images.extend(t.images),
  17046. this.images.forEach((info)=>{
  17047. if(info.locations){
  17048. info.images = new _(this);
  17049. info.images.extend(info.locations)
  17050. }
  17051. })
  17052. this.heroLocations = []
  17053. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17054. this.outdoorPanoLocations = [],
  17055. this.floors = new d(this),
  17056. this.floorsEnabled = void 0 === e.floors || e.floors,
  17057. this.changingFloor = !1,
  17058. this.chunks = [],
  17059. this.panos = new A,
  17060. this.colliders = [],
  17061. this.loadPanosPromise = null,
  17062. this.loadMeshTexturesPromise = null,
  17063. this.auxDataPromise = null,
  17064. this.meshTexturesLoaded = !1,
  17065. this.meshTextures = [],
  17066. this.tags = {},
  17067. this.tagsShown = !1,
  17068. this.shouldShowtags = !1,
  17069. this.has360Views = !1,
  17070. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17071. this.supportedModes = {},
  17072. this.supportedModes[c.PANORAMA] = !0,
  17073. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17074. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17075. this.supportedModes[c.TRANSITIONING] = !0,
  17076. this.supportsTiles = this.configureTiling(),
  17077. // this.supportsVR = t.is_vr,
  17078. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17079. this.mode = c.DOLLHOUSE,
  17080. this.size = null,
  17081. this.center = null,
  17082. this.boundingBox = new o.Box3,
  17083. this.currentFloor = null,
  17084. this.allFloorsVisible = !0,
  17085. this.projectedPano0 = null,
  17086. this.projectedPano1 = null,
  17087. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17088. this.addFloor(new u(this,t,e.trim()))
  17089. }
  17090. .bind(this)),
  17091. this.waitQueue = [],
  17092. this.on("load", function(e) {
  17093. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17094. return !e.isLoadedCallback()
  17095. }),
  17096. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17097. }
  17098. .bind(this)),
  17099. this.setupCustomProperties()
  17100. this.hots = {};
  17101. }
  17102. function r() {
  17103. try {
  17104. var e = document.createElement("canvas")
  17105. , t = e.getContext("webgl");
  17106. t || (t = e.getContext("experimental-webgl"));
  17107. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17108. return i
  17109. } catch (e) {
  17110. return 0
  17111. }
  17112. }
  17113. var o = e("three")
  17114. , a = e("../util/ajax")
  17115. , s = e("../util/ModelUrls")
  17116. , l = e("../objects/BoundingTextureSkybox")
  17117. , c = e("../enum/Viewmode")
  17118. , h = e("../enum/RenderOrder")
  17119. , u = (e("../enum/AlignmentType"),
  17120. e("../objects/Floor"))
  17121. , d = e("./FloorCollection")
  17122. , p = e("../objects/Chunk")
  17123. , f = (e("../objects/Room"),
  17124. e("../objects/Snapshot"),
  17125. e("../label/Label"),
  17126. e("../util/math"),
  17127. e("../settings"))
  17128. ,ss = e("../shaders")
  17129. , g = e("../util/logger")
  17130. , m = e("../tag/tag")
  17131. , v = (e("../tag/tagManager"),
  17132. e("../objects/Panorama"))
  17133. , A = e("../util/PanoramaCollection")
  17134. , y = e("../loaders/ModelLoader")
  17135. , C = e("../loaders/ModelTextureLoader")
  17136. , I = e("../loaders/SweepDataLoader")
  17137. , E = e("../util/transitions")
  17138. , b = e("../util/common")
  17139. , es = e("../util/easing")
  17140. ,lerp = e("../util/lerp")
  17141. ,tex = e("../util/texture")
  17142. , w = e("./../util/browser")
  17143. , _ = e("./ImageCollection")
  17144. , T = e("./RoomCollection")
  17145. , x = e("./LabelCollection")
  17146. , S = e("./Chunks")
  17147. , M = e("./../util/showcase")
  17148. , R = e("../exception/BasicException")
  17149. , P = (e("../constants")
  17150. ,e("events").EventEmitter)
  17151. //,Hot = e("hot")
  17152. , O = new g(i);
  17153. n.prototype = Object.create(o.Object3D.prototype),
  17154. b.extend(n, P),
  17155. n.prototype.setupCustomProperties = function() {
  17156. var e = f.modelAlpha;
  17157. Object.defineProperty(this, "alpha", {
  17158. get: function() {
  17159. return e
  17160. },
  17161. set: function(t) {
  17162. e = t,
  17163. this.chunks.forEach(function(t) {
  17164. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17165. })
  17166. }
  17167. })
  17168. }
  17169. ,
  17170. n.prototype.configureTiling = function() {
  17171. var e = r();
  17172. if (e < 2048)
  17173. return !1;
  17174. O.warn("Max cube texture size: " + e);
  17175. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17176. var i = f.tiling.tilingFlagNames[t];
  17177. if ("1" === w.valueFromHash(i, null))
  17178. return !0;
  17179. if ("0" === w.valueFromHash(i, null))
  17180. return !1
  17181. }
  17182. //--------------------------------------------许钟文-------------------------------------------
  17183. //return true;
  17184. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17185. //--------------------------------------------e n d -------------------------------------------
  17186. }
  17187. ,
  17188. n.prototype.toggleAlpha = function() {
  17189. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17190. }
  17191. ,
  17192. n.prototype.load = function(e) {
  17193. var t = function() {
  17194. return $.when(this.loadPanos(), this.loadMesh())
  17195. }
  17196. , i = this.urls.init().then(t.bind(this));
  17197. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17198. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17199. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17200. }
  17201. ,
  17202. n.prototype.loadMesh = function() {
  17203. function e(e) {
  17204. O.error(e),
  17205. n.reject("loading-failed")
  17206. }
  17207. function t(e, t) {
  17208. n.notify(e, t)
  17209. }
  17210. function i(e, t) {
  17211. if (0 === e.length) {
  17212. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17213. r.supportedModes[c.DOLLHOUSE] = !1,
  17214. r.supportedModes[c.FLOORPLAN] = !1;
  17215. var i = new p({
  17216. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17217. });
  17218. i.material.visible = !1,
  17219. i.rotateX(-Math.PI / 2),
  17220. i.geometry.computeBoundingBox(),
  17221. e = [i]
  17222. }
  17223. e.forEach(function(e) {
  17224. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17225. r.addChunk(t, e)
  17226. }),
  17227. r.floors.sort(),
  17228. n.resolve(r)
  17229. }
  17230. var n = $.Deferred()
  17231. , r = this;
  17232. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17233. n.promise()
  17234. }
  17235. ,
  17236. n.prototype.loadMeshTextures = function() {
  17237. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17238. this.meshTexturesLoaded = !0
  17239. }
  17240. .bind(this)),
  17241. this.loadTexturesPromise)
  17242. }
  17243. ,
  17244. /* n.prototype.loadtags = function() {//xzw改
  17245. var e = $.Deferred();
  17246. if (!f.tags.enabled)
  17247. return e.resolve();
  17248. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17249. t = "data/" + this.sid + "/tags.json"
  17250. return a.get(t, {
  17251. responseType: "json",
  17252. auth: this.isPublic ? null : f.authorizationHeader
  17253. }).done(function(t) {
  17254. var i = 0
  17255. , n = 0;
  17256. for (var r in t) {
  17257. var o = t[r];
  17258. o.enabled && (n++,
  17259. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17260. i++))
  17261. }
  17262. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17263. e.resolve()
  17264. }
  17265. .bind(this)).fail(function() {
  17266. O.warn("Getting tags failed, not displaying tags."),
  17267. e.resolve()
  17268. }),
  17269. e
  17270. } */
  17271. n.prototype.shineHots = function(){ //xzw
  17272. E.trigger({
  17273. func: function(e) {
  17274. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17275. for(var i in this.hots){
  17276. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17277. }
  17278. }.bind(this),
  17279. cycling: true,
  17280. duration: 3000,
  17281. //easing: "easeInOutQuad",
  17282. name: "hotShine"
  17283. })
  17284. },
  17285. n.prototype.createHotItem = function() {
  17286. // console.log(99999,this.hotGroup.children)
  17287. this.hotGroup.children.forEach((hot,index)=>{
  17288. // console.log(99999,index,hot.info.title)
  17289. if(hot.info.actionType.openHot){/* hot.texType == 'shine' */
  17290. let ul = document.createElement('ul');
  17291. let li = document.createElement('li');
  17292. let span = document.createElement('span');
  17293. span.innerHTML = hot.info.title || '热点';
  17294. // console.log(span.innerHTML);
  17295. li.hot = hot; // 列表每一项对应一个热点
  17296. li.appendChild(span);
  17297. ul.appendChild(li);
  17298. // docFragment.appendChild(li);
  17299. }
  17300. })
  17301. }
  17302. /* n.prototype.loadOverlays = function(overlays){
  17303. var overlays = window.data2 && window.data2.overlays
  17304. overlays && overlays.forEach((info)=>{
  17305. new Overlay(info)
  17306. })
  17307. Overlay.load()
  17308. }
  17309. */
  17310. n.prototype.loadhots = function() {//xzw
  17311. initHot(this)
  17312. var r = $.Deferred();
  17313. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17314. return a.get(t, {
  17315. responseType: "json",
  17316. auth: this.isPublic ? null : f.authorizationHeader
  17317. }).done(function(e) {
  17318. window.data2 = e;
  17319. if(!e){
  17320. console.error("data2 is null")
  17321. }else{
  17322. g_data2 = hotMatcher(e);
  17323. this.hotsCount = 0;
  17324. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17325. if(e.hots){
  17326. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17327. sids.forEach((sid)=>{
  17328. e.hots[sid].sid = sid
  17329. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17330. })
  17331. }
  17332. if(e.overlays){
  17333. e.overlays.forEach((info)=>{
  17334. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17335. new Hot(info, 'byOverlay')
  17336. })
  17337. }
  17338. this.createHotItem( );
  17339. Hot.createHotList();
  17340. Hot.startLoad()
  17341. g_index = w.valueFromHash("m");
  17342. }
  17343. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17344. /* var dataJsPromise = $.Deferred();
  17345. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17346. a.get(dataJsUrl,{
  17347. responseType: "json",
  17348. auth: this.isPublic ? null : f.authorizationHeader
  17349. }).done(function(data) {
  17350. window.hotData = data;
  17351. this.createHotItem(data, this.hots);
  17352. for(let i in this.hots){//add
  17353. data[i] && this.hots[i].initStyleImg(data[i]);
  17354. }
  17355. dataJsPromise.resolve();
  17356. }.bind(this)).fail(function(){
  17357. console.log('Data.js is empty');
  17358. dataJsPromise.resolve();
  17359. }) */
  17360. r.resolve();
  17361. }.bind(this)).fail(function() {
  17362. console.log('没有热点');
  17363. r.resolve()
  17364. }),
  17365. r
  17366. }
  17367. ,
  17368. n.prototype.loadPanos = function() {
  17369. if (this.loadPanosPromise)
  17370. return this.loadPanosPromise;
  17371. var e = new I(this);
  17372. return this.loadPanosPromise = e.load().then(function(e) {
  17373. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17374. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17375. else console.log(e.uuid)
  17376. }
  17377. .bind(this))),
  17378. this.panos.extend(e.map(function(e) {
  17379. return new v(this,e.uuid,e,this.supportsTiles)
  17380. }
  17381. .bind(this))),
  17382. this.panos.forEach(function(e) {
  17383. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17384. var i = this.panos.get(t);
  17385. i && this.panos.setNeighbour(e, i, !0)
  17386. }
  17387. .bind(this)),
  17388. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17389. }
  17390. .bind(this)),
  17391. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17392. this.supportedModes[c.PANORAMA] = !1),
  17393. $.when(this)
  17394. }
  17395. .bind(this)),
  17396. this.loadPanosPromise
  17397. }
  17398. ,
  17399. n.prototype.loadHighlightReel = function() {//xzw
  17400. var e = $.Deferred()
  17401. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17402. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17403. return a.get(t, {
  17404. responseType: "json",
  17405. auth: this.isPublic ? null : f.authorizationHeader
  17406. }).done(function(t) {
  17407. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17408. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17409. e.resolve()
  17410. }
  17411. .bind(this)).fail(function() {
  17412. O.warn("Getting highlight reel failed, no highlights available"),
  17413. e.resolve()
  17414. }),
  17415. e
  17416. }
  17417. ,
  17418. n.prototype.waitForLoad = function(e, t) {
  17419. t() || (this.waitQueue.push({
  17420. object: e,
  17421. isLoadedCallback: t
  17422. }),
  17423. 1 === this.waitQueue.length && this.emit("waiting"))
  17424. }
  17425. ,
  17426. n.prototype.hide = function() {
  17427. this.floors.hide()
  17428. }
  17429. ,
  17430. n.prototype.show = function() {
  17431. this.floors.show()
  17432. }
  17433. ,
  17434. n.prototype.floorNames = function() {
  17435. return this.floors.names()
  17436. }
  17437. ,
  17438. n.prototype.warpDestFloors = function(e, t) {
  17439. if (!e || this.floors.length !== e.length)
  17440. return void this.toggleAllFloors(!0);
  17441. var i = e.findIndex(function(e) {
  17442. return e
  17443. }
  17444. .bind(this));
  17445. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17446. }
  17447. ,
  17448. n.prototype.setFloor = function(e, t, i) {
  17449. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17450. this.allFloorsVisible = !1,
  17451. this._setFloor(e, t, i)
  17452. }
  17453. ,
  17454. n.prototype.toggleAllFloors = function(e) {
  17455. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17456. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17457. this._setFloor(this.currentFloor)
  17458. }
  17459. ,
  17460. n.prototype._setFloor = function(e, t, i) {
  17461. t = t || this.mode,
  17462. this.emit("floor.changed", e, t, this.currentFloor),
  17463. this.currentFloor = e;
  17464. var n;
  17465. if (t === c.PANORAMA) {
  17466. if (this.show(),
  17467. this.shouldShowtags && this.tagsShown)
  17468. for (n in this.tags)
  17469. this.tags[n].show(f.showFloorDuration)
  17470. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17471. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17472. }
  17473. .bind(this)),
  17474. this.shouldShowtags && this.tagsShown))
  17475. for (n in this.tags) {
  17476. var r = this.tags[n];
  17477. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17478. }
  17479. var o = this
  17480. , a = e;
  17481. E.start(function() {}, f.showFloorDelay, function() {
  17482. o.floors.forEach(function(e) {
  17483. e.chunks.forEach(function(t) {
  17484. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17485. })
  17486. })
  17487. }
  17488. .bind(this))
  17489. }
  17490. ,
  17491. n.prototype.toggleExplode = function() {
  17492. this.floors.toggleExplodeHorizontal()
  17493. }
  17494. ,
  17495. n.prototype.toggleExplodeUp = function() {
  17496. this.floors.toggleExplodeVertical()
  17497. }
  17498. ,
  17499. n.prototype.nextFloor = function(e) {
  17500. return this.floors.nextFloor(this.currentFloor, e)
  17501. }
  17502. ,
  17503. n.prototype.addFloor = function(e) {
  17504. this.floors.add(e)
  17505. }
  17506. ,
  17507. n.prototype.getFloorAtPoint = function(e) {
  17508. return this.floors.getFloorAtPoint(e)
  17509. }
  17510. ,
  17511. n.prototype.getTagBySid = function(e) {
  17512. return this.tags[e]
  17513. }
  17514. ,
  17515. n.prototype.addChunk = function(e, t) {
  17516. this.floors.getOrMakeFloor(e).addChunk(t),
  17517. this.chunks.push(t)
  17518. }
  17519. ,
  17520. n.prototype.setMode = function(e) {
  17521. if (!this.supportedModes[e])
  17522. throw new R("Mode not supported for this model: " + e);
  17523. this.mode = e;
  17524. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17525. this.chunks.forEach(function(t) {
  17526. t.setMode(e)
  17527. })
  17528. }
  17529. ,
  17530. n.prototype.build = function() {
  17531. this.heroLocations = this.images.getHeroLocations(this.panos);
  17532. var e = function() {
  17533. return !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  17534. }
  17535. .bind(this)();
  17536. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17537. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17538. }
  17539. .bind(this)) || e,
  17540. null === this.heroImage && O.warn("No hero image defined."),
  17541. this.currentFloor = this.floors.last(),
  17542. this.floors.build(),
  17543. this.colliders = this.floors.reduce(function(e, t) {
  17544. return e.concat(t.collider.children)
  17545. }, []),
  17546. this.panos.forEach(function(e) {
  17547. e.build1(),
  17548. e.on("enter", function() {
  17549. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17550. }
  17551. .bind(this))
  17552. }
  17553. .bind(this)),
  17554. this.panos.forEach(function(e) {
  17555. e.build2()
  17556. }),
  17557. this.floors.forEach(function(e) {
  17558. this.boundingBox.union(e.boundingBox)
  17559. }
  17560. .bind(this)),
  17561. this.size = this.boundingBox.size(),
  17562. this.center = this.boundingBox.center(),
  17563. this.floors.forEach(function(e) {
  17564. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17565. }
  17566. .bind(this)),
  17567. this.panos.populate_path_graph(),
  17568. this.skybox = new l(this.boundingBox),
  17569. this.skybox.matrixWorldNeedsUpdate = !0,
  17570. this.add(this.skybox);
  17571. setTimeout(function() {
  17572. //this.hotsCount && this.shineHots()
  17573. Hot.beginShineHot()
  17574. }
  17575. .bind(this), 1300)
  17576. //add-----
  17577. {
  17578. let maxCount = browser.isMobile() ? 200000 : 400000
  17579. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17580. let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17581. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17582. if(c > maxCount){ //防止加载时间过长,分批计算
  17583. console.log('hot分批setVisiblePanos')
  17584. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17585. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17586. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17587. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17588. if(noVisiHots.length){
  17589. let i = 0
  17590. let hotVisiInterval = setInterval(()=>{
  17591. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos);
  17592. i++;
  17593. if(i>=noVisiHots.length){
  17594. clearInterval(hotVisiInterval)
  17595. }
  17596. }, dur)
  17597. }
  17598. }
  17599. }
  17600. //---------
  17601. this.createFloorLogo()
  17602. return O.debug("Done building model"),
  17603. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17604. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17605. this.buildRooms(),
  17606. this.labels.associateWithRooms(this.rooms),
  17607. $.when(this)
  17608. }
  17609. ,
  17610. n.prototype.createFloorLogo = function(){
  17611. console.log('createFloorLogo')
  17612. if(this.floorLogos || !settings.floorlogoURL)return;
  17613. var url = settings.floorlogoURL
  17614. var map = tex.load(url);//可以追加done
  17615. this.floorLogos = [];
  17616. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17617. var material = new o.MeshBasicMaterial({
  17618. opacity:0,
  17619. map:map,
  17620. side: o.DoubleSide,
  17621. transparent: !0,
  17622. depthWrite: !1,
  17623. depthTest:false//改 在chunk\skybox外也可看到
  17624. });
  17625. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17626. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17627. //logo.scale.set(s,s,s);
  17628. logo.position.set(0,-1.5,0);
  17629. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17630. logo.renderOrder = 100;//cover the videoSkybox
  17631. //logo.layers.set(0)
  17632. this.add(logo);
  17633. this.floorLogos.push(logo);
  17634. }
  17635. this.floorLogos[1].visible = false;
  17636. }
  17637. n.prototype.adjustfloorLogoHeight = function(o){
  17638. var h = player.currentPano.floorPosition.y + 0.01;
  17639. this.floorLogos[1].position.setY(h);
  17640. this.floorLogos[0].position.setY(h);
  17641. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17642. },
  17643. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17644. if(!this.floorLogos) return;
  17645. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17646. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17647. if(!o.dur){//立刻
  17648. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17649. this.floorLogos[o.index].material.opacity = o.opa;
  17650. }else{
  17651. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17652. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17653. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17654. }
  17655. },
  17656. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17657. var lastQ, lastP;
  17658. var equals = function(v1, v2, min){
  17659. return Math.abs(v1-v2) < min
  17660. }
  17661. var isSame = function(now, last, k){//如果和上次相同就不改变
  17662. if(!last)return false;
  17663. var R = k.sceneRenderer;
  17664. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17665. //暂时:
  17666. var min = 0.0008
  17667. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17668. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17669. return same;
  17670. }
  17671. return function(Q, k){
  17672. if(!Q)return;
  17673. /* if(Config.ifFish && window.lowFPS){
  17674. this.fLCompute++;
  17675. if(R.AFPS < 38){
  17676. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17677. else if(k.flying && k.fLCompute%2 !=1) return;
  17678. k.fLCompute %= 4;
  17679. }else if(R.AFPS < 45){
  17680. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17681. else if(k.flying && k.fLCompute%2 !=1) return;
  17682. k.fLCompute %= 6;
  17683. }else{
  17684. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17685. //else if(k.flying && k.fLCompute%2 !=1) return;
  17686. k.fLCompute %= 2;
  17687. }
  17688. } */
  17689. var sameQ, sameP, quaternion, visible;
  17690. for(var i=0;i<2;i++){
  17691. var logo = this.floorLogos[i];
  17692. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  17693. visible = true;
  17694. }
  17695. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  17696. var c = k.cameraControls.activeControl;
  17697. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  17698. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  17699. for(var i=0;i<2;i++){
  17700. var logo = this.floorLogos[i];
  17701. if(!sameQ){
  17702. if(!quaternion){
  17703. var a = new THREE.Vector3(0,0,-1);
  17704. a.applyQuaternion(Q);
  17705. a.setY(0);
  17706. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  17707. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  17708. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  17709. quaternion.multiply(a);
  17710. }
  17711. logo.quaternion.copy(quaternion);
  17712. }
  17713. }
  17714. }
  17715. }()
  17716. n.prototype.loadLabels = function() {//xzw
  17717. this.labels = new x(this);
  17718. var e = $.Deferred();
  17719. //加载俯视图的标签 注释这个备注就会加载
  17720. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  17721. window.DATA.showingLabels ? this.showingLabels = true : '';
  17722. if (!this.showingLabels)
  17723. return e.resolve();
  17724. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17725. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17726. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17727. O.warn("Getting labels failed, not displaying labels."),
  17728. e.resolve()
  17729. }),
  17730. e
  17731. }
  17732. ,
  17733. n.prototype.buildRooms = function() {
  17734. this.rooms = new T(this),
  17735. this.rooms.createFromChunks(this.chunks),
  17736. this.rooms.calcRoomBoundaries()
  17737. }
  17738. ,
  17739. n.prototype.updateProjectedPanos = function() {
  17740. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17741. }
  17742. ,
  17743. n.prototype.setProjectedPanos = function(e, t, i) {
  17744. void 0 !== i && null !== i || (i = !0),
  17745. i = !!i,
  17746. this.projectedPano0 = e,
  17747. this.projectedPano1 = t,
  17748. this.skybox.material.setProjectedPanos(e, t, i),
  17749. this.chunks.forEach(function(n) {
  17750. n.materialInside.setProjectedPanos(e, t, i)
  17751. })
  17752. }
  17753. ,
  17754. n.prototype.setSide = function(e) {
  17755. this.floors.forEach(function(t) {
  17756. t.collider.material.side = e
  17757. })
  17758. }
  17759. ,
  17760. n.prototype.heroCount = function() {
  17761. return this.heroLocations ? this.heroLocations.length : 0
  17762. }
  17763. ,
  17764. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17765. if (e[0] < 0)
  17766. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17767. null;
  17768. if (this.heroCount() < 1)
  17769. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17770. null;
  17771. var t = this.heroLocations[e[0]];
  17772. if(t.heroLocations && e[1]!=void 0){
  17773. t = t.heroLocations[e[1]];
  17774. }
  17775. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17776. null) : t
  17777. }
  17778. ,
  17779. n.prototype.findPanoramicHero = function() {
  17780. for (var e in this.heroLocations)
  17781. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17782. return this.heroLocations[e];
  17783. return null
  17784. }
  17785. ,
  17786. n.prototype.listImagePanos = function() {
  17787. var e = []
  17788. , t = this;
  17789. return this.images.forEach(function(i) {
  17790. if (i.metadata && i.metadata.scan_id) {
  17791. var n = t.panos.get(i.metadata.scan_id);
  17792. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17793. }
  17794. }),
  17795. e
  17796. }
  17797. ,
  17798. n.prototype.fadePanoMarkers = function(e, t) {
  17799. this.panos.fadeMarkerOpacity(e, t)
  17800. }
  17801. ,
  17802. n.prototype.setSweepVisibility = function(e) {
  17803. this.panos.forEach(function(t) {
  17804. t.marker && (t.marker.visible = e)
  17805. })
  17806. }
  17807. ,
  17808. n.prototype.outsideAllowed = function() {
  17809. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17810. }
  17811. ,
  17812. t.exports = n
  17813. }
  17814. ).call(this, "/js/model/Model.js")
  17815. }
  17816. , {
  17817. "../constants": 8,
  17818. "../enum/AlignmentType": 17,
  17819. "../enum/RenderOrder": 42,
  17820. "../enum/Viewmode": 51,
  17821. "../exception/BasicException": 55,
  17822. "../label/Label": 90,
  17823. "../loaders/ModelLoader": 105,
  17824. "../loaders/ModelTextureLoader": 106,
  17825. "../loaders/SweepDataLoader": 107,
  17826. "../tag/tag": 123,
  17827. "../tag/tagManager": 124,
  17828. "../objects/BoundingTextureSkybox": 143,
  17829. "../objects/Chunk": 144,
  17830. "../objects/Floor": 146,
  17831. "../objects/Panorama": 148,
  17832. "../objects/Room": 150,
  17833. "../objects/Snapshot": 153,
  17834. "../settings": 166,
  17835. "../shaders": 167,
  17836. "../util/ModelUrls": 177,
  17837. "../util/PanoramaCollection": 178,
  17838. "../util/ajax": 181,
  17839. "../util/common": 185,
  17840. "../util/easing": 186,
  17841. "../util/lerp": 188,
  17842. "../util/logger": 189,
  17843. "../util/math": 190,
  17844. "../util/texture": 194,
  17845. "../util/transitions": 195,
  17846. "./../util/browser": 182,
  17847. "./../util/showcase": 193,
  17848. "./Chunks": 135,
  17849. "./FloorCollection": 136,
  17850. "./ImageCollection": 137,
  17851. "./LabelCollection": 138,
  17852. "./RoomCollection": 141,
  17853. events: 202,
  17854. three: 217,
  17855. "hot": "hot"
  17856. }],
  17857. 140: [function(e, t, i) {
  17858. "use strict";
  17859. function n() {
  17860. this.modelMap = {},
  17861. this.activeModel = null,
  17862. this.modelCount = 0,
  17863. this.tileDownloader = null,
  17864. this.panoRenderer = null
  17865. }
  17866. var r = (e("three"),
  17867. e("../util/common"))
  17868. , o = e("../exception/BasicException")
  17869. , a = e("../enum/ModelManagerEvents")
  17870. , s = e("../enum/PanoRendererEvents")
  17871. , l = e("events").EventEmitter;
  17872. n.prototype.init = function(e, t, i) {
  17873. this.tileDownloader = e,
  17874. this.panoRenderer = t,
  17875. this.qualityManager = i,
  17876. this.bindEvents()
  17877. }
  17878. ,
  17879. n.prototype.bindEvents = function() {
  17880. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17881. }
  17882. ,
  17883. n.prototype.onTileRendered = function(e, t, i, n) {}
  17884. ,
  17885. n.prototype.addModel = function(e) {
  17886. this.modelMap[e.sid] = e,
  17887. 0 === this.modelCount && this.activateModel(e.sid),
  17888. this.modelCount++,
  17889. this.emit(a.ModelAdded)
  17890. }
  17891. ,
  17892. n.prototype.getModel = function(e) {
  17893. return this.modelMap[e]
  17894. }
  17895. ,
  17896. n.prototype.activateModel = function(e) {
  17897. var t = this.modelMap[e];
  17898. if (!t)
  17899. throw new o("Tried to activate invalid model!");
  17900. var i = this.activeModel;
  17901. this.activeModel = t,
  17902. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17903. this.tileDownloader.setUrls(t.urls),
  17904. t.panos.forEach(function(e) {
  17905. e.attachToPanoRenderer(this.panoRenderer),
  17906. e.tileDownloader = this.tileDownloader,
  17907. e.qualityManager = this.qualityManager
  17908. }
  17909. .bind(this)),
  17910. this.emit(a.ActiveModelChanged, {
  17911. oldModel: i,
  17912. model: t
  17913. })
  17914. }
  17915. ,
  17916. n.prototype.getActiveModel = function() {
  17917. return this.activeModel
  17918. }
  17919. ,
  17920. r.extend(n, l),
  17921. t.exports = n
  17922. }
  17923. , {
  17924. "../enum/ModelManagerEvents": 33,
  17925. "../enum/PanoRendererEvents": 35,
  17926. "../exception/BasicException": 55,
  17927. "../util/common": 185,
  17928. events: 202,
  17929. three: 217
  17930. }],
  17931. 141: [function(e, t, i) {
  17932. (function(i) {
  17933. "use strict";
  17934. function n() {
  17935. s.call(this)
  17936. }
  17937. var r = e("../objects/Room")
  17938. , o = (e("../settings"),
  17939. e("../util/logger"))
  17940. , a = (e("../util/transitions"),
  17941. e("../util/easing"),
  17942. e("../util/common"))
  17943. , s = e("../util/IndexedCollection")
  17944. , l = e("./Chunks");
  17945. new o(i);
  17946. a.inherit(n, s),
  17947. n.prototype.getIndex = function(e) {
  17948. return e.roomId
  17949. }
  17950. ,
  17951. n.prototype.calcRoomBoundaries = function() {
  17952. this.forEach(function(e) {
  17953. e.calcBoundaries()
  17954. })
  17955. }
  17956. ,
  17957. n.prototype.createFromChunks = function(e) {
  17958. var t = {
  17959. floorId: -1,
  17960. roomId: -1
  17961. }
  17962. , i = {};
  17963. e.forEach(function(e) {
  17964. l.parseIdsFromChunkName(e.name, t);
  17965. var o = i[t.roomId];
  17966. if (!o) {
  17967. var a = n.generateRoomId(t.floorId, t.roomId);
  17968. o = new r(t.floorId,a),
  17969. this.add(o),
  17970. i[t.roomId] = o
  17971. }
  17972. o.addChunk(e)
  17973. }
  17974. .bind(this)),
  17975. this.calcRoomBoundaries()
  17976. }
  17977. ,
  17978. n.generateRoomId = function(e, t) {
  17979. return e + "_" + t
  17980. }
  17981. ,
  17982. t.exports = n
  17983. }
  17984. ).call(this, "/js/model/RoomCollection.js")
  17985. }
  17986. , {
  17987. "../objects/Room": 150,
  17988. "../settings": 166,
  17989. "../util/IndexedCollection": 175,
  17990. "../util/common": 185,
  17991. "../util/easing": 186,
  17992. "../util/logger": 189,
  17993. "../util/transitions": 195,
  17994. "./Chunks": 135
  17995. }],
  17996. 142: [function(e, t, i) {
  17997. "use strict";
  17998. function n(e, t, i) {
  17999. e = e.clone().expandByScalar(0.01);//改
  18000. var n = e.size()
  18001. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18002. o.boundingBox = e,
  18003. r.Mesh.call(this, o, t),
  18004. this.position.copy(e.center()),
  18005. this.frustumCulled = !1,
  18006. i && this.add(new r.WireframeHelper(this))
  18007. }
  18008. var r = e("three");
  18009. n.prototype = Object.create(r.Mesh.prototype),
  18010. n.prototype.constructor = n,
  18011. t.exports = n
  18012. }
  18013. , {
  18014. three: 217
  18015. }],
  18016. 143: [function(e, t, i) {
  18017. (function(i) {
  18018. "use strict";
  18019. function n(e) {
  18020. h.time("Computing a nice bounding cubemap");
  18021. var t = new a({
  18022. side: r.BackSide,
  18023. transparent: !0
  18024. });
  18025. t.uniforms.modelAlpha.value = 0,
  18026. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18027. this.renderOrder = l.boundingSkybox,
  18028. o.call(this, e, t),
  18029. h.timeEnd("Computing a nice bounding cubemap")
  18030. }
  18031. var r = e("three")
  18032. , o = (e("../enum/Viewmode"),
  18033. e("../shaders"),
  18034. e("./BoundingMesh"))
  18035. , a = e("../materials/ModelTextureMaterial")
  18036. , s = e("../settings")
  18037. , l = e("../enum/RenderOrder")
  18038. , c = e("../util/logger")
  18039. , h = new c(i);
  18040. n.prototype = Object.create(o.prototype),
  18041. n.prototype.constructor = n,
  18042. t.exports = n
  18043. }
  18044. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18045. }
  18046. , {
  18047. "../enum/RenderOrder": 42,
  18048. "../enum/Viewmode": 51,
  18049. "../materials/ModelTextureMaterial": 118,
  18050. "../settings": 166,
  18051. "../shaders": 167,
  18052. "../util/logger": 189,
  18053. "./BoundingMesh": 142,
  18054. three: 217
  18055. }],
  18056. 144: [function(e, t, i) {
  18057. "use strict";
  18058. function n(e) {
  18059. this.materialInside = new s({
  18060. side: r.DoubleSide
  18061. });
  18062. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18063. this.materialOutside = new r.RawShaderMaterial({
  18064. fragmentShader: o.modelOutside.fragmentShader,
  18065. vertexShader: o.modelOutside.vertexShader,
  18066. uniforms: t,
  18067. side: r.FrontSide,
  18068. name: "chunkOut"
  18069. }),
  18070. r.Mesh.call(this, e.geometry, this.materialInside),
  18071. this.name = e.name || "",
  18072. this.textureName = e.textureName,
  18073. this.meshUrl = e.meshUrl
  18074. }
  18075. var r = e("three")
  18076. , o = e("../shaders")
  18077. , a = e("../enum/Viewmode")
  18078. , s = e("../materials/ModelTextureMaterial");
  18079. n.prototype = Object.create(r.Mesh.prototype),
  18080. n.prototype.setTextureMap = function(e) {
  18081. this.materialInside.uniforms.map.value = e,
  18082. this.materialOutside.uniforms.map.value = e
  18083. }
  18084. ,
  18085. n.prototype.setMode = function(e) {
  18086. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18087. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18088. t.transparent = this.material.transparent,
  18089. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18090. this.material = t
  18091. }
  18092. ,
  18093. t.exports = n
  18094. }
  18095. , {
  18096. "../enum/Viewmode": 51,
  18097. "../materials/ModelTextureMaterial": 118,
  18098. "../shaders": 167,
  18099. three: 217
  18100. }],
  18101. 145: [function(e, t, i) {
  18102. "use strict";
  18103. function n(e) {
  18104. this.chunksize = e || 10,
  18105. this.chunks = {},
  18106. this.boundingBoxes = {},
  18107. this.children = [],
  18108. this.offset = new r.Vector3(0,.5,0),
  18109. this.material = new r.MeshBasicMaterial({
  18110. color: 16777215 * Math.random(),
  18111. side: r.DoubleSide
  18112. })
  18113. }
  18114. var r = e("three");
  18115. e("../enum/Viewmode");
  18116. n.prototype.add = function(e) {
  18117. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18118. m ? (t = m.position.array,
  18119. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18120. n = e.faces);
  18121. var v = new r.Vector3;
  18122. if (i)
  18123. for (o = 0,
  18124. a = i.length; o < a; o += 3) {
  18125. var A = 3 * i[o]
  18126. , y = 3 * i[o + 1]
  18127. , C = 3 * i[o + 2];
  18128. s = (t[A] + t[y] + t[C]) / 3,
  18129. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18130. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18131. h = Math.floor(s / this.chunksize),
  18132. u = Math.floor(l / this.chunksize),
  18133. d = Math.floor(c / this.chunksize),
  18134. p = h + "." + u + "." + d,
  18135. p in this.chunks ? (g = this.chunks[p],
  18136. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18137. f = this.boundingBoxes[p] = new r.Box3),
  18138. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  18139. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18140. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18141. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18142. }
  18143. else
  18144. for (o = 0,
  18145. a = t.length; o < a; o += 9)
  18146. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18147. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18148. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18149. h = Math.floor(s / this.chunksize),
  18150. u = Math.floor(l / this.chunksize),
  18151. d = Math.floor(c / this.chunksize),
  18152. p = h + "." + u + "." + d,
  18153. p in this.chunks ? (g = this.chunks[p],
  18154. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18155. f = this.boundingBoxes[p] = new r.Box3),
  18156. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  18157. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18158. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18159. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18160. }
  18161. ,
  18162. n.prototype.build = function() {
  18163. var e = new r.Object3D;
  18164. e.material = this.material;
  18165. for (var t in this.chunks) {
  18166. var i = this.chunks[t]
  18167. , n = new r.BufferGeometry;
  18168. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18169. n.boundingBox = this.boundingBoxes[t];
  18170. var o = new r.Mesh(n,this.material);
  18171. o.material.visible = !1,
  18172. e.add(o),
  18173. this.chunks[t] = []
  18174. }
  18175. return e
  18176. }
  18177. ,
  18178. t.exports = n
  18179. }
  18180. , {
  18181. "../enum/Viewmode": 51,
  18182. three: 217
  18183. }],
  18184. 146: [function(e, t, i) {
  18185. "use strict";
  18186. var r = e("three")
  18187. , o = e("../settings")
  18188. , a = e("../util/common")
  18189. , s = e("../util/lerp")
  18190. , l = e("./ChunkedCollider")
  18191. , c = e("../util/transitions")
  18192. , h = e("../util/easing")
  18193. , u = (e("../objects/Panorama"),
  18194. e("../enum/RenderOrder"))
  18195. , d = e("../localization/localize");
  18196. function n(e, t, i) {
  18197. r.Object3D.call(this),
  18198. this.model = e,
  18199. this.floorIndex = t,
  18200. this.lang = o.languageTag,
  18201. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18202. this.panos = [],
  18203. this.chunks = [],
  18204. this.colliderBuilder = new l(3),
  18205. this.collider = null,
  18206. this.center = null,
  18207. this.boundingBox = new r.Box3,
  18208. this.size = null,
  18209. this.hidden = !1,
  18210. this.conservativeBoundingBox = new r.Box3,
  18211. this.debugColor = 16777215 * Math.random(),
  18212. this.transition = null
  18213. }
  18214. n.prototype = Object.create(r.Object3D.prototype),
  18215. n.prototype.enter = function(e) {
  18216. this.model.setFloor(this, e)
  18217. }
  18218. ,
  18219. n.prototype.hide = function(e) {
  18220. if (!this.hidden || this.transition) {
  18221. this.chunks.forEach(function(e) {
  18222. e.material.transparent = !0
  18223. }),
  18224. c.cancel(this.transition);
  18225. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18226. , i = e ? 0 : o.hideFloorDelay / t;
  18227. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18228. this.hidden = !0
  18229. }
  18230. .bind(this), i, h.easeInOutQuad)
  18231. }
  18232. }
  18233. ,
  18234. n.prototype.show = function(e) {
  18235. if (this.hidden || this.transition) {
  18236. this.hidden = !1,
  18237. c.cancel(this.transition);
  18238. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18239. , i = e ? 0 : o.showFloorDelay / t;
  18240. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18241. this.hidden || this.chunks.forEach(function(e) {
  18242. e.material.transparent = !1
  18243. })
  18244. }
  18245. .bind(this), i, h.easeInOutQuad)
  18246. }
  18247. }
  18248. ,
  18249. n.prototype.toggle = function(e, t) {
  18250. e = void 0 === e ? this.hidden : e,
  18251. e ? this.show(t) : this.hide(t)
  18252. }
  18253. ,
  18254. n.prototype.containsPoint = function(e) {
  18255. return this.collider.children.some(function(t) {
  18256. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18257. t.geometry.boundingBox.containsPoint(e)
  18258. })
  18259. }
  18260. ,
  18261. n.prototype.distanceToPoint = function(e) {
  18262. var t = null
  18263. , i = 1 / 0;
  18264. return this.collider.children.forEach(function(n) {
  18265. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18266. var r = n.geometry.boundingBox.distanceToPoint(e);
  18267. (!t || i > r) && (i = r,
  18268. t = n)
  18269. }),
  18270. i
  18271. }
  18272. ,
  18273. n.prototype.addChunk = function(e) {
  18274. e.renderOrder = u.ghostFloor,
  18275. this.add(e),
  18276. this.chunks.push(e),
  18277. this.boundingBox.union(e.geometry.boundingBox),
  18278. this.size = this.boundingBox.size(),
  18279. this.colliderBuilder.add(e.geometry)
  18280. }
  18281. ,
  18282. n.prototype.addPano = function(e) {
  18283. this.panos.push(e),
  18284. this.add(e.skyboxMesh),
  18285. e.marker && this.add(e.marker);
  18286. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18287. var t = new r.Vector3(1,1,1)
  18288. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18289. this.boundingBox.union(i)
  18290. }
  18291. }
  18292. ,
  18293. n.prototype.build = function() {
  18294. this.collider = this.colliderBuilder.build(!0),
  18295. this.add(this.collider),
  18296. this.center = this.boundingBox.center(),
  18297. this.conservativeBoundingBox.copy(this.boundingBox),
  18298. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18299. return e.geometry.boundingBox.min.y
  18300. }), 5),
  18301. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18302. return e.geometry.boundingBox.max.y
  18303. }), 5),
  18304. this.colliderBuilder = null
  18305. }
  18306. ,
  18307. n.prototype.toShortString = function() {
  18308. return a.nth(this.floorIndex + 1)
  18309. }
  18310. ,
  18311. n.prototype.toString = function() {
  18312. return this.name
  18313. }
  18314. ,
  18315. t.exports = n
  18316. }
  18317. , {
  18318. "../enum/RenderOrder": 42,
  18319. "../localization/localize": 108,
  18320. "./strings-cn-CN": 109,
  18321. "../objects/Panorama": 148,
  18322. "../settings": 166,
  18323. "../util/common": 185,
  18324. "../util/easing": 186,
  18325. "../util/lerp": 188,
  18326. "../util/transitions": 195,
  18327. "./ChunkedCollider": 145,
  18328. three: 217
  18329. }],
  18330. 147: [function(e, t, i) {
  18331. "use strict";
  18332. function n(e) {
  18333. this.player = e,
  18334. this.obj3d = null,
  18335. this.UP = new r.Vector3(0,1,0)
  18336. }
  18337. var r = e("three")
  18338. , o = e("../settings");
  18339. n.prototype.prefs = {
  18340. linewidth: 3,
  18341. height: .07,
  18342. opacity: .45,
  18343. endScale: .05
  18344. },
  18345. n.prototype.discard = function() {
  18346. if (this.obj3d) {
  18347. var e = this.obj3d.parent;
  18348. e && e.remove(this.obj3d)
  18349. }
  18350. this.obj3d = null
  18351. }
  18352. ,
  18353. n.prototype.draw = function() {
  18354. if (this.discard(),
  18355. o.showNeighbors) {
  18356. var e = this.player.currentPano.floor;
  18357. this.obj3d = new r.Object3D;
  18358. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18359. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18360. i.y += this.prefs.height;
  18361. var n = .1525
  18362. , a = .127
  18363. , s = .0127
  18364. , l = .1
  18365. , c = .19
  18366. , h = .2032
  18367. , u = .2286
  18368. , d = .255
  18369. , p = new r.Matrix4;
  18370. for (var f in t)
  18371. if (t[f]) {
  18372. var g = this.player.model.panos.get(f)
  18373. , m = (g.position.clone().sub(this.player.model.position),
  18374. g.position.clone().sub(g.floorPosition))
  18375. , v = g.floorPosition.clone().sub(this.player.model.position);
  18376. v.y += this.prefs.height;
  18377. var A = new r.Geometry;
  18378. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  18379. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  18380. p.identity().setPosition(m),
  18381. A.applyMatrix(p),
  18382. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18383. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  18384. p.lookAt(v, i, this.UP).setPosition(v),
  18385. A.applyMatrix(p),
  18386. A.vertices.push(v, i);
  18387. var y = new r.Line(A,new r.LineBasicMaterial({
  18388. color: g.debugColor.getHex(),
  18389. transparent: !0,
  18390. opacity: this.prefs.opacity,
  18391. depthWrite: !1,
  18392. name: "sLine" + f,
  18393. linewidth: this.prefs.linewidth
  18394. }));
  18395. this.obj3d.add(y)
  18396. }
  18397. e.add(this.obj3d)
  18398. }
  18399. }
  18400. ,
  18401. n.prototype.update = function() {
  18402. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18403. }
  18404. ,
  18405. t.exports = n
  18406. }
  18407. , {
  18408. "../settings": 166,
  18409. three: 217
  18410. }],
  18411. 148: [function(e, t, i) {
  18412. (function(i) {
  18413. "use strict";
  18414. function n(e, t, i, n) {
  18415. this.model = e,
  18416. this.id = t,
  18417. this.alignmentType = i.alignmentType || l.ALIGNED,
  18418. this.neighbourUUIDs = i.neighbours || null,
  18419. this.neighbourPanos = null,
  18420. this.floor = null,
  18421. this.floorIndex = i.floor,
  18422. this.failedLoadingAt = 0,
  18423. this.maxLoadRetries = 4,
  18424. this.origin = i.position.clone(),
  18425. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18426. this.quaternion = i.quaternion.clone(),
  18427. this.skyboxMesh = new r.Mesh(E),
  18428. this.skyboxMesh.position.copy(this.position),
  18429. this.skyboxMesh.quaternion.copy(this.quaternion),
  18430. this.skyboxMesh.name = "skybox",
  18431. this.skyboxMesh.visible = !1,
  18432. this.skyboxMesh.updateMatrix(),
  18433. this.skyboxMesh.updateMatrixWorld(),
  18434. this.marker = null,
  18435. this.showFloorMarker = !window.DATA.hideFloorMarker;
  18436. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18437. map: w,
  18438. side: r.DoubleSide,
  18439. opacity: 0,
  18440. transparent: !0,
  18441. depthWrite: !1
  18442. })),
  18443. this.marker.visible = this.showFloorMarker,
  18444. this.marker.renderOrder = s.panoMarker,
  18445. this.marker.name = "marker",
  18446. this.marker.pano = this,
  18447. this.marker.layers.set(v.PANOMARKERS),
  18448. this.marker.updateMatrixWorld(),
  18449. a.colorMarkerOnLoad && this.on("load", function() {
  18450. this.marker.material.color.set(65280)
  18451. })),
  18452. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18453. this.floorPosition = i.puck ? i.puck.clone() : null,
  18454. this.tiled = n,
  18455. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18456. this.solidSkybox.flipY = !1,
  18457. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18458. this.solidSkybox.magFilter = r.LinearFilter,
  18459. this.solidSkybox.generateMipmaps = !1)),
  18460. this.zoomed = !1,
  18461. this.panoRenderer = null,
  18462. this.qualityManager = null,
  18463. this.tileDownloader = null,
  18464. this.tiledPanoRenderTarget = null,
  18465. this.minimumTiledPanoLoaded = !1,
  18466. this.highestPartialTileRenderOpCompleted = 0,
  18467. this.highestFullTileRenderOpCompleted = 0,
  18468. this.shouldRedrawOnBaseLoaded = !1,
  18469. this.lockUntilRenderingComplete = !1,
  18470. a.colorMarkerOnLoad && this.on("load", function() {
  18471. this.marker.material.color.set(65280)
  18472. });
  18473. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18474. var e = new r.TextureLoader;
  18475. e.setCrossOrigin(!0);
  18476. var g = e.load("static/images/texture.jpg");
  18477. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  18478. color: 16777215,
  18479. transparent: !0,
  18480. opacity: .75,
  18481. map: g
  18482. })),
  18483. this.vrMarker.boluoType = "vr",
  18484. this.vrMarker.position.z = 1,
  18485. this.vrMarker.enabled = !0,
  18486. this.vrMarker.visible = !1,
  18487. window.vrMarkers = window.vrMarkers || [],
  18488. window.vrMarkers.push(this.vrMarker),
  18489. this.marker && this.marker.add(this.vrMarker),
  18490. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  18491. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  18492. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  18493. this.adjustAngleEnable) {
  18494. var i = new r.Quaternion;
  18495. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  18496. this.skyboxMesh.quaternion.multiply(i);
  18497. var m = new r.Quaternion;
  18498. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  18499. this.skyboxMesh.quaternion.multiply(m);
  18500. var n = new r.Quaternion;
  18501. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  18502. this.skyboxMesh.quaternion.multiply(n),
  18503. this.skyboxMesh.updateMatrix(),
  18504. this.skyboxMesh.updateMatrixWorld(),
  18505. this.model.updateProjectedPanos()
  18506. }
  18507. /**************************************************************************************************************************************/
  18508. }
  18509. var r = e("three")
  18510. , o = e("../util/logger")
  18511. , a = e("../settings")
  18512. , s = (e("../enum/Viewmode"),
  18513. e("../enum/RenderOrder"))
  18514. , l = e("../enum/AlignmentType")
  18515. , c = (e("../util/common"),
  18516. e("../util/transitions"))
  18517. , h = e("../util/lerp")
  18518. , u = e("../util/ajax")
  18519. , d = e("../util/texture")
  18520. , p = e("../util/panorama")
  18521. , f = (e("../enum/TileDownloaderEvents"),
  18522. e("../enum/PanoramaEvents"))
  18523. , g = e("../enum/PanoRendererEvents")
  18524. , m = e("../enum/PanoSizeClass")
  18525. , v = e("../enum/RenderLayers")
  18526. , A = (e("../scene/SceneRenderer"),
  18527. e("../enum/GLCubeFaces"),
  18528. e("../exception/BasicException"))
  18529. , y = e("../tile/TileUtils")
  18530. , C = e("events").EventEmitter
  18531. , I = new o(i)
  18532. , E = new r.SphereBufferGeometry(.1)
  18533. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18534. , w = d.load("static/images/marker-256x256.png");
  18535. n.prototype = Object.create(C.prototype),
  18536. n.prototype.enter = function() {
  18537. var e = null;
  18538. return function() {
  18539. this.setZoomed(!1),
  18540. this.emit("enter", {
  18541. oldPano: e,
  18542. newPano: this
  18543. }),
  18544. e = this
  18545. }
  18546. }(),
  18547. n.prototype.exit = function() {
  18548. this.tiled ? (this.clearWaitDeferreds(),
  18549. this.minimumTiledPanoLoaded = !1,
  18550. this.tiledPanoRenderTarget = null,
  18551. this.setZoomed(!1),
  18552. this.panoRenderer.deactivateTiledPano(this),
  18553. this.highestPartialTileRenderOpCompleted = 0,
  18554. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18555. this.solidSkybox.loaded = !1,
  18556. this.solidSkybox.version = 0),
  18557. this.emit("exit")
  18558. }
  18559. ,
  18560. n.prototype.hoverOn = function(e) {
  18561. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18562. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18563. }
  18564. ,
  18565. n.prototype.hoverOff = function(e) {
  18566. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18567. }
  18568. ,
  18569. n.prototype.build1 = function() {
  18570. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position),
  18571. this.floor.addPano(this),
  18572. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18573. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18574. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18575. }
  18576. ,
  18577. n.prototype.build2 = function() {
  18578. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18579. this.height = this.position.distanceTo(this.floorPosition),
  18580. this.placeMarker()
  18581. }
  18582. ,
  18583. n.prototype.interpolateFloorPosition = function() {
  18584. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18585. return !!e.floorPosition
  18586. }).sort(function(e, t) {
  18587. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18588. }
  18589. .bind(this))
  18590. , t = this.position.clone();
  18591. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18592. t
  18593. }
  18594. ,
  18595. n.prototype.raycastFloorPosition = function() {
  18596. I.warn("Performance warning: Raycasting to find floor position");
  18597. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18598. , t = e.intersectObjects(this.model.colliders);
  18599. return t.length ? t[0].point : null
  18600. }
  18601. ,
  18602. n.prototype.raycastToFindFloor = function() {
  18603. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  18604. return function() {
  18605. I.warn("Performance warning: Raycasting to find floor index");
  18606. for (var t = 0; t < e.length; t++) {
  18607. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18608. , n = i.intersectObjects(this.model.colliders);
  18609. if (n.length)
  18610. return n[0].object.parent.parent
  18611. }
  18612. return null
  18613. }
  18614. }(),
  18615. n.prototype.placeMarker = function() {
  18616. this.marker && (this.marker.position.copy(this.floorPosition),
  18617. this.marker.position.y += .05,
  18618. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18619. }
  18620. ,
  18621. n.prototype.translate = function(e) {
  18622. this.position.add(e),
  18623. this.floorPosition.add(e)
  18624. }
  18625. ,
  18626. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18627. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18628. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18629. }
  18630. ,
  18631. n.prototype.attachToPanoRenderer = function(e) {
  18632. this.panoRenderer = e,
  18633. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18634. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18635. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18636. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18637. }
  18638. ;
  18639. var _ = {};
  18640. n.prototype.getWaitDeferred = function(e) {
  18641. var t = _[this.id];
  18642. t || (t = {},
  18643. _[this.id] = t);
  18644. var i = t[e];
  18645. return i || (i = {
  18646. deferred: $.Deferred(),
  18647. active: !1
  18648. },
  18649. t[e] = i),
  18650. i
  18651. }
  18652. ,
  18653. n.prototype.resetWaitDeferred = function(e) {
  18654. var t = this.getWaitDeferred(e);
  18655. t.active = !1,
  18656. t.deferred = $.Deferred()
  18657. }
  18658. ,
  18659. n.prototype.clearWaitDeferreds = function() {
  18660. var e = _[this.id];
  18661. e || (e = {},
  18662. _[this.id] = e);
  18663. for (var t in e)
  18664. if (e.hasOwnProperty(t)) {
  18665. var i = e[t];
  18666. i.active = !1,
  18667. i.deferred = $.Deferred()
  18668. }
  18669. }
  18670. ,
  18671. n.prototype.loadTiledPano = function() {
  18672. var e = (new r.Vector3,
  18673. [])
  18674. , t = [];
  18675. return function(i, n, r, o, a, s) {
  18676. null !== o && void 0 !== o || (o = !0),
  18677. null !== a && void 0 !== a || (a = !0);
  18678. var l = this.getWaitDeferred(i)
  18679. , c = l.deferred
  18680. , h = null
  18681. , u = null;
  18682. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18683. u = r.vFov)),
  18684. !this.isLoaded(i)) {
  18685. if (!l.active) {
  18686. if (l.active = !0,
  18687. r) {
  18688. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18689. e[this.id + ":" + i] = {
  18690. tileCount: 0,
  18691. targetTileCount: d
  18692. },
  18693. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18694. }
  18695. t[this.id] || (t[this.id] = !0,
  18696. this.on(f.LoadComplete, function(e, t) {
  18697. var i = this.getWaitDeferred(e).deferred;
  18698. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18699. this.resetWaitDeferred(e))
  18700. }
  18701. .bind(this)),
  18702. this.on(f.LoadFailed, function(e) {
  18703. var t = this.getWaitDeferred(e).deferred;
  18704. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18705. this.resetWaitDeferred(e))
  18706. }
  18707. .bind(this)),
  18708. this.on(f.TileLoaded, function(t, i, n) {
  18709. var r = this.getWaitDeferred(t).deferred;
  18710. if (r && "pending" === r.state()) {
  18711. r.notify(t, i, n);
  18712. var o = e[this.id + ":" + t];
  18713. o && (o.tileCount++,
  18714. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18715. r.resolve(t, n),
  18716. this.resetWaitDeferred(t)))
  18717. }
  18718. }
  18719. .bind(this)))
  18720. }
  18721. this.tileDownloader.clearForceQueue(),
  18722. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18723. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18724. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18725. }
  18726. return c.promise()
  18727. }
  18728. }(),
  18729. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18730. if (e === this.id) {
  18731. var n = this.qualityManager.getPanoSize(m.BASE);
  18732. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18733. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18734. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18735. }
  18736. }
  18737. ,
  18738. n.prototype.onTileRendered = function(e, t, i, n) {
  18739. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18740. }
  18741. ,
  18742. n.prototype.onPanoRendered = function(e, t, i, n) {
  18743. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18744. this.updateSkyboxForZoomLevel(),
  18745. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18746. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18747. this.emit("load", t),
  18748. this.model.emit("load", this),
  18749. this.emit(f.LoadComplete, t, i))
  18750. }
  18751. ,
  18752. n.prototype.setZoomed = function(e) {
  18753. this.zoomed = e,
  18754. this.updateSkyboxForZoomLevel()
  18755. }
  18756. ,
  18757. n.prototype.ensureSkyboxReadyForRender = function() {
  18758. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18759. this.solidSkybox.loaded = !0)
  18760. }
  18761. ,
  18762. n.prototype.updateSkyboxForZoomLevel = function() {
  18763. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18764. }
  18765. ,
  18766. n.prototype.getSkyboxTexture = function() {
  18767. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18768. }
  18769. ,
  18770. n.prototype.onTileRenderFail = function(e, t, i) {
  18771. e === this.id && this.emit(f.LoadFailed, t)
  18772. }
  18773. ,
  18774. n.prototype.isLoaded = function(e) {
  18775. if (this.tiled) {
  18776. if (e && "string" == typeof e)
  18777. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18778. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18779. }
  18780. if (e && "number" == typeof e)
  18781. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18782. return !!this.solidSkybox.high || e in this.solidSkybox
  18783. }
  18784. ,
  18785. n.prototype.loadCube = function(e) {
  18786. if (this.isLoaded(e))
  18787. return I.info("Skipping load of pano, already loaded"),
  18788. $.when();
  18789. this.emit("loading", e),
  18790. this.model.emit("loading", this);
  18791. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18792. , i = t.filter(function(e) {
  18793. return !e
  18794. });
  18795. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18796. e = "high",
  18797. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18798. var n = 0
  18799. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18800. return u.getImage(t[i])
  18801. }
  18802. .bind(this));
  18803. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18804. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18805. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18806. this.solidSkybox.low = null),
  18807. this.solidSkybox.needsUpdate = !0,
  18808. this.emit("load", e),
  18809. this.model.emit("load", this),
  18810. this
  18811. }
  18812. .bind(this), function() {
  18813. I.error("Downloading cubemap for pano", this.id, "failed"),
  18814. this.failedLoadingAt = Date.now()
  18815. }
  18816. .bind(this), function() {
  18817. return $.when(++n, 6)
  18818. })
  18819. }
  18820. ,
  18821. n.raycastsSkipped = 0,
  18822. n.raycastsDone = 0,
  18823. n.prototype.findNeighourPanos = function() {
  18824. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18825. this.model.panos.forEach(function(e) {
  18826. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18827. var t = this.position.distanceTo(e.position);
  18828. if (t > a.panoramaNeighbourMaxDistance)
  18829. return this.model.panos.setNeighbour(this, e, !1),
  18830. void n.raycastsSkipped++;
  18831. var i = e.position.clone().sub(this.position).normalize()
  18832. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18833. , s = o.intersectObjects(this.model.colliders);
  18834. n.raycastsDone++,
  18835. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18836. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  18837. }
  18838. }
  18839. .bind(this)),
  18840. this.model.panos.neighbourMap[this.id]
  18841. }
  18842. ,
  18843. n.prototype.worldPosition = function() {
  18844. return this.position
  18845. }
  18846. ,
  18847. n.prototype.addTextSprite = function(e, t) {
  18848. this.removeTextSprite();
  18849. var i = document.createElement("canvas")
  18850. , n = i.getContext("2d");
  18851. i.width = 256,
  18852. i.height = 256;
  18853. var o = "Arial"
  18854. , a = 60;
  18855. n.font = "bold " + a + "px " + o,
  18856. n.fillStyle = "white";
  18857. var s = n.measureText(e).width;
  18858. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18859. var l = new r.Texture(i);
  18860. l.needsUpdate = !0;
  18861. var c = new r.SpriteMaterial({
  18862. map: l,
  18863. color: t || 16428055
  18864. });
  18865. this.text3d = new r.Sprite(c),
  18866. this.text3d.position.copy(this.skyboxMesh.position),
  18867. this.floor.add(this.text3d)
  18868. }
  18869. ,
  18870. n.prototype.removeTextSprite = function() {
  18871. this.text3d && (this.floor.remove(this.text3d),
  18872. this.text3d = null)
  18873. }
  18874. ,
  18875. n.prototype.isAligned = function() {
  18876. return this.alignmentType === l.ALIGNED
  18877. }
  18878. ,
  18879. n.filters = {
  18880. inDirection: function(e, t, i) {
  18881. return function(n) {
  18882. var r = n.position.clone().sub(e).normalize();
  18883. return r.dot(t) > i
  18884. }
  18885. },
  18886. inFloorDirection: function(e, t, i) {
  18887. return function(n) {
  18888. var r = n.floorPosition.clone().sub(e).normalize();
  18889. return r.dot(t) > i
  18890. }
  18891. },
  18892. inPanoDirection: function(e, t, i) {
  18893. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18894. function(n) {
  18895. var r = n.floorPosition.clone().sub(e).normalize()
  18896. , o = n.position.clone().sub(e).normalize();
  18897. return r.dot(t) > i || o.dot(t) > i
  18898. }
  18899. },
  18900. atFloor: function(e) {
  18901. return function(t) {
  18902. return !e || t.floor === e
  18903. }
  18904. },
  18905. not: function(e) {
  18906. return function(t) {
  18907. return t !== e
  18908. }
  18909. },
  18910. notIn: function(e) {
  18911. return function(t) {
  18912. return e.indexOf(t) === -1
  18913. }
  18914. },
  18915. isLoaded: function() {
  18916. return function(e) {
  18917. return e.isLoaded()
  18918. }
  18919. },
  18920. isNotLoaded: function() {
  18921. return function(e) {
  18922. return !e.isLoaded()
  18923. }
  18924. },
  18925. isCloseEnoughTo: function(e, t) {
  18926. return function(i) {
  18927. return e.distanceTo(i.floorPosition) < t
  18928. }
  18929. },
  18930. hasMinimumHeightDifferenceTo: function(e, t) {
  18931. return function(i) {
  18932. return Math.abs(i.position.y - e.y) > t
  18933. }
  18934. },
  18935. isNotBehindNormal: function(e, t) {
  18936. var i = new r.Vector3;
  18937. return t = t.clone(),
  18938. function(n) {
  18939. var r = i.copy(n.position).sub(e).normalize();
  18940. return r.dot(t) > 0
  18941. }
  18942. },
  18943. isNeighbourPanoTo: function(e) {
  18944. return function(t) {
  18945. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18946. }
  18947. },
  18948. isNeighbourOfNeighbourTo: function(e) {
  18949. return function(t) {
  18950. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18951. var n = e.model.panos.get(i);
  18952. return !!n && n.neighbourPanos[t.id]
  18953. })
  18954. }
  18955. },
  18956. isNotRecentlyFailed: function(e) {
  18957. return function(t) {
  18958. return Date.now() - t.failedLoadingAt > e
  18959. }
  18960. },
  18961. isOnVisibleFloor: function() {
  18962. return function(e) {
  18963. return !e.floor.hidden
  18964. }
  18965. },
  18966. isPanoAligned: function() {
  18967. return function(e) {
  18968. return e.isAligned()
  18969. }
  18970. }
  18971. },
  18972. n.sortFunctions = {
  18973. distanceToPoint: function(e) {
  18974. return function(t, i) {
  18975. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18976. }
  18977. },
  18978. floorDistanceToPoint: function(e) {
  18979. return function(t, i) {
  18980. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18981. }
  18982. },
  18983. choose: function(e) {
  18984. return function(t, i) {
  18985. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18986. }
  18987. }
  18988. },
  18989. n.scoreFunctions = {
  18990. distance: function(e, t) {
  18991. return t = t || a.navigation.distanceFactor,
  18992. function(i) {
  18993. return e ? e.position.distanceTo(i.position) * t : 0
  18994. }
  18995. },
  18996. distanceSquared: function(e, t) {
  18997. return t = t || a.navigation.distanceFactor,
  18998. function(i) {
  18999. return e ? e.position.distanceToSquared(i.position) * t : 0
  19000. }
  19001. },
  19002. direction: function(e, t) {
  19003. return function(i) {
  19004. var n = i.position.clone().sub(e).normalize();
  19005. return n.dot(t) * a.navigation.directionFactor
  19006. }
  19007. },
  19008. angle: function(e, t) {
  19009. return function(i) {
  19010. var n = i.position.clone().sub(e).normalize();
  19011. return n.angleTo(t) * a.navigation.angleFactor
  19012. }
  19013. },
  19014. inFieldOfView: function(e, t) {
  19015. return function(i) {
  19016. var n = i.position.clone().sub(e).normalize();
  19017. return n.dot(t) > .75 ? 10 : -1
  19018. }
  19019. },
  19020. optionality: function(e) {
  19021. return function(t) {
  19022. var i = t.neighbourUUIDs.filter(function(t) {
  19023. return !(t in e.neighbourUUIDs) && t !== e.id
  19024. });
  19025. return i.length * a.navigation.optionalityFactor
  19026. }
  19027. },
  19028. penalizeHeightDifferenceUnder: function(e, t) {
  19029. return function(i) {
  19030. return e.y - i.position.y < t ? -20 : 0
  19031. }
  19032. }
  19033. },
  19034. t.exports = n
  19035. }
  19036. ).call(this, "/js/objects/Panorama.js")
  19037. }
  19038. , {
  19039. "../enum/AlignmentType": 17,
  19040. "../enum/GLCubeFaces": 25,
  19041. "../enum/PanoRendererEvents": 35,
  19042. "../enum/PanoSizeClass": 36,
  19043. "../enum/PanoramaEvents": 37,
  19044. "../enum/RenderLayers": 41,
  19045. "../enum/RenderOrder": 42,
  19046. "../enum/TileDownloaderEvents": 45,
  19047. "../enum/Viewmode": 51,
  19048. "../exception/BasicException": 55,
  19049. "../scene/SceneRenderer": 158,
  19050. "../settings": 166,
  19051. "../tile/TileUtils": 174,
  19052. "../util/ajax": 181,
  19053. "../util/common": 185,
  19054. "../util/lerp": 188,
  19055. "../util/logger": 189,
  19056. "../util/panorama": 191,
  19057. "../util/texture": 194,
  19058. "../util/transitions": 195,
  19059. events: 202,
  19060. three: 217
  19061. }],
  19062. 149: [function(e, t, i) {
  19063. "use strict";
  19064. function n(e) {
  19065. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19066. t.map.value = d,
  19067. t.opacity.value = 0,
  19068. t.color.value.set(o.reticuleColor),
  19069. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19070. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19071. side: r.DoubleSide,
  19072. depthWrite: !1,
  19073. depthTest: !1,
  19074. transparent: !0,
  19075. vertexShader: c.waypoint.vertexShader,
  19076. fragmentShader: c.waypoint.fragmentShader,
  19077. uniforms: t,
  19078. name: "waypoint",
  19079. opacity: 0,
  19080. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19081. })),
  19082. this.layers.set(h.RETICULE),
  19083. this.renderOrder = u.reticule,
  19084. this.player = e,
  19085. this.direction = new r.Vector3,
  19086. this.hidden = !0,
  19087. this.mouseLastMoveTime = Date.now()
  19088. }
  19089. var r = e("three")
  19090. , o = e("../settings")
  19091. , a = e("../util/transitions")
  19092. , s = e("../util/texture")
  19093. , l = e("../util/lerp")
  19094. , c = e("../shaders")
  19095. , h = e("../enum/RenderLayers")
  19096. , u = e("../enum/RenderOrder")
  19097. , d = s.load("static/images/reticule-256x256.png");
  19098. n.prototype = Object.create(r.Mesh.prototype),
  19099. n.prototype.move = function(e, t, i) {
  19100. this.hidden = i,
  19101. this.mouseLastMoveTime = Date.now()
  19102. }
  19103. ,
  19104. n.prototype.hide = function() {
  19105. this.hidden || (this.hidden = !0,
  19106. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19107. }
  19108. ,
  19109. n.prototype.show = function() {
  19110. this.hidden = !1,
  19111. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19112. }
  19113. ,
  19114. n.prototype.update = function() {
  19115. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19116. }
  19117. ,
  19118. n.prototype.updatePosition = function(e, t) {
  19119. if (!this.hidden) {
  19120. if (!t)
  19121. return this.hide();
  19122. var i = t.point
  19123. , n = e.distanceTo(i)
  19124. , r = 1 + .01 * n;
  19125. n < 1 && (r -= 1 - n),
  19126. this.show(),
  19127. this.scale.set(r, r, r),
  19128. this.direction = this.direction.multiplyScalar(.8),
  19129. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19130. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19131. this.lookAt(this.position.clone().add(this.direction))
  19132. }
  19133. }
  19134. ,
  19135. n.prototype.writeAstag = function() {
  19136. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19137. , t = new Date;
  19138. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19139. var i = {
  19140. enabled: !0,
  19141. version: "0",
  19142. created: t.toISOString(),
  19143. created_by: "APITest",
  19144. position: this.position.clone(),
  19145. stem: {
  19146. enabled: o.tags.pole.enabled,
  19147. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19148. },
  19149. label: "tag " + this.tagCount,
  19150. description: "Description " + e,
  19151. floor: function(e) {
  19152. if (e.currentFloor) {
  19153. var t = e.floors.indexOf(e.currentFloor);
  19154. return t > -1 ? t : void 0
  19155. }
  19156. }(this.player.model),
  19157. type: "info",
  19158. metadata: {
  19159. preferred_camera: {
  19160. mode: this.player.mode
  19161. }
  19162. }
  19163. };
  19164. console.log("--------------------------"),
  19165. console.log(JSON.stringify(i));
  19166. var n = this.player.model.addtag(e, i).build();
  19167. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19168. n.visible || n.show(o.tags.startup.fadeInDuration))
  19169. }
  19170. ,
  19171. t.exports = n
  19172. }
  19173. , {
  19174. "../enum/RenderLayers": 41,
  19175. "../enum/RenderOrder": 42,
  19176. "../settings": 166,
  19177. "../shaders": 167,
  19178. "../util/lerp": 188,
  19179. "../util/texture": 194,
  19180. "../util/transitions": 195,
  19181. three: 217
  19182. }],
  19183. 150: [function(e, t, i) {
  19184. "use strict";
  19185. function n(e, t) {
  19186. this.chunks = [],
  19187. this.floorId = e,
  19188. this.roomId = t,
  19189. this.position = new r.Vector3
  19190. }
  19191. var r = e("three");
  19192. n.prototype.addChunk = function(e) {
  19193. this.chunks.push(e)
  19194. }
  19195. ,
  19196. n.prototype.calcBoundaries = function() {
  19197. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  19198. var s = this.chunks[a]
  19199. , l = s.geometry.attributes.position;
  19200. if (l)
  19201. for (var c = 0; c < l.array.length; c += 3)
  19202. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19203. t.add(e),
  19204. 0 === c ? (i.copy(e),
  19205. n.copy(e)) : (i.max(e),
  19206. n.min(e)),
  19207. o++
  19208. }
  19209. o > 0 ? (t.multiplyScalar(1 / o),
  19210. this.average = t) : this.average = null,
  19211. this.boundsMax = i,
  19212. this.boundsMin = n,
  19213. this.center = new r.Vector3,
  19214. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19215. }
  19216. ,
  19217. t.exports = n
  19218. }
  19219. , {
  19220. three: 217
  19221. }],
  19222. 151: [function(e, t, i) {
  19223. (function(i) {
  19224. "use strict";
  19225. function n(e, t, i) {
  19226. this.obj3d = null,
  19227. this.nodes = [],
  19228. this.colorHull = [],
  19229. this.shortPaths = {},
  19230. this.floorHull = null,
  19231. this.cameraHull = null,
  19232. this.floorPathDistance = 0,
  19233. this.floorCurvePoints = null,
  19234. this.floorCurveColors = null,
  19235. this.camCurvePoints = null,
  19236. this.warpDestHeroLoc = null,
  19237. this.warpDestPano = null,
  19238. this.warpPathPoints = null,
  19239. this.warpPathLengths = [0],
  19240. this.warpLength = 0,
  19241. this.closeWarpDistance = 4,
  19242. this.UP = A.UP.clone(),
  19243. this.longestStep = 0,
  19244. this.upcomingTransType = null,
  19245. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19246. this.prevNextDist = 0,
  19247. this.nextI = 0,
  19248. this.activeTransType = null,
  19249. this.lastTransType = null,
  19250. this.bunnyObj = null,
  19251. this.director = e,
  19252. this.player = t,
  19253. this.playerControls = i,
  19254. this.modelManager = t.modelManager,
  19255. this.updateModel(),
  19256. this.updateDefaultsFromModelData(),
  19257. this.bindEvents(),
  19258. this.warping = !1,
  19259. this.waitingToWarp = !1,
  19260. this.warpInterrupted = !1,
  19261. this.warpInterruptionBlackoutStyle = null,
  19262. this.warpInterruptionTravelTime = null
  19263. }
  19264. var r = e("three")
  19265. , o = e("../util/logger")
  19266. , a = e("../enum/Viewmode")
  19267. , s = e("../enum/RenderOrder")
  19268. , l = e("../enum/WarpStyle")
  19269. , c = e("../settings")
  19270. , h = e("../util/math")
  19271. , u = e("../util/lerp")
  19272. , d = e("../util/easing")
  19273. , p = e("../util/transitions")
  19274. , f = e("../objects/Snapshot")
  19275. , g = e("../effects")
  19276. , m = e("../shaders")
  19277. , v = (e("../gui/gui"),
  19278. e("../util/texture"))
  19279. , A = e("../enum/Vectors")
  19280. , y = (e("../model/ModelManager"),
  19281. new o(i))
  19282. , C = e("../enum/PlayerEvents")
  19283. , I = e("../enum/BlackoutStyle")
  19284. , E = e("../enum/ModelManagerEvents")
  19285. , b = e("../constants")
  19286. , w = {
  19287. path: v.loadBase64("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"),
  19288. pathEnd: v.load("static/images/End.png"),
  19289. pathStart: v.loadBase64("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==")
  19290. };
  19291. n.prototype.setScene = function(e) {
  19292. this.createCpm(e),
  19293. this.createBunnyObj(e)
  19294. }
  19295. ,
  19296. n.prototype.updateModel = function() {
  19297. this.model = this.modelManager.getActiveModel()
  19298. }
  19299. ,
  19300. n.prototype.bindEvents = function() {
  19301. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19302. }
  19303. ,
  19304. n.prototype.updateDefaultsFromModelData = function() {
  19305. this.model.data
  19306. }
  19307. ,
  19308. n.prototype.pointPathDistance = function(e) {
  19309. for (var t = 0, i = 1; i < e.length; i += 1)
  19310. t += e[i - 1].distanceTo(e[i]);
  19311. return t
  19312. }
  19313. ,
  19314. n.prototype.pointPathLengths = function(e) {
  19315. for (var t = [0], i = 1; i < e.length; i += 1)
  19316. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19317. return t
  19318. }
  19319. ,
  19320. n.prototype.interpAlongPath = function(e, t, i) {
  19321. var n, o = new r.Vector3, a = t[t.length - 1];
  19322. if (i < 1) {
  19323. n = i * a;
  19324. for (var s = 1; s < t.length; s += 1)
  19325. if (t[s] > n) {
  19326. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19327. return o.copy(e[s]),
  19328. o.sub(e[s - 1]),
  19329. o.multiplyScalar(l),
  19330. o.add(e[s - 1]),
  19331. o
  19332. }
  19333. } else
  19334. o.copy(e[e.length - 1]);
  19335. return o
  19336. }
  19337. ,
  19338. n.prototype.pathHeight = function() {
  19339. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19340. }
  19341. ,
  19342. n.prototype.createBunnyObj = function(e) {
  19343. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19344. this.bunnyObj.visible = c.warp.showBunny),
  19345. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19346. e.add(this.bunnyObj)
  19347. }
  19348. ,
  19349. n.prototype.createCpm = function(e) {
  19350. if (!this.currentPanoMarker) {
  19351. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19352. t.material.uniforms.opacity.value = 0,
  19353. this.currentPanoMarker = {
  19354. mesh: t,
  19355. placed: !1
  19356. }
  19357. }
  19358. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19359. this.placeCpm(),
  19360. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19361. }
  19362. ,
  19363. n.prototype.placeCpm = function() {
  19364. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19365. var e = this.player.currentPano.floor;
  19366. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19367. e.add(this.currentPanoMarker.mesh)),
  19368. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19369. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19370. this.currentPanoMarker.placed = !0
  19371. } else
  19372. this.popOutCpm()
  19373. }
  19374. ,
  19375. n.prototype.fadeInCpm = function(e) {
  19376. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  19377. }
  19378. ,
  19379. n.prototype.fadeOutCpm = function(e) {
  19380. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19381. }
  19382. ,
  19383. n.prototype.popInCpm = function() {
  19384. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19385. }
  19386. ,
  19387. n.prototype.popOutCpm = function() {
  19388. this.fadeOutCpm(2)
  19389. }
  19390. ,
  19391. n.prototype.brushPrefs = {
  19392. linewidth: 7,
  19393. strokeWidth: 15,
  19394. cvSegments: 48,
  19395. paveStep: .1,
  19396. paveWidth: .2,
  19397. lookBlendDist: 3,
  19398. maxTurn: r.Math.degToRad(2)
  19399. },
  19400. n.prototype.panoPathDistance = function(e) {
  19401. var t = this.model.panos;
  19402. if (!e || e.length < 2)
  19403. return 0;
  19404. for (var i = [], n = 0; n < e.length; n += 1)
  19405. i.push(t.get(e[n]).floorPosition);
  19406. return this.pointPathDistance(i)
  19407. }
  19408. ,
  19409. n.prototype.loadTileTexture = function(e) {
  19410. var t = v.load(e, function(t) {
  19411. t.wrapS = r.RepeatWrapping,
  19412. t.wrapT = r.RepeatWrapping,
  19413. t.needsUpdate = !0,
  19414. y.debug('path texture "' + e + '" is ready')
  19415. }, function() {
  19416. y.error('path texture "' + e + '" failed')
  19417. });
  19418. return t.mapping = r.UVMapping,
  19419. t
  19420. }
  19421. ,
  19422. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19423. var a = {
  19424. cameraMode: n,
  19425. position: e,
  19426. quaternion: t,
  19427. panoId: i,
  19428. orthoZoom: o,
  19429. floorVisibility: r,
  19430. thumbUrl: null,
  19431. name: null
  19432. };
  19433. return new f(a)
  19434. }
  19435. ,
  19436. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19437. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19438. }
  19439. ,
  19440. n.prototype.setWarpDestination = function(e) {
  19441. this.warpDestHeroLoc = e
  19442. }
  19443. ,
  19444. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19445. var t = this.getHeroDescriptorByHeroIndex(e);
  19446. return null !== t && (this.setWarpDestination(t),
  19447. !0)
  19448. }
  19449. ,
  19450. n.prototype.setWarpDestinationByPano = function(e, t) {
  19451. var i = this.model.panos.get(e.id);
  19452. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19453. }
  19454. ,
  19455. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19456. var i = this.model.panos.get(e);
  19457. if (i) {
  19458. t = t || new r.Quaternion;
  19459. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19460. return this.setWarpDestination(n),
  19461. !0
  19462. }
  19463. return !1
  19464. }
  19465. ,
  19466. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19467. var t = this.model.heroCount();
  19468. /* if (null !== this.warpDestHeroLoc && t < 2)
  19469. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19470. this.model.getHeroDescriptorByIndex(0); */
  19471. var i = this.model.getHeroDescriptorByIndex(e);
  19472. if (i) {
  19473. var n = i.isPano() ? i.panoId : i.cameraMode;
  19474. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19475. }
  19476. return i
  19477. }
  19478. ,
  19479. n.prototype.getHeroDescriptorByPano = function(e) {
  19480. var t = this.model.panos.get(e.id);
  19481. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19482. }
  19483. ,
  19484. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19485. var t = this.getHeroIndexFromPanoId(e);
  19486. return this.getHeroDescriptorByHeroIndex(t)
  19487. }
  19488. ,
  19489. n.prototype.getHeroIndexFromPanoId = function(e) {
  19490. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19491. var i = this.model.heroLocations[t]
  19492. , n = this.getHeroId(i);
  19493. if (n && n === e)
  19494. return t
  19495. }
  19496. return -1
  19497. }
  19498. ,
  19499. n.prototype.getHeroPano = function(e) {
  19500. if (null === e)
  19501. return y.warn("getHeroPano(): no destination"),
  19502. null;
  19503. var t = this.getHeroId(e)
  19504. , i = this.model.panos.get(t);
  19505. return void 0 === i && (i = null,
  19506. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19507. i
  19508. }
  19509. ,
  19510. n.prototype.getHeroId = function(e) {
  19511. return e.panoId
  19512. }
  19513. ,
  19514. n.prototype.setWarpDestPano = function() {
  19515. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19516. this.warpDestPano
  19517. }
  19518. ,
  19519. n.prototype.brushToWarpPano = function(e, t) {
  19520. if (this.discardPathObject(),
  19521. !this.setWarpDestPano())
  19522. return !1;
  19523. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19524. !this.warpDestPano)
  19525. return y.info("No brush"),
  19526. !1;
  19527. if (!this.player.currentPano)
  19528. return y.debug("No current pano, visibility undefined"),
  19529. !1;
  19530. if (!this.warpDestPano)
  19531. return y.info("No wPano, visibility undefined"),
  19532. !1;
  19533. if (!this.warpDestPano.isAligned())
  19534. return y.debug("Cannot brush to unaligned pano"),
  19535. !1;
  19536. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19537. , n = !0;
  19538. if (this.player.currentPano.id === this.warpDestPano.id)
  19539. y.debug("Already at destination pano");
  19540. else {
  19541. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19542. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19543. this.obj3d = new r.Object3D,
  19544. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19545. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19546. e = t) : (this.setPathHulls(this.nodes),
  19547. this.setFloorCurves(),
  19548. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19549. this.player.currentPano.floor.add(this.obj3d);
  19550. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19551. , s = e === l.STD;
  19552. if (!n && (i || s)) {
  19553. if (o) {
  19554. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19555. this.obj3d.add(h)
  19556. }
  19557. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19558. this.obj3d.add(u)
  19559. }
  19560. this.appearSlow()
  19561. }
  19562. return this.upcomingTransType = e,
  19563. !n
  19564. }
  19565. ,
  19566. n.prototype.findShortestPath = function(e, t) {
  19567. if (!e || !t)
  19568. return null;
  19569. var i = c.warp.walkExtraPanosDistance
  19570. , n = e.id + ":" + t.id + ":" + i;
  19571. if (this.shortPaths.hasOwnProperty(n))
  19572. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19573. var r = t.id + ":" + e.id + ":" + i;
  19574. if (this.shortPaths.hasOwnProperty(r))
  19575. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19576. var o = this.model.panos.aStarSearch(e, t);
  19577. return this.model.panos.includeNodesNearPath(o, i),
  19578. this.shortPaths[n] = o ? o.slice() : null,
  19579. o
  19580. }
  19581. ,
  19582. n.prototype.makePathHulls = function(e) {
  19583. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19584. t = u.get(e[0]),
  19585. r = t.floor.floorIndex;
  19586. for (var d = 0; d < e.length; d += 1)
  19587. t = u.get(e[d]),
  19588. i = t.floorPosition.clone().sub(this.model.position),
  19589. i.y += this.pathHeight(),
  19590. s.push(i),
  19591. l.push(t.position.clone()),
  19592. n = t.floor.floorIndex,
  19593. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19594. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19595. o > a && (a = o));
  19596. return a > this.longestStep && (this.longestStep = a,
  19597. y.debug("path contains " + a + " meter segment")),
  19598. {
  19599. floor: s,
  19600. camera: l,
  19601. color: h
  19602. }
  19603. }
  19604. ,
  19605. n.prototype.makeFloorCurves = function(e, t, i) {
  19606. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19607. , o = this.pointPathDistance(e) - 2 * n
  19608. , s = e.slice(0)
  19609. , l = s[1].clone().sub(s[0]);
  19610. l.y = 0,
  19611. l.normalize().multiplyScalar(n),
  19612. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19613. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19614. l.y = 0,
  19615. l.normalize().multiplyScalar(n),
  19616. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19617. var h = new r.CatmullRomCurve3(s)
  19618. , u = Math.floor(o / i);
  19619. u = 4 * Math.floor(u / 4),
  19620. u = Math.max(4, u);
  19621. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19622. f = 0,
  19623. d = g[A].distanceTo(e[0]);
  19624. for (var y = 1; y < e.length; y += 1)
  19625. v.copy(g[A]).sub(e[y]),
  19626. v.y *= 4,
  19627. p = v.length(),
  19628. p < d && (f = y);
  19629. m.push(t[f])
  19630. }
  19631. return {
  19632. distance: o,
  19633. points: g,
  19634. colors: m
  19635. }
  19636. }
  19637. ,
  19638. n.prototype.makeCameraCurvePoints = function(e, t) {
  19639. var i = this.pointPathDistance(e)
  19640. , n = new r.CatmullRomCurve3(e);
  19641. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19642. }
  19643. ,
  19644. n.prototype.makeCameraCurveTangents = function(e, t) {
  19645. var i = this.pointPathDistance(e)
  19646. , n = new r.CatmullRomCurve3(e)
  19647. , o = Math.max(2, Math.floor(i / t));
  19648. o || (o = 5);
  19649. for (var a = [], s = 0; s <= o; s++)
  19650. a.push(n.getTangentAt(s / o));
  19651. return a
  19652. }
  19653. ,
  19654. n.prototype.setPathHulls = function(e) {
  19655. var t = this.makePathHulls(e);
  19656. this.floorHull = t.floor,
  19657. this.cameraHull = t.camera,
  19658. this.colorHull = t.color
  19659. }
  19660. ,
  19661. n.prototype.setFloorCurves = function() {
  19662. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19663. this.floorPathDistance = e.distance,
  19664. this.floorCurvePoints = e.points,
  19665. this.floorCurveColors = e.colors
  19666. }
  19667. ,
  19668. n.prototype.setCameraCurvePoints = function() {
  19669. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19670. }
  19671. ,
  19672. n.prototype.chooseWarpPath = function(e) {
  19673. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19674. if (this.player.currentPano === this.warpDestPano || !e)
  19675. return this.warpPathPoints = null,
  19676. this.warpLength = 0,
  19677. !1;
  19678. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19679. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19680. t = this.warpDestPano.position.clone().sub(o.position),
  19681. i = t.clone().negate(),
  19682. t.multiplyScalar(.15).add(o.position),
  19683. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19684. t.y = o.position.y,
  19685. i.y = this.warpDestPano.position.y,
  19686. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19687. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19688. this.setCameraCurvePoints(),
  19689. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19690. this.warpLength = 0,
  19691. this.warpPathLengths = [0];
  19692. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  19693. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19694. var p = s.length();
  19695. s.y *= c.warp.climbEffort;
  19696. var f = s.length() / p;
  19697. if (d > 1) {
  19698. s.setY(0).normalize(),
  19699. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19700. var g = Math.min(1, s.dot(l))
  19701. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19702. f = Math.max(m, f)
  19703. }
  19704. this.warpLength += p * f,
  19705. this.warpPathLengths[d] = this.warpLength
  19706. }
  19707. return !0
  19708. }
  19709. ,
  19710. n.prototype.drawPathRibbon = function(e, t) {
  19711. this.bunnyObj.visible = c.warp.showBunny;
  19712. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  19713. h.copy(e[u]),
  19714. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19715. h.normalize(),
  19716. n.crossVectors(h, A.UP),
  19717. n.multiplyScalar(i);
  19718. var d = (new r.Vector3).copy(e[u]).add(o);
  19719. d.sub(n),
  19720. l.vertices.push(d),
  19721. d = (new r.Vector3).copy(e[u]).add(o),
  19722. d.add(n),
  19723. l.vertices.push(d)
  19724. }
  19725. var p, f = 0;
  19726. for (u = 0; u < e.length - 1; u += 1) {
  19727. var g = 2 * u
  19728. , v = f;
  19729. f += e[u + 1].distanceTo(e[u]);
  19730. var y = f
  19731. , C = t[u]
  19732. , I = t[u + 1];
  19733. p = new r.Face3(g,g + 1,g + 2),
  19734. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19735. l.faces.push(p),
  19736. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19737. p = new r.Face3(g + 2,g + 1,g + 3),
  19738. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19739. l.faces.push(p),
  19740. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19741. }
  19742. l.computeFaceNormals(),
  19743. l.computeVertexNormals();
  19744. var E, b;
  19745. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19746. b.map.value = w.path,
  19747. b.opacity.value = 0,
  19748. b.color.value.set(c.path.color),
  19749. E = new r.RawShaderMaterial({
  19750. side: r.DoubleSide,
  19751. depthWrite: !1,
  19752. transparent: !0,
  19753. vertexShader: m.ribbon.vertexShader,
  19754. fragmentShader: m.ribbon.fragmentShader,
  19755. uniforms: b,
  19756. name: "ribbonT",
  19757. opacity: 0
  19758. })) : E = new r.MeshBasicMaterial({
  19759. color: 16777215,
  19760. side: r.DoubleSide,
  19761. name: "ribbonOut",
  19762. vertexColors: r.VertexColors
  19763. });
  19764. var _ = new r.Mesh(l,E);
  19765. return _.name = "ribbon",
  19766. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19767. _
  19768. }
  19769. ,
  19770. n.prototype.drawPathPavement = function(e) {
  19771. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19772. s.copy(e[l]),
  19773. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19774. s.normalize(),
  19775. n.crossVectors(s, A.UP),
  19776. n.multiplyScalar(this.brushPrefs.paveWidth),
  19777. t = (new r.Vector3).copy(e[l]),
  19778. t.sub(n),
  19779. o.vertices.push(t),
  19780. o.vertices.push((new r.Vector3).copy(e[l])),
  19781. t = (new r.Vector3).copy(e[l]),
  19782. t.add(n),
  19783. o.vertices.push(t);
  19784. var h, u, d;
  19785. for (l = 0; l < e.length - 1; l += 1)
  19786. h = 3 * l + 1,
  19787. u = l * i,
  19788. d = u + i,
  19789. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19790. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19791. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19792. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19793. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19794. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19795. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19796. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19797. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19798. color: c.path.color,
  19799. side: r.DoubleSide,
  19800. transparent: !0,
  19801. depthWrite: !1,
  19802. opacity: 0,
  19803. name: "paveT",
  19804. map: w.path
  19805. }) : new r.MeshBasicMaterial({
  19806. color: c.path.color,
  19807. side: r.DoubleSide,
  19808. transparent: !0,
  19809. depthWrite: !1,
  19810. opacity: 1,
  19811. name: "paveO",
  19812. map: w.path
  19813. });
  19814. return new r.Mesh(o,p)
  19815. }
  19816. ,
  19817. n.prototype.hintPrefs = {
  19818. rad: .18,
  19819. width: .0125,
  19820. depth: .0625,
  19821. setBack: -.04,
  19822. markRad: .25,
  19823. markInnerRad: .16
  19824. },
  19825. n.prototype.makeWaypointObj = function(e, t) {
  19826. var i = new r.Geometry
  19827. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19828. , o = this.pathHeight();
  19829. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  19830. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19831. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19832. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19833. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19834. s.map.value = e,
  19835. s.opacity.value = 0,
  19836. s.color.value.set(c.path.color);
  19837. var l = {
  19838. side: r.DoubleSide,
  19839. depthWrite: !1,
  19840. transparent: !0,
  19841. vertexShader: m.waypoint.vertexShader,
  19842. fragmentShader: m.waypoint.fragmentShader,
  19843. uniforms: s,
  19844. name: "waypoint",
  19845. opacity: 0
  19846. };
  19847. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19848. l.name = "wayPtOut");
  19849. var h = new r.RawShaderMaterial(l)
  19850. , u = new r.Mesh(i,h);
  19851. return u.name = t,
  19852. u
  19853. }
  19854. ,
  19855. n.prototype.makeStartMarker = function(e, t) {
  19856. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19857. i.y = 0,
  19858. i.normalize();
  19859. var n = Math.acos(i.x)
  19860. , o = this.makeWaypointObj(w.pathStart, "Start");
  19861. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19862. o.position.copy(e),
  19863. o
  19864. }
  19865. ,
  19866. n.prototype.makeEndMarker = function(e) {
  19867. var t = this.makeWaypointObj(w.pathEnd, "End")
  19868. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19869. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19870. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19871. t.position.copy(e),
  19872. t
  19873. }
  19874. ,
  19875. n.prototype.pathClean = function(e) {
  19876. if (e) {
  19877. for (var t in e.children)
  19878. this.pathClean(e.children[t]);
  19879. e.geometry && e.geometry.dispose(),
  19880. e.material && e.material.dispose()
  19881. }
  19882. }
  19883. ,
  19884. n.prototype.discardPathObject = function() {
  19885. if (this.obj3d) {
  19886. var e = this.obj3d.parent;
  19887. e && e.remove(this.obj3d),
  19888. this.pathClean(this.obj3d)
  19889. }
  19890. this.obj3d = null,
  19891. this.popInCpm()
  19892. }
  19893. ,
  19894. n.prototype.discardSlow = function() {
  19895. if (this.obj3d) {
  19896. if (this.player.mode !== a.PANORAMA)
  19897. return void this.discardPathObject();
  19898. for (var e, t = this, i = 0, n = function() {
  19899. this.discardPathObject()
  19900. }
  19901. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19902. e = t.obj3d.children[r],
  19903. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  19904. i += 1,
  19905. n = null);
  19906. 0 === i && this.discardPathObject(),
  19907. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19908. }
  19909. }
  19910. ,
  19911. n.prototype.appearSlow = function() {
  19912. var e, t = this;
  19913. this.fadeOutCpm(c.path.fadeInTime);
  19914. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19915. e = t.obj3d.children[n],
  19916. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  19917. }
  19918. ,
  19919. n.prototype.update = function() {
  19920. this.obj3d && this.obj3d.updateMatrixWorld()
  19921. }
  19922. ,
  19923. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  19924. var t = r.Math.degToRad(c.warp.burnsAngle);
  19925. if (this.player.mode === a.PANORAMA) {
  19926. var i = this.burnsDir * t;
  19927. if (this.upcomingTransType === l.BLACK)
  19928. return i;
  19929. var n = e;
  19930. if (null === n)
  19931. return y.warn("Transition request for non-highlight"),
  19932. i;
  19933. var o = this.getHeroDescriptorByHeroIndex(n);
  19934. if (null === o)
  19935. return i;
  19936. if (!o.isPano())
  19937. return i;
  19938. var s = this.getHeroPano(o)
  19939. , h = this.playerControls.cameras[a.PANORAMA]
  19940. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19941. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19942. , p = function(e) {
  19943. var i = Math.acos(Math.min(1, e.dot(u)))
  19944. , n = (new r.Vector3).crossVectors(u, e);
  19945. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19946. };
  19947. if (s === this.player.currentPano)
  19948. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19949. var f = this.findShortestPath(this.player.currentPano, s);
  19950. if (void 0 === f || null === f || f.length < 1)
  19951. return y.debug("Empty path ahead..."),
  19952. i;
  19953. var g = this.makePathHulls(f)
  19954. , m = new r.CatmullRomCurve3(g.camera)
  19955. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19956. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19957. }
  19958. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19959. }
  19960. ,
  19961. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19962. var i = (time==void 0)? c.warp.tourStepDelay : time;
  19963. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19964. var n = new r.Euler
  19965. , o = new r.Vector3;
  19966. y.debug("Starting wait: " + (void 0 !== t));
  19967. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  19968. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  19969. , h = function() {
  19970. this.endWarpState(),
  19971. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19972. t && t()
  19973. }
  19974. .bind(this)
  19975. , u = function(e, t) {
  19976. if (this.warpInterrupted)
  19977. return h(),
  19978. !0;
  19979. var r = t || 1e3 / 60;
  19980. if (c.warp.doBurns && !currentLocation.dontRot )
  19981. if (this.player.mode === a.PANORAMA) {
  19982. var l = this.playerControls.cameras[a.PANORAMA];
  19983. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19984. var u = i == 0 ? s : r * s / i;
  19985. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  19986. n.y += u,
  19987. o.set(0, 0, -1),
  19988. o.applyEuler(n),
  19989. o.add(l.position),
  19990. l.controls.lookAt(o),
  19991. l.controls.lookVector.copy(o)
  19992. ,l.lookAt(o)
  19993. } else
  19994. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19995. }
  19996. .bind(this);
  19997. this.startWarpState(),
  19998. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19999. }
  20000. ,
  20001. n.prototype.warpToNonPano = function(e) {
  20002. if (this.discardPathObject(),
  20003. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20004. var t = function() {
  20005. e && e()
  20006. }
  20007. .bind(this);
  20008. this.player.flyToNewMode({
  20009. mode: this.warpDestHeroLoc.cameraMode,
  20010. duration: c.warp.outsideTime,
  20011. warpDest: this.warpDestHeroLoc,
  20012. callback: t,
  20013. force: !0
  20014. })
  20015. } else
  20016. y.warn("no warp destination!!!"),
  20017. e && e()
  20018. }
  20019. ,
  20020. n.prototype._resetWarpShaderParams = function(e) {//
  20021. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20022. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20023. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20024. delete e.material.defines.newBlack;
  20025. e.material.needsUpdate = true
  20026. } */
  20027. }
  20028. ,
  20029. n.prototype._clearWarpShading = function() {
  20030. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20031. this._resetWarpShaderParams(e[t]),
  20032. e[t].visible = !0;
  20033. this._resetWarpShaderParams(this.model.skybox)
  20034. }
  20035. ,
  20036. n.prototype._warpStopFlying = function() {
  20037. this.activeTransType = null,
  20038. this.placeCpm()
  20039. }
  20040. ,
  20041. n.prototype._wrapupTravelOnlyBits = function() {
  20042. this._warpStopFlying(),
  20043. this.warpPathPoints && (this.player.currentPano.exit(),
  20044. this.warpDestPano.enter(),
  20045. this.player.currentPano = this.warpDestPano),
  20046. this.player.spider.draw(),
  20047. this.placeCpm()
  20048. }
  20049. ,
  20050. n.prototype._wrapupTravel = function(e) {
  20051. this._wrapupTravelOnlyBits(),
  20052. this.warpCameraAim(e)
  20053. }
  20054. ,
  20055. n.prototype._wrapupWarpShading = function(e) {
  20056. this._clearWarpShading(),
  20057. this._wrapupTravel(e)
  20058. }
  20059. ,
  20060. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20061. t !== I.END && this._clearWarpShading(),
  20062. this._wrapupTravelOnlyBits(),
  20063. this.upcomingTransType = null,
  20064. e && e()
  20065. }
  20066. ,
  20067. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20068. var i = this.warpDestHeroLoc.quaternion
  20069. , n = this.playerControls.cameras[a.PANORAMA]
  20070. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20071. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20072. , l = s.dot(o)
  20073. , u = r.Math.radToDeg(Math.acos(l))
  20074. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20075. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20076. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20077. m.y = h.constrainedTurn(m.y),
  20078. this.burnsDir = Math.sign(m.y);
  20079. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20080. , A = new r.Vector3
  20081. , C = function(e, t) {
  20082. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20083. v.y = g.y + e * m.y,
  20084. v.z = g.z + e * m.z,
  20085. A.set(0, 0, -1),
  20086. A.applyEuler(v),
  20087. A.add(n.position),
  20088. n.controls.lookAt(A),
  20089. n.controls.lookVector.copy(A),
  20090. void n.lookAt(A))
  20091. }
  20092. .bind(this);
  20093. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20094. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20095. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20096. ):
  20097. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20098. ,void (t && t())
  20099. ) */
  20100. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20101. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20102. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20103. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20104. ,void (t && t())
  20105. )
  20106. }
  20107. ,
  20108. n.prototype._warpBendAim = function(e, t, i, n) {
  20109. var o = n || 0
  20110. , s = this.playerControls.cameras[a.PANORAMA]
  20111. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20112. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20113. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20114. f.y = h.constrainedTurn(f.y);
  20115. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20116. f.x = g * Math.sign(f.x),
  20117. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20118. this.burnsDir = Math.sign(f.y),
  20119. g *= Math.sign(f.y),
  20120. f.y = g;
  20121. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20122. , v = new r.Vector3
  20123. , A = function(e, t) {
  20124. if (e < .5)
  20125. m.x = u.x + e * f.x,
  20126. m.y = u.y + e * f.y,
  20127. m.z = u.z + e * f.z;
  20128. else {
  20129. var i = (1 - e) * c.warp.softBendEnd;
  20130. m.x = l.x - i * f.x,
  20131. m.y = l.y - i * f.y,
  20132. m.z = l.z - i * f.z
  20133. }
  20134. v.set(0, 0, -1),
  20135. v.applyEuler(m),
  20136. v.add(s.position);
  20137. s.controls.lookAt(v),
  20138. s.controls.lookVector.copy(v),
  20139. s.lookAt(v);
  20140. }
  20141. .bind(this);
  20142. if(momentTourBlackNewType){
  20143. A(1)
  20144. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20145. }
  20146. ,
  20147. n.prototype._warpStepCameraAim = function(e, t, i) {
  20148. var n = this.playerControls.cameras[a.PANORAMA]
  20149. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20150. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20151. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20152. l.y = h.constrainedTurn(l.y),
  20153. this.burnsDir = Math.sign(l.y);
  20154. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20155. , f = new r.Vector3
  20156. , g = function(e, t) {
  20157. e < .5 ? u.copy(s) : u.copy(o),
  20158. f.set(0, 0, -1),
  20159. f.applyEuler(u),
  20160. f.add(n.position),
  20161. n.controls.lookAt(f),
  20162. n.controls.lookVector.copy(f),
  20163. n.lookAt(f)
  20164. }
  20165. .bind(this);
  20166. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20167. }
  20168. ,
  20169. n.prototype.setBurnsDir = function() {
  20170. var e = this.playerControls.cameras[a.PANORAMA]
  20171. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20172. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20173. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20174. n.y = h.constrainedTurn(n.y),
  20175. this.burnsDir = Math.sign(n.y)
  20176. }
  20177. ,
  20178. n.prototype.stepWarpPath = function(firstPos, e ) {
  20179. var i = this.playerControls.cameras[a.PANORAMA];
  20180. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20181. if (!n){
  20182. return i.position.copy(this.warpDestPano.position),
  20183. !0;
  20184. }
  20185. /* if (!this.warpPathPoints)
  20186. return i.position.copy(this.warpDestPano.position),
  20187. !0;
  20188. var n = this.warpPathPoints[0] */
  20189. var o = this.warpDestPano.position;
  20190. /* console.log(firstPos)
  20191. console.log(o) */
  20192. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20193. var s = new r.Vector3;
  20194. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  20195. i.position.copy(s)
  20196. } else
  20197. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20198. }
  20199. ,
  20200. n.prototype.interruptAndFastForward = function(e, t) {
  20201. this.warping && (this.warpInterrupted = !0,
  20202. this.warpInterruptionBlackoutStyle = e,
  20203. this.warpInterruptionTravelTime = t,
  20204. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20205. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20206. }
  20207. ,
  20208. n.prototype.warpCameraAim = function(e) {
  20209. var t = c.warp.minWarpTime;
  20210. if (this.upcomingTransType === l.BLACK)
  20211. t = c.warp.teleportTime;
  20212. else {
  20213. var i = this.playerControls.cameras[a.PANORAMA]
  20214. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20215. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20216. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20217. s.y = h.constrainedTurn(s.y);
  20218. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20219. t = Math.max(t, u)
  20220. }
  20221. var d = function() {
  20222. this._warpStopFlying(),
  20223. this.discardSlow(),
  20224. e && e()
  20225. }
  20226. .bind(this);
  20227. this._warpCameraAim(t, d)
  20228. }
  20229. ,
  20230. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20231. this.model.skybox.material.uniforms.blackout.value = n;
  20232. var r = u.uniform(this.model.skybox, "progress", 1)
  20233. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20234. , a = !1
  20235. , s = function() {
  20236. if (this.warpInterrupted)
  20237. return a = !0,
  20238. !0
  20239. }
  20240. .bind(this)
  20241. , l = function(e, t) {
  20242. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20243. !0) : void r(e, t)
  20244. }
  20245. .bind(this)
  20246. , h = function(e, t) {
  20247. return i && a ? (o(0),
  20248. !0) : void o(e, t)
  20249. }
  20250. .bind(this);
  20251. p.start(s, e, null, t, null, "safeHaltWatch"),
  20252. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20253. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20254. }
  20255. ,
  20256. n.prototype.warpTravel_STD = function(e) {
  20257. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  20258. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  20259. w += this.warpLength * c.warp.timePerMeter,
  20260. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20261. var _ = !1
  20262. , T = this.warpDestHeroLoc.quaternion
  20263. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20264. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20265. , M = S.dot(x)
  20266. , R = r.Math.radToDeg(Math.acos(M))
  20267. , P = function(e) {
  20268. var t = o
  20269. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20270. return i
  20271. }
  20272. , O = function() {
  20273. return E.lookAt(C, t, A.UP),
  20274. s.setFromRotationMatrix(E, c.warp.eOrder),
  20275. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20276. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20277. h.constrainedTurn(b.y)
  20278. }
  20279. .bind(this)
  20280. , L = function(e, t) {
  20281. if (this.warpInterrupted)
  20282. return _ = !0,
  20283. !0
  20284. }
  20285. .bind(this)
  20286. , D = function(e, t) {
  20287. return _ || !this.warpPathPoints ? (g.blur(0),
  20288. !0) : void g.blur(e)
  20289. }
  20290. .bind(this)
  20291. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20292. , B = function(e, t) {
  20293. return _ || !this.warpPathPoints ? (N(0),
  20294. !0) : void N(e, t)
  20295. }
  20296. .bind(this)
  20297. , F = function(e, t) {
  20298. if (!this.warpPathPoints)
  20299. return n.position.copy(this.warpDestPano.position),
  20300. !0;
  20301. if (_)
  20302. return !0;
  20303. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20304. n.position.copy(i),
  20305. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20306. }
  20307. .bind(this)
  20308. , V = function(e, n) {
  20309. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20310. !0)
  20311. }
  20312. .bind(this)
  20313. , U = function(e, o) {
  20314. if (_)
  20315. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20316. !0;
  20317. if (!this.warpPathPoints)
  20318. return !0;
  20319. var a = this.warpLength * e
  20320. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20321. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20322. c.warp.matchCam && (l *= 1 - u),
  20323. E.lookAt(C, t, A.UP),
  20324. s.setFromRotationMatrix(E, c.warp.eOrder),
  20325. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20326. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20327. b.y = h.constrainedTurn(b.y),
  20328. s.x = m.x + l * b.x,
  20329. s.y = m.y + l * b.y,
  20330. s.z = m.z + l * b.z,
  20331. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20332. b.y = h.constrainedTurn(b.y);
  20333. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20334. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20335. v.x = v.x + b.x * c.warp.turnFriction,
  20336. v.y = v.y + b.y * c.warp.turnFriction,
  20337. v.z = v.z + b.z * c.warp.turnFriction,
  20338. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20339. var p = t.clone().sub(C).normalize();
  20340. if (R < c.warp.maxAimRotation && u > 0) {
  20341. var g = 1 - u;
  20342. p.x = p.x * g + u * S.x,
  20343. p.y = p.y * g + u * S.y,
  20344. p.z = p.z * g + u * S.z,
  20345. p.normalize()
  20346. }
  20347. this.bunnyObj.position.copy(n.position).add(p),
  20348. f.set(0, 0, -1).applyEuler(v).normalize(),
  20349. f.multiplyScalar(8),
  20350. f.add(n.position),
  20351. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20352. n.controls.lookVector.copy(f),
  20353. n.lookAt(f))
  20354. }
  20355. .bind(this)
  20356. , k = function() {
  20357. _ ? (this.discardSlow(),
  20358. this.upcomingTransType = l.BLACK,
  20359. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20360. }
  20361. .bind(this);
  20362. V(0);
  20363. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  20364. w += H;
  20365. var G = H / w;
  20366. this.warpCommonParameters(w, G, !0, I.NONE),
  20367. p.start(L, w, null, 0, null, "_haltWatcher"),
  20368. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  20369. p.start(D, w, null, G, P, "blurring")),
  20370. p.start(B, w, null, G, P, "modelAlpha"),
  20371. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20372. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20373. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20374. }
  20375. ,
  20376. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20377. var r = e || 0;
  20378. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  20379. //add
  20380. var done = ()=>{
  20381. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20382. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  20383. }
  20384. if(momentTourBlackNewType){
  20385. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  20386. var camera = this.playerControls.cameras[a.PANORAMA];
  20387. var end = this.warpDestHeroLoc.position
  20388. camera.position.copy(end)
  20389. setTimeout(()=>{
  20390. player.sceneRenderer.effects.transitionMaskPass.stop()
  20391. this.wrapupWarpShadingOnly(n, i);
  20392. done()
  20393. },t)
  20394. }else{
  20395. var o = function() {
  20396. this.wrapupWarpShadingOnly(n, i);
  20397. done()
  20398. }
  20399. .bind(this);
  20400. var firstPos = this.player.position.clone()//add
  20401. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20402. }
  20403. this.warpCommonParameters(t, r, !1, i)
  20404. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  20405. if(window.momentTourBlackNewType){
  20406. e.material.uniforms.blackout.value = 5//i 改
  20407. //e.material.defines.newBlack = ''
  20408. //e.material.needsUpdate = true
  20409. }else{
  20410. e.material.uniforms.blackout.value = i
  20411. }
  20412. }),
  20413. this._warpBendAim(null, t, null, r);
  20414. }
  20415. ,
  20416. n.prototype.flightStepWalk = function(e, t, i) {
  20417. var n = .001
  20418. , o = 1
  20419. , a = 1.2
  20420. , s = new r.Vector3
  20421. , h = new r.Vector3
  20422. , u = function(e, t) {
  20423. //导览速度
  20424. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20425. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20426. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  20427. h.copy(A.FORWARD),
  20428. this.player.getDirection(h),
  20429. s.copy(t).sub(e.position).normalize();
  20430. var l = s.dot(h)
  20431. , u = Math.acos(l)
  20432. , d = u / r;
  20433. d > n && (r *= d / n,
  20434. u < o && (r *= a))
  20435. return r / DATA.tourWalkSpeed * 100 // 改
  20436. };
  20437. return function(e, t, i) {
  20438. if (this.warpInterrupted)
  20439. i && i();
  20440. else if (this.activeTransType !== l.WALK)
  20441. this._clearWarpShading(),
  20442. this._warpStopFlying(),
  20443. this.player.spider.draw(),
  20444. this.placeCpm(),
  20445. i && i();
  20446. else if (this.player.currentPano !== e) {
  20447. var n = {
  20448. pano: e,
  20449. lookAtPoint: t,
  20450. duration: null,
  20451. maxDistanceOverride: c.warp.walkMaxDist,
  20452. skipWarpingCheck: !1,
  20453. constantMoveSpeed: !0
  20454. };
  20455. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20456. n.zoomLevel = this.warpDestHeroLoc.zoom
  20457. }
  20458. n.duration = u.call(this, e, t),
  20459. this.player.nonInterruptingFlyToPano(n, i)
  20460. } else
  20461. i && i()
  20462. }
  20463. }(),
  20464. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20465. return this.flightStepWalk.bind(this, e, t, i)
  20466. }
  20467. ,
  20468. n.prototype.warpTravel_WALK = function() {
  20469. var e = [];
  20470. return function(t) {
  20471. var i = this.player.model.panos;
  20472. e.length = 0;
  20473. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20474. var s = this.nodes[a]
  20475. , l = i.get(s);
  20476. a === this.nodes.length - 1;
  20477. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20478. n && o || (e.push(s),
  20479. n = l)
  20480. }
  20481. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20482. var h = e.length
  20483. , u = i.get(e[h - 1])
  20484. , d = new Array(h + 1);
  20485. d[d.length - 1] = function() {
  20486. t && t()
  20487. }
  20488. .bind(this);
  20489. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20490. var g = e[p];
  20491. u = i.get(g);
  20492. var m = new r.Vector3;
  20493. this.getLookAtForWalkingTourNode(e, p, m),
  20494. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20495. p--
  20496. }
  20497. d[0]()
  20498. }
  20499. }(),
  20500. n.prototype.getLookAtForWalkingTourNode = function() {
  20501. var e = new r.Vector3
  20502. , t = new r.Vector3
  20503. , i = new r.Vector3
  20504. , n = new r.Vector3
  20505. , o = new r.Vector3
  20506. , a = .65
  20507. , s = .75
  20508. , l = .2
  20509. , c = .4
  20510. , h = .2
  20511. , u = 3;
  20512. return function(r, d, p) {
  20513. var f = r.length;
  20514. if (d >= f)
  20515. return !1;
  20516. var g = 1
  20517. , m = 1;
  20518. t.set(0, 0, 0),
  20519. o.set(0, 0, 0);
  20520. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20521. if (v = this.player.model.panos.get(r[A]),
  20522. this.getOrientationForWalkingTourNode(r, A, i),
  20523. A === d && e.copy(i),
  20524. n.copy(i),
  20525. A > d) {
  20526. var y = n.dot(e) < a;
  20527. g *= y ? l : s,
  20528. m *= y ? h : c
  20529. }
  20530. i.multiplyScalar(g),
  20531. t.add(i),
  20532. o.lerp(v.position, m)
  20533. }
  20534. return t.normalize(),
  20535. p.copy(o),
  20536. p.add(t),
  20537. !0
  20538. }
  20539. }(),
  20540. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20541. var n = e.length;
  20542. if (t >= n)
  20543. return !1;
  20544. if (t === n - 1)
  20545. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20546. else {
  20547. var r = this.player.model.panos.get(e[t])
  20548. , o = this.player.model.panos.get(e[t + 1]);
  20549. i.copy(o.position).sub(r.position)
  20550. }
  20551. return i.normalize(),
  20552. !0
  20553. }
  20554. ,
  20555. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20556. if (this.activeTransType = this.upcomingTransType,
  20557. this.lastTransType = this.activeTransType,
  20558. this.upcomingTransType = null,
  20559. !e) {
  20560. var r = function() {
  20561. this._wrapupTravel(n)
  20562. }
  20563. .bind(this)
  20564. , o = {
  20565. pano: this.warpDestPano,
  20566. lookAtPoint: null,
  20567. duration: null,
  20568. maxDistanceOverride: null,
  20569. skipWarpingCheck: !1
  20570. };
  20571. return void this.player.flyToPano(o, r)
  20572. }
  20573. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20574. this._clearWarpShading(),
  20575. this._warpStopFlying(),
  20576. this.player.spider.draw(),
  20577. this.placeCpm(),
  20578. n && n()
  20579. }
  20580. .bind(this)) : this.warpTravel_STD(n)
  20581. }
  20582. ,
  20583. n.prototype.startWarpState = function() {
  20584. this.warping = !0,
  20585. this.warpInterrupted = !1,
  20586. this.warpInterruptionBlackoutStyle = null,
  20587. this.warpInterruptionTravelTime = null
  20588. }
  20589. ,
  20590. n.prototype.endWarpState = function() {
  20591. this.warping = !1
  20592. }
  20593. ,
  20594. n.prototype.warpToPano = function(e, t, i, n) {
  20595. if (this.warping)
  20596. return void y.warn("Cannot warp when already warping");
  20597. if (this.upcomingTransType = e,
  20598. this.activeTransType = null,
  20599. !this.setWarpDestPano())
  20600. return this.upcomingTransType = null,
  20601. void this.warpToNonPano(n);
  20602. if (this.player.mode !== a.PANORAMA)
  20603. return this.upcomingTransType = null,
  20604. this.discardSlow(),
  20605. void this.player.flyToNewMode({
  20606. mode: a.PANORAMA,
  20607. pano: this.warpDestPano,
  20608. duration: c.warp.outsideTime,
  20609. warpDest: this.warpDestHeroLoc,
  20610. callback: n,
  20611. force: !0
  20612. });
  20613. if (!this.warpDestPano)
  20614. return y.warn("no warp destination, callback dropped"),
  20615. void (this.upcomingTransType = null);
  20616. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  20617. , o = this.chooseWarpPath(r);
  20618. if (o && this.upcomingTransType !== l.WALK) {
  20619. var s = function() {
  20620. this.waitingToWarp = !1,
  20621. this.warpToPano(e, t, i, n)
  20622. }
  20623. .bind(this);
  20624. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20625. return void (this.waitingToWarp = !0)
  20626. }
  20627. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20628. this.player.currentPano = this.warpDestPano,
  20629. this.placeCpm(),
  20630. this.fadeOutCpm(c.path.fadeOutTime),
  20631. this.player.spider.draw()),
  20632. y.debug("Warping to pano ", this.warpDestPano.position),
  20633. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20634. this.startWarpState();
  20635. var h = function() {
  20636. this.endWarpState(),
  20637. n && n()
  20638. }
  20639. .bind(this);
  20640. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  20641. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  20642. }
  20643. ,
  20644. t.exports = n
  20645. }
  20646. ).call(this, "/js/objects/ShowPath.js")
  20647. }
  20648. , {
  20649. "../constants": 8,
  20650. "../effects": 16,
  20651. "../enum/BlackoutStyle": 18,
  20652. "../enum/ModelManagerEvents": 33,
  20653. "../enum/PlayerEvents": 40,
  20654. "../enum/RenderOrder": 42,
  20655. "../enum/Vectors": 50,
  20656. "../enum/Viewmode": 51,
  20657. "../enum/WarpStyle": 52,
  20658. "../gui/gui": 65,
  20659. "../model/ModelManager": 140,
  20660. "../objects/Snapshot": 153,
  20661. "../settings": 166,
  20662. "../shaders": 167,
  20663. "../util/easing": 186,
  20664. "../util/lerp": 188,
  20665. "../util/logger": 189,
  20666. "../util/math": 190,
  20667. "../util/texture": 194,
  20668. "../util/transitions": 195,
  20669. three: 217
  20670. }],
  20671. 152: [function(e, t, i) {
  20672. "use strict";
  20673. function n() {
  20674. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20675. , t = new r.RawShaderMaterial({
  20676. fragmentShader: o.skysphere.fragmentShader,
  20677. vertexShader: o.skysphere.vertexShader,
  20678. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20679. side: r.BackSide,
  20680. name: "skysphere"
  20681. });
  20682. t.uniforms.radius.value = e.parameters.radius,
  20683. r.Mesh.call(this, e, t)
  20684. }
  20685. var r = e("three")
  20686. , o = e("../shaders")
  20687. , a = e("../settings");
  20688. n.prototype = Object.create(r.Mesh.prototype),
  20689. n.prototype.constructor = n,
  20690. t.exports = n
  20691. }
  20692. , {
  20693. "../settings": 166,
  20694. "../shaders": 167,
  20695. three: 217
  20696. }],
  20697. 153: [function(e, t, i) {
  20698. (function(i) {
  20699. "use strict";
  20700. function n(e) {
  20701. o.call(this, e),
  20702. this.sid = e.sid,//xzw add
  20703. this.panoId = e.panoId,
  20704. this.orthoZoom = e.orthoZoom,
  20705. this.floorVisibility = e.floorVisibility,
  20706. this.thumbUrl = e.thumbUrl,
  20707. this.name = e.name,
  20708. this.zoom = e.zoom
  20709. }
  20710. var r = (e("three"),
  20711. e("../util/logger"))
  20712. , o = (e("../settings"),
  20713. e("../enum/Viewmode"),
  20714. e("../util/common"),
  20715. e("../util/transitions"),
  20716. e("../util/lerp"),
  20717. e("../util/ajax"),
  20718. e("../util/texture"),
  20719. e("./View"));
  20720. e("events").EventEmitter,
  20721. new r(i);
  20722. n.prototype = Object.create(o.prototype),
  20723. n.prototype.isPano = function() {
  20724. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20725. }
  20726. ,
  20727. t.exports = n
  20728. }
  20729. ).call(this, "/js/objects/Snapshot.js")
  20730. }
  20731. , {
  20732. "../enum/Viewmode": 51,
  20733. "../settings": 166,
  20734. "../util/ajax": 181,
  20735. "../util/common": 185,
  20736. "../util/lerp": 188,
  20737. "../util/logger": 189,
  20738. "../util/texture": 194,
  20739. "../util/transitions": 195,
  20740. "./View": 154,
  20741. events: 202,
  20742. three: 217
  20743. }],
  20744. 154: [function(e, t, i) {
  20745. (function(i) {
  20746. "use strict";
  20747. function n(e) {
  20748. e = e || {},
  20749. this.position = new r.Vector3,
  20750. this.quaternion = new r.Quaternion,
  20751. this.update(e)
  20752. }
  20753. var r = e("three")
  20754. , o = e("../util/logger")
  20755. , a = (e("../settings"),
  20756. e("../enum/Viewmode"),
  20757. e("../util/common"),
  20758. e("../util/transitions"),
  20759. e("../util/lerp"),
  20760. e("../util/ajax"),
  20761. e("../util/texture"),
  20762. e("events").EventEmitter);
  20763. new o(i);
  20764. n.prototype = Object.create(a.prototype),
  20765. n.prototype.isValid = function() {
  20766. return !!this.cameraMode
  20767. }
  20768. ,
  20769. n.prototype.update = function(e) {
  20770. return this.cameraMode = e.cameraMode || this.cameraMode,
  20771. this.pano = e.pano || this.pano,
  20772. e.position && this.position.copy(e.position),
  20773. e.quaternion && this.quaternion.copy(e.quaternion),
  20774. this
  20775. }
  20776. ,
  20777. t.exports = n
  20778. }
  20779. ).call(this, "/js/objects/View.js")
  20780. }
  20781. , {
  20782. "../enum/Viewmode": 51,
  20783. "../settings": 166,
  20784. "../util/ajax": 181,
  20785. "../util/common": 185,
  20786. "../util/lerp": 188,
  20787. "../util/logger": 189,
  20788. "../util/texture": 194,
  20789. "../util/transitions": 195,
  20790. events: 202,
  20791. three: 217
  20792. }],
  20793. 155: [function(e, t, i) {//player.js
  20794. (function(i) {
  20795. "use strict";
  20796. function n(e) {
  20797. this.currentPano = null,
  20798. this.nextPano = null,
  20799. this.camera = null,
  20800. this.paused = !1,
  20801. this.flying = !1,
  20802. this.sceneIntersectionPlane = null,
  20803. this.target = new r.Vector3,
  20804. this.mouse = new r.Vector3(1.1,1.1,.5),
  20805. this.mouseAtMouseDown = new r.Vector2,
  20806. this.mouseCouldBeClickToMove = !1,
  20807. this.mouseLastMoveTime = Date.now(),
  20808. this.mouseDown = !1,
  20809. this.mouseDownTimer = null,
  20810. this.couldBeLongTap = !1,
  20811. this.containsMouse = !1, //
  20812. this.isTouchEvent = !1,
  20813. this.isPanoHover = !1,
  20814. this.reticule = new a(this),
  20815. this.panoMarkers = [],
  20816. this.spider = new h(this),
  20817. this.quaternion = new r.Quaternion,
  20818. this.position = new r.Vector3(15,10,15),
  20819. this.previousState = null,
  20820. this.lastInsideView = new c,
  20821. this.last360View = new c,
  20822. this.raycaster = new r.Raycaster,
  20823. this.intersect = null,
  20824. this.lastChangeTime = Date.now(),
  20825. this.history = new I,
  20826. this.cameraControls = null,
  20827. this.path = null,
  20828. this.model = null,
  20829. this.domElement = null,
  20830. this.cachedPanoCandidates = null,
  20831. this.basePanoSize = 0,
  20832. this.standardPanoSize = 0,
  20833. this.highPanoSize = 0,
  20834. this.ultraHighPanoSize = 0,
  20835. this.zoomLevel = 1,
  20836. this.zooming = 0,
  20837. this.zoomSpeed = .5,
  20838. this.scrollZoomSpeed = .06,
  20839. this.zoomSpeedAdjust = .05,
  20840. this.defaultZoomIncrement = .2,
  20841. this.baseFov = f.insideFOV,
  20842. this.zoomFov = this.baseFov,
  20843. this.zoomEnabled = !0,
  20844. this.preRenderingEnabled = !1,
  20845. this.setupCustomProperties(e),
  20846. this.zoomStats = new L
  20847. }
  20848. var r = e("three")
  20849. , o = e("./util/logger")
  20850. , a = e("./objects/Reticule")
  20851. , s = e("./objects/Panorama")
  20852. , l = e("./objects/ShowPath")
  20853. , c = e("./objects/View")
  20854. , h = (e("./objects/Snapshot"),
  20855. e("./objects/NSpider"))
  20856. , u = e("./enum/Viewmode")
  20857. , d = (e("./enum/TagStates"),
  20858. e("./enum/Vectors"))
  20859. , p = e("./enum/Keys")
  20860. , f = (e("./enum/AlignmentType"),
  20861. e("./settings"))
  20862. , g = e("./util/common")
  20863. , m = (e("./util/browser"),
  20864. e("./util/math"))
  20865. , v = e("./util/lerp")
  20866. , A = e("./util/easing")
  20867. , y = e("./util/transitions")
  20868. , C = e("events").EventEmitter
  20869. , I = (e("./shaders"),
  20870. e("./util/history"))
  20871. , E = (e("./util/camera"),
  20872. e("./model/ModelManager"),
  20873. e("./enum/PathDiscardMode"))
  20874. , b = e("./enum/PathDisplayMode")
  20875. , w = e("./enum/PlayerEvents")
  20876. , _ = e("./enum/ControlEvents")
  20877. , T = e("./enum/ModelManagerEvents")
  20878. , x = e("./enum/WarpStyle")
  20879. , S = e("./enum/BlackoutStyle")
  20880. , M = e("./exception/BasicException")
  20881. , R = e("./enum/PanoSizeClass")
  20882. , P = (e("./tile/TileDownloader"),
  20883. e("./tile/TilePrioritizer"))
  20884. , O = (e("./enum/PanoramaEvents"),
  20885. e("./enum/ZoomEvents"))
  20886. , L = e("./util/ZoomStats")
  20887. , D = e("./constants")
  20888. , N = e("./util/common")
  20889. , B = e("./util/cameraLight")
  20890. //, Hot = e('hot')
  20891. , F = new o(i)
  20892. , V = Object.freeze({
  20893. FlyToPano: y.getUniqueId(),
  20894. FlyToNewMode: y.getUniqueId(),
  20895. FlyToSameMode: y.getUniqueId(),
  20896. FlyToViewFloor: y.getUniqueId(),
  20897. LookTransition: y.getUniqueId(),
  20898. ZoomTransition: y.getUniqueId()
  20899. });
  20900. n.prototype = Object.create(C.prototype),
  20901. n.prototype.init = function(e) {
  20902. window.player = this
  20903. this.modelManager = e.modelManager,
  20904. this.tileDownloader = e.tileDownloader,
  20905. this.panoRenderer = e.panoRenderer,
  20906. this.qualityManager = e.qualityManager,
  20907. this.domElement = e.container,
  20908. this.camera = e.camera,
  20909. this.tagManager = e.tagManager,
  20910. this.cameraControls = e.controls,
  20911. this.path = new l(e.director,this,e.controls),
  20912. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20913. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20914. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20915. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20916. this.tileDownloader.processPriorityQueue = !1,
  20917. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20918. this.bindEvents(e.container),
  20919. this.updateModel()
  20920. this.modeTran = ''
  20921. }
  20922. //xzw add: 截图
  20923. function dataURLtoBlob(dataurl) {
  20924. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  20925. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  20926. while(n--){
  20927. u8arr[n] = bstr.charCodeAt(n);
  20928. };
  20929. return new Blob([u8arr], {type:mime});
  20930. }
  20931. n.prototype.screenShot = function(o){
  20932. if(this.flying || this.flyingToTag) return;
  20933. var R = this.sceneRenderer;
  20934. R.updateScreenSize(o);
  20935. for(var i in this.model.panos.index){
  20936. if(!this.model.panos.index[i].marker) continue;
  20937. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  20938. this.model.panos.index[i].marker.visible = false;
  20939. }
  20940. for(var i in this.model.hots){
  20941. this.model.hots[i].mesh.visible = false;
  20942. }
  20943. this.reticule.visible = false;
  20944. this.reticule.forceUnvisible = true;
  20945. this.path.currentPanoMarker.mesh.visible = false;
  20946. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  20947. R.renderer.clear(true,true,true);
  20948. R.renderer.render(R.scene, R.camera);
  20949. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  20950. o.f && o.f(imgData)
  20951. R.updateScreenSize({resize:true});
  20952. this.reticule.visible = true;
  20953. for(var i in this.model.hots){
  20954. this.model.hots[i].mesh.visible = true;
  20955. }
  20956. for(var i in this.model.panos.index){
  20957. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  20958. }
  20959. this.path.currentPanoMarker.mesh.visible = true;
  20960. R.renderer.render(R.scene, R.camera);
  20961. }.bind(this),30) //这个数字不能太小
  20962. }
  20963. var scaleImg = e("scaleImg");
  20964. var ResizeImg = function(img, option){
  20965. var img2; //不能直接改img 否则可能触发第二次img.onload
  20966. var compress = function(ratio,type){
  20967. var image = img2 || img;
  20968. var c = document.createElement('canvas');
  20969. c.width = image.width; c.height = image.height;
  20970. var ctx = c.getContext('2d');
  20971. ctx.drawImage(image,0,0,image.width,image.height);
  20972. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  20973. }
  20974. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  20975. var image = img2 || img;
  20976. var blob = dataURLtoBlob(image.src);
  20977. if(option.maxWeight && blob.size > option.maxWeight){
  20978. compress(option.maxWeight/blob.size, "jpeg")
  20979. blob = dataURLtoBlob(image.src);
  20980. }
  20981. if(!img2){
  20982. img2 = new Image();
  20983. }
  20984. img2.base64Src = image.src;
  20985. img2.src = window.URL.createObjectURL(blob);
  20986. }
  20987. var oldSize = Math.max(img.width, img.height);
  20988. if(option.toType != "png"){//不是非要png的话
  20989. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  20990. if(oldSize > option.maxSize){
  20991. compress(option.maxSize/oldSize, "jpeg");
  20992. }
  20993. reCom();
  20994. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  20995. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  20996. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  20997. reCom();
  20998. }
  20999. }
  21000. }else{
  21001. //?貌似png会越压缩越大?
  21002. }
  21003. return img2 || img;
  21004. }
  21005. var _fixType=function(type) {
  21006. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21007. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21008. return 'image/' + r;
  21009. };
  21010. var saveFile=function(data, filename){
  21011. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21012. save_link.href = data;
  21013. save_link.download = filename;
  21014. var event = document.createEvent('MouseEvents');
  21015. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21016. save_link.dispatchEvent(event);
  21017. };
  21018. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21019. var info = this.getSnapAngleInfo();
  21020. var str = ',{\r\t' + info;
  21021. var arg = arguments[0];
  21022. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21023. if (arg && arg.__callback) {
  21024. return arg.__callback(imgData, info)
  21025. }
  21026. var img = new Image();
  21027. img.src = imgData;
  21028. img.onload = function(){
  21029. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21030. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21031. var filename = "snap" + (new Date()).getTime();
  21032. saveFile(img2.src,filename + ".jpg");
  21033. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21034. str +=('\r\t"sid":"'+filename+'",');
  21035. str +=('\r\t"name":"'+filename+'"\r}');
  21036. logData(str)
  21037. }
  21038. }});
  21039. }
  21040. ,
  21041. n.prototype.getSnapAngleInfo = function(){
  21042. var info = {};
  21043. var str = '"metadata":{';
  21044. var q = this.camera.quaternion.clone();
  21045. switch (this.mode) {
  21046. case "panorama":
  21047. info.scan_id = this.currentPano.id;
  21048. str += ('"scan_id":"'+this.currentPano.id+'",');
  21049. break;
  21050. case "floorplan":
  21051. info.camera_mode = 1;
  21052. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21053. q.multiply(this.camera.quaternion);
  21054. str += ('"camera_mode":1,');
  21055. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21056. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21057. break;
  21058. case "dollhouse":
  21059. info.camera_mode = 2;
  21060. str += ('"camera_mode":2,');
  21061. break;
  21062. }
  21063. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21064. console.log(info.camera_position)
  21065. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21066. /**fyz 对相机截屏的角度进行校对 */
  21067. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21068. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21069. out.x *= -1;
  21070. out.w *= -1;
  21071. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21072. }else{
  21073. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21074. }
  21075. info.zoom = this.zoomLevel;
  21076. console.log(info.camera_quaternion)
  21077. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21078. // fyz 扩展编辑页面, 加上导览点缩放值
  21079. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21080. return str;
  21081. }
  21082. //------end
  21083. n.prototype.setupCustomProperties = function(e) {
  21084. var t = e || u.PANORAMA;
  21085. Object.defineProperty(this, "mode", {
  21086. get: function() {
  21087. return t
  21088. },
  21089. set: function(e) {
  21090. var i = t;
  21091. t = e,
  21092. this.onModeUpdated(i, t)
  21093. }
  21094. })
  21095. }
  21096. ,
  21097. n.prototype.isInMode = function() {
  21098. for (var e = 0; e < arguments.length; e++)
  21099. if (this.mode === arguments[e])
  21100. return !0;
  21101. return !1
  21102. }
  21103. ,
  21104. n.prototype.isOutsideMode = function(e) {
  21105. return e = e || this.mode,
  21106. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21107. }
  21108. ,
  21109. n.prototype.is360View = function(e, t) {
  21110. return e === u.PANORAMA && t && !t.isAligned()
  21111. }
  21112. ,
  21113. n.prototype.setScene = function(e) {
  21114. this.sceneIntersectionPlane = e.plane,
  21115. this.path.setScene(e),
  21116. this.moveReticuleToScene(e)
  21117. }
  21118. ,
  21119. n.prototype.moveReticuleToScene = function(e) {
  21120. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21121. e.add(this.reticule)
  21122. }
  21123. ,
  21124. n.prototype.updateModel = function() {
  21125. function e(e, t, n) {
  21126. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21127. }
  21128. function t(e, t) {
  21129. if (this.mode === u.DOLLHOUSE) {
  21130. var n = e ? this.model.center.y : n = t.center.y;
  21131. i.call(this, n)
  21132. }
  21133. }
  21134. function i(e) {
  21135. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21136. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21137. , n = t.position.y + (e - i.target.y)
  21138. , r = f.showFloorDuration + f.showFloorDelay;
  21139. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21140. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21141. }
  21142. this.model = this.modelManager.getActiveModel(),
  21143. this.model.on("floor.changed", e.bind(this)),
  21144. this.model.on("allfloors.toggled", t.bind(this)),
  21145. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21146. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21147. var e2 = this;
  21148. this.model.panos.list.forEach(function(a) {
  21149. a.vrMarker.addEventListener("click", function() {
  21150. e2.flyToPano({
  21151. pano: a
  21152. })
  21153. })
  21154. })
  21155. /********************************************************************************************************************************************/
  21156. }
  21157. ,
  21158. n.prototype.updateModelDependentData = function() {
  21159. this.cameraControls.setModelForControls(this.model),
  21160. this.getPanoMarkersFromModel(this.model)
  21161. }
  21162. ,
  21163. n.prototype.onModelChanged = function() {
  21164. this.updateModel(),
  21165. this.updateModelDependentData()
  21166. }
  21167. ,
  21168. n.prototype.getPanoMarkersFromModel = function(e) {
  21169. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21170. return t.marker ? e.concat(t.marker) : e
  21171. }, [])
  21172. }
  21173. ,
  21174. n.prototype.handleControlMove = function(e) {
  21175. this.emit(w.Move, e)
  21176. }
  21177. ,
  21178. n.prototype.handleControlInputStart = function(e) {
  21179. this.emit(w.InputStart, e)
  21180. }
  21181. ,
  21182. n.prototype.onModeUpdated = function(e, t) {
  21183. this.cameraControls.activateControls(t),
  21184. this.emit(w.ModeChanged, e, t)
  21185. }
  21186. ,
  21187. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21188. return this.path.warping
  21189. }
  21190. ,
  21191. n.prototype.isWaitingToWarp = function() {
  21192. return this.path.waitingToWarp
  21193. }
  21194. ,
  21195. n.prototype.getLabelScaleFactor = function() {
  21196. if (this.isOutsideMode()) {
  21197. var e = 10
  21198. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21199. return t
  21200. }
  21201. return .5
  21202. }
  21203. ,
  21204. /* n.prototype.changeMusic = function() {//xzw add
  21205. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21206. } */
  21207. n.prototype.bindEvents = function(e) {
  21208. e !== document && e.setAttribute("tabindex", -1),
  21209. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21210. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21211. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21212. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21213. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21214. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21215. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21216. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21217. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21218. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21219. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21220. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21221. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21222. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21223. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21224. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21225. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21226. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21227. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21228. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21229. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21230. // lzb
  21231. window.getSeft && getSeft(this);
  21232. }
  21233. ,
  21234. n.prototype.onMouseDown = function(e) {
  21235. e.currentTarget !== document && e.currentTarget.focus(),
  21236. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21237. this.updateIntersect())
  21238. }
  21239. ,
  21240. n.prototype.onMouseMove = function(e) {
  21241. this.isTouchEvent = !1,
  21242. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21243. }
  21244. ,
  21245. n.prototype.onMouseOver = function(e) {
  21246. this.containsMouse = !0,
  21247. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21248. }
  21249. ,
  21250. n.prototype.onMouseOut = function(e) {
  21251. this.containsMouse = !1
  21252. }
  21253. ,
  21254. n.prototype.onMouseUp = function(e) {
  21255. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21256. }
  21257. ,
  21258. n.prototype.onTouchStart = function(e) {
  21259. if (e.currentTarget !== document && e.currentTarget.focus(),
  21260. !this.mouseDown) {
  21261. this.couldBeLongTap = !0;
  21262. var t = g.average(e.changedTouches, "clientX")
  21263. , i = g.average(e.changedTouches, "clientY");
  21264. this.handleInputStart.call(this, t, i, !0),
  21265. this.mouseDownTimer = setTimeout(function() {
  21266. this.updateIntersect(),
  21267. this.handleInputEnd.call(this, t, i, !0)
  21268. }
  21269. .bind(this), f.input.longTapThreshold)
  21270. }
  21271. }
  21272. ,
  21273. n.prototype.onTouchMove = function(e) {
  21274. var t = g.average(e.changedTouches, "clientX")
  21275. , i = g.average(e.changedTouches, "clientY");
  21276. this.handleInputMove.call(this, t, i, !0)
  21277. }
  21278. ,
  21279. n.prototype.onTouchEnd = function(e) {
  21280. if (clearTimeout(this.mouseDownTimer),
  21281. this.mouseDown) {
  21282. this.couldBeLongTap = !1,
  21283. this.updateIntersect();
  21284. var t = g.average(e.changedTouches, "clientX")
  21285. , i = g.average(e.changedTouches, "clientY");
  21286. this.handleInputEnd.call(this, t, i, !0)
  21287. }
  21288. }
  21289. ,
  21290. n.prototype.onPointerDown = function(e) {
  21291. return e.currentTarget !== document && e.currentTarget.focus(),
  21292. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21293. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21294. void (this.mouseDownTimer = setTimeout(function() {
  21295. this.updateIntersect(),
  21296. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21297. }
  21298. .bind(this), f.input.longTapThreshold)))
  21299. }
  21300. ,
  21301. n.prototype.onPointerMove = function(e) {
  21302. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21303. }
  21304. ,
  21305. n.prototype.onPointerUp = function(e) {
  21306. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21307. this.couldBeLongTap = !1,
  21308. this.updateIntersect(),
  21309. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21310. }
  21311. ,
  21312. n.prototype.onPointerOut = function(e) {
  21313. this.mouseDown = !1
  21314. }
  21315. ,
  21316. n.prototype.onPointerCancel = function(e) {
  21317. this.mouseDown = !1
  21318. }
  21319. ,
  21320. n.prototype.onKeyDown = function(e) {
  21321. var t = function() {
  21322. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21323. }
  21324. .bind(this)
  21325. , i = e.which;
  21326. switch (i) {
  21327. case p.F:
  21328. t(),
  21329. this.changeFloor(-1);
  21330. break;
  21331. case p.R:
  21332. t(),
  21333. this.changeFloor(1)
  21334. }
  21335. if (this.mode === u.PANORAMA)
  21336. switch (i) {
  21337. case p.UPARROW:
  21338. case p.W:
  21339. this.flyLocalDirection(d.FORWARD.clone());
  21340. break;
  21341. case p.DOWNARROW:
  21342. case p.S:
  21343. this.flyLocalDirection(d.BACK.clone());
  21344. break;
  21345. case p.A:
  21346. this.flyLocalDirection(d.LEFT.clone());
  21347. break;
  21348. case p.D:
  21349. this.flyLocalDirection(d.RIGHT.clone())
  21350. }
  21351. }
  21352. ,
  21353. n.prototype.handleScrollPinchZoom = function() {
  21354. return function(e) {
  21355. var t = e
  21356. , i = this.zoomLevel;
  21357. this.zoomBy(t),
  21358. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21359. }
  21360. }(),
  21361. n.prototype.handleControlPinch = function(e) {
  21362. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  21363. }
  21364. ,
  21365. n.prototype.handleControlScroll = function(e) {
  21366. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21367. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  21368. }
  21369. ,
  21370. n.prototype.handleInputStart = function(e, t, i) {
  21371. //许钟文加
  21372. var pad = this.handelPadding(e, t);
  21373. e = pad.x;
  21374. t = pad.y;
  21375. this.isTouchEvent = i,
  21376. m.convertScreenPositionToNDC(e, t, this.mouse),
  21377. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21378. this.mouseCouldBeClickToMove = !0,
  21379. this.mouseDown = !0;
  21380. }
  21381. ,
  21382. n.prototype.handelPadding = function(x, y) {
  21383. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21384. if (!this.pad)
  21385. this.pad = {
  21386. x: dom.getOffset("left", $("#player")[0]),
  21387. y: dom.getOffset("top", $("#player")[0])
  21388. }
  21389. return {
  21390. x: x - this.pad.x,
  21391. y: y - this.pad.y
  21392. }
  21393. }
  21394. n.prototype.handleInputMove = function(e, t, i) {
  21395. //许钟文加
  21396. var pad = this.handelPadding(e, t);
  21397. e = pad.x;
  21398. t = pad.y;
  21399. this.isTouchEvent = i,
  21400. m.convertScreenPositionToNDC(e, t, this.mouse),
  21401. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21402. this.couldBeLongTap = !1,
  21403. clearTimeout(this.mouseDownTimer)),
  21404. this.mouseLastMoveTime = Date.now(),
  21405. this.reticule.move(e, t, i)
  21406. }
  21407. ,
  21408. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21409. if (this.isTouchEvent = i,
  21410. this.mouseDown = !1,
  21411. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21412. !i && this.couldBeLongTap)
  21413. return !0;
  21414. if (this.handleLongTap())
  21415. return !0;
  21416. if (this.mouseCouldBeClickToMove) {
  21417. if (this.flying)
  21418. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21419. !0;
  21420. //add----
  21421. if(this.checkHotClick())//add
  21422. return !0;
  21423. if(this.hoveringPlane){
  21424. this.clickOverlay(this.hoveringPlane)
  21425. return;
  21426. }
  21427. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21428. this.history.invalidate(),
  21429. this.intersect)
  21430. return this.flyToPanoClosestToMouse();
  21431. if (this.mode === u.PANORAMA) {
  21432. var n = this.closestPanoInDirection(this.getMouseDirection());
  21433. return n ? this.flyToPano({
  21434. pano: n
  21435. }) : this.bump(this.getMouseDirection())
  21436. }
  21437. }
  21438. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21439. }
  21440. ,
  21441. n.prototype.handleLongTap = function() {
  21442. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21443. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21444. !0
  21445. }
  21446. ,
  21447. n.prototype.checktagClick = function() {
  21448. if (this.tagManager.intersectTag) {
  21449. var e = this.isTouchEvent
  21450. , t = this.tagManager.clickedOnTag(e, this);
  21451. return e || t || y.cancelById(V.LookTransition),
  21452. !0
  21453. }
  21454. if (this.tagManager.activeTag)
  21455. return this.tagManager.dismissActiveTag(),
  21456. !1
  21457. }
  21458. ,
  21459. n.prototype.rankedtagInDirection = function(e, t) {
  21460. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21461. }
  21462. ,
  21463. n.prototype.start = function(e) {
  21464. //-------------------
  21465. //-------------------
  21466. var t = e.mode
  21467. , i = e.pano
  21468. , n = e.position
  21469. , rr = e.quaternion
  21470. , o = e.tag
  21471. , a = e.quickstart
  21472. , s = $.Deferred();
  21473. this.updateModelDependentData(),
  21474. this.updateFromControls(),
  21475. this.findDefaultViews();
  21476. var l = this.is360View(t, i);
  21477. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21478. s.done(function(e) {
  21479. this.emit(w.Ready, l, e, o)
  21480. }
  21481. .bind(this)),
  21482. s.promise()
  21483. }
  21484. ,
  21485. n.prototype.startOutside = function(e, t) {
  21486. var i = e.mode
  21487. , n = e.pano
  21488. , r = e.position
  21489. , o = e.quaternion
  21490. , a = e.zoom
  21491. , s = e.floorVisibility
  21492. , l = e.tag;
  21493. this.emit(w.StartOutside, f[i].transitionTime),
  21494. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21495. y.cancelById(V.FlyToViewFloor),
  21496. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21497. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21498. }
  21499. ,
  21500. n.prototype.startInside = function(e, t, i, n, r) {
  21501. r = r || $.Deferred(),
  21502. this.currentPano = e;
  21503. var o = e && !e.isAligned();
  21504. if (t = o ? e.position : t || e.position,
  21505. i = i || e.quaternion,
  21506. e) {
  21507. var a = this.startInside.bind(this, e, t, i, n, r);
  21508. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21509. return
  21510. }
  21511. //add
  21512. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21513. this.updateHotVisible()
  21514. Hot.updateVisibles([this.currentPano])
  21515. this.modeTran = "panorama-panorama"
  21516. return this.mode = u.PANORAMA,
  21517. e.floor.enter(this.mode),
  21518. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21519. this.switchCameraMode(this.mode, i),
  21520. this.emit(w.StartInside, o),
  21521. r.resolve(!0),
  21522. r
  21523. }
  21524. ,
  21525. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21526. if (r = r || $.Deferred(),
  21527. this.dollhouseMode(),
  21528. !e)
  21529. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21530. r.resolve(!1),
  21531. r;
  21532. t = t || e.position;
  21533. var o = i || this.cameraControls.activeControl.camera.quaternion
  21534. , a = e.position;
  21535. return this.fitDollhouse(a, t, o),
  21536. setTimeout(function(t) {
  21537. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21538. var n = {
  21539. mode: u.PANORAMA,
  21540. pano: e,
  21541. quaternion: i,
  21542. callback: function() {
  21543. this.emit(w.FlyinFinished),
  21544. r.resolve(!0)
  21545. }
  21546. .bind(this)
  21547. };
  21548. this.flyToNewMode(n)
  21549. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21550. r
  21551. }
  21552. ,
  21553. n.prototype.checkAndWaitForPanoLoad = function() {
  21554. var e = {}
  21555. , t = {}
  21556. , i = 5e3
  21557. , n = function() {
  21558. for (var n in e)
  21559. if (e.hasOwnProperty(n) && e[n]) {
  21560. var r = performance.now() - t[n];
  21561. if (r < i)
  21562. return !0
  21563. }
  21564. return !1
  21565. };
  21566. return function(r, o, a, s, l, c, h, u, d, p) {
  21567. if (n())
  21568. return !0;
  21569. var f = function(t, i, n) {
  21570. N.delayOneFrame(function() {
  21571. e[t] = !1,
  21572. l && l(i, n)
  21573. }
  21574. .bind(this))
  21575. }
  21576. .bind(this, r.id)
  21577. , g = function(t, i) {
  21578. N.delayOneFrame(function() {
  21579. e[t] = !1,
  21580. c && c(i)
  21581. }
  21582. .bind(this))
  21583. }
  21584. .bind(this, r.id);
  21585. try {
  21586. return null !== u && void 0 !== u || (u = !0),
  21587. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  21588. e[r.id] && (t[r.id] = performance.now()),
  21589. e[r.id]
  21590. } catch (n) {
  21591. throw e[r.id] = !1,
  21592. t[r.id] = performance.now() - i,
  21593. n
  21594. }
  21595. }
  21596. }(),
  21597. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21598. if (!e)
  21599. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21600. return r && this.model.waitForLoad(e, function() {
  21601. return e.isLoaded(i)
  21602. }),
  21603. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21604. !0)
  21605. }
  21606. ,
  21607. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21608. var e = new r.Vector3;
  21609. return function(t, i, n, r, o, a, s, l) {
  21610. if (!t)
  21611. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21612. return e.copy(d.FORWARD),
  21613. this.getDirection(e),
  21614. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21615. return t.isLoaded(i)
  21616. }),
  21617. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21618. n && n(e, t)
  21619. }
  21620. .bind(this)).fail(function(e) {
  21621. r && r(e)
  21622. }
  21623. .bind(this)).progress(function(e, t, i) {
  21624. o && o(e, t, i)
  21625. }
  21626. .bind(this)),
  21627. !0)
  21628. }
  21629. }(),
  21630. n.prototype.switchCameraMode = function(e, t) {
  21631. var i = this.cameraControls.controls[e]
  21632. , n = i.camera;
  21633. switch (e) {
  21634. case u.PANORAMA:
  21635. n.position.copy(this.currentPano.position);
  21636. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21637. i.lookAt(o.add(n.position));
  21638. break;
  21639. case u.DOLLHOUSE:
  21640. /* var a = this.position.clone();
  21641. 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),
  21642. n.position.copy(a),
  21643. i.target.copy(this.target.clone().setY(this.model.center.y));
  21644. break; */
  21645. //for多楼层 且 让模型刚好适应屏幕
  21646. var box = this.model.boundingBox.clone();
  21647. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21648. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21649. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21650. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21651. console.log(boxSize.x,distance, boxSize.length() / 2)
  21652. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21653. if(this.mode === u.PANORAMA){
  21654. i.target.copy(this.model.center);
  21655. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21656. }else{
  21657. i.target.copy(this.target.clone().setY(this.model.center.y))
  21658. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21659. }
  21660. vec.multiplyScalar(distance )
  21661. n.position.copy(i.target.clone().add(vec))
  21662. break
  21663. case u.FLOORPLAN:
  21664. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21665. i.target.copy(this.model.center).setY(0),
  21666. i.zoomToContain(this.model.size),
  21667. i.rotateToView(this.model.size, this.getDirection())
  21668. }
  21669. i.update(0)
  21670. }
  21671. ,
  21672. n.prototype.update = function() {
  21673. var e = (new r.Vector3,
  21674. {})
  21675. , t = [];
  21676. return function(i) {
  21677. this.updatePersistentZooming(i),
  21678. this.updateFromControls(i),
  21679. this.getCurrentNodePanos(t)
  21680. if(this.hasChanged(e) ) {
  21681. this.lastChangeTime = Date.now(),
  21682. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21683. this.emit(w.ViewChanged),
  21684. this.intersectHot && this.intersectHot.showTitle()
  21685. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  21686. }
  21687. if(e.cameraChanged){
  21688. // console.log(11111111,this.position.x,this.position.z,this.cameraControls.controls.panorama.lon);
  21689. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  21690. }
  21691. if(e.cameraChanged2){ //变化要更大些
  21692. for(var i in this.model.hots){
  21693. this.model.hots[i].update(this)
  21694. }
  21695. }
  21696. this.model.supportsTiles && (this.updateTileDownloader(t),
  21697. this.updatePanoRenderer(t)),
  21698. this.updatePreRendering(t),
  21699. this.reticule.update(),
  21700. this.path.update(),
  21701. this.spider.update(),
  21702. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21703. this.updateControlLocks(),
  21704. this.model.supportsTiles && this.updateZoomPano()
  21705. }
  21706. }(),
  21707. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  21708. var lastMode, lastPano;
  21709. return function(){
  21710. var mode = this.mode;
  21711. var pano = mode == "panorama" ? this.currentPano : "";
  21712. if(mode != "panorama" || pano != lastPano){
  21713. overlay.noBlock = null
  21714. }
  21715. this.overlayGroup.children.forEach((overlay)=>{
  21716. if(overlay.overlayType == "video" ){
  21717. var matrix = overlay.plane.matrixWorld;
  21718. var inSight = false;
  21719. var cameraDir = this.getDirection();
  21720. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  21721. var vertexes = []
  21722. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  21723. for(let i=0; i<4; i++){
  21724. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  21725. vertexes.push(vertex)
  21726. if(overlay.noBlock == null){
  21727. if(!m.ifShelter(vertex)){
  21728. overlay.noBlock = true
  21729. }
  21730. inSight = true; break;
  21731. }else{
  21732. overlay.noBlock = true
  21733. }
  21734. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  21735. inSight = true; break;
  21736. }
  21737. }
  21738. }
  21739. overlay.inSight = inSight
  21740. if(!inSight)overlay.plane.material.map.image.pause()
  21741. else overlay.plane.material.map.image.play()//maybe fail
  21742. }
  21743. })
  21744. lastMode = mode, lastPano = pano
  21745. }
  21746. }() */
  21747. n.prototype.updatePersistentZooming = function(e) {
  21748. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21749. }
  21750. ,
  21751. n.prototype.updateControlLocks = function() {
  21752. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21753. }
  21754. ,
  21755. n.prototype.updatePanoRenderer = function() {
  21756. var e = new r.Vector3;
  21757. return function(t) {
  21758. var i = this.nextPano || this.currentPano;
  21759. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21760. this.getDirection(e),
  21761. this.panoRenderer.updateDirection(e))
  21762. }
  21763. }(),
  21764. n.prototype.cleanupInactivePanos = function() {
  21765. var e = []
  21766. , t = [];
  21767. return function() {
  21768. e.length = 0,
  21769. e.push(this.currentPano),
  21770. this.nextPano && e.push(this.nextPano),
  21771. t.length = 0;
  21772. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21773. t.push(this.panoRenderer.activePanos[i]);
  21774. for (var n = 0; n < t.length; n++) {
  21775. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21776. r.id === e[a].id && (o = !1);
  21777. o && r.exit()
  21778. }
  21779. }
  21780. }(),
  21781. n.prototype.updatePreRendering = function() {
  21782. var e = {};
  21783. return function(t) {
  21784. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21785. var i = this.nextPano || this.currentPano;
  21786. if (i && t && t.length > 1) {
  21787. var n = t.findIndex(function(e) {
  21788. if (e.id === i.id)
  21789. return !0
  21790. });
  21791. if (n >= 0 && n + 1 < t.length) {
  21792. var r = t[n + 1];
  21793. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21794. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21795. window.setTimeout(function(t) {
  21796. e[t.id] = !1
  21797. }
  21798. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21799. }
  21800. .bind(this, r), f.tiling.panoPreRenderDelay),
  21801. e[r.id] = !0)
  21802. }
  21803. }
  21804. }
  21805. }
  21806. }(),
  21807. n.prototype.enablePreRendering = function() {
  21808. this.preRenderingEnabled = !0
  21809. }
  21810. ,
  21811. n.prototype.disablePreRendering = function() {
  21812. this.preRenderingEnabled = !1,
  21813. this.cleanupInactivePanos()
  21814. }
  21815. ,
  21816. n.prototype.updateTileDownloader = function() {
  21817. var e = new r.Vector3;
  21818. return function(t) {
  21819. var i = this.nextPano || this.currentPano;
  21820. i && (e.copy(d.FORWARD),
  21821. this.getDirection(e),
  21822. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21823. this.tileDownloader.processPriorityQueue = !0)
  21824. }
  21825. }(),
  21826. n.prototype.updateFromControls = function(e) {
  21827. null !== e && void 0 !== e || (e = 0),
  21828. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21829. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21830. this.position.copy(this.cameraControls.activeControl.camera.position),
  21831. this.target.copy(this.cameraControls.activeControl.target),
  21832. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21833. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21834. this.camera.position.copy(this.position),
  21835. this.camera.quaternion.copy(this.quaternion),
  21836. this.camera.updateMatrix(),
  21837. this.camera.updateMatrixWorld()
  21838. }
  21839. ,
  21840. n.prototype.hasChanged = function(e) {
  21841. /* if (!this.previousState)
  21842. return this.previousState = {
  21843. allFloorsVisible: this.model.allFloorsVisible,
  21844. position: this.position.clone(),
  21845. quaternion: this.quaternion.clone(),
  21846. mouse: this.mouse.clone(),
  21847. labelScaleFactor: this.getLabelScaleFactor(),
  21848. currentFloor: this.model.currentFloor,
  21849. projectionMatrix: this.camera.projectionMatrix.clone(),
  21850. worldMatrix: this.camera.matrixWorld.clone(),
  21851. mode: this.mode,
  21852. modelPosition: this.model.position.clone(),
  21853. modelCenter: this.model.center.clone(),
  21854. zoomLevel: this.zoomLevel
  21855. },
  21856. !0;
  21857. 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;
  21858. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21859. e.moved = !this.position.equals(this.previousState.position),
  21860. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21861. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21862. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21863. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21864. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21865. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21866. e.modeChanged = this.mode !== this.previousState.mode,
  21867. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21868. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21869. e.nextPanoActive = null !== this.nextPano,
  21870. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21871. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21872. this.previousState.position.copy(this.position),
  21873. this.previousState.quaternion.copy(this.quaternion),
  21874. this.previousState.mouse.copy(this.mouse),
  21875. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21876. this.previousState.currentFloor = this.model.currentFloor,
  21877. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21878. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21879. this.previousState.mode = this.mode,
  21880. this.previousState.modelPosition.copy(this.model.position),
  21881. this.previousState.modelCenter.copy(this.model.center),
  21882. this.previousState.zoomLevel = this.zoomLevel,
  21883. !t */
  21884. if (!this.previousState)
  21885. {
  21886. this.previousState = {
  21887. allFloorsVisible: this.model.allFloorsVisible,
  21888. position: this.position.clone(),
  21889. quaternion: this.quaternion.clone(),
  21890. mouse: this.mouse.clone(),
  21891. //labelScaleFactor: this.getLabelScaleFactor(),
  21892. currentFloor: this.model.currentFloor,
  21893. projectionMatrix: this.camera.projectionMatrix.clone(),
  21894. worldMatrix: this.camera.matrixWorld.clone(),
  21895. mode: this.mode,
  21896. modelPosition: this.model.position.clone(),
  21897. modelCenter: this.model.center.clone(),
  21898. zoomLevel: this.zoomLevel
  21899. };
  21900. return !0;
  21901. }
  21902. //许钟文改 分成相机是否改变cameraChanged 和其他
  21903. var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
  21904. var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
  21905. e.cameraChanged = !a;
  21906. if(e.cameraChanged){//
  21907. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
  21908. }else e.cameraChanged2 = false
  21909. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21910. e.moved = !this.position.equals(this.previousState.position),
  21911. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21912. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21913. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21914. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21915. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21916. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21917. e.modeChanged = this.mode !== this.previousState.mode,
  21918. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21919. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21920. e.nextPanoActive = null !== this.nextPano,
  21921. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21922. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21923. this.previousState.position.copy(this.position),
  21924. this.previousState.quaternion.copy(this.quaternion),
  21925. this.previousState.mouse.copy(this.mouse),
  21926. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21927. this.previousState.currentFloor = this.model.currentFloor,
  21928. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21929. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21930. this.previousState.mode = this.mode,
  21931. this.previousState.modelPosition.copy(this.model.position),
  21932. this.previousState.modelCenter.copy(this.model.center),
  21933. this.previousState.zoomLevel = this.zoomLevel;
  21934. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  21935. return !t
  21936. }
  21937. ,
  21938. n.prototype.updateIntersect = function() {
  21939. var e = this.flying || this.isWarping()
  21940. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21941. , i = y.getById(V.LookTransition)
  21942. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21943. {//clear:
  21944. if(this.intersectHot) this.intersectHot.hideTitle()
  21945. this.intersectHot = null
  21946. $("#player").css("cursor", "")
  21947. }
  21948. var deal = ()=>{
  21949. if(this.intersect && this.intersect.object.visible ){
  21950. if("hotSprite" == this.intersect.object.type){
  21951. this.intersectHot = this.intersect.object
  21952. while(!(this.intersectHot instanceof Hot)){
  21953. this.intersectHot = this.intersectHot.parent
  21954. }
  21955. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21956. this.intersectHot.showTitle()
  21957. }
  21958. }
  21959. }
  21960. if(this.model.hotGroup){
  21961. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
  21962. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  21963. if(this.intersect){
  21964. deal()
  21965. this.intersectHot && $("#player").css("cursor", "pointer");
  21966. }
  21967. }
  21968. this.intersect = this.getMouseIntersect(),
  21969. this.intersect && this.updateClosestPano(this.intersect),
  21970. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21971. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21972. }
  21973. ,
  21974. n.prototype.checkHotClick = function() {
  21975. if(this.intersectHot){
  21976. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  21977. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  21978. }
  21979. this.intersectHot.examine(this)
  21980. return true;
  21981. }
  21982. },
  21983. n.prototype.getMouseDirection = function(e) {
  21984. e = e || this.mouse;
  21985. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21986. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21987. return i.sub(t).normalize()
  21988. }
  21989. ,
  21990. n.prototype.hoverOverlay = function(mesh){
  21991. if(!mesh){
  21992. this.hoveringPlane = null;
  21993. $("#player").css("cursor",this.currentCursor || "" );
  21994. }else{
  21995. var overlay = mesh.parent;
  21996. $("#player").css("cursor","pointer");
  21997. this.hoveringPlane = overlay;
  21998. return true;
  21999. }
  22000. },
  22001. n.prototype.clickOverlay = function(overlay){
  22002. if(this.openOverlay && !overlay)return;
  22003. var plane = overlay.plane;
  22004. /* if(overlay.overlayType == "video"){
  22005. if(plane.material.map.image.paused) plane.material.map.image.play()
  22006. else plane.material.map.image.pause()
  22007. } */
  22008. if(overlay.overlayType == "video"){
  22009. overlay.switchPlay(!!overlay.pausedByUser)
  22010. }
  22011. /* if(window.EditOverlay &&EditOverlay.editing){
  22012. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22013. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22014. EditOverlay.endAddPlane();
  22015. EditOverlay.updateOverlayPanel(overlay)
  22016. EditOverlay.controlSelectOverlay(overlay)
  22017. return;
  22018. } */
  22019. },
  22020. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22021. e = e || this.mouse.clone(),
  22022. t = t || this.model.floors.reduce(function(e, t) {
  22023. return t.hidden ? e : e.concat(t.collider.children)
  22024. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22025. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22026. this.raycaster.set(i, this.getMouseDirection(e));
  22027. var n = this.raycaster.intersectObjects(t, true);//add true
  22028. var o = n[0];
  22029. if(o){
  22030. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22031. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22032. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22033. o.horizontal = .8 < o.normal.y);
  22034. return o
  22035. }
  22036. }
  22037. ,
  22038. n.prototype.updateClosestPano = function(e) {
  22039. var t = [s.filters.isPanoAligned()];
  22040. if (this.mode === u.PANORAMA) {
  22041. if (!this.currentPano)
  22042. return;
  22043. t.push(s.filters.not(this.currentPano)),
  22044. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22045. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22046. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22047. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22048. } else{
  22049. t.push((pano)=>{ // add
  22050. return this.checkHasNeighbor(pano)
  22051. })
  22052. t.push(s.filters.isOnVisibleFloor()),
  22053. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22054. }
  22055. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22056. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22057. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22058. this.closestPano = i) : this.isPanoHover = !1
  22059. }
  22060. ,
  22061. n.prototype.dollhouseMode = function(e, t) {
  22062. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22063. this.mode = u.DOLLHOUSE,
  22064. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22065. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22066. , n = new r.Vector3(15,10,15);
  22067. if (e && t) {
  22068. var o = d.FORWARD.clone().applyQuaternion(t)
  22069. , a = this.model.center.clone().sub(e)
  22070. , s = a.dot(o);
  22071. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22072. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22073. }
  22074. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22075. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22076. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22077. this.updateFromControls(),
  22078. this.model.alpha = 1,
  22079. this.model.skybox.material.uniforms.opacity.value = 0
  22080. }
  22081. ,
  22082. n.prototype.insideMode = function(e, t) {
  22083. var i = $.Deferred()
  22084. , n = t || null;
  22085. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22086. var r = [s.filters.isPanoAligned()];
  22087. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22088. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22089. this.flyToNewMode({
  22090. mode: u.PANORAMA,
  22091. pano: e,
  22092. callback: n
  22093. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22094. } else {
  22095. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22096. i.reject(o)
  22097. }
  22098. return i.promise()
  22099. }
  22100. ,
  22101. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22102. //if(urlHasValue('oldEntry')){
  22103. //搬自一代。
  22104. var maxY = this.model.boundingBox.max.y;
  22105. var n = d.FORWARD.clone().applyQuaternion(i)
  22106. , i = n.clone().add(e);
  22107. this.cameraControls.activeControl.target.copy(i),
  22108. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22109. //return;
  22110. /* //this.camera.position.copy(this.model.center);
  22111. //this.camera.updateMatrixWorld()
  22112. this.switchCameraMode("dollhouse", i) */
  22113. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22114. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22115. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22116. this.cameraControls.activeControl.target.copy(n).add(e);
  22117. var o = d.RIGHT.clone().applyQuaternion(i)
  22118. , a = d.UP.clone()
  22119. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22120. , l = this.model.boundingBox.max.clone()
  22121. , c = this.model.boundingBox.min.clone()
  22122. , 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)]
  22123. , u = 0
  22124. , p = 0
  22125. , g = 0;
  22126. h.forEach(function(e, t, i) {
  22127. var n = Math.abs(e.dot(o))
  22128. , r = e.dot(s);
  22129. n > u && (u = n,
  22130. p = r),
  22131. r > g && (g = r)
  22132. });
  22133. 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)))
  22134. , v = s.clone().multiplyScalar(p).add(t)
  22135. , A = s.clone().multiplyScalar(g).add(t);
  22136. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22137. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22138. p = Math.max(p, 10),
  22139. g = Math.max(g, 10);
  22140. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22141. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22142. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22143. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22144. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22145. */
  22146. }
  22147. ,
  22148. n.prototype.floorplanMode = function(e, t, i) {
  22149. this.mode = u.FLOORPLAN;
  22150. var n = this.cameraControls.controls[u.FLOORPLAN];
  22151. n.reset();
  22152. var r = e ? e : this.model.center;
  22153. if (n.target.copy(r).setY(0),
  22154. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22155. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22156. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22157. t) {
  22158. var o = d.LEFT.clone().applyQuaternion(t);
  22159. n.rotateLeft(-Math.atan2(o.x, o.z))
  22160. } else
  22161. n.rotateToView(this.model.size, this.getDirection());
  22162. n.update(0)
  22163. }
  22164. ,
  22165. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22166. return e.skipWarpingCheck = !0,
  22167. this.flyToPano(e, t)
  22168. }
  22169. ,
  22170. n.prototype.updateMarkerVisi = function() {//加
  22171. if(this.mode != "panorama")return;
  22172. this.model.panos.list.forEach((pano)=>{
  22173. if(!pano.marker)return;
  22174. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22175. })
  22176. }
  22177. ,
  22178. n.prototype.updateHotVisible = function(pano){
  22179. var hots = this.model.hots;
  22180. pano = pano || this.currentPano;
  22181. for (var index in hots){
  22182. var visible;
  22183. if(this.mode != "panorama"){
  22184. visible = true;
  22185. }else{
  22186. //hots[index].mesh.material.depthTest = false;
  22187. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22188. }
  22189. hots[index].mesh.visible = visible;
  22190. }
  22191. }
  22192. n.prototype.flyToPano = function(e, t) {
  22193. var i = e.pano
  22194. , aim = e.lookAtPoint
  22195. , aimQua = e.quaternion //ADD
  22196. , o = e.duration
  22197. , a = e.aimDuration
  22198. , s = e.maxDistanceOverride
  22199. , l = e.skipWarpingCheck
  22200. , c = e.constantMoveSpeed
  22201. , h = null
  22202. , p = null
  22203. if (aim){
  22204. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22205. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22206. }
  22207. else aimQua = aimQua
  22208. var zoomLevel = e.zoomLevel || 1 //add
  22209. if(this.flying) return t && t(e)
  22210. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22211. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22212. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22213. t && t(),
  22214. !1;
  22215. if (this.updateLastView(),
  22216. this.mode !== u.PANORAMA) {
  22217. var m;
  22218. void this.flyToNewMode({
  22219. mode: u.PANORAMA,
  22220. pano: i,
  22221. duration: o,
  22222. quaternion: aimQua ,
  22223. callback: t
  22224. })
  22225. }
  22226. if (!i || (h = g.deepExtend(e),
  22227. p = function() {
  22228. N.delayOneFrame(function() {
  22229. this.flyToPano(h, t)
  22230. }
  22231. .bind(this))
  22232. }
  22233. .bind(this),
  22234. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22235. var C = function(e) {
  22236. t && t(e)
  22237. }
  22238. .bind(this);
  22239. this.currentPano || (this.currentPano = i,
  22240. this.path.placeCpm(),
  22241. this.path.fadeOutCpm(f.path.fadeOutTime),
  22242. this.spider.draw());
  22243. var I = o;
  22244. if ("number" != typeof o) {
  22245. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22246. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22247. }
  22248. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22249. zoomLevel !== this.zoomLevel)
  22250. switch (f.zoom.transitionStyle) {
  22251. case 1:
  22252. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22253. break;
  22254. case 2:
  22255. return h = g.deepExtend(e),
  22256. p = this.flyToPano.bind(this, h, t),
  22257. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22258. }
  22259. if (aimQua) {
  22260. y.cancelById(V.LookTransition),
  22261. I *= f.transition.aimSlowFactor;
  22262. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22263. , S = b.clone()
  22264. , M = new r.Vector3;
  22265. if (i === this.currentPano) {
  22266. var R = d.FORWARD.clone().applyQuaternion(b)
  22267. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22268. , O = R.angleTo(P);
  22269. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22270. void y.start(function(e) {
  22271. S.copy(b),
  22272. v.quaternion(S, aimQua)(e),
  22273. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22274. this.cameraControls.activeControl.lookAt(M)
  22275. }
  22276. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22277. }
  22278. }
  22279. if (i === this.currentPano )
  22280. return void C();
  22281. this.flying = !0;
  22282. var L = this.position.clone()
  22283. , D = this.currentPano;
  22284. F.debug("Flying to pano ", i.position),
  22285. this.emit(w.PanoChosen, this.currentPano, i),
  22286. this.emit(w.FlyingStarted, i.position, L, i, D)
  22287. //---------before fly--------------- add
  22288. this.updateHotVisible(i); //更新热点显示
  22289. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22290. Hot.updateVisibles([this.currentPano, i])
  22291. //地标变化
  22292. if(this.model.floorLogos){
  22293. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22294. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22295. //this.model.adjustfloorLogoHeight();
  22296. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22297. this.model.floorLogos[1].visible = true;
  22298. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22299. }
  22300. //=======================================
  22301. aimQua && y.start(function(e) {
  22302. S.copy(b),
  22303. v.quaternion(S, aimQua)(e),
  22304. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22305. this.cameraControls.activeControl.lookAt(M)
  22306. }
  22307. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22308. var B = c ? null : A[f.transition.movementEasing];
  22309. this.nextPano = i,
  22310. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22311. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22312. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22313. this.flying = !1,
  22314. this.currentPano !== i && this.currentPano.exit(),
  22315. i.enter(),
  22316. this.currentPano = i,
  22317. this.nextPano = null,
  22318. this.path.placeCpm(),
  22319. this.path.fadeOutCpm(f.path.fadeOutTime),
  22320. this.spider.draw(),
  22321. this.emit(w.FlyingEnded, i.position, L, i, D),
  22322. this.updateMarkerVisi(),//add
  22323. C(e)
  22324. //add:
  22325. if(this.mode == "panorama" ){
  22326. if(this.model.floorLogos){
  22327. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22328. //this.model.adjustfloorLogoHeight()
  22329. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22330. this.model.floorLogos[1].visible = false;
  22331. }
  22332. Hot.updateVisibles([this.currentPano])//add
  22333. }
  22334. }
  22335. .bind(this), 0, B, "camFly", V.FlyToPano)
  22336. }
  22337. }
  22338. ,
  22339. n.prototype.warpToPano = function(o={}) {
  22340. }
  22341. n.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  22342. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  22343. if(this.flying || this.isWarping() )return;
  22344. let oldPos = this.position.clone();
  22345. let oldPano = this.currentPano
  22346. let pano = o.pano || this.model.panos.index[o.panoId]
  22347. this.path.warpDestPano = pano
  22348. var retry = ()=>{
  22349. this.waitingToWarp = !1,
  22350. this.blackToPano(o)
  22351. }
  22352. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  22353. return void (this.waitingToWarp = !0)
  22354. this.emit("pano.chosen", oldPano, pano)
  22355. /* if(window.momentTourBlackNewType == 1) { */
  22356. this.flying = true
  22357. this.path.warpDestHeroLoc = {
  22358. panoId : o.panoId,
  22359. position: pano.position,
  22360. quaternion: o.quaternion || this.quaternion.clone()
  22361. }
  22362. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  22363. pano != this.currentPano && this.currentPano.exit()
  22364. pano.enter()
  22365. this.currentPano = pano
  22366. this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
  22367. this.flying = false
  22368. } )
  22369. }
  22370. window._transitionPosId = 9999
  22371. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  22372. y.cancelById(_transitionPosId)
  22373. var begin = function(object, pos, qua, scale){
  22374. if(pos){
  22375. if(!same(object.position, pos, 0.01)){
  22376. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  22377. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22378. }
  22379. if(qua && !same(object.quaternion, qua, 1e-6)){
  22380. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  22381. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22382. }
  22383. if(scale && !same(object.scale, scale, 0.001)){
  22384. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  22385. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22386. }
  22387. }
  22388. }
  22389. var same = function(vec1, vec2, diff){
  22390. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  22391. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  22392. return s
  22393. }
  22394. var sid = o.pano != void 0 ? o.pano.id : "outside";
  22395. for(let i in this.model.hots){//是否判断visible?
  22396. var hot = this.model.hots[i];
  22397. var panoData = hot.info.transformAtPanos[sid];
  22398. var useCustom = !panoData
  22399. //if(hot.usingTransformData || !useCustom){
  22400. var pos = useCustom ? hot.info.position : panoData.pos;
  22401. begin(hot, pos/* , qua */ )
  22402. //}
  22403. }
  22404. }
  22405. window._tranOutsideFocus = 4399
  22406. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  22407. console.log("focusPoint")
  22408. if(this.mode == "floorplan"){
  22409. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  22410. var control = this.cameraControls.controls.floorplan;
  22411. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22412. var currentScale = control.absoluteScale;
  22413. var currentTarget = control.target.clone()
  22414. y.cancelById(window._tranOutsideFocus, true);
  22415. y.start(function(progress){
  22416. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22417. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22418. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22419. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22420. }else if(player.mode == "dollhouse"){
  22421. var control = player.cameraControls.controls.dollhouse;
  22422. var radius = o.radius || 8;
  22423. var currentTarget = control.target.clone()
  22424. var dir = control.offset.clone().normalize()
  22425. var currentRadius = control.offset.length();
  22426. y.cancelById(window._tranOutsideFocus, true);
  22427. y.start(function(progress){
  22428. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22429. let radius_ = radius*progress+currentRadius*(1-progress)
  22430. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22431. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22432. }else if(this.mode == 'panorama'){
  22433. this.flyToPano({
  22434. lookAtPoint: o.aim.clone() ,
  22435. pano: this.currentPano,
  22436. aimDuration: o.dur || 600
  22437. })
  22438. }
  22439. }
  22440. /*
  22441. 切换到某个模式后再执行函数
  22442. */
  22443. n.prototype.FlyToMode = function(mode, f1, duration){
  22444. var f2;
  22445. if (this.mode == mode) {
  22446. f1 && f1()
  22447. } else {
  22448. f2 = f1;
  22449. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22450. this.afterCModeFuc = function() {
  22451. /* objects.gui.modeChange[mode](null, {
  22452. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  22453. }); */
  22454. this.afterCModeFuc = f2
  22455. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  22456. //callback : f2
  22457. });
  22458. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  22459. }.bind(this)
  22460. } else {
  22461. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  22462. this.afterCModeFuc = f2;//飞入后执行
  22463. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22464. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  22465. }catch(e){
  22466. console.log('FlyToMode遇到问题?')
  22467. }
  22468. }
  22469. }
  22470. }
  22471. n.prototype.fastForwardActivePanoFlight = function(e) {
  22472. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  22473. y.adjustSpeed(V.FlyToPano, e)
  22474. y.adjustSpeed(V.LookTransition, e)
  22475. }
  22476. ,
  22477. n.prototype.flyToPanoClosestToMouse = function() {
  22478. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  22479. this.intersect && this.updateClosestPano(this.intersect)),
  22480. this.closestPano)
  22481. return this.flyToPano({
  22482. pano: this.closestPano
  22483. });
  22484. var e = this.getMouseDirection();
  22485. this.flyDirection(e) || this.flyToPano({
  22486. pano: this.currentPano
  22487. })
  22488. }
  22489. ,
  22490. n.prototype.flyLocalDirection = function(e) {
  22491. var t = this.getDirection(e)
  22492. , i = 1 === e.z ? .4 : .75
  22493. , n = 1 === Math.abs(e.x);
  22494. return this.flyDirection(t, i, n)
  22495. }
  22496. ,
  22497. n.prototype.flyDirection = function(e, t, i) {
  22498. Hot.closePopup();//xzw add
  22499. var n = $.Deferred();
  22500. this.history.invalidate();
  22501. var r = this.closestPanoInDirection(e, t, i);
  22502. return r ? this.flyToPano({
  22503. pano: r
  22504. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22505. n.resolve(!1)),
  22506. n.promise()
  22507. }
  22508. ,
  22509. n.prototype.closestPanoInDirection = function(e, t, i) {
  22510. return this.rankedPanoInDirection(0, e, t, i)
  22511. }
  22512. ,
  22513. n.prototype.rankedPanoInDirection = function() {
  22514. var e = {
  22515. pano: null,
  22516. candidates: []
  22517. };
  22518. return function(t, i, n, r) {
  22519. t || (t = 0),
  22520. n = void 0 !== n ? n : .75;
  22521. var o = r ? "angle" : "direction";
  22522. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  22523. this.cachedPanoCandidates = e.candidates,
  22524. e.pano
  22525. }
  22526. }(),
  22527. n.prototype.bump = function(e) {
  22528. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22529. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  22530. if (s)
  22531. t = function() {
  22532. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  22533. }
  22534. .bind(this),
  22535. i = function() {
  22536. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  22537. }
  22538. .bind(this);
  22539. else {
  22540. var l = this.camera.position.clone()
  22541. , c = e.clone();
  22542. this.raycaster.set(l, c);
  22543. var h = this.model.floors.reduce(function(e, t) {
  22544. return e.concat(t.collider.children)
  22545. }, [])
  22546. , d = this.raycaster.intersectObjects(h)
  22547. , p = d.length > 0 ? d[0].distance / 25 : .04
  22548. , g = l.clone().add(c.multiplyScalar(p));
  22549. t = function() {
  22550. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  22551. }
  22552. .bind(this),
  22553. i = function() {
  22554. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  22555. }
  22556. .bind(this)
  22557. }
  22558. n = function() {
  22559. this.flying = !1
  22560. }
  22561. .bind(this),
  22562. this.flying = !0,
  22563. t()
  22564. }
  22565. }
  22566. ,
  22567. n.prototype.changeFloor = function(e) {
  22568. if (!this.is360View(this.mode, this.currentPano))
  22569. if (this.mode === u.PANORAMA) {
  22570. var t = this.history.reversePano(e);
  22571. t && t.isAligned() ? this.flyToPano({
  22572. pano: t
  22573. }) : this.changeFloorByScore(e)
  22574. } else
  22575. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22576. }
  22577. ,
  22578. n.prototype.changeFloorByScore = function() {
  22579. var e = {
  22580. pano: null,
  22581. candidates: []
  22582. };
  22583. return function(t) {
  22584. var i = this.model.nextFloor(t);
  22585. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  22586. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  22587. this.history.push(t, this.currentPano),
  22588. this.flyToPano({
  22589. pano: e.pano
  22590. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  22591. }
  22592. }(),
  22593. n.prototype.gotoFloor = function(e) {
  22594. var t = e - this.model.currentFloor.floorIndex;
  22595. this.changeFloor(t)
  22596. }
  22597. ,
  22598. n.prototype.getDirection = function(e) {
  22599. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  22600. e.applyQuaternion(this.camera.quaternion)
  22601. }
  22602. ,
  22603. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  22604. if (o = o || $.Deferred(),
  22605. this.mode === u.TRANSITIONING)
  22606. return F.warn("should not be transitioning here"),
  22607. n && n(!1),
  22608. o.reject().promise();
  22609. var a = i || !1
  22610. , s = i ? i.position : this.position
  22611. , l = this.position.clone()
  22612. , c = this.currentPano;
  22613. if (F.debug("New pose in mode " + this.mode),
  22614. !e || (retryCallback = function() {
  22615. N.delayOneFrame(function() {
  22616. this.flyToSameMode(e, t, i, n, o)
  22617. }
  22618. .bind(this))
  22619. }
  22620. .bind(this),
  22621. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  22622. var h = function() {
  22623. this.emit(w.FlyingEnded, s, l, e, c),
  22624. n && n(!0)
  22625. }
  22626. .bind(this)
  22627. , d = f[this.mode]
  22628. , p = void 0 !== t ? t : d.transitionTime
  22629. , g = new r.Vector3
  22630. , C = new r.Vector3;
  22631. if (this.emit(w.FlyingStarted, s, l, e, c),
  22632. this.mode === u.PANORAMA)
  22633. F.warn("we should not be here for panorama views");
  22634. else if (this.mode === u.DOLLHOUSE)
  22635. if (a) {
  22636. var I = new r.Vector3(0,1,0);
  22637. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22638. this.model.warpDestFloors(i.floorVisibility),
  22639. C.copy(i.position);
  22640. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  22641. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  22642. , _ = b.intersectObjects(this.model.colliders)
  22643. , T = 3;
  22644. _.length ? (g.copy(_[0].point),
  22645. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  22646. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  22647. var x = (new r.Matrix4).lookAt(C, g, I)
  22648. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  22649. , M = g.distanceTo(C)
  22650. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  22651. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  22652. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  22653. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  22654. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  22655. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  22656. this.path.burnsDir = Math.sign(L.y);
  22657. var D = new r.Euler(0,0,0,f.warp.eOrder)
  22658. , B = new r.Vector3;
  22659. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22660. y.start(function(e, t) {
  22661. D.x = P.x + e * L.x,
  22662. D.y = P.y + e * L.y,
  22663. D.z = P.z + e * L.z;
  22664. var i = O + e * (M - O);
  22665. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  22666. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  22667. }
  22668. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22669. y.start(function(e, t) {
  22670. this.cameraControls.controls[u.DOLLHOUSE].update(),
  22671. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  22672. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  22673. }
  22674. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22675. } else
  22676. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  22677. else if (this.path.placeCpm(),
  22678. this.path.fadeInCpm(f.path.fadeInTime),
  22679. i) {
  22680. this.model.warpDestFloors(i.floorVisibility);
  22681. var U = this.cameraControls.cameras[u.FLOORPLAN]
  22682. , k = this.cameraControls.controls[u.FLOORPLAN]
  22683. , H = k.target.clone()
  22684. , G = i.position.clone().sub(H)
  22685. , z = U.position.clone().sub(k.target)
  22686. , W = z.length()
  22687. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  22688. , Y = Math.atan2(k.offset.x, k.offset.z)
  22689. , X = Math.atan2(j.x, j.z)
  22690. , Z = k.absoluteScale
  22691. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  22692. y.start(function(e, t) {
  22693. k.target.copy(G).multiplyScalar(e).add(H);
  22694. var i = Y + (X - Y) * e;
  22695. k.offset.x = W * Math.sin(i),
  22696. k.offset.z = W * Math.cos(i),
  22697. U.position.copy(k.target).add(k.offset),
  22698. k.absoluteScale = Z + e * (q - Z),
  22699. k.update(),
  22700. this.quaternion.copy(U.quaternion),
  22701. this.position.copy(U.position),
  22702. this.target.copy(k.target),
  22703. this.camera.projectionMatrix.copy(U.projectionMatrix)
  22704. }
  22705. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  22706. } else
  22707. F.info("flyToSameMode() funny floorplan view? skipping");
  22708. return y.setTimeout(function(e) {
  22709. this.mode = e,
  22710. h(),
  22711. o.resolve(!0)
  22712. }
  22713. .bind(this, this.mode), p, V.FlyToSameMode),
  22714. this.mode = u.TRANSITIONING,
  22715. o.promise()
  22716. }
  22717. }
  22718. ,
  22719. n.prototype.flyToNewMode = function(e, t) {
  22720. Hot.closePopup();//xzw add
  22721. e = e || {};
  22722. var i = e.mode
  22723. , n = e.pano
  22724. , o = e.duration
  22725. , a = e.warpDest
  22726. , s = e.callback
  22727. , l = e.force
  22728. , c = e.quaternion;
  22729. if (t = t || $.Deferred(),
  22730. this.isWarping())
  22731. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  22732. s && s(!1),
  22733. t.reject("Cannot change mode during tour transition").promise();
  22734. if (this.mode === u.TRANSITIONING)
  22735. return s && s(!1),
  22736. t.reject("Cannot change mode during mode transition").promise();
  22737. if (i === this.mode)
  22738. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  22739. t.promise()) : (s && s(!1),
  22740. t.reject("Already in " + i + " mode").promise());
  22741. var h = a || !1;
  22742. F.debug("Switching mode to " + i);
  22743. var d = function() {
  22744. N.delayOneFrame(function() {
  22745. this.flyToNewMode(e, t)
  22746. }
  22747. .bind(this))
  22748. }
  22749. .bind(this);
  22750. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  22751. return t.promise();
  22752. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22753. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  22754. this.model.waitForLoad(this.model, function() {
  22755. return this.model.meshTexturesLoaded;
  22756. }
  22757. .bind(this)),
  22758. this.model.loadMeshTextures().done(d),
  22759. t.promise();
  22760. this.history.invalidate(),
  22761. this.updateLastView();
  22762. var p = this.mode
  22763. , C = this.cameraControls.cameras[i];
  22764. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  22765. var I = void 0 !== o ? o : e.transitionTime;
  22766. this.emit(w.ModeChanging, p, i, n),
  22767. n && (this.currentPano = n),
  22768. this.switchCameraMode(i, c),
  22769. y.cancelById(V.LookTransition);
  22770. //before fly---------------------
  22771. this.modeTran = p + "-" + i; //add
  22772. if(this.mode == "panorama"){
  22773. if(this.model.floorLogos){
  22774. this.model.floorLogos[0].visible = false;
  22775. this.model.floorLogos[1].visible = false;
  22776. }
  22777. }
  22778. if(i == "panorama"){
  22779. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  22780. }else{
  22781. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  22782. }
  22783. //------------------------------------
  22784. var _ = (new r.Vector3).copy(this.position);
  22785. if (i === u.PANORAMA){
  22786. this.emit(w.PanoChosen, n, n),
  22787. setTimeout(function() {
  22788. n.floor.enter(i)
  22789. }
  22790. .bind(this), I / 2),
  22791. this.path.fadeOutCpm(f.path.fadeOutTime);
  22792. if(this.model.floorLogos){
  22793. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  22794. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  22795. }
  22796. }else if (i === u.DOLLHOUSE) {
  22797. if (h && (this.model.stayPut = !0),
  22798. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  22799. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  22800. this.path.placeCpm(),
  22801. this.path.fadeInCpm(f.path.fadeInTime),
  22802. h) {
  22803. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  22804. _.set(15, 10, 15);
  22805. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  22806. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  22807. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  22808. P.length ? (T.copy(P[0].point),
  22809. _.copy(a.position),
  22810. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  22811. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  22812. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  22813. _.add(this.model.position),
  22814. C.position.copy(_),
  22815. this.cameraControls.controls[u.DOLLHOUSE].update()
  22816. }
  22817. } else if (this.path.placeCpm(),
  22818. this.path.fadeInCpm(f.path.fadeInTime),
  22819. a) {
  22820. this.model.warpDestFloors(a.floorVisibility);
  22821. var O = this.cameraControls.cameras[u.FLOORPLAN]
  22822. , L = this.cameraControls.controls[u.FLOORPLAN]
  22823. , D = O.position.clone().sub(L.target)
  22824. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  22825. , U = Math.atan2(B.x, B.z);
  22826. L.target.copy(a.position);
  22827. var k = D.length();
  22828. L.offset.x = k * Math.sin(U),
  22829. L.offset.y = 0,
  22830. L.offset.z = k * Math.cos(U),
  22831. O.position.copy(L.target).add(L.offset);
  22832. L.target.clone().sub(C.position);
  22833. C.quaternion.copy(a.quaternion),
  22834. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  22835. L.absoluteScale = L.currentScale,
  22836. L.update()
  22837. } else
  22838. this.model.currentFloor.enter(i);
  22839. var H = this.currentPano
  22840. , G = this.position.clone();
  22841. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  22842. this.flying = !0,
  22843. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  22844. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  22845. C.controls.update()),
  22846. e.blackoutStyle = S.FADEIN,
  22847. I = f.show360Views.transitionTime,
  22848. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  22849. this.mode = i,
  22850. this.path && this.path.popOutCpm(),
  22851. e.blackoutStyle = S.END,
  22852. I = f.show360Views.transitionTime,
  22853. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  22854. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  22855. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  22856. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  22857. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  22858. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  22859. y.setTimeout(function() {
  22860. this.flying = !1,
  22861. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  22862. this.currentPano.enter(),
  22863. this.path.placeCpm(),
  22864. this.path.fadeOutCpm(f.path.fadeOutTime),
  22865. this.spider.draw()),
  22866. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  22867. this.mode = i,
  22868. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  22869. //add:
  22870. this.updateMarkerVisi() ;
  22871. (this.mode == u.PANORAMA) && this.updateHotVisible(),
  22872. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  22873. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  22874. this.model.floorLogos[0].visible = true
  22875. )
  22876. if (this.afterCModeFuc) {
  22877. //手动加的函数
  22878. var cf = this.afterCModeFuc;
  22879. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22880. cf();
  22881. }
  22882. if(this.mode == u.PANORAMA){
  22883. Hot.updateVisibles([this.currentPano])
  22884. }else{
  22885. Hot.updateVisibles(true)
  22886. this.model.hotGroup.children.forEach(overlay=>{
  22887. if(overlay.animateInfo){
  22888. GifTexDeal.start(overlay.animation)
  22889. }
  22890. })
  22891. }
  22892. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  22893. t.resolve())
  22894. }
  22895. .bind(this), I, V.FlyToNewMode),
  22896. this.mode = u.TRANSITIONING,
  22897. p == "panorama" && this.updateHotVisible(),
  22898. t.promise()
  22899. }
  22900. ,
  22901. n.prototype.fade360View = function(e, t, i) {
  22902. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22903. $(this.domElement).fadeOut(.5 * e, function() {
  22904. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22905. this.model.alpha = i.modelAlpha,
  22906. this.position.copy(t.position),
  22907. this.quaternion.copy(t.quaternion),
  22908. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22909. $(this.domElement).fadeIn(.5 * e)
  22910. }
  22911. .bind(this))
  22912. }
  22913. ,
  22914. n.prototype.findDefaultViews = function() {
  22915. this.findDefaultView(this.lastInsideView, !0),
  22916. this.findDefaultView(this.last360View, !1)
  22917. }
  22918. ,
  22919. n.prototype.findDefaultView = function(e, t) {
  22920. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22921. if (e.cameraMode !== u.PANORAMA)
  22922. return !1;
  22923. var i = r.get(e.panoId);
  22924. return i && i.isAligned() === t
  22925. });
  22926. o >= 0 ? (i = r.get(n[o].panoId),
  22927. e.update({
  22928. cameraMode: u.PANORAMA,
  22929. pano: i,
  22930. position: n[o].position,
  22931. quaternion: n[o].quaternion
  22932. })) : (o = r.list.findIndex(function(e) {
  22933. return e.isAligned() === t
  22934. }),
  22935. o >= 0 ? (i = r.list[o],
  22936. e.update({
  22937. cameraMode: u.PANORAMA,
  22938. pano: i,
  22939. position: i.position
  22940. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  22941. }
  22942. ,
  22943. n.prototype.updateLastView = function() {
  22944. if (this.mode === u.PANORAMA) {
  22945. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  22946. e.update({
  22947. pano: this.currentPano,
  22948. position: this.position,
  22949. quaternion: this.quaternion
  22950. })
  22951. }
  22952. }
  22953. ,
  22954. n.prototype.goToLastView = function(e, t) {
  22955. var i = $.Deferred()
  22956. , n = i.resolve.bind(i)
  22957. , r = i.reject.bind(i)
  22958. , o = e ? this.lastInsideView : this.last360View;
  22959. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22960. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22961. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22962. mode: o.cameraMode,
  22963. pano: o.pano,
  22964. quaternion: o.quaternion,
  22965. callback: t
  22966. }).done(n).fail(r),
  22967. i.promise()
  22968. }
  22969. ,
  22970. n.prototype.fadeToView = function(e, t, i, n) {
  22971. var r = $.Deferred()
  22972. , o = r.resolve.bind(r)
  22973. , a = r.reject.bind(r);
  22974. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  22975. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  22976. a("Cannot go to illegal view"),
  22977. r.promise();
  22978. var s = (f[t.cameraMode],
  22979. function() {
  22980. $(this.domElement).fadeIn(.5 * i),
  22981. n && n(),
  22982. o()
  22983. }
  22984. .bind(this))
  22985. , l = e ? S.FADEIN : S.END;
  22986. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22987. $(this.domElement).fadeOut(.5 * i, function() {
  22988. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  22989. t.cameraMode === u.PANORAMA ? this.flyToPano({
  22990. pano: t.pano,
  22991. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22992. duration: 0
  22993. }, s) : this.flyToNewMode({
  22994. mode: t.cameraMode,
  22995. quaternion: t.quaternion,
  22996. duration: 0,
  22997. callback: s
  22998. })
  22999. }
  23000. .bind(this)),
  23001. r.promise()
  23002. }
  23003. ,
  23004. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23005. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23006. this.flying)
  23007. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23008. o && o(),
  23009. !1;
  23010. null !== e && void 0 !== e || (e = b.Show),
  23011. this.history.invalidate()
  23012. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23013. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23014. return this.emit(w.WarpStarted, a, i, n, r),
  23015. n = n || S.MIDDLE,
  23016. this.path.warpToPano(i, n, r, function() {
  23017. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23018. this.emit(w.WarpEnded, i),
  23019. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23020. o && o()
  23021. }
  23022. .bind(this)),
  23023. e === b.Hide && this.path.discardPathObject(),
  23024. !0
  23025. }
  23026. ,
  23027. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23028. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23029. s && s(),
  23030. !1)
  23031. }
  23032. ,
  23033. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23034. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23035. a && a(),
  23036. !1)
  23037. }
  23038. ,
  23039. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23040. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23041. }
  23042. ,
  23043. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23044. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23045. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23046. t && t(),
  23047. !1)
  23048. }
  23049. ,
  23050. n.prototype.aimTourCamera = function(e, t, i, n) {
  23051. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23052. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23053. }
  23054. ,
  23055. n.prototype.showPathToHeroLocation = function(e) {
  23056. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23057. }
  23058. ,
  23059. n.prototype.tourInterlude = function(e, t) {
  23060. this.history.invalidate();
  23061. this.path.discardSlow();
  23062. //xzw:
  23063. var defaultRotTime = DATA.tourRotTime * 1000
  23064. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23065. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23066. var rotTime
  23067. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23068. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  23069. var hasMusic = currentLocation && currentLocation.musicInfo.music
  23070. if(hasMusic){
  23071. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23072. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23073. rotTime = currentLocation.musicInfo.time - current
  23074. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23075. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23076. }
  23077. }else{
  23078. rotTime = defaultRotTime
  23079. }
  23080. rotTime = Math.max(0, rotTime)
  23081. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation.musicInfo.time) : ''),"#E8E")
  23082. }else{
  23083. rotTime = currentLocation.rotTime * 1000
  23084. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23085. }
  23086. this.path.waitNextStep(e, function() {
  23087. t && t()
  23088. }.bind(this), rotTime)
  23089. }
  23090. ,
  23091. n.prototype.stopInterlude = function() {
  23092. this.interruptAndFastForward(null, 0)
  23093. }
  23094. ,
  23095. n.prototype.interruptAndFastForward = function(e, t) {
  23096. //Log('interruptAndFastForward' , '#f00')
  23097. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23098. this.flying && this.emit(w.FlyingInterrupted),
  23099. this.path.interruptAndFastForward(e, t)
  23100. }
  23101. ,
  23102. n.prototype.setSize = function(e, t) {
  23103. var i = e / t;
  23104. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23105. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23106. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23107. for (var r in this.cameraControls.cameras) {
  23108. var o = this.cameraControls.cameras[r];
  23109. o.fov = this.baseFov * (1 / this.zoomLevel),
  23110. o.updateAspect(i)
  23111. }
  23112. }
  23113. ,
  23114. n.prototype.toJSON = function() {
  23115. var e = {};
  23116. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23117. e.camera_mode = u.toInt(this.mode),
  23118. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23119. return e.hidden ? 0 : 1
  23120. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23121. e) : e
  23122. }
  23123. ,
  23124. n.prototype.getCurrentNodePanos = function(e) {
  23125. this.model.panos.map;
  23126. if (e.length = 0, this.path.nodes){
  23127. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23128. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23129. if(this.path.nodes.length){
  23130. e.push(this.model.panos.get(this.path.nodes[0]))
  23131. }
  23132. if(this.path.nodes.length>1){
  23133. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23134. }
  23135. }else{
  23136. for (var t = 0; t < this.path.nodes.length; t++) {
  23137. var i = this.path.nodes[t];
  23138. e.push(this.model.panos.get(i))
  23139. }
  23140. }
  23141. }
  23142. }
  23143. ,
  23144. n.prototype.zoomIncrementally = function(e) {
  23145. var t = this.zoomLevel;
  23146. this.zoomTo(this.zoomLevel + e),
  23147. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23148. }
  23149. ,
  23150. n.prototype.zoomInIncrementally = function(e) {
  23151. e = e || this.defaultZoomIncrement,
  23152. this.zoomIncrementally(e)
  23153. }
  23154. ,
  23155. n.prototype.zoomOutIncrementally = function(e) {
  23156. e = e || -this.defaultZoomIncrement,
  23157. this.zoomIncrementally(e)
  23158. }
  23159. ,
  23160. n.prototype.zoomBy = function(e) {
  23161. this.zoomTo(this.zoomLevel * e)
  23162. }
  23163. ,
  23164. n.prototype.zoomIn = function() {
  23165. this.zoomBy(1 + this.zoomSpeed)
  23166. }
  23167. ,
  23168. n.prototype.zoomOut = function() {
  23169. this.zoomBy(1 - this.zoomSpeed)
  23170. }
  23171. ,
  23172. n.prototype.zoomTo = function(e, t) {
  23173. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23174. if (e < f.zoom.min && (e = f.zoom.min),
  23175. e > f.zoom.max && (e = f.zoom.max),
  23176. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23177. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23178. e === f.zoom.min && this.emit(O.ZoomMin)),
  23179. this.cameraControls.activeControl) {
  23180. var i = this.cameraControls.activeControl.camera;
  23181. this.zoomLevel = e,
  23182. i.fov = this.baseFov * (1 / this.zoomLevel),
  23183. i.updateProjectionMatrix(),
  23184. this.zoomFov = i.fov
  23185. }
  23186. }
  23187. }
  23188. ,
  23189. n.prototype.increaseZoomSpeed = function() {
  23190. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23191. }
  23192. ,
  23193. n.prototype.decreaseZoomSpeed = function() {
  23194. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23195. }
  23196. ,
  23197. n.prototype.clampZoomSpeed = function(e) {
  23198. return e < 0 ? 0 : e
  23199. }
  23200. ,
  23201. n.prototype.activatePersistentZooming = function(e) {
  23202. this.zooming = e ? 1 : -1
  23203. }
  23204. ,
  23205. n.prototype.deactivatePersistentZooming = function() {
  23206. this.zooming = 0
  23207. }
  23208. ,
  23209. n.prototype.zoomDefault = function() {
  23210. this.zoomTo(1, !0)
  23211. }
  23212. ,
  23213. window.fovTranId = 333;//add
  23214. n.prototype.smoothZoomToDefault = function(e, t) {
  23215. y.cancelById(window.fovTranId)
  23216. var i, n = this.zoomLevel,
  23217. r = function(e) {
  23218. e > 1 && (e = 1),
  23219. i = n * (1 - e) + e,
  23220. this.zoomTo(i, !0)
  23221. }.bind(this),
  23222. o = function() {
  23223. this.zoomDefault(),
  23224. t && window.setTimeout(t, 50)
  23225. }.bind(this);
  23226. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23227. }
  23228. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23229. y.cancelById(window.fovTranId)
  23230. console.log("smoothZoomFovTo "+zoomLevel)
  23231. var i,
  23232. n = this.zoomLevel,
  23233. aimLevel = zoomLevel || this.baseFov / fov
  23234. if (n == aimLevel) return
  23235. var fun = function (e) {
  23236. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23237. this.zoomTo(i, !0)
  23238. }.bind(this)
  23239. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23240. }
  23241. ,
  23242. n.prototype.updateZoomPano = function() {
  23243. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  23244. var e = this.currentPano;
  23245. if (e) {
  23246. var t = this.zoomLevel > f.zoom.activationThreshold
  23247. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23248. , n = !i && !this.isWarping()
  23249. , r = t /*&& n*/; // 允许flying状态下加载4K图
  23250. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23251. this.panoRenderer.setZoomingActive(r, e, !0);
  23252. var o = function(e, t) {
  23253. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23254. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  23255. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  23256. e.setZoomed(t)
  23257. }
  23258. .bind(this);
  23259. r && !e.zoomed ? (o(e, !0),
  23260. this.panoRenderer.enableUltraHighQualityMode(function() {
  23261. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  23262. r && o(e, !0)
  23263. }
  23264. .bind(this))) : !t && e.zoomed && o(e, !1)
  23265. }
  23266. }
  23267. },
  23268. n.prototype.checkHasNeighbor = function(pano){//add
  23269. for(var i in pano.neighbourPanos ){
  23270. if(i == pano.id)continue;
  23271. if(pano.neighbourPanos[i]){
  23272. return true;
  23273. }
  23274. }
  23275. }
  23276. ,
  23277. t.exports = n
  23278. }
  23279. ).call(this, "/js/player.js")
  23280. }
  23281. , {
  23282. "./constants": 8,
  23283. "./enum/AlignmentType": 17,
  23284. "./enum/BlackoutStyle": 18,
  23285. "./enum/ControlEvents": 21,
  23286. "./enum/Keys": 30,
  23287. "./enum/ModelManagerEvents": 33,
  23288. "./enum/PanoSizeClass": 36,
  23289. "./enum/PanoramaEvents": 37,
  23290. "./enum/PathDiscardMode": 38,
  23291. "./enum/PathDisplayMode": 39,
  23292. "./enum/PlayerEvents": 40,
  23293. "./enum/TagStates": 44,
  23294. "./enum/Vectors": 50,
  23295. "./enum/Viewmode": 51,
  23296. "./enum/WarpStyle": 52,
  23297. "./enum/ZoomEvents": 53,
  23298. "./exception/BasicException": 55,
  23299. "./model/ModelManager": 140,
  23300. "./objects/NSpider": 147,
  23301. "./objects/Panorama": 148,
  23302. "./objects/Reticule": 149,
  23303. "./objects/ShowPath": 151,
  23304. "./objects/Snapshot": 153,
  23305. "./objects/View": 154,
  23306. "./settings": 166,
  23307. "./shaders": 167,
  23308. "./tile/TileDownloader": 171,
  23309. "./tile/TilePrioritizer": 172,
  23310. "./util/ZoomStats": 179,
  23311. "./util/browser": 182,
  23312. "./util/camera": 183,
  23313. "./util/cameraLight": 184,
  23314. "./util/common": 185,
  23315. "./util/easing": 186,
  23316. "./util/history": 187,
  23317. "./util/lerp": 188,
  23318. "./util/logger": 189,
  23319. "./util/math": 190,
  23320. "./util/transitions": 195,
  23321. "hot":"hot",
  23322. "scaleImg":"scaleImg",
  23323. events: 202,
  23324. three: 217
  23325. }],
  23326. "scaleImg":[function(t, e){// xzw
  23327. var OUTPUT = e;
  23328. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  23329. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  23330. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  23331. return G.getImageData(0,0,s,f)}
  23332. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  23333. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  23334. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  23335. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  23336. else
  23337. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  23338. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  23339. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  23340. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  23341. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  23342. W=new Float32Array(at);else
  23343. for(W=[],et=0;at>et;++et)
  23344. W[et]=0;for(b=0;w>b;b++)
  23345. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  23346. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  23347. delete p,h(),J=n(W)}
  23348. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  23349. if("png-src"===i||"jpeg-src"===i)
  23350. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  23351. return B}
  23352. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  23353. OUTPUT.exports = c;
  23354. }, {}
  23355. ],
  23356. 156: [function(e, t, i) {
  23357. (function(i) {
  23358. "use strict";
  23359. function n(e, t) {
  23360. this.model = e,
  23361. this.panos = e.panos,
  23362. this.player = t,
  23363. this.imagePanos = this.listImagePanos(),
  23364. this.retryMinimumTime = 1e4
  23365. }
  23366. var r = (e("three"),
  23367. e("./enum/Viewmode"))
  23368. , o = (e("./settings"),
  23369. e("./objects/Panorama"))
  23370. , a = e("./util/logger")
  23371. , s = new a(i);
  23372. n.prototype.start = function() {
  23373. this.loadNextPano(function(e) {
  23374. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  23375. setTimeout(function() {
  23376. this.start()
  23377. }
  23378. .bind(this), 1e3))
  23379. }
  23380. .bind(this))
  23381. }
  23382. ,
  23383. n.prototype.validLoadTarget = function(e) {
  23384. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23385. }
  23386. ,
  23387. n.prototype.listImagePanos = function() {
  23388. var e = []
  23389. , t = this;
  23390. return this.model.images.forEach(function(i) {
  23391. if (i.metadata && i.metadata.scan_id) {
  23392. var n = t.model.panos.get(i.metadata.scan_id);
  23393. n && !n.isLoaded("high") && e.push(n)
  23394. }
  23395. }),
  23396. e
  23397. }
  23398. ,
  23399. n.prototype.nextNotLoadedImage = function() {
  23400. for (; this.imagePanos.length > 0; ) {
  23401. var e = this.imagePanos[0];
  23402. if (!e.isLoaded("high"))
  23403. return e;
  23404. this.imagePanos.shift()
  23405. }
  23406. return null
  23407. }
  23408. ,
  23409. n.prototype.loadNextPano = function(e) {
  23410. var t, i, n = this.model.waitQueue.filter(function(e) {
  23411. return e.object instanceof o
  23412. });
  23413. n.length > 0 ? (t = n[0].object,
  23414. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23415. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23416. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23417. t = this.imagePanos[0],
  23418. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  23419. t && s.debug("Normal pano selection: neighbor " + t.id)),
  23420. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23421. s.debug("Preloading " + i + "-res pano " + t.id),
  23422. t.loadCube(i).done(e).fail(function() {
  23423. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23424. e()
  23425. })) : e && e(null)
  23426. }
  23427. ,
  23428. t.exports = n
  23429. }
  23430. ).call(this, "/js/preloaders.js")
  23431. }
  23432. , {
  23433. "./enum/Viewmode": 51,
  23434. "./objects/Panorama": 148,
  23435. "./settings": 166,
  23436. "./util/logger": 189,
  23437. three: 217
  23438. }],
  23439. 157: [function(e, t, i) {
  23440. (function(i) {
  23441. "use strict";
  23442. function n(e, t, i, n, r) {
  23443. this.qualityManager = e,
  23444. this.scene = t,
  23445. this.camera = i,
  23446. this.container = r,
  23447. this.controls = n,
  23448. this.controls.enabled = !0,
  23449. this.controls.locked = !0,
  23450. this.quickstartCamera = n.camera,
  23451. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  23452. this.skybox = null
  23453. }
  23454. var r = e("three")
  23455. , o = e("../util/logger")
  23456. , a = e("../constants")
  23457. , s = (e("../util/transitions"),
  23458. e("../util/lerp"),
  23459. e("../util/easing"),
  23460. e("../enum/Vectors"))
  23461. , l = e("../enum/PanoSizeClass")
  23462. , c = (e("../materials/ModelTextureMaterial"),
  23463. e("../materials/CubemapMaterial"))
  23464. , h = (e("../cameras/PanoramaCamera"),
  23465. e("../controls/PanoramaControls"),
  23466. e("../tile/TileUtils"),
  23467. e("../util/camera"),
  23468. e("../util/cameraLight"))
  23469. , u = (e("../util/browser"),
  23470. e("../settings"),
  23471. e("../gui/helpManager"),
  23472. new o(i));
  23473. n.prototype.load = function(e) {
  23474. e.pano.shouldRedrawOnBaseLoaded = !0;
  23475. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23476. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23477. var a = this.qualityManager.getPanoSize(l.BASE)
  23478. , c = this.qualityManager.getPanoSize(l.STANDARD);
  23479. if (e.pano.tiled) {
  23480. u.warn("Loading startPano, TILED", e.pano.id);
  23481. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23482. , p = this.quickstartCamera.fov;
  23483. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  23484. t = e.pano.loadTiledPano(c, r, {
  23485. hFov: d,
  23486. vFov: p
  23487. }, !1, !1, !0),
  23488. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23489. } else
  23490. u.warn("Loading startPano", e.pano.id),
  23491. t = e.pano.loadCube("high");
  23492. return $.when(t).then(function() {
  23493. n.init(e.pano, e.quaternion),
  23494. e.pano.tiled ? i.done(function() {
  23495. e.pano.lockUntilRenderingComplete = !1,
  23496. this.controls.locked = !1
  23497. }
  23498. .bind(this)) : this.controls.locked = !1
  23499. }
  23500. .bind(this))
  23501. }
  23502. ,
  23503. n.prototype.init = function(e, t) {
  23504. u.info("Quickstart done loading, adding scene objects"),
  23505. e.lockUntilRenderingComplete = !0,
  23506. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  23507. side: r.BackSide
  23508. })),
  23509. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23510. this.skybox.quaternion.copy(e.quaternion),
  23511. this.scene.add(this.skybox),
  23512. $(this.container).show()
  23513. }
  23514. ,
  23515. n.prototype.update = function(e) {
  23516. this.controls.update(e),
  23517. this.camera.copy(this.quickstartCamera)
  23518. }
  23519. ,
  23520. n.prototype.setSize = function(e, t) {
  23521. this.quickstartCamera.updateAspect(e / t)
  23522. }
  23523. ,
  23524. n.prototype.destroy = function() {
  23525. this.scene.remove(this.skybox)
  23526. }
  23527. ,
  23528. t.exports = n
  23529. }
  23530. ).call(this, "/js/scene/QuickstartManager.js")
  23531. }
  23532. , {
  23533. "../cameras/PanoramaCamera": 7,
  23534. "../constants": 8,
  23535. "../controls/PanoramaControls": 13,
  23536. "../enum/PanoSizeClass": 36,
  23537. "../enum/Vectors": 50,
  23538. "../gui/helpManager": 68,
  23539. "../materials/CubemapMaterial": 117,
  23540. "../materials/ModelTextureMaterial": 118,
  23541. "../settings": 166,
  23542. "../tile/TileUtils": 174,
  23543. "../util/browser": 182,
  23544. "../util/camera": 183,
  23545. "../util/cameraLight": 184,
  23546. "../util/easing": 186,
  23547. "../util/lerp": 188,
  23548. "../util/logger": 189,
  23549. "../util/transitions": 195,
  23550. three: 217
  23551. }],
  23552. 158: [function(e, t, i) {
  23553. "use strict";
  23554. function n(e, t, i) {
  23555. this.scene = e,
  23556. this.camera = t,
  23557. this.renderer = null,
  23558. this.effects = i,
  23559. this.animateCallback = null,
  23560. this.composer = null,
  23561. this.qualityManager = null,
  23562. e.renderWidth = 0,
  23563. e.renderHeight = 0,
  23564. this.updateClock = new r.Clock,
  23565. this.components = [],
  23566. this.updateListeners = [],
  23567. this.resizeListeners = [],
  23568. this.forceUpdateSize = !1,
  23569. this.started = !1,
  23570. this.textures = {},
  23571. this.suspendedObjects = []
  23572. }
  23573. var r = e("three")
  23574. , o = e("../shaders")
  23575. , a = e("../enum/SceneRendererEvents")
  23576. , s = e("../enum/GLTextureType")
  23577. , l = e("../enum/GLCubeFaces")
  23578. , c = e("../exception/BasicException")
  23579. , h = e("../exception/RendererCreationException")
  23580. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  23581. , m = e("../util/browser")
  23582. /**************************************************************************************************************************************************/
  23583. , u = e("../settings")
  23584. , d = e("events").EventEmitter;
  23585. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  23586. n.prototype = Object.create(d.prototype),
  23587. n.prototype.addComponent = function(e) {
  23588. this.components.push(e),
  23589. e.update && this.updateListeners.push(e),
  23590. e.setSize && (this.resizeListeners.push(e),
  23591. this.forceUpdateSize = !0)
  23592. }
  23593. ,
  23594. n.prototype.removeComponent = function(e) {
  23595. var t = function(t) {
  23596. return t !== e
  23597. };
  23598. this.components = this.components.filter(t),
  23599. this.updateListeners = this.updateListeners.filter(t),
  23600. this.resizeListeners = this.resizeListeners.filter(t)
  23601. }
  23602. ,
  23603. n.prototype.start = function(e) {
  23604. if (this.started)
  23605. throw new c("Can't start SceneRenderer, already started");
  23606. this.createContext(e),
  23607. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  23608. m.isMobile() && this.boluoVrInit(),
  23609. /*******************************************************************************************************************************/
  23610. this.initComposer(),
  23611. this.started = !0,
  23612. (p = p.bind(this))()
  23613. }
  23614. ,
  23615. n.prototype.createContext = function(e) {
  23616. var transparent = !!(settings.transparentBg || settings.bgImg)
  23617. try {
  23618. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  23619. this.renderer.autoClear = !0,
  23620. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  23621. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  23622. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  23623. this.emit(a.ContextCreated)
  23624. } catch (e) {
  23625. throw new h("Unable to create a WebGL rendering context")
  23626. }
  23627. u.profiling.enabled && this.overrideTextures(),
  23628. e.appendChild(this.renderer.domElement)
  23629. /* window.stats = new Stats();
  23630. e.appendChild( stats.dom ); */
  23631. }
  23632. ,
  23633. n.prototype.overrideTextures = function() {
  23634. var e = this.renderer.context
  23635. , t = 0
  23636. , i = e.createTexture;
  23637. e.createTexture = function() {
  23638. var n = i.call(e);
  23639. return n.id = t++,
  23640. this.textures[n.id] = n,
  23641. n
  23642. }
  23643. .bind(this);
  23644. var n = e.texImage2D;
  23645. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  23646. var d, p = this.getTextureTypeFromTarget(e, t);
  23647. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  23648. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  23649. h = a,
  23650. u = l,
  23651. o = u.naturalWidth,
  23652. a = u.naturalHeight,
  23653. n.call(e, t, i, r, c, h, u));
  23654. var f = this.textures[d.id];
  23655. f.width = p === s.TextureCube ? 6 * o : o,
  23656. f.height = a
  23657. }
  23658. .bind(this);
  23659. var r = e.deleteTexture;
  23660. e.deleteTexture = function(t) {
  23661. delete this.textures[t.id],
  23662. r.call(e, t)
  23663. }
  23664. .bind(this)
  23665. }
  23666. ,
  23667. n.prototype.updateTextureMemory = function() {
  23668. var e = null;
  23669. return function() {
  23670. var t = 0;
  23671. for (var i in this.textures) {
  23672. var n = this.textures[i];
  23673. n.width && n.height && (t += n.width * n.height * 4)
  23674. }
  23675. t !== e && this.emit(a.MemoryUsageUpdated, t),
  23676. e = t
  23677. }
  23678. }(),
  23679. n.prototype.getTextureTypeFromTarget = function(e, t) {
  23680. switch (t) {
  23681. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  23682. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  23683. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  23684. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23685. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  23686. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23687. return s.TextureCube;
  23688. case e.TEXTURE_2D:
  23689. return s.Texture2D;
  23690. default:
  23691. return null
  23692. }
  23693. }
  23694. ,
  23695. n.prototype.initComposer = function() {
  23696. this.composer = new r.EffectComposer(this.renderer),
  23697. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  23698. //this.composer.addPass(this.effects.hblurPass),
  23699. //this.composer.addPass(this.effects.vblurPass)
  23700. this.composer.addPass(this.effects.transitionMaskPass)//add
  23701. }
  23702. ,
  23703. n.prototype.setSize = function(e, t, devicePixelRatio) {
  23704. this.renderWidth = e,
  23705. this.renderHeight = t,
  23706. this.effects.aspect = e / t,
  23707. /* this.renderer.setSize(e, t), -----MP */
  23708. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  23709. this.composer.setSize(e, t);
  23710. for (var i = 0; i < this.resizeListeners.length; i++)
  23711. this.resizeListeners[i].setSize(e, t)
  23712. }
  23713. ,
  23714. n.prototype.render = function() {
  23715. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23716. this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  23717. }
  23718. /******************************************************************************************************徐世廷**********************************************************************/
  23719. var vrPermission = {};
  23720. var vrPermissionCallBack = function(info1,info2){
  23721. if(info1 == "reset"){
  23722. vrPermission = {};
  23723. }else{
  23724. vrPermission[info1] = info2
  23725. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  23726. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  23727. }
  23728. }
  23729. }
  23730. n.prototype.boluoVrInit = function() {
  23731. console.log("boluoVrInit")
  23732. this.isHuawei5X = m.detectHUAWEI5X(),
  23733. this.oldRenderer = this.renderer,
  23734. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  23735. window.panoCamera = this.camera;
  23736. var a = this;
  23737. window._vrEnabled = !1,
  23738. Object.defineProperty(window, "vrEnabled", {
  23739. get: function() {
  23740. return window._vrEnabled
  23741. },
  23742. set: function(b) {
  23743. b = !!b,
  23744. b ? (a.renderer = a.newRenderer,
  23745. window.vrMarkers.forEach(function(a) {
  23746. a.visible = !0
  23747. })) : (a.renderer = a.oldRenderer,
  23748. window.vrMarkers.forEach(function(a) {
  23749. a.visible = !1
  23750. })),
  23751. a.cursor.visible = b,
  23752. a.setSize(window.innerWidth, window.innerHeight),
  23753. window._vrEnabled = b
  23754. if(b){
  23755. setTimeout(function(){
  23756. console.log("orientEnable"+window.orientEnable)
  23757. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  23758. if(m.detectIOS()/* && m.detectSafari() */){
  23759. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  23760. console.log("开始获取权限 major"+b.major)
  23761. if(b.major == 12 && b.minor>=2){
  23762. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  23763. else{//app??
  23764. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  23765. }
  23766. }else if(b.major >= 13){
  23767. if(!window.location.href.includes("https://")){
  23768. console.log("需要https");
  23769. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  23770. return;
  23771. }
  23772. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  23773. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  23774. if(!window.vrEnabled || window.orientEnable)return;
  23775. vrPermissionCallBack("reset")
  23776. console.log(window.DeviceMotionEvent)
  23777. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  23778. console.log("开始获取权限1")
  23779. ///注意:需要https 本地服务器permissionState会得到denied
  23780. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  23781. console.log("permissionState1: "+permissionState)
  23782. vrPermissionCallBack("deviceMotion", permissionState)
  23783. }).catch(function(e){
  23784. vrPermissionCallBack("deviceMotion", false)
  23785. console.log(e)
  23786. })
  23787. }else{
  23788. console.log("window.DeviceMotionEvent undefined")
  23789. vrPermissionCallBack("deviceMotion", false)
  23790. }
  23791. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  23792. console.log("开始获取权限2")
  23793. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  23794. console.log("permissionState2: "+permissionState)
  23795. vrPermissionCallBack("deviceOrientation", permissionState)
  23796. }).catch(function(e){
  23797. vrPermissionCallBack("deviceOrientation", false)
  23798. console.log(e)
  23799. })
  23800. }else{
  23801. console.log("window.DeviceOrientationEvent undefined")
  23802. vrPermissionCallBack("deviceOrientation", false)
  23803. }
  23804. },hasFailed ? 0 : 150)
  23805. /* /* setTimeout(function(){
  23806. if(settings.vrEnabled && !window.orientEnable){
  23807. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  23808. }
  23809. },4000) */
  23810. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  23811. }else{
  23812. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  23813. }
  23814. }else{
  23815. //已经触发了
  23816. }
  23817. },200);
  23818. }
  23819. }
  23820. }),
  23821. this.createCursor(.5, !1, 1, 16777215, 0);
  23822. var b = {
  23823. setSize: function(b, c) {
  23824. a.camera.aspect = b / c
  23825. }
  23826. };
  23827. this.resizeListeners.push(b),
  23828. this.vrLoadingInit()
  23829. }
  23830. ,
  23831. n.prototype.vrLoadingInit = function() {
  23832. var a = function(camera) {
  23833. var a = this
  23834. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  23835. , c = new r.MeshBasicMaterial({
  23836. color: 4967932,
  23837. side: r.DoubleSide
  23838. })
  23839. , d = new r.Mesh(b,c);
  23840. this.mesh = d,
  23841. d.position.z = -2,
  23842. d.scale.set(.08, .08, .08),
  23843. d.visible = !1,
  23844. camera.add(d),
  23845. //window.player.camera.add(d),
  23846. a.enabled = !1,
  23847. this.update = function(b) {
  23848. 1 == a.enabled && (d.rotation.z += 15 * b)
  23849. }
  23850. }
  23851. , a = new a(this.camera);
  23852. window.Loading = a,
  23853. this.updateListeners.push(a)
  23854. }
  23855. ,
  23856. n.prototype.createCursor = function(a, b, c, d, e) {
  23857. var g, h = new r.SpriteMaterial({
  23858. opacity: c,
  23859. color: d,
  23860. transparent: b,
  23861. map: this.boluoGetTexture("static/images/cursor.png"),
  23862. needsUpdate: !0,
  23863. side: r.DoubleSide
  23864. });
  23865. h.map.offset = new r.Vector2(1 / 17 * e,0),
  23866. h.map.repeat = new r.Vector2(1 / 17,1),
  23867. h.depthTest = !1,
  23868. h.blending = r.AdditiveBlending,
  23869. g = new r.Sprite(h),
  23870. // g.scale.set(a, a, a),
  23871. g.scale.set(.3,.3,.3)
  23872. g.position.z = -2,
  23873. g.visible = !1,
  23874. g.name = "cursor",
  23875. this.camera.add(g),
  23876. this.scene.add(this.camera),
  23877. this.cursor = g;
  23878. var i = new this.CursorAnimation(this.scene,g,this.camera);
  23879. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  23880. this.updateListeners.push(i)
  23881. }
  23882. ,
  23883. window.orientEnable = 0; //是否能触发deviceorientation
  23884. n.prototype.CursorAnimation = function(a, b, c) {
  23885. function d() {
  23886. g.orient = r.Math.degToRad(window.orientation || 0)
  23887. }
  23888. function e(a) {
  23889. if(!window.vrEnabled && window.orientEnable) return;
  23890. window.orientEnable || (window.orientEnable = 1);
  23891. var b = r.Math.degToRad(a.alpha)
  23892. , c = r.Math.degToRad(a.beta)
  23893. , d = r.Math.degToRad(a.gamma);
  23894. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  23895. -1e3 === g.beta && (g.beta = c),
  23896. -1e3 === g.gamma && (g.gamma = d),
  23897. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  23898. Math.abs(c - g.beta) > .006 && (g.beta = c),
  23899. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  23900. g.beta = c,
  23901. g.gamma = d),
  23902. n.vrDebug) {
  23903. $("#info-device-orientation").css("display", "block");
  23904. var e = "";
  23905. e += "alpha=(" + g.alpha + ")<BR/>",
  23906. e += "beta=(" + g.beta + ")<BR/>",
  23907. e += "gamma=" + g.gamma + "<BR/>",
  23908. document.getElementById("info-device-orientation").innerHTML = e
  23909. }
  23910. }
  23911. this.cursor = b,
  23912. this.raycaster = new r.Raycaster,
  23913. this.targetEventObj = {},
  23914. this.type = 1,
  23915. this.tweenFlag = !0;
  23916. var g = this;
  23917. this.target = c,
  23918. console.log(c.uuid),
  23919. this.euler = new r.Euler,
  23920. this.q0 = new r.Quaternion,
  23921. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23922. this.zee = new r.Vector3(0,0,1),
  23923. this.alpha = -1e3,
  23924. this.beta = -1e3,
  23925. this.gamma = -1e3,
  23926. this.orient = r.Math.degToRad(window.orientation || 0),
  23927. window.addEventListener("orientationchange", d),
  23928. window.addEventListener("deviceorientation", e),
  23929. this.setObjectQuaternion = function(a, b, d, e, f) {
  23930. g.euler.set(d, b, -e, "YXZ"),
  23931. a.setFromEuler(g.euler),
  23932. a.multiply(g.q1),
  23933. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  23934. c.updateMatrixWorld()
  23935. }
  23936. ,
  23937. parent !== window && window.addEventListener("message", function(a) {
  23938. var b = JSON.parse(a.data)
  23939. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23940. b && b.alpha && b.beta && b.gamma && function(a) {
  23941. var c = r.Math.degToRad(b.alpha)
  23942. , d = r.Math.degToRad(b.beta)
  23943. , e = r.Math.degToRad(b.gamma);
  23944. a ? (-1e3 === g.alpha && (g.alpha = c),
  23945. -1e3 === g.beta && (g.beta = d),
  23946. -1e3 === g.gamma && (g.gamma = e),
  23947. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  23948. Math.abs(d - g.beta) > .006 && (g.beta = d),
  23949. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  23950. g.beta = d,
  23951. g.gamma = e)
  23952. }(c)
  23953. }),
  23954. this.update = function(a) {
  23955. TWEEN.update();
  23956. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  23957. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  23958. this.triggerTargetEvent())
  23959. }
  23960. ,
  23961. this.triggerTargetEvent = function() {
  23962. var a = this.choseObj()
  23963. , b = a ? a.object : void 0;
  23964. this.targetEventObj.currentObj = b,
  23965. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  23966. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23967. b && b.enabled && this.startAnimate(function() {
  23968. this.clickCallback(b)
  23969. }
  23970. .bind(this))) : this.type,
  23971. this.targetEventObj.lastObj = b)
  23972. }
  23973. ,
  23974. this.choseObj = function() {
  23975. this.raycaster.setFromCamera({
  23976. x: 0,
  23977. y: 0
  23978. }, c);
  23979. var a = (this.raycaster.ray,
  23980. window.vrMarkers)
  23981. , b = this.raycaster.intersectObjects(a);
  23982. if (b.length > 0)
  23983. return b[0]
  23984. }
  23985. ,
  23986. this.clickCallback = function(a) {
  23987. this.runTHREEAction(a, "onclick")
  23988. }
  23989. ,
  23990. this.runTHREEAction = function(a, b) {
  23991. switch (b) {
  23992. case "onclick":
  23993. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  23994. a()
  23995. });
  23996. break;
  23997. case "onhover":
  23998. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  23999. a()
  24000. });
  24001. break;
  24002. case "onout":
  24003. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24004. a()
  24005. })
  24006. }
  24007. }
  24008. ,
  24009. this.startAnimate = function(a) {
  24010. this.tweenFlag && this.initAnimation(a)
  24011. }
  24012. ,
  24013. this.initAnimation = function(a) {
  24014. var b = this
  24015. , c = this.cursor.material.map.offset
  24016. , d = function(a) {
  24017. return Math.floor(17 * a) / 17
  24018. };
  24019. b.tweenFlag = !1,
  24020. this.cursorAnimate = new TWEEN.Tween(c).to({
  24021. x: 1
  24022. }, 1e3).onStart(function() {
  24023. b.tweenFlag = !1
  24024. }).onStop(function() {
  24025. b.tweenFlag = !0,
  24026. this.x = 0,
  24027. c.x = 0
  24028. }).onUpdate(function() {}).onComplete(function() {
  24029. a(),
  24030. c.x = 0,
  24031. setTimeout(function() {
  24032. b.tweenFlag = !0
  24033. }, 1500)
  24034. }),
  24035. this.cursorAnimate.easing(d),
  24036. this.cursorAnimate.start()
  24037. }
  24038. ,
  24039. this.autoCursorPosition = function(a) {
  24040. // var b = Math.abs(a.distance - 10);
  24041. // this.cursor.position.z = -b,
  24042. // b /= 10;
  24043. // alert(b);
  24044. // this.cursor.scale.set(b, b, b)
  24045. this.cursor.scale.set(.3,.3,.3)
  24046. }
  24047. }
  24048. ,
  24049. n.prototype.vrRenderer = function(a, b, c) {
  24050. var d = new b.vrCamera(c);
  24051. d.bananaAspect = .8,
  24052. this.width,
  24053. this.height;
  24054. var b = this;
  24055. this.setSize = function(c, d) {
  24056. a.setSize.call(this, c, d),
  24057. b.width = c,
  24058. b.height = d
  24059. }
  24060. ,
  24061. this.render = function(b, c, e, f) {
  24062. window.cameraQua = c.quaternion.clone();
  24063. var g, h;
  24064. if (c.__RESS__SKIP__STEREO__)
  24065. return a.render(b, c, e, f);
  24066. if ("PerspectiveCamera" === c.type)
  24067. g = d.cameraL,
  24068. h = d.cameraR,
  24069. b.updateMatrixWorld(),
  24070. null === c.parent && c.updateMatrixWorld(),
  24071. d.vrCameraUpdate(c);
  24072. else {
  24073. if ("OrthographicCamera" !== c.type)
  24074. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24075. g = h = c
  24076. }
  24077. a.setScissorTest(!0),
  24078. a.setScissor(0, 0, this.width / 2, this.height),
  24079. a.setViewport(0, 0, this.width / 2, this.height),
  24080. a.render.call(this, b, g, e, f),
  24081. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24082. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24083. a.render.call(this, b, h, e, f),
  24084. a.setScissorTest(!1)
  24085. }
  24086. ,
  24087. this.__proto__ = {
  24088. __proto__: a
  24089. }
  24090. }
  24091. ,
  24092. n.prototype.vrCamera = function(a) {
  24093. this.type = "StereoCamera",
  24094. this._aspect = 1,
  24095. this._overlap = .064,
  24096. this.cameraL = new r.PerspectiveCamera,
  24097. this.cameraL.layers.enable(1),
  24098. this.cameraL.near = 0.01,//xzw add
  24099. this.cameraL.matrixAutoUpdate = !1,
  24100. this.cameraR = new r.PerspectiveCamera,
  24101. this.cameraR.layers.enable(2),
  24102. this.cameraR.near = 0.01,//xzw add
  24103. this.cameraR.matrixAutoUpdate = !1,
  24104. this.eyeRight = new r.Matrix4,
  24105. this.eyeLeft = new r.Matrix4,
  24106. this.vrCameraNeedsUpdate = !0,
  24107. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24108. Object.defineProperty(this, "bananaAspect", {
  24109. get: function() {
  24110. return this._aspect
  24111. },
  24112. set: function(a) {
  24113. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24114. this._aspect = a
  24115. }
  24116. }),
  24117. Object.defineProperty(this, "overlap", {
  24118. get: function() {
  24119. return this._overlap
  24120. },
  24121. set: function(a) {
  24122. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24123. this._overlap = a
  24124. }
  24125. }),
  24126. this.vrCameraUpdate = function(a) {
  24127. this.vrCameraNeedsUpdate = true;
  24128. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24129. this.vrCameraNeedsUpdate) {
  24130. this.vrCameraNeedsUpdate = !1,
  24131. //console.debug("vrCameraUpdate"),
  24132. this.bananaFocus = a.focus,
  24133. this.bananaFov = a.fov,
  24134. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24135. this.bananaNear = a.near,
  24136. this.bananaFar = a.far,
  24137. //console.debug(a.aspect),
  24138. this.bananaFocus = 10;
  24139. var b, c, d = a.projectionMatrix.clone(), e = this.overlap / 2, f = e * this.bananaNear / this.bananaFocus, g = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  24140. this.eyeLeft.elements[12] = -e,
  24141. this.eyeRight.elements[12] = e,
  24142. b = -g * this.bananaReal_aspect + f,
  24143. c = g * this.bananaReal_aspect + f,
  24144. d.elements[0] = 2 * this.bananaNear / (c - b),
  24145. d.elements[8] = (c + b) / (c - b),
  24146. this.cameraL.projectionMatrix.copy(d),
  24147. b = -g * this.bananaReal_aspect - f,
  24148. c = g * this.bananaReal_aspect - f,
  24149. d.elements[0] = 2 * this.bananaNear / (c - b),
  24150. d.elements[8] = (c + b) / (c - b),
  24151. this.cameraR.projectionMatrix.copy(d)
  24152. }
  24153. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24154. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24155. }
  24156. }
  24157. ,
  24158. n.prototype.boluoGetTexture = function(a) {
  24159. var b = new r.TextureLoader;
  24160. return b.crossOrigin = "anonymous",
  24161. b.load(a)
  24162. }
  24163. ,
  24164. /***********************************************************************************************************************************************************************************/
  24165. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24166. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24167. return function(o){
  24168. var render = false;
  24169. var ratio;
  24170. var w, h; //记录应当render的大小
  24171. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  24172. w = o.width, h = o.height, render = true, ratio=1;
  24173. }else{
  24174. w = $('#player').width();
  24175. h = $('#player').height();
  24176. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  24177. (w !== W || h !== H || this.forceUpdateSize) &&
  24178. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  24179. }
  24180. if(render){
  24181. this.setSize(w, h, ratio);
  24182. this.forceUpdateSize = !1
  24183. }
  24184. }
  24185. }()
  24186. ,
  24187. n.prototype.updateComponents = function() {
  24188. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  24189. this.updateListeners[t].update(e)
  24190. }
  24191. ,
  24192. n.prototype.suspend = function() {
  24193. this.started = !1,
  24194. this.suspendedObjects = this.scene.children.map(function(e) {
  24195. return this.scene.remove(e),
  24196. e
  24197. }
  24198. .bind(this)),
  24199. this.render()
  24200. }
  24201. ,
  24202. n.prototype.resume = function() {
  24203. this.suspendedObjects.forEach(function(e) {
  24204. this.scene.add(e)
  24205. }
  24206. .bind(this)),
  24207. this.suspendedObjects = [],
  24208. this.started = !0,
  24209. p()
  24210. }
  24211. ;
  24212. var p = function() {
  24213. this.started && (window.requestAnimationFrame(p),
  24214. this.updateScreenSize(), // fyz resize
  24215. this.updateComponents(),
  24216. this.updateTextureMemory(),
  24217. this.render(),
  24218. window.stats && (window.fps = stats.update()),
  24219. this.emit(a.AfterRender))
  24220. };
  24221. n.prototype.getImageData = function() {
  24222. var e = document.createElement("canvas")
  24223. , t = e.getContext("2d");
  24224. return function(i, n, r) {
  24225. return e.width === n && e.height === r || (e.width = n,
  24226. e.height = r),
  24227. t.drawImage(i, 0, 0, n, r),
  24228. t.getImageData(0, 0, n, r)
  24229. }
  24230. }(),
  24231. n.prototype.initSizedTexture2D = function(e, t, i) {
  24232. var n = this.renderer
  24233. , o = n.context
  24234. , a = n.state
  24235. , s = new r.Texture(null);
  24236. s.flipY = !1,
  24237. i !== !0 && (i = !1),
  24238. s.generateMipmaps = i;
  24239. var l = n.paramThreeToGL(s.format)
  24240. , c = n.paramThreeToGL(s.type)
  24241. , h = n.properties.get(s)
  24242. , u = o.createTexture();
  24243. a.bindTexture(o.TEXTURE_2D, u),
  24244. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  24245. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  24246. s.wrapS = t,
  24247. s.wrapT = t;
  24248. var d = n.paramThreeToGL(t);
  24249. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24250. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24251. i ? (s.magFilter = r.LinearFilter,
  24252. s.minFilter = r.LinearMipMapLinearFilter,
  24253. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24254. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  24255. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  24256. s.minFilter = r.LinearFilter,
  24257. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24258. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  24259. a.bindTexture(o.TEXTURE_2D, null),
  24260. h.__webglTexture = u,
  24261. s
  24262. }
  24263. ,
  24264. n.prototype.initSizedCubeMap = function(e, t) {
  24265. var i = this.renderer
  24266. , n = i.context
  24267. , o = i.state
  24268. , a = new r.CubeTexture([null, null, null, null, null, null]);
  24269. a.flipY = !1,
  24270. a.generateMipmaps = t;
  24271. var s = i.paramThreeToGL(a.format)
  24272. , l = i.paramThreeToGL(a.type)
  24273. , c = i.properties.get(a)
  24274. , h = n.createTexture();
  24275. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  24276. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  24277. for (var u = 0; u < 6; u++)
  24278. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  24279. return t ? (a.magFilter = r.LinearFilter,
  24280. a.minFilter = r.LinearMipMapLinearFilter,
  24281. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24282. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  24283. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  24284. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  24285. a.minFilter = r.LinearFilter,
  24286. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24287. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  24288. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  24289. c.__image__webglTextureCube = h,
  24290. a
  24291. }
  24292. ,
  24293. n.prototype.deallocateCubeTexture = function(e) {
  24294. var t = this.renderer
  24295. , i = t.context
  24296. , n = t.properties.get(e);
  24297. i.deleteTexture(n.__image__webglTextureCube)
  24298. }
  24299. ,
  24300. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  24301. var a = this.renderer
  24302. , s = a.context
  24303. , l = a.state
  24304. , c = a.properties.get(t);
  24305. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  24306. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24307. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  24308. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  24309. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  24310. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  24311. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  24312. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  24313. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  24314. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  24315. l.bindTexture(s.TEXTURE_2D, null)
  24316. }
  24317. ,
  24318. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  24319. var s = this.renderer
  24320. , l = s.context
  24321. , c = s.state
  24322. , h = s.properties.get(t);
  24323. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  24324. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24325. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  24326. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  24327. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  24328. }
  24329. ,
  24330. n.prototype.rebuildMipMaps2D = function(e) {
  24331. var t = this.renderer
  24332. , i = t.context
  24333. , n = t.state;
  24334. t.properties.get(e);
  24335. i.generateMipmap(i.TEXTURE_2D),
  24336. n.bindTexture(i.TEXTURE_2D, null)
  24337. }
  24338. ,
  24339. n.prototype.rebuildMipMaps3D = function(e) {
  24340. var t = this.renderer
  24341. , i = t.context
  24342. , n = t.state
  24343. , r = t.properties.get(e);
  24344. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  24345. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  24346. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  24347. }
  24348. ,
  24349. n.prototype.renderToCubeMap = function() {
  24350. var e = !1
  24351. , t = null
  24352. , i = null
  24353. , n = null
  24354. , a = null
  24355. , s = null
  24356. , l = 1;
  24357. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  24358. var _ = this.renderer;
  24359. _.context;
  24360. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  24361. i.position.z = 150,
  24362. t = new r.Scene,
  24363. t.add(i),
  24364. n = new r.ShaderMaterial({
  24365. uniforms: {
  24366. tDiffuse: {
  24367. type: "t",
  24368. value: null
  24369. },
  24370. alpha: {
  24371. type: "f",
  24372. value: 1
  24373. }
  24374. },
  24375. vertexShader: o.basicTextured.vertexShader,
  24376. fragmentShader: o.basicTextured.fragmentShader,
  24377. depthWrite: !1,
  24378. depthTest: !1,
  24379. side: r.DoubleSide
  24380. }),
  24381. a = new r.PlaneBufferGeometry(l,l),
  24382. s = new r.Mesh(a,n),
  24383. s.position.z = 0,
  24384. t.add(s),
  24385. e = !0);
  24386. var T = a.getAttribute("uv");
  24387. T.setDynamic(!0),
  24388. T.needsUpdate = !0;
  24389. var x = T.array
  24390. , S = p / u
  24391. , M = f / d
  24392. , R = g / u
  24393. , P = m / d;
  24394. x[0] = S,
  24395. x[1] = M + P,
  24396. x[2] = S + R,
  24397. x[3] = M + P,
  24398. x[4] = S,
  24399. x[5] = M,
  24400. x[6] = S + R,
  24401. x[7] = M;
  24402. var O = a.getAttribute("position");
  24403. O.setDynamic(!0),
  24404. O.needsUpdate = !0;
  24405. var L = O.array
  24406. , D = v / h.width - l / 2
  24407. , N = A / h.height - l / 2
  24408. , B = y / h.width
  24409. , F = C / h.height;
  24410. L[0] = D,
  24411. L[1] = N + F,
  24412. L[3] = D + B,
  24413. L[4] = N + F,
  24414. L[6] = D,
  24415. L[7] = N,
  24416. L[9] = D + B,
  24417. L[10] = N;
  24418. this.renderer.properties.get(c);
  24419. n.uniforms.tDiffuse.value = c,
  24420. n.blending = E || r.NoBlending,
  24421. n.transparent = !!b,
  24422. void 0 !== w && null !== w || (w = 1),
  24423. n.uniforms.alpha.value = w,
  24424. n.needUpdate = !0,
  24425. h.activeCubeFace = I,
  24426. h.viewport.set(0, 0, h.width, h.height);
  24427. var V = this.renderer.autoClear;
  24428. this.renderer.autoClear = !1,
  24429. this.renderer.render(t, i, h, !1),
  24430. this.renderer.autoClear = V
  24431. }
  24432. }(),
  24433. n.prototype.copyCubeMap = function() {
  24434. var e = !1
  24435. , t = null
  24436. , i = null
  24437. , a = null
  24438. , s = null
  24439. , l = null
  24440. , c = new r.Euler;
  24441. new r.Vector3;
  24442. return function(h, u, d, p, f, g, m, v, A) {
  24443. this.renderer;
  24444. if (!e) {
  24445. var y = 2;
  24446. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  24447. i.position.set(0, 0, 0),
  24448. t = new r.Scene,
  24449. t.add(i),
  24450. a = new r.ShaderMaterial({
  24451. uniforms: {
  24452. tDiffuse: {
  24453. type: "t",
  24454. value: null
  24455. },
  24456. alpha: {
  24457. type: "f",
  24458. value: 1
  24459. }
  24460. },
  24461. vertexShader: o.copyCubeMap.vertexShader,
  24462. fragmentShader: o.copyCubeMap.fragmentShader,
  24463. depthWrite: !1,
  24464. depthTest: !1,
  24465. side: r.DoubleSide
  24466. }),
  24467. s = new r.BoxGeometry(y,y,y),
  24468. l = new r.Mesh(s,a),
  24469. t.add(l),
  24470. e = !0
  24471. }
  24472. for (var C = 0; C < 6; C++)
  24473. n.getCubeOrientationForCubeFace(C, c),
  24474. l.rotation.copy(c),
  24475. l.matrixWorldNeedsUpdate = !0,
  24476. l.updateMatrixWorld(),
  24477. a.uniforms.tDiffuse.value = h,
  24478. a.blending = m || r.NoBlending,
  24479. a.transparent = !!v,
  24480. void 0 !== A && null !== A || (A = 1),
  24481. a.uniforms.alpha.value = A,
  24482. a.needUpdate = !0,
  24483. u.activeCubeFace = C,
  24484. u.viewport.set(0, 0, f, g),
  24485. this.renderer.render(t, i, u, !1)
  24486. }
  24487. }(),
  24488. n.getLookAtForCubeFace = function(e, t) {
  24489. switch (e) {
  24490. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24491. t.set(1, 0, 0);
  24492. break;
  24493. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24494. t.set(-1, 0, 0);
  24495. break;
  24496. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24497. t.set(0, 1, 0);
  24498. break;
  24499. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24500. t.set(0, -1, 0);
  24501. break;
  24502. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24503. t.set(0, 0, 1);
  24504. break;
  24505. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24506. t.set(0, 0, -1)
  24507. }
  24508. }
  24509. ,
  24510. n.getCubeOrientationForCubeFace = function(e, t) {
  24511. switch (e) {
  24512. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24513. t.set(0, -Math.PI / 2, 0);
  24514. break;
  24515. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24516. t.set(0, Math.PI / 2, 0);
  24517. break;
  24518. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24519. t.set(Math.PI / 2, Math.PI, 0);
  24520. break;
  24521. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24522. t.set(-Math.PI / 2, Math.PI, 0);
  24523. break;
  24524. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24525. t.set(0, -Math.PI, 0);
  24526. break;
  24527. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24528. t.set(0, 0, 0)
  24529. }
  24530. }
  24531. ,
  24532. t.exports = n
  24533. }
  24534. , {
  24535. "../enum/GLCubeFaces": 25,
  24536. "../enum/GLTextureType": 26,
  24537. "../enum/SceneRendererEvents": 43,
  24538. "../exception/BasicException": 55,
  24539. "../exception/RendererCreationException": 57,
  24540. "../settings": 166,
  24541. "../shaders": 167,
  24542. /********************************************************************fyz改 from徐世廷**********************************************************************/
  24543. "../util/browser": 182,
  24544. /************************************************************************************************************************************************/
  24545. events: 202,
  24546. three: 217
  24547. }],
  24548. 159: [function(e, t, i) {
  24549. "use strict";
  24550. function n(e) {
  24551. this.messenger = new a(e),
  24552. this.clientKey = null
  24553. }
  24554. var r = e("../util/ajax")
  24555. , o = e("./PostMessageType")
  24556. , a = e("./postmessage")
  24557. , s = e("./VersionInfo")
  24558. , l = e("events").EventEmitter
  24559. , c = window.location.origin + "/api/v1/user/";
  24560. n.prototype = Object.create(l.prototype),
  24561. n.prototype.bindEvents = function() {
  24562. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  24563. }
  24564. ,
  24565. n.prototype.waitForConnection = function() {
  24566. var e = new Promise(function(e, t) {
  24567. this.messenger.on(o.CONNECT, function(i) {
  24568. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  24569. }
  24570. .bind(this))
  24571. }
  24572. .bind(this));
  24573. return e
  24574. }
  24575. ,
  24576. n.prototype.onConnectionReceived = function(e) {
  24577. return this.messenger.setTarget(e.source, e.origin),
  24578. this.verifyConnection(e).then(function(t, i) {
  24579. this.messenger.send({
  24580. type: o.ACCEPT,
  24581. toId: e.fromId,
  24582. warning: i
  24583. }),
  24584. this.clientKey = t,
  24585. this.messenger.removeAllListeners(o.CONNECT),
  24586. this.bindEvents()
  24587. }
  24588. .bind(this), function(t) {
  24589. this.messenger.send({
  24590. type: o.REJECT,
  24591. toId: e.fromId,
  24592. reason: t
  24593. }),
  24594. this.messenger.setTarget()
  24595. }
  24596. .bind(this))
  24597. }
  24598. ,
  24599. n.prototype.verifyConnection = function(e) {
  24600. return new Promise(function(t, i) {
  24601. var n;
  24602. if (s.isDeprecated(e.sdkVersion))
  24603. n = "这个版本正在被弃用";
  24604. else if (!s.isSupported(e.sdkVersion))
  24605. return i("不支持此版本的SDK");
  24606. var o = {
  24607. cache: !1,
  24608. headers: {
  24609. "X-port-Application-Key": e.applicationKey,
  24610. "X-port-Referrer": e.origin
  24611. }
  24612. };
  24613. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  24614. }
  24615. )
  24616. }
  24617. ,
  24618. n.prototype.onMessageReceived = function(e) {
  24619. if (this.validateClientApplicationKey(e.applicationKey)) {
  24620. var t = this;
  24621. e.onDone = function(i) {
  24622. i.toId = e.fromId,
  24623. i.uid = e.uid,
  24624. i.type = o.RESPONSE,
  24625. t.messenger.send(i)
  24626. }
  24627. ,
  24628. this.emit(o.ACTION, e)
  24629. }
  24630. }
  24631. ,
  24632. n.prototype.validateClientApplicationKey = function(e) {
  24633. return this.clientKey === e
  24634. }
  24635. ,
  24636. n.prototype.sendEvent = function(e, t) {
  24637. this.messenger.send({
  24638. type: o.EVENT,
  24639. eventType: e,
  24640. eventData: t
  24641. })
  24642. }
  24643. ,
  24644. t.exports = n
  24645. }
  24646. , {
  24647. "../util/ajax": 181,
  24648. "./PostMessageType": 160,
  24649. "./VersionInfo": 163,
  24650. "./postmessage": 165,
  24651. events: 202
  24652. }],
  24653. 160: [function(e, t, i) {
  24654. "use strict";
  24655. t.exports = Object.freeze({
  24656. CONNECT: "postmessage.connect",
  24657. ACCEPT: "postmessage.accept",
  24658. REJECT: "postmessage.reject",
  24659. ACTION: "postmessage.action",
  24660. RESPONSE: "postmessage.response",
  24661. EVENT: "postmessage.event"
  24662. })
  24663. }
  24664. , {}],
  24665. 161: [function(e, t, i) {
  24666. "use strict";
  24667. t.exports = Object.freeze({
  24668. MOVE: "sdk.move",
  24669. ENTER_PANO: "sdk.enterpano",
  24670. MODEL_LOADED: "sdk.modelloaded"
  24671. })
  24672. }
  24673. , {}],
  24674. 162: [function(e, t, i) {
  24675. "use strict";
  24676. t.exports = Object.freeze({
  24677. FLY: "transition.fly",
  24678. FADEOUT: "transition.fade",
  24679. INSTANT: "transition.instant"
  24680. })
  24681. }
  24682. , {}],
  24683. 163: [function(e, t, i) {
  24684. "use strict";
  24685. t.exports = {
  24686. current: "1.0",
  24687. supported: ["1.0"],
  24688. deprecated: [],
  24689. isSupported: function(e) {
  24690. return this.supported.indexOf(e) !== -1
  24691. },
  24692. isDeprecated: function(e) {
  24693. return this.deprecated.indexOf(e) !== -1
  24694. },
  24695. isValid: function(e) {
  24696. return this.isSupported(e) || this.isDeprecated(e)
  24697. }
  24698. }
  24699. }
  24700. , {}],
  24701. 164: [function(e, t, i) {
  24702. (function(i) {
  24703. "use strict";
  24704. function n(e, t, i) {
  24705. e && (e = e.toLowerCase().trim());
  24706. var n = new I.UP.clone
  24707. , r = Math.PI / 3
  24708. , o = Math.PI / 2;
  24709. switch (e) {
  24710. case "left":
  24711. i.copy(t),
  24712. i.applyAxisAngle(n, o);
  24713. break;
  24714. case "right":
  24715. i.copy(t),
  24716. i.applyAxisAngle(n, -o);
  24717. break;
  24718. case "forwardleft":
  24719. i.copy(t),
  24720. i.applyAxisAngle(n, r);
  24721. break;
  24722. case "forwardright":
  24723. i.copy(t),
  24724. i.applyAxisAngle(n, -r);
  24725. break;
  24726. case "forward":
  24727. default:
  24728. i.copy(t)
  24729. }
  24730. return i
  24731. }
  24732. function r(e, t) {
  24733. if (e) {
  24734. var i = {
  24735. pano: e,
  24736. lookAtPoint: null,
  24737. duration: null,
  24738. maxDistanceOverride: null,
  24739. skipWarpingCheck: !1
  24740. };
  24741. this.player.flyToPano(i, function() {
  24742. t && t({
  24743. success: !0,
  24744. message: "Transition complete."
  24745. })
  24746. })
  24747. } else
  24748. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  24749. t && t({
  24750. success: !1,
  24751. error: "Unable to find pano."
  24752. })
  24753. }
  24754. function o(e, t) {
  24755. var i = this.findRankedPano(e, t);
  24756. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24757. null)
  24758. }
  24759. function a(e, t) {
  24760. var i = this.findRankedtag(e, t);
  24761. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24762. null)
  24763. }
  24764. function s(e, t) {
  24765. t.copy(I.FORWARD),
  24766. e.getDirection(t)
  24767. }
  24768. function l(e) {
  24769. function t(e) {
  24770. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  24771. return {
  24772. x: c.Math.radToDeg(t._x),
  24773. y: c.Math.radToDeg(t._y),
  24774. z: c.Math.radToDeg(t._z)
  24775. }
  24776. }
  24777. var i = function(e) {
  24778. return e.alignmentType !== m.ALIGNED ? null : {
  24779. x: e.position.x,
  24780. y: e.position.y,
  24781. z: e.position.z
  24782. }
  24783. };
  24784. return {
  24785. panos: e.panos.list.map(function(n) {
  24786. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  24787. return {
  24788. uuid: n.id,
  24789. aligned: n.alignmentType === m.ALIGNED,
  24790. neighbourUUIDs: n.neighbourUUIDs.slice(),
  24791. position: i(n),
  24792. rotation: t(n),
  24793. thumbnail: r
  24794. }
  24795. })
  24796. }
  24797. }
  24798. var c = e("three")
  24799. , h = e("./ApiHost")
  24800. , u = e("../util/logger")
  24801. , d = e("../util/common")
  24802. , p = e("../util/math")
  24803. , f = e("../enum/ModelManagerEvents")
  24804. , g = e("./PostMessageType")
  24805. , m = e("../enum/AlignmentType")
  24806. , v = e("../enum/Direction")
  24807. , A = e("./TransitionStyles")
  24808. , y = e("../util/panorama")
  24809. , C = e("../enum/GLCubeFaces")
  24810. , I = e("../enum/Vectors")
  24811. , E = e("../enum/Viewmode")
  24812. , b = e("../enum/WarpStyle")
  24813. , w = (e("../enum/Keys"),
  24814. e("../enum/PlayerEvents"))
  24815. , _ = e("../sdk/SdkEvents")
  24816. , I = e("../enum/Vectors")
  24817. , T = e("../enum/ControlEvents")
  24818. , x = e("../enum/RenderLayers")
  24819. , S = (e("../constants"),
  24820. e("../settings"))
  24821. , M = e("../lib/jpeg_encoder")
  24822. , R = new u(i)
  24823. , P = function() {
  24824. var e = function e() {
  24825. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24826. e.player.getDirection(e.playerDirection),
  24827. e.projectVectors();
  24828. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  24829. if (e.angleTravelled += Math.abs(t),
  24830. e.angleTravelled >= Math.abs(e.angle)) {
  24831. if (e.active = !1,
  24832. e.onDone) {
  24833. var i = e.onDone;
  24834. i()
  24835. }
  24836. } else
  24837. e.lastFacingDirection.copy(e.playerDirection),
  24838. window.setTimeout(e, 4)
  24839. };
  24840. return e.active = !1,
  24841. e.angle = 0,
  24842. e.angleTravelled = 0,
  24843. e.playerDirection = new c.Vector3,
  24844. e.lastFacingDirection = new c.Vector3,
  24845. e.onDone = null,
  24846. e.player = null,
  24847. e.start = function(t, i, n, r) {
  24848. e.active = !0,
  24849. t && i && (i = 0),
  24850. e.angle = t || i,
  24851. e.xAngle = t,
  24852. e.yAngle = i,
  24853. e.angleTravelled = 0,
  24854. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  24855. n.getDirection(e.playerDirection),
  24856. e.lastFacingDirection.copy(e.playerDirection),
  24857. e.projectVectors(),
  24858. e.onDone = r,
  24859. e.player = n,
  24860. e()
  24861. }
  24862. ,
  24863. e.projectVectors = function() {
  24864. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  24865. e.lastFacingDirection.projectOnPlane(I.UP))
  24866. }
  24867. ,
  24868. e
  24869. }()
  24870. , O = function() {
  24871. var e = new c.Vector3;
  24872. return function(t) {
  24873. t ? (e.copy(t.position),
  24874. e.add(t.discPosition),
  24875. p.projectPositionToCanvas(e, this.player.camera, e),
  24876. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  24877. }
  24878. }()
  24879. , L = function() {
  24880. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  24881. }
  24882. , D = function() {
  24883. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  24884. }
  24885. , N = function(e) {
  24886. var t = new c.Vector3;
  24887. return function(e) {
  24888. var i = this.player.getDirection();
  24889. t.copy(i);
  24890. var n = t.y;
  24891. t.y = 0,
  24892. t.normalize();
  24893. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  24894. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  24895. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  24896. 0;
  24897. this.player.mode === E.DOLLHOUSE && (r = -r);
  24898. var o = L.call(this) - .1
  24899. , a = D.call(this) + .1
  24900. , s = r + e;
  24901. s > o ? s = o : s < a && (s = a);
  24902. var l = s - r;
  24903. return e > 0 && l < .01 && (l = 0),
  24904. e < 0 && l > -.01 && (l = 0),
  24905. l
  24906. }
  24907. }()
  24908. , B = function() {
  24909. var e = new c.Euler;
  24910. return function(t) {
  24911. return e.setFromQuaternion(t.quaternion, "YXZ"),
  24912. {
  24913. position: {
  24914. x: t.position.x,
  24915. y: t.position.y,
  24916. z: t.position.z
  24917. },
  24918. rotation: {
  24919. x: c.Math.radToDeg(e.x),
  24920. y: c.Math.radToDeg(e.y),
  24921. z: 0
  24922. },
  24923. pano: t.currentPano ? t.currentPano.id : null,
  24924. mode: t.mode
  24925. }
  24926. }
  24927. }()
  24928. , F = null;
  24929. t.exports = {
  24930. init: function(e, t, i, n, r) {
  24931. V.init(e, t, i, r),
  24932. F = new Promise(function(e, t) {
  24933. i.on(w.Ready, function() {
  24934. e()
  24935. })
  24936. }
  24937. .bind(this));
  24938. var o = new h(window)
  24939. , a = o.waitForConnection();
  24940. a.then(function(e) {
  24941. o.on(g.ACTION, V.onMessageReceive.bind(V))
  24942. });
  24943. var s = function() {
  24944. var e = Date.now();
  24945. return function() {
  24946. if (!(Date.now() - e < 100)) {
  24947. var t = B(i);
  24948. o.sendEvent(_.MOVE, {
  24949. state: t
  24950. }),
  24951. e = Date.now()
  24952. }
  24953. }
  24954. }();
  24955. i.on(w.Move, s),
  24956. i.on(w.ViewChanged, s),
  24957. n.on(f.ActiveModelChanged, function(e) {
  24958. function t(e) {
  24959. var t, i = e.newPano.id;
  24960. e.oldPano && (t = e.oldPano.id),
  24961. i !== t && o.sendEvent(_.ENTER_PANO, {
  24962. oldPano: t,
  24963. newPano: i
  24964. })
  24965. }
  24966. var i = e.model
  24967. , n = e.oldModel;
  24968. V.model = i,
  24969. a.then(function() {
  24970. o.sendEvent(_.MODEL_LOADED, {
  24971. metadata: l(i)
  24972. })
  24973. }),
  24974. n && n.panos.forEach(function(e) {
  24975. e.removeEventListener("enter", t)
  24976. }),
  24977. i.panos.forEach(function(e) {
  24978. e.on("enter", t)
  24979. })
  24980. })
  24981. }
  24982. };
  24983. var V = {
  24984. director: null,
  24985. player: null,
  24986. controls: null,
  24987. sceneRenderer: null,
  24988. model: null,
  24989. init: function(e, t, i, n) {
  24990. this.director = e,
  24991. this.player = i,
  24992. this.controls = t,
  24993. this.sceneRenderer = n
  24994. },
  24995. handleToObject: {},
  24996. objectToHandle: {},
  24997. handleCount: 0,
  24998. onMessageReceive: function(e) {
  24999. if (e) {
  25000. var t = e.targetFunction
  25001. , i = e.params
  25002. , n = e.onDone;
  25003. t && this[t] && this[t](i, n)
  25004. }
  25005. },
  25006. waitForInit: function(e, t) {
  25007. F.then(t.bind({
  25008. success: !0,
  25009. message: "Init complete."
  25010. }))
  25011. },
  25012. moveToPano: function(e, t) {
  25013. var i = new c.Euler(0,0,0,"YXZ")
  25014. , n = new c.Quaternion;
  25015. return function(e, t) {
  25016. var r = e.pano
  25017. , o = e.rotation
  25018. , a = e.transition;
  25019. if (!this.model)
  25020. return t({
  25021. success: !1,
  25022. error: "The model has not been loaded yet"
  25023. });
  25024. var s = this.model.panos.get(r);
  25025. if (!s)
  25026. return t({
  25027. success: !1,
  25028. error: r + " does not exist in this model"
  25029. });
  25030. if (!o)
  25031. return t({
  25032. sucess: !1,
  25033. erorr: o + " is not a valid rotation"
  25034. });
  25035. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25036. console.log(o.z);
  25037. var l = {
  25038. success: !0,
  25039. message: r
  25040. };
  25041. if (a === A.FADEOUT)
  25042. n.setFromEuler(i),
  25043. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25044. else {
  25045. var h, u;
  25046. a === A.INSTANT && (h = 0,
  25047. u = 0);
  25048. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25049. this.player.flyToPano({
  25050. pano: s,
  25051. lookAtPoint: d,
  25052. duration: h,
  25053. aimDuration: u
  25054. }, t.bind(this, l))
  25055. }
  25056. }
  25057. }(),
  25058. moveInDirection: function(e, t) {
  25059. var i = e.direction;
  25060. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25061. void (t && t({
  25062. success: !1,
  25063. error: "Invalid direction."
  25064. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25065. t(e ? {
  25066. success: !0,
  25067. message: "moved " + i
  25068. } : {
  25069. success: !1,
  25070. error: "Cannot move in direction: " + i
  25071. })
  25072. })
  25073. },
  25074. getPose: function(e, t) {
  25075. this.player.camera.position,
  25076. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25077. return t({
  25078. success: !0,
  25079. message: B(this.player)
  25080. })
  25081. },
  25082. takeScreenShot: function() {
  25083. var e = new c.PerspectiveCamera
  25084. , t = new c.WebGLRenderTarget;
  25085. return function(i, n) {
  25086. if (!i.resolution)
  25087. return n({
  25088. success: !1,
  25089. error: "An invalid resolution was specified"
  25090. });
  25091. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25092. var r = this.sceneRenderer.renderer.getSize();
  25093. i.resolution.width = r.width,
  25094. i.resolution.height = r.height
  25095. }
  25096. e.layers.set(x.DEFAULT),
  25097. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25098. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25099. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25100. var o = i.resolution.width
  25101. , a = i.resolution.height
  25102. , s = o / a;
  25103. e.position.copy(this.sceneRenderer.camera.position),
  25104. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25105. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25106. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25107. t.setSize(o, a),
  25108. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25109. var l = new Uint8Array(o * a * 4);
  25110. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25111. var c = M.encode({
  25112. data: l,
  25113. width: o,
  25114. height: a,
  25115. heading: 180,
  25116. pitch: 0
  25117. }, {
  25118. quality: 75,
  25119. flipY: !0
  25120. })
  25121. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25122. n({
  25123. success: !0,
  25124. message: h
  25125. })
  25126. }
  25127. }(),
  25128. findRankedPano: function(e, t) {
  25129. var i = new c.Vector3
  25130. , r = new c.Vector3;
  25131. return function(e, t) {
  25132. s(this.player, r),
  25133. n(t, r, i);
  25134. var o = this.player.rankedPanoInDirection(e, i);
  25135. if (o) {
  25136. var a = this.objectToHandle[o.id];
  25137. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25138. this.handleToObject[a] = o),
  25139. a
  25140. }
  25141. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25142. -1
  25143. }
  25144. }(),
  25145. findRankedtag: function(e, t) {
  25146. var i = new c.Vector3
  25147. , r = new c.Vector3;
  25148. return function(e, t) {
  25149. s(this.player, r),
  25150. n(t, r, i);
  25151. var o = this.player.rankedtagInDirection(e, i);
  25152. if (o) {
  25153. var a = this.objectToHandle[o.sid];
  25154. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25155. this.handleToObject[a] = o),
  25156. a
  25157. }
  25158. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25159. -1
  25160. }
  25161. }(),
  25162. clickNearesttag: function(e) {
  25163. this.clickRankedtag(0, e)
  25164. },
  25165. clickRankedtag: function(e, t) {
  25166. var i = a.call(this, e, t);
  25167. i && O.call(this, i)
  25168. },
  25169. clickNearestPano: function(e, t) {
  25170. this.clickRankedPano(0, e, t)
  25171. },
  25172. clickRankedPano: function(e, t, i) {
  25173. var n = o.call(this, e, t);
  25174. n ? r.call(this, n, i) : i(null)
  25175. },
  25176. clickPano: function(e, t) {
  25177. var i = this.handleTable[e];
  25178. i ? r.call(this, i, t) : t(null)
  25179. },
  25180. rotateDirection: function() {
  25181. return function(e, t) {
  25182. var i = e.direction
  25183. , n = e.angle;
  25184. if (!P.active) {
  25185. var r = 0
  25186. , o = 0
  25187. , a = 0
  25188. , s = 0;
  25189. if (!n || isNaN(n))
  25190. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  25191. void (t && t({
  25192. success: !1,
  25193. error: "Invalid rotation angle."
  25194. }));
  25195. if (this.player.mode === E.TRANSITIONING)
  25196. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  25197. void (t && t({
  25198. success: !1,
  25199. error: "Cannot rotate while transitioning"
  25200. }));
  25201. if (i === v.RIGHT || i === v.LEFT)
  25202. i === v.RIGHT && (n = -n),
  25203. r = n > 0 ? -1 : 1,
  25204. a = n;
  25205. else {
  25206. if (i !== v.UP && i !== v.DOWN)
  25207. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  25208. void (t && t({
  25209. success: !1,
  25210. error: "Invalid direction for rotation."
  25211. }));
  25212. if (this.player.mode === E.FLOORPLAN)
  25213. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  25214. void (t && t({
  25215. success: !1,
  25216. error: "Cannot rotate " + i + " in floorplan mode"
  25217. }));
  25218. if (i === v.DOWN && (n = -n),
  25219. n = N.call(this, n),
  25220. 0 === n)
  25221. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  25222. void (t && t({
  25223. success: !1,
  25224. error: "Already at maximum rotation in direction: " + i
  25225. }));
  25226. o = n > 0 ? 1 : -1,
  25227. s = n
  25228. }
  25229. var l = n;
  25230. n = c.Math.degToRad(n),
  25231. a = c.Math.degToRad(a),
  25232. s = c.Math.degToRad(s);
  25233. var h = this.controls.activeControl
  25234. , u = function() {
  25235. h.stopRotating(!0),
  25236. t && t({
  25237. success: !0,
  25238. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  25239. })
  25240. };
  25241. h.startRotating(r, o),
  25242. P.start(a, s, this.player, u)
  25243. }
  25244. }
  25245. }(),
  25246. rotate: function() {
  25247. var e = new c.Vector3
  25248. , t = new c.Vector3;
  25249. return function(i, n) {
  25250. var r = i.xAngle
  25251. , o = i.yAngle;
  25252. if (!P.active) {
  25253. if (r = r || 0,
  25254. o = o || 0,
  25255. isNaN(r) || isNaN(o))
  25256. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  25257. void (n && n({
  25258. success: !1,
  25259. error: "Invalid rotation angle."
  25260. }));
  25261. if (this.player.mode === E.TRANSITIONING)
  25262. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  25263. void (n && n({
  25264. success: !1,
  25265. error: "Cannot rotate while transitioning"
  25266. }));
  25267. Math.abs(r) < .01 && (r = 0),
  25268. Math.abs(o) < .01 && (o = 0);
  25269. var a = o;
  25270. o = N.call(this, o),
  25271. r = -r;
  25272. var s = a > 0 ? "UP" : "DOWN";
  25273. if (!r && a && !o)
  25274. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  25275. void (n && n({
  25276. success: !1,
  25277. error: "Already at maximum rotation in direction: " + s
  25278. }));
  25279. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  25280. var l = o;
  25281. o = c.Math.degToRad(o),
  25282. r = c.Math.degToRad(r),
  25283. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25284. this.player.getDirection(e),
  25285. t.copy(e).applyAxisAngle(I.UP, r),
  25286. t.applyAxisAngle(I.RIGHT, o);
  25287. var h = (e.angleTo(t),
  25288. r > 0 ? -1 : r < 0 ? 1 : 0)
  25289. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  25290. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  25291. var d = this.controls.activeControl
  25292. , p = function() {
  25293. d.stopRotating(!0),
  25294. n && n({
  25295. success: !0,
  25296. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  25297. })
  25298. };
  25299. d.startRotating(h, u),
  25300. P.start(r, o, this.player, p)
  25301. }
  25302. }
  25303. }(),
  25304. panCamera: function(e, t) {
  25305. function i(e) {
  25306. switch (r.removeAllListeners(T.AutoPanComplete),
  25307. r.removeAllListeners(T.AutoPanInterrupt),
  25308. r.removeAllListeners(T.AutoPanClamped),
  25309. e) {
  25310. case T.AutoPanInterrupt:
  25311. t({
  25312. success: !0,
  25313. message: "Camera panning interrupted."
  25314. });
  25315. break;
  25316. case T.AutoPanClamped:
  25317. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  25318. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  25319. return void t({
  25320. success: !1,
  25321. error: "Already at edge of current model bounds."
  25322. });
  25323. var i = "The view point is outside the bounds for the current model. ";
  25324. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  25325. console.warn(i)
  25326. }
  25327. case T.AutoPanComplete:
  25328. t({
  25329. success: !0,
  25330. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  25331. })
  25332. }
  25333. }
  25334. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  25335. return t({
  25336. success: !1,
  25337. error: "Camera panning is not available in the current mode: " + this.player.mode
  25338. });
  25339. var n = e.position
  25340. , r = this.player.control;
  25341. r.setAutoPanPosition(n.x, n.z),
  25342. r.autoPan = !0;
  25343. var o = function(e, t) {
  25344. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  25345. };
  25346. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  25347. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  25348. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  25349. },
  25350. click: function(e, t) {
  25351. var i = e.x
  25352. , n = e.y
  25353. , r = e.percentage;
  25354. r === !0 && (i = i / 100 * $("#player").width(),
  25355. n = n / 100 * $("#player").height()),
  25356. this.player.handleInputStart(i, n),
  25357. this.player.updateIntersect(),
  25358. this.player.handleInputEnd(i, n)
  25359. },
  25360. mouseOver: function(e, t) {
  25361. var i = e.x
  25362. , n = e.y
  25363. , r = e.percentage;
  25364. r === !0 && (i = i / 100 * $("#player").width(),
  25365. n = n / 100 * $("#player").height()),
  25366. this.player.handleInputMove(i, n),
  25367. this.player.updateIntersect()
  25368. },
  25369. moveToMode: function(e, t) {
  25370. function i(e) {
  25371. t(e ? {
  25372. success: !1,
  25373. error: "Failed to load new mode: " + e
  25374. } : {
  25375. success: !0,
  25376. message: "Moved to new mode: " + n
  25377. })
  25378. }
  25379. var n = e.mode;
  25380. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  25381. i()
  25382. }, function(e) {
  25383. i(e)
  25384. }) : t({
  25385. success: !1,
  25386. error: "Invalid mode selection"
  25387. })
  25388. }
  25389. }
  25390. }
  25391. ).call(this, "/js/sdk/automation.js")
  25392. }
  25393. , {
  25394. "../constants": 8,
  25395. "../enum/AlignmentType": 17,
  25396. "../enum/ControlEvents": 21,
  25397. "../enum/Direction": 22,
  25398. "../enum/GLCubeFaces": 25,
  25399. "../enum/Keys": 30,
  25400. "../enum/ModelManagerEvents": 33,
  25401. "../enum/PlayerEvents": 40,
  25402. "../enum/RenderLayers": 41,
  25403. "../enum/Vectors": 50,
  25404. "../enum/Viewmode": 51,
  25405. "../enum/WarpStyle": 52,
  25406. "../lib/jpeg_encoder": 94,
  25407. "../sdk/SdkEvents": 161,
  25408. "../settings": 166,
  25409. "../util/common": 185,
  25410. "../util/logger": 189,
  25411. "../util/math": 190,
  25412. "../util/panorama": 191,
  25413. "./ApiHost": 159,
  25414. "./PostMessageType": 160,
  25415. "./TransitionStyles": 162,
  25416. three: 217
  25417. }],
  25418. 165: [function(e, t, i) {
  25419. "use strict";
  25420. function n(e) {
  25421. this.sourceWindow = e,
  25422. this.targetWindow = null,
  25423. this.targetOrigin = null,
  25424. this.id = Math.floor(1e5 * Math.random()),
  25425. this.bindEvents()
  25426. }
  25427. var r = e("./PostMessageType")
  25428. , o = e("events").EventEmitter;
  25429. n.prototype = Object.create(o.prototype),
  25430. n.prototype.bindEvents = function() {
  25431. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  25432. }
  25433. ,
  25434. n.prototype.setTarget = function(e, t) {
  25435. this.targetWindow = e,
  25436. this.targetOrigin = t
  25437. }
  25438. ,
  25439. n.prototype.onPostmessageReceived = function(e) {
  25440. var t = e.origin || e.originalEvent.origin
  25441. , i = e.source;
  25442. switch (e.data.type) {
  25443. case r.CONNECT:
  25444. break;
  25445. case r.RESPONSE:
  25446. if (this.id !== e.data.toId)
  25447. return;
  25448. default:
  25449. if (!this.validateMessageOrigin(t))
  25450. return
  25451. }
  25452. var n = e.data;
  25453. n.source = i,
  25454. n.origin = t,
  25455. n.timestamp = Date.now(),
  25456. this.emit(e.data.type, n)
  25457. }
  25458. ,
  25459. n.prototype.validateMessageOrigin = function(e) {
  25460. return "*" === this.targetOrigin || e === this.targetOrigin
  25461. }
  25462. ,
  25463. n.prototype.send = function(e) {
  25464. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  25465. this.targetWindow.postMessage(e, this.targetOrigin))
  25466. }
  25467. ,
  25468. t.exports = n
  25469. }
  25470. , {
  25471. "./PostMessageType": 160,
  25472. events: 202
  25473. }],
  25474. 166: [function(e, t, i) {
  25475. "use strict";
  25476. var n = e("three")
  25477. , r = e("./util/browser")
  25478. , o = e("./enum/Viewmode")
  25479. , a = e("./enum/VROption")
  25480. , s = e("./enum/Colors")
  25481. , l = e("./enum/WarpStyle")
  25482. , c = e("./util/easing")
  25483. , h = e("./util/common")
  25484. , u = e("./util/showcase")
  25485. , d = e("./constants")
  25486. , p = {
  25487. debug: !1,
  25488. version: "2.25.6-0-gd87e5b1",
  25489. languageTag: r.valueFromHash("lang", null),
  25490. pageTitle: "四维虚拟漫游",
  25491. authorizationHeader: u.getAuthorizationHeader(),
  25492. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  25493. logLevel: r.valueFromHash("log", 2),
  25494. skyboxRadius: 2500,
  25495. modelBoundsPadding: 5,
  25496. showNeighbors: !1,
  25497. brand: r.valueFromHash("brand", !0),
  25498. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  25499. startHighlights: r.valueFromHash("hl", -1),
  25500. specialEdition: r.valueFromHash("bn", 0),
  25501. useWheel: r.valueFromHash("wh", !0),
  25502. crossOrigin: "anonymous",
  25503. fancierTransition: !1,
  25504. wireframe: !1,
  25505. skyboxWireframe: !1,
  25506. modelAlpha: 1,
  25507. highlightPanoSelection: !1,
  25508. showSweeps: !0,
  25509. showSkyboxes: !1,
  25510. showMesh: !0,
  25511. showFloors: !1,
  25512. showFloorDuration: 300,
  25513. showFloorDelay: 300,
  25514. hideFloorDuration: 300,
  25515. hideFloorDelay: 0,
  25516. reticuleOpacityTransitionTime: 250,
  25517. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  25518. markerOpacityTransitionTime: 500,
  25519. guiAnimationSpeed: 250,
  25520. highlightAnimationDuration: 500,
  25521. modelComponentLoadSpinnerDelay: 150,
  25522. captureErrors: !1,
  25523. maxMobileTextures: 6,
  25524. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25525. startupFlyinDelay: 3e3,
  25526. dollhouseDefault: {
  25527. minDistance: 15,
  25528. maxDistance: 50,
  25529. minPolarAngle: n.Math.degToRad(10),
  25530. maxPolarAngle: n.Math.degToRad(90)
  25531. },
  25532. hideReticuleTimeout: 1e3,
  25533. analytics: {
  25534. inactivityThreshold: 30,
  25535. sessionTrackingRate: .15,
  25536. maxTrackedErrors: 20,
  25537. sessionDurationPingFrequency: 10,
  25538. sessionDurationTimeout: 15
  25539. },
  25540. flydown: {
  25541. movementEasing: "easeInOutQuad",
  25542. movementDelay: .001,
  25543. rotationEasing: "easeInOutQuad",
  25544. rotationDelay: .5,
  25545. modelTextureDelay: .75,
  25546. skyboxDelay: .75
  25547. },
  25548. transition: {
  25549. flySpeed: .001,
  25550. flyTime: 750,
  25551. flytimeMaxDistanceThreshold: 5,
  25552. flytimeDistanceMultiplier: 150,
  25553. aimTime: 1500,
  25554. aimSlowFactor: 1.5,
  25555. blur: 0.8,
  25556. movementEasing: "easeInOutQuad",
  25557. blendEasing: "easeInOutQuad",
  25558. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  25559. },
  25560. show360Views: {
  25561. enabled: !0,
  25562. transitionTime: 1e3
  25563. },
  25564. quickstart: {
  25565. enabled: true,
  25566. animation: 1400,
  25567. showTextDelay: 500,
  25568. fadeOutDelay: 3e3,
  25569. fovChange: 10
  25570. },
  25571. appConfig: {
  25572. webvr_version: null,
  25573. segment_key: null,
  25574. embedly_key: null,
  25575. branch_key: null,
  25576. keen_write_key: null,
  25577. keen_project_id: null
  25578. },
  25579. vr: {
  25580. enabled: !0,
  25581. allowWebVR: !1,
  25582. option: r.valueFromHash("vr", a.CONTEXTUAL)
  25583. },
  25584. share: {
  25585. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  25586. },
  25587. input: {
  25588. longTapThreshold: 200,
  25589. moveToleranceNDC: .08,
  25590. touchMoveThreshold: 25
  25591. },
  25592. help: {
  25593. modalStayDuration: 600
  25594. },
  25595. immersive: {
  25596. timeToShowAgain: 1250,
  25597. uiStayDuration: 600
  25598. },
  25599. tourInteraction: {
  25600. disabled: "0" === r.valueFromHash("tourcta", null),
  25601. showPauseButton: 1e3,
  25602. showModal: 1500,
  25603. allowNextClick: 200,
  25604. largeModal: "1" === r.valueFromHash("tourcta", null),
  25605. smallModal: "2" === r.valueFromHash("tourcta", null)
  25606. },
  25607. labels: {
  25608. enabled: !1,
  25609. hideUntilStart: !0,
  25610. fadeInDuration: 250,
  25611. fadeInDelay: 250,
  25612. fadeOutDuration: 250,
  25613. fadeOutDelay: 0,
  25614. zoomHideThreshhold: {
  25615. mobile: r.isSmallScreen() ? .45 : .6,
  25616. desktop: 2
  25617. },
  25618. zoomTruncateThreshhold: {
  25619. mobile: r.isSmallScreen() ? .35 : .45,
  25620. desktop: .85
  25621. },
  25622. minLengthForTruncate: 16,
  25623. truncateLength: 12,
  25624. truncateSuffix: "..."
  25625. },
  25626. tags: {
  25627. enabled: r.valueFromHash("mt", 1),
  25628. startup: {
  25629. hideUntilStart: !0,
  25630. fadeInDuration: 500,
  25631. fadeInDelay: 100
  25632. },
  25633. visibility: {
  25634. anyDistance: !0,
  25635. visibleDistance: 8,
  25636. cameraClearance: .1,
  25637. alphaTestLevel: .05,
  25638. hideViaFloor: !0,
  25639. hideOffScreenDisc: !1,
  25640. hideOffScreenObject: !1
  25641. },
  25642. disc: {
  25643. opacity: 1,
  25644. disabledOpacity: .5,
  25645. scale: {
  25646. nearBound: 1.5,
  25647. farBound: 4.8,
  25648. linkFarBound: !1,
  25649. linkPercent: 40,
  25650. maxSize: 80,
  25651. minSize: 40,
  25652. baseViewportSize: 800,
  25653. responsiveness: 100
  25654. }
  25655. },
  25656. pole: {
  25657. enabled: !0,
  25658. height: .5,
  25659. width: 2,
  25660. opacity: .5,
  25661. color: "white"
  25662. },
  25663. navigate: {
  25664. nearestPano: !0,
  25665. lineOfSight: !0,
  25666. reactivate: !0,
  25667. aimAt: "disc",
  25668. tiltTolerance: 25,
  25669. rotateSpeedFactor: .6
  25670. }
  25671. },
  25672. path: {
  25673. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  25674. colorUp: s._desat(s.newBlue, .5),
  25675. colorDown: s._darken(s.newBlue, .35),
  25676. opacity: .5,
  25677. style: "ribbon",
  25678. height: .025,
  25679. ribbonWidth: .24,
  25680. outsideHeight: .5,
  25681. waypointRadius: .5,
  25682. waypointIndoorRadius: .24,
  25683. waypointPulse: 1e3,
  25684. typ: l.BLACK,
  25685. meshFree: r.valueFromHash("mf", 1),
  25686. mapGuides: r.valueFromHash("guides", !0),
  25687. fadeInTime: 400,
  25688. fadeOutTime: 300
  25689. },
  25690. warp: {
  25691. nearPanoDist: .1,
  25692. matchCam: !1,
  25693. blur: .33,
  25694. fastTime: 1500,
  25695. teleportTime: 1500,//瞬间过渡的时间
  25696. flytimeDistanceMultiplier:150,//add
  25697. flyTime:750,//add
  25698. outsideTime: 2e3,
  25699. lookAheadMax: .3,
  25700. lookAheadDist: 2.5,
  25701. softPushDist: .37,
  25702. softPushEnd: .3,
  25703. softBendAngle: 8,
  25704. softBendTilt: 4,
  25705. softBendEnd: .3,
  25706. doBurns: true, //r.valueFromHash("kb", !0),
  25707. burnsAngle: 8, //导览在每个点停留时的旋转角度
  25708. minBurnsAngle: 35,
  25709. minDownAngle: -35,
  25710. maxTurnPerSec: 280,
  25711. maxAimPerSec: 35,
  25712. minRotation: 12,
  25713. maxAimRotation: 33.2,
  25714. turnFriction: .2,
  25715. flySpeed: .01,
  25716. minWarpTime: 1200,
  25717. warpInterruptionRedirectTime: 500,
  25718. tourStepDelay: r.valueFromHash("st", 0),
  25719. walkDelay: 0,
  25720. walkMaxDist: 50,
  25721. walkMinDist: .8,
  25722. walkSlideShowThreshhold: 3000,
  25723. walkExtraPanosDistance: .4,
  25724. timePerMeter: 1200,
  25725. motionLeadTime: 5000,
  25726. movementEasing: "easeInOutQuad",
  25727. blendEasing: "easeInOutQuad",
  25728. showBunny: !1,
  25729. loop: r.valueFromHash("lp", !1),
  25730. auto: r.valueFromHash("ts", -1),
  25731. eOrder: 'YXZ', //"YXZ",
  25732. stepFactor: .25,
  25733. brakeStrength: 2,
  25734. minBrakeAngle: .1,
  25735. maxBrakeAngle: 1.8,
  25736. climbEffort: 4
  25737. },
  25738. rotationFriction: .05,
  25739. rotationAccelerationInside: 4.5,
  25740. rotationAccelerationOutside: .15,
  25741. rotationAfterMoveMultiplier: 40,
  25742. rotationAfterMoveHistoryCount: 5,
  25743. panFriction: .09,
  25744. panAccelerationOutside: 60,
  25745. onload: r.valueFromHash("onload", o.PANORAMA),
  25746. zoomNearLimit: .1,
  25747. zoomFarLimit: 50,
  25748. navigation: {
  25749. panoScores: !1,
  25750. mouseDirection: !0,
  25751. filterStrictness: .75,
  25752. angleFactor: -30,
  25753. directionFactor: 10,
  25754. distanceFactor: -1,
  25755. optionalityFactor: 3
  25756. },
  25757. sdkInit: !1,
  25758. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  25759. console: r.valueFromHash("console", !1),
  25760. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  25761. panoramaNeighbourMaxDistance: 5,
  25762. panoFloorClickRadius: .35,
  25763. showScreenshotLocations: !1,
  25764. showAxis: !1,
  25765. showNeighbourRaycasts: !1,
  25766. colorMarkerOnLoad: !1,
  25767. colorMarkerByFloor: !1,
  25768. tiling: {
  25769. panoPreRenderRepeatDelay: 2500,
  25770. panoPreRenderDelay: 500,
  25771. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  25772. tilingFlagNames: ["usetiles", "tiles"],
  25773. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  25774. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  25775. overlayStyle: r.valueFromHash("tileoverlay", 0),
  25776. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  25777. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  25778. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  25779. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  25780. customCompression: r.valueFromHash("tilecustcomp", 0),
  25781. // mobileHighQualityOverride: !1,
  25782. mobileHighQualityOverride: 1,
  25783. allowUltraHighResolution: true
  25784. },
  25785. zoom: {
  25786. enabled: true,
  25787. forceOff: r.valueFromHash("nozoom", 0),
  25788. overridemax: r.valueFromHash("maxzoom", null),
  25789. overridemin: r.valueFromHash("minzoom", null),
  25790. max: d.highQualityMaxZoom,
  25791. min: 1,
  25792. transitionStyle: r.valueFromHash("zoomtrans", 1),
  25793. activationThreshold: 1.1,
  25794. restoreTime: 500
  25795. },
  25796. profiling: {
  25797. enabled: r.valueFromHash("mem", !1)
  25798. }
  25799. };
  25800. p = h.deepExtend(p, d, {
  25801. insideFOV: r.valueFromHash("fov", d.insideFOV),
  25802. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  25803. panorama: {
  25804. transitionTime: 1e3,
  25805. modelAlpha: 0,
  25806. modelAlphaDelay: p.flydown.modelTextureDelay,
  25807. modelAlphaLength: 1,
  25808. skyboxOpacity: 1,
  25809. skyboxOpacityDelay: p.flydown.skyboxDelay,
  25810. skyboxOpacityLength: .9,
  25811. fovLength: 1,
  25812. fovDelay: 0,
  25813. cameraMatrixDuration: .8,
  25814. cameraMatrixDelay: 0,
  25815. cameraMatrixEase: c.easeInCubic,
  25816. reticuleOpacity: 1,
  25817. markerOpacity: .3,
  25818. markerOpacityOnHover: 1
  25819. },
  25820. dollhouse: {
  25821. transitionTime: 1e3,
  25822. modelAlpha: 1,
  25823. modelAlphaDelay: 0,
  25824. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25825. skyboxOpacity: 0,
  25826. skyboxOpacityDelay: 0,
  25827. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25828. fovLength: 1,
  25829. fovDelay: 0,
  25830. cameraMatrixDuration: .8,
  25831. cameraMatrixDelay: .3,
  25832. cameraMatrixEase: c.easeInCubic,
  25833. reticuleOpacity: 1,
  25834. markerOpacity: 0,
  25835. markerOpacityOnHover: 0
  25836. },
  25837. floorplan: {
  25838. transitionTime: 1e3,
  25839. modelAlpha: 1,
  25840. modelAlphaDelay: 0,
  25841. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  25842. skyboxOpacity: 0,
  25843. skyboxOpacityDelay: 0,
  25844. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  25845. fovLength: 1,
  25846. fovDelay: 0,
  25847. cameraMatrixDuration: .5,
  25848. cameraMatrixDelay: 0,
  25849. cameraMatrixEase: c.easeOutCubic,
  25850. reticuleOpacity: 1,
  25851. markerOpacity: 0,
  25852. markerOpacityOnHover: 0,
  25853. cameraHeight: 50
  25854. },
  25855. transitioning: {
  25856. reticuleOpacity: 0,
  25857. markerOpacity: .3,
  25858. markerOpacityOnHover: 1
  25859. },
  25860. "floorplan-dollhouse": {
  25861. rotationDelay: 0,
  25862. rotationDuration: 1
  25863. },
  25864. "floorplan-panorama": {
  25865. rotationDelay: .5,
  25866. rotationDuration: 1
  25867. },
  25868. "dollhouse-panorama": {
  25869. rotationDelay: .5,
  25870. rotationDuration: 1
  25871. },
  25872. "dollhouse-floorplan": {
  25873. rotationDelay: 0,
  25874. rotationDuration: 1,
  25875. cameraMatrixDuration: 1.05,
  25876. cameraMatrixDelay: .5
  25877. },
  25878. "panorama-dollhouse": {
  25879. rotationDelay: 0,
  25880. rotationDuration: .5
  25881. },
  25882. "panorama-floorplan": {
  25883. transitionTime: 1500,
  25884. rotationDelay: 0,
  25885. rotationDuration: .5
  25886. }
  25887. }),
  25888. p.path.meshFree && (p.path.typ = l.WALK),
  25889. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  25890. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  25891. window._settings = t.exports = p
  25892. }
  25893. , {
  25894. "./constants": 8,
  25895. "./enum/Colors": 19,
  25896. "./enum/VROption": 47,
  25897. "./enum/Viewmode": 51,
  25898. "./enum/WarpStyle": 52,
  25899. "./util/browser": 182,
  25900. "./util/common": 185,
  25901. "./util/easing": 186,
  25902. "./util/showcase": 193,
  25903. three: 217
  25904. }],
  25905. 167: [function(e, t, i) {
  25906. "use strict";
  25907. var n = e("three")
  25908. , r = e("./settings")
  25909. , o = "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"
  25910. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  25911. t.exports = {
  25912. basicTextured: {
  25913. uniforms: {
  25914. tDiffuse: {
  25915. type: "t",
  25916. value: null
  25917. },
  25918. alpha: {
  25919. type: "f",
  25920. value: 1
  25921. }
  25922. },
  25923. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25924. fragmentShader: "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}"
  25925. },
  25926. copyCubeMap: {
  25927. uniforms: {
  25928. tDiffuse: {
  25929. type: "t",
  25930. value: null
  25931. },
  25932. alpha: {
  25933. type: "f",
  25934. value: 1
  25935. }
  25936. },
  25937. vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25938. fragmentShader: "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}"
  25939. },
  25940. cube: {
  25941. uniforms: {
  25942. map: {
  25943. type: "t",
  25944. value: null
  25945. },
  25946. opacity: {
  25947. type: "f",
  25948. value: 1
  25949. }
  25950. },
  25951. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25952. fragmentShader: a + "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"
  25953. },
  25954. model: {
  25955. uniforms: {
  25956. map: {
  25957. type: "t",
  25958. value: null
  25959. },
  25960. modelAlpha: {
  25961. type: "f",
  25962. value: r.modelAlpha
  25963. },
  25964. opacity: {
  25965. type: "f",
  25966. value: 1
  25967. },
  25968. progress: {
  25969. type: "f",
  25970. value: 0
  25971. },
  25972. blackout: {
  25973. type: "i",
  25974. value: 0
  25975. },
  25976. pano0Map: {
  25977. type: "t",
  25978. value: null
  25979. },
  25980. pano0Position: {
  25981. type: "v3",
  25982. value: new n.Vector3
  25983. },
  25984. pano0Matrix: {
  25985. type: "m4",
  25986. value: new n.Matrix4
  25987. },
  25988. pano1Map: {
  25989. type: "t",
  25990. value: null
  25991. },
  25992. pano1Position: {
  25993. type: "v3",
  25994. value: new n.Vector3
  25995. },
  25996. pano1Matrix: {
  25997. type: "m4",
  25998. value: new n.Matrix4
  25999. }
  26000. },
  26001. vertexShader: o + `uniform vec3 pano0Position;
  26002. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26003. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26004. varying vec3 vWorldPosition0;
  26005. varying vec3 vWorldPosition1;
  26006. uniform int blackout;
  26007. void main() {
  26008. vUv = uv;
  26009. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26010. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26011. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26012. vWorldPosition0.x *= -1.0;
  26013. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26014. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26015. vWorldPosition1.x *= -1.0;
  26016. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26017. }`,
  26018. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26019. 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
  26020. void main() {
  26021. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26022. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26023. vec4 colorFromPanos;
  26024. if (blackout == 5){
  26025. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26026. }else{
  26027. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26028. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26029. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26030. else if (blackout == 1) {
  26031. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26032. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26033. }
  26034. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26035. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26036. }
  26037. vec4 colorFromTexture = texture2D( map, vUv );
  26038. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26039. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26040. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26041. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26042. }`
  26043. },
  26044. hot:{
  26045. uniforms:{
  26046. color:{
  26047. type: "c",
  26048. value: new n.Color( 0xff2200 )
  26049. },
  26050. opac:{
  26051. type: "f",
  26052. value: 0
  26053. },
  26054. texture1:{
  26055. type: "t",
  26056. value: null
  26057. },
  26058. texture2:{
  26059. type: "t",
  26060. value: null
  26061. }
  26062. },
  26063. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26064. fragmentShader:"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"
  26065. },
  26066. modelOutside: {
  26067. uniforms: {
  26068. map: {
  26069. type: "t",
  26070. value: null
  26071. },
  26072. opacity: {
  26073. type: "f",
  26074. value: 1
  26075. }
  26076. },
  26077. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26078. fragmentShader: a + "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"
  26079. },
  26080. ribbon: {
  26081. uniforms: {
  26082. map: {
  26083. type: "t",
  26084. value: null
  26085. },
  26086. opacity: {
  26087. type: "f",
  26088. value: 1
  26089. },
  26090. color: {
  26091. type: "c",
  26092. value: new n.Color(r.path.color)
  26093. }
  26094. },
  26095. vertexShader: o + "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",
  26096. fragmentShader: a + "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"
  26097. },
  26098. waypoint: {
  26099. uniforms: {
  26100. map: {
  26101. type: "t",
  26102. value: null
  26103. },
  26104. opacity: {
  26105. type: "f",
  26106. value: 1
  26107. },
  26108. pulse: {
  26109. type: "f",
  26110. value: 1
  26111. },
  26112. nearFade: {
  26113. type: "v2",
  26114. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26115. },
  26116. color: {
  26117. type: "c",
  26118. value: new n.Color(r.reticuleColor)
  26119. }
  26120. },
  26121. vertexShader: o + "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",
  26122. fragmentShader: a + "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"
  26123. },
  26124. modelDebug: {
  26125. uniforms: {
  26126. map: {
  26127. type: "t",
  26128. value: null
  26129. },
  26130. modelAlpha: {
  26131. type: "f",
  26132. value: r.modelAlpha
  26133. },
  26134. depthmapRatio: {
  26135. type: "f",
  26136. value: 0
  26137. },
  26138. opacity: {
  26139. type: "f",
  26140. value: 1
  26141. },
  26142. progress: {
  26143. type: "f",
  26144. value: 0
  26145. },
  26146. considerOcclusion: {
  26147. type: "i",
  26148. value: r.fancierTransition
  26149. },
  26150. highlightPanoSelection: {
  26151. type: "i",
  26152. value: 0
  26153. },
  26154. useThirdPano: {
  26155. type: "i",
  26156. value: r.useThirdPano
  26157. },
  26158. pano0Map: {
  26159. type: "t",
  26160. value: null
  26161. },
  26162. pano0Depth: {
  26163. type: "t",
  26164. value: null
  26165. },
  26166. pano0Position: {
  26167. type: "v3",
  26168. value: new n.Vector3
  26169. },
  26170. pano0Matrix: {
  26171. type: "m4",
  26172. value: new n.Matrix4
  26173. },
  26174. pano0Weight: {
  26175. type: "f",
  26176. value: r.transition.pano0Weight
  26177. },
  26178. pano1Map: {
  26179. type: "t",
  26180. value: null
  26181. },
  26182. pano1Depth: {
  26183. type: "t",
  26184. value: null
  26185. },
  26186. pano1Position: {
  26187. type: "v3",
  26188. value: new n.Vector3
  26189. },
  26190. pano1Matrix: {
  26191. type: "m4",
  26192. value: new n.Matrix4
  26193. },
  26194. pano1Weight: {
  26195. type: "f",
  26196. value: r.transition.pano1Weight
  26197. },
  26198. pano2Map: {
  26199. type: "t",
  26200. value: null
  26201. },
  26202. pano2Depth: {
  26203. type: "t",
  26204. value: null
  26205. },
  26206. pano2Position: {
  26207. type: "v3",
  26208. value: new n.Vector3
  26209. },
  26210. pano2Matrix: {
  26211. type: "m4",
  26212. value: new n.Matrix4
  26213. },
  26214. pano2Weight: {
  26215. type: "f",
  26216. value: r.transition.pano2Weight
  26217. }
  26218. },
  26219. vertexShader: o + "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",
  26220. fragmentShader: a + "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"
  26221. },
  26222. customDepth: {
  26223. uniforms: {
  26224. panoPosition: {
  26225. type: "v3",
  26226. value: new n.Vector3
  26227. }
  26228. },
  26229. vertexShader: o + "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",
  26230. fragmentShader: a + "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"
  26231. },
  26232. skysphere: {
  26233. uniforms: {
  26234. radius: {
  26235. type: "f",
  26236. value: 0
  26237. }
  26238. },
  26239. vertexShader: o + "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",
  26240. fragmentShader: a + "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"
  26241. },
  26242. tagDisc: {
  26243. uniforms: {
  26244. opacity: {
  26245. type: "f",
  26246. value: 0
  26247. },
  26248. color: {
  26249. type: "c",
  26250. value: new n.Color
  26251. },
  26252. bg: {
  26253. type: "t",
  26254. value: null
  26255. },
  26256. mask: {
  26257. type: "t",
  26258. value: null
  26259. }
  26260. },
  26261. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26262. fragmentShader: a + "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"
  26263. }
  26264. }
  26265. }
  26266. , {
  26267. "./settings": 166,
  26268. three: 217
  26269. }],
  26270. 168: [function(e, t, i) {
  26271. (function(i) {
  26272. "use strict";
  26273. var n = e("three")
  26274. , r = (e("url"),
  26275. e("./util/ajax"))
  26276. , o = e("./settings")
  26277. , a = e("./util/logger")
  26278. , s = e("./util/math")
  26279. , l = e("./util/showcase")
  26280. , c = e("./objects/Panorama")
  26281. , h = new a(i)
  26282. , u = e("./model/Model")
  26283. , d = e("./shaders")
  26284. , p = e("./util/transitions")
  26285. , f = e("./objects/Chunk")
  26286. , g = e("./objects/Reticule")
  26287. , m = e("./objects/Skybox")
  26288. , v = e("./objects/Floor")
  26289. , A = e("./cameras/DollhouseCamera")
  26290. , y = e("./cameras/FloorplanCamera")
  26291. , C = e("./cameras/PanoramaCamera")
  26292. , I = e("./controls/DollhouseControls")
  26293. , E = e("./controls/FloorplanControls")
  26294. , b = e("./controls/PanoramaControls");
  26295. n.ImageUtils.crossOrigin = o.crossOrigin,
  26296. t.exports = {
  26297. shaders: d,
  26298. transitions: p,
  26299. Model: u,
  26300. Chunk: f,
  26301. Floor: v,
  26302. Skybox: m,
  26303. Reticule: g,
  26304. Panorama: c,
  26305. DollhouseCamera: A,
  26306. FloorplanCamera: y,
  26307. PanoramaCamera: C,
  26308. DollhouseControls: I,
  26309. FloorplanControls: E,
  26310. PanoramaControls: b,
  26311. getModel: function(e) {
  26312. if (!e.url)
  26313. throw 'getModel(): missing parameter "url"';
  26314. e.autoload = void 0 === e.autoload || e.autoload;
  26315. var t = l.parseSidUrl(e.url);
  26316. e.urlBase = t.urlBase,
  26317. e.urlModel = t.urlModel,
  26318. e.urlFiles = t.urlFiles;
  26319. var i = this._getPlatformError();
  26320. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  26321. this._loadModel().then(this._buildModel.bind(this)))
  26322. },
  26323. _getPlatformError: function() {
  26324. return "IE" === $.ua.browser.name && parseInt($.ua.browser.major) < 11 ? "webgl-unsupported" : "iOS" === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version) ? "webgl-ios" : Modernizr.webgl ? null : "webgl-unsupported"
  26325. },
  26326. _loadModel: function() {
  26327. return r.get(this.options.urlModel, {
  26328. responseType: "json",
  26329. prefetchFrom: "model",
  26330. auth: l.getAuthorizationHeader()
  26331. }).then(null, function() {
  26332. return h.warn("Model loading failed at initial metadata load"),
  26333. "loading-failed"
  26334. })
  26335. },
  26336. _buildModel: function(e) {
  26337. e = l.normalizeModeldata(e, s);
  26338. var t = new u(this.options,e);
  26339. return this.options.autoload ? t.load(!0) : $.when(t)
  26340. }
  26341. }
  26342. }
  26343. ).call(this, "/js/showcase.js")
  26344. }
  26345. , {
  26346. "./cameras/DollhouseCamera": 5,
  26347. "./cameras/FloorplanCamera": 6,
  26348. "./cameras/PanoramaCamera": 7,
  26349. "./controls/DollhouseControls": 10,
  26350. "./controls/FloorplanControls": 11,
  26351. "./controls/PanoramaControls": 13,
  26352. "./model/Model": 139,
  26353. "./objects/Chunk": 144,
  26354. "./objects/Floor": 146,
  26355. "./objects/Panorama": 148,
  26356. "./objects/Reticule": 149,
  26357. "./objects/Skybox": 152,
  26358. "./settings": 166,
  26359. "./shaders": 167,
  26360. "./util/ajax": 181,
  26361. "./util/logger": 189,
  26362. "./util/math": 190,
  26363. "./util/showcase": 193,
  26364. "./util/transitions": 195,
  26365. three: 217,
  26366. url: 208
  26367. }],
  26368. 169: [function(e, t, i) {
  26369. "use strict";
  26370. function n() {
  26371. var e = {
  26372. renderTarget: null,
  26373. inUse: !1,
  26374. size: -1,
  26375. pano: null
  26376. };
  26377. return e
  26378. }
  26379. function r(e) {
  26380. M.push(e)
  26381. }
  26382. function o(e) {
  26383. var t = n();
  26384. return t.inUse = !0,
  26385. t.size = e,
  26386. r(t),
  26387. t
  26388. }
  26389. function a(e) {
  26390. for (var t = 0; t < M.length; t++) {
  26391. var i = M[t];
  26392. if (!i.inUse && i.size === e)
  26393. return i.inUse = !0,
  26394. i
  26395. }
  26396. return null
  26397. }
  26398. function s(e) {
  26399. for (var t = 0; t < M.length; t++) {
  26400. var i = M[t];
  26401. if (i.renderTarget === e)
  26402. return i.inUse = !1,
  26403. !0
  26404. }
  26405. return !1
  26406. }
  26407. function l() {
  26408. this.tileDirectory = {},
  26409. this.activeRenderTargetDescriptors = {},
  26410. this.activePanos = [],
  26411. this.panoLODDescriptors = {},
  26412. this.panoDescriptors = {},
  26413. this.tileTrees = {},
  26414. this.sceneRenderer = null,
  26415. this.tileDownloader = null,
  26416. this.forceQueue = [],
  26417. this.uploadQueues = {},
  26418. this.uploadInterval = null,
  26419. this.uploadIntervalCancelled = !1,
  26420. this.usingTileOverlay = !1,
  26421. this.overlayTilesLoaded = !1,
  26422. this.overlayTileBase = null,
  26423. this.overlayTilesBasic = {},
  26424. this.overlayTilesEnhanced = {},
  26425. this.zoomRenderTarget = null,
  26426. this.zoomPano = null,
  26427. this.zoomingActive = !1,
  26428. this.zoomPanoId = null,
  26429. this.zoomPanoRenderingDisabled = !1,
  26430. this.direction = new h.Vector3,
  26431. this.initTime = -1,
  26432. this.maxBaseUploadsPerFrame = x,
  26433. this.maxNonBaseUploadsPerFrame = T
  26434. }
  26435. function c() {
  26436. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  26437. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26438. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26439. }
  26440. var h = e("three")
  26441. , u = e("../exception/BasicException")
  26442. , d = e("../settings")
  26443. , p = e("../enum/PanoSizeClass")
  26444. , f = (e("../objects/Panorama"),
  26445. e("../enum/PanoRendererEvents"))
  26446. , g = e("../enum/SceneRendererEvents")
  26447. , m = e("../enum/TileDownloaderEvents")
  26448. , v = e("../enum/Vectors")
  26449. , A = (e("../enum/GLCubeFaces"),
  26450. e("../objects/Panorama"),
  26451. e("./TileTree"))
  26452. , y = (e("./TileDownloader"),
  26453. e("./TilePrioritizer"))
  26454. , C = e("./TileUtils")
  26455. , p = e("../enum/PanoSizeClass")
  26456. , I = (e("../util/browser"),
  26457. e("../util/panorama"))
  26458. , E = e("events").EventEmitter
  26459. , b = !1
  26460. , w = d.tiling.uploadIntervalDelay
  26461. , _ = d.tiling.initialIntervalDelay
  26462. , T = d.tiling.maxNonBaseUploadsPerFrame
  26463. , x = d.tiling.maxBaseUploadsPerFrame
  26464. , S = {
  26465. Base: 0,
  26466. Remaining: 1
  26467. }
  26468. , M = [];
  26469. l.prototype = Object.create(E.prototype),
  26470. l.prototype.init = function(e, t, i) {
  26471. this.sceneRenderer = e,
  26472. this.tileDownloader = t,
  26473. this.qualityManager = i,
  26474. this.bindEvents(),
  26475. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  26476. this.initTime = performance.now()
  26477. }
  26478. ,
  26479. l.prototype.getActivePanoTextures = function(e) {
  26480. e = e || [];
  26481. for (var t = 0; t < M.length; t++) {
  26482. var i = M[t];
  26483. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  26484. }
  26485. }
  26486. ,
  26487. l.prototype.hasQueuedTiles = function() {
  26488. var e = this.peekNextFromUploadQueue();
  26489. return null !== e && void 0 !== e
  26490. }
  26491. ,
  26492. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  26493. return this.activeRenderTargetDescriptors[e]
  26494. }
  26495. ,
  26496. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  26497. this.activeRenderTargetDescriptors[e] = t
  26498. }
  26499. ,
  26500. l.prototype.loadOverlayTiles = function() {
  26501. if (0 !== d.tiling.overlayStyle) {
  26502. var e = 0
  26503. , t = function(t, n, r) {
  26504. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  26505. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  26506. e++,
  26507. e === i.length && (this.overlayTilesLoaded = !0)
  26508. }
  26509. .bind(this)
  26510. , i = [["static/images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["static/images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["static/images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["static/images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["static/images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["static/images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["static/images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["static/images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["static/images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["static/images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["static/images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  26511. i.forEach(function(e) {
  26512. this.tileDownloader.loadImage(e[0], 0, e[1])
  26513. }
  26514. .bind(this)),
  26515. this.usingTileOverlay = !0
  26516. } else
  26517. this.usingTileOverlay = !1
  26518. }
  26519. ,
  26520. l.prototype.bindEvents = function() {
  26521. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  26522. }
  26523. ,
  26524. l.prototype.setupZoomRenderTarget = function() {
  26525. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  26526. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  26527. return;
  26528. var e = this.zoomRenderTarget;
  26529. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  26530. e) {
  26531. var t = e.width
  26532. , i = this.zoomRenderTarget.width;
  26533. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  26534. e.texture.dispose(),
  26535. e.texture.loaded = !1,
  26536. e.texture.version = 0,
  26537. this.sceneRenderer.deallocateCubeTexture(e.texture),
  26538. e.texture = null
  26539. }
  26540. this.zoomPanoRenderingDisabled = !1
  26541. } else
  26542. this.zoomPanoRenderingDisabled = !0
  26543. }
  26544. ,
  26545. l.prototype.enableUltraHighQualityMode = function(e) {
  26546. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  26547. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  26548. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  26549. t && (this.qualityManager.enableUltraHighQualityMode(),
  26550. this.setupZoomRenderTarget(),
  26551. e())
  26552. }
  26553. .bind(this))
  26554. }
  26555. }
  26556. ,
  26557. l.prototype.activateTiledPano = function(e, t, i) {
  26558. i && this.clearAllQueuedUploads();
  26559. for (var n = 0; n < C.FACES_PER_PANO; n++)
  26560. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  26561. this.linkAllTilesAndNodes(e);
  26562. var r = this.getActiveRenderTargetDescriptor(e.id)
  26563. , l = t;
  26564. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  26565. !r || l !== r.size) {
  26566. if (r && s(r.renderTarget),
  26567. r = a(l),
  26568. !r) {
  26569. var c = this.initTiledPano(l, !1);
  26570. r = o(c.width),
  26571. r.renderTarget = c
  26572. }
  26573. r.pano = e,
  26574. this.resetPanoDescriptor(e.id),
  26575. this.resetPanoLODDescriptors(e.id),
  26576. this.resetRenderStatus(e.id, !0, !0)
  26577. }
  26578. this.setActiveRenderTargetDescriptor(e.id, r);
  26579. var h = i ? 0 : 1;
  26580. return this.updateActivePanos(e, h),
  26581. r.renderTarget
  26582. }
  26583. ,
  26584. l.prototype.deactivateTiledPano = function(e) {
  26585. var t = this.getActiveRenderTargetDescriptor(e.id);
  26586. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  26587. this.setActiveRenderTargetDescriptor(e.id, null);
  26588. var i = this.getUploadQueueForPano(e.id);
  26589. this.clearUploadQueue(i),
  26590. this.updateActivePanos()
  26591. }
  26592. ,
  26593. l.prototype.updateActivePanos = function() {
  26594. var e = [];
  26595. return function(t, i) {
  26596. e.length = 0;
  26597. for (var n = 0; n < this.activePanos.length; n++) {
  26598. t && e.length === i && e.push(t);
  26599. var r = this.activePanos[n]
  26600. , o = this.getActiveRenderTargetDescriptor(r.id);
  26601. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  26602. }
  26603. t && i >= e.length && e.push(t),
  26604. this.activePanos.length = 0,
  26605. this.activePanos.push.apply(this.activePanos, e)
  26606. }
  26607. }(),
  26608. l.prototype.getActivePanoCount = function() {
  26609. return this.activePanos.length
  26610. }
  26611. ,
  26612. l.prototype.resetRenderStatus = function(e, t, i, n) {
  26613. var r = null;
  26614. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  26615. for (var o = function(e, n, r, o) {
  26616. i && (n.tile.zoomUploaded = !1),
  26617. t && (n.tile.uploaded = !1)
  26618. }, a = 0; a < C.FACES_PER_PANO; a++) {
  26619. var s = this.getTileTree(e, a);
  26620. s.breadthFirst({
  26621. callback: o.bind(this, a),
  26622. minLevel: r
  26623. })
  26624. }
  26625. }
  26626. ,
  26627. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  26628. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  26629. t.tile.zoomUploaded = t.tile.uploaded,
  26630. t.zoomCovered = t.covered
  26631. }, n = 0; n < C.FACES_PER_PANO; n++) {
  26632. var r = this.getTileTree(e, n);
  26633. r.breadthFirst({
  26634. callback: i.bind(this, n),
  26635. maxLevel: t
  26636. })
  26637. }
  26638. }
  26639. ,
  26640. l.prototype.renderPanoTiles = function() {
  26641. var e = [];
  26642. return function(t, i, n, r) {
  26643. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  26644. i = i || this.direction || v.FORWARD;
  26645. var o = this.getActiveRenderTargetDescriptor(t);
  26646. if (!this.isRenderTargetDescriptorValid(o))
  26647. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  26648. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  26649. var s = this.getTileTree(t, a);
  26650. e.length = 0,
  26651. s.breadthFirst({
  26652. saveVisited: e
  26653. });
  26654. for (var l = 0; l < e.length; l++) {
  26655. var c = e[l];
  26656. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  26657. }
  26658. }
  26659. this.updateDirection(i)
  26660. }
  26661. }(),
  26662. l.prototype.isRenderTargetDescriptorValid = function(e) {
  26663. return e && e.renderTarget
  26664. }
  26665. ,
  26666. l.prototype.isPanoActive = function(e) {
  26667. var t = this.getActiveRenderTargetDescriptor(e);
  26668. return this.isRenderTargetDescriptorValid(t)
  26669. }
  26670. ,
  26671. l.prototype.isPanoZoomed = function(e) {
  26672. return this.zoomingActive && this.zoomPanoId === e
  26673. }
  26674. ,
  26675. l.prototype.initTileTree = function(e, t, i) {
  26676. var n = this.tileTrees[e];
  26677. n || (n = [],
  26678. this.tileTrees[e] = n);
  26679. var r = n[t];
  26680. if (!r) {
  26681. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  26682. r = new A(C.TILE_SIZE,o),
  26683. n[t] = r
  26684. }
  26685. }
  26686. ,
  26687. l.prototype.getTileTree = function(e, t) {
  26688. var i = this.tileTrees[e];
  26689. if (!i)
  26690. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  26691. var n = i[t];
  26692. if (!n)
  26693. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  26694. return n
  26695. }
  26696. ,
  26697. l.prototype.initTiledPano = function(e, t) {
  26698. var i = this.sceneRenderer.renderer
  26699. , n = (i.context,
  26700. new h.WebGLRenderTargetCube(e,e,{
  26701. stencilBuffer: !1
  26702. }))
  26703. , r = new h.CubeTexture([]);
  26704. n.texture = r,
  26705. r.image = [null, null, null, null, null, null],
  26706. r.flipY = !0,
  26707. t ? (r.generateMipmaps = !0,
  26708. r.magFilter = h.LinearFilter,
  26709. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  26710. r.magFilter = h.LinearFilter,
  26711. r.minFilter = h.LinearFilter),
  26712. r.format = h.RGBAFormat,
  26713. i.setRenderTarget(n),
  26714. i.setRenderTarget(null);
  26715. var o = i.properties.get(r);
  26716. return o.__image__webglTextureCube = o.__webglTexture,
  26717. n
  26718. }
  26719. ,
  26720. l.prototype.getUploadQueueForPano = function(e) {
  26721. var t = this.uploadQueues[e];
  26722. return t || (t = [],
  26723. this.uploadQueues[e] = t),
  26724. t
  26725. }
  26726. ,
  26727. l.prototype.isTileUploaded = function(e) {
  26728. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  26729. }
  26730. ,
  26731. l.prototype.setUploaded = function(e, t) {
  26732. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  26733. }
  26734. ,
  26735. l.prototype.queueTileUpload = function(e, t, i) {
  26736. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  26737. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  26738. var r = this.getUploadQueueForPano(e.panoId);
  26739. i ? this.uploadTile(e, !1) : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  26740. e.uploadQueued = !0,
  26741. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  26742. }
  26743. }
  26744. ,
  26745. l.prototype.shoulPushToFrontOfQueue = function(e) {
  26746. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  26747. }
  26748. ,
  26749. l.prototype.getTopUploadQueue = function() {
  26750. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  26751. for (var n = 0; n < this.activePanos.length; n++)
  26752. if (e = this.activePanos[n],
  26753. t = this.getUploadQueueForPano(e.id),
  26754. t.length > 0)
  26755. switch (i) {
  26756. case S.Base:
  26757. if (0 === t[0].level)
  26758. return t;
  26759. break;
  26760. case S.Remaining:
  26761. return t
  26762. }
  26763. return null
  26764. }
  26765. ,
  26766. l.prototype.getNextFromUploadQueue = function() {
  26767. var e = function(e) {
  26768. var t = e.shift();
  26769. return t.uploadQueued = !1,
  26770. t
  26771. };
  26772. return function() {
  26773. if (this.forceQueue.length > 0)
  26774. return e(this.forceQueue);
  26775. var t = this.getTopUploadQueue();
  26776. return t && t.length > 0 ? e(t) : null
  26777. }
  26778. }(),
  26779. l.prototype.peekNextFromUploadQueue = function() {
  26780. if (this.forceQueue.length > 0)
  26781. return this.forceQueue[0];
  26782. var e = this.getTopUploadQueue();
  26783. return e && e.length > 0 ? e[0] : null
  26784. }
  26785. ,
  26786. l.prototype.clearAllQueuedUploads = function() {
  26787. this.clearAllUploadQueues(null, 0)
  26788. }
  26789. ,
  26790. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  26791. this.clearAllUploadQueues(e, 0)
  26792. }
  26793. ,
  26794. l.prototype.clearAllUploadQueues = function(e, t) {
  26795. if (e)
  26796. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  26797. this.clearUploadQueue(this.forceQueue, t, e);
  26798. else {
  26799. for (var i = 0; i < this.activePanos.length; i++) {
  26800. var n = this.activePanos[i];
  26801. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  26802. }
  26803. this.clearUploadQueue(this.forceQueue, t)
  26804. }
  26805. }
  26806. ,
  26807. l.prototype.clearUploadQueue = function(e, t, i) {
  26808. void 0 !== t && null !== t || (t = 0);
  26809. for (var n = 0; n < e.length; ) {
  26810. var r = e[n];
  26811. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  26812. e.splice(n, 1)) : n++
  26813. }
  26814. }
  26815. ,
  26816. l.prototype.refreshUploadInterval = function() {
  26817. var e = null;
  26818. return function(t) {
  26819. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  26820. null !== t && void 0 !== t || (t = w),
  26821. b || (t = _),
  26822. this.uploadInterval = window.setTimeout(e, t),
  26823. this.uploadIntervalDelay = t)
  26824. }
  26825. }(),
  26826. l.prototype.update = function() {
  26827. var e = performance.now()
  26828. , t = 0;
  26829. return function() {
  26830. this.uploadIntervalCancelled = !0,
  26831. window.clearTimeout(this.uploadInterval),
  26832. this.uploadInterval = null;
  26833. var i = performance.now() - e;
  26834. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26835. e = performance.now()),
  26836. t++
  26837. }
  26838. }(),
  26839. l.prototype.updateUploadQueue = function(e, t) {
  26840. e || (e = 1);
  26841. for (var i = 0, n = 0; ; ) {
  26842. if (n >= t || i >= e)
  26843. break;
  26844. var r = this.getNextFromUploadQueue();
  26845. if (!r)
  26846. break;
  26847. if (0 !== r.level ? i++ : n++,
  26848. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  26849. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  26850. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  26851. }
  26852. }
  26853. }
  26854. ,
  26855. l.prototype.updateDirection = function(e) {
  26856. if (e = e || this.direction) {
  26857. this.direction = e;
  26858. for (var t = 0; t < this.activePanos.length; t++) {
  26859. var i = this.activePanos[t]
  26860. , n = this.getUploadQueueForPano(i.id);
  26861. y.sortPanoTiles(n, i, this.direction)
  26862. }
  26863. }
  26864. }
  26865. ,
  26866. l.prototype.uploadTile = function() {
  26867. var e = {}
  26868. , t = (new h.Vector4,
  26869. d.tiling.overlayStyle);
  26870. return function(i, n) {
  26871. var r = i.panoId
  26872. , o = i.image
  26873. , a = i.tileSize
  26874. , s = i.panoSize
  26875. , l = i.tileIndex
  26876. , c = (i.faceTileIndex,
  26877. i.totalTiles)
  26878. , u = (i.face,
  26879. i.tileX)
  26880. , d = i.tileY
  26881. , p = !0
  26882. , g = !1
  26883. , m = (this.getPanoDescriptor(r),
  26884. this.getPanoLODDescriptor(r, s))
  26885. , v = this.getActiveRenderTargetDescriptor(r)
  26886. , A = v.renderTarget
  26887. , y = v.size;
  26888. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  26889. y = this.qualityManager.getMaxZoomPanoSize()),
  26890. this.isRenderTargetDescriptorValid(v) || (p = !1,
  26891. g = !1),
  26892. n || (this.anyUploaded(i.node) && (p = !1,
  26893. g = !0),
  26894. this.isTileUploaded(i) && (p = !1,
  26895. g = !1)),
  26896. p) {
  26897. var C = u * a
  26898. , I = d * a
  26899. , E = a / s * y
  26900. , b = C / s * y
  26901. , w = I / s * y;
  26902. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  26903. var _ = e[a];
  26904. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  26905. 1 === t || 2 === t) {
  26906. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  26907. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  26908. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  26909. } else
  26910. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  26911. m.uploadCount++,
  26912. this.emit(f.TileRenderSuccess, r, s, l, c),
  26913. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  26914. this.setUploaded(i, !0),
  26915. this.addCoverageForNode(i.node)
  26916. } else
  26917. this.setUploaded(i, !1);
  26918. return i.uploadAttempted || (m.uploadAttempts++,
  26919. this.emit(f.TileUploadAttempted, r, s, l, c)),
  26920. i.uploadAttempted = !0,
  26921. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  26922. g
  26923. }
  26924. }(),
  26925. l.prototype.linkTileAndNode = function(e, t) {
  26926. t.tile = e,
  26927. e.node = t
  26928. }
  26929. ,
  26930. l.prototype.linkAllTilesAndNodes = function(e) {
  26931. for (var t = function(t, i, n, r, o) {
  26932. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  26933. this.linkTileAndNode(a, n)
  26934. }, i = 0; i < C.FACES_PER_PANO; i++) {
  26935. var n = this.getTileTree(e.id, i);
  26936. n.breadthFirst({
  26937. callback: t.bind(this, n, i)
  26938. })
  26939. }
  26940. }
  26941. ,
  26942. l.prototype.anyUploaded = function(e) {
  26943. if (!e)
  26944. return !1;
  26945. if (e.tile && this.isTileUploaded(e.tile))
  26946. return !0;
  26947. if (e.children)
  26948. for (var t = 0; t < e.children.length; t++) {
  26949. var i = e.children[t];
  26950. if (this.anyUploaded(i))
  26951. return !0
  26952. }
  26953. return !1
  26954. }
  26955. ,
  26956. l.prototype.setNodeCovered = function(e, t) {
  26957. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  26958. }
  26959. ,
  26960. l.prototype.isNodeCovered = function(e) {
  26961. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  26962. }
  26963. ,
  26964. l.prototype.addCoverageForNode = function(e) {
  26965. if (this.setNodeCovered(e, !0),
  26966. e.parent && e.covered) {
  26967. var t = e.parent;
  26968. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  26969. }
  26970. }
  26971. ,
  26972. l.prototype.calcFullCoverage = function(e) {
  26973. var t = !1;
  26974. if (e.children)
  26975. for (var i = 0; i < e.children.length; i++) {
  26976. var n = e.children[i];
  26977. t = t || this.calcFullCoverage(n)
  26978. }
  26979. e.covered = e.tile.uploaded || t
  26980. }
  26981. ,
  26982. l.prototype.nodeSubcovered = function(e) {
  26983. if (!e.children)
  26984. return !1;
  26985. for (var t = 0; t < e.children.length; t++)
  26986. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  26987. return !1;
  26988. return !0
  26989. }
  26990. ,
  26991. l.prototype.resetPanoDescriptor = function(e) {
  26992. this.getPanoDescriptor(e)
  26993. }
  26994. ,
  26995. l.prototype.getPanoDescriptor = function(e) {
  26996. var t = this.panoDescriptors[e];
  26997. return t || (t = {},
  26998. this.panoDescriptors[e] = t),
  26999. t
  27000. }
  27001. ,
  27002. l.prototype.resetPanoLODDescriptors = function(e) {
  27003. var t = this.getPanoLODDescriptors(e);
  27004. for (var i in t)
  27005. if (t.hasOwnProperty(i)) {
  27006. var n = t[i];
  27007. n.uploadCount = 0,
  27008. n.uploadAttempts = 0
  27009. }
  27010. }
  27011. ,
  27012. l.prototype.getPanoLODDescriptor = function(e, t) {
  27013. var i = this.getPanoLODDescriptors(e)
  27014. , n = i[t];
  27015. return n || (n = {
  27016. uploadCount: 0,
  27017. uploadAttempts: 0
  27018. },
  27019. i[t] = n),
  27020. n
  27021. }
  27022. ,
  27023. l.prototype.getPanoLODDescriptors = function(e) {
  27024. var t = this.panoLODDescriptors[e];
  27025. return t || (t = {},
  27026. this.panoLODDescriptors[e] = t),
  27027. t
  27028. }
  27029. ,
  27030. l.prototype.onTileDownloaded = function(e) {
  27031. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27032. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27033. if (i.downloaded = !0,
  27034. i.image = e.image,
  27035. i.panoSize = e.panoSize,
  27036. i.tileX = e.tileX,
  27037. i.tileY = e.tileY,
  27038. i.totalTiles = e.totalTiles,
  27039. i.tileIndex = e.tileIndex,
  27040. i.faceTileIndex = e.faceTileIndex,
  27041. i.face = e.face,
  27042. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27043. i.panoId = e.panoId,
  27044. i.tileSize = e.tileSize,
  27045. i.direction = (new h.Vector3).copy(e.direction),
  27046. i.node = null,
  27047. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27048. this.isPanoActive(i.panoId)) {
  27049. var n = this.getTileTree(i.panoId, i.face)
  27050. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27051. this.linkTileAndNode(i, r),
  27052. this.queueTileUpload(i, !0)
  27053. }
  27054. }
  27055. ,
  27056. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27057. var r = this.tileDirectory[e];
  27058. r || (r = {},
  27059. this.tileDirectory[e] = r);
  27060. var o = 16384 * t + 1024 * i + n
  27061. , a = r[o];
  27062. return a || (a = {
  27063. downloaded: !1,
  27064. uploaded: !1,
  27065. zoomUploaded: !1
  27066. },
  27067. r[o] = a),
  27068. a._key = e + ":" + t + ":" + i + ":" + n,
  27069. a._tileKey = o,
  27070. a
  27071. }
  27072. ,
  27073. l.prototype.setZoomingActive = function(e, t, i) {
  27074. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27075. this.zoomPanoId = t.id,
  27076. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27077. }
  27078. ,
  27079. l.prototype.updateZoomedPanoFromBase = function(e) {
  27080. if (!this.zoomPanoRenderingDisabled) {
  27081. var t = this.getActiveRenderTargetDescriptor(e.id);
  27082. if (t && t.renderTarget) {
  27083. var i = this.qualityManager.getMaxZoomPanoSize()
  27084. , n = t.renderTarget
  27085. , r = t.size;
  27086. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27087. this.copyBaseRenderStatusToZoomed(e.id)
  27088. }
  27089. }
  27090. }
  27091. ,
  27092. t.exports = l
  27093. }
  27094. , {
  27095. "../enum/GLCubeFaces": 25,
  27096. "../enum/PanoRendererEvents": 35,
  27097. "../enum/PanoSizeClass": 36,
  27098. "../enum/SceneRendererEvents": 43,
  27099. "../enum/TileDownloaderEvents": 45,
  27100. "../enum/Vectors": 50,
  27101. "../exception/BasicException": 55,
  27102. "../objects/Panorama": 148,
  27103. "../settings": 166,
  27104. "../util/browser": 182,
  27105. "../util/panorama": 191,
  27106. "./TileDownloader": 171,
  27107. "./TilePrioritizer": 172,
  27108. "./TileTree": 173,
  27109. "./TileUtils": 174,
  27110. events: 202,
  27111. three: 217
  27112. }],
  27113. 170: [function(e, t, i) {
  27114. "use strict";
  27115. function n(e, t, i) {
  27116. this.maxNavPanoSize = -1,
  27117. this.maxZoomPanoSize = -1,
  27118. this.devicePixelDensity = e,
  27119. this.deviceScreenSize = t,
  27120. this.clientBandwidth = i,
  27121. this.panoSizeClassMap = {},
  27122. this.useHighResolutionPanos = !0,
  27123. this.useUltraHighResolutionPanos = !1,
  27124. this.modelHasUltraHighPanos = !1
  27125. }
  27126. var r = e("../enum/PanoSizeClass")
  27127. , o = e("../settings")
  27128. , a = e("../util/browser")
  27129. , s = e("../constants")
  27130. , l = e("../util/showcase")
  27131. , c = e("../enum/ModelManagerEvents");
  27132. n.prototype.init = function(e) {
  27133. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27134. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27135. this.highSize = this.getPanoSize(r.HIGH),
  27136. this.standardSize = this.getPanoSize(r.STANDARD),
  27137. this.baseSize = this.getPanoSize(r.BASE),
  27138. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27139. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27140. this.updateMaximums(),
  27141. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27142. }
  27143. ,
  27144. n.prototype.updateFromModel = function(e) {
  27145. this.updateHighResolutionSettings(e),
  27146. this.updateUltraHighResolutionSettings(e)
  27147. }
  27148. ,
  27149. n.prototype.updateHighResolutionSettings = function(e) {
  27150. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27151. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27152. //this.useHighResolutionPanos = !0;
  27153. //----------------------e n d -----------------------------------------------------------------
  27154. this.updateMaximums()
  27155. }
  27156. ,
  27157. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27158. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27159. this.updateMaximums()
  27160. }
  27161. ,
  27162. n.prototype.enableUltraHighQualityMode = function() {
  27163. this.modelHasUltraHighPanos = !0,
  27164. this.updateUltraHighResolutionSettings(null)
  27165. }
  27166. ,
  27167. n.prototype.ultraHighQualityModeEnabled = function() {
  27168. return this.modelHasUltraHighPanos
  27169. }
  27170. ,
  27171. n.prototype.onModelChanged = function(e) {
  27172. this.updateFromModel(e.model),
  27173. this.updateMaximums()
  27174. }
  27175. ,
  27176. n.prototype.updateMaximums = function() {
  27177. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  27178. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  27179. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27180. }
  27181. ,
  27182. n.prototype.buildPanoSizeClassMap = function() {
  27183. this.panoSizeClassMap[r.BASE] = 512,
  27184. this.panoSizeClassMap[r.STANDARD] = 1024,
  27185. this.panoSizeClassMap[r.HIGH] = 2048,
  27186. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  27187. }
  27188. ,
  27189. n.prototype.getPanoSize = function(e) {
  27190. return this.panoSizeClassMap[e]
  27191. }
  27192. ,
  27193. n.prototype.getMaxPossiblePanoSize = function() {
  27194. return this.getPanoSize(r.ULTRAHIGH)
  27195. }
  27196. ,
  27197. n.prototype.getMaxPanoSize = function() {
  27198. return this.maxZoomPanoSize
  27199. }
  27200. ,
  27201. n.prototype.getMaxNavPanoSize = function() {
  27202. return this.maxNavPanoSize
  27203. }
  27204. ,
  27205. n.prototype.getMaxZoomPanoSize = function() {
  27206. return this.maxZoomPanoSize
  27207. }
  27208. ,
  27209. n.prototype.detectMaxNavPanoSizeClass = function() {
  27210. if(settings.mobileNavHigh)return r.HIGH //改
  27211. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27212. }
  27213. ,
  27214. n.prototype.detectMaxNavPanoSize = function() {
  27215. var e = this.detectMaxNavPanoSizeClass();
  27216. return this.getPanoSize(e)
  27217. }
  27218. ,
  27219. n.prototype.detectMaxZoomPanoSize = function() {
  27220. 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)
  27221. }
  27222. ,
  27223. t.exports = n
  27224. }
  27225. , {
  27226. "../constants": 8,
  27227. "../enum/ModelManagerEvents": 33,
  27228. "../enum/PanoSizeClass": 36,
  27229. "../settings": 166,
  27230. "../util/browser": 182,
  27231. "../util/showcase": 193
  27232. }],
  27233. 171: [function(e, t, i) {
  27234. (function(i) {
  27235. "use strict";
  27236. function n(e) {
  27237. this.panos = null,
  27238. this.retryMinimumTime = 1e4,
  27239. this.urls = null,
  27240. this.panoLoadCallbacks = {},
  27241. this.downloadDescriptors = {},
  27242. this.priorityQueue = [],
  27243. this.forceQueue = [],
  27244. this.activeDownloads = [],
  27245. this.qualityManager = null,
  27246. this.tilePrioritizer = null,
  27247. this.refreshInterval = null,
  27248. this.processPriorityQueue = !1,
  27249. this.concurrentDownloads = e.concurrentDownloads || 1,
  27250. this.downloadTestResults = {}
  27251. }
  27252. var r = e("three")
  27253. , o = (e("../enum/Viewmode"),
  27254. e("../settings"))
  27255. , a = (e("../objects/Panorama"),
  27256. e("../util/logger"))
  27257. , s = (e("../enum/Vectors"),
  27258. e("../enum/PanoSizeClass"),
  27259. e("../enum/TileDownloaderEvents"))
  27260. , l = e("./TilePrioritizer")
  27261. , c = e("./TileUtils")
  27262. , h = (e("../enum/GLCubeFaces"),
  27263. e("../enum/DownloadStatus"))
  27264. , u = e("../util/panorama")
  27265. , d = e("../util/ajax")
  27266. , p = e("../ab")
  27267. , f = e("events").EventEmitter
  27268. , g = (new a(i),
  27269. Object.freeze({
  27270. Testing: 1,
  27271. Success: 2,
  27272. Fail: 3
  27273. }));
  27274. n.prototype = Object.create(f.prototype),
  27275. n.IDLE_REFRESH_DELAY = 500,
  27276. n.ACTIVE_REFRESH_DELAY = 16,
  27277. n.DOWNLOAD_RETRIES = 4,
  27278. n.prototype.init = function(e) {
  27279. this.qualityManager = e
  27280. }
  27281. ,
  27282. n.prototype.setUrls = function(e) {
  27283. this.urls = e
  27284. }
  27285. ,
  27286. n.prototype.setPanoData = function(e, t, i) {
  27287. this.panos = e,
  27288. this.imagePanos = t,
  27289. this.panoGroupId = i
  27290. }
  27291. ,
  27292. n.prototype.start = function() {
  27293. this.refreshUpdateInterval(0)
  27294. }
  27295. ,
  27296. n.prototype.stop = function() {
  27297. window.cancel(this.refreshInterval)
  27298. }
  27299. ,
  27300. n.prototype.refreshUpdateInterval = function(e) {
  27301. e || (e = 0),
  27302. this.refreshInterval = window.setTimeout(function() {
  27303. var e = this.update();
  27304. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  27305. }
  27306. .bind(this), e)
  27307. }
  27308. ,
  27309. n.prototype.update = function() {
  27310. var e = this.forceQueue.length > 0;
  27311. return this.processQueueForDownloading(this.forceQueue),
  27312. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  27313. this.priorityQueue.length > 0 && (e = !0),
  27314. this.processQueueForDownloading(this.priorityQueue)),
  27315. e
  27316. }
  27317. ,
  27318. n.prototype.forceQueueTilesForPano = function() {
  27319. var e = []
  27320. , t = [];
  27321. return function(i, n, r, o, a, s) {
  27322. e.length = 0;
  27323. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  27324. var p = u[d];
  27325. p.status !== h.None && p.status !== h.Queued || e.push(p)
  27326. }
  27327. if (r && e.length > 0) {
  27328. l.sortPanoTiles(e, i, r),
  27329. t.length = 0,
  27330. c.matchingTilesInDirection(i, n, r, o, a, t);
  27331. for (var f = 0, g = function(e) {
  27332. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  27333. }; f < e.length; ) {
  27334. var m = e[f]
  27335. , v = t.findIndex(g);
  27336. v < 0 ? e.splice(f, 1) : f++
  27337. }
  27338. }
  27339. for (var A = 0; A < e.length; A++)
  27340. this.forceQueue.push(e[A]);
  27341. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  27342. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  27343. s && this.processQueueForDownloading(this.forceQueue, !0)
  27344. }
  27345. }(),
  27346. n.prototype.clearForceQueue = function() {
  27347. this.clearQueue(this.forceQueue)
  27348. }
  27349. ,
  27350. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  27351. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  27352. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  27353. this.clearFromQueue(this.priorityQueue, h.None, !0),
  27354. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  27355. }
  27356. ,
  27357. n.prototype.clearQueue = function(e) {
  27358. this.setStatusForAllDescriptors(e, h.None),
  27359. e.length = 0
  27360. }
  27361. ,
  27362. n.prototype.clearFromQueue = function(e, t, i) {
  27363. for (var n = 0; n < e.length; n++) {
  27364. var r = e[n];
  27365. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  27366. }
  27367. }
  27368. ,
  27369. n.prototype.setStatusForAllDescriptors = function(e, t) {
  27370. for (var i = 0; i < e.length; i++) {
  27371. var n = e[i];
  27372. n && (n.status = t)
  27373. }
  27374. }
  27375. ,
  27376. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  27377. for (var i = 0; i < e.length; i++) {
  27378. var n = e[i];
  27379. n && (n.status !== t ? n.status = t : e[i] = null)
  27380. }
  27381. }
  27382. ,
  27383. n.prototype.getTileDownloadDescriptors = function(e, t) {
  27384. var i = this.getAllTileDownloadDescriptorsForPano(e)
  27385. , n = i[t];
  27386. return n || (n = this.buildDownloadDescriptorArray(t),
  27387. i[t] = n,
  27388. this.initTileDownloadDescriptors(n, e, t)),
  27389. n
  27390. }
  27391. ,
  27392. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  27393. var t = this.downloadDescriptors[e.id];
  27394. return t || (t = {},
  27395. this.downloadDescriptors[e.id] = t),
  27396. t
  27397. }
  27398. ,
  27399. n.prototype.processQueueForDownloading = function(e, t) {
  27400. if (this.cleanupActiveDownloads(),
  27401. this.activeDownloads.length < this.concurrentDownloads || t)
  27402. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  27403. var o = e.shift();
  27404. o && (this.startDownload(o),
  27405. n++)
  27406. }
  27407. }
  27408. ,
  27409. n.prototype.testDownload = function(e, t, i) {
  27410. var n = this.downloadTestResults[e];
  27411. if (n)
  27412. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  27413. this.downloadTestResults[e] = g.Testing;
  27414. var r = this.panos.list[0]
  27415. , o = this.getTileUrl(r.id, e, t, 0)
  27416. , a = function(t) {
  27417. this.downloadTestResults[e] = g.Success,
  27418. i(!0)
  27419. }
  27420. .bind(this)
  27421. , s = function() {
  27422. this.downloadTestResults[e] = g.Fail,
  27423. i(!1)
  27424. }
  27425. .bind(this);
  27426. this.loadImage(o, 0, a, s)
  27427. }
  27428. ,
  27429. n.prototype.startDownload = function(e) {
  27430. e.status = h.Downloading;
  27431. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  27432. this.activeDownloads.push(e),
  27433. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  27434. }
  27435. ,
  27436. n.prototype.downloadFailed = function(e, t) {}
  27437. ,
  27438. n.prototype.downloadComplete = function(e, t) {
  27439. if (e.panoGroupId === this.panoGroupId) {
  27440. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  27441. e.status = h.Downloaded,
  27442. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  27443. var n = {
  27444. panoId: e.pano.id,
  27445. image: t,
  27446. tileSize: e.tileSize,
  27447. panoSize: e.panoSize,
  27448. tileIndex: e.tileIndex,
  27449. faceTileIndex: e.faceTileIndex,
  27450. totalTiles: e.totalTiles,
  27451. face: e.face,
  27452. tileX: e.tileX,
  27453. tileY: e.tileY,
  27454. direction: e.direction
  27455. };
  27456. e.image = t,
  27457. this.emit(s.TileDownloadSuccess, n),
  27458. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  27459. panoId: e.pano.id,
  27460. tileSize: e.tileSize,
  27461. panoSize: e.panoSize
  27462. },
  27463. this.emit(s.PanoDownloadComplete, n),
  27464. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  27465. }
  27466. }
  27467. ,
  27468. n.prototype.cleanupActiveDownloads = function() {
  27469. var e = [];
  27470. return function() {
  27471. e.length = 0;
  27472. for (var t = 0; t < this.activeDownloads.length; t++) {
  27473. var i = this.activeDownloads[t];
  27474. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  27475. }
  27476. this.activeDownloads.length = 0,
  27477. this.activeDownloads.push.apply(this.activeDownloads, e)
  27478. }
  27479. }(),
  27480. n.prototype.isPanoDownloaded = function(e, t) {
  27481. var i = this.getTileDownloadDescriptors(e, t);
  27482. if (i.length <= 0)
  27483. return !1;
  27484. for (var n = 0; n < i.length; n++) {
  27485. var r = i[n];
  27486. if (r.status !== h.Downloaded)
  27487. return !1
  27488. }
  27489. return !0
  27490. }
  27491. ,
  27492. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  27493. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  27494. this.panoLoadCallbacks[o] = {
  27495. onLoad: i,
  27496. onFail: n,
  27497. onProgress: r
  27498. }
  27499. }
  27500. ,
  27501. n.prototype.getPanoLoadCallbacks = function(e, t) {
  27502. var i = e.id + ":" + t;
  27503. return this.panoLoadCallbacks[i]
  27504. }
  27505. ,
  27506. n.prototype.buildDownloadDescriptorArray = function(e) {
  27507. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  27508. var r = this.buildDownloadDescriptor();
  27509. i.push(r)
  27510. }
  27511. return i
  27512. }
  27513. ,
  27514. n.prototype.buildDownloadDescriptor = function() {
  27515. var e = {
  27516. panoGroupId: null,
  27517. pano: null,
  27518. panoSize: -1,
  27519. tileSize: -1,
  27520. tileIndex: -1,
  27521. totalTiles: -1,
  27522. faceTileIndex: -1,
  27523. status: h.None,
  27524. url: null,
  27525. image: null,
  27526. direction: new r.Vector3,
  27527. face: -1,
  27528. cubeFace: -1,
  27529. tileX: -1,
  27530. tileY: -1
  27531. };
  27532. return e
  27533. }
  27534. ,
  27535. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  27536. for (var n = 0; n < e.length; n++) {
  27537. var r = e[n];
  27538. this.initTileDownloadDescriptor(r, t, i, n)
  27539. }
  27540. }
  27541. ,
  27542. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  27543. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  27544. e.face = c.getFaceForTile(i, n),
  27545. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  27546. e.panoGroupId = this.panoGroupId,
  27547. e.pano = t,
  27548. e.panoSize = i,
  27549. e.tileSize = r,
  27550. e.tileIndex = n,
  27551. e.totalTiles = c.getTileCountForSize(i),
  27552. e.status = h.None,
  27553. e.image = null,
  27554. c.getTileLocation(e.panoSize, e.tileIndex, e),
  27555. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  27556. }
  27557. ,
  27558. n.prototype.getTileUrl = function() {
  27559. var e = {
  27560. 256: "256",
  27561. 512: "512",
  27562. 1024: "1k",
  27563. 2048: "2k",
  27564. 4096: "4k"
  27565. }
  27566. , t = {
  27567. face: -1,
  27568. faceTileIndex: -1,
  27569. tileX: -1,
  27570. tileY: -1
  27571. };
  27572. return function(i, n, r, a) {
  27573. c.getTileLocation(n, a, t);
  27574. var s = Math.floor(n / r)
  27575. , l = s * s
  27576. , h = Math.floor(a / l)
  27577. , u = "";
  27578. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  27579. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  27580. return d = p.changeIfTileGenerating(d)
  27581. }
  27582. }(),
  27583. n.prototype.loadImage = function(e, t, i, n) {
  27584. d.getImage(e, t).then(function(e) {
  27585. i(e)
  27586. }).fail(n)
  27587. }
  27588. ,
  27589. t.exports = n
  27590. }
  27591. ).call(this, "/js/tile/TileDownloader.js")
  27592. }
  27593. , {
  27594. "../ab": 3,
  27595. "../enum/DownloadStatus": 24,
  27596. "../enum/GLCubeFaces": 25,
  27597. "../enum/PanoSizeClass": 36,
  27598. "../enum/TileDownloaderEvents": 45,
  27599. "../enum/Vectors": 50,
  27600. "../enum/Viewmode": 51,
  27601. "../objects/Panorama": 148,
  27602. "../settings": 166,
  27603. "../util/ajax": 181,
  27604. "../util/logger": 189,
  27605. "../util/panorama": 191,
  27606. "./TilePrioritizer": 172,
  27607. "./TileUtils": 174,
  27608. events: 202,
  27609. three: 217
  27610. }],
  27611. 172: [function(e, t, i) {
  27612. (function(i) {
  27613. "use strict";
  27614. function n(e, t, i, o, a) {
  27615. this.qualityManager = e,
  27616. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27617. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  27618. this.baseSize = t,
  27619. this.standardSize = i,
  27620. this.highSize = o,
  27621. this.ultraHighSize = a,
  27622. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  27623. }
  27624. var r = e("three")
  27625. , o = (e("../enum/Viewmode"),
  27626. e("../settings"),
  27627. e("../settings"),
  27628. e("../objects/Panorama"))
  27629. , a = e("../util/logger")
  27630. , s = (e("../enum/Vectors"),
  27631. e("../enum/PanoSizeClass"),
  27632. e("../enum/ModelManagerEvents"),
  27633. e("../enum/GLCubeFaces"),
  27634. e("../enum/DownloadStatus"))
  27635. , l = (e("../util/browser"),
  27636. e("./TileUtils"))
  27637. , c = e("../util/math")
  27638. , h = (e("events").EventEmitter,
  27639. new a(i),
  27640. Object.freeze({
  27641. None: 0,
  27642. DirectionalFOV: 1
  27643. }));
  27644. n.PriorityCriteria = function(e, t, i, n, o) {
  27645. this.pano = e,
  27646. this.cameraPosition = (new r.Vector3).copy(t),
  27647. this.cameraDir = (new r.Vector3).copy(i),
  27648. this.panoSpaceDir = (new r.Vector3).copy(n),
  27649. this.upcomingPanos = o,
  27650. this.copy = function(e) {
  27651. this.pano = e.pano,
  27652. this.cameraPosition.copy(e.cameraPosition),
  27653. this.cameraDir.copy(e.cameraDir),
  27654. this.panoSpaceDir.copy(e.panoSpaceDir),
  27655. this.upcomingPanos = o
  27656. }
  27657. ,
  27658. this.zoomingActive = !1
  27659. }
  27660. ,
  27661. n.DIRECTIONAL_FOV = 180,
  27662. n.DIRECTIONAL_FOV_NARROW = 120,
  27663. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  27664. n.MAX_SCORED_PANOS_TOADD = 2,
  27665. n.MAX_UPCOMING_PANOS_TOADD = 3,
  27666. n.DIRECTION_SCORE_STRICTNESS = .75,
  27667. n.appendQueue = function(e, t) {
  27668. if (e && t)
  27669. for (var i = 0; i < t.length; i++)
  27670. e.push(t[i])
  27671. }
  27672. ,
  27673. n.prototype.updateCriteria = function(e, t, i, n) {
  27674. this.priorityCriteria.pano = e,
  27675. this.priorityCriteria.cameraPosition.copy(t),
  27676. this.priorityCriteria.cameraDir.copy(i),
  27677. this.priorityCriteria.upcomingPanos = n,
  27678. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  27679. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  27680. }
  27681. ,
  27682. n.prototype.filterAndPrioritize = function() {
  27683. var e = []
  27684. , t = []
  27685. , i = [];
  27686. return function(r, o, a) {
  27687. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  27688. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  27689. var s = this.baseSize
  27690. , l = this.standardSize
  27691. , c = this.highSize
  27692. , h = this.ultraHighSize;
  27693. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  27694. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  27695. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  27696. i.length = 0,
  27697. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27698. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27699. n.appendQueue(r, i),
  27700. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  27701. i.length = 0,
  27702. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27703. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  27704. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27705. n.appendQueue(r, i),
  27706. i.length = 0,
  27707. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27708. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27709. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  27710. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  27711. n.appendQueue(r, i),
  27712. this.queueTilesForPanos(r, e, a, s)
  27713. }
  27714. }(),
  27715. n.prototype.canDownloadSize = function(e) {
  27716. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  27717. }
  27718. ,
  27719. n.prototype.populateNeighborPanos = function(e, t, i) {
  27720. i = i || [],
  27721. i.length = 0;
  27722. var n = t.getNeighbours(e);
  27723. for (var r in n)
  27724. if (n.hasOwnProperty(r)) {
  27725. var o = t.get(r);
  27726. i.push(o)
  27727. }
  27728. return i
  27729. }
  27730. ,
  27731. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  27732. i = i || [],
  27733. i.length = 0;
  27734. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  27735. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  27736. , c = t.sortByScore(s, l);
  27737. if (c)
  27738. for (var h = 0; h < c.length && h < a; h++) {
  27739. var u = c[h].pano;
  27740. i.push(u)
  27741. }
  27742. return i
  27743. }
  27744. ,
  27745. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  27746. for (var o = 0, a = 0; a < t.length; a++) {
  27747. var s = t[a]
  27748. , l = this.queueTilesForPano(e, i, s, n);
  27749. if (o += l > 0 ? 1 : 0,
  27750. r && o >= r)
  27751. break
  27752. }
  27753. return o
  27754. }
  27755. ,
  27756. n.prototype.queueTilesForPano = function() {
  27757. var e = {
  27758. filter: h.None
  27759. };
  27760. return function(t, i, n, r) {
  27761. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  27762. }
  27763. }(),
  27764. n.prototype.queueTilesForPanosInDirection = function() {
  27765. var e = new r.Vector3;
  27766. return function(t, i, n, r, o, a, s, l) {
  27767. for (var h = 0, u = 0; u < n.length; u++) {
  27768. var d = n[u];
  27769. e.copy(d.position),
  27770. e.sub(o),
  27771. e.normalize();
  27772. var p = Math.max(Math.min(a.dot(e), 1), -1)
  27773. , f = c.getFOVDotThreshold(s);
  27774. if (p >= f) {
  27775. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  27776. if (h += g > 0 ? 1 : 0,
  27777. l && h >= l)
  27778. break
  27779. }
  27780. }
  27781. return h
  27782. }
  27783. }(),
  27784. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  27785. for (var l = 0, c = 0; c < i.length; c++) {
  27786. var h = i[c]
  27787. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  27788. if (l += u > 0 ? 1 : 0,
  27789. s && l >= s)
  27790. break
  27791. }
  27792. return l
  27793. }
  27794. ,
  27795. n.prototype.queueTilesInDirectionForPano = function() {
  27796. var e = {
  27797. filter: h.DirectionalFOV,
  27798. direction: new r.Vector3,
  27799. fov: 60
  27800. }
  27801. , t = new r.Vector3;
  27802. return function(i, n, r, o, a, s, c) {
  27803. return t.copy(s),
  27804. l.getRelativeDirection(r.quaternion, t),
  27805. e.direction.copy(t),
  27806. e.fov = c,
  27807. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  27808. }
  27809. }(),
  27810. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  27811. var e = [];
  27812. return function(t, i, n, r, o) {
  27813. var a = i.getTileDownloadDescriptors(n, r);
  27814. e.length = 0,
  27815. this.filterTileDownloadDescriptors(n, a, e, o);
  27816. for (var s = 0, l = 0; l < e.length; l++) {
  27817. var c = e[l];
  27818. c && (t.push(c),
  27819. s++)
  27820. }
  27821. return s
  27822. }
  27823. }(),
  27824. n.prototype.filterTileDownloadDescriptors = function() {
  27825. new r.Vector3;
  27826. return function(e, t, i, n) {
  27827. var r, o;
  27828. switch (n.filter) {
  27829. case h.DirectionalFOV:
  27830. for (r = 0; r < t.length; r++)
  27831. o = t[r],
  27832. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  27833. break;
  27834. default:
  27835. for (r = 0; r < t.length; r++)
  27836. o = t[r],
  27837. i.push(o)
  27838. }
  27839. for (r = 0; r < i.length; r++)
  27840. o = i[r],
  27841. this.canIncludeDescriptor(o) || (i[r] = null)
  27842. }
  27843. }(),
  27844. n.prototype.canIncludeDescriptor = function(e) {
  27845. return e.status !== s.Downloading && e.status !== s.Downloaded
  27846. }
  27847. ,
  27848. n.prototype.canIncludePano = function(e, t) {
  27849. return !e.isLoaded(t)
  27850. }
  27851. ,
  27852. n.getFOVDotThreshold = function(e) {
  27853. return Math.cos(r.Math.degToRad(e / 2))
  27854. }
  27855. ;
  27856. var u = function() {
  27857. var e = function e(t, i) {
  27858. var n = e._panoSpaceDir
  27859. , r = e._fovThreshold
  27860. , o = e._fovThresholdNarrow
  27861. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  27862. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  27863. return t._dot = a,
  27864. i._dot = s,
  27865. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  27866. };
  27867. return e._panoSpaceDir = new r.Vector3,
  27868. e._fovThreshold = -1,
  27869. e._fovThresholdNarrow = -1,
  27870. e
  27871. }();
  27872. n.sortPanoTiles = function(e, t, i) {
  27873. u._panoSpaceDir.copy(i),
  27874. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  27875. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27876. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  27877. e.sort(u)
  27878. }
  27879. ,
  27880. n.insertSortedPanoTile = function(e, t, i, r) {
  27881. u._panoSpaceDir.copy(r),
  27882. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  27883. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  27884. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  27885. for (var o = -1, a = 0; a < e.length; a++) {
  27886. var s = u(t, e[a]);
  27887. if (s <= 0) {
  27888. o = a;
  27889. break
  27890. }
  27891. }
  27892. if (o === -1)
  27893. e[e.length] = t;
  27894. else {
  27895. for (var h = e.length; h > o; h--)
  27896. e[h] = e[h - 1];
  27897. e[o] = t
  27898. }
  27899. }
  27900. ,
  27901. n.prototype.setZoomingActive = function(e) {
  27902. e !== this.zoomingActive && (this.zoomingActive = e)
  27903. }
  27904. ,
  27905. t.exports = n
  27906. }
  27907. ).call(this, "/js/tile/TilePrioritizer.js")
  27908. }
  27909. , {
  27910. "../enum/DownloadStatus": 24,
  27911. "../enum/GLCubeFaces": 25,
  27912. "../enum/ModelManagerEvents": 33,
  27913. "../enum/PanoSizeClass": 36,
  27914. "../enum/Vectors": 50,
  27915. "../enum/Viewmode": 51,
  27916. "../objects/Panorama": 148,
  27917. "../settings": 166,
  27918. "../util/browser": 182,
  27919. "../util/logger": 189,
  27920. "../util/math": 190,
  27921. "./TileUtils": 174,
  27922. events: 202,
  27923. three: 217
  27924. }],
  27925. 173: [function(e, t, i) {
  27926. "use strict";
  27927. function n(e, t) {
  27928. this.levels = t,
  27929. this.tileSize = e,
  27930. this.root = null,
  27931. this.allNodes = [],
  27932. a(this)
  27933. }
  27934. function r(e, t) {
  27935. this.tree = e,
  27936. this.parent = t,
  27937. this.children = [],
  27938. this.id = ++u
  27939. }
  27940. function o(e, t, i, r, a, s, l, h) {
  27941. if (e) {
  27942. l = l || n.TraversalType.PreOrder;
  27943. var u = r * c + i;
  27944. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  27945. s && s.push(e)),
  27946. e.children && 0 !== e.children.length) {
  27947. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  27948. for (var g = 0; g < c; g++)
  27949. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  27950. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  27951. s && s.push(e))
  27952. }
  27953. }
  27954. }
  27955. function a(e) {
  27956. e.root = s(e, null, 0)
  27957. }
  27958. function s(e, t, i) {
  27959. if (i > e.levels)
  27960. return null;
  27961. var n = new r(e,t);
  27962. e.allNodes.push(n);
  27963. for (var o = 0; o < h; o++)
  27964. n.children[o] = s(e, n, i + 1);
  27965. return n
  27966. }
  27967. function l(e, t, i, n, r) {
  27968. if (!e)
  27969. return null;
  27970. if (0 === i)
  27971. return e;
  27972. if (!e.children || 0 === e.children.length)
  27973. return null;
  27974. var o = Math.pow(c, i)
  27975. , a = o / c
  27976. , s = n % a
  27977. , h = r % a
  27978. , u = Math.floor(r / a)
  27979. , d = Math.floor(n / a)
  27980. , p = u * c + d
  27981. , f = e.children[p];
  27982. return l(f, t + 1, i - 1, s, h)
  27983. }
  27984. var c = (e("three"),
  27985. e("./TileUtils"),
  27986. e("../objects/Panorama"),
  27987. e("../util/panorama"),
  27988. e("events").EventEmitter,
  27989. 2)
  27990. , h = c * c;
  27991. n.TraversalType = Object.freeze({
  27992. PreOrder: 0,
  27993. PostOrder: 1
  27994. });
  27995. var u = 0;
  27996. n.getLevelCountForSize = function(e, t) {
  27997. var i = 0;
  27998. for (t < e && (t = e); ; ) {
  27999. if (t /= c,
  28000. t < e)
  28001. break;
  28002. i++
  28003. }
  28004. return i
  28005. }
  28006. ,
  28007. n.getSizeForLevel = function(e, t) {
  28008. return Math.pow(c, t) * e
  28009. }
  28010. ,
  28011. n.prototype.getSubNode = function(e, t, i) {
  28012. (!t || e < this.tileSize) && (t = 0),
  28013. (!i || e < this.tileSize) && (i = 0),
  28014. e < this.tileSize && (e = this.tileSize);
  28015. var r = n.getLevelCountForSize(this.tileSize, e)
  28016. , o = l(this.root, 0, r, t, i);
  28017. return o
  28018. }
  28019. ,
  28020. n.prototype.breadthFirst = function(e) {
  28021. e = e || {};
  28022. var t = !!e.nullLevelEnd
  28023. , i = e.maxLevel
  28024. , n = e.minLevel
  28025. , r = e.callback
  28026. , o = e.saveVisited
  28027. , a = []
  28028. , s = {}
  28029. , l = 0
  28030. , c = 0;
  28031. for (a.push(this.root),
  28032. a.push(s); a.length > 0 && !(i && l > i); ) {
  28033. var h = a.shift();
  28034. if (h === s)
  28035. (!n || l >= n) && (r && t && r(null),
  28036. o && t && o.push(null)),
  28037. a.length > 0 && a.push(s),
  28038. l++,
  28039. c = 0;
  28040. else {
  28041. if (h.children)
  28042. for (var u = 0; u < h.children.length; u++) {
  28043. var d = h.children[u];
  28044. d && a.push(h.children[u])
  28045. }
  28046. var p = this.getFaceIndexFromNode(h);
  28047. (!n || l >= n) && (r && r(h, l, p),
  28048. o && o.push(h)),
  28049. c++
  28050. }
  28051. }
  28052. }
  28053. ,
  28054. n.prototype.getFaceIndexFromNode = function(e) {
  28055. if (!e)
  28056. return -1;
  28057. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28058. var o = i.parent;
  28059. if (!o)
  28060. break;
  28061. for (var a = -1, s = 0; s < o.children.length; s++)
  28062. o.children[s] === i && (a = s);
  28063. var l = a % c
  28064. , h = Math.floor(a / c);
  28065. n = l * t + n,
  28066. r = h * t + r,
  28067. t *= c,
  28068. i = o
  28069. }
  28070. return r * t + n
  28071. }
  28072. ,
  28073. n.prototype.depthFirst = function(e, t, i) {
  28074. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28075. }
  28076. ,
  28077. t.exports = n
  28078. }
  28079. , {
  28080. "../objects/Panorama": 148,
  28081. "../util/panorama": 191,
  28082. "./TileUtils": 174,
  28083. events: 202,
  28084. three: 217
  28085. }],
  28086. 174: [function(e, t, i) {
  28087. "use strict";
  28088. var n = e("../enum/GLCubeFaces")
  28089. , r = e("../util/MathLight")
  28090. , o = {};
  28091. o.TILE_SIZE = 512,
  28092. o.FACES_PER_PANO = 6,
  28093. o.LocationOnTile = {
  28094. Center: 0,
  28095. UpperLeft: 1,
  28096. UpperRight: 2,
  28097. LowerRight: 3,
  28098. LowerLeft: 4
  28099. },
  28100. o.getTileVector = function() {
  28101. return function(e, t, i, a, s, l, c, h) {
  28102. l = l || o.LocationOnTile.Center;
  28103. var u = e / t
  28104. , d = a / u;
  28105. s = -s + (u - 1);
  28106. var p = s / u
  28107. , f = t / e
  28108. , g = 2 * f
  28109. , m = g / 2
  28110. , v = 2 * d - 1 + m
  28111. , A = 2 * p - 1 + m;
  28112. switch (l) {
  28113. case o.LocationOnTile.UpperLeft:
  28114. v -= m,
  28115. A += m,
  28116. v += c * g;
  28117. break;
  28118. case o.LocationOnTile.UpperRight:
  28119. v += m,
  28120. A += m,
  28121. A -= c * g;
  28122. break;
  28123. case o.LocationOnTile.LowerRight:
  28124. v += m,
  28125. A -= m,
  28126. v -= c * g;
  28127. break;
  28128. case o.LocationOnTile.LowerLeft:
  28129. v -= m,
  28130. A -= m,
  28131. A += c * g;
  28132. break;
  28133. case o.LocationOnTile.Center:
  28134. }
  28135. switch (i) {
  28136. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28137. r.setVector(h, -1, A, -v);
  28138. break;
  28139. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28140. r.setVector(h, 1, A, v);
  28141. break;
  28142. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28143. r.setVector(h, -v, 1, -A);
  28144. break;
  28145. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28146. r.setVector(h, -v, -1, A);
  28147. break;
  28148. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28149. r.setVector(h, -v, A, 1);
  28150. break;
  28151. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28152. r.setVector(h, v, A, -1)
  28153. }
  28154. r.normalize(h)
  28155. }
  28156. }(),
  28157. o.getFaceForTile = function(e, t) {
  28158. var i = o.TILE_SIZE;
  28159. e < o.TILE_SIZE && (i = e);
  28160. var n = Math.floor(e / i)
  28161. , r = n * n;
  28162. return Math.floor(t / r)
  28163. }
  28164. ,
  28165. o.getTileLocation = function(e, t, i) {
  28166. var n = o.TILE_SIZE;
  28167. e < o.TILE_SIZE && (n = e);
  28168. var r = o.getFaceForTile(e, t)
  28169. , a = Math.floor(e / n)
  28170. , s = a * a
  28171. , l = t - r * s;
  28172. i.tileX = l % a,
  28173. i.tileY = Math.floor(l / a),
  28174. i.face = r,
  28175. i.faceTileIndex = l
  28176. }
  28177. ,
  28178. o.getTileCountForSize = function(e) {
  28179. if (e <= o.TILE_SIZE)
  28180. return o.FACES_PER_PANO;
  28181. var t = Math.floor(e / o.TILE_SIZE)
  28182. , i = t * t
  28183. , n = i * o.FACES_PER_PANO;
  28184. return n
  28185. }
  28186. ,
  28187. o.getRelativeDirection = function() {
  28188. var e = new r.Matrix4
  28189. , t = new r.Quaternion;
  28190. return function(i, n) {
  28191. t.copy(i),
  28192. t.inverse(),
  28193. e.makeRotationFromQuaternion(t),
  28194. e.applyToVector3(n),
  28195. r.normalize(n)
  28196. }
  28197. }(),
  28198. o.matchingTilesInDirection = function() {
  28199. var e = new r.Vector3
  28200. , t = new r.Vector3(0,0,-1)
  28201. , i = new r.Quaternion
  28202. , n = function(e, t) {
  28203. e.push({
  28204. face: t.face,
  28205. faceTileIndex: t.faceTileIndex,
  28206. tileX: t.tileX,
  28207. tileY: t.tileY
  28208. })
  28209. }
  28210. , a = function() {
  28211. var e = {
  28212. face: -1,
  28213. faceTileIndex: -1,
  28214. tileX: -1,
  28215. tileY: -1
  28216. };
  28217. return function(t, i, r) {
  28218. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  28219. o.getTileLocation(t, l, e),
  28220. i && !i(e) || (s++,
  28221. r && n(r, e));
  28222. return s
  28223. }
  28224. }();
  28225. return function(n, s, l, c, h, u) {
  28226. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  28227. o.getTileCountForSize(s);
  28228. if (!c && !h)
  28229. return a(s, null, u);
  28230. var p = !!h;
  28231. if (h = h || c,
  28232. h = Math.max(0, Math.min(h, 360)),
  28233. c = Math.max(0, Math.min(c, 360)),
  28234. r.copyVector(l, e),
  28235. o.getRelativeDirection(n.quaternion, e),
  28236. p) {
  28237. i.setFromUnitVectors(e, t);
  28238. var f = function(e) {
  28239. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28240. };
  28241. return a(s, f, u)
  28242. }
  28243. var g = function(t) {
  28244. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28245. };
  28246. return a(s, g, u)
  28247. }
  28248. }(),
  28249. o.isTileWithinFrustum = function() {
  28250. var e = new r.Vector3
  28251. , t = 1e-5;
  28252. return function(i, n, a, s, l, c, h, u) {
  28253. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  28254. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  28255. r.applyQuaternionToVector(c, e),
  28256. e.z >= -t)
  28257. I++;
  28258. else {
  28259. var w = -1 / e.z
  28260. , _ = e.x * w
  28261. , T = e.y * w;
  28262. T > d ? v++ : T < p && A++,
  28263. _ > f ? y++ : _ < g && C++,
  28264. E++
  28265. }
  28266. return A !== E && v !== E && y !== E && C !== E
  28267. }
  28268. }(),
  28269. o.isTileWithinFOV = function() {
  28270. var e = new r.Vector3
  28271. , t = new r.Vector3(0,1,0)
  28272. , i = new r.Vector3(1,0,0);
  28273. return function(n, a, s, l, c, h, u) {
  28274. var d = o.mapFaceToCubemapFace(s);
  28275. if (r.cross(h, t, i),
  28276. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  28277. o.isWithinFOV(e, h, u, null))
  28278. return !0;
  28279. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28280. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  28281. if (o.getTileVector(n, a, d, l, c, v, g, e),
  28282. o.isWithinFOV(e, h, u, null))
  28283. return !0;
  28284. g += p
  28285. }
  28286. return !1
  28287. }
  28288. }(),
  28289. o.isWithinFOV = function() {
  28290. var e = new r.Vector3
  28291. , t = new r.Vector3;
  28292. return function(i, n, o, a) {
  28293. if (r.copyVector(i, t),
  28294. a) {
  28295. r.copyVector(a, e),
  28296. r.normalize(e);
  28297. var s = r.dot(e, i);
  28298. e.x *= s,
  28299. e.y *= s,
  28300. e.z *= s,
  28301. r.subVector(t, e)
  28302. }
  28303. var l = o / 2 * r.RADIANS_PER_DEGREE
  28304. , c = Math.cos(l)
  28305. , h = r.dot(t, n);
  28306. return h >= c
  28307. }
  28308. }(),
  28309. o.mapFaceToCubemapFace = function() {
  28310. var e = {
  28311. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28312. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28313. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28314. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28315. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28316. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28317. };
  28318. return function(t) {
  28319. return e[t]
  28320. }
  28321. }(),
  28322. t.exports = o
  28323. }
  28324. , {
  28325. "../enum/GLCubeFaces": 25,
  28326. "../util/MathLight": 176
  28327. }],
  28328. 175: [function(e, t, i) {
  28329. (function(i) {
  28330. "use strict";
  28331. function n() {
  28332. this.list = [],
  28333. this.index = {},
  28334. Object.defineProperty(this, "length", {
  28335. get: function() {
  28336. return this.list.length
  28337. }
  28338. })
  28339. }
  28340. var r = (e("./common"),
  28341. e("./logger"));
  28342. new r(i);
  28343. n.prototype.forEach = function(e) {
  28344. this.list.forEach(e)
  28345. }
  28346. ,
  28347. n.prototype.add = function(e) {
  28348. this.list.push(e),
  28349. this.index[this.getIndex(e)] = e
  28350. }
  28351. ,
  28352. n.prototype.getIndex = function(e) {
  28353. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  28354. }
  28355. ,
  28356. n.prototype.extend = function(e) {
  28357. for (var t = 0; t < e.length; t++)
  28358. this.add(e[t])
  28359. }
  28360. ,
  28361. n.prototype.get = function(e) {
  28362. return this.index[e]
  28363. }
  28364. ,
  28365. n.prototype.first = function() {
  28366. return this.list[0]
  28367. }
  28368. ,
  28369. n.prototype.last = function() {
  28370. return this.list[this.list.length - 1]
  28371. }
  28372. ,
  28373. n.prototype.reIndex = function() {
  28374. this.index = {};
  28375. var e = this;
  28376. this.forEach(function(t) {
  28377. e.index[e.getIndex(t)] = t
  28378. })
  28379. }
  28380. ,
  28381. n.prototype.filter = function(e) {
  28382. var t = this.list.filter(e);
  28383. return this.reIndex(),
  28384. t
  28385. }
  28386. ,
  28387. n.prototype.reduce = function(e, t) {
  28388. return this.list.reduce(e, t)
  28389. }
  28390. ,
  28391. n.prototype.sort = function(e) {
  28392. return this.list.sort(e)
  28393. }
  28394. ,
  28395. n.prototype.indexOf = function(e) {
  28396. for (var t = 0; t < this.list.length; ++t)
  28397. if (this.list[t] === e)
  28398. return t;
  28399. return -1
  28400. }
  28401. ,
  28402. t.exports = n
  28403. }
  28404. ).call(this, "/js/util/IndexedCollection.js")
  28405. }
  28406. , {
  28407. "./common": 185,
  28408. "./logger": 189
  28409. }],
  28410. 176: [function(e, t, i) {
  28411. "use strict";
  28412. var n = e("../constants")
  28413. , r = {};
  28414. r.RADIANS_PER_DEGREE = Math.PI / 180,
  28415. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  28416. r.Vector3 = function(e, t, i) {
  28417. this.x = e || 0,
  28418. this.y = t || 0,
  28419. this.z = i || 0
  28420. }
  28421. ,
  28422. r.Matrix4 = function() {
  28423. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  28424. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  28425. }
  28426. ,
  28427. r.Matrix4.prototype = {
  28428. identity: function() {
  28429. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  28430. this
  28431. },
  28432. copy: function(e) {
  28433. return this.elements.set(e.elements),
  28434. this
  28435. },
  28436. applyToVector3: function(e) {
  28437. var t = e.x
  28438. , i = e.y
  28439. , n = e.z
  28440. , r = this.elements;
  28441. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  28442. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  28443. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  28444. this
  28445. },
  28446. getInverse: function(e, t) {
  28447. var i = this.elements
  28448. , n = e.elements
  28449. , r = n[0]
  28450. , o = n[1]
  28451. , a = n[2]
  28452. , s = n[3]
  28453. , l = n[4]
  28454. , c = n[5]
  28455. , h = n[6]
  28456. , u = n[7]
  28457. , d = n[8]
  28458. , p = n[9]
  28459. , f = n[10]
  28460. , g = n[11]
  28461. , m = n[12]
  28462. , v = n[13]
  28463. , A = n[14]
  28464. , y = n[15]
  28465. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  28466. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  28467. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  28468. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  28469. , w = r * C + o * I + a * E + s * b;
  28470. if (0 === w) {
  28471. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  28472. if (t)
  28473. throw new Error(_);
  28474. return console.warn(_),
  28475. this.identity()
  28476. }
  28477. var T = 1 / w;
  28478. return i[0] = C * T,
  28479. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  28480. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  28481. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  28482. i[4] = I * T,
  28483. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  28484. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  28485. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  28486. i[8] = E * T,
  28487. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  28488. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  28489. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  28490. i[12] = b * T,
  28491. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  28492. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  28493. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  28494. this
  28495. },
  28496. makeRotationFromQuaternion: function(e) {
  28497. var t = this.elements
  28498. , i = e.x
  28499. , n = e.y
  28500. , r = e.z
  28501. , o = e.w
  28502. , a = i + i
  28503. , s = n + n
  28504. , l = r + r
  28505. , c = i * a
  28506. , h = i * s
  28507. , u = i * l
  28508. , d = n * s
  28509. , p = n * l
  28510. , f = r * l
  28511. , g = o * a
  28512. , m = o * s
  28513. , v = o * l;
  28514. return t[0] = 1 - (d + f),
  28515. t[4] = h - v,
  28516. t[8] = u + m,
  28517. t[1] = h + v,
  28518. t[5] = 1 - (c + f),
  28519. t[9] = p - g,
  28520. t[2] = u - m,
  28521. t[6] = p + g,
  28522. t[10] = 1 - (c + d),
  28523. t[3] = 0,
  28524. t[7] = 0,
  28525. t[11] = 0,
  28526. t[12] = 0,
  28527. t[13] = 0,
  28528. t[14] = 0,
  28529. t[15] = 1,
  28530. this
  28531. }
  28532. },
  28533. r.Quaternion = function(e, t, i, n) {
  28534. this._x = e || 0,
  28535. this._y = t || 0,
  28536. this._z = i || 0,
  28537. this._w = void 0 !== n ? n : 1
  28538. }
  28539. ,
  28540. r.Quaternion.prototype = {
  28541. get x() {
  28542. return this._x
  28543. },
  28544. set x(e) {
  28545. this._x = e
  28546. },
  28547. get y() {
  28548. return this._y
  28549. },
  28550. set y(e) {
  28551. this._y = e
  28552. },
  28553. get z() {
  28554. return this._z
  28555. },
  28556. set z(e) {
  28557. this._z = e
  28558. },
  28559. get w() {
  28560. return this._w
  28561. },
  28562. set w(e) {
  28563. this._w = e
  28564. },
  28565. copy: function(e) {
  28566. this._x = e.x,
  28567. this._y = e.y,
  28568. this._z = e.z,
  28569. this._w = e.w
  28570. },
  28571. inverse: function() {
  28572. return this.conjugate().normalize()
  28573. },
  28574. conjugate: function() {
  28575. return this._x *= -1,
  28576. this._y *= -1,
  28577. this._z *= -1,
  28578. this
  28579. },
  28580. length: function() {
  28581. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  28582. },
  28583. normalize: function() {
  28584. var e = this.length();
  28585. return 0 === e ? (this._x = 0,
  28586. this._y = 0,
  28587. this._z = 0,
  28588. this._w = 1) : (e = 1 / e,
  28589. this._x = this._x * e,
  28590. this._y = this._y * e,
  28591. this._z = this._z * e,
  28592. this._w = this._w * e),
  28593. this
  28594. },
  28595. setFromAxisAngle: function(e, t) {
  28596. var i = t / 2
  28597. , n = Math.sin(i);
  28598. return this._x = e.x * n,
  28599. this._y = e.y * n,
  28600. this._z = e.z * n,
  28601. this._w = Math.cos(i),
  28602. this
  28603. },
  28604. setFromUnitVectors: function() {
  28605. var e, t, i = 1e-6;
  28606. return function(n, o) {
  28607. return void 0 === e && (e = new r.Vector3),
  28608. t = r.dot(n, o) + 1,
  28609. t < i ? (t = 0,
  28610. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  28611. this._x = e.x,
  28612. this._y = e.y,
  28613. this._z = e.z,
  28614. this._w = t,
  28615. this.normalize()
  28616. }
  28617. }(),
  28618. multiply: function(e) {
  28619. return this.multiplyQuaternions(this, e)
  28620. },
  28621. premultiply: function(e) {
  28622. return this.multiplyQuaternions(e, this)
  28623. },
  28624. multiplyQuaternions: function(e, t) {
  28625. var i = e._x
  28626. , n = e._y
  28627. , r = e._z
  28628. , o = e._w
  28629. , a = t._x
  28630. , s = t._y
  28631. , l = t._z
  28632. , c = t._w;
  28633. return this._x = i * c + o * a + n * l - r * s,
  28634. this._y = n * c + o * s + r * a - i * l,
  28635. this._z = r * c + o * l + i * s - n * a,
  28636. this._w = o * c - i * a - n * s - r * l,
  28637. this
  28638. }
  28639. },
  28640. r.convertWorkshopVector = function(e) {
  28641. return new r.Vector3(-e.x,e.y,e.z)
  28642. }
  28643. ,
  28644. r.convertWorkshopQuaternion = function(e) {
  28645. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28646. }
  28647. ;
  28648. r.convertWorkshopOrthoZoom = function(e) {//xzw
  28649. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  28650. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28651. }
  28652. ,
  28653. r.convertWorkshopPanoramaQuaternion = function(e) {
  28654. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  28655. }
  28656. ,
  28657. r.normalize = function(e) {
  28658. var t = e.x * e.x + e.y * e.y + e.z * e.z
  28659. , i = Math.sqrt(t);
  28660. e.x /= i,
  28661. e.y /= i,
  28662. e.z /= i
  28663. }
  28664. ,
  28665. r.dot = function(e, t) {
  28666. return e.x * t.x + e.y * t.y + e.z * t.z
  28667. }
  28668. ,
  28669. r.cross = function(e, t, i) {
  28670. var n = e.x
  28671. , r = e.y
  28672. , o = e.z;
  28673. i.x = r * t.z - o * t.y,
  28674. i.y = o * t.x - n * t.z,
  28675. i.z = n * t.y - r * t.x
  28676. }
  28677. ,
  28678. r.setVector = function(e, t, i, n) {
  28679. e.x = t,
  28680. e.y = i,
  28681. e.z = n
  28682. }
  28683. ,
  28684. r.copyVector = function(e, t) {
  28685. t.x = e.x,
  28686. t.y = e.y,
  28687. t.z = e.z
  28688. }
  28689. ,
  28690. r.addVector = function(e, t) {
  28691. e.x += t.x,
  28692. e.y += t.y,
  28693. e.z += t.z
  28694. }
  28695. ,
  28696. r.subVector = function(e, t) {
  28697. e.x -= t.x,
  28698. e.y -= t.y,
  28699. e.z -= t.z
  28700. }
  28701. ,
  28702. r.applyQuaternionToVector = function(e, t) {
  28703. var i = t.x
  28704. , n = t.y
  28705. , r = t.z
  28706. , o = e.x
  28707. , a = e.y
  28708. , s = e.z
  28709. , l = e.w
  28710. , c = l * i + a * r - s * n
  28711. , h = l * n + s * i - o * r
  28712. , u = l * r + o * n - a * i
  28713. , d = -o * i - a * n - s * r;
  28714. t.x = c * l + d * -o + h * -s - u * -a,
  28715. t.y = h * l + d * -a + u * -o - c * -s,
  28716. t.z = u * l + d * -s + c * -a - h * -o
  28717. }
  28718. ,
  28719. r.angleBetweenVectors = function(e, t) {
  28720. return Math.acos(r.dot(e, t))
  28721. }
  28722. ,
  28723. t.exports = r
  28724. }
  28725. , {
  28726. "../constants": 8
  28727. }],
  28728. 177: [function(e, t, i) {
  28729. (function(i) {
  28730. "use strict";
  28731. function n(e) {
  28732. this.cache = null,
  28733. this.expires = 0
  28734. }
  28735. function r() {
  28736. this.baseUrl = null,
  28737. this.cache = null,
  28738. this.expires = 0
  28739. }
  28740. function o() {
  28741. this.baseUrl = null,
  28742. this.expires = 0
  28743. }
  28744. function a(e) {
  28745. this.initialLoadingPromise = null,
  28746. this.endpoint = e + "?type=3",
  28747. this.urlContainer = null,
  28748. this.authorizationHeader = h.getAuthorizationHeader(),
  28749. this.containerClasses = [o, r, n]
  28750. }
  28751. var s = e("./ajax")
  28752. , l = e("./logger")
  28753. , c = e("../constants")
  28754. , h = e("./showcase")
  28755. , u = (e("../ab"),
  28756. new l(i));
  28757. n.prototype = {
  28758. version: 1,
  28759. validate: function(e) {
  28760. return "catalog.json"in e && Object.keys(e).length > 0
  28761. },
  28762. update: function(e) {
  28763. return this.cache = e,
  28764. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28765. $.when()
  28766. },
  28767. get: function(e) {
  28768. return this.cache[e]
  28769. }
  28770. },
  28771. r.prototype = {
  28772. version: 2,
  28773. validate: function(e) {
  28774. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  28775. },
  28776. update: function(e) {
  28777. return this.baseUrl = e["base.url"],
  28778. this.cache = e,
  28779. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28780. $.when()
  28781. },
  28782. get: function(e) {
  28783. var t = this.cache[e];
  28784. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  28785. }
  28786. },
  28787. o.prototype = {
  28788. version: 3,
  28789. validate: function(e) {
  28790. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  28791. },
  28792. update: function(e) {
  28793. return this.baseUrl = e.templates[0],
  28794. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  28795. $.when()
  28796. },
  28797. get: function(e) {
  28798. return this.baseUrl.replace("{{filename}}", e)
  28799. }
  28800. },
  28801. a.prototype = {
  28802. init: function() {
  28803. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  28804. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  28805. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  28806. this.refresh().done(function() {
  28807. u.debug("Refreshed")
  28808. }).fail(function() {
  28809. u.error("Failed url refresh, urls might go stale soon")
  28810. }))
  28811. }
  28812. .bind(this), c.signedUrlCheckInterval),
  28813. this.initialLoadingPromise = this.refresh(),
  28814. this.initialLoadingPromise)
  28815. },
  28816. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  28817. e = e || {};
  28818. /*var t = void 0 === e.cache || e.cache;
  28819. return s.get( this.endpoint , { //file
  28820. responseType: "json",
  28821. prefetchFrom: t ? "files" : null,
  28822. cache: t,
  28823. auth: this.authorizationHeader
  28824. }).then(function(e) {
  28825. if (this.urlContainer && this.urlContainer.validate(e))
  28826. return this.urlContainer.update(e);
  28827. for (var i = 0; i < this.containerClasses.length; i++) {
  28828. var n = this.containerClasses[i]
  28829. , r = new n;
  28830. if (r.validate(e))
  28831. return u.info("Using urls version " + r.version),
  28832. this.urlContainer = r,
  28833. this.urlContainer.update(e)
  28834. }
  28835. return t ? this.refresh({
  28836. cache: !1
  28837. }) : $.Deferred().reject("missing-urls")
  28838. }
  28839. .bind(this), function(e) {
  28840. return "loading-failed"
  28841. }) */
  28842. return $.Deferred().resolve();
  28843. },
  28844. get: function(e) {
  28845. //return this.urlContainer.get(e)
  28846. return window.DATA.files.templates[0].replace("{{filename}}", e)
  28847. }
  28848. },
  28849. t.exports = a
  28850. }
  28851. ).call(this, "/js/util/ModelUrls.js")
  28852. }
  28853. , {
  28854. "../ab": 3,
  28855. "../constants": 8,
  28856. "./ajax": 181,
  28857. "./logger": 189,
  28858. "./showcase": 193
  28859. }],
  28860. 178: [function(e, t, i) {
  28861. (function(i) {
  28862. "use strict";
  28863. function n() {
  28864. u.call(this),
  28865. this.neighbourMap = {},
  28866. this.map = null
  28867. }
  28868. var r = e("three")
  28869. , o = e("./common")
  28870. , a = e("../settings")
  28871. , s = e("../objects/Panorama")
  28872. , a = e("../settings")
  28873. , l = e("./aStar")
  28874. , c = e("./logger")
  28875. , h = new c(i)
  28876. , u = e("./IndexedCollection")
  28877. , d = e("./transitions");
  28878. o.inherit(n, u),
  28879. n.prototype.getIndex = function(e) {
  28880. return e.id
  28881. }
  28882. ,
  28883. n.prototype.find = function(e, t) {
  28884. var i = o.filterAll(this.list, e);
  28885. return 0 === i.length ? null : (t && t.forEach(function(e) {
  28886. i = o.stableSort(i, e)
  28887. }),
  28888. i[0])
  28889. }
  28890. ,
  28891. n.prototype.sortByScore = function(e, t) {
  28892. var i = o.filterAll(this.list, e);
  28893. return 0 === i.length ? null : i = i.map(function(e) {
  28894. return {
  28895. pano: e,
  28896. score: t.reduce(function(t, i) {
  28897. return t + i(e)
  28898. }, 0)
  28899. }
  28900. }).sort(function(e, t) {
  28901. return t.score - e.score;
  28902. })
  28903. }
  28904. ,
  28905. n.prototype.lowestByScore = function(e, t, i) {
  28906. return this.findRankedByScore(0, e, t, i)
  28907. }
  28908. ,
  28909. n.prototype.findRankedByScore = function(e, t, i, n) {
  28910. n && (n.candidates = null,
  28911. n.pano = null),
  28912. e || (e = 0);
  28913. var r = this.sortByScore(t, i);
  28914. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  28915. n.pano = r[e].pano),
  28916. r[e].pano)
  28917. }
  28918. ,
  28919. n.prototype.showPanoScores = function(e) {
  28920. this.list.forEach(function(e) {
  28921. e.removeTextSprite()
  28922. });
  28923. var t = 6344768;
  28924. e.forEach(function(e) {
  28925. e.pano.addTextSprite(e.score.toFixed(2), t),
  28926. t = 16428055
  28927. })
  28928. }
  28929. ,
  28930. n.prototype.isNeighbour = function(e, t) {
  28931. return this.neighbourMap[e.id][t.id]
  28932. }
  28933. ,
  28934. n.prototype.getNeighbours = function(e) {
  28935. return this.neighbourMap[e.id]
  28936. }
  28937. ,
  28938. n.prototype.setNeighbour = function(e, t, i) {
  28939. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  28940. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  28941. this.neighbourMap[e.id][e.id] = !0,
  28942. this.neighbourMap[t.id][t.id] = !0,
  28943. this.neighbourMap[e.id][t.id] = i,
  28944. this.neighbourMap[t.id][e.id] = i,
  28945. this.neighbourMap[e.id]
  28946. }
  28947. ,
  28948. n.prototype.findClosest = function(e, t) {
  28949. var i = [s.filters.isPanoAligned()];
  28950. return t && i.push(s.filters.inDirection(e, t, .75)),
  28951. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  28952. }
  28953. ,
  28954. n.prototype.dualNeighbors = function(e, t) {
  28955. var i, n = [];
  28956. for (i in this.neighbourMap[e.id])
  28957. this.neighbourMap[t.id][i] && n.push(i);
  28958. return n
  28959. }
  28960. ,
  28961. n.prototype.populate_path_graph = function() {
  28962. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  28963. for (e = 0; e < this.list.length; e += 1) {
  28964. o = this.list[e],
  28965. s = {},
  28966. l = !1,
  28967. i = o.neighbourPanos || o.findNeighourPanos();
  28968. for (t in i)
  28969. if (i[t]) {
  28970. a = this.index[t],
  28971. p.copy(o.floorPosition),
  28972. p.sub(a.floorPosition);
  28973. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  28974. , v = (Math.abs(p.y) / Math.max(m, .01),
  28975. Math.max(0, Math.abs(p.y) - .2));
  28976. v > 0 ? (f += 1,
  28977. v = Math.pow(4 * v, 2),
  28978. m = Math.pow(m, 2),
  28979. n = Math.sqrt(v * v + m * m)) : (g += 1,
  28980. n = p.length()),
  28981. s[a.id] = n,
  28982. l = !0
  28983. }
  28984. l ? u[o.id] = s : d += 1
  28985. }
  28986. this.map = u,
  28987. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  28988. }
  28989. ,
  28990. n.prototype.aStarSearch = function(e, t) {
  28991. var i = Date.now()
  28992. , n = new l({
  28993. start: e,
  28994. isEnd: function(e) {
  28995. return e === t
  28996. },
  28997. neighbor: function(e) {
  28998. var t = e.neighbourPanos || e.findNeighourPanos()
  28999. , i = [];
  29000. for (var n in t)
  29001. t[n] && i.push(this.index[n]); //add: t[n] &&
  29002. return i
  29003. }
  29004. .bind(this),
  29005. distance: function(e, t) {
  29006. var i = this.map[e.id]
  29007. , n = i[t.id];
  29008. return n
  29009. }
  29010. .bind(this),
  29011. heuristic: function(e, t) {
  29012. return 1
  29013. }
  29014. .bind(this),
  29015. hash: function(e) {
  29016. return e.id
  29017. },
  29018. timeout: 5e3
  29019. });
  29020. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29021. "success" !== n.status)
  29022. return h.debug("Did not find A* path from " + e + " to " + t),
  29023. null;
  29024. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29025. var r = [];
  29026. return n.path.forEach(function(e) {
  29027. r.push(e.id)
  29028. }),
  29029. r
  29030. }
  29031. ,
  29032. n.prototype.includeNodesNearPath = function() {
  29033. var e = new r.Vector3
  29034. , t = new r.Vector3
  29035. , i = new r.Vector3
  29036. , n = new r.Vector3
  29037. , o = new r.Vector3
  29038. , a = new r.Vector3
  29039. , s = new r.Vector3
  29040. , l = new r.Vector3
  29041. , c = []
  29042. , h = new r.Vector3
  29043. , u = new r.Vector3;
  29044. return function(r, d) {
  29045. if (r)
  29046. for (var p = function(e, t, i) {
  29047. return o.copy(t).sub(e),
  29048. o.dot(i)
  29049. }, f = function(e, t) {
  29050. return p(h, e.position, i) - p(h, t.position, i)
  29051. }, g = 0; g < r.length - 1; ) {
  29052. var m = r[g]
  29053. , v = r[g + 1]
  29054. , A = this.index[m]
  29055. , y = this.index[v];
  29056. h.copy(A.position),
  29057. u.copy(y.position),
  29058. c.length = 0,
  29059. e.copy(u).sub(h),
  29060. i.copy(e).normalize();
  29061. for (var C = 0; C < this.list.length; C++) {
  29062. var I = this.list[C];
  29063. o.copy(I.position).sub(h);
  29064. var E = o.dot(i);
  29065. if (E > 0) {
  29066. s.copy(i),
  29067. s.multiplyScalar(E),
  29068. a.copy(o),
  29069. a.sub(s);
  29070. var b = a.length();
  29071. if (b < d) {
  29072. t.copy(e).negate(),
  29073. n.copy(t).normalize(),
  29074. l.copy(I.position).sub(u);
  29075. var w = l.dot(n);
  29076. w > 0 && c.push(I)
  29077. }
  29078. }
  29079. }
  29080. if (c.length > 0) {
  29081. c.sort(f);
  29082. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29083. r[_] = r[_ - c.length];
  29084. for (var T = 0; T < c.length; T++)
  29085. r[T + g + 1] = c[T].id
  29086. }
  29087. g += c.length + 1
  29088. }
  29089. }
  29090. }(),
  29091. n.prototype.fadeMarkerOpacity = function(e, t) {
  29092. var i = void 0 === e ? a.panorama.markerOpacity : e
  29093. , n = this.list.findIndex(function(e) {
  29094. return e.marker
  29095. });
  29096. if (!(n < 0)) {
  29097. var r = this.list[n].marker.material.opacity;
  29098. if (r !== e) {
  29099. var o = i - r;
  29100. d.trigger({
  29101. func: function(e, t) {
  29102. var i = r + e * o;
  29103. this.forEach(function(e) {
  29104. e.marker && (e.marker.material.opacity = i)
  29105. })
  29106. }
  29107. .bind(this),
  29108. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29109. name: "_fpm"
  29110. })
  29111. }
  29112. }
  29113. }
  29114. ,
  29115. t.exports = n
  29116. }
  29117. ).call(this, "/js/util/PanoramaCollection.js")
  29118. }
  29119. , {
  29120. "../objects/Panorama": 148,
  29121. "../settings": 166,
  29122. "./IndexedCollection": 175,
  29123. "./aStar": 180,
  29124. "./common": 185,
  29125. "./logger": 189,
  29126. "./transitions": 195,
  29127. three: 217
  29128. }],
  29129. 179: [function(e, t, i) {
  29130. "use strict";
  29131. function n() {
  29132. this.actionSequence = [],
  29133. this.actionSequenceInProgress = !1
  29134. }
  29135. function r(e, t, i, n) {
  29136. s.trackAlways("zoom_" + e, {
  29137. from: t,
  29138. to: i,
  29139. pano: n
  29140. })
  29141. }
  29142. function o(e, t) {
  29143. r("initial", 1, e, t)
  29144. }
  29145. function a(e, t, i) {
  29146. r("followup", e, t, i)
  29147. }
  29148. var s = e("../analytics");
  29149. n.prototype.reset = function(e) {
  29150. this.actionSequenceInProgress = !1,
  29151. this.actionSequence.length = 0
  29152. }
  29153. ,
  29154. n.prototype.addZoomAction = function() {
  29155. var e = null
  29156. , t = null
  29157. , i = !1
  29158. , n = function() {
  29159. if (e = null,
  29160. this.actionSequence.length > 0) {
  29161. var i = this.actionSequence[0].start
  29162. , n = this.actionSequence[this.actionSequence.length - 1].end;
  29163. 1 === i ? o(n, t) : a(i, n, t)
  29164. }
  29165. this.reset()
  29166. };
  29167. return function(r, o, a) {
  29168. if (r !== o) {
  29169. i || (n = n.bind(this),
  29170. i = !0),
  29171. e && (window.clearTimeout(e),
  29172. e = null),
  29173. a === t && this.actionSequenceInProgress || (this.reset(),
  29174. t = a),
  29175. this.actionSequenceInProgress = !0;
  29176. var s = {
  29177. start: r,
  29178. end: o
  29179. };
  29180. this.actionSequence.push(s),
  29181. e = window.setTimeout(n, 150)
  29182. }
  29183. }
  29184. }(),
  29185. t.exports = n
  29186. }
  29187. , {
  29188. "../analytics": 4
  29189. }],
  29190. 180: [function(e, t, i) {
  29191. "use strict";
  29192. function n(e) {
  29193. void 0 === e.timeout && (e.timeout = 1 / 0);
  29194. var t = e.hash || o
  29195. , i = {
  29196. data: e.start,
  29197. g: 0,
  29198. h: e.heuristic(e.start)
  29199. }
  29200. , n = i;
  29201. i.f = i.h;
  29202. var h = new s
  29203. , u = new l(a)
  29204. , d = c();
  29205. u.push(i),
  29206. d.set(t(i.data), i);
  29207. for (var p = new Date; u.size(); ) {
  29208. if (new Date - p > e.timeout)
  29209. return {
  29210. status: "timeout",
  29211. cost: n.g,
  29212. path: r(n)
  29213. };
  29214. var f = u.pop();
  29215. if (d.delete(t(f.data)),
  29216. e.isEnd(f.data))
  29217. return {
  29218. status: "success",
  29219. cost: f.g,
  29220. path: r(f)
  29221. };
  29222. h.add(t(f.data));
  29223. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29224. var v = g[m];
  29225. if (!h.contains(t(v))) {
  29226. var A = f.g + e.distance(f.data, v)
  29227. , y = d.get(t(v))
  29228. , C = !1;
  29229. if (void 0 === y)
  29230. y = {
  29231. data: v
  29232. },
  29233. d.set(t(v), y);
  29234. else {
  29235. if (y.g < A)
  29236. continue;
  29237. C = !0
  29238. }
  29239. y.parent = f,
  29240. y.g = A,
  29241. y.h = e.heuristic(v),
  29242. y.f = A + y.h,
  29243. y.h < n.h && (n = y),
  29244. C ? u.heapify() : u.push(y)
  29245. }
  29246. }
  29247. }
  29248. return {
  29249. status: "noPath",
  29250. cost: n.g,
  29251. path: r(n)
  29252. }
  29253. }
  29254. function r(e) {
  29255. if (void 0 !== e.parent) {
  29256. var t = r(e.parent);
  29257. return t.push(e.data),
  29258. t
  29259. }
  29260. return [e.data]
  29261. }
  29262. function o(e) {
  29263. return e.toString()
  29264. }
  29265. function a(e, t) {
  29266. return e.f - t.f
  29267. }
  29268. var s = e("Set")
  29269. , l = e("heap")
  29270. , c = e("dict");
  29271. t.exports = n
  29272. }
  29273. , {
  29274. Set: 196,
  29275. dict: 210,
  29276. heap: 211
  29277. }],
  29278. 181: [function(e, t, i) {
  29279. (function(i) {
  29280. "use strict";
  29281. function n(e, t, i) {
  29282. var n = new XMLHttpRequest;
  29283. if (i && "withCredentials"in n)
  29284. n.open(e, t, i);
  29285. else if ("undefined" != typeof XDomainRequest)
  29286. n = new XDomainRequest,
  29287. n.open(e, t);
  29288. else {
  29289. if (i)
  29290. throw "Browser does not support CORS!";
  29291. n.open(e, t)
  29292. }
  29293. return n
  29294. }
  29295. function r(e, t, i) {
  29296. function o() {
  29297. u.warn("Retrying ", t),
  29298. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29299. }
  29300. function a(e, t) {
  29301. var i = e.response;
  29302. if ("json" === t && "object" != typeof i)
  29303. try {
  29304. i = JSON.parse(e.responseText)
  29305. } catch (e) {
  29306. return void c.reject({
  29307. error: "Failed parsing JSON"
  29308. })
  29309. }
  29310. else if ("image/jpeg" === t) {
  29311. var n = new Uint8Array(e.response)
  29312. , r = new Blob([n],{
  29313. type: "image/jpeg"
  29314. })
  29315. , o = URL.createObjectURL(r);
  29316. i = new Image,
  29317. i.src = o,
  29318. i.crossOrigin = "Anonymous",
  29319. i.onload = function() {
  29320. URL.revokeObjectURL(o)
  29321. }
  29322. }
  29323. return i
  29324. }
  29325. var s = n(e, t, !1);
  29326. if (i = i || {},
  29327. i.retries = void 0 !== i.retries ? i.retries : 0,
  29328. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  29329. i.responseType)
  29330. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  29331. s.responseType = i.responseType;
  29332. else {
  29333. if ("image/jpeg" !== i.responseType)
  29334. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  29335. s.responseType = "arraybuffer"
  29336. }
  29337. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  29338. i.auth && s.setRequestHeader("Authorization", i.auth),
  29339. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  29340. s.setRequestHeader("Content-Type", "application/json")),
  29341. "object" == typeof i.headers)
  29342. for (var l in i.headers)
  29343. s.setRequestHeader(l, i.headers[l]);
  29344. var c = $.Deferred();
  29345. return s.onreadystatechange = function(e) {
  29346. if (4 === this.readyState)
  29347. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  29348. i.retries++,
  29349. setTimeout(o, 1e3);
  29350. else if (200 === this.status) {
  29351. var t = a(this, i.responseType);
  29352. c.resolve(t)
  29353. } else
  29354. c.reject(this)
  29355. }
  29356. ,
  29357. s.onprogress = function(e) {
  29358. c.notify(e)
  29359. }
  29360. ,
  29361. s.send(i.data),
  29362. c.promise()
  29363. }
  29364. function o(e) {
  29365. return Object.keys(e).sort().map(function(t) {
  29366. return {
  29367. key: t,
  29368. value: e[t]
  29369. }
  29370. })
  29371. }
  29372. function a(e, t) {
  29373. var i = t.responseType || null
  29374. , n = t.auth || null
  29375. , r = t.prefetchFrom || null
  29376. , a = e + "__" + i + "__" + n + "__" + r;
  29377. return t.headers && o(t.headers).forEach(function(e) {
  29378. a += "__" + e.key + ":" + e.value
  29379. }),
  29380. a
  29381. }
  29382. function s(e, t) {
  29383. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29384. }
  29385. function l(e, t, i) {
  29386. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29387. }
  29388. var c = e("./logger")
  29389. , h = e("../ab")
  29390. , u = new c(i);
  29391. window.URL = window.URL || window.webkitURL,
  29392. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  29393. window.DATA = window.DATA || {}
  29394. /* setTimeout(function() {//MP-- xzw delete
  29395. window.MP_REQUEST_CACHE = null,
  29396. window.DATA = {}
  29397. }, 6e4),
  29398. window.onpageshow = function(e) {
  29399. e.persisted && (window.MP_REQUEST_CACHE = null,
  29400. window.DATA = {})
  29401. } */
  29402. ,
  29403. t.exports = {
  29404. get: function(e, t) {
  29405. t = t || {};
  29406. var i = void 0 === t.cache || t.cache;
  29407. if (i) {
  29408. var n = s(e, t);
  29409. if (n)
  29410. return n
  29411. }
  29412. var o;
  29413. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  29414. i && l(e, t, o),
  29415. o
  29416. },
  29417. post: function(e, t) {
  29418. return r("POST", e, t)
  29419. },
  29420. patch: function(e, t) {
  29421. return r("PATCH", e, t)
  29422. },
  29423. getImage: function(e, t) {
  29424. function i() {
  29425. u.warn("Retrying ", e),
  29426. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  29427. }
  29428. var n = $.Deferred()
  29429. , r = new Image
  29430. , o = this;
  29431. return e = h.changeIfImageOptimzing(e),
  29432. null !== t && void 0 !== t || (t = 3),
  29433. r.onerror = function() {
  29434. t > 0 ? setTimeout(i, 1e3) : n.reject()
  29435. }
  29436. ,
  29437. r.onload = function() {
  29438. n.resolve(r)
  29439. }
  29440. ,
  29441. r.crossOrigin = "anonymous",
  29442. r.src = e,
  29443. n
  29444. }
  29445. }
  29446. }
  29447. ).call(this, "/js/util/ajax.js")
  29448. }
  29449. , {
  29450. "../ab": 3,
  29451. "./logger": 189
  29452. }],
  29453. 182: [function(e, t, i) {
  29454. "use strict";
  29455. function n(e, t) {
  29456. var i = window.navigator.userAgent
  29457. , n = i.match(e);
  29458. return n = n ? n[1].split(t) : [],
  29459. {
  29460. major: parseInt(n[0]) || 0,
  29461. minor: parseInt(n[1]) || 0,
  29462. patch: parseInt(n[2]) || 0
  29463. }
  29464. }
  29465. var r = e("../exception/DeviceMismatchException");
  29466. window.browser = t.exports = {
  29467. isFullscreen: function() {
  29468. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  29469. },
  29470. supportsFullscreen: function() {
  29471. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  29472. },
  29473. isPointerLocked: function() {
  29474. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  29475. },
  29476. requestFullscreen: function(e, t) {
  29477. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  29478. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  29479. },
  29480. requestPointerLock: function() {
  29481. var e;
  29482. if (document.fullscreenElement)
  29483. e = document.fullscreenElement();
  29484. else if (document.mozFullscreenElement)
  29485. e = document.mozFullscreenElement();
  29486. else if (document.mozFullScreenElement)
  29487. e = document.mozFullScreenElement();
  29488. else {
  29489. if (!document.webkitFullscreenElement)
  29490. return;
  29491. e = document.webkitFullscreenElement()
  29492. }
  29493. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  29494. e.requestPointerLock(),
  29495. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  29496. },
  29497. exitPointerLock: function() {
  29498. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  29499. document.exitPointerLock()
  29500. },
  29501. exitFullscreen: function() {
  29502. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  29503. },
  29504. details: function() {
  29505. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  29506. return e ? {
  29507. name: e[1],
  29508. version: parseInt(e[2]),
  29509. platform: navigator.platform
  29510. } : {}
  29511. },
  29512. is: function(e) {
  29513. return this.details() && this.details().name === e
  29514. },
  29515. inIframe: function() {
  29516. return window.parent !== window
  29517. },
  29518. aspectRatio: function() {
  29519. var e = $("#player").width() / $("#player").height();
  29520. return isFinite(e) ? e : 0
  29521. },
  29522. userAgent: function() {
  29523. return window.navigator.userAgent
  29524. },
  29525. isMobile: function() {
  29526. var e = navigator.userAgent || navigator.vendor || window.opera;
  29527. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  29528. },
  29529. isLandscape: function() {
  29530. return this.isMobile && this.aspectRatio() > 1
  29531. },
  29532. isSmallScreen: function() {
  29533. var e = screen.width / window.devicePixelRatio;
  29534. return e < 240
  29535. },
  29536. detectIE: function() {
  29537. var e = window.navigator.userAgent
  29538. , t = e.indexOf("MSIE ");
  29539. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  29540. },
  29541. detectSafari: function() {
  29542. var e = window.navigator.userAgent
  29543. , t = e.indexOf("Safari");
  29544. return t !== -1 && !this.detectChrome()
  29545. },
  29546. detectFirefox: function() {
  29547. var e = window.navigator.userAgent;
  29548. return e.indexOf("Firefox") !== -1
  29549. },
  29550. detectChrome: function() {
  29551. var e = window.navigator.userAgent;
  29552. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  29553. },
  29554. detectOpera: function() {
  29555. var e = window.navigator.userAgent;
  29556. return e.indexOf("OPR") !== -1
  29557. },
  29558. detectIOS: function() {
  29559. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  29560. },
  29561. detectIPad: function() {
  29562. var e = window.navigator.userAgent
  29563. , t = /iPad/;
  29564. return t.test(e)
  29565. },
  29566. detectIPod: function() {
  29567. var e = window.navigator.userAgent
  29568. , t = /iPod/;
  29569. return t.test(e)
  29570. },
  29571. detectIPhone: function() {
  29572. var e = window.navigator.userAgent
  29573. , t = /iPhone/;
  29574. return t.test(e)
  29575. },
  29576. detectAndroid: function() {
  29577. var e = window.navigator.userAgent;
  29578. return e.indexOf("Android") !== -1
  29579. },
  29580. detectAndroidMobile: function() {
  29581. var e = window.navigator.userAgent;
  29582. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  29583. },
  29584. detectSamsungNative: function() {
  29585. var e = window.navigator.userAgent;
  29586. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  29587. },
  29588. detectSamsungS6: function() {
  29589. var e = window.navigator.userAgent;
  29590. return e.indexOf("SM-G92") !== -1
  29591. },
  29592. /************************************************************fyz改from徐世廷*************************************************************/
  29593. detectHUAWEI5X: function() {
  29594. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  29595. },
  29596. /*******************************************************************************************************************************/
  29597. detectWebVR: function() {
  29598. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  29599. },
  29600. getVRDisplay: function() {
  29601. var e = $.Deferred();
  29602. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  29603. t.length >= 1 && e.resolve(t[0]),
  29604. e.reject(null)
  29605. }),
  29606. e) : e.reject(null)
  29607. },
  29608. iosVersion: function() {
  29609. if (!this.detectIOS())
  29610. throw new r("Did not detect an iDevice");
  29611. var e = /((?:\d+\_?){1,3}) like Mac OS/
  29612. , t = "_";
  29613. return n(e, t)
  29614. },
  29615. androidVersion: function() {
  29616. if (!this.detectAndroid())
  29617. throw new r("Did not detect an Android based device");
  29618. var e = /Android ((?:\d+\.?){1,3})/
  29619. , t = ".";
  29620. return n(e, t)
  29621. },
  29622. valueFromCookie: function(e, t) {
  29623. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  29624. if (!i)
  29625. return t;
  29626. var n = i[1];
  29627. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  29628. },
  29629. valueFromHash: function(e, t) {
  29630. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  29631. , n = i.exec(window.location.href);
  29632. if (!n)
  29633. return t;
  29634. var r = n[1];
  29635. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  29636. }
  29637. }
  29638. // changeLog()
  29639. }
  29640. , {
  29641. "../exception/DeviceMismatchException": 56
  29642. }],
  29643. 183: [function(e, t, i) {
  29644. (function(i) {
  29645. "use strict";
  29646. function n(e, t) {
  29647. var i = r(t);
  29648. var replaceAll = function (str, f, e) {
  29649. //f全部替换成e
  29650. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  29651. return str.replace(reg, e);
  29652. };
  29653. var urlFirstView = c.valueFromHash('firstView');
  29654. if(urlFirstView){
  29655. try{
  29656. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  29657. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  29658. urlFirstView = "{"+urlFirstView+"]}"
  29659. let info = JSON.parse(urlFirstView);
  29660. i.pano = t.index[info.pano] //panos.get(info.pano)
  29661. if(!i.pano){
  29662. urlFirstView = false
  29663. console.error('检测到firstView但是 找不到该pano')
  29664. }else{
  29665. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  29666. i.zoom = -1;
  29667. i.mode = "panorama"
  29668. i.setByUrl = true
  29669. }
  29670. }catch(e){
  29671. urlFirstView = false
  29672. console.error('检测到firstView但是解析出错'+e)
  29673. }
  29674. }
  29675. if (Object.keys(i).length > 0)
  29676. return i;
  29677. if (e.heroImage)
  29678. i = o(e, t);
  29679. else if (window.DATA.camera_start) {
  29680. var n = window.DATA.camera_start;
  29681. try {
  29682. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  29683. i.position = n.camera.position,
  29684. //i.quaternion = n.camera.quaternion,
  29685. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  29686. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  29687. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  29688. d.debug("Using camera_start"),
  29689. d.debug("Modeldata pano: ", i.pano.quaternion),
  29690. d.debug("Camera start pano: ", n.pano.quaternion)),
  29691. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  29692. } catch (e) {
  29693. d.warn(e.message)
  29694. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  29695. }
  29696. }
  29697. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  29698. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  29699. i.pano = t.findClosest(i.position),
  29700. i.quaternion = i.pano.quaternion),
  29701. 0 === Object.keys(i).length) {
  29702. var a = t.list[0];
  29703. a && (i.mode = h.PANORAMA,
  29704. i.pano = a,
  29705. i.position = a.position,
  29706. i.quaternion = a.quaternion,
  29707. d.info("Starting at 1st pano " + a.id))
  29708. }
  29709. return i.mode = i.mode || h.DOLLHOUSE,
  29710. i
  29711. }
  29712. function r(e) {
  29713. var t = c.valueFromHash("start", "")
  29714. , i = {};
  29715. if ("" !== t) {
  29716. d.debug("Start override found in parameters, trying to parse..."),
  29717. i = a(t) || {};
  29718. var n = c.valueFromHash("tag", null);
  29719. n && (i.tag = n),
  29720. i.panoId && (i.pano = e.get(i.panoId))
  29721. }
  29722. return i
  29723. }
  29724. function o(e, t) {
  29725. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  29726. return {};
  29727. var i = {}
  29728. , n = e.heroImage.metadata;
  29729. d.debug("Using start position from thumbnail image"),
  29730. i.position = n.camera_position,
  29731. i.quaternion = n.camera_quaternion;
  29732. try {
  29733. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  29734. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  29735. } catch (e) {
  29736. d.debug(e.message)
  29737. }
  29738. return i
  29739. }
  29740. function a(e) {
  29741. return s.deserialize(e)
  29742. }
  29743. var s = e("../controls/serializer")
  29744. , l = e("../util/math")
  29745. , c = e("./browser")
  29746. , h = e("../enum/Viewmode")
  29747. , u = e("../util/logger")
  29748. , th = e("three")//xzw
  29749. , d = new u(i);
  29750. t.exports = {
  29751. getStartCameraOptions: n
  29752. }
  29753. }
  29754. ).call(this, "/js/util/camera.js")
  29755. }
  29756. , {
  29757. "../controls/serializer": 14,
  29758. "../enum/Viewmode": 51,
  29759. "../util/logger": 189,
  29760. "../util/math": 190,
  29761. "./browser": 182,
  29762. "three": 217
  29763. }],
  29764. 184: [function(e, t, i) {
  29765. "use strict";
  29766. function n(e, t, i) {
  29767. return o(e.fov, t, i)
  29768. }
  29769. var r = e("./MathLight")
  29770. , o = function(e, t, i) {
  29771. var n = t
  29772. , o = i
  29773. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  29774. return a
  29775. }
  29776. , a = function(e, t, i) {
  29777. var n = t
  29778. , o = i
  29779. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  29780. return a
  29781. }
  29782. , s = function(e, t, i, n) {
  29783. var r = o(e, i, n);
  29784. return r > t ? a(t, i, n) : e
  29785. };
  29786. t.exports = {
  29787. clampVFOV: s,
  29788. getHFOVForCamera: n,
  29789. getHFOVFromVFOV: o,
  29790. getVFOVFromHFOV: a
  29791. }
  29792. window.MathLight = t.exports
  29793. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  29794. var prec = Math.pow(10, - (precision || 4));
  29795. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  29796. if(e1.w){
  29797. return s1 && Math.abs(e1.w - e2.w) < prec
  29798. }else return s1
  29799. }
  29800. }
  29801. , {
  29802. "./MathLight": 176
  29803. }],
  29804. 185: [function(e, t, i) {
  29805. "use strict";
  29806. var n = e("three");
  29807. t.exports = {
  29808. delayOneFrame: function(e) {
  29809. window.setTimeout(e, 1)
  29810. },
  29811. normalizeUrl: function(e) {
  29812. return e.replace("https://", "http://")
  29813. },
  29814. domainFromUrl: function(e) {
  29815. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  29816. return t ? t[3] : e
  29817. },
  29818. average: function(e, t) {
  29819. if (0 === e.length)
  29820. return null;
  29821. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  29822. var o = t ? e[r][t] : e[r];
  29823. i += o,
  29824. n++
  29825. }
  29826. return i / n
  29827. },
  29828. countUnique: function(e) {
  29829. for (var t = {}, i = 0; i < e.length; i++)
  29830. t[e[i]] = 1 + (t[e[i]] || 0);
  29831. return Object.keys(t).length
  29832. },
  29833. averageVectors: function(e, t) {
  29834. var i = new n.Vector3;
  29835. if (0 === e.length)
  29836. return i;
  29837. for (var r = 0, o = 0; o < e.length; o++) {
  29838. var a = t ? e[o][t] : e[o];
  29839. i.add(a),
  29840. r++
  29841. }
  29842. return i.divideScalar(r)
  29843. },
  29844. equalLists: function(e, t) {
  29845. if (e.length !== t.length)
  29846. return !1;
  29847. for (var i = 0; i < e.length; i++)
  29848. if (e[i] !== t[i])
  29849. return !1;
  29850. return !0
  29851. },
  29852. lowerMedian: function(e, t) {
  29853. if (0 === e.length)
  29854. return null;
  29855. t = t || 2,
  29856. e.sort(function(e, t) {
  29857. return e - t
  29858. });
  29859. var i = Math.floor(e.length / t);
  29860. return e[i]
  29861. },
  29862. stableSort: function(e, t) {
  29863. return e.map(function(e, t) {
  29864. return {
  29865. value: e,
  29866. index: t
  29867. }
  29868. }).sort(function(e, i) {
  29869. var n = t(e.value, i.value);
  29870. return 0 !== n ? n : e.index - i.index
  29871. }).map(function(e) {
  29872. return e.value
  29873. })
  29874. },
  29875. filterAll: function(e, t) {
  29876. return e.filter(function(e) {
  29877. return t.every(function(t) {
  29878. return t(e)
  29879. })
  29880. })
  29881. },
  29882. formatDate: function(e) {
  29883. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  29884. },
  29885. formatDatetime: function(e) {
  29886. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  29887. },
  29888. randomString: function(e) {
  29889. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  29890. t += i.charAt(Math.floor(Math.random() * i.length));
  29891. return t
  29892. },
  29893. uint8ToBase64: function(e, t) {
  29894. t && "number" == typeof t || (t = 8192);
  29895. for (var i = [], n = 0; n < e.length; n += t)
  29896. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  29897. return btoa(i.join(""))
  29898. },
  29899. uuid4: function e(t) {
  29900. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  29901. },
  29902. nth: function(e) {
  29903. return e %= 10,
  29904. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  29905. },
  29906. extendObject: function(e, t) {
  29907. return Object.keys(t).forEach(function(i) {
  29908. e[i] = t[i]
  29909. }),
  29910. e
  29911. },
  29912. deepExtend: function e(t) {
  29913. t = t || {};
  29914. for (var i = 1; i < arguments.length; i++) {
  29915. var n = arguments[i];
  29916. if (n)
  29917. for (var r in n)
  29918. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  29919. }
  29920. return t
  29921. },
  29922. inherit: function(e, t) {
  29923. e.prototype = Object.create(t.prototype),
  29924. e.prototype.constructor = e
  29925. },
  29926. extend: function(e, t) {
  29927. for (var i in t.prototype)
  29928. e.prototype[i] = t.prototype[i]
  29929. }
  29930. ,
  29931. getVisiblePano : function(positions = [], panos, options={}){//add
  29932. var visiblePanos = [];
  29933. options.posAtPanos = options.posAtPanos || {}//在不同漫游点的positions
  29934. panos.forEach((pano)=>{
  29935. if(!pano.isAligned())return;
  29936. var A = pano.position.clone();
  29937. var posB = options.posAtPanos[pano.id] || positions;
  29938. var posLength = posB.length
  29939. for(let i=0;i<posLength;i++){
  29940. var B = posB[i];
  29941. var ray = new THREE.Raycaster(A.clone(), B.clone().sub(A).normalize(), 0, A.distanceTo(B) - (options.tolerance||0) )
  29942. var o = ray.intersectObjects(options.model || player.model.colliders, true);
  29943. if (!o || !o.length){ //只要有一点可见,就算整体可见
  29944. visiblePanos.push(pano.id);
  29945. break;
  29946. }
  29947. }
  29948. })
  29949. return visiblePanos
  29950. }
  29951. ,
  29952. sortByScore : function(list, request, rank) {
  29953. var i = this.filterAll(list, request);
  29954. return 0 === i.length ? null : i = i.map(function(e) {
  29955. return {
  29956. item: e,
  29957. score: rank.reduce(function(t, i) {
  29958. return t + i(e);
  29959. }, 0)
  29960. };
  29961. }).sort(function(e, t) {
  29962. return t.score - e.score;
  29963. });
  29964. },
  29965. getFileNameFromUrl:function(url){
  29966. return url.split('/').pop();
  29967. }
  29968. },
  29969. Math.sign = function(e) {
  29970. return e < 0 ? -1 : 1
  29971. }
  29972. window.common = t.exports
  29973. }
  29974. , {
  29975. three: 217
  29976. }],
  29977. 186: [function(e, t, i) {
  29978. "use strict";
  29979. var n = {};
  29980. n.linearTween = function(e, t, i, n) {
  29981. return i * e / n + t
  29982. }
  29983. ,
  29984. n.easeInQuad = function(e, t, i, n) {
  29985. return e /= n,
  29986. i * e * e + t
  29987. }
  29988. ,
  29989. n.easeOutQuad = function(e, t, i, n) {
  29990. return e /= n,
  29991. -i * e * (e - 2) + t
  29992. }
  29993. ,
  29994. n.easeInOutQuad = function(e, t, i, n) {
  29995. return e /= n / 2,
  29996. e < 1 ? i / 2 * e * e + t : (e--,
  29997. -i / 2 * (e * (e - 2) - 1) + t)
  29998. }
  29999. ,
  30000. n.easeInCubic = function(e, t, i, n) {
  30001. return e /= n,
  30002. i * e * e * e + t
  30003. }
  30004. ,
  30005. n.easeOutCubic = function(e, t, i, n) {
  30006. return e /= n,
  30007. e--,
  30008. i * (e * e * e + 1) + t
  30009. }
  30010. ,
  30011. n.easeInOutCubic = function(e, t, i, n) {
  30012. return e /= n / 2,
  30013. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30014. i / 2 * (e * e * e + 2) + t)
  30015. }
  30016. ,
  30017. n.easeInQuart = function(e, t, i, n) {
  30018. return e /= n,
  30019. i * e * e * e * e + t
  30020. }
  30021. ,
  30022. n.easeOutQuart = function(e, t, i, n) {
  30023. return e /= n,
  30024. e--,
  30025. -i * (e * e * e * e - 1) + t
  30026. }
  30027. ,
  30028. n.easeInOutQuart = function(e, t, i, n) {
  30029. return e /= n / 2,
  30030. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30031. -i / 2 * (e * e * e * e - 2) + t)
  30032. }
  30033. ,
  30034. n.easeInQuint = function(e, t, i, n) {
  30035. return e /= n,
  30036. i * e * e * e * e * e + t
  30037. }
  30038. ,
  30039. n.easeOutQuint = function(e, t, i, n) {
  30040. return e /= n,
  30041. e--,
  30042. i * (e * e * e * e * e + 1) + t
  30043. }
  30044. ,
  30045. n.easeInOutQuint = function(e, t, i, n) {
  30046. return e /= n / 2,
  30047. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30048. i / 2 * (e * e * e * e * e + 2) + t)
  30049. }
  30050. ,
  30051. n.easeInSine = function(e, t, i, n) {
  30052. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30053. }
  30054. ,
  30055. n.easeOutSine = function(e, t, i, n) {
  30056. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30057. }
  30058. ,
  30059. n.easeInOutSine = function(e, t, i, n) {
  30060. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30061. }
  30062. ,
  30063. n.easeInExpo = function(e, t, i, n) {
  30064. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30065. }
  30066. ,
  30067. n.easeOutExpo = function(e, t, i, n) {
  30068. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30069. }
  30070. ,
  30071. n.easeInOutExpo = function(e, t, i, n) {
  30072. return e /= n / 2,
  30073. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30074. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30075. }
  30076. ,
  30077. n.easeInCirc = function(e, t, i, n) {
  30078. return e /= n,
  30079. -i * (Math.sqrt(1 - e * e) - 1) + t
  30080. }
  30081. ,
  30082. n.easeOutCirc = function(e, t, i, n) {
  30083. return e /= n,
  30084. e--,
  30085. i * Math.sqrt(1 - e * e) + t
  30086. }
  30087. ,
  30088. n.easeInOutCirc = function(e, t, i, n) {
  30089. return e /= n / 2,
  30090. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30091. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30092. }
  30093. ,
  30094. n.easeInElastic = function(e, t, i, n) {
  30095. var r = 1.70158
  30096. , o = 0
  30097. , a = i;
  30098. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30099. a < Math.abs(i) ? (a = i,
  30100. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30101. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30102. }
  30103. ,
  30104. n.easeOutElastic = function(e, t, i, n) {
  30105. var r = 1.70158
  30106. , o = 0
  30107. , a = i;
  30108. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30109. a < Math.abs(i) ? (a = i,
  30110. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30111. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30112. }
  30113. ,
  30114. n.easeInOutElastic = function(e, t, i, n) {
  30115. var r = 1.70158
  30116. , o = 0
  30117. , a = i;
  30118. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30119. a < Math.abs(i) ? (a = i,
  30120. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30121. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  30122. }
  30123. ,
  30124. n.easeInBack = function(e, t, i, n, r) {
  30125. return void 0 === r && (r = 1.70158),
  30126. i * (e /= n) * e * ((r + 1) * e - r) + t
  30127. }
  30128. ,
  30129. n.easeOutBack = function(e, t, i, n, r) {
  30130. return void 0 === r && (r = 1.70158),
  30131. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30132. }
  30133. ,
  30134. n.easeInOutBack = function(e, t, i, n, r) {
  30135. return void 0 === r && (r = 1.70158),
  30136. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  30137. }
  30138. ,
  30139. n.easeOutBounce = function(e, t, i, n) {
  30140. return (e /= n) < 1 / 2.75 ? i * (7.5625 * e * e) + t : e < 2 / 2.75 ? i * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? i * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : i * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  30141. }
  30142. ,
  30143. n.easeInBounce = function(e, t, i, r) {
  30144. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30145. }
  30146. ,
  30147. n.easeInOutBounce = function(e, t, i, r) {
  30148. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  30149. }
  30150. ,
  30151. t.exports = n
  30152. window.easing = n
  30153. }
  30154. , {}],
  30155. 187: [function(e, t, i) {
  30156. "use strict";
  30157. function n() {
  30158. this.events = [],
  30159. this.valid = !1
  30160. }
  30161. var r = e("../enum/Joystick");
  30162. n.prototype.push = function(e, t) {
  30163. this.events.push({
  30164. direction: e,
  30165. pano: t
  30166. }),
  30167. this.valid = !0
  30168. }
  30169. ,
  30170. n.prototype.pop = function(e) {
  30171. var t = this.events.pop();
  30172. return this.events.length < 1 && (this.valid = !1),
  30173. t
  30174. }
  30175. ,
  30176. n.prototype.peek = function() {
  30177. return this.events.length ? this.events[this.events.length - 1] : {
  30178. direction: null,
  30179. pano: null
  30180. }
  30181. }
  30182. ,
  30183. n.prototype.invalidate = function() {
  30184. this.events = [],
  30185. this.valid = !1
  30186. }
  30187. ,
  30188. n.prototype.reversePano = function(e) {
  30189. if (!this.valid)
  30190. return null;
  30191. var t = this.peek();
  30192. return r.opposite(e) === t.direction ? (this.pop(),
  30193. t.pano) : null
  30194. }
  30195. ,
  30196. t.exports = n
  30197. }
  30198. , {
  30199. "../enum/Joystick": 29
  30200. }],
  30201. 188: [function(e, t, i) {
  30202. "use strict";
  30203. window.lerp = t.exports = {
  30204. vector: function(e, t) {
  30205. var i = e.clone();
  30206. return t = t.clone(),
  30207. function(n) {
  30208. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30209. }
  30210. },
  30211. quaternion: function(e, t) {
  30212. var i = e.clone();
  30213. return function(n) {
  30214. e.copy(i).slerp(t, n)
  30215. }
  30216. },
  30217. property: function(e, t, i, n) {
  30218. var r = e[t];
  30219. return function(o) {
  30220. e[t] = r * (1 - o) + i * o,
  30221. n && n(e[t])
  30222. }
  30223. },
  30224. uniform: function(e, t, i) {
  30225. var n = e.material.uniforms[t].value;
  30226. return function(r) {
  30227. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30228. }
  30229. },
  30230. matrix4: function(e, t) {
  30231. var i = e.clone();
  30232. return function(n) {
  30233. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  30234. r[s] = o[s] * (1 - n) + a[s] * n
  30235. }
  30236. },
  30237. allUniforms: function(e, t, i) {
  30238. var n = e.map(function(e) {
  30239. return this.uniform(e, t, i)
  30240. }
  30241. .bind(this));
  30242. return function(e) {
  30243. n.forEach(function(t) {
  30244. t(e)
  30245. })
  30246. }
  30247. }
  30248. }
  30249. }
  30250. , {}],
  30251. 189: [function(e, t, i) {
  30252. "use strict";
  30253. function n(e) {
  30254. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  30255. if (n.consoleEnabled) {
  30256. var h = function(e) {
  30257. $("#debug-console").append("<p>" + e + "</p>"),
  30258. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  30259. };
  30260. t = function(e) {
  30261. h(Array.prototype.slice.call(arguments).join(" "))
  30262. }
  30263. ,
  30264. i = function(e) {
  30265. h(Array.prototype.slice.call(arguments).join(" "))
  30266. }
  30267. ,
  30268. o = function(e) {
  30269. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  30270. }
  30271. ,
  30272. a = function(e) {
  30273. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  30274. }
  30275. } else
  30276. console.log ? (t = console.log,
  30277. i = console.info ? console.info : console.log,
  30278. o = console.warn ? console.warn : console.log,
  30279. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  30280. ;
  30281. var u = function(e) {
  30282. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30283. }
  30284. , d = function(t, i) {
  30285. if (r) {
  30286. var o = Array.prototype.slice.call(t).join(" ");
  30287. r.captureMessage(o, {
  30288. level: i,
  30289. path: e,
  30290. timestamp: n.timestamp()
  30291. })
  30292. }
  30293. }
  30294. , p = function(t, i) {
  30295. if (r) {
  30296. var o = Array.prototype.slice.call(t).join(" ");
  30297. r.captureException(new Error(o), {
  30298. level: i,
  30299. path: e,
  30300. timestamp: n.timestamp()
  30301. })
  30302. }
  30303. };
  30304. return {
  30305. debug: function() {
  30306. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30307. },
  30308. info: function() {
  30309. n.level >= n.levels.info && i.apply(console, u(arguments))
  30310. },
  30311. warn: function() {
  30312. d(arguments, "warn"),
  30313. n.level >= n.levels.warn && o.apply(console, u(arguments))
  30314. },
  30315. error: function() {
  30316. p(arguments, "error"),
  30317. n.level >= n.levels.error && a.apply(console, u(arguments))
  30318. },
  30319. v3str: function(e, t) {
  30320. var i = void 0 === t ? 2 : t;
  30321. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  30322. },
  30323. eulstr: function(e, t) {
  30324. var i = void 0 === t ? 2 : t;
  30325. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30326. },
  30327. time: function(e) {
  30328. n.level >= n.levels.debug && (c[e] = Date.now())
  30329. },
  30330. timeEnd: function(e) {
  30331. if (n.level >= n.levels.debug) {
  30332. var t = c[e];
  30333. if (!t)
  30334. return;
  30335. var i = (Date.now() - t) / 1e3;
  30336. this.debug(e, i + "s")
  30337. }
  30338. }
  30339. }
  30340. }
  30341. var r = window.Raven;
  30342. n.timestamp = function() {
  30343. return (Date.now() - window.navigationStart) / 1e3 + "s"
  30344. }
  30345. ,
  30346. n.levels = {
  30347. debug: 3,
  30348. info: 2,
  30349. warn: 1,
  30350. error: 0
  30351. },
  30352. n.level = n.levels.info,
  30353. t.exports = n
  30354. }
  30355. , {}],
  30356. 190: [function(e, t, i) {
  30357. "use strict";
  30358. var n = e("three")
  30359. , r = e("../enum/GLCubeFaces")
  30360. , o = e("../constants");
  30361. t.exports = {
  30362. convertVisionVector: function(e) {
  30363. return new n.Vector3(e.x,e.z,-e.y)
  30364. },
  30365. convertVisionQuaternion: function(e) {
  30366. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  30367. },
  30368. convertWorkshopVector: function(e) {
  30369. return new n.Vector3(-e.x,e.y,e.z)
  30370. },
  30371. convertWorkshopQuaternion: function(e) {
  30372. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  30373. },
  30374. convertWorkshopPanoramaQuaternion: function(e) {
  30375. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  30376. },
  30377. convertWorkshopOrthoZoom: function(e) {// xzw
  30378. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30379. //return e;
  30380. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  30381. },
  30382. toPrecision: function(e, t) {//xzw change
  30383. var f = function(e, t){
  30384. var i = Math.pow(10, t);
  30385. return Math.round(e * i) / i
  30386. }
  30387. if(e instanceof Array){
  30388. for(var s=0; s<e.length; s++){
  30389. e[s] = f(e[s],t);
  30390. }
  30391. return e;
  30392. }
  30393. else return f(e,t)
  30394. },
  30395. isEmptyQuaternion: function(e) {
  30396. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30397. },
  30398. projectPositionToCanvas: function(e, t, i) {
  30399. i = i || new n.Vector3,
  30400. i.copy(e);
  30401. var r = .5 * $("#player").width()
  30402. , o = .5 * $("#player").height();
  30403. return i.project(t),
  30404. i.x = i.x * r + r,
  30405. i.y = -(i.y * o) + o,
  30406. i
  30407. },
  30408. convertScreenPositionToNDC: function(e, t, i) {
  30409. return i = i || new n.Vector2,
  30410. i.x = e / $("#player").width() * 2 - 1,
  30411. i.y = 2 * -(t / $("#player").height()) + 1,
  30412. i
  30413. },
  30414. constrainedTurn: function(e) {
  30415. var t = e % (2 * Math.PI);
  30416. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  30417. },
  30418. getFOVDotThreshold: function(e) {
  30419. return Math.cos(n.Math.degToRad(e / 2))
  30420. },
  30421. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  30422. switch (e) {
  30423. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30424. i.set(1, t.y, t.x);
  30425. break;
  30426. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30427. i.set(-1, t.y, -t.x);
  30428. break;
  30429. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30430. i.set(-t.x, 1, -t.y);
  30431. break;
  30432. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30433. i.set(-t.x, -1, t.y);
  30434. break;
  30435. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  30436. i.set(-t.x, t.y, 1);
  30437. break;
  30438. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30439. i.set(t.x, t.y, -1)
  30440. }
  30441. n && i.normalize()
  30442. },
  30443. //add:
  30444. getPos2d : function(point, camera, dom){
  30445. var camera = camera ;
  30446. var dom = dom;
  30447. 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);
  30448. var x,y;
  30449. x = (pos.x + 1) / 2 * dom.clientWidth;
  30450. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  30451. var inSight = x <= dom.clientWidth && x >= 0
  30452. && y <= dom.clientHeight && y >= 0
  30453. return {
  30454. pos: new THREE.Vector2(x,y),
  30455. vector: pos,
  30456. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  30457. inSight : inSight //在屏幕范围内可见
  30458. };
  30459. },
  30460. getDirByLonLat: function(lon, lat) {
  30461. var dir = new THREE.Vector3();
  30462. var phi = THREE.Math.degToRad(90 - lat);
  30463. var theta = THREE.Math.degToRad(lon);
  30464. dir.x = Math.sin(phi) * Math.cos(theta);
  30465. dir.y = Math.cos(phi);
  30466. dir.z = Math.sin(phi) * Math.sin(theta);
  30467. return dir.negate();
  30468. }
  30469. }
  30470. window.math = t.exports
  30471. }
  30472. , {
  30473. "../constants": 8,
  30474. "../enum/GLCubeFaces": 25,
  30475. three: 217
  30476. }],
  30477. 191: [function(e, t, i) {
  30478. "use strict";
  30479. function n(e, t, i) {
  30480. return a.map(function(n, o) {
  30481. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  30482. }
  30483. .bind(this))
  30484. }
  30485. function r(e) {
  30486. return s[e]
  30487. }
  30488. var o = e("../enum/GLCubeFaces")
  30489. , a = [0, 1, 2, 3, 4, 5]
  30490. , s = {
  30491. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  30492. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  30493. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  30494. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  30495. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  30496. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  30497. };
  30498. t.exports = {
  30499. mapFaceToCubemapFace: r,
  30500. getCubemapUrls: n
  30501. }
  30502. }
  30503. , {
  30504. "../enum/GLCubeFaces": 25
  30505. }],
  30506. 192: [function(e, t, i) {
  30507. "use strict";
  30508. t.exports = {
  30509. captureErrors: function(e, t, i) {
  30510. if ("Raven"in window) {
  30511. Raven.config(e, t).install(),
  30512. i && Raven.setTagsContext(i);
  30513. var n = console.warn
  30514. , r = console.error;
  30515. console.warn = function() {
  30516. var e = Array.prototype.slice.call(arguments);
  30517. Raven.captureMessage(e.join(" "), {
  30518. level: "warning"
  30519. }),
  30520. n.apply(console, e)
  30521. }
  30522. ,
  30523. console.error = function() {
  30524. var e = Array.prototype.slice.call(arguments);
  30525. Raven.captureException(new Error(e.join(" ")), {
  30526. level: "error"
  30527. }),
  30528. r.apply(console, e)
  30529. }
  30530. } else
  30531. console.error("Raven not found, not capturing errors.")
  30532. }
  30533. }
  30534. }
  30535. , {}],
  30536. 193: [function(e, t, i) {
  30537. (function(i) {
  30538. "use strict";
  30539. var n = e("./browser")
  30540. , r = e("../constants")
  30541. , o = e("url")
  30542. , a = e("./logger")
  30543. , ss = e('three')
  30544. , s = new a(i)
  30545. , l = {
  30546. getAuthorizationHeader: function() {
  30547. var e = n.valueFromHash("auth");
  30548. if (e)
  30549. return e.replace(",", " ");
  30550. var t = n.valueFromCookie("token");
  30551. return t ? "Token " + t : null
  30552. },
  30553. parseSidUrl: function(e) {
  30554. var t, i;
  30555. t=g_Prefix;
  30556. if (e = e || "",
  30557. e.match(/^https?/)) {
  30558. var n = o.parse(e);
  30559. t = g_Prefix,
  30560. i = e
  30561. } else{
  30562. //xzw 原先的不能用
  30563. //t = window.location.protocol + "//" + window.location.host, //MP
  30564. t = g_Prefix
  30565. //i = t + "/api/player/models/" + e; //MP
  30566. i = t + "data/" + e;
  30567. }
  30568. return {
  30569. urlBase: t,
  30570. urlModel: i,
  30571. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  30572. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  30573. }
  30574. },
  30575. getModelIDFromQueryString: function() {
  30576. return n.valueFromHash("model") || n.valueFromHash("m")
  30577. },
  30578. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30579. e = JSON.parse(JSON.stringify(e));
  30580. var i = null;
  30581. if (e.images.forEach(function(n) {
  30582. if(!n.metadata) return;
  30583. if ("string" == typeof n.metadata)
  30584. try {
  30585. n.metadata = JSON.parse(n.metadata)
  30586. } catch (e) {
  30587. s.warn("Unable to parse image metadata"),
  30588. n.metadata = null
  30589. }
  30590. else{
  30591. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30592. }
  30593. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30594. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30595. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30596. }else{
  30597. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30598. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  30599. n.metadata.zoom = n.metadata.zoom || 1;
  30600. }
  30601. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30602. }),
  30603. //icon初始视角的:
  30604. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30605. var n = {};
  30606. n.pano = {
  30607. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30608. position: t.convertWorkshopVector(i.scan_position),
  30609. uuid: i.scan_id
  30610. },
  30611. n.camera = {
  30612. quaternion: i.camera_quaternion,
  30613. position: i.camera_position
  30614. },
  30615. e.startPano = n
  30616. }
  30617. return e
  30618. },
  30619. */
  30620. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30621. e = JSON.parse(JSON.stringify(e));
  30622. var i = null;
  30623. var deal = function(n) {
  30624. if(!n.metadata) return;
  30625. if ("string" == typeof n.metadata)
  30626. try {
  30627. n.metadata = JSON.parse(n.metadata)
  30628. } catch (e) {
  30629. s.warn("Unable to parse image metadata"),
  30630. n.metadata = null
  30631. }
  30632. else{
  30633. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30634. }
  30635. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30636. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30637. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30638. }else{
  30639. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  30640. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  30641. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30642. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  30643. }
  30644. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30645. }
  30646. //改
  30647. e.images.forEach(info=>{
  30648. if(info.locations){
  30649. info.locations.forEach(a=>deal(a))
  30650. }else{
  30651. deal(info)
  30652. }
  30653. })
  30654. //icon初始视角的:
  30655. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30656. var n = {};
  30657. n.pano = {
  30658. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30659. position: t.convertWorkshopVector(i.scan_position),
  30660. uuid: i.scan_id
  30661. },
  30662. n.camera = {
  30663. quaternion: i.camera_quaternion,
  30664. position: i.camera_position
  30665. },
  30666. e.startPano = n
  30667. }
  30668. return e
  30669. },
  30670. visionVersionToInt: function() {
  30671. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  30672. return function(t) {
  30673. if (!t)
  30674. throw new Error("Vision version is required");
  30675. var i = e.exec(t);
  30676. if (null === i)
  30677. throw new Error("String is not a vision version: " + t);
  30678. return parseInt(i[1])
  30679. }
  30680. }(),
  30681. modelDataPromisesTiles: function(e) {
  30682. var vision_version = e.vision_version || window.DATA.vision_version
  30683. if (vision_version)
  30684. try {
  30685. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  30686. } catch (t) {
  30687. s.warn("Invalid vision version: " + vision_version)
  30688. }
  30689. // var t = e.created ? new Date(e.created) : null;
  30690. // return t && t >= r.visionTilingStartDate
  30691. return false
  30692. }
  30693. };
  30694. t.exports = l
  30695. }
  30696. ).call(this, "/js/util/showcase.js")
  30697. }
  30698. , {
  30699. "../constants": 8,
  30700. "./browser": 182,
  30701. "./logger": 189,
  30702. three:217,
  30703. url: 208
  30704. }],
  30705. 194: [function(e, t, i) {
  30706. "use strict";
  30707. var n = e("../util/ajax")
  30708. , r = e("three")
  30709. , o = e("../settings")
  30710. , a = {};
  30711. t.exports = {
  30712. load: function(e, t, i) {
  30713. var s = a[e];
  30714. return s ? (t && setTimeout(function() {
  30715. t(s)
  30716. }, 1),
  30717. s) : (s = new r.Texture,
  30718. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  30719. s.magFilter = r.LinearFilter,
  30720. s.generateMipmaps = !1),
  30721. s.sourceFile = e,
  30722. a[e] = s,
  30723. n.getImage(e).then(function(e) {
  30724. s.image = e,
  30725. s.needsUpdate = !0,
  30726. t && t(s)
  30727. }).fail(i),
  30728. s)
  30729. },
  30730. loadBase64: function(e, t) {
  30731. t = t || "png";
  30732. var i = new r.Texture;
  30733. return i.image = document.createElement("img"),
  30734. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  30735. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  30736. i.magFilter = r.LinearFilter,
  30737. i.generateMipmaps = !1),
  30738. i.needsUpdate = !0,
  30739. i
  30740. },
  30741. isLoaded: function(e) {
  30742. return !!a[e]
  30743. }
  30744. }
  30745. window.Texture = t.exports
  30746. }
  30747. , {
  30748. "../settings": 166,
  30749. "../util/ajax": 181,
  30750. three: 217
  30751. }],
  30752. 195: [function(e, t, i) {
  30753. "use strict";
  30754. var n = e("./easing");
  30755. window.transitions = t.exports = {
  30756. globalDone: null,
  30757. funcs: [],
  30758. counter: 0,
  30759. uniqueID: 0,
  30760. start: function(e, t, i, r, o, a, s) {
  30761. return r = r || 0,
  30762. this.funcs.push({
  30763. func: e,
  30764. current: -r * Math.abs(t),
  30765. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  30766. done: i,
  30767. easing: o || n.linearTween,
  30768. cycling: t < 0,
  30769. running: !0,
  30770. debug: r < 0,
  30771. name: a || "T" + this.counter,
  30772. id: void 0 === s ? this.counter : s,
  30773. paused: !1
  30774. }),
  30775. e(0, 16),
  30776. this.counter += 1,
  30777. e
  30778. },
  30779. trigger: function(e) {
  30780. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  30781. , i = e.func || function() {}
  30782. , r = void 0 === e.duration ? 0 : e.duration;
  30783. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  30784. var o = e.done || null
  30785. , a = e.easing || n.linearTween
  30786. , s = e.name || "R" + this.counter
  30787. , l = void 0 === e.id ? this.counter : e.id;
  30788. return this.start(i, r, o, t, a, s, l)
  30789. },
  30790. setTimeout: function(e, t, i) {
  30791. var n = void 0 === i ? this.counter : i;
  30792. return this.trigger({
  30793. done: e,
  30794. duration: void 0 === t ? 0 : t,
  30795. name: "O" + this.counter,
  30796. id: n
  30797. })
  30798. },
  30799. pause: function() {
  30800. this.paused = !0
  30801. },
  30802. resume: function() {
  30803. this.paused = !1
  30804. },
  30805. update: function(e) {
  30806. this.funcs.forEach(function(t) {
  30807. if (!(t.paused || (t.current += 1e3 * e,
  30808. t.current < 0)))
  30809. if (t.current >= t.duration && !t.cycling) {
  30810. var i = t.easing(1, 0, 1, 1);
  30811. t.func(i, 1e3 * e),
  30812. t.done && t.done(),
  30813. t.running = !1
  30814. } else {
  30815. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  30816. , r = t.func(n, 1e3 * e) || !1;
  30817. r && (t.done && t.done(),
  30818. t.running = !1)
  30819. }
  30820. });
  30821. var t = this.funcs.length;
  30822. this.funcs = this.funcs.filter(function(e) {
  30823. return e.running
  30824. });
  30825. var i = this.funcs.length;
  30826. if (t > 0 && 0 === i && this.globalDone) {
  30827. var n = this.globalDone;
  30828. this.globalDone = null,
  30829. n()
  30830. }
  30831. },
  30832. adjustSpeed: function(e, t) {
  30833. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  30834. var r = i[n];
  30835. r.duration /= t,
  30836. r.current /= t
  30837. }
  30838. },
  30839. getById: function(e) {
  30840. return this.funcs.filter(function(t) {
  30841. return e === t.id
  30842. })
  30843. },
  30844. get: function(e) {
  30845. for (var t = 0; t < this.funcs.length; t += 1)
  30846. if (this.funcs[t].func === e)
  30847. return this.funcs[t];
  30848. return null
  30849. },
  30850. isRunning: function(e) {
  30851. var t = this.get(e);
  30852. return null !== t && t.running
  30853. },
  30854. countActive: function() {
  30855. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  30856. e += this.funcs[t].running;
  30857. return e
  30858. },
  30859. listActive: function() {
  30860. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  30861. this.funcs[t].running && e.push(this.funcs[t].name);
  30862. return e
  30863. },
  30864. done: function(e) {
  30865. this.globalDone = e
  30866. },
  30867. cancelById: function(e) {
  30868. var t = void 0 === e ? 0 : e;
  30869. this.funcs = this.funcs.filter(function(e) {
  30870. return e.id !== t
  30871. })
  30872. },
  30873. cancel: function(e) {
  30874. this.funcs = this.funcs.filter(function(t) {
  30875. return t.func !== e
  30876. })
  30877. },
  30878. getUniqueId: function() {
  30879. return this.uniqueID -= 1,
  30880. this.uniqueID
  30881. }
  30882. }
  30883. }
  30884. , {
  30885. "./easing": 186
  30886. }],
  30887. 196: [function(e, t, i) {
  30888. function n(e) {
  30889. if (this.set = {},
  30890. this.infContains = function() {
  30891. return !0
  30892. }
  30893. ,
  30894. "object" == typeof e)
  30895. if (e instanceof Array)
  30896. for (var t = 0; t < e.length; t++)
  30897. this.set[e[t]] = !0;
  30898. else
  30899. this.set = e;
  30900. else if ("function" == typeof e)
  30901. this.infContains = e;
  30902. else if ("undefined" != typeof e)
  30903. throw new Error("set must be either an array or an object.")
  30904. }
  30905. t.exports = n,
  30906. n.prototype.contains = function(e) {
  30907. return !!this.set[e]
  30908. }
  30909. ,
  30910. n.prototype.has = n.prototype.contains,
  30911. n.prototype.add = function(e) {
  30912. if (1 == arguments.length)
  30913. this.set[e] = !0;
  30914. else
  30915. for (var t = 0; t < arguments.length; t++)
  30916. this.set[arguments[t]] = !0
  30917. }
  30918. ,
  30919. n.prototype.addAll = function(e) {
  30920. if ("object" != typeof e && !(e instanceof Array))
  30921. throw new Error("arr must be an array.");
  30922. for (var t = 0; t < e.length; t++)
  30923. this.add(e[t])
  30924. }
  30925. ,
  30926. n.prototype.remove = function(e) {
  30927. if (1 == arguments.length)
  30928. delete this.set[e];
  30929. else
  30930. for (var t = 0; t < arguments.length; t++)
  30931. delete this.set[arguments[t]]
  30932. }
  30933. ,
  30934. n.prototype.delete = n.prototype.remove,
  30935. n.prototype.clear = function() {
  30936. this.set = {}
  30937. }
  30938. ,
  30939. n.prototype.size = function() {
  30940. return Object.keys(this.set).length
  30941. }
  30942. ,
  30943. n.prototype.toString = function() {
  30944. return "{" + Object.keys(this.set).toString() + "}"
  30945. }
  30946. ,
  30947. n.prototype.toArray = function() {
  30948. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  30949. }
  30950. ,
  30951. n.prototype["*values"] = n.prototype.toArray
  30952. }
  30953. , {}],
  30954. 197: [function(e, t, i) {}
  30955. , {}],
  30956. 198: [function(e, t, i) {
  30957. (function(t) {
  30958. "use strict";
  30959. function n() {
  30960. try {
  30961. var e = new Uint8Array(1);
  30962. return e.__proto__ = {
  30963. __proto__: Uint8Array.prototype,
  30964. foo: function() {
  30965. return 42
  30966. }
  30967. },
  30968. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  30969. } catch (e) {
  30970. return !1
  30971. }
  30972. }
  30973. function r() {
  30974. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  30975. }
  30976. function o(e, t) {
  30977. if (r() < t)
  30978. throw new RangeError("Invalid typed array length");
  30979. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  30980. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  30981. e.length = t),
  30982. e
  30983. }
  30984. function a(e, t, i) {
  30985. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  30986. return new a(e,t,i);
  30987. if ("number" == typeof e) {
  30988. if ("string" == typeof t)
  30989. throw new Error("If encoding is specified then the first argument must be a string");
  30990. return h(this, e)
  30991. }
  30992. return s(this, e, t, i)
  30993. }
  30994. function s(e, t, i, n) {
  30995. if ("number" == typeof t)
  30996. throw new TypeError('"value" argument must not be a number');
  30997. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  30998. }
  30999. function l(e) {
  31000. if ("number" != typeof e)
  31001. throw new TypeError('"size" argument must be a number');
  31002. if (e < 0)
  31003. throw new RangeError('"size" argument must not be negative')
  31004. }
  31005. function c(e, t, i, n) {
  31006. return l(t),
  31007. t <= 0 ? o(e, t) : void 0 !== i ? "string" == typeof n ? o(e, t).fill(i, n) : o(e, t).fill(i) : o(e, t)
  31008. }
  31009. function h(e, t) {
  31010. if (l(t),
  31011. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31012. !a.TYPED_ARRAY_SUPPORT)
  31013. for (var i = 0; i < t; ++i)
  31014. e[i] = 0;
  31015. return e
  31016. }
  31017. function u(e, t, i) {
  31018. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31019. !a.isEncoding(i))
  31020. throw new TypeError('"encoding" must be a valid string encoding');
  31021. var n = 0 | v(t, i);
  31022. e = o(e, n);
  31023. var r = e.write(t, i);
  31024. return r !== n && (e = e.slice(0, r)),
  31025. e
  31026. }
  31027. function d(e, t) {
  31028. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31029. e = o(e, i);
  31030. for (var n = 0; n < i; n += 1)
  31031. e[n] = 255 & t[n];
  31032. return e
  31033. }
  31034. function p(e, t, i, n) {
  31035. if (t.byteLength,
  31036. i < 0 || t.byteLength < i)
  31037. throw new RangeError("'offset' is out of bounds");
  31038. if (t.byteLength < i + (n || 0))
  31039. throw new RangeError("'length' is out of bounds");
  31040. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31041. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31042. e.__proto__ = a.prototype) : e = d(e, t),
  31043. e
  31044. }
  31045. function f(e, t) {
  31046. if (a.isBuffer(t)) {
  31047. var i = 0 | g(t.length);
  31048. return e = o(e, i),
  31049. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31050. e)
  31051. }
  31052. if (t) {
  31053. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31054. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31055. if ("Buffer" === t.type && $(t.data))
  31056. return d(e, t.data)
  31057. }
  31058. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31059. }
  31060. function g(e) {
  31061. if (e >= r())
  31062. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31063. return 0 | e
  31064. }
  31065. function m(e) {
  31066. return +e != e && (e = 0),
  31067. a.alloc(+e)
  31068. }
  31069. function v(e, t) {
  31070. if (a.isBuffer(e))
  31071. return e.length;
  31072. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31073. return e.byteLength;
  31074. "string" != typeof e && (e = "" + e);
  31075. var i = e.length;
  31076. if (0 === i)
  31077. return 0;
  31078. for (var n = !1; ; )
  31079. switch (t) {
  31080. case "ascii":
  31081. case "latin1":
  31082. case "binary":
  31083. return i;
  31084. case "utf8":
  31085. case "utf-8":
  31086. case void 0:
  31087. return j(e).length;
  31088. case "ucs2":
  31089. case "ucs-2":
  31090. case "utf16le":
  31091. case "utf-16le":
  31092. return 2 * i;
  31093. case "hex":
  31094. return i >>> 1;
  31095. case "base64":
  31096. return Z(e).length;
  31097. default:
  31098. if (n)
  31099. return j(e).length;
  31100. t = ("" + t).toLowerCase(),
  31101. n = !0
  31102. }
  31103. }
  31104. function A(e, t, i) {
  31105. var n = !1;
  31106. if ((void 0 === t || t < 0) && (t = 0),
  31107. t > this.length)
  31108. return "";
  31109. if ((void 0 === i || i > this.length) && (i = this.length),
  31110. i <= 0)
  31111. return "";
  31112. if (i >>>= 0,
  31113. t >>>= 0,
  31114. i <= t)
  31115. return "";
  31116. for (e || (e = "utf8"); ; )
  31117. switch (e) {
  31118. case "hex":
  31119. return L(this, t, i);
  31120. case "utf8":
  31121. case "utf-8":
  31122. return M(this, t, i);
  31123. case "ascii":
  31124. return P(this, t, i);
  31125. case "latin1":
  31126. case "binary":
  31127. return O(this, t, i);
  31128. case "base64":
  31129. return S(this, t, i);
  31130. case "ucs2":
  31131. case "ucs-2":
  31132. case "utf16le":
  31133. case "utf-16le":
  31134. return D(this, t, i);
  31135. default:
  31136. if (n)
  31137. throw new TypeError("Unknown encoding: " + e);
  31138. e = (e + "").toLowerCase(),
  31139. n = !0
  31140. }
  31141. }
  31142. function y(e, t, i) {
  31143. var n = e[t];
  31144. e[t] = e[i],
  31145. e[i] = n
  31146. }
  31147. function C(e, t, i, n, r) {
  31148. if (0 === e.length)
  31149. return -1;
  31150. if ("string" == typeof i ? (n = i,
  31151. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31152. i = +i,
  31153. isNaN(i) && (i = r ? 0 : e.length - 1),
  31154. i < 0 && (i = e.length + i),
  31155. i >= e.length) {
  31156. if (r)
  31157. return -1;
  31158. i = e.length - 1
  31159. } else if (i < 0) {
  31160. if (!r)
  31161. return -1;
  31162. i = 0
  31163. }
  31164. if ("string" == typeof t && (t = a.from(t, n)),
  31165. a.isBuffer(t))
  31166. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31167. if ("number" == typeof t)
  31168. return t &= 255,
  31169. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  31170. throw new TypeError("val must be string, number or Buffer")
  31171. }
  31172. function I(e, t, i, n, r) {
  31173. function o(e, t) {
  31174. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31175. }
  31176. var a = 1
  31177. , s = e.length
  31178. , l = t.length;
  31179. if (void 0 !== n && (n = String(n).toLowerCase(),
  31180. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  31181. if (e.length < 2 || t.length < 2)
  31182. return -1;
  31183. a = 2,
  31184. s /= 2,
  31185. l /= 2,
  31186. i /= 2
  31187. }
  31188. var c;
  31189. if (r) {
  31190. var h = -1;
  31191. for (c = i; c < s; c++)
  31192. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31193. if (h === -1 && (h = c),
  31194. c - h + 1 === l)
  31195. return h * a
  31196. } else
  31197. h !== -1 && (c -= c - h),
  31198. h = -1
  31199. } else
  31200. for (i + l > s && (i = s - l),
  31201. c = i; c >= 0; c--) {
  31202. for (var u = !0, d = 0; d < l; d++)
  31203. if (o(e, c + d) !== o(t, d)) {
  31204. u = !1;
  31205. break
  31206. }
  31207. if (u)
  31208. return c
  31209. }
  31210. return -1
  31211. }
  31212. function E(e, t, i, n) {
  31213. i = Number(i) || 0;
  31214. var r = e.length - i;
  31215. n ? (n = Number(n),
  31216. n > r && (n = r)) : n = r;
  31217. var o = t.length;
  31218. if (o % 2 !== 0)
  31219. throw new TypeError("Invalid hex string");
  31220. n > o / 2 && (n = o / 2);
  31221. for (var a = 0; a < n; ++a) {
  31222. var s = parseInt(t.substr(2 * a, 2), 16);
  31223. if (isNaN(s))
  31224. return a;
  31225. e[i + a] = s
  31226. }
  31227. return a
  31228. }
  31229. function b(e, t, i, n) {
  31230. return q(j(t, e.length - i), e, i, n)
  31231. }
  31232. function w(e, t, i, n) {
  31233. return q(Y(t), e, i, n)
  31234. }
  31235. function _(e, t, i, n) {
  31236. return w(e, t, i, n)
  31237. }
  31238. function T(e, t, i, n) {
  31239. return q(Z(t), e, i, n)
  31240. }
  31241. function x(e, t, i, n) {
  31242. return q(X(t, e.length - i), e, i, n)
  31243. }
  31244. function S(e, t, i) {
  31245. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31246. }
  31247. function M(e, t, i) {
  31248. i = Math.min(e.length, i);
  31249. for (var n = [], r = t; r < i; ) {
  31250. var o = e[r]
  31251. , a = null
  31252. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  31253. if (r + s <= i) {
  31254. var l, c, h, u;
  31255. switch (s) {
  31256. case 1:
  31257. o < 128 && (a = o);
  31258. break;
  31259. case 2:
  31260. l = e[r + 1],
  31261. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  31262. u > 127 && (a = u));
  31263. break;
  31264. case 3:
  31265. l = e[r + 1],
  31266. c = e[r + 2],
  31267. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  31268. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  31269. break;
  31270. case 4:
  31271. l = e[r + 1],
  31272. c = e[r + 2],
  31273. h = e[r + 3],
  31274. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  31275. u > 65535 && u < 1114112 && (a = u))
  31276. }
  31277. }
  31278. null === a ? (a = 65533,
  31279. s = 1) : a > 65535 && (a -= 65536,
  31280. n.push(a >>> 10 & 1023 | 55296),
  31281. a = 56320 | 1023 & a),
  31282. n.push(a),
  31283. r += s
  31284. }
  31285. return R(n)
  31286. }
  31287. function R(e) {
  31288. var t = e.length;
  31289. if (t <= ee)
  31290. return String.fromCharCode.apply(String, e);
  31291. for (var i = "", n = 0; n < t; )
  31292. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  31293. return i
  31294. }
  31295. function P(e, t, i) {
  31296. var n = "";
  31297. i = Math.min(e.length, i);
  31298. for (var r = t; r < i; ++r)
  31299. n += String.fromCharCode(127 & e[r]);
  31300. return n
  31301. }
  31302. function O(e, t, i) {
  31303. var n = "";
  31304. i = Math.min(e.length, i);
  31305. for (var r = t; r < i; ++r)
  31306. n += String.fromCharCode(e[r]);
  31307. return n
  31308. }
  31309. function L(e, t, i) {
  31310. var n = e.length;
  31311. (!t || t < 0) && (t = 0),
  31312. (!i || i < 0 || i > n) && (i = n);
  31313. for (var r = "", o = t; o < i; ++o)
  31314. r += W(e[o]);
  31315. return r
  31316. }
  31317. function D(e, t, i) {
  31318. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  31319. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  31320. return r
  31321. }
  31322. function N(e, t, i) {
  31323. if (e % 1 !== 0 || e < 0)
  31324. throw new RangeError("offset is not uint");
  31325. if (e + t > i)
  31326. throw new RangeError("Trying to access beyond buffer length")
  31327. }
  31328. function B(e, t, i, n, r, o) {
  31329. if (!a.isBuffer(e))
  31330. throw new TypeError('"buffer" argument must be a Buffer instance');
  31331. if (t > r || t < o)
  31332. throw new RangeError('"value" argument is out of bounds');
  31333. if (i + n > e.length)
  31334. throw new RangeError("Index out of range")
  31335. }
  31336. function F(e, t, i, n) {
  31337. t < 0 && (t = 65535 + t + 1);
  31338. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  31339. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  31340. }
  31341. function V(e, t, i, n) {
  31342. t < 0 && (t = 4294967295 + t + 1);
  31343. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  31344. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  31345. }
  31346. function U(e, t, i, n, r, o) {
  31347. if (i + n > e.length)
  31348. throw new RangeError("Index out of range");
  31349. if (i < 0)
  31350. throw new RangeError("Index out of range")
  31351. }
  31352. function k(e, t, i, n, r) {
  31353. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  31354. J.write(e, t, i, n, 23, 4),
  31355. i + 4
  31356. }
  31357. function H(e, t, i, n, r) {
  31358. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  31359. J.write(e, t, i, n, 52, 8),
  31360. i + 8
  31361. }
  31362. function G(e) {
  31363. if (e = z(e).replace(te, ""),
  31364. e.length < 2)
  31365. return "";
  31366. for (; e.length % 4 !== 0; )
  31367. e += "=";
  31368. return e
  31369. }
  31370. function z(e) {
  31371. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  31372. }
  31373. function W(e) {
  31374. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  31375. }
  31376. function j(e, t) {
  31377. t = t || 1 / 0;
  31378. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31379. if (i = e.charCodeAt(a),
  31380. i > 55295 && i < 57344) {
  31381. if (!r) {
  31382. if (i > 56319) {
  31383. (t -= 3) > -1 && o.push(239, 191, 189);
  31384. continue
  31385. }
  31386. if (a + 1 === n) {
  31387. (t -= 3) > -1 && o.push(239, 191, 189);
  31388. continue
  31389. }
  31390. r = i;
  31391. continue
  31392. }
  31393. if (i < 56320) {
  31394. (t -= 3) > -1 && o.push(239, 191, 189),
  31395. r = i;
  31396. continue
  31397. }
  31398. i = (r - 55296 << 10 | i - 56320) + 65536
  31399. } else
  31400. r && (t -= 3) > -1 && o.push(239, 191, 189);
  31401. if (r = null,
  31402. i < 128) {
  31403. if ((t -= 1) < 0)
  31404. break;
  31405. o.push(i)
  31406. } else if (i < 2048) {
  31407. if ((t -= 2) < 0)
  31408. break;
  31409. o.push(i >> 6 | 192, 63 & i | 128)
  31410. } else if (i < 65536) {
  31411. if ((t -= 3) < 0)
  31412. break;
  31413. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  31414. } else {
  31415. if (!(i < 1114112))
  31416. throw new Error("Invalid code point");
  31417. if ((t -= 4) < 0)
  31418. break;
  31419. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  31420. }
  31421. }
  31422. return o
  31423. }
  31424. function Y(e) {
  31425. for (var t = [], i = 0; i < e.length; ++i)
  31426. t.push(255 & e.charCodeAt(i));
  31427. return t
  31428. }
  31429. function X(e, t) {
  31430. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  31431. i = e.charCodeAt(a),
  31432. n = i >> 8,
  31433. r = i % 256,
  31434. o.push(r),
  31435. o.push(n);
  31436. return o
  31437. }
  31438. function Z(e) {
  31439. return Q.toByteArray(G(e))
  31440. }
  31441. function q(e, t, i, n) {
  31442. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  31443. t[r + i] = e[r];
  31444. return r
  31445. }
  31446. function K(e) {
  31447. return e !== e
  31448. }
  31449. var Q = e("base64-js")
  31450. , J = e("ieee754")
  31451. , $ = e("isarray");
  31452. i.Buffer = a,
  31453. i.SlowBuffer = m,
  31454. i.INSPECT_MAX_BYTES = 50,
  31455. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  31456. i.kMaxLength = r(),
  31457. a.poolSize = 8192,
  31458. a._augment = function(e) {
  31459. return e.__proto__ = a.prototype,
  31460. e
  31461. }
  31462. ,
  31463. a.from = function(e, t, i) {
  31464. return s(null, e, t, i)
  31465. }
  31466. ,
  31467. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  31468. a.__proto__ = Uint8Array,
  31469. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  31470. value: null,
  31471. configurable: !0
  31472. })),
  31473. a.alloc = function(e, t, i) {
  31474. return c(null, e, t, i)
  31475. }
  31476. ,
  31477. a.allocUnsafe = function(e) {
  31478. return h(null, e)
  31479. }
  31480. ,
  31481. a.allocUnsafeSlow = function(e) {
  31482. return h(null, e)
  31483. }
  31484. ,
  31485. a.isBuffer = function(e) {
  31486. return !(null == e || !e._isBuffer)
  31487. }
  31488. ,
  31489. a.compare = function(e, t) {
  31490. if (!a.isBuffer(e) || !a.isBuffer(t))
  31491. throw new TypeError("Arguments must be Buffers");
  31492. if (e === t)
  31493. return 0;
  31494. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  31495. if (e[r] !== t[r]) {
  31496. i = e[r],
  31497. n = t[r];
  31498. break
  31499. }
  31500. return i < n ? -1 : n < i ? 1 : 0
  31501. }
  31502. ,
  31503. a.isEncoding = function(e) {
  31504. switch (String(e).toLowerCase()) {
  31505. case "hex":
  31506. case "utf8":
  31507. case "utf-8":
  31508. case "ascii":
  31509. case "latin1":
  31510. case "binary":
  31511. case "base64":
  31512. case "ucs2":
  31513. case "ucs-2":
  31514. case "utf16le":
  31515. case "utf-16le":
  31516. return !0;
  31517. default:
  31518. return !1
  31519. }
  31520. }
  31521. ,
  31522. a.concat = function(e, t) {
  31523. if (!$(e))
  31524. throw new TypeError('"list" argument must be an Array of Buffers');
  31525. if (0 === e.length)
  31526. return a.alloc(0);
  31527. var i;
  31528. if (void 0 === t)
  31529. for (t = 0,
  31530. i = 0; i < e.length; ++i)
  31531. t += e[i].length;
  31532. var n = a.allocUnsafe(t)
  31533. , r = 0;
  31534. for (i = 0; i < e.length; ++i) {
  31535. var o = e[i];
  31536. if (!a.isBuffer(o))
  31537. throw new TypeError('"list" argument must be an Array of Buffers');
  31538. o.copy(n, r),
  31539. r += o.length
  31540. }
  31541. return n
  31542. }
  31543. ,
  31544. a.byteLength = v,
  31545. a.prototype._isBuffer = !0,
  31546. a.prototype.swap16 = function() {
  31547. var e = this.length;
  31548. if (e % 2 !== 0)
  31549. throw new RangeError("Buffer size must be a multiple of 16-bits");
  31550. for (var t = 0; t < e; t += 2)
  31551. y(this, t, t + 1);
  31552. return this
  31553. }
  31554. ,
  31555. a.prototype.swap32 = function() {
  31556. var e = this.length;
  31557. if (e % 4 !== 0)
  31558. throw new RangeError("Buffer size must be a multiple of 32-bits");
  31559. for (var t = 0; t < e; t += 4)
  31560. y(this, t, t + 3),
  31561. y(this, t + 1, t + 2);
  31562. return this
  31563. }
  31564. ,
  31565. a.prototype.swap64 = function() {
  31566. var e = this.length;
  31567. if (e % 8 !== 0)
  31568. throw new RangeError("Buffer size must be a multiple of 64-bits");
  31569. for (var t = 0; t < e; t += 8)
  31570. y(this, t, t + 7),
  31571. y(this, t + 1, t + 6),
  31572. y(this, t + 2, t + 5),
  31573. y(this, t + 3, t + 4);
  31574. return this
  31575. }
  31576. ,
  31577. a.prototype.toString = function() {
  31578. var e = 0 | this.length;
  31579. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  31580. }
  31581. ,
  31582. a.prototype.equals = function(e) {
  31583. if (!a.isBuffer(e))
  31584. throw new TypeError("Argument must be a Buffer");
  31585. return this === e || 0 === a.compare(this, e)
  31586. }
  31587. ,
  31588. a.prototype.inspect = function() {
  31589. var e = ""
  31590. , t = i.INSPECT_MAX_BYTES;
  31591. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  31592. this.length > t && (e += " ... ")),
  31593. "<Buffer " + e + ">"
  31594. }
  31595. ,
  31596. a.prototype.compare = function(e, t, i, n, r) {
  31597. if (!a.isBuffer(e))
  31598. throw new TypeError("Argument must be a Buffer");
  31599. if (void 0 === t && (t = 0),
  31600. void 0 === i && (i = e ? e.length : 0),
  31601. void 0 === n && (n = 0),
  31602. void 0 === r && (r = this.length),
  31603. t < 0 || i > e.length || n < 0 || r > this.length)
  31604. throw new RangeError("out of range index");
  31605. if (n >= r && t >= i)
  31606. return 0;
  31607. if (n >= r)
  31608. return -1;
  31609. if (t >= i)
  31610. return 1;
  31611. if (t >>>= 0,
  31612. i >>>= 0,
  31613. n >>>= 0,
  31614. r >>>= 0,
  31615. this === e)
  31616. return 0;
  31617. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  31618. if (c[u] !== h[u]) {
  31619. o = c[u],
  31620. s = h[u];
  31621. break
  31622. }
  31623. return o < s ? -1 : s < o ? 1 : 0
  31624. }
  31625. ,
  31626. a.prototype.includes = function(e, t, i) {
  31627. return this.indexOf(e, t, i) !== -1
  31628. }
  31629. ,
  31630. a.prototype.indexOf = function(e, t, i) {
  31631. return C(this, e, t, i, !0)
  31632. }
  31633. ,
  31634. a.prototype.lastIndexOf = function(e, t, i) {
  31635. return C(this, e, t, i, !1)
  31636. }
  31637. ,
  31638. a.prototype.write = function(e, t, i, n) {
  31639. if (void 0 === t)
  31640. n = "utf8",
  31641. i = this.length,
  31642. t = 0;
  31643. else if (void 0 === i && "string" == typeof t)
  31644. n = t,
  31645. i = this.length,
  31646. t = 0;
  31647. else {
  31648. if (!isFinite(t))
  31649. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  31650. t |= 0,
  31651. isFinite(i) ? (i |= 0,
  31652. void 0 === n && (n = "utf8")) : (n = i,
  31653. i = void 0)
  31654. }
  31655. var r = this.length - t;
  31656. if ((void 0 === i || i > r) && (i = r),
  31657. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  31658. throw new RangeError("Attempt to write outside buffer bounds");
  31659. n || (n = "utf8");
  31660. for (var o = !1; ; )
  31661. switch (n) {
  31662. case "hex":
  31663. return E(this, e, t, i);
  31664. case "utf8":
  31665. case "utf-8":
  31666. return b(this, e, t, i);
  31667. case "ascii":
  31668. return w(this, e, t, i);
  31669. case "latin1":
  31670. case "binary":
  31671. return _(this, e, t, i);
  31672. case "base64":
  31673. return T(this, e, t, i);
  31674. case "ucs2":
  31675. case "ucs-2":
  31676. case "utf16le":
  31677. case "utf-16le":
  31678. return x(this, e, t, i);
  31679. default:
  31680. if (o)
  31681. throw new TypeError("Unknown encoding: " + n);
  31682. n = ("" + n).toLowerCase(),
  31683. o = !0
  31684. }
  31685. }
  31686. ,
  31687. a.prototype.toJSON = function() {
  31688. return {
  31689. type: "Buffer",
  31690. data: Array.prototype.slice.call(this._arr || this, 0)
  31691. }
  31692. }
  31693. ;
  31694. var ee = 4096;
  31695. a.prototype.slice = function(e, t) {
  31696. var i = this.length;
  31697. e = ~~e,
  31698. t = void 0 === t ? i : ~~t,
  31699. e < 0 ? (e += i,
  31700. e < 0 && (e = 0)) : e > i && (e = i),
  31701. t < 0 ? (t += i,
  31702. t < 0 && (t = 0)) : t > i && (t = i),
  31703. t < e && (t = e);
  31704. var n;
  31705. if (a.TYPED_ARRAY_SUPPORT)
  31706. n = this.subarray(e, t),
  31707. n.__proto__ = a.prototype;
  31708. else {
  31709. var r = t - e;
  31710. n = new a(r,void 0);
  31711. for (var o = 0; o < r; ++o)
  31712. n[o] = this[o + e]
  31713. }
  31714. return n
  31715. }
  31716. ,
  31717. a.prototype.readUIntLE = function(e, t, i) {
  31718. e |= 0,
  31719. t |= 0,
  31720. i || N(e, t, this.length);
  31721. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31722. n += this[e + o] * r;
  31723. return n
  31724. }
  31725. ,
  31726. a.prototype.readUIntBE = function(e, t, i) {
  31727. e |= 0,
  31728. t |= 0,
  31729. i || N(e, t, this.length);
  31730. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  31731. n += this[e + --t] * r;
  31732. return n
  31733. }
  31734. ,
  31735. a.prototype.readUInt8 = function(e, t) {
  31736. return t || N(e, 1, this.length),
  31737. this[e]
  31738. }
  31739. ,
  31740. a.prototype.readUInt16LE = function(e, t) {
  31741. return t || N(e, 2, this.length),
  31742. this[e] | this[e + 1] << 8
  31743. }
  31744. ,
  31745. a.prototype.readUInt16BE = function(e, t) {
  31746. return t || N(e, 2, this.length),
  31747. this[e] << 8 | this[e + 1]
  31748. }
  31749. ,
  31750. a.prototype.readUInt32LE = function(e, t) {
  31751. return t || N(e, 4, this.length),
  31752. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  31753. }
  31754. ,
  31755. a.prototype.readUInt32BE = function(e, t) {
  31756. return t || N(e, 4, this.length),
  31757. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  31758. }
  31759. ,
  31760. a.prototype.readIntLE = function(e, t, i) {
  31761. e |= 0,
  31762. t |= 0,
  31763. i || N(e, t, this.length);
  31764. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  31765. n += this[e + o] * r;
  31766. return r *= 128,
  31767. n >= r && (n -= Math.pow(2, 8 * t)),
  31768. n
  31769. }
  31770. ,
  31771. a.prototype.readIntBE = function(e, t, i) {
  31772. e |= 0,
  31773. t |= 0,
  31774. i || N(e, t, this.length);
  31775. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  31776. o += this[e + --n] * r;
  31777. return r *= 128,
  31778. o >= r && (o -= Math.pow(2, 8 * t)),
  31779. o
  31780. }
  31781. ,
  31782. a.prototype.readInt8 = function(e, t) {
  31783. return t || N(e, 1, this.length),
  31784. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  31785. }
  31786. ,
  31787. a.prototype.readInt16LE = function(e, t) {
  31788. t || N(e, 2, this.length);
  31789. var i = this[e] | this[e + 1] << 8;
  31790. return 32768 & i ? 4294901760 | i : i
  31791. }
  31792. ,
  31793. a.prototype.readInt16BE = function(e, t) {
  31794. t || N(e, 2, this.length);
  31795. var i = this[e + 1] | this[e] << 8;
  31796. return 32768 & i ? 4294901760 | i : i
  31797. }
  31798. ,
  31799. a.prototype.readInt32LE = function(e, t) {
  31800. return t || N(e, 4, this.length),
  31801. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  31802. }
  31803. ,
  31804. a.prototype.readInt32BE = function(e, t) {
  31805. return t || N(e, 4, this.length),
  31806. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  31807. }
  31808. ,
  31809. a.prototype.readFloatLE = function(e, t) {
  31810. return t || N(e, 4, this.length),
  31811. J.read(this, e, !0, 23, 4)
  31812. }
  31813. ,
  31814. a.prototype.readFloatBE = function(e, t) {
  31815. return t || N(e, 4, this.length),
  31816. J.read(this, e, !1, 23, 4)
  31817. }
  31818. ,
  31819. a.prototype.readDoubleLE = function(e, t) {
  31820. return t || N(e, 8, this.length),
  31821. J.read(this, e, !0, 52, 8)
  31822. }
  31823. ,
  31824. a.prototype.readDoubleBE = function(e, t) {
  31825. return t || N(e, 8, this.length),
  31826. J.read(this, e, !1, 52, 8)
  31827. }
  31828. ,
  31829. a.prototype.writeUIntLE = function(e, t, i, n) {
  31830. if (e = +e,
  31831. t |= 0,
  31832. i |= 0,
  31833. !n) {
  31834. var r = Math.pow(2, 8 * i) - 1;
  31835. B(this, e, t, i, r, 0)
  31836. }
  31837. var o = 1
  31838. , a = 0;
  31839. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  31840. this[t + a] = e / o & 255;
  31841. return t + i
  31842. }
  31843. ,
  31844. a.prototype.writeUIntBE = function(e, t, i, n) {
  31845. if (e = +e,
  31846. t |= 0,
  31847. i |= 0,
  31848. !n) {
  31849. var r = Math.pow(2, 8 * i) - 1;
  31850. B(this, e, t, i, r, 0)
  31851. }
  31852. var o = i - 1
  31853. , a = 1;
  31854. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31855. this[t + o] = e / a & 255;
  31856. return t + i
  31857. }
  31858. ,
  31859. a.prototype.writeUInt8 = function(e, t, i) {
  31860. return e = +e,
  31861. t |= 0,
  31862. i || B(this, e, t, 1, 255, 0),
  31863. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31864. this[t] = 255 & e,
  31865. t + 1
  31866. }
  31867. ,
  31868. a.prototype.writeUInt16LE = function(e, t, i) {
  31869. return e = +e,
  31870. t |= 0,
  31871. i || B(this, e, t, 2, 65535, 0),
  31872. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31873. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31874. t + 2
  31875. }
  31876. ,
  31877. a.prototype.writeUInt16BE = function(e, t, i) {
  31878. return e = +e,
  31879. t |= 0,
  31880. i || B(this, e, t, 2, 65535, 0),
  31881. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31882. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31883. t + 2
  31884. }
  31885. ,
  31886. a.prototype.writeUInt32LE = function(e, t, i) {
  31887. return e = +e,
  31888. t |= 0,
  31889. i || B(this, e, t, 4, 4294967295, 0),
  31890. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  31891. this[t + 2] = e >>> 16,
  31892. this[t + 1] = e >>> 8,
  31893. this[t] = 255 & e) : V(this, e, t, !0),
  31894. t + 4
  31895. }
  31896. ,
  31897. a.prototype.writeUInt32BE = function(e, t, i) {
  31898. return e = +e,
  31899. t |= 0,
  31900. i || B(this, e, t, 4, 4294967295, 0),
  31901. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31902. this[t + 1] = e >>> 16,
  31903. this[t + 2] = e >>> 8,
  31904. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31905. t + 4
  31906. }
  31907. ,
  31908. a.prototype.writeIntLE = function(e, t, i, n) {
  31909. if (e = +e,
  31910. t |= 0,
  31911. !n) {
  31912. var r = Math.pow(2, 8 * i - 1);
  31913. B(this, e, t, i, r - 1, -r)
  31914. }
  31915. var o = 0
  31916. , a = 1
  31917. , s = 0;
  31918. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  31919. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  31920. this[t + o] = (e / a >> 0) - s & 255;
  31921. return t + i
  31922. }
  31923. ,
  31924. a.prototype.writeIntBE = function(e, t, i, n) {
  31925. if (e = +e,
  31926. t |= 0,
  31927. !n) {
  31928. var r = Math.pow(2, 8 * i - 1);
  31929. B(this, e, t, i, r - 1, -r)
  31930. }
  31931. var o = i - 1
  31932. , a = 1
  31933. , s = 0;
  31934. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  31935. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  31936. this[t + o] = (e / a >> 0) - s & 255;
  31937. return t + i
  31938. }
  31939. ,
  31940. a.prototype.writeInt8 = function(e, t, i) {
  31941. return e = +e,
  31942. t |= 0,
  31943. i || B(this, e, t, 1, 127, -128),
  31944. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  31945. e < 0 && (e = 255 + e + 1),
  31946. this[t] = 255 & e,
  31947. t + 1
  31948. }
  31949. ,
  31950. a.prototype.writeInt16LE = function(e, t, i) {
  31951. return e = +e,
  31952. t |= 0,
  31953. i || B(this, e, t, 2, 32767, -32768),
  31954. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31955. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  31956. t + 2
  31957. }
  31958. ,
  31959. a.prototype.writeInt16BE = function(e, t, i) {
  31960. return e = +e,
  31961. t |= 0,
  31962. i || B(this, e, t, 2, 32767, -32768),
  31963. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  31964. this[t + 1] = 255 & e) : F(this, e, t, !1),
  31965. t + 2
  31966. }
  31967. ,
  31968. a.prototype.writeInt32LE = function(e, t, i) {
  31969. return e = +e,
  31970. t |= 0,
  31971. i || B(this, e, t, 4, 2147483647, -2147483648),
  31972. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  31973. this[t + 1] = e >>> 8,
  31974. this[t + 2] = e >>> 16,
  31975. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  31976. t + 4
  31977. }
  31978. ,
  31979. a.prototype.writeInt32BE = function(e, t, i) {
  31980. return e = +e,
  31981. t |= 0,
  31982. i || B(this, e, t, 4, 2147483647, -2147483648),
  31983. e < 0 && (e = 4294967295 + e + 1),
  31984. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  31985. this[t + 1] = e >>> 16,
  31986. this[t + 2] = e >>> 8,
  31987. this[t + 3] = 255 & e) : V(this, e, t, !1),
  31988. t + 4
  31989. }
  31990. ,
  31991. a.prototype.writeFloatLE = function(e, t, i) {
  31992. return k(this, e, t, !0, i)
  31993. }
  31994. ,
  31995. a.prototype.writeFloatBE = function(e, t, i) {
  31996. return k(this, e, t, !1, i)
  31997. }
  31998. ,
  31999. a.prototype.writeDoubleLE = function(e, t, i) {
  32000. return H(this, e, t, !0, i)
  32001. }
  32002. ,
  32003. a.prototype.writeDoubleBE = function(e, t, i) {
  32004. return H(this, e, t, !1, i)
  32005. }
  32006. ,
  32007. a.prototype.copy = function(e, t, i, n) {
  32008. if (i || (i = 0),
  32009. n || 0 === n || (n = this.length),
  32010. t >= e.length && (t = e.length),
  32011. t || (t = 0),
  32012. n > 0 && n < i && (n = i),
  32013. n === i)
  32014. return 0;
  32015. if (0 === e.length || 0 === this.length)
  32016. return 0;
  32017. if (t < 0)
  32018. throw new RangeError("targetStart out of bounds");
  32019. if (i < 0 || i >= this.length)
  32020. throw new RangeError("sourceStart out of bounds");
  32021. if (n < 0)
  32022. throw new RangeError("sourceEnd out of bounds");
  32023. n > this.length && (n = this.length),
  32024. e.length - t < n - i && (n = e.length - t + i);
  32025. var r, o = n - i;
  32026. if (this === e && i < t && t < n)
  32027. for (r = o - 1; r >= 0; --r)
  32028. e[r + t] = this[r + i];
  32029. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32030. for (r = 0; r < o; ++r)
  32031. e[r + t] = this[r + i];
  32032. else
  32033. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32034. return o
  32035. }
  32036. ,
  32037. a.prototype.fill = function(e, t, i, n) {
  32038. if ("string" == typeof e) {
  32039. if ("string" == typeof t ? (n = t,
  32040. t = 0,
  32041. i = this.length) : "string" == typeof i && (n = i,
  32042. i = this.length),
  32043. 1 === e.length) {
  32044. var r = e.charCodeAt(0);
  32045. r < 256 && (e = r)
  32046. }
  32047. if (void 0 !== n && "string" != typeof n)
  32048. throw new TypeError("encoding must be a string");
  32049. if ("string" == typeof n && !a.isEncoding(n))
  32050. throw new TypeError("Unknown encoding: " + n)
  32051. } else
  32052. "number" == typeof e && (e &= 255);
  32053. if (t < 0 || this.length < t || this.length < i)
  32054. throw new RangeError("Out of range index");
  32055. if (i <= t)
  32056. return this;
  32057. t >>>= 0,
  32058. i = void 0 === i ? this.length : i >>> 0,
  32059. e || (e = 0);
  32060. var o;
  32061. if ("number" == typeof e)
  32062. for (o = t; o < i; ++o)
  32063. this[o] = e;
  32064. else {
  32065. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32066. , l = s.length;
  32067. for (o = 0; o < i - t; ++o)
  32068. this[o + t] = s[o % l]
  32069. }
  32070. return this
  32071. }
  32072. ;
  32073. var te = /[^+\/0-9A-Za-z-_]/g
  32074. }
  32075. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32076. }
  32077. , {
  32078. "base64-js": 199,
  32079. ieee754: 200,
  32080. isarray: 201
  32081. }],
  32082. 199: [function(e, t, i) {
  32083. "use strict";
  32084. function n(e) {
  32085. var t = e.length;
  32086. if (t % 4 > 0)
  32087. throw new Error("Invalid string. Length must be a multiple of 4");
  32088. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32089. }
  32090. function r(e) {
  32091. return 3 * e.length / 4 - n(e)
  32092. }
  32093. function o(e) {
  32094. var t, i, r, o, a, s, l = e.length;
  32095. a = n(e),
  32096. s = new u(3 * l / 4 - a),
  32097. r = a > 0 ? l - 4 : l;
  32098. var c = 0;
  32099. for (t = 0,
  32100. i = 0; t < r; t += 4,
  32101. i += 3)
  32102. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32103. s[c++] = o >> 16 & 255,
  32104. s[c++] = o >> 8 & 255,
  32105. s[c++] = 255 & o;
  32106. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32107. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32108. s[c++] = o >> 8 & 255,
  32109. s[c++] = 255 & o),
  32110. s
  32111. }
  32112. function a(e) {
  32113. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32114. }
  32115. function s(e, t, i) {
  32116. for (var n, r = [], o = t; o < i; o += 3)
  32117. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32118. r.push(a(n));
  32119. return r.join("")
  32120. }
  32121. function l(e) {
  32122. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32123. o.push(s(e, l, l + a > h ? h : l + a));
  32124. return 1 === n ? (t = e[i - 1],
  32125. r += c[t >> 2],
  32126. r += c[t << 4 & 63],
  32127. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32128. r += c[t >> 10],
  32129. r += c[t >> 4 & 63],
  32130. r += c[t << 2 & 63],
  32131. r += "="),
  32132. o.push(r),
  32133. o.join("")
  32134. }
  32135. i.byteLength = r,
  32136. i.toByteArray = o,
  32137. i.fromByteArray = l;
  32138. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32139. c[p] = d[p],
  32140. h[d.charCodeAt(p)] = p;
  32141. h["-".charCodeAt(0)] = 62,
  32142. h["_".charCodeAt(0)] = 63
  32143. }
  32144. , {}],
  32145. 200: [function(e, t, i) {
  32146. i.read = function(e, t, i, n, r) {
  32147. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  32148. for (u += d,
  32149. o = p & (1 << -h) - 1,
  32150. p >>= -h,
  32151. h += s; h > 0; o = 256 * o + e[t + u],
  32152. u += d,
  32153. h -= 8)
  32154. ;
  32155. for (a = o & (1 << -h) - 1,
  32156. o >>= -h,
  32157. h += n; h > 0; a = 256 * a + e[t + u],
  32158. u += d,
  32159. h -= 8)
  32160. ;
  32161. if (0 === o)
  32162. o = 1 - c;
  32163. else {
  32164. if (o === l)
  32165. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32166. a += Math.pow(2, n),
  32167. o -= c
  32168. }
  32169. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32170. }
  32171. ,
  32172. i.write = function(e, t, i, n, r, o) {
  32173. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  32174. for (t = Math.abs(t),
  32175. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32176. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32177. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32178. l *= 2),
  32179. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  32180. t * l >= 2 && (a++,
  32181. l /= 2),
  32182. a + u >= h ? (s = 0,
  32183. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  32184. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  32185. a = 0)); r >= 8; e[i + p] = 255 & s,
  32186. p += f,
  32187. s /= 256,
  32188. r -= 8)
  32189. ;
  32190. for (a = a << r | s,
  32191. c += r; c > 0; e[i + p] = 255 & a,
  32192. p += f,
  32193. a /= 256,
  32194. c -= 8)
  32195. ;
  32196. e[i + p - f] |= 128 * g
  32197. }
  32198. }
  32199. , {}],
  32200. 201: [function(e, t, i) {
  32201. var n = {}.toString;
  32202. t.exports = Array.isArray || function(e) {
  32203. return "[object Array]" == n.call(e)
  32204. }
  32205. }
  32206. , {}],
  32207. 202: [function(e, t, i) {
  32208. function n() {
  32209. this._events = this._events || {},
  32210. this._maxListeners = this._maxListeners || void 0
  32211. }
  32212. function r(e) {
  32213. return "function" == typeof e
  32214. }
  32215. function o(e) {
  32216. return "number" == typeof e
  32217. }
  32218. function a(e) {
  32219. return "object" == typeof e && null !== e
  32220. }
  32221. function s(e) {
  32222. return void 0 === e
  32223. }
  32224. t.exports = n,
  32225. n.EventEmitter = n,
  32226. n.prototype._events = void 0,
  32227. n.prototype._maxListeners = void 0,
  32228. n.defaultMaxListeners = 10,
  32229. n.prototype.setMaxListeners = function(e) {
  32230. if (!o(e) || e < 0 || isNaN(e))
  32231. throw TypeError("n must be a positive number");
  32232. return this._maxListeners = e,
  32233. this
  32234. }
  32235. ,
  32236. n.prototype.emit = function(e) {
  32237. var t, i, n, o, l, c;
  32238. if (this._events || (this._events = {}),
  32239. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  32240. if (t = arguments[1],
  32241. t instanceof Error)
  32242. throw t;
  32243. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  32244. throw h.context = t,
  32245. h
  32246. }
  32247. if (i = this._events[e],
  32248. s(i))
  32249. return !1;
  32250. if (r(i))
  32251. switch (arguments.length) {
  32252. case 1:
  32253. i.call(this);
  32254. break;
  32255. case 2:
  32256. i.call(this, arguments[1]);
  32257. break;
  32258. case 3:
  32259. i.call(this, arguments[1], arguments[2]);
  32260. break;
  32261. default:
  32262. o = Array.prototype.slice.call(arguments, 1),
  32263. i.apply(this, o)
  32264. }
  32265. else if (a(i))
  32266. for (o = Array.prototype.slice.call(arguments, 1),
  32267. c = i.slice(),
  32268. n = c.length,
  32269. l = 0; l < n; l++)
  32270. c[l].apply(this, o);
  32271. return !0
  32272. }
  32273. ,
  32274. n.prototype.addListener = function(e, t) {
  32275. var i;
  32276. if (!r(t))
  32277. throw TypeError("listener must be a function");
  32278. return this._events || (this._events = {}),
  32279. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  32280. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  32281. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  32282. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  32283. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  32284. "function" == typeof console.trace && console.trace())),
  32285. this
  32286. }
  32287. ,
  32288. n.prototype.on = n.prototype.addListener,
  32289. n.prototype.once = function(e, t) {
  32290. function i() {
  32291. this.removeListener(e, i),
  32292. n || (n = !0,
  32293. t.apply(this, arguments))
  32294. }
  32295. if (!r(t))
  32296. throw TypeError("listener must be a function");
  32297. var n = !1;
  32298. return i.listener = t,
  32299. this.on(e, i),
  32300. this
  32301. }
  32302. ,
  32303. n.prototype.removeListener = function(e, t) {
  32304. var i, n, o, s;
  32305. if (!r(t))
  32306. throw TypeError("listener must be a function");
  32307. if (!this._events || !this._events[e])
  32308. return this;
  32309. if (i = this._events[e],
  32310. o = i.length,
  32311. n = -1,
  32312. i === t || r(i.listener) && i.listener === t)
  32313. delete this._events[e],
  32314. this._events.removeListener && this.emit("removeListener", e, t);
  32315. else if (a(i)) {
  32316. for (s = o; s-- > 0; )
  32317. if (i[s] === t || i[s].listener && i[s].listener === t) {
  32318. n = s;
  32319. break
  32320. }
  32321. if (n < 0)
  32322. return this;
  32323. 1 === i.length ? (i.length = 0,
  32324. delete this._events[e]) : i.splice(n, 1),
  32325. this._events.removeListener && this.emit("removeListener", e, t)
  32326. }
  32327. return this
  32328. }
  32329. ,
  32330. n.prototype.removeAllListeners = function(e) {
  32331. var t, i;
  32332. if (!this._events)
  32333. return this;
  32334. if (!this._events.removeListener)
  32335. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  32336. this;
  32337. if (0 === arguments.length) {
  32338. for (t in this._events)
  32339. "removeListener" !== t && this.removeAllListeners(t);
  32340. return this.removeAllListeners("removeListener"),
  32341. this._events = {},
  32342. this
  32343. }
  32344. if (i = this._events[e],
  32345. r(i))
  32346. this.removeListener(e, i);
  32347. else if (i)
  32348. for (; i.length; )
  32349. this.removeListener(e, i[i.length - 1]);
  32350. return delete this._events[e],
  32351. this
  32352. }
  32353. ,
  32354. n.prototype.listeners = function(e) {
  32355. var t;
  32356. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  32357. }
  32358. ,
  32359. n.prototype.listenerCount = function(e) {
  32360. if (this._events) {
  32361. var t = this._events[e];
  32362. if (r(t))
  32363. return 1;
  32364. if (t)
  32365. return t.length
  32366. }
  32367. return 0
  32368. }
  32369. ,
  32370. n.listenerCount = function(e, t) {
  32371. return e.listenerCount(t)
  32372. }
  32373. }
  32374. , {}],
  32375. 203: [function(e, t, i) {
  32376. function n() {
  32377. throw new Error("setTimeout has not been defined")
  32378. }
  32379. function r() {
  32380. throw new Error("clearTimeout has not been defined")
  32381. }
  32382. function o(e) {
  32383. if (u === setTimeout)
  32384. return setTimeout(e, 0);
  32385. if ((u === n || !u) && setTimeout)
  32386. return u = setTimeout,
  32387. setTimeout(e, 0);
  32388. try {
  32389. return u(e, 0)
  32390. } catch (t) {
  32391. try {
  32392. return u.call(null, e, 0)
  32393. } catch (t) {
  32394. return u.call(this, e, 0)
  32395. }
  32396. }
  32397. }
  32398. function a(e) {
  32399. if (d === clearTimeout)
  32400. return clearTimeout(e);
  32401. if ((d === r || !d) && clearTimeout)
  32402. return d = clearTimeout,
  32403. clearTimeout(e);
  32404. try {
  32405. return d(e)
  32406. } catch (t) {
  32407. try {
  32408. return d.call(null, e)
  32409. } catch (t) {
  32410. return d.call(this, e)
  32411. }
  32412. }
  32413. }
  32414. function s() {
  32415. m && f && (m = !1,
  32416. f.length ? g = f.concat(g) : v = -1,
  32417. g.length && l())
  32418. }
  32419. function l() {
  32420. if (!m) {
  32421. var e = o(s);
  32422. m = !0;
  32423. for (var t = g.length; t; ) {
  32424. for (f = g,
  32425. g = []; ++v < t; )
  32426. f && f[v].run();
  32427. v = -1,
  32428. t = g.length
  32429. }
  32430. f = null,
  32431. m = !1,
  32432. a(e)
  32433. }
  32434. }
  32435. function c(e, t) {
  32436. this.fun = e,
  32437. this.array = t
  32438. }
  32439. function h() {}
  32440. var u, d, p = t.exports = {};
  32441. !function() {
  32442. try {
  32443. u = "function" == typeof setTimeout ? setTimeout : n
  32444. } catch (e) {
  32445. u = n
  32446. }
  32447. try {
  32448. d = "function" == typeof clearTimeout ? clearTimeout : r
  32449. } catch (e) {
  32450. d = r
  32451. }
  32452. }();
  32453. var f, g = [], m = !1, v = -1;
  32454. p.nextTick = function(e) {
  32455. var t = new Array(arguments.length - 1);
  32456. if (arguments.length > 1)
  32457. for (var i = 1; i < arguments.length; i++)
  32458. t[i - 1] = arguments[i];
  32459. g.push(new c(e,t)),
  32460. 1 !== g.length || m || o(l)
  32461. }
  32462. ,
  32463. c.prototype.run = function() {
  32464. this.fun.apply(null, this.array)
  32465. }
  32466. ,
  32467. p.title = "browser",
  32468. p.browser = !0,
  32469. p.env = {},
  32470. p.argv = [],
  32471. p.version = "",
  32472. p.versions = {},
  32473. p.on = h,
  32474. p.addListener = h,
  32475. p.once = h,
  32476. p.off = h,
  32477. p.removeListener = h,
  32478. p.removeAllListeners = h,
  32479. p.emit = h,
  32480. p.binding = function(e) {
  32481. throw new Error("process.binding is not supported")
  32482. }
  32483. ,
  32484. p.cwd = function() {
  32485. return "/"
  32486. }
  32487. ,
  32488. p.chdir = function(e) {
  32489. throw new Error("process.chdir is not supported")
  32490. }
  32491. ,
  32492. p.umask = function() {
  32493. return 0
  32494. }
  32495. }
  32496. , {}],
  32497. 204: [function(e, t, i) {
  32498. (function(e) {
  32499. !function(n) {
  32500. function r(e) {
  32501. throw new RangeError(L[e])
  32502. }
  32503. function o(e, t) {
  32504. for (var i = e.length, n = []; i--; )
  32505. n[i] = t(e[i]);
  32506. return n
  32507. }
  32508. function a(e, t) {
  32509. var i = e.split("@")
  32510. , n = "";
  32511. i.length > 1 && (n = i[0] + "@",
  32512. e = i[1]),
  32513. e = e.replace(O, ".");
  32514. var r = e.split(".")
  32515. , a = o(r, t).join(".");
  32516. return n + a
  32517. }
  32518. function s(e) {
  32519. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  32520. t = e.charCodeAt(r++),
  32521. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  32522. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  32523. r--)) : n.push(t);
  32524. return n
  32525. }
  32526. function l(e) {
  32527. return o(e, function(e) {
  32528. var t = "";
  32529. return e > 65535 && (e -= 65536,
  32530. t += B(e >>> 10 & 1023 | 55296),
  32531. e = 56320 | 1023 & e),
  32532. t += B(e)
  32533. }).join("")
  32534. }
  32535. function c(e) {
  32536. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  32537. }
  32538. function h(e, t) {
  32539. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  32540. }
  32541. function u(e, t, i) {
  32542. var n = 0;
  32543. for (e = i ? N(e / T) : e >> 1,
  32544. e += N(e / t); e > D * w >> 1; n += E)
  32545. e = N(e / D);
  32546. return N(n + (D + 1) * e / (e + _))
  32547. }
  32548. function d(e) {
  32549. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  32550. for (i = e.lastIndexOf(M),
  32551. i < 0 && (i = 0),
  32552. n = 0; n < i; ++n)
  32553. e.charCodeAt(n) >= 128 && r("not-basic"),
  32554. g.push(e.charCodeAt(n));
  32555. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  32556. for (a = v,
  32557. s = 1,
  32558. h = E; o >= m && r("invalid-input"),
  32559. d = c(e.charCodeAt(o++)),
  32560. (d >= E || d > N((I - v) / s)) && r("overflow"),
  32561. v += d * s,
  32562. p = h <= y ? b : h >= y + w ? w : h - y,
  32563. !(d < p); h += E)
  32564. f = E - p,
  32565. s > N(I / f) && r("overflow"),
  32566. s *= f;
  32567. t = g.length + 1,
  32568. y = u(v - a, t, 0 == a),
  32569. N(v / t) > I - A && r("overflow"),
  32570. A += N(v / t),
  32571. v %= t,
  32572. g.splice(v++, 0, A)
  32573. }
  32574. return l(g)
  32575. }
  32576. function p(e) {
  32577. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  32578. for (e = s(e),
  32579. m = e.length,
  32580. t = S,
  32581. i = 0,
  32582. a = x,
  32583. l = 0; l < m; ++l)
  32584. g = e[l],
  32585. g < 128 && C.push(B(g));
  32586. for (n = o = C.length,
  32587. o && C.push(M); n < m; ) {
  32588. for (c = I,
  32589. l = 0; l < m; ++l)
  32590. g = e[l],
  32591. g >= t && g < c && (c = g);
  32592. for (v = n + 1,
  32593. c - t > N((I - i) / v) && r("overflow"),
  32594. i += (c - t) * v,
  32595. t = c,
  32596. l = 0; l < m; ++l)
  32597. if (g = e[l],
  32598. g < t && ++i > I && r("overflow"),
  32599. g == t) {
  32600. for (d = i,
  32601. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  32602. !(d < f); p += E)
  32603. y = d - f,
  32604. A = E - f,
  32605. C.push(B(h(f + y % A, 0))),
  32606. d = N(y / A);
  32607. C.push(B(h(d, 0))),
  32608. a = u(i, v, n == o),
  32609. i = 0,
  32610. ++n
  32611. }
  32612. ++i,
  32613. ++t
  32614. }
  32615. return C.join("")
  32616. }
  32617. function f(e) {
  32618. return a(e, function(e) {
  32619. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  32620. })
  32621. }
  32622. function g(e) {
  32623. return a(e, function(e) {
  32624. return P.test(e) ? "xn--" + p(e) : e
  32625. })
  32626. }
  32627. var m = "object" == typeof i && i && !i.nodeType && i
  32628. , v = "object" == typeof t && t && !t.nodeType && t
  32629. , A = "object" == typeof e && e;
  32630. A.global !== A && A.window !== A && A.self !== A || (n = A);
  32631. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  32632. overflow: "Overflow: input needs wider integers to process",
  32633. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  32634. "invalid-input": "Invalid input"
  32635. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  32636. if (y = {
  32637. version: "1.4.1",
  32638. ucs2: {
  32639. decode: s,
  32640. encode: l
  32641. },
  32642. decode: d,
  32643. encode: p,
  32644. toASCII: g,
  32645. toUnicode: f
  32646. },
  32647. "function" == typeof define && "object" == typeof define.amd && define.amd)
  32648. define("punycode", function() {
  32649. return y
  32650. });
  32651. else if (m && v)
  32652. if (t.exports == m)
  32653. v.exports = y;
  32654. else
  32655. for (C in y)
  32656. y.hasOwnProperty(C) && (m[C] = y[C]);
  32657. else
  32658. n.punycode = y
  32659. }(this)
  32660. }
  32661. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32662. }
  32663. , {}],
  32664. 205: [function(e, t, i) {
  32665. "use strict";
  32666. function n(e, t) {
  32667. return Object.prototype.hasOwnProperty.call(e, t)
  32668. }
  32669. t.exports = function(e, t, i, o) {
  32670. t = t || "&",
  32671. i = i || "=";
  32672. var a = {};
  32673. if ("string" != typeof e || 0 === e.length)
  32674. return a;
  32675. var s = /\+/g;
  32676. e = e.split(t);
  32677. var l = 1e3;
  32678. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  32679. var c = e.length;
  32680. l > 0 && c > l && (c = l);
  32681. for (var h = 0; h < c; ++h) {
  32682. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  32683. m >= 0 ? (u = g.substr(0, m),
  32684. d = g.substr(m + 1)) : (u = g,
  32685. d = ""),
  32686. p = decodeURIComponent(u),
  32687. f = decodeURIComponent(d),
  32688. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  32689. }
  32690. return a
  32691. }
  32692. ;
  32693. var r = Array.isArray || function(e) {
  32694. return "[object Array]" === Object.prototype.toString.call(e)
  32695. }
  32696. }
  32697. , {}],
  32698. 206: [function(e, t, i) {
  32699. "use strict";
  32700. function n(e, t) {
  32701. if (e.map)
  32702. return e.map(t);
  32703. for (var i = [], n = 0; n < e.length; n++)
  32704. i.push(t(e[n], n));
  32705. return i
  32706. }
  32707. var r = function(e) {
  32708. switch (typeof e) {
  32709. case "string":
  32710. return e;
  32711. case "boolean":
  32712. return e ? "true" : "false";
  32713. case "number":
  32714. return isFinite(e) ? e : "";
  32715. default:
  32716. return ""
  32717. }
  32718. };
  32719. t.exports = function(e, t, i, s) {
  32720. return t = t || "&",
  32721. i = i || "=",
  32722. null === e && (e = void 0),
  32723. "object" == typeof e ? n(a(e), function(a) {
  32724. var s = encodeURIComponent(r(a)) + i;
  32725. return o(e[a]) ? n(e[a], function(e) {
  32726. return s + encodeURIComponent(r(e))
  32727. }).join(t) : s + encodeURIComponent(r(e[a]))
  32728. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  32729. }
  32730. ;
  32731. var o = Array.isArray || function(e) {
  32732. return "[object Array]" === Object.prototype.toString.call(e)
  32733. }
  32734. , a = Object.keys || function(e) {
  32735. var t = [];
  32736. for (var i in e)
  32737. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  32738. return t
  32739. }
  32740. }
  32741. , {}],
  32742. 207: [function(e, t, i) {
  32743. "use strict";
  32744. i.decode = i.parse = e("./decode"),
  32745. i.encode = i.stringify = e("./encode")
  32746. }
  32747. , {
  32748. "./decode": 205,
  32749. "./encode": 206
  32750. }],
  32751. 208: [function(e, t, i) {
  32752. "use strict";
  32753. function n() {
  32754. this.protocol = null,
  32755. this.slashes = null,
  32756. this.auth = null,
  32757. this.host = null,
  32758. this.port = null,
  32759. this.hostname = null,
  32760. this.hash = null,
  32761. this.search = null,
  32762. this.query = null,
  32763. this.pathname = null,
  32764. this.path = null,
  32765. this.href = null
  32766. }
  32767. function r(e, t, i) {
  32768. if (e && c.isObject(e) && e instanceof n)
  32769. return e;
  32770. var r = new n;
  32771. return r.parse(e, t, i),
  32772. r
  32773. }
  32774. function o(e) {
  32775. return c.isString(e) && (e = r(e)),
  32776. e instanceof n ? e.format() : n.prototype.format.call(e)
  32777. }
  32778. function a(e, t) {
  32779. return r(e, !1, !0).resolve(t)
  32780. }
  32781. function s(e, t) {
  32782. return e ? r(e, !1, !0).resolveObject(t) : t
  32783. }
  32784. var l = e("punycode")
  32785. , c = e("./util");
  32786. i.parse = r,
  32787. i.resolve = a,
  32788. i.resolveObject = s,
  32789. i.format = o,
  32790. i.Url = n;
  32791. var h = /^([a-z0-9.+-]+:)/i
  32792. , u = /:[0-9]*$/
  32793. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  32794. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  32795. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  32796. , g = ["'"].concat(f)
  32797. , m = ["%", "/", "?", ";", "#"].concat(g)
  32798. , v = ["/", "?", "#"]
  32799. , A = 255
  32800. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  32801. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  32802. , I = {
  32803. javascript: !0,
  32804. "javascript:": !0
  32805. }
  32806. , E = {
  32807. javascript: !0,
  32808. "javascript:": !0
  32809. }
  32810. , b = {
  32811. http: !0,
  32812. https: !0,
  32813. ftp: !0,
  32814. gopher: !0,
  32815. file: !0,
  32816. "http:": !0,
  32817. "https:": !0,
  32818. "ftp:": !0,
  32819. "gopher:": !0,
  32820. "file:": !0
  32821. }
  32822. , w = e("querystring");
  32823. n.prototype.parse = function(e, t, i) {
  32824. if (!c.isString(e))
  32825. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  32826. var n = e.indexOf("?")
  32827. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  32828. , o = e.split(r)
  32829. , a = /\\/g;
  32830. o[0] = o[0].replace(a, "/"),
  32831. e = o.join(r);
  32832. var s = e;
  32833. if (s = s.trim(),
  32834. !i && 1 === e.split("#").length) {
  32835. var u = d.exec(s);
  32836. if (u)
  32837. return this.path = s,
  32838. this.href = s,
  32839. this.pathname = u[1],
  32840. u[2] ? (this.search = u[2],
  32841. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  32842. this.query = {}),
  32843. this
  32844. }
  32845. var p = h.exec(s);
  32846. if (p) {
  32847. p = p[0];
  32848. var f = p.toLowerCase();
  32849. this.protocol = f,
  32850. s = s.substr(p.length)
  32851. }
  32852. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  32853. var _ = "//" === s.substr(0, 2);
  32854. !_ || p && E[p] || (s = s.substr(2),
  32855. this.slashes = !0)
  32856. }
  32857. if (!E[p] && (_ || p && !b[p])) {
  32858. for (var T = -1, x = 0; x < v.length; x++) {
  32859. var S = s.indexOf(v[x]);
  32860. S !== -1 && (T === -1 || S < T) && (T = S)
  32861. }
  32862. var M, R;
  32863. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  32864. R !== -1 && (M = s.slice(0, R),
  32865. s = s.slice(R + 1),
  32866. this.auth = decodeURIComponent(M)),
  32867. T = -1;
  32868. for (var x = 0; x < m.length; x++) {
  32869. var S = s.indexOf(m[x]);
  32870. S !== -1 && (T === -1 || S < T) && (T = S)
  32871. }
  32872. T === -1 && (T = s.length),
  32873. this.host = s.slice(0, T),
  32874. s = s.slice(T),
  32875. this.parseHost(),
  32876. this.hostname = this.hostname || "";
  32877. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  32878. if (!P)
  32879. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  32880. var D = O[x];
  32881. if (D && !D.match(y)) {
  32882. for (var N = "", B = 0, F = D.length; B < F; B++)
  32883. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  32884. if (!N.match(y)) {
  32885. var V = O.slice(0, x)
  32886. , U = O.slice(x + 1)
  32887. , k = D.match(C);
  32888. k && (V.push(k[1]),
  32889. U.unshift(k[2])),
  32890. U.length && (s = "/" + U.join(".") + s),
  32891. this.hostname = V.join(".");
  32892. break
  32893. }
  32894. }
  32895. }
  32896. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  32897. P || (this.hostname = l.toASCII(this.hostname));
  32898. var H = this.port ? ":" + this.port : ""
  32899. , G = this.hostname || "";
  32900. this.host = G + H,
  32901. this.href += this.host,
  32902. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  32903. "/" !== s[0] && (s = "/" + s))
  32904. }
  32905. if (!I[f])
  32906. for (var x = 0, L = g.length; x < L; x++) {
  32907. var z = g[x];
  32908. if (s.indexOf(z) !== -1) {
  32909. var W = encodeURIComponent(z);
  32910. W === z && (W = escape(z)),
  32911. s = s.split(z).join(W)
  32912. }
  32913. }
  32914. var j = s.indexOf("#");
  32915. j !== -1 && (this.hash = s.substr(j),
  32916. s = s.slice(0, j));
  32917. var Y = s.indexOf("?");
  32918. if (Y !== -1 ? (this.search = s.substr(Y),
  32919. this.query = s.substr(Y + 1),
  32920. t && (this.query = w.parse(this.query)),
  32921. s = s.slice(0, Y)) : t && (this.search = "",
  32922. this.query = {}),
  32923. s && (this.pathname = s),
  32924. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  32925. this.pathname || this.search) {
  32926. var H = this.pathname || ""
  32927. , X = this.search || "";
  32928. this.path = H + X
  32929. }
  32930. return this.href = this.format(),
  32931. this
  32932. }
  32933. ,
  32934. n.prototype.format = function() {
  32935. var e = this.auth || "";
  32936. e && (e = encodeURIComponent(e),
  32937. e = e.replace(/%3A/i, ":"),
  32938. e += "@");
  32939. var t = this.protocol || ""
  32940. , i = this.pathname || ""
  32941. , n = this.hash || ""
  32942. , r = !1
  32943. , o = "";
  32944. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  32945. this.port && (r += ":" + this.port)),
  32946. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  32947. var a = this.search || o && "?" + o || "";
  32948. return t && ":" !== t.substr(-1) && (t += ":"),
  32949. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  32950. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  32951. n && "#" !== n.charAt(0) && (n = "#" + n),
  32952. a && "?" !== a.charAt(0) && (a = "?" + a),
  32953. i = i.replace(/[?#]/g, function(e) {
  32954. return encodeURIComponent(e)
  32955. }),
  32956. a = a.replace("#", "%23"),
  32957. t + r + i + a + n
  32958. }
  32959. ,
  32960. n.prototype.resolve = function(e) {
  32961. return this.resolveObject(r(e, !1, !0)).format()
  32962. }
  32963. ,
  32964. n.prototype.resolveObject = function(e) {
  32965. if (c.isString(e)) {
  32966. var t = new n;
  32967. t.parse(e, !1, !0),
  32968. e = t
  32969. }
  32970. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  32971. var a = r[o];
  32972. i[a] = this[a]
  32973. }
  32974. if (i.hash = e.hash,
  32975. "" === e.href)
  32976. return i.href = i.format(),
  32977. i;
  32978. if (e.slashes && !e.protocol) {
  32979. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  32980. var h = s[l];
  32981. "protocol" !== h && (i[h] = e[h])
  32982. }
  32983. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  32984. i.href = i.format(),
  32985. i
  32986. }
  32987. if (e.protocol && e.protocol !== i.protocol) {
  32988. if (!b[e.protocol]) {
  32989. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  32990. var p = u[d];
  32991. i[p] = e[p]
  32992. }
  32993. return i.href = i.format(),
  32994. i
  32995. }
  32996. if (i.protocol = e.protocol,
  32997. e.host || E[e.protocol])
  32998. i.pathname = e.pathname;
  32999. else {
  33000. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33001. ;
  33002. e.host || (e.host = ""),
  33003. e.hostname || (e.hostname = ""),
  33004. "" !== f[0] && f.unshift(""),
  33005. f.length < 2 && f.unshift(""),
  33006. i.pathname = f.join("/")
  33007. }
  33008. if (i.search = e.search,
  33009. i.query = e.query,
  33010. i.host = e.host || "",
  33011. i.auth = e.auth,
  33012. i.hostname = e.hostname || e.host,
  33013. i.port = e.port,
  33014. i.pathname || i.search) {
  33015. var g = i.pathname || ""
  33016. , m = i.search || "";
  33017. i.path = g + m
  33018. }
  33019. return i.slashes = i.slashes || e.slashes,
  33020. i.href = i.format(),
  33021. i
  33022. }
  33023. var v = i.pathname && "/" === i.pathname.charAt(0)
  33024. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33025. , y = A || v || i.host && e.pathname
  33026. , C = y
  33027. , I = i.pathname && i.pathname.split("/") || []
  33028. , f = e.pathname && e.pathname.split("/") || []
  33029. , w = i.protocol && !b[i.protocol];
  33030. if (w && (i.hostname = "",
  33031. i.port = null,
  33032. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33033. i.host = "",
  33034. e.protocol && (e.hostname = null,
  33035. e.port = null,
  33036. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33037. e.host = null),
  33038. y = y && ("" === f[0] || "" === I[0])),
  33039. A)
  33040. i.host = e.host || "" === e.host ? e.host : i.host,
  33041. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33042. i.search = e.search,
  33043. i.query = e.query,
  33044. I = f;
  33045. else if (f.length)
  33046. I || (I = []),
  33047. I.pop(),
  33048. I = I.concat(f),
  33049. i.search = e.search,
  33050. i.query = e.query;
  33051. else if (!c.isNullOrUndefined(e.search)) {
  33052. if (w) {
  33053. i.hostname = i.host = I.shift();
  33054. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33055. _ && (i.auth = _.shift(),
  33056. i.host = i.hostname = _.shift())
  33057. }
  33058. return i.search = e.search,
  33059. i.query = e.query,
  33060. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33061. i.href = i.format(),
  33062. i
  33063. }
  33064. if (!I.length)
  33065. return i.pathname = null,
  33066. i.search ? i.path = "/" + i.search : i.path = null,
  33067. i.href = i.format(),
  33068. i;
  33069. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  33070. T = I[M],
  33071. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33072. S++) : S && (I.splice(M, 1),
  33073. S--);
  33074. if (!y && !C)
  33075. for (; S--; S)
  33076. I.unshift("..");
  33077. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33078. x && "/" !== I.join("/").substr(-1) && I.push("");
  33079. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33080. if (w) {
  33081. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33082. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33083. _ && (i.auth = _.shift(),
  33084. i.host = i.hostname = _.shift())
  33085. }
  33086. return y = y || i.host && I.length,
  33087. y && !R && I.unshift(""),
  33088. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33089. i.path = null),
  33090. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33091. i.auth = e.auth || i.auth,
  33092. i.slashes = i.slashes || e.slashes,
  33093. i.href = i.format(),
  33094. i
  33095. }
  33096. ,
  33097. n.prototype.parseHost = function() {
  33098. var e = this.host
  33099. , t = u.exec(e);
  33100. t && (t = t[0],
  33101. ":" !== t && (this.port = t.substr(1)),
  33102. e = e.substr(0, e.length - t.length)),
  33103. e && (this.hostname = e)
  33104. }
  33105. }
  33106. , {
  33107. "./util": 209,
  33108. punycode: 204,
  33109. querystring: 207
  33110. }],
  33111. 209: [function(e, t, i) {
  33112. "use strict";
  33113. t.exports = {
  33114. isString: function(e) {
  33115. return "string" == typeof e
  33116. },
  33117. isObject: function(e) {
  33118. return "object" == typeof e && null !== e
  33119. },
  33120. isNull: function(e) {
  33121. return null === e
  33122. },
  33123. isNullOrUndefined: function(e) {
  33124. return null == e
  33125. }
  33126. }
  33127. }
  33128. , {}],
  33129. 210: [function(e, t, i) {
  33130. "use strict";
  33131. function n(e) {
  33132. return l + e
  33133. }
  33134. function r(e) {
  33135. return e.substring(l.length)
  33136. }
  33137. function o(e, t) {
  33138. for (var i in t)
  33139. Object.defineProperty(e, i, {
  33140. value: t[i],
  33141. configurable: !0,
  33142. writable: !0
  33143. })
  33144. }
  33145. function a(e) {
  33146. if ("string" != typeof e)
  33147. throw new TypeError("key must be a string.")
  33148. }
  33149. var s = Object.prototype.hasOwnProperty
  33150. , l = "~";
  33151. t.exports = function(e) {
  33152. var t = Object.create(null)
  33153. , i = 0
  33154. , l = {};
  33155. return o(l, {
  33156. get: function(e, i) {
  33157. a(e);
  33158. var r = n(e);
  33159. return r in t ? t[r] : i
  33160. },
  33161. set: function(e, r) {
  33162. a(e);
  33163. var o = n(e);
  33164. return o in t || ++i,
  33165. t[o] = r
  33166. },
  33167. has: function(e) {
  33168. return a(e),
  33169. n(e)in t
  33170. },
  33171. delete: function(e) {
  33172. a(e);
  33173. var r = n(e);
  33174. return r in t && (--i,
  33175. delete t[r],
  33176. !0)
  33177. },
  33178. clear: function() {
  33179. t = Object.create(null),
  33180. i = 0
  33181. },
  33182. forEach: function(e, i) {
  33183. if ("function" != typeof e)
  33184. throw new TypeError("`callback` must be a function");
  33185. for (var n in t)
  33186. if (s.call(t, n)) {
  33187. var o = r(n)
  33188. , a = t[n];
  33189. e.call(i, a, o, l)
  33190. }
  33191. }
  33192. }),
  33193. Object.defineProperty(l, "size", {
  33194. get: function() {
  33195. return i
  33196. },
  33197. configurable: !0
  33198. }),
  33199. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  33200. l.set(t, e[t])
  33201. }),
  33202. l
  33203. }
  33204. }
  33205. , {}],
  33206. 211: [function(e, t, i) {
  33207. t.exports = e("./lib/heap")
  33208. }
  33209. , {
  33210. "./lib/heap": 212
  33211. }],
  33212. 212: [function(e, t, i) {
  33213. (function() {
  33214. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  33215. r = Math.floor,
  33216. u = Math.min,
  33217. n = function(e, t) {
  33218. return e < t ? -1 : e > t ? 1 : 0
  33219. }
  33220. ,
  33221. h = function(e, t, i, o, a) {
  33222. var s;
  33223. if (null == i && (i = 0),
  33224. null == a && (a = n),
  33225. i < 0)
  33226. throw new Error("lo must be non-negative");
  33227. for (null == o && (o = e.length); i < o; )
  33228. s = r((i + o) / 2),
  33229. a(t, e[s]) < 0 ? o = s : i = s + 1;
  33230. return [].splice.apply(e, [i, i - i].concat(t)),
  33231. t
  33232. }
  33233. ,
  33234. s = function(e, t, i) {
  33235. return null == i && (i = n),
  33236. e.push(t),
  33237. g(e, 0, e.length - 1, i)
  33238. }
  33239. ,
  33240. a = function(e, t) {
  33241. var i, r;
  33242. return null == t && (t = n),
  33243. i = e.pop(),
  33244. e.length ? (r = e[0],
  33245. e[0] = i,
  33246. m(e, 0, t)) : r = i,
  33247. r
  33248. }
  33249. ,
  33250. c = function(e, t, i) {
  33251. var r;
  33252. return null == i && (i = n),
  33253. r = e[0],
  33254. e[0] = t,
  33255. m(e, 0, i),
  33256. r
  33257. }
  33258. ,
  33259. l = function(e, t, i) {
  33260. var r;
  33261. return null == i && (i = n),
  33262. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  33263. t = r[0],
  33264. e[0] = r[1],
  33265. m(e, 0, i)),
  33266. t
  33267. }
  33268. ,
  33269. o = function(e, t) {
  33270. var i, o, a, s, l, c;
  33271. for (null == t && (t = n),
  33272. s = function() {
  33273. c = [];
  33274. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  33275. c.push(t);
  33276. return c
  33277. }
  33278. .apply(this).reverse(),
  33279. l = [],
  33280. o = 0,
  33281. a = s.length; o < a; o++)
  33282. i = s[o],
  33283. l.push(m(e, i, t));
  33284. return l
  33285. }
  33286. ,
  33287. f = function(e, t, i) {
  33288. var r;
  33289. if (null == i && (i = n),
  33290. r = e.indexOf(t),
  33291. r !== -1)
  33292. return g(e, 0, r, i),
  33293. m(e, r, i)
  33294. }
  33295. ,
  33296. d = function(e, t, i) {
  33297. var r, a, s, c, h;
  33298. if (null == i && (i = n),
  33299. a = e.slice(0, t),
  33300. !a.length)
  33301. return a;
  33302. for (o(a, i),
  33303. h = e.slice(t),
  33304. s = 0,
  33305. c = h.length; s < c; s++)
  33306. r = h[s],
  33307. l(a, r, i);
  33308. return a.sort(i).reverse()
  33309. }
  33310. ,
  33311. p = function(e, t, i) {
  33312. var r, s, l, c, d, p, f, g, m, v;
  33313. if (null == i && (i = n),
  33314. 10 * t <= e.length) {
  33315. if (c = e.slice(0, t).sort(i),
  33316. !c.length)
  33317. return c;
  33318. for (l = c[c.length - 1],
  33319. g = e.slice(t),
  33320. d = 0,
  33321. f = g.length; d < f; d++)
  33322. r = g[d],
  33323. i(r, l) < 0 && (h(c, r, 0, null, i),
  33324. c.pop(),
  33325. l = c[c.length - 1]);
  33326. return c
  33327. }
  33328. for (o(e, i),
  33329. v = [],
  33330. s = p = 0,
  33331. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  33332. v.push(a(e, i));
  33333. return v
  33334. }
  33335. ,
  33336. g = function(e, t, i, r) {
  33337. var o, a, s;
  33338. for (null == r && (r = n),
  33339. o = e[i]; i > t && (s = i - 1 >> 1,
  33340. a = e[s],
  33341. r(o, a) < 0); )
  33342. e[i] = a,
  33343. i = s;
  33344. return e[i] = o
  33345. }
  33346. ,
  33347. m = function(e, t, i) {
  33348. var r, o, a, s, l;
  33349. for (null == i && (i = n),
  33350. o = e.length,
  33351. l = t,
  33352. a = e[t],
  33353. r = 2 * t + 1; r < o; )
  33354. s = r + 1,
  33355. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  33356. e[t] = e[r],
  33357. t = r,
  33358. r = 2 * t + 1;
  33359. return e[t] = a,
  33360. g(e, l, t, i)
  33361. }
  33362. ,
  33363. e = function() {
  33364. function e(e) {
  33365. this.cmp = null != e ? e : n,
  33366. this.nodes = []
  33367. }
  33368. return e.push = s,
  33369. e.pop = a,
  33370. e.replace = c,
  33371. e.pushpop = l,
  33372. e.heapify = o,
  33373. e.updateItem = f,
  33374. e.nlargest = d,
  33375. e.nsmallest = p,
  33376. e.prototype.push = function(e) {
  33377. return s(this.nodes, e, this.cmp)
  33378. }
  33379. ,
  33380. e.prototype.pop = function() {
  33381. return a(this.nodes, this.cmp)
  33382. }
  33383. ,
  33384. e.prototype.peek = function() {
  33385. return this.nodes[0]
  33386. }
  33387. ,
  33388. e.prototype.contains = function(e) {
  33389. return this.nodes.indexOf(e) !== -1
  33390. }
  33391. ,
  33392. e.prototype.replace = function(e) {
  33393. return c(this.nodes, e, this.cmp)
  33394. }
  33395. ,
  33396. e.prototype.pushpop = function(e) {
  33397. return l(this.nodes, e, this.cmp)
  33398. }
  33399. ,
  33400. e.prototype.heapify = function() {
  33401. return o(this.nodes, this.cmp)
  33402. }
  33403. ,
  33404. e.prototype.updateItem = function(e) {
  33405. return f(this.nodes, e, this.cmp)
  33406. }
  33407. ,
  33408. e.prototype.clear = function() {
  33409. return this.nodes = []
  33410. }
  33411. ,
  33412. e.prototype.empty = function() {
  33413. return 0 === this.nodes.length
  33414. }
  33415. ,
  33416. e.prototype.size = function() {
  33417. return this.nodes.length
  33418. }
  33419. ,
  33420. e.prototype.clone = function() {
  33421. var t;
  33422. return t = new e,
  33423. t.nodes = this.nodes.slice(0),
  33424. t
  33425. }
  33426. ,
  33427. e.prototype.toArray = function() {
  33428. return this.nodes.slice(0)
  33429. }
  33430. ,
  33431. e.prototype.insert = e.prototype.push,
  33432. e.prototype.top = e.prototype.peek,
  33433. e.prototype.front = e.prototype.peek,
  33434. e.prototype.has = e.prototype.contains,
  33435. e.prototype.copy = e.prototype.clone,
  33436. e
  33437. }(),
  33438. function(e, n) {
  33439. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  33440. }(this, function() {
  33441. return e
  33442. })
  33443. }
  33444. ).call(this)
  33445. }
  33446. , {}],
  33447. 213: [function(e, t, i) {
  33448. !function(e) {
  33449. function i() {}
  33450. function n(e, t) {
  33451. return function() {
  33452. e.apply(t, arguments)
  33453. }
  33454. }
  33455. function r(e) {
  33456. if ("object" != typeof this)
  33457. throw new TypeError("Promises must be constructed via new");
  33458. if ("function" != typeof e)
  33459. throw new TypeError("not a function");
  33460. this._state = 0,
  33461. this._handled = !1,
  33462. this._value = void 0,
  33463. this._deferreds = [],
  33464. h(e, this)
  33465. }
  33466. function o(e, t) {
  33467. for (; 3 === e._state; )
  33468. e = e._value;
  33469. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  33470. void r._immediateFn(function() {
  33471. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  33472. if (null === i)
  33473. return void (1 === e._state ? a : s)(t.promise, e._value);
  33474. var n;
  33475. try {
  33476. n = i(e._value)
  33477. } catch (e) {
  33478. return void s(t.promise, e)
  33479. }
  33480. a(t.promise, n)
  33481. }))
  33482. }
  33483. function a(e, t) {
  33484. try {
  33485. if (t === e)
  33486. throw new TypeError("A promise cannot be resolved with itself.");
  33487. if (t && ("object" == typeof t || "function" == typeof t)) {
  33488. var i = t.then;
  33489. if (t instanceof r)
  33490. return e._state = 3,
  33491. e._value = t,
  33492. void l(e);
  33493. if ("function" == typeof i)
  33494. return void h(n(i, t), e)
  33495. }
  33496. e._state = 1,
  33497. e._value = t,
  33498. l(e)
  33499. } catch (t) {
  33500. s(e, t)
  33501. }
  33502. }
  33503. function s(e, t) {
  33504. e._state = 2,
  33505. e._value = t,
  33506. l(e)
  33507. }
  33508. function l(e) {
  33509. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  33510. e._handled || r._unhandledRejectionFn(e._value)
  33511. });
  33512. for (var t = 0, i = e._deferreds.length; t < i; t++)
  33513. o(e, e._deferreds[t]);
  33514. e._deferreds = null
  33515. }
  33516. function c(e, t, i) {
  33517. this.onFulfilled = "function" == typeof e ? e : null,
  33518. this.onRejected = "function" == typeof t ? t : null,
  33519. this.promise = i
  33520. }
  33521. function h(e, t) {
  33522. var i = !1;
  33523. try {
  33524. e(function(e) {
  33525. i || (i = !0,
  33526. a(t, e))
  33527. }, function(e) {
  33528. i || (i = !0,
  33529. s(t, e))
  33530. })
  33531. } catch (e) {
  33532. if (i)
  33533. return;
  33534. i = !0,
  33535. s(t, e)
  33536. }
  33537. }
  33538. var u = setTimeout;
  33539. r.prototype.catch = function(e) {
  33540. return this.then(null, e)
  33541. }
  33542. ,
  33543. r.prototype.then = function(e, t) {
  33544. var n = new this.constructor(i);
  33545. return o(this, new c(e,t,n)),
  33546. n
  33547. }
  33548. ,
  33549. r.all = function(e) {
  33550. var t = Array.prototype.slice.call(e);
  33551. return new r(function(e, i) {
  33552. function n(o, a) {
  33553. try {
  33554. if (a && ("object" == typeof a || "function" == typeof a)) {
  33555. var s = a.then;
  33556. if ("function" == typeof s)
  33557. return void s.call(a, function(e) {
  33558. n(o, e)
  33559. }, i)
  33560. }
  33561. t[o] = a,
  33562. 0 === --r && e(t)
  33563. } catch (e) {
  33564. i(e)
  33565. }
  33566. }
  33567. if (0 === t.length)
  33568. return e([]);
  33569. for (var r = t.length, o = 0; o < t.length; o++)
  33570. n(o, t[o])
  33571. }
  33572. )
  33573. }
  33574. ,
  33575. r.resolve = function(e) {
  33576. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  33577. t(e)
  33578. }
  33579. )
  33580. }
  33581. ,
  33582. r.reject = function(e) {
  33583. return new r(function(t, i) {
  33584. i(e)
  33585. }
  33586. )
  33587. }
  33588. ,
  33589. r.race = function(e) {
  33590. return new r(function(t, i) {
  33591. for (var n = 0, r = e.length; n < r; n++)
  33592. e[n].then(t, i)
  33593. }
  33594. )
  33595. }
  33596. ,
  33597. r._immediateFn = "function" == typeof setImmediate && function(e) {
  33598. setImmediate(e)
  33599. }
  33600. || function(e) {
  33601. u(e, 0)
  33602. }
  33603. ,
  33604. r._unhandledRejectionFn = function(e) {
  33605. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  33606. }
  33607. ,
  33608. r._setImmediateFn = function(e) {
  33609. r._immediateFn = e
  33610. }
  33611. ,
  33612. r._setUnhandledRejectionFn = function(e) {
  33613. r._unhandledRejectionFn = e
  33614. }
  33615. ,
  33616. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  33617. }(this)
  33618. }
  33619. , {}],
  33620. 214: [function(e, t, i) {
  33621. (function(i) {
  33622. !function(i, n) {
  33623. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  33624. }(this, function(t, n) {
  33625. "use strict";
  33626. var r = {};
  33627. return r.ByteBuffer = t,
  33628. r.Long = t.Long || null,
  33629. r.VERSION = "5.0.1",
  33630. r.WIRE_TYPES = {},
  33631. r.WIRE_TYPES.VARINT = 0,
  33632. r.WIRE_TYPES.BITS64 = 1,
  33633. r.WIRE_TYPES.LDELIM = 2,
  33634. r.WIRE_TYPES.STARTGROUP = 3,
  33635. r.WIRE_TYPES.ENDGROUP = 4,
  33636. r.WIRE_TYPES.BITS32 = 5,
  33637. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  33638. r.TYPES = {
  33639. int32: {
  33640. name: "int32",
  33641. wireType: r.WIRE_TYPES.VARINT,
  33642. defaultValue: 0
  33643. },
  33644. uint32: {
  33645. name: "uint32",
  33646. wireType: r.WIRE_TYPES.VARINT,
  33647. defaultValue: 0
  33648. },
  33649. sint32: {
  33650. name: "sint32",
  33651. wireType: r.WIRE_TYPES.VARINT,
  33652. defaultValue: 0
  33653. },
  33654. int64: {
  33655. name: "int64",
  33656. wireType: r.WIRE_TYPES.VARINT,
  33657. defaultValue: r.Long ? r.Long.ZERO : void 0
  33658. },
  33659. uint64: {
  33660. name: "uint64",
  33661. wireType: r.WIRE_TYPES.VARINT,
  33662. defaultValue: r.Long ? r.Long.UZERO : void 0
  33663. },
  33664. sint64: {
  33665. name: "sint64",
  33666. wireType: r.WIRE_TYPES.VARINT,
  33667. defaultValue: r.Long ? r.Long.ZERO : void 0
  33668. },
  33669. bool: {
  33670. name: "bool",
  33671. wireType: r.WIRE_TYPES.VARINT,
  33672. defaultValue: !1
  33673. },
  33674. double: {
  33675. name: "double",
  33676. wireType: r.WIRE_TYPES.BITS64,
  33677. defaultValue: 0
  33678. },
  33679. string: {
  33680. name: "string",
  33681. wireType: r.WIRE_TYPES.LDELIM,
  33682. defaultValue: ""
  33683. },
  33684. bytes: {
  33685. name: "bytes",
  33686. wireType: r.WIRE_TYPES.LDELIM,
  33687. defaultValue: null
  33688. },
  33689. fixed32: {
  33690. name: "fixed32",
  33691. wireType: r.WIRE_TYPES.BITS32,
  33692. defaultValue: 0
  33693. },
  33694. sfixed32: {
  33695. name: "sfixed32",
  33696. wireType: r.WIRE_TYPES.BITS32,
  33697. defaultValue: 0
  33698. },
  33699. fixed64: {
  33700. name: "fixed64",
  33701. wireType: r.WIRE_TYPES.BITS64,
  33702. defaultValue: r.Long ? r.Long.UZERO : void 0
  33703. },
  33704. sfixed64: {
  33705. name: "sfixed64",
  33706. wireType: r.WIRE_TYPES.BITS64,
  33707. defaultValue: r.Long ? r.Long.ZERO : void 0
  33708. },
  33709. float: {
  33710. name: "float",
  33711. wireType: r.WIRE_TYPES.BITS32,
  33712. defaultValue: 0
  33713. },
  33714. enum: {
  33715. name: "enum",
  33716. wireType: r.WIRE_TYPES.VARINT,
  33717. defaultValue: 0
  33718. },
  33719. message: {
  33720. name: "message",
  33721. wireType: r.WIRE_TYPES.LDELIM,
  33722. defaultValue: null
  33723. },
  33724. group: {
  33725. name: "group",
  33726. wireType: r.WIRE_TYPES.STARTGROUP,
  33727. defaultValue: null
  33728. }
  33729. },
  33730. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  33731. r.ID_MIN = 1,
  33732. r.ID_MAX = 536870911,
  33733. r.convertFieldsToCamelCase = !1,
  33734. r.populateAccessors = !0,
  33735. r.populateDefaults = !0,
  33736. r.Util = function() {
  33737. var t = {};
  33738. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  33739. t.XHR = function() {
  33740. for (var e = [function() {
  33741. return new XMLHttpRequest
  33742. }
  33743. , function() {
  33744. return new ActiveXObject("Msxml2.XMLHTTP")
  33745. }
  33746. , function() {
  33747. return new ActiveXObject("Msxml3.XMLHTTP")
  33748. }
  33749. , function() {
  33750. return new ActiveXObject("Microsoft.XMLHTTP")
  33751. }
  33752. ], t = null, i = 0; i < e.length; i++) {
  33753. try {
  33754. t = e[i]()
  33755. } catch (e) {
  33756. continue
  33757. }
  33758. break
  33759. }
  33760. if (!t)
  33761. throw Error("XMLHttpRequest is not supported");
  33762. return t
  33763. }
  33764. ,
  33765. t.fetch = function(i, n) {
  33766. if (n && "function" != typeof n && (n = null),
  33767. t.IS_NODE) {
  33768. var r = e("fs");
  33769. if (n)
  33770. r.readFile(i, function(e, t) {
  33771. n(e ? null : "" + t)
  33772. });
  33773. else
  33774. try {
  33775. return r.readFileSync(i)
  33776. } catch (e) {
  33777. return null
  33778. }
  33779. } else {
  33780. var o = t.XHR();
  33781. if (o.open("GET", i, !!n),
  33782. o.setRequestHeader("Accept", "text/plain"),
  33783. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  33784. !n)
  33785. return o.send(null),
  33786. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  33787. if (o.onreadystatechange = function() {
  33788. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  33789. }
  33790. ,
  33791. 4 == o.readyState)
  33792. return;
  33793. o.send(null)
  33794. }
  33795. }
  33796. ,
  33797. t.toCamelCase = function(e) {
  33798. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  33799. return t.toUpperCase()
  33800. })
  33801. }
  33802. ,
  33803. t
  33804. }(),
  33805. r.Lang = {
  33806. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  33807. RULE: /^(?:required|optional|repeated|map)$/,
  33808. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  33809. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  33810. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  33811. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  33812. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  33813. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  33814. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  33815. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  33816. NUMBER_OCT: /^0[0-7]+$/,
  33817. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  33818. BOOL: /^(?:true|false)$/i,
  33819. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33820. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33821. WHITESPACE: /\s/,
  33822. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  33823. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  33824. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  33825. },
  33826. r.DotProto = function(e, t) {
  33827. function i(e, i) {
  33828. var n = -1
  33829. , r = 1;
  33830. if ("-" == e.charAt(0) && (r = -1,
  33831. e = e.substring(1)),
  33832. t.NUMBER_DEC.test(e))
  33833. n = parseInt(e);
  33834. else if (t.NUMBER_HEX.test(e))
  33835. n = parseInt(e.substring(2), 16);
  33836. else {
  33837. if (!t.NUMBER_OCT.test(e))
  33838. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33839. n = parseInt(e.substring(1), 8)
  33840. }
  33841. if (n = r * n | 0,
  33842. !i && n < 0)
  33843. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  33844. return n
  33845. }
  33846. function n(e) {
  33847. var i = 1;
  33848. if ("-" == e.charAt(0) && (i = -1,
  33849. e = e.substring(1)),
  33850. t.NUMBER_DEC.test(e))
  33851. return i * parseInt(e, 10);
  33852. if (t.NUMBER_HEX.test(e))
  33853. return i * parseInt(e.substring(2), 16);
  33854. if (t.NUMBER_OCT.test(e))
  33855. return i * parseInt(e.substring(1), 8);
  33856. if ("inf" === e)
  33857. return i * (1 / 0);
  33858. if ("nan" === e)
  33859. return NaN;
  33860. if (t.NUMBER_FLT.test(e))
  33861. return i * parseFloat(e);
  33862. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  33863. }
  33864. function r(e, t, i) {
  33865. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  33866. e[t].push(i))
  33867. }
  33868. var o = {}
  33869. , a = function(e) {
  33870. this.source = e + "",
  33871. this.index = 0,
  33872. this.line = 1,
  33873. this.stack = [],
  33874. this._stringOpen = null
  33875. }
  33876. , s = a.prototype;
  33877. s._readString = function() {
  33878. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  33879. e.lastIndex = this.index - 1;
  33880. var i = e.exec(this.source);
  33881. if (!i)
  33882. throw Error("unterminated string");
  33883. return this.index = e.lastIndex,
  33884. this.stack.push(this._stringOpen),
  33885. this._stringOpen = null,
  33886. i[1]
  33887. }
  33888. ,
  33889. s.next = function() {
  33890. if (this.stack.length > 0)
  33891. return this.stack.shift();
  33892. if (this.index >= this.source.length)
  33893. return null;
  33894. if (null !== this._stringOpen)
  33895. return this._readString();
  33896. var e, i, n;
  33897. do {
  33898. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  33899. if ("\n" === n && ++this.line,
  33900. ++this.index === this.source.length)
  33901. return null;
  33902. if ("/" === this.source.charAt(this.index))
  33903. if (++this.index,
  33904. "/" === this.source.charAt(this.index)) {
  33905. for (; "\n" !== this.source.charAt(++this.index); )
  33906. if (this.index == this.source.length)
  33907. return null;
  33908. ++this.index,
  33909. ++this.line,
  33910. e = !0
  33911. } else {
  33912. if ("*" !== (n = this.source.charAt(this.index)))
  33913. return "/";
  33914. do {
  33915. if ("\n" === n && ++this.line,
  33916. ++this.index === this.source.length)
  33917. return null;
  33918. i = n,
  33919. n = this.source.charAt(this.index)
  33920. } while ("*" !== i || "/" !== n);++this.index,
  33921. e = !0
  33922. }
  33923. } while (e);if (this.index === this.source.length)
  33924. return null;
  33925. var r = this.index;
  33926. t.DELIM.lastIndex = 0;
  33927. var o = t.DELIM.test(this.source.charAt(r++));
  33928. if (!o)
  33929. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  33930. ++r;
  33931. var a = this.source.substring(this.index, this.index = r);
  33932. return '"' !== a && "'" !== a || (this._stringOpen = a),
  33933. a
  33934. }
  33935. ,
  33936. s.peek = function() {
  33937. if (0 === this.stack.length) {
  33938. var e = this.next();
  33939. if (null === e)
  33940. return null;
  33941. this.stack.push(e)
  33942. }
  33943. return this.stack[0]
  33944. }
  33945. ,
  33946. s.skip = function(e) {
  33947. var t = this.next();
  33948. if (t !== e)
  33949. throw Error("illegal '" + t + "', '" + e + "' expected")
  33950. }
  33951. ,
  33952. s.omit = function(e) {
  33953. return this.peek() === e && (this.next(),
  33954. !0)
  33955. }
  33956. ,
  33957. s.toString = function() {
  33958. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  33959. }
  33960. ,
  33961. o.Tokenizer = a;
  33962. var l = function(e) {
  33963. this.tn = new a(e),
  33964. this.proto3 = !1
  33965. }
  33966. , c = l.prototype;
  33967. return c.parse = function() {
  33968. var e, i, n = {
  33969. name: "[ROOT]",
  33970. package: null,
  33971. messages: [],
  33972. enums: [],
  33973. imports: [],
  33974. options: {},
  33975. services: []
  33976. }, r = !0;
  33977. try {
  33978. for (; e = this.tn.next(); )
  33979. switch (e) {
  33980. case "package":
  33981. if (!r || null !== n.package)
  33982. throw Error("unexpected 'package'");
  33983. if (e = this.tn.next(),
  33984. !t.TYPEREF.test(e))
  33985. throw Error("illegal package name: " + e);
  33986. this.tn.skip(";"),
  33987. n.package = e;
  33988. break;
  33989. case "import":
  33990. if (!r)
  33991. throw Error("unexpected 'import'");
  33992. e = this.tn.peek(),
  33993. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  33994. e = this._readString(),
  33995. this.tn.skip(";"),
  33996. i || n.imports.push(e);
  33997. break;
  33998. case "syntax":
  33999. if (!r)
  34000. throw Error("unexpected 'syntax'");
  34001. this.tn.skip("="),
  34002. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34003. this.tn.skip(";");
  34004. break;
  34005. case "message":
  34006. this._parseMessage(n, null),
  34007. r = !1;
  34008. break;
  34009. case "enum":
  34010. this._parseEnum(n),
  34011. r = !1;
  34012. break;
  34013. case "option":
  34014. this._parseOption(n);
  34015. break;
  34016. case "service":
  34017. this._parseService(n);
  34018. break;
  34019. case "extend":
  34020. this._parseExtend(n);
  34021. break;
  34022. default:
  34023. throw Error("unexpected '" + e + "'")
  34024. }
  34025. } catch (e) {
  34026. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34027. e
  34028. }
  34029. return delete n.name,
  34030. n
  34031. }
  34032. ,
  34033. l.parse = function(e) {
  34034. return new l(e).parse()
  34035. }
  34036. ,
  34037. c._readString = function() {
  34038. var e, t, i = "";
  34039. do {
  34040. if (t = this.tn.next(),
  34041. "'" !== t && '"' !== t)
  34042. throw Error("illegal string delimiter: " + t);
  34043. i += this.tn.next(),
  34044. this.tn.skip(t),
  34045. e = this.tn.peek()
  34046. } while ('"' === e || '"' === e);return i
  34047. }
  34048. ,
  34049. c._readValue = function(e) {
  34050. var i = this.tn.peek();
  34051. if ('"' === i || "'" === i)
  34052. return this._readString();
  34053. if (this.tn.next(),
  34054. t.NUMBER.test(i))
  34055. return n(i);
  34056. if (t.BOOL.test(i))
  34057. return "true" === i.toLowerCase();
  34058. if (e && t.TYPEREF.test(i))
  34059. return i;
  34060. throw Error("illegal value: " + i)
  34061. }
  34062. ,
  34063. c._parseOption = function(e, i) {
  34064. var n = this.tn.next()
  34065. , r = !1;
  34066. if ("(" === n && (r = !0,
  34067. n = this.tn.next()),
  34068. !t.TYPEREF.test(n))
  34069. throw Error("illegal option name: " + n);
  34070. var o = n;
  34071. r && (this.tn.skip(")"),
  34072. o = "(" + o + ")",
  34073. n = this.tn.peek(),
  34074. t.FQTYPEREF.test(n) && (o += n,
  34075. this.tn.next())),
  34076. this.tn.skip("="),
  34077. this._parseOptionValue(e, o),
  34078. i || this.tn.skip(";")
  34079. }
  34080. ,
  34081. c._parseOptionValue = function(e, i) {
  34082. var n = this.tn.peek();
  34083. if ("{" !== n)
  34084. r(e.options, i, this._readValue(!0));
  34085. else
  34086. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34087. if (!t.NAME.test(n))
  34088. throw Error("illegal option name: " + i + "." + n);
  34089. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34090. }
  34091. }
  34092. ,
  34093. c._parseService = function(e) {
  34094. var i = this.tn.next();
  34095. if (!t.NAME.test(i))
  34096. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34097. var n = i
  34098. , r = {
  34099. name: n,
  34100. rpc: {},
  34101. options: {}
  34102. };
  34103. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34104. if ("option" === i)
  34105. this._parseOption(r);
  34106. else {
  34107. if ("rpc" !== i)
  34108. throw Error("illegal service token: " + i);
  34109. this._parseServiceRPC(r)
  34110. }
  34111. this.tn.omit(";"),
  34112. e.services.push(r)
  34113. }
  34114. ,
  34115. c._parseServiceRPC = function(e) {
  34116. var i = "rpc"
  34117. , n = this.tn.next();
  34118. if (!t.NAME.test(n))
  34119. throw Error("illegal rpc service method name: " + n);
  34120. var r = n
  34121. , o = {
  34122. request: null,
  34123. response: null,
  34124. request_stream: !1,
  34125. response_stream: !1,
  34126. options: {}
  34127. };
  34128. if (this.tn.skip("("),
  34129. n = this.tn.next(),
  34130. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34131. n = this.tn.next()),
  34132. !t.TYPEREF.test(n))
  34133. throw Error("illegal rpc service request type: " + n);
  34134. if (o.request = n,
  34135. this.tn.skip(")"),
  34136. n = this.tn.next(),
  34137. "returns" !== n.toLowerCase())
  34138. throw Error("illegal rpc service request type delimiter: " + n);
  34139. if (this.tn.skip("("),
  34140. n = this.tn.next(),
  34141. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34142. n = this.tn.next()),
  34143. o.response = n,
  34144. this.tn.skip(")"),
  34145. n = this.tn.peek(),
  34146. "{" === n) {
  34147. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34148. if ("option" !== n)
  34149. throw Error("illegal rpc service token: " + n);
  34150. this._parseOption(o)
  34151. }
  34152. this.tn.omit(";")
  34153. } else
  34154. this.tn.skip(";");
  34155. "undefined" == typeof e[i] && (e[i] = {}),
  34156. e[i][r] = o
  34157. }
  34158. ,
  34159. c._parseMessage = function(e, n) {
  34160. var r = !!n
  34161. , o = this.tn.next()
  34162. , a = {
  34163. name: "",
  34164. fields: [],
  34165. enums: [],
  34166. messages: [],
  34167. options: {},
  34168. services: [],
  34169. oneofs: {}
  34170. };
  34171. if (!t.NAME.test(o))
  34172. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34173. for (a.name = o,
  34174. r && (this.tn.skip("="),
  34175. n.id = i(this.tn.next()),
  34176. a.isGroup = !0),
  34177. o = this.tn.peek(),
  34178. "[" === o && n && this._parseFieldOptions(n),
  34179. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  34180. if (t.RULE.test(o))
  34181. this._parseMessageField(a, o);
  34182. else if ("oneof" === o)
  34183. this._parseMessageOneOf(a);
  34184. else if ("enum" === o)
  34185. this._parseEnum(a);
  34186. else if ("message" === o)
  34187. this._parseMessage(a);
  34188. else if ("option" === o)
  34189. this._parseOption(a);
  34190. else if ("service" === o)
  34191. this._parseService(a);
  34192. else if ("extensions" === o)
  34193. a.extensions = this._parseExtensionRanges();
  34194. else if ("reserved" === o)
  34195. this._parseIgnored();
  34196. else if ("extend" === o)
  34197. this._parseExtend(a);
  34198. else {
  34199. if (!t.TYPEREF.test(o))
  34200. throw Error("illegal message token: " + o);
  34201. if (!this.proto3)
  34202. throw Error("illegal field rule: " + o);
  34203. this._parseMessageField(a, "optional", o)
  34204. }
  34205. return this.tn.omit(";"),
  34206. e.messages.push(a),
  34207. a
  34208. }
  34209. ,
  34210. c._parseIgnored = function() {
  34211. for (; ";" !== this.tn.peek(); )
  34212. this.tn.next();
  34213. this.tn.skip(";")
  34214. }
  34215. ,
  34216. c._parseMessageField = function(e, n, r) {
  34217. if (!t.RULE.test(n))
  34218. throw Error("illegal message field rule: " + n);
  34219. var o, a = {
  34220. rule: n,
  34221. type: "",
  34222. name: "",
  34223. options: {},
  34224. id: 0
  34225. };
  34226. if ("map" === n) {
  34227. if (r)
  34228. throw Error("illegal type: " + r);
  34229. if (this.tn.skip("<"),
  34230. o = this.tn.next(),
  34231. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34232. throw Error("illegal message field type: " + o);
  34233. if (a.keytype = o,
  34234. this.tn.skip(","),
  34235. o = this.tn.next(),
  34236. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34237. throw Error("illegal message field: " + o);
  34238. if (a.type = o,
  34239. this.tn.skip(">"),
  34240. o = this.tn.next(),
  34241. !t.NAME.test(o))
  34242. throw Error("illegal message field name: " + o);
  34243. a.name = o,
  34244. this.tn.skip("="),
  34245. a.id = i(this.tn.next()),
  34246. o = this.tn.peek(),
  34247. "[" === o && this._parseFieldOptions(a),
  34248. this.tn.skip(";")
  34249. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  34250. "group" === r) {
  34251. var s = this._parseMessage(e, a);
  34252. if (!/^[A-Z]/.test(s.name))
  34253. throw Error("illegal group name: " + s.name);
  34254. a.type = s.name,
  34255. a.name = s.name.toLowerCase(),
  34256. this.tn.omit(";")
  34257. } else {
  34258. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  34259. throw Error("illegal message field type: " + r);
  34260. if (a.type = r,
  34261. o = this.tn.next(),
  34262. !t.NAME.test(o))
  34263. throw Error("illegal message field name: " + o);
  34264. a.name = o,
  34265. this.tn.skip("="),
  34266. a.id = i(this.tn.next()),
  34267. o = this.tn.peek(),
  34268. "[" === o && this._parseFieldOptions(a),
  34269. this.tn.skip(";")
  34270. }
  34271. return e.fields.push(a),
  34272. a
  34273. }
  34274. ,
  34275. c._parseMessageOneOf = function(e) {
  34276. var i = this.tn.next();
  34277. if (!t.NAME.test(i))
  34278. throw Error("illegal oneof name: " + i);
  34279. var n, r = i, o = [];
  34280. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34281. n = this._parseMessageField(e, "optional", i),
  34282. n.oneof = r,
  34283. o.push(n.id);
  34284. this.tn.omit(";"),
  34285. e.oneofs[r] = o
  34286. }
  34287. ,
  34288. c._parseFieldOptions = function(e) {
  34289. this.tn.skip("[");
  34290. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  34291. i || this.tn.skip(","),
  34292. this._parseOption(e, !0),
  34293. i = !1;
  34294. this.tn.next()
  34295. }
  34296. ,
  34297. c._parseEnum = function(e) {
  34298. var n = {
  34299. name: "",
  34300. values: [],
  34301. options: {}
  34302. }
  34303. , r = this.tn.next();
  34304. if (!t.NAME.test(r))
  34305. throw Error("illegal name: " + r);
  34306. for (n.name = r,
  34307. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  34308. if ("option" === r)
  34309. this._parseOption(n);
  34310. else {
  34311. if (!t.NAME.test(r))
  34312. throw Error("illegal name: " + r);
  34313. this.tn.skip("=");
  34314. var o = {
  34315. name: r,
  34316. id: i(this.tn.next(), !0)
  34317. };
  34318. r = this.tn.peek(),
  34319. "[" === r && this._parseFieldOptions({
  34320. options: {}
  34321. }),
  34322. this.tn.skip(";"),
  34323. n.values.push(o)
  34324. }
  34325. this.tn.omit(";"),
  34326. e.enums.push(n)
  34327. }
  34328. ,
  34329. c._parseExtensionRanges = function() {
  34330. var t, i, r, o = [];
  34331. do {
  34332. for (i = []; ; ) {
  34333. switch (t = this.tn.next()) {
  34334. case "min":
  34335. r = e.ID_MIN;
  34336. break;
  34337. case "max":
  34338. r = e.ID_MAX;
  34339. break;
  34340. default:
  34341. r = n(t)
  34342. }
  34343. if (i.push(r),
  34344. 2 === i.length)
  34345. break;
  34346. if ("to" !== this.tn.peek()) {
  34347. i.push(r);
  34348. break
  34349. }
  34350. this.tn.next()
  34351. }
  34352. o.push(i)
  34353. } while (this.tn.omit(","));return this.tn.skip(";"),
  34354. o
  34355. }
  34356. ,
  34357. c._parseExtend = function(e) {
  34358. var i = this.tn.next();
  34359. if (!t.TYPEREF.test(i))
  34360. throw Error("illegal extend reference: " + i);
  34361. var n = {
  34362. ref: i,
  34363. fields: []
  34364. };
  34365. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34366. if (t.RULE.test(i))
  34367. this._parseMessageField(n, i);
  34368. else {
  34369. if (!t.TYPEREF.test(i))
  34370. throw Error("illegal extend token: " + i);
  34371. if (!this.proto3)
  34372. throw Error("illegal field rule: " + i);
  34373. this._parseMessageField(n, "optional", i)
  34374. }
  34375. return this.tn.omit(";"),
  34376. e.messages.push(n),
  34377. n
  34378. }
  34379. ,
  34380. c.toString = function() {
  34381. return "Parser at line " + this.tn.line
  34382. }
  34383. ,
  34384. o.Parser = l,
  34385. o
  34386. }(r, r.Lang),
  34387. r.Reflect = function(e) {
  34388. function i(i) {
  34389. if ("string" == typeof i && (i = e.TYPES[i]),
  34390. "undefined" == typeof i.defaultValue)
  34391. throw Error("default value for type " + i.name + " is not supported");
  34392. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  34393. }
  34394. function n(t, i) {
  34395. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  34396. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  34397. if ("string" == typeof t)
  34398. return e.Long.fromString(t, i || !1, 10);
  34399. if ("number" == typeof t)
  34400. return e.Long.fromNumber(t, i || !1);
  34401. throw Error("not convertible to Long")
  34402. }
  34403. function r(t, i) {
  34404. var n = i.readVarint32()
  34405. , o = 7 & n
  34406. , a = n >>> 3;
  34407. switch (o) {
  34408. case e.WIRE_TYPES.VARINT:
  34409. do
  34410. n = i.readUint8();
  34411. while (128 === (128 & n));break;
  34412. case e.WIRE_TYPES.BITS64:
  34413. i.offset += 8;
  34414. break;
  34415. case e.WIRE_TYPES.LDELIM:
  34416. n = i.readVarint32(),
  34417. i.offset += n;
  34418. break;
  34419. case e.WIRE_TYPES.STARTGROUP:
  34420. r(a, i);
  34421. break;
  34422. case e.WIRE_TYPES.ENDGROUP:
  34423. if (a === t)
  34424. return !1;
  34425. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  34426. case e.WIRE_TYPES.BITS32:
  34427. i.offset += 4;
  34428. break;
  34429. default:
  34430. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  34431. }
  34432. return !0
  34433. }
  34434. var o = {}
  34435. , a = function(e, t, i) {
  34436. this.builder = e,
  34437. this.parent = t,
  34438. this.name = i,
  34439. this.className
  34440. }
  34441. , s = a.prototype;
  34442. s.fqn = function() {
  34443. for (var e = this.name, t = this; ; ) {
  34444. if (t = t.parent,
  34445. null == t)
  34446. break;
  34447. e = t.name + "." + e
  34448. }
  34449. return e
  34450. }
  34451. ,
  34452. s.toString = function(e) {
  34453. return (e ? this.className + " " : "") + this.fqn()
  34454. }
  34455. ,
  34456. s.build = function() {
  34457. throw Error(this.toString(!0) + " cannot be built directly")
  34458. }
  34459. ,
  34460. o.T = a;
  34461. var l = function(e, t, i, n, r) {
  34462. a.call(this, e, t, i),
  34463. this.className = "Namespace",
  34464. this.children = [],
  34465. this.options = n || {},
  34466. this.syntax = r || "proto2"
  34467. }
  34468. , c = l.prototype = Object.create(a.prototype);
  34469. c.getChildren = function(e) {
  34470. if (e = e || null,
  34471. null == e)
  34472. return this.children.slice();
  34473. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  34474. this.children[i]instanceof e && t.push(this.children[i]);
  34475. return t
  34476. }
  34477. ,
  34478. c.addChild = function(e) {
  34479. var t;
  34480. if (t = this.getChild(e.name))
  34481. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  34482. t.name = t.originalName;
  34483. else {
  34484. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  34485. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  34486. e.name = e.originalName
  34487. }
  34488. this.children.push(e)
  34489. }
  34490. ,
  34491. c.getChild = function(e) {
  34492. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  34493. if (this.children[i][t] === e)
  34494. return this.children[i];
  34495. return null
  34496. }
  34497. ,
  34498. c.resolve = function(e, t) {
  34499. var i = "string" == typeof e ? e.split(".") : e
  34500. , n = this
  34501. , r = 0;
  34502. if ("" === i[r]) {
  34503. for (; null !== n.parent; )
  34504. n = n.parent;
  34505. r++
  34506. }
  34507. var a;
  34508. do {
  34509. do {
  34510. if (!(n instanceof o.Namespace)) {
  34511. n = null;
  34512. break
  34513. }
  34514. if (a = n.getChild(i[r]),
  34515. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  34516. n = null;
  34517. break
  34518. }
  34519. n = a,
  34520. r++
  34521. } while (r < i.length);if (null != n)
  34522. break;
  34523. if (null !== this.parent)
  34524. return this.parent.resolve(e, t)
  34525. } while (null != n);return n
  34526. }
  34527. ,
  34528. c.qn = function(e) {
  34529. var t = []
  34530. , i = e;
  34531. do
  34532. t.unshift(i.name),
  34533. i = i.parent;
  34534. while (null !== i);for (var n = 1; n <= t.length; n++) {
  34535. var r = t.slice(t.length - n);
  34536. if (e === this.resolve(r, e instanceof o.Namespace))
  34537. return r.join(".")
  34538. }
  34539. return e.fqn()
  34540. }
  34541. ,
  34542. c.build = function() {
  34543. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  34544. e = i[n],
  34545. e instanceof l && (t[e.name] = e.build());
  34546. return Object.defineProperty && Object.defineProperty(t, "$options", {
  34547. value: this.buildOpt()
  34548. }),
  34549. t
  34550. }
  34551. ,
  34552. c.buildOpt = function() {
  34553. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  34554. var r = t[i]
  34555. , o = this.options[t[i]];
  34556. e[r] = o
  34557. }
  34558. return e
  34559. }
  34560. ,
  34561. c.getOption = function(e) {
  34562. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  34563. }
  34564. ,
  34565. o.Namespace = l;
  34566. var h = function(t, i, n, r) {
  34567. if (this.type = t,
  34568. this.resolvedType = i,
  34569. this.isMapKey = n,
  34570. this.syntax = r,
  34571. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  34572. throw Error("Invalid map key type: " + t.name)
  34573. }
  34574. , u = h.prototype;
  34575. h.defaultFieldValue = i,
  34576. u.verifyValue = function(i) {
  34577. function r(e, t) {
  34578. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  34579. }
  34580. var o = this;
  34581. switch (this.type) {
  34582. case e.TYPES.int32:
  34583. case e.TYPES.sint32:
  34584. case e.TYPES.sfixed32:
  34585. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34586. i > 4294967295 ? 0 | i : i;
  34587. case e.TYPES.uint32:
  34588. case e.TYPES.fixed32:
  34589. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34590. i < 0 ? i >>> 0 : i;
  34591. case e.TYPES.int64:
  34592. case e.TYPES.sint64:
  34593. case e.TYPES.sfixed64:
  34594. if (e.Long)
  34595. try {
  34596. return n(i, !1)
  34597. } catch (e) {
  34598. r(typeof i, e.message)
  34599. }
  34600. else
  34601. r(typeof i, "requires Long.js");
  34602. case e.TYPES.uint64:
  34603. case e.TYPES.fixed64:
  34604. if (e.Long)
  34605. try {
  34606. return n(i, !0)
  34607. } catch (e) {
  34608. r(typeof i, e.message)
  34609. }
  34610. else
  34611. r(typeof i, "requires Long.js");
  34612. case e.TYPES.bool:
  34613. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  34614. i;
  34615. case e.TYPES.float:
  34616. case e.TYPES.double:
  34617. return "number" != typeof i && r(typeof i, "not a number"),
  34618. i;
  34619. case e.TYPES.string:
  34620. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  34621. "" + i;
  34622. case e.TYPES.bytes:
  34623. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  34624. case e.TYPES.enum:
  34625. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  34626. for (l = 0; l < a.length; l++) {
  34627. if (a[l].name == i)
  34628. return a[l].id;
  34629. if (a[l].id == i)
  34630. return a[l].id
  34631. }
  34632. if ("proto3" === this.syntax)
  34633. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  34634. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  34635. i;
  34636. r(i, "not a valid enum value");
  34637. case e.TYPES.group:
  34638. case e.TYPES.message:
  34639. if (i && "object" == typeof i || r(typeof i, "object expected"),
  34640. i instanceof this.resolvedType.clazz)
  34641. return i;
  34642. if (i instanceof e.Builder.Message) {
  34643. var s = {};
  34644. for (var l in i)
  34645. i.hasOwnProperty(l) && (s[l] = i[l]);
  34646. i = s
  34647. }
  34648. return new this.resolvedType.clazz(i)
  34649. }
  34650. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  34651. }
  34652. ,
  34653. u.calculateLength = function(i, n) {
  34654. if (null === n)
  34655. return 0;
  34656. var r;
  34657. switch (this.type) {
  34658. case e.TYPES.int32:
  34659. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  34660. case e.TYPES.uint32:
  34661. return t.calculateVarint32(n);
  34662. case e.TYPES.sint32:
  34663. return t.calculateVarint32(t.zigZagEncode32(n));
  34664. case e.TYPES.fixed32:
  34665. case e.TYPES.sfixed32:
  34666. case e.TYPES.float:
  34667. return 4;
  34668. case e.TYPES.int64:
  34669. case e.TYPES.uint64:
  34670. return t.calculateVarint64(n);
  34671. case e.TYPES.sint64:
  34672. return t.calculateVarint64(t.zigZagEncode64(n));
  34673. case e.TYPES.fixed64:
  34674. case e.TYPES.sfixed64:
  34675. return 8;
  34676. case e.TYPES.bool:
  34677. return 1;
  34678. case e.TYPES.enum:
  34679. return t.calculateVarint32(n);
  34680. case e.TYPES.double:
  34681. return 8;
  34682. case e.TYPES.string:
  34683. return r = t.calculateUTF8Bytes(n),
  34684. t.calculateVarint32(r) + r;
  34685. case e.TYPES.bytes:
  34686. if (n.remaining() < 0)
  34687. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34688. return t.calculateVarint32(n.remaining()) + n.remaining();
  34689. case e.TYPES.message:
  34690. return r = this.resolvedType.calculate(n),
  34691. t.calculateVarint32(r) + r;
  34692. case e.TYPES.group:
  34693. return r = this.resolvedType.calculate(n),
  34694. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  34695. }
  34696. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34697. }
  34698. ,
  34699. u.encodeValue = function(i, n, r) {
  34700. if (null === n)
  34701. return r;
  34702. switch (this.type) {
  34703. case e.TYPES.int32:
  34704. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  34705. break;
  34706. case e.TYPES.uint32:
  34707. r.writeVarint32(n);
  34708. break;
  34709. case e.TYPES.sint32:
  34710. r.writeVarint32ZigZag(n);
  34711. break;
  34712. case e.TYPES.fixed32:
  34713. r.writeUint32(n);
  34714. break;
  34715. case e.TYPES.sfixed32:
  34716. r.writeInt32(n);
  34717. break;
  34718. case e.TYPES.int64:
  34719. case e.TYPES.uint64:
  34720. r.writeVarint64(n);
  34721. break;
  34722. case e.TYPES.sint64:
  34723. r.writeVarint64ZigZag(n);
  34724. break;
  34725. case e.TYPES.fixed64:
  34726. r.writeUint64(n);
  34727. break;
  34728. case e.TYPES.sfixed64:
  34729. r.writeInt64(n);
  34730. break;
  34731. case e.TYPES.bool:
  34732. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  34733. break;
  34734. case e.TYPES.enum:
  34735. r.writeVarint32(n);
  34736. break;
  34737. case e.TYPES.float:
  34738. r.writeFloat32(n);
  34739. break;
  34740. case e.TYPES.double:
  34741. r.writeFloat64(n);
  34742. break;
  34743. case e.TYPES.string:
  34744. r.writeVString(n);
  34745. break;
  34746. case e.TYPES.bytes:
  34747. if (n.remaining() < 0)
  34748. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  34749. var o = n.offset;
  34750. r.writeVarint32(n.remaining()),
  34751. r.append(n),
  34752. n.offset = o;
  34753. break;
  34754. case e.TYPES.message:
  34755. var a = (new t).LE();
  34756. this.resolvedType.encode(n, a),
  34757. r.writeVarint32(a.offset),
  34758. r.append(a.flip());
  34759. break;
  34760. case e.TYPES.group:
  34761. this.resolvedType.encode(n, r),
  34762. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  34763. break;
  34764. default:
  34765. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  34766. }
  34767. return r
  34768. }
  34769. ,
  34770. u.decode = function(t, i, n) {
  34771. if (i != this.type.wireType)
  34772. throw Error("Unexpected wire type for element");
  34773. var r, o;
  34774. switch (this.type) {
  34775. case e.TYPES.int32:
  34776. return 0 | t.readVarint32();
  34777. case e.TYPES.uint32:
  34778. return t.readVarint32() >>> 0;
  34779. case e.TYPES.sint32:
  34780. return 0 | t.readVarint32ZigZag();
  34781. case e.TYPES.fixed32:
  34782. return t.readUint32() >>> 0;
  34783. case e.TYPES.sfixed32:
  34784. return 0 | t.readInt32();
  34785. case e.TYPES.int64:
  34786. return t.readVarint64();
  34787. case e.TYPES.uint64:
  34788. return t.readVarint64().toUnsigned();
  34789. case e.TYPES.sint64:
  34790. return t.readVarint64ZigZag();
  34791. case e.TYPES.fixed64:
  34792. return t.readUint64();
  34793. case e.TYPES.sfixed64:
  34794. return t.readInt64();
  34795. case e.TYPES.bool:
  34796. return !!t.readVarint32();
  34797. case e.TYPES.enum:
  34798. return t.readVarint32();
  34799. case e.TYPES.float:
  34800. return t.readFloat();
  34801. case e.TYPES.double:
  34802. return t.readDouble();
  34803. case e.TYPES.string:
  34804. return t.readVString();
  34805. case e.TYPES.bytes:
  34806. if (o = t.readVarint32(),
  34807. t.remaining() < o)
  34808. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  34809. return r = t.clone(),
  34810. r.limit = r.offset + o,
  34811. t.offset += o,
  34812. r;
  34813. case e.TYPES.message:
  34814. return o = t.readVarint32(),
  34815. this.resolvedType.decode(t, o);
  34816. case e.TYPES.group:
  34817. return this.resolvedType.decode(t, -1, n)
  34818. }
  34819. throw Error("[INTERNAL] Illegal decode type")
  34820. }
  34821. ,
  34822. u.valueFromString = function(i) {
  34823. if (!this.isMapKey)
  34824. throw Error("valueFromString() called on non-map-key element");
  34825. switch (this.type) {
  34826. case e.TYPES.int32:
  34827. case e.TYPES.sint32:
  34828. case e.TYPES.sfixed32:
  34829. case e.TYPES.uint32:
  34830. case e.TYPES.fixed32:
  34831. return this.verifyValue(parseInt(i));
  34832. case e.TYPES.int64:
  34833. case e.TYPES.sint64:
  34834. case e.TYPES.sfixed64:
  34835. case e.TYPES.uint64:
  34836. case e.TYPES.fixed64:
  34837. return this.verifyValue(i);
  34838. case e.TYPES.bool:
  34839. return "true" === i;
  34840. case e.TYPES.string:
  34841. return this.verifyValue(i);
  34842. case e.TYPES.bytes:
  34843. return t.fromBinary(i)
  34844. }
  34845. }
  34846. ,
  34847. u.valueToString = function(t) {
  34848. if (!this.isMapKey)
  34849. throw Error("valueToString() called on non-map-key element");
  34850. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  34851. }
  34852. ,
  34853. o.Element = h;
  34854. var d = function(e, t, i, n, r, o) {
  34855. l.call(this, e, t, i, n, o),
  34856. this.className = "Message",
  34857. this.extensions = void 0,
  34858. this.clazz = null,
  34859. this.isGroup = !!r,
  34860. this._fields = null,
  34861. this._fieldsById = null,
  34862. this._fieldsByName = null
  34863. }
  34864. , p = d.prototype = Object.create(l.prototype);
  34865. p.build = function(i) {
  34866. if (this.clazz && !i)
  34867. return this.clazz;
  34868. var n = function(e, i) {
  34869. function n(i, r, o, a) {
  34870. if (null === i || "object" != typeof i) {
  34871. if (a && a instanceof e.Reflect.Enum) {
  34872. var s = e.Reflect.Enum.getName(a.object, i);
  34873. if (null !== s)
  34874. return s
  34875. }
  34876. return i
  34877. }
  34878. if (t.isByteBuffer(i))
  34879. return r ? i.toBase64() : i.toBuffer();
  34880. if (e.Long.isLong(i))
  34881. return o ? i.toString() : e.Long.fromValue(i);
  34882. var l;
  34883. if (Array.isArray(i))
  34884. return l = [],
  34885. i.forEach(function(e, t) {
  34886. l[t] = n(e, r, o, a)
  34887. }),
  34888. l;
  34889. if (l = {},
  34890. i instanceof e.Map) {
  34891. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  34892. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  34893. return l
  34894. }
  34895. var u = i.$type
  34896. , d = void 0;
  34897. for (var p in i)
  34898. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  34899. return l
  34900. }
  34901. var r = i.getChildren(e.Reflect.Message.Field)
  34902. , o = i.getChildren(e.Reflect.Message.OneOf)
  34903. , a = function(n, s) {
  34904. e.Builder.Message.call(this);
  34905. for (var l = 0, c = o.length; l < c; ++l)
  34906. this[o[l].name] = null;
  34907. for (l = 0,
  34908. c = r.length; l < c; ++l) {
  34909. var h = r[l];
  34910. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  34911. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  34912. }
  34913. if (arguments.length > 0) {
  34914. var u;
  34915. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  34916. for (l = 0,
  34917. c = arguments.length; l < c; ++l)
  34918. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  34919. else
  34920. this.$set(n)
  34921. }
  34922. }
  34923. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  34924. s.add = function(t, n, r) {
  34925. var o = i._fieldsByName[t];
  34926. if (!r) {
  34927. if (!o)
  34928. throw Error(this + "#" + t + " is undefined");
  34929. if (!(o instanceof e.Reflect.Message.Field))
  34930. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  34931. if (!o.repeated)
  34932. throw Error(this + "#" + t + " is not a repeated field");
  34933. n = o.verifyValue(n, !0)
  34934. }
  34935. return null === this[t] && (this[t] = []),
  34936. this[t].push(n),
  34937. this
  34938. }
  34939. ,
  34940. s.$add = s.add,
  34941. s.set = function(t, n, r) {
  34942. if (t && "object" == typeof t) {
  34943. r = n;
  34944. for (var o in t)
  34945. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  34946. return this
  34947. }
  34948. var a = i._fieldsByName[t];
  34949. if (r)
  34950. this[t] = n;
  34951. else {
  34952. if (!a)
  34953. throw Error(this + "#" + t + " is not a field: undefined");
  34954. if (!(a instanceof e.Reflect.Message.Field))
  34955. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  34956. this[a.name] = n = a.verifyValue(n)
  34957. }
  34958. if (a && a.oneof) {
  34959. var s = this[a.oneof.name];
  34960. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  34961. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  34962. }
  34963. return this
  34964. }
  34965. ,
  34966. s.$set = s.set,
  34967. s.get = function(t, n) {
  34968. if (n)
  34969. return this[t];
  34970. var r = i._fieldsByName[t];
  34971. if (!(r && r instanceof e.Reflect.Message.Field))
  34972. throw Error(this + "#" + t + " is not a field: undefined");
  34973. if (!(r instanceof e.Reflect.Message.Field))
  34974. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  34975. return this[r.name]
  34976. }
  34977. ,
  34978. s.$get = s.get;
  34979. for (var l = 0; l < r.length; l++) {
  34980. var c = r[l];
  34981. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  34982. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  34983. return e.toUpperCase().replace("_", "")
  34984. });
  34985. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  34986. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  34987. return "_" + e
  34988. })
  34989. , r = function(t, i) {
  34990. return this[e.name] = i ? t : e.verifyValue(t),
  34991. this
  34992. }
  34993. , o = function() {
  34994. return this[e.name]
  34995. };
  34996. null === i.getChild("set" + t) && (s["set" + t] = r),
  34997. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  34998. null === i.getChild("get" + t) && (s["get" + t] = o),
  34999. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35000. }(c)
  35001. }
  35002. s.encode = function(e, n) {
  35003. "boolean" == typeof e && (n = e,
  35004. e = void 0);
  35005. var r = !1;
  35006. e || (e = new t,
  35007. r = !0);
  35008. var o = e.littleEndian;
  35009. try {
  35010. return i.encode(this, e.LE(), n),
  35011. (r ? e.flip() : e).LE(o)
  35012. } catch (t) {
  35013. throw e.LE(o),
  35014. t
  35015. }
  35016. }
  35017. ,
  35018. a.encode = function(e, t, i) {
  35019. return new a(e).encode(t, i)
  35020. }
  35021. ,
  35022. s.calculate = function() {
  35023. return i.calculate(this)
  35024. }
  35025. ,
  35026. s.encodeDelimited = function(e, n) {
  35027. var r = !1;
  35028. e || (e = new t,
  35029. r = !0);
  35030. var o = (new t).LE();
  35031. return i.encode(this, o, n).flip(),
  35032. e.writeVarint32(o.remaining()),
  35033. e.append(o),
  35034. r ? e.flip() : e
  35035. }
  35036. ,
  35037. s.encodeAB = function() {
  35038. try {
  35039. return this.encode().toArrayBuffer()
  35040. } catch (e) {
  35041. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35042. e
  35043. }
  35044. }
  35045. ,
  35046. s.toArrayBuffer = s.encodeAB,
  35047. s.encodeNB = function() {
  35048. try {
  35049. return this.encode().toBuffer()
  35050. } catch (e) {
  35051. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35052. e
  35053. }
  35054. }
  35055. ,
  35056. s.toBuffer = s.encodeNB,
  35057. s.encode64 = function() {
  35058. try {
  35059. return this.encode().toBase64()
  35060. } catch (e) {
  35061. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35062. e
  35063. }
  35064. }
  35065. ,
  35066. s.toBase64 = s.encode64,
  35067. s.encodeHex = function() {
  35068. try {
  35069. return this.encode().toHex()
  35070. } catch (e) {
  35071. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35072. e
  35073. }
  35074. }
  35075. ,
  35076. s.toHex = s.encodeHex,
  35077. s.toRaw = function(e, t) {
  35078. return n(this, !!e, !!t, this.$type)
  35079. }
  35080. ,
  35081. s.encodeJSON = function() {
  35082. return JSON.stringify(n(this, !0, !0, this.$type))
  35083. }
  35084. ,
  35085. a.decode = function(e, n, r) {
  35086. "string" == typeof n && (r = n,
  35087. n = -1),
  35088. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35089. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35090. var o = e.littleEndian;
  35091. try {
  35092. var a = i.decode(e.LE());
  35093. return e.LE(o),
  35094. a
  35095. } catch (t) {
  35096. throw e.LE(o),
  35097. t
  35098. }
  35099. }
  35100. ,
  35101. a.decodeDelimited = function(e, n) {
  35102. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35103. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35104. e.remaining() < 1)
  35105. return null;
  35106. var r = e.offset
  35107. , o = e.readVarint32();
  35108. if (e.remaining() < o)
  35109. return e.offset = r,
  35110. null;
  35111. try {
  35112. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35113. return e.offset += o,
  35114. a
  35115. } catch (t) {
  35116. throw e.offset += o,
  35117. t
  35118. }
  35119. }
  35120. ,
  35121. a.decode64 = function(e) {
  35122. return a.decode(e, "base64")
  35123. }
  35124. ,
  35125. a.decodeHex = function(e) {
  35126. return a.decode(e, "hex")
  35127. }
  35128. ,
  35129. a.decodeJSON = function(e) {
  35130. return new a(JSON.parse(e))
  35131. }
  35132. ,
  35133. s.toString = function() {
  35134. return i.toString()
  35135. }
  35136. ;
  35137. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35138. value: i.buildOpt()
  35139. }),
  35140. Object.defineProperty(s, "$options", {
  35141. value: a.$options
  35142. }),
  35143. Object.defineProperty(a, "$type", {
  35144. value: i
  35145. }),
  35146. Object.defineProperty(s, "$type", {
  35147. value: i
  35148. })),
  35149. a
  35150. }(e, this);
  35151. this._fields = [],
  35152. this._fieldsById = {},
  35153. this._fieldsByName = {};
  35154. for (var r, o = 0, a = this.children.length; o < a; o++)
  35155. if (r = this.children[o],
  35156. r instanceof A || r instanceof d || r instanceof E) {
  35157. if (n.hasOwnProperty(r.name))
  35158. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35159. n[r.name] = r.build()
  35160. } else if (r instanceof d.Field)
  35161. r.build(),
  35162. this._fields.push(r),
  35163. this._fieldsById[r.id] = r,
  35164. this._fieldsByName[r.name] = r;
  35165. else if (!(r instanceof d.OneOf || r instanceof I))
  35166. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35167. return this.clazz = n
  35168. }
  35169. ,
  35170. p.encode = function(e, t, i) {
  35171. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35172. n = this._fields[a],
  35173. r = e[n.name],
  35174. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35175. if (null !== o) {
  35176. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35177. throw l.encoded = t,
  35178. l
  35179. }
  35180. return t
  35181. }
  35182. ,
  35183. p.calculate = function(e) {
  35184. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  35185. if (t = this._fields[r],
  35186. i = e[t.name],
  35187. t.required && null === i)
  35188. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  35189. n += t.calculate(i, e)
  35190. }
  35191. return n
  35192. }
  35193. ,
  35194. p.decode = function(t, i, n) {
  35195. i = "number" == typeof i ? i : -1;
  35196. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  35197. if (o = t.readVarint32(),
  35198. a = 7 & o,
  35199. s = o >>> 3,
  35200. a === e.WIRE_TYPES.ENDGROUP) {
  35201. if (s !== n)
  35202. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  35203. break
  35204. }
  35205. if (l = this._fieldsById[s]) {
  35206. if (l.repeated && !l.options.packed)
  35207. h[l.name].push(l.decode(a, t));
  35208. else if (l.map) {
  35209. var u = l.decode(a, t);
  35210. h[l.name].set(u[0], u[1])
  35211. } else if (h[l.name] = l.decode(a, t),
  35212. l.oneof) {
  35213. var d = h[l.oneof.name];
  35214. null !== d && d !== l.name && (h[d] = null),
  35215. h[l.oneof.name] = l.name
  35216. }
  35217. } else
  35218. switch (a) {
  35219. case e.WIRE_TYPES.VARINT:
  35220. t.readVarint32();
  35221. break;
  35222. case e.WIRE_TYPES.BITS32:
  35223. t.offset += 4;
  35224. break;
  35225. case e.WIRE_TYPES.BITS64:
  35226. t.offset += 8;
  35227. break;
  35228. case e.WIRE_TYPES.LDELIM:
  35229. var p = t.readVarint32();
  35230. t.offset += p;
  35231. break;
  35232. case e.WIRE_TYPES.STARTGROUP:
  35233. for (; r(s, t); )
  35234. ;
  35235. break;
  35236. default:
  35237. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  35238. }
  35239. }
  35240. for (var f = 0, g = this._fields.length; f < g; ++f)
  35241. if (l = this._fields[f],
  35242. null === h[l.name])
  35243. if ("proto3" === this.syntax)
  35244. h[l.name] = l.defaultValue;
  35245. else {
  35246. if (l.required) {
  35247. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  35248. throw m.decoded = h,
  35249. m
  35250. }
  35251. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  35252. }
  35253. return h
  35254. }
  35255. ,
  35256. o.Message = d;
  35257. var f = function(t, i, n, r, o, s, l, c, h, u) {
  35258. a.call(this, t, i, s),
  35259. this.className = "Message.Field",
  35260. this.required = "required" === n,
  35261. this.repeated = "repeated" === n,
  35262. this.map = "map" === n,
  35263. this.keyType = r || null,
  35264. this.type = o,
  35265. this.resolvedType = null,
  35266. this.id = l,
  35267. this.options = c || {},
  35268. this.defaultValue = null,
  35269. this.oneof = h || null,
  35270. this.syntax = u || "proto2",
  35271. this.originalName = this.name,
  35272. this.element = null,
  35273. this.keyElement = null,
  35274. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  35275. }
  35276. , g = f.prototype = Object.create(a.prototype);
  35277. g.build = function() {
  35278. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  35279. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  35280. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  35281. }
  35282. ,
  35283. g.verifyValue = function(t, i) {
  35284. function n(e, t) {
  35285. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  35286. }
  35287. i = i || !1;
  35288. var r = this;
  35289. if (null === t)
  35290. return this.required && n(typeof t, "required"),
  35291. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  35292. null;
  35293. var o;
  35294. if (this.repeated && !i) {
  35295. Array.isArray(t) || (t = [t]);
  35296. var a = [];
  35297. for (o = 0; o < t.length; o++)
  35298. a.push(this.element.verifyValue(t[o]));
  35299. return a
  35300. }
  35301. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  35302. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  35303. this.element.verifyValue(t))
  35304. }
  35305. ,
  35306. g.hasWirePresence = function(t, i) {
  35307. if ("proto3" !== this.syntax)
  35308. return null !== t;
  35309. if (this.oneof && i[this.oneof.name] === this.name)
  35310. return !0;
  35311. switch (this.type) {
  35312. case e.TYPES.int32:
  35313. case e.TYPES.sint32:
  35314. case e.TYPES.sfixed32:
  35315. case e.TYPES.uint32:
  35316. case e.TYPES.fixed32:
  35317. return 0 !== t;
  35318. case e.TYPES.int64:
  35319. case e.TYPES.sint64:
  35320. case e.TYPES.sfixed64:
  35321. case e.TYPES.uint64:
  35322. case e.TYPES.fixed64:
  35323. return 0 !== t.low || 0 !== t.high;
  35324. case e.TYPES.bool:
  35325. return t;
  35326. case e.TYPES.float:
  35327. case e.TYPES.double:
  35328. return 0 !== t;
  35329. case e.TYPES.string:
  35330. return t.length > 0;
  35331. case e.TYPES.bytes:
  35332. return t.remaining() > 0;
  35333. case e.TYPES.enum:
  35334. return 0 !== t;
  35335. case e.TYPES.message:
  35336. return null !== t;
  35337. default:
  35338. return !0
  35339. }
  35340. }
  35341. ,
  35342. g.encode = function(i, n, r) {
  35343. if (null === this.type || "object" != typeof this.type)
  35344. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35345. if (null === i || this.repeated && 0 == i.length)
  35346. return n;
  35347. try {
  35348. if (this.repeated) {
  35349. var o;
  35350. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35351. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35352. n.ensureCapacity(n.offset += 1);
  35353. var a = n.offset;
  35354. for (o = 0; o < i.length; o++)
  35355. this.element.encodeValue(this.id, i[o], n);
  35356. var s = n.offset - a
  35357. , l = t.calculateVarint32(s);
  35358. if (l > 1) {
  35359. var c = n.slice(a, n.offset);
  35360. a += l - 1,
  35361. n.offset = a,
  35362. n.append(c)
  35363. }
  35364. n.writeVarint32(s, a - l)
  35365. } else
  35366. for (o = 0; o < i.length; o++)
  35367. n.writeVarint32(this.id << 3 | this.type.wireType),
  35368. this.element.encodeValue(this.id, i[o], n)
  35369. } else
  35370. this.map ? i.forEach(function(i, r, o) {
  35371. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35372. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35373. n.writeVarint32(a),
  35374. n.writeVarint32(8 | this.keyType.wireType),
  35375. this.keyElement.encodeValue(1, r, n),
  35376. n.writeVarint32(16 | this.type.wireType),
  35377. this.element.encodeValue(2, i, n)
  35378. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  35379. this.element.encodeValue(this.id, i, n))
  35380. } catch (e) {
  35381. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35382. }
  35383. return n
  35384. }
  35385. ,
  35386. g.calculate = function(i, n) {
  35387. if (i = this.verifyValue(i),
  35388. null === this.type || "object" != typeof this.type)
  35389. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35390. if (null === i || this.repeated && 0 == i.length)
  35391. return 0;
  35392. var r = 0;
  35393. try {
  35394. if (this.repeated) {
  35395. var o, a;
  35396. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35397. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35398. a = 0,
  35399. o = 0; o < i.length; o++)
  35400. a += this.element.calculateLength(this.id, i[o]);
  35401. r += t.calculateVarint32(a),
  35402. r += a
  35403. } else
  35404. for (o = 0; o < i.length; o++)
  35405. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35406. r += this.element.calculateLength(this.id, i[o])
  35407. } else
  35408. this.map ? i.forEach(function(i, n, o) {
  35409. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35410. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35411. r += t.calculateVarint32(a),
  35412. r += a
  35413. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35414. r += this.element.calculateLength(this.id, i))
  35415. } catch (e) {
  35416. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35417. }
  35418. return r
  35419. }
  35420. ,
  35421. g.decode = function(t, i, n) {
  35422. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  35423. if (!a)
  35424. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  35425. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  35426. o = i.readVarint32(),
  35427. o = i.offset + o;
  35428. for (var s = []; i.offset < o; )
  35429. s.push(this.decode(this.type.wireType, i, !0));
  35430. return s
  35431. }
  35432. if (this.map) {
  35433. var l = h.defaultFieldValue(this.keyType);
  35434. if (r = h.defaultFieldValue(this.type),
  35435. o = i.readVarint32(),
  35436. i.remaining() < o)
  35437. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  35438. var c = i.clone();
  35439. for (c.limit = c.offset + o,
  35440. i.offset += o; c.remaining() > 0; ) {
  35441. var u = c.readVarint32();
  35442. t = 7 & u;
  35443. var d = u >>> 3;
  35444. if (1 === d)
  35445. l = this.keyElement.decode(c, t, d);
  35446. else {
  35447. if (2 !== d)
  35448. throw Error("Unexpected tag in map field key/value submessage");
  35449. r = this.element.decode(c, t, d)
  35450. }
  35451. }
  35452. return [l, r]
  35453. }
  35454. return this.element.decode(i, t, this.id)
  35455. }
  35456. ,
  35457. o.Message.Field = f;
  35458. var m = function(e, t, i, n, r, o, a) {
  35459. f.call(this, e, t, i, null, n, r, o, a),
  35460. this.extension
  35461. };
  35462. m.prototype = Object.create(f.prototype),
  35463. o.Message.ExtensionField = m;
  35464. var v = function(e, t, i) {
  35465. a.call(this, e, t, i),
  35466. this.fields = []
  35467. };
  35468. o.Message.OneOf = v;
  35469. var A = function(e, t, i, n, r) {
  35470. l.call(this, e, t, i, n, r),
  35471. this.className = "Enum",
  35472. this.object = null
  35473. };
  35474. A.getName = function(e, t) {
  35475. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  35476. if (e[i = n[r]] === t)
  35477. return i;
  35478. return null
  35479. }
  35480. ;
  35481. var y = A.prototype = Object.create(l.prototype);
  35482. y.build = function(t) {
  35483. if (this.object && !t)
  35484. return this.object;
  35485. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  35486. i[n[r].name] = n[r].id;
  35487. return Object.defineProperty && Object.defineProperty(i, "$options", {
  35488. value: this.buildOpt(),
  35489. enumerable: !1
  35490. }),
  35491. this.object = i
  35492. }
  35493. ,
  35494. o.Enum = A;
  35495. var C = function(e, t, i, n) {
  35496. a.call(this, e, t, i),
  35497. this.className = "Enum.Value",
  35498. this.id = n
  35499. };
  35500. C.prototype = Object.create(a.prototype),
  35501. o.Enum.Value = C;
  35502. var I = function(e, t, i, n) {
  35503. a.call(this, e, t, i),
  35504. this.field = n
  35505. };
  35506. I.prototype = Object.create(a.prototype),
  35507. o.Extension = I;
  35508. var E = function(e, t, i, n) {
  35509. l.call(this, e, t, i, n),
  35510. this.className = "Service",
  35511. this.clazz = null
  35512. }
  35513. , b = E.prototype = Object.create(l.prototype);
  35514. b.build = function(i) {
  35515. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  35516. for (var n = function(t) {
  35517. e.Builder.Service.call(this),
  35518. this.rpcImpl = t || function(e, t, i) {
  35519. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  35520. }
  35521. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  35522. !function(e) {
  35523. r[e.name] = function(n, r) {
  35524. try {
  35525. try {
  35526. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  35527. } catch (e) {
  35528. if (!(e instanceof TypeError))
  35529. throw e
  35530. }
  35531. if (null === n || "object" != typeof n)
  35532. throw Error("Illegal arguments");
  35533. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  35534. this.rpcImpl(e.fqn(), n, function(t, n) {
  35535. if (t)
  35536. return void r(t);
  35537. null === n && (n = "");
  35538. try {
  35539. n = e.resolvedResponseType.clazz.decode(n)
  35540. } catch (e) {}
  35541. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  35542. })
  35543. } catch (e) {
  35544. setTimeout(r.bind(this, e), 0)
  35545. }
  35546. }
  35547. ,
  35548. n[e.name] = function(t, i, r) {
  35549. new n(t)[e.name](i, r)
  35550. }
  35551. ,
  35552. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  35553. value: e.buildOpt()
  35554. }),
  35555. Object.defineProperty(r[e.name], "$options", {
  35556. value: n[e.name].$options
  35557. }))
  35558. }(o[a]);
  35559. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  35560. value: i.buildOpt()
  35561. }),
  35562. Object.defineProperty(r, "$options", {
  35563. value: n.$options
  35564. }),
  35565. Object.defineProperty(n, "$type", {
  35566. value: i
  35567. }),
  35568. Object.defineProperty(r, "$type", {
  35569. value: i
  35570. })),
  35571. n
  35572. }(e, this)
  35573. }
  35574. ,
  35575. o.Service = E;
  35576. var w = function(e, t, i, n) {
  35577. a.call(this, e, t, i),
  35578. this.className = "Service.Method",
  35579. this.options = n || {}
  35580. }
  35581. , _ = w.prototype = Object.create(a.prototype);
  35582. _.buildOpt = c.buildOpt,
  35583. o.Service.Method = w;
  35584. var T = function(e, t, i, n, r, o, a, s) {
  35585. w.call(this, e, t, i, s),
  35586. this.className = "Service.RPCMethod",
  35587. this.requestName = n,
  35588. this.responseName = r,
  35589. this.requestStream = o,
  35590. this.responseStream = a,
  35591. this.resolvedRequestType = null,
  35592. this.resolvedResponseType = null
  35593. };
  35594. return T.prototype = Object.create(w.prototype),
  35595. o.Service.RPCMethod = T,
  35596. o
  35597. }(r),
  35598. r.Builder = function(t, i, n) {
  35599. function r(e) {
  35600. e.messages && e.messages.forEach(function(t) {
  35601. t.syntax = e.syntax,
  35602. r(t)
  35603. }),
  35604. e.enums && e.enums.forEach(function(t) {
  35605. t.syntax = e.syntax
  35606. })
  35607. }
  35608. var o = function(e) {
  35609. this.ns = new n.Namespace(this,null,""),
  35610. this.ptr = this.ns,
  35611. this.resolved = !1,
  35612. this.result = null,
  35613. this.files = {},
  35614. this.importRoot = null,
  35615. this.options = e || {}
  35616. }
  35617. , a = o.prototype;
  35618. return o.isMessage = function(e) {
  35619. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  35620. }
  35621. ,
  35622. o.isMessageField = function(e) {
  35623. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  35624. }
  35625. ,
  35626. o.isEnum = function(e) {
  35627. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  35628. }
  35629. ,
  35630. o.isService = function(e) {
  35631. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  35632. }
  35633. ,
  35634. o.isExtend = function(e) {
  35635. return "string" == typeof e.ref
  35636. }
  35637. ,
  35638. a.reset = function() {
  35639. return this.ptr = this.ns,
  35640. this
  35641. }
  35642. ,
  35643. a.define = function(e) {
  35644. if ("string" != typeof e || !i.TYPEREF.test(e))
  35645. throw Error("illegal namespace: " + e);
  35646. return e.split(".").forEach(function(e) {
  35647. var t = this.ptr.getChild(e);
  35648. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  35649. this.ptr = t
  35650. }, this),
  35651. this
  35652. }
  35653. ,
  35654. a.create = function(e) {
  35655. if (!e)
  35656. return this;
  35657. if (Array.isArray(e)) {
  35658. if (0 === e.length)
  35659. return this;
  35660. e = e.slice()
  35661. } else
  35662. e = [e];
  35663. for (var i = [e]; i.length > 0; ) {
  35664. if (e = i.pop(),
  35665. !Array.isArray(e))
  35666. throw Error("not a valid namespace: " + JSON.stringify(e));
  35667. for (; e.length > 0; ) {
  35668. var r = e.shift();
  35669. if (o.isMessage(r)) {
  35670. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  35671. , s = {};
  35672. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  35673. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  35674. }, this),
  35675. r.fields && r.fields.forEach(function(e) {
  35676. if (null !== a.getChild(0 | e.id))
  35677. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  35678. if (e.options && "object" != typeof e.options)
  35679. throw Error("illegal field options in " + a.name + "#" + e.name);
  35680. var t = null;
  35681. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  35682. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  35683. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  35684. t && t.fields.push(e),
  35685. a.addChild(e)
  35686. }, this);
  35687. var l = [];
  35688. if (r.enums && r.enums.forEach(function(e) {
  35689. l.push(e)
  35690. }),
  35691. r.messages && r.messages.forEach(function(e) {
  35692. l.push(e)
  35693. }),
  35694. r.services && r.services.forEach(function(e) {
  35695. l.push(e)
  35696. }),
  35697. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  35698. this.ptr.addChild(a),
  35699. l.length > 0) {
  35700. i.push(e),
  35701. e = l,
  35702. l = null,
  35703. this.ptr = a,
  35704. a = null;
  35705. continue
  35706. }
  35707. l = null
  35708. } else if (o.isEnum(r))
  35709. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  35710. r.values.forEach(function(e) {
  35711. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  35712. }, this),
  35713. this.ptr.addChild(a);
  35714. else if (o.isService(r))
  35715. a = new n.Service(this,this.ptr,r.name,r.options),
  35716. Object.keys(r.rpc).forEach(function(e) {
  35717. var t = r.rpc[e];
  35718. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  35719. }, this),
  35720. this.ptr.addChild(a);
  35721. else {
  35722. if (!o.isExtend(r))
  35723. throw Error("not a valid definition: " + JSON.stringify(r));
  35724. if (a = this.ptr.resolve(r.ref, !0))
  35725. r.fields.forEach(function(e) {
  35726. if (null !== a.getChild(0 | e.id))
  35727. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  35728. if (a.extensions) {
  35729. var i = !1;
  35730. if (a.extensions.forEach(function(t) {
  35731. e.id >= t[0] && e.id <= t[1] && (i = !0)
  35732. }),
  35733. !i)
  35734. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  35735. }
  35736. var r = e.name;
  35737. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  35738. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  35739. , s = new n.Extension(this,this.ptr,e.name,o);
  35740. o.extension = s,
  35741. this.ptr.addChild(s),
  35742. a.addChild(o)
  35743. }, this);
  35744. else if (!/\.?google\.protobuf\./.test(r.ref))
  35745. throw Error("extended message " + r.ref + " is not defined")
  35746. }
  35747. r = null,
  35748. a = null
  35749. }
  35750. e = null,
  35751. this.ptr = this.ptr.parent
  35752. }
  35753. return this.resolved = !1,
  35754. this.result = null,
  35755. this
  35756. }
  35757. ,
  35758. a.import = function(i, n) {
  35759. var o = "/";
  35760. if ("string" == typeof n) {
  35761. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  35762. this.files[n] === !0)
  35763. return this.reset();
  35764. this.files[n] = !0
  35765. } else if ("object" == typeof n) {
  35766. var a = n.root;
  35767. t.Util.IS_NODE && (a = e("path").resolve(a)),
  35768. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  35769. var s = a + o + n.file;
  35770. if (this.files[s] === !0)
  35771. return this.reset();
  35772. this.files[s] = !0
  35773. }
  35774. if (i.imports && i.imports.length > 0) {
  35775. var l, c = !1;
  35776. "object" == typeof n ? (this.importRoot = n.root,
  35777. c = !0,
  35778. l = this.importRoot,
  35779. n = n.file,
  35780. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  35781. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  35782. o = "\\") : l = "." : l = null;
  35783. for (var h = 0; h < i.imports.length; h++)
  35784. if ("string" == typeof i.imports[h]) {
  35785. if (!l)
  35786. throw Error("cannot determine import root");
  35787. var u = i.imports[h];
  35788. if ("google/protobuf/descriptor.proto" === u)
  35789. continue;
  35790. if (u = l + o + u,
  35791. this.files[u] === !0)
  35792. continue;
  35793. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  35794. var d = t.Util.fetch(u);
  35795. if (null === d)
  35796. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  35797. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  35798. } else
  35799. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  35800. return t + "_import" + h + "." + i
  35801. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  35802. c && (this.importRoot = null)
  35803. }
  35804. i.package && this.define(i.package),
  35805. i.syntax && r(i);
  35806. var p = this.ptr;
  35807. return i.options && Object.keys(i.options).forEach(function(e) {
  35808. p.options[e] = i.options[e]
  35809. }),
  35810. i.messages && (this.create(i.messages),
  35811. this.ptr = p),
  35812. i.enums && (this.create(i.enums),
  35813. this.ptr = p),
  35814. i.services && (this.create(i.services),
  35815. this.ptr = p),
  35816. i.extends && this.create(i.extends),
  35817. this.reset()
  35818. }
  35819. ,
  35820. a.resolveAll = function() {
  35821. var e;
  35822. if (null == this.ptr || "object" == typeof this.ptr.type)
  35823. return this;
  35824. if (this.ptr instanceof n.Namespace)
  35825. this.ptr.children.forEach(function(e) {
  35826. this.ptr = e,
  35827. this.resolveAll()
  35828. }, this);
  35829. else if (this.ptr instanceof n.Message.Field) {
  35830. if (i.TYPE.test(this.ptr.type))
  35831. this.ptr.type = t.TYPES[this.ptr.type];
  35832. else {
  35833. if (!i.TYPEREF.test(this.ptr.type))
  35834. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35835. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  35836. !e)
  35837. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35838. if (this.ptr.resolvedType = e,
  35839. e instanceof n.Enum) {
  35840. if (this.ptr.type = t.TYPES.enum,
  35841. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  35842. throw Error("proto3 message cannot reference proto2 enum")
  35843. } else {
  35844. if (!(e instanceof n.Message))
  35845. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  35846. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  35847. }
  35848. }
  35849. if (this.ptr.map) {
  35850. if (!i.TYPE.test(this.ptr.keyType))
  35851. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  35852. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  35853. }
  35854. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  35855. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  35856. throw Error("illegal service type in " + this.ptr.toString(!0));
  35857. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  35858. !(e && e instanceof t.Reflect.Message))
  35859. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  35860. if (this.ptr.resolvedRequestType = e,
  35861. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  35862. !(e && e instanceof t.Reflect.Message))
  35863. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  35864. this.ptr.resolvedResponseType = e
  35865. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  35866. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  35867. return this.reset()
  35868. }
  35869. ,
  35870. a.build = function(e) {
  35871. if (this.reset(),
  35872. this.resolved || (this.resolveAll(),
  35873. this.resolved = !0,
  35874. this.result = null),
  35875. null === this.result && (this.result = this.ns.build()),
  35876. !e)
  35877. return this.result;
  35878. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  35879. if (!i[t[n]]) {
  35880. i = null;
  35881. break
  35882. }
  35883. i = i[t[n]]
  35884. }
  35885. return i
  35886. }
  35887. ,
  35888. a.lookup = function(e, t) {
  35889. return e ? this.ns.resolve(e, t) : this.ns
  35890. }
  35891. ,
  35892. a.toString = function() {
  35893. return "Builder"
  35894. }
  35895. ,
  35896. o.Message = function() {}
  35897. ,
  35898. o.Enum = function() {}
  35899. ,
  35900. o.Service = function() {}
  35901. ,
  35902. o
  35903. }(r, r.Lang, r.Reflect),
  35904. r.Map = function(e, t) {
  35905. function i(e) {
  35906. var t = 0;
  35907. return {
  35908. next: function() {
  35909. return t < e.length ? {
  35910. done: !1,
  35911. value: e[t++]
  35912. } : {
  35913. done: !0
  35914. }
  35915. }
  35916. }
  35917. }
  35918. var n = function(e, i) {
  35919. if (!e.map)
  35920. throw Error("field is not a map");
  35921. if (this.field = e,
  35922. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  35923. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  35924. this.map = {},
  35925. Object.defineProperty(this, "size", {
  35926. get: function() {
  35927. return Object.keys(this.map).length
  35928. }
  35929. }),
  35930. i)
  35931. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  35932. var o = this.keyElem.valueFromString(n[r])
  35933. , a = this.valueElem.verifyValue(i[n[r]]);
  35934. this.map[this.keyElem.valueToString(o)] = {
  35935. key: o,
  35936. value: a
  35937. }
  35938. }
  35939. }
  35940. , r = n.prototype;
  35941. return r.clear = function() {
  35942. this.map = {}
  35943. }
  35944. ,
  35945. r.delete = function(e) {
  35946. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35947. , i = t in this.map;
  35948. return delete this.map[t],
  35949. i
  35950. }
  35951. ,
  35952. r.entries = function() {
  35953. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  35954. t.push([(e = this.map[n[r]]).key, e.value]);
  35955. return i(t)
  35956. }
  35957. ,
  35958. r.keys = function() {
  35959. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35960. e.push(this.map[t[n]].key);
  35961. return i(e)
  35962. }
  35963. ,
  35964. r.values = function() {
  35965. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  35966. e.push(this.map[t[n]].value);
  35967. return i(e)
  35968. }
  35969. ,
  35970. r.forEach = function(e, t) {
  35971. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  35972. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  35973. }
  35974. ,
  35975. r.set = function(e, t) {
  35976. var i = this.keyElem.verifyValue(e)
  35977. , n = this.valueElem.verifyValue(t);
  35978. return this.map[this.keyElem.valueToString(i)] = {
  35979. key: i,
  35980. value: n
  35981. },
  35982. this
  35983. }
  35984. ,
  35985. r.get = function(e) {
  35986. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35987. if (t in this.map)
  35988. return this.map[t].value
  35989. }
  35990. ,
  35991. r.has = function(e) {
  35992. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  35993. return t in this.map
  35994. }
  35995. ,
  35996. n
  35997. }(r, r.Reflect),
  35998. r.loadProto = function(e, t, i) {
  35999. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36000. t = void 0),
  36001. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36002. }
  36003. ,
  36004. r.protoFromString = r.loadProto,
  36005. r.loadProtoFile = function(e, t, i) {
  36006. if (t && "object" == typeof t ? (i = t,
  36007. t = null) : t && "function" == typeof t || (t = null),
  36008. t)
  36009. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36010. if (null === n)
  36011. return void t(Error("Failed to fetch file"));
  36012. try {
  36013. t(null, r.loadProto(n, i, e))
  36014. } catch (e) {
  36015. t(e)
  36016. }
  36017. });
  36018. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36019. return null === n ? null : r.loadProto(n, i, e)
  36020. }
  36021. ,
  36022. r.protoFromFile = r.loadProtoFile,
  36023. r.newBuilder = function(e) {
  36024. return e = e || {},
  36025. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36026. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36027. new r.Builder(e)
  36028. }
  36029. ,
  36030. r.loadJson = function(e, t, i) {
  36031. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36032. t = null),
  36033. t && "object" == typeof t || (t = r.newBuilder()),
  36034. "string" == typeof e && (e = JSON.parse(e)),
  36035. t.import(e, i),
  36036. t.resolveAll(),
  36037. t
  36038. }
  36039. ,
  36040. r.loadJsonFile = function(e, t, i) {
  36041. if (t && "object" == typeof t ? (i = t,
  36042. t = null) : t && "function" == typeof t || (t = null),
  36043. t)
  36044. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36045. if (null === n)
  36046. return void t(Error("Failed to fetch file"));
  36047. try {
  36048. t(null, r.loadJson(JSON.parse(n), i, e))
  36049. } catch (e) {
  36050. t(e)
  36051. }
  36052. });
  36053. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36054. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36055. }
  36056. ,
  36057. r
  36058. })
  36059. }
  36060. ).call(this, e("_process"))
  36061. }
  36062. , {
  36063. _process: 203,
  36064. bytebuffer: 215,
  36065. fs: 197,
  36066. path: 197
  36067. }],
  36068. 215: [function(e, t, i) {
  36069. !function(i, n) {
  36070. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36071. var t;
  36072. try {
  36073. t = e("long")
  36074. } catch (e) {}
  36075. return n(t)
  36076. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36077. }(this, function(e) {
  36078. "use strict";
  36079. function t(e) {
  36080. var t = 0;
  36081. return function() {
  36082. return t < e.length ? e.charCodeAt(t++) : null
  36083. }
  36084. }
  36085. function i() {
  36086. var e = []
  36087. , t = [];
  36088. return function() {
  36089. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36090. e.length = 0),
  36091. void Array.prototype.push.apply(e, arguments))
  36092. }
  36093. }
  36094. function n(e, t, i, n, r) {
  36095. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  36096. for (u += d,
  36097. o = p & (1 << -h) - 1,
  36098. p >>= -h,
  36099. h += s; h > 0; o = 256 * o + e[t + u],
  36100. u += d,
  36101. h -= 8)
  36102. ;
  36103. for (a = o & (1 << -h) - 1,
  36104. o >>= -h,
  36105. h += n; h > 0; a = 256 * a + e[t + u],
  36106. u += d,
  36107. h -= 8)
  36108. ;
  36109. if (0 === o)
  36110. o = 1 - c;
  36111. else {
  36112. if (o === l)
  36113. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36114. a += Math.pow(2, n),
  36115. o -= c
  36116. }
  36117. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36118. }
  36119. function r(e, t, i, n, r, o) {
  36120. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  36121. for (t = Math.abs(t),
  36122. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36123. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36124. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36125. l *= 2),
  36126. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36127. t * l >= 2 && (a++,
  36128. l /= 2),
  36129. a + u >= h ? (s = 0,
  36130. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36131. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36132. a = 0)); r >= 8; e[i + p] = 255 & s,
  36133. p += f,
  36134. s /= 256,
  36135. r -= 8)
  36136. ;
  36137. for (a = a << r | s,
  36138. c += r; c > 0; e[i + p] = 255 & a,
  36139. p += f,
  36140. a /= 256,
  36141. c -= 8)
  36142. ;
  36143. e[i + p - f] |= 128 * g
  36144. }
  36145. var o = function(e, t, i) {
  36146. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36147. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36148. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36149. !i) {
  36150. if (e |= 0,
  36151. e < 0)
  36152. throw RangeError("Illegal capacity");
  36153. t = !!t,
  36154. i = !!i
  36155. }
  36156. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36157. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36158. this.offset = 0,
  36159. this.markedOffset = -1,
  36160. this.limit = e,
  36161. this.littleEndian = t,
  36162. this.noAssert = i
  36163. };
  36164. o.VERSION = "5.0.1",
  36165. o.LITTLE_ENDIAN = !0,
  36166. o.BIG_ENDIAN = !1,
  36167. o.DEFAULT_CAPACITY = 16,
  36168. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36169. o.DEFAULT_NOASSERT = !1,
  36170. o.Long = e || null;
  36171. var a = o.prototype;
  36172. a.__isByteBuffer__,
  36173. Object.defineProperty(a, "__isByteBuffer__", {
  36174. value: !0,
  36175. enumerable: !1,
  36176. configurable: !1
  36177. });
  36178. var s = new ArrayBuffer(0)
  36179. , l = String.fromCharCode;
  36180. o.accessor = function() {
  36181. return Uint8Array
  36182. }
  36183. ,
  36184. o.allocate = function(e, t, i) {
  36185. return new o(e,t,i)
  36186. }
  36187. ,
  36188. o.concat = function(e, t, i, n) {
  36189. "boolean" != typeof t && "string" == typeof t || (n = i,
  36190. i = t,
  36191. t = void 0);
  36192. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  36193. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  36194. r = e[s].limit - e[s].offset,
  36195. r > 0 && (a += r);
  36196. if (0 === a)
  36197. return new o(0,i,n);
  36198. var c, h = new o(a,i,n);
  36199. for (s = 0; s < l; )
  36200. c = e[s++],
  36201. r = c.limit - c.offset,
  36202. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  36203. h.offset += r);
  36204. return h.limit = h.offset,
  36205. h.offset = 0,
  36206. h
  36207. }
  36208. ,
  36209. o.isByteBuffer = function(e) {
  36210. return (e && e.__isByteBuffer__) === !0
  36211. }
  36212. ,
  36213. o.type = function() {
  36214. return ArrayBuffer
  36215. }
  36216. ,
  36217. o.wrap = function(e, t, i, n) {
  36218. if ("string" != typeof t && (n = i,
  36219. i = t,
  36220. t = void 0),
  36221. "string" == typeof e)
  36222. switch ("undefined" == typeof t && (t = "utf8"),
  36223. t) {
  36224. case "base64":
  36225. return o.fromBase64(e, i);
  36226. case "hex":
  36227. return o.fromHex(e, i);
  36228. case "binary":
  36229. return o.fromBinary(e, i);
  36230. case "utf8":
  36231. return o.fromUTF8(e, i);
  36232. case "debug":
  36233. return o.fromDebug(e, i);
  36234. default:
  36235. throw Error("Unsupported encoding: " + t)
  36236. }
  36237. if (null === e || "object" != typeof e)
  36238. throw TypeError("Illegal buffer");
  36239. var r;
  36240. if (o.isByteBuffer(e))
  36241. return r = a.clone.call(e),
  36242. r.markedOffset = -1,
  36243. r;
  36244. if (e instanceof Uint8Array)
  36245. r = new o(0,i,n),
  36246. e.length > 0 && (r.buffer = e.buffer,
  36247. r.offset = e.byteOffset,
  36248. r.limit = e.byteOffset + e.byteLength,
  36249. r.view = new Uint8Array(e.buffer));
  36250. else if (e instanceof ArrayBuffer)
  36251. r = new o(0,i,n),
  36252. e.byteLength > 0 && (r.buffer = e,
  36253. r.offset = 0,
  36254. r.limit = e.byteLength,
  36255. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  36256. else {
  36257. if ("[object Array]" !== Object.prototype.toString.call(e))
  36258. throw TypeError("Illegal buffer");
  36259. r = new o(e.length,i,n),
  36260. r.limit = e.length;
  36261. for (var s = 0; s < e.length; ++s)
  36262. r.view[s] = e[s]
  36263. }
  36264. return r
  36265. }
  36266. ,
  36267. a.writeBitSet = function(e, t) {
  36268. var i = "undefined" == typeof t;
  36269. if (i && (t = this.offset),
  36270. !this.noAssert) {
  36271. if (!(e instanceof Array))
  36272. throw TypeError("Illegal BitSet: Not an array");
  36273. if ("number" != typeof t || t % 1 !== 0)
  36274. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36275. if (t >>>= 0,
  36276. t < 0 || t + 0 > this.buffer.byteLength)
  36277. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36278. }
  36279. var n, r = t, o = e.length, a = o >> 3, s = 0;
  36280. for (t += this.writeVarint32(o, t); a--; )
  36281. n = 1 & !!e[s++] | (1 & !!e[s++]) << 1 | (1 & !!e[s++]) << 2 | (1 & !!e[s++]) << 3 | (1 & !!e[s++]) << 4 | (1 & !!e[s++]) << 5 | (1 & !!e[s++]) << 6 | (1 & !!e[s++]) << 7,
  36282. this.writeByte(n, t++);
  36283. if (s < o) {
  36284. var l = 0;
  36285. for (n = 0; s < o; )
  36286. n |= (1 & !!e[s++]) << l++;
  36287. this.writeByte(n, t++)
  36288. }
  36289. return i ? (this.offset = t,
  36290. this) : t - r
  36291. }
  36292. ,
  36293. a.readBitSet = function(e) {
  36294. var t = "undefined" == typeof e;
  36295. t && (e = this.offset);
  36296. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  36297. for (e += n.length; o--; )
  36298. i = this.readByte(e++),
  36299. s[a++] = !!(1 & i),
  36300. s[a++] = !!(2 & i),
  36301. s[a++] = !!(4 & i),
  36302. s[a++] = !!(8 & i),
  36303. s[a++] = !!(16 & i),
  36304. s[a++] = !!(32 & i),
  36305. s[a++] = !!(64 & i),
  36306. s[a++] = !!(128 & i);
  36307. if (a < r) {
  36308. var l = 0;
  36309. for (i = this.readByte(e++); a < r; )
  36310. s[a++] = !!(i >> l++ & 1)
  36311. }
  36312. return t && (this.offset = e),
  36313. s
  36314. }
  36315. ,
  36316. a.readBytes = function(e, t) {
  36317. var i = "undefined" == typeof t;
  36318. if (i && (t = this.offset),
  36319. !this.noAssert) {
  36320. if ("number" != typeof t || t % 1 !== 0)
  36321. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36322. if (t >>>= 0,
  36323. t < 0 || t + e > this.buffer.byteLength)
  36324. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  36325. }
  36326. var n = this.slice(t, t + e);
  36327. return i && (this.offset += e),
  36328. n
  36329. }
  36330. ,
  36331. a.writeBytes = a.append,
  36332. a.writeInt8 = function(e, t) {
  36333. var i = "undefined" == typeof t;
  36334. if (i && (t = this.offset),
  36335. !this.noAssert) {
  36336. if ("number" != typeof e || e % 1 !== 0)
  36337. throw TypeError("Illegal value: " + e + " (not an integer)");
  36338. if (e |= 0,
  36339. "number" != typeof t || t % 1 !== 0)
  36340. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36341. if (t >>>= 0,
  36342. t < 0 || t + 0 > this.buffer.byteLength)
  36343. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36344. }
  36345. t += 1;
  36346. var n = this.buffer.byteLength;
  36347. return t > n && this.resize((n *= 2) > t ? n : t),
  36348. t -= 1,
  36349. this.view[t] = e,
  36350. i && (this.offset += 1),
  36351. this
  36352. }
  36353. ,
  36354. a.writeByte = a.writeInt8,
  36355. a.readInt8 = function(e) {
  36356. var t = "undefined" == typeof e;
  36357. if (t && (e = this.offset),
  36358. !this.noAssert) {
  36359. if ("number" != typeof e || e % 1 !== 0)
  36360. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36361. if (e >>>= 0,
  36362. e < 0 || e + 1 > this.buffer.byteLength)
  36363. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36364. }
  36365. var i = this.view[e];
  36366. return 128 === (128 & i) && (i = -(255 - i + 1)),
  36367. t && (this.offset += 1),
  36368. i
  36369. }
  36370. ,
  36371. a.readByte = a.readInt8,
  36372. a.writeUint8 = function(e, t) {
  36373. var i = "undefined" == typeof t;
  36374. if (i && (t = this.offset),
  36375. !this.noAssert) {
  36376. if ("number" != typeof e || e % 1 !== 0)
  36377. throw TypeError("Illegal value: " + e + " (not an integer)");
  36378. if (e >>>= 0,
  36379. "number" != typeof t || t % 1 !== 0)
  36380. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36381. if (t >>>= 0,
  36382. t < 0 || t + 0 > this.buffer.byteLength)
  36383. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36384. }
  36385. t += 1;
  36386. var n = this.buffer.byteLength;
  36387. return t > n && this.resize((n *= 2) > t ? n : t),
  36388. t -= 1,
  36389. this.view[t] = e,
  36390. i && (this.offset += 1),
  36391. this
  36392. }
  36393. ,
  36394. a.writeUInt8 = a.writeUint8,
  36395. a.readUint8 = function(e) {
  36396. var t = "undefined" == typeof e;
  36397. if (t && (e = this.offset),
  36398. !this.noAssert) {
  36399. if ("number" != typeof e || e % 1 !== 0)
  36400. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36401. if (e >>>= 0,
  36402. e < 0 || e + 1 > this.buffer.byteLength)
  36403. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36404. }
  36405. var i = this.view[e];
  36406. return t && (this.offset += 1),
  36407. i
  36408. }
  36409. ,
  36410. a.readUInt8 = a.readUint8,
  36411. a.writeInt16 = function(e, t) {
  36412. var i = "undefined" == typeof t;
  36413. if (i && (t = this.offset),
  36414. !this.noAssert) {
  36415. if ("number" != typeof e || e % 1 !== 0)
  36416. throw TypeError("Illegal value: " + e + " (not an integer)");
  36417. if (e |= 0,
  36418. "number" != typeof t || t % 1 !== 0)
  36419. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36420. if (t >>>= 0,
  36421. t < 0 || t + 0 > this.buffer.byteLength)
  36422. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36423. }
  36424. t += 2;
  36425. var n = this.buffer.byteLength;
  36426. return t > n && this.resize((n *= 2) > t ? n : t),
  36427. t -= 2,
  36428. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36429. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36430. this.view[t + 1] = 255 & e),
  36431. i && (this.offset += 2),
  36432. this
  36433. }
  36434. ,
  36435. a.writeShort = a.writeInt16,
  36436. a.readInt16 = function(e) {
  36437. var t = "undefined" == typeof e;
  36438. if (t && (e = this.offset),
  36439. !this.noAssert) {
  36440. if ("number" != typeof e || e % 1 !== 0)
  36441. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36442. if (e >>>= 0,
  36443. e < 0 || e + 2 > this.buffer.byteLength)
  36444. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36445. }
  36446. var i = 0;
  36447. return this.littleEndian ? (i = this.view[e],
  36448. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36449. i |= this.view[e + 1]),
  36450. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  36451. t && (this.offset += 2),
  36452. i
  36453. }
  36454. ,
  36455. a.readShort = a.readInt16,
  36456. a.writeUint16 = function(e, t) {
  36457. var i = "undefined" == typeof t;
  36458. if (i && (t = this.offset),
  36459. !this.noAssert) {
  36460. if ("number" != typeof e || e % 1 !== 0)
  36461. throw TypeError("Illegal value: " + e + " (not an integer)");
  36462. if (e >>>= 0,
  36463. "number" != typeof t || t % 1 !== 0)
  36464. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36465. if (t >>>= 0,
  36466. t < 0 || t + 0 > this.buffer.byteLength)
  36467. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36468. }
  36469. t += 2;
  36470. var n = this.buffer.byteLength;
  36471. return t > n && this.resize((n *= 2) > t ? n : t),
  36472. t -= 2,
  36473. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36474. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36475. this.view[t + 1] = 255 & e),
  36476. i && (this.offset += 2),
  36477. this
  36478. }
  36479. ,
  36480. a.writeUInt16 = a.writeUint16,
  36481. a.readUint16 = function(e) {
  36482. var t = "undefined" == typeof e;
  36483. if (t && (e = this.offset),
  36484. !this.noAssert) {
  36485. if ("number" != typeof e || e % 1 !== 0)
  36486. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36487. if (e >>>= 0,
  36488. e < 0 || e + 2 > this.buffer.byteLength)
  36489. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  36490. }
  36491. var i = 0;
  36492. return this.littleEndian ? (i = this.view[e],
  36493. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  36494. i |= this.view[e + 1]),
  36495. t && (this.offset += 2),
  36496. i
  36497. }
  36498. ,
  36499. a.readUInt16 = a.readUint16,
  36500. a.writeInt32 = function(e, t) {
  36501. var i = "undefined" == typeof t;
  36502. if (i && (t = this.offset),
  36503. !this.noAssert) {
  36504. if ("number" != typeof e || e % 1 !== 0)
  36505. throw TypeError("Illegal value: " + e + " (not an integer)");
  36506. if (e |= 0,
  36507. "number" != typeof t || t % 1 !== 0)
  36508. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36509. if (t >>>= 0,
  36510. t < 0 || t + 0 > this.buffer.byteLength)
  36511. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36512. }
  36513. t += 4;
  36514. var n = this.buffer.byteLength;
  36515. return t > n && this.resize((n *= 2) > t ? n : t),
  36516. t -= 4,
  36517. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36518. this.view[t + 2] = e >>> 16 & 255,
  36519. this.view[t + 1] = e >>> 8 & 255,
  36520. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36521. this.view[t + 1] = e >>> 16 & 255,
  36522. this.view[t + 2] = e >>> 8 & 255,
  36523. this.view[t + 3] = 255 & e),
  36524. i && (this.offset += 4),
  36525. this
  36526. }
  36527. ,
  36528. a.writeInt = a.writeInt32,
  36529. a.readInt32 = function(e) {
  36530. var t = "undefined" == typeof e;
  36531. if (t && (e = this.offset),
  36532. !this.noAssert) {
  36533. if ("number" != typeof e || e % 1 !== 0)
  36534. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36535. if (e >>>= 0,
  36536. e < 0 || e + 4 > this.buffer.byteLength)
  36537. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36538. }
  36539. var i = 0;
  36540. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36541. i |= this.view[e + 1] << 8,
  36542. i |= this.view[e],
  36543. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36544. i |= this.view[e + 2] << 8,
  36545. i |= this.view[e + 3],
  36546. i += this.view[e] << 24 >>> 0),
  36547. i |= 0,
  36548. t && (this.offset += 4),
  36549. i
  36550. }
  36551. ,
  36552. a.readInt = a.readInt32,
  36553. a.writeUint32 = function(e, t) {
  36554. var i = "undefined" == typeof t;
  36555. if (i && (t = this.offset),
  36556. !this.noAssert) {
  36557. if ("number" != typeof e || e % 1 !== 0)
  36558. throw TypeError("Illegal value: " + e + " (not an integer)");
  36559. if (e >>>= 0,
  36560. "number" != typeof t || t % 1 !== 0)
  36561. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36562. if (t >>>= 0,
  36563. t < 0 || t + 0 > this.buffer.byteLength)
  36564. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36565. }
  36566. t += 4;
  36567. var n = this.buffer.byteLength;
  36568. return t > n && this.resize((n *= 2) > t ? n : t),
  36569. t -= 4,
  36570. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  36571. this.view[t + 2] = e >>> 16 & 255,
  36572. this.view[t + 1] = e >>> 8 & 255,
  36573. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  36574. this.view[t + 1] = e >>> 16 & 255,
  36575. this.view[t + 2] = e >>> 8 & 255,
  36576. this.view[t + 3] = 255 & e),
  36577. i && (this.offset += 4),
  36578. this
  36579. }
  36580. ,
  36581. a.writeUInt32 = a.writeUint32,
  36582. a.readUint32 = function(e) {
  36583. var t = "undefined" == typeof e;
  36584. if (t && (e = this.offset),
  36585. !this.noAssert) {
  36586. if ("number" != typeof e || e % 1 !== 0)
  36587. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36588. if (e >>>= 0,
  36589. e < 0 || e + 4 > this.buffer.byteLength)
  36590. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36591. }
  36592. var i = 0;
  36593. return this.littleEndian ? (i = this.view[e + 2] << 16,
  36594. i |= this.view[e + 1] << 8,
  36595. i |= this.view[e],
  36596. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  36597. i |= this.view[e + 2] << 8,
  36598. i |= this.view[e + 3],
  36599. i += this.view[e] << 24 >>> 0),
  36600. t && (this.offset += 4),
  36601. i
  36602. }
  36603. ,
  36604. a.readUInt32 = a.readUint32,
  36605. e && (a.writeInt64 = function(t, i) {
  36606. var n = "undefined" == typeof i;
  36607. if (n && (i = this.offset),
  36608. !this.noAssert) {
  36609. if ("number" == typeof t)
  36610. t = e.fromNumber(t);
  36611. else if ("string" == typeof t)
  36612. t = e.fromString(t);
  36613. else if (!(t && t instanceof e))
  36614. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36615. if ("number" != typeof i || i % 1 !== 0)
  36616. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36617. if (i >>>= 0,
  36618. i < 0 || i + 0 > this.buffer.byteLength)
  36619. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36620. }
  36621. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36622. i += 8;
  36623. var r = this.buffer.byteLength;
  36624. i > r && this.resize((r *= 2) > i ? r : i),
  36625. i -= 8;
  36626. var o = t.low
  36627. , a = t.high;
  36628. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36629. this.view[i + 2] = o >>> 16 & 255,
  36630. this.view[i + 1] = o >>> 8 & 255,
  36631. this.view[i] = 255 & o,
  36632. i += 4,
  36633. this.view[i + 3] = a >>> 24 & 255,
  36634. this.view[i + 2] = a >>> 16 & 255,
  36635. this.view[i + 1] = a >>> 8 & 255,
  36636. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36637. this.view[i + 1] = a >>> 16 & 255,
  36638. this.view[i + 2] = a >>> 8 & 255,
  36639. this.view[i + 3] = 255 & a,
  36640. i += 4,
  36641. this.view[i] = o >>> 24 & 255,
  36642. this.view[i + 1] = o >>> 16 & 255,
  36643. this.view[i + 2] = o >>> 8 & 255,
  36644. this.view[i + 3] = 255 & o),
  36645. n && (this.offset += 8),
  36646. this
  36647. }
  36648. ,
  36649. a.writeLong = a.writeInt64,
  36650. a.readInt64 = function(t) {
  36651. var i = "undefined" == typeof t;
  36652. if (i && (t = this.offset),
  36653. !this.noAssert) {
  36654. if ("number" != typeof t || t % 1 !== 0)
  36655. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36656. if (t >>>= 0,
  36657. t < 0 || t + 8 > this.buffer.byteLength)
  36658. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36659. }
  36660. var n = 0
  36661. , r = 0;
  36662. this.littleEndian ? (n = this.view[t + 2] << 16,
  36663. n |= this.view[t + 1] << 8,
  36664. n |= this.view[t],
  36665. n += this.view[t + 3] << 24 >>> 0,
  36666. t += 4,
  36667. r = this.view[t + 2] << 16,
  36668. r |= this.view[t + 1] << 8,
  36669. r |= this.view[t],
  36670. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36671. r |= this.view[t + 2] << 8,
  36672. r |= this.view[t + 3],
  36673. r += this.view[t] << 24 >>> 0,
  36674. t += 4,
  36675. n = this.view[t + 1] << 16,
  36676. n |= this.view[t + 2] << 8,
  36677. n |= this.view[t + 3],
  36678. n += this.view[t] << 24 >>> 0);
  36679. var o = new e(n,r,!1);
  36680. return i && (this.offset += 8),
  36681. o
  36682. }
  36683. ,
  36684. a.readLong = a.readInt64,
  36685. a.writeUint64 = function(t, i) {
  36686. var n = "undefined" == typeof i;
  36687. if (n && (i = this.offset),
  36688. !this.noAssert) {
  36689. if ("number" == typeof t)
  36690. t = e.fromNumber(t);
  36691. else if ("string" == typeof t)
  36692. t = e.fromString(t);
  36693. else if (!(t && t instanceof e))
  36694. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36695. if ("number" != typeof i || i % 1 !== 0)
  36696. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36697. if (i >>>= 0,
  36698. i < 0 || i + 0 > this.buffer.byteLength)
  36699. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36700. }
  36701. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  36702. i += 8;
  36703. var r = this.buffer.byteLength;
  36704. i > r && this.resize((r *= 2) > i ? r : i),
  36705. i -= 8;
  36706. var o = t.low
  36707. , a = t.high;
  36708. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  36709. this.view[i + 2] = o >>> 16 & 255,
  36710. this.view[i + 1] = o >>> 8 & 255,
  36711. this.view[i] = 255 & o,
  36712. i += 4,
  36713. this.view[i + 3] = a >>> 24 & 255,
  36714. this.view[i + 2] = a >>> 16 & 255,
  36715. this.view[i + 1] = a >>> 8 & 255,
  36716. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  36717. this.view[i + 1] = a >>> 16 & 255,
  36718. this.view[i + 2] = a >>> 8 & 255,
  36719. this.view[i + 3] = 255 & a,
  36720. i += 4,
  36721. this.view[i] = o >>> 24 & 255,
  36722. this.view[i + 1] = o >>> 16 & 255,
  36723. this.view[i + 2] = o >>> 8 & 255,
  36724. this.view[i + 3] = 255 & o),
  36725. n && (this.offset += 8),
  36726. this
  36727. }
  36728. ,
  36729. a.writeUInt64 = a.writeUint64,
  36730. a.readUint64 = function(t) {
  36731. var i = "undefined" == typeof t;
  36732. if (i && (t = this.offset),
  36733. !this.noAssert) {
  36734. if ("number" != typeof t || t % 1 !== 0)
  36735. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36736. if (t >>>= 0,
  36737. t < 0 || t + 8 > this.buffer.byteLength)
  36738. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  36739. }
  36740. var n = 0
  36741. , r = 0;
  36742. this.littleEndian ? (n = this.view[t + 2] << 16,
  36743. n |= this.view[t + 1] << 8,
  36744. n |= this.view[t],
  36745. n += this.view[t + 3] << 24 >>> 0,
  36746. t += 4,
  36747. r = this.view[t + 2] << 16,
  36748. r |= this.view[t + 1] << 8,
  36749. r |= this.view[t],
  36750. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  36751. r |= this.view[t + 2] << 8,
  36752. r |= this.view[t + 3],
  36753. r += this.view[t] << 24 >>> 0,
  36754. t += 4,
  36755. n = this.view[t + 1] << 16,
  36756. n |= this.view[t + 2] << 8,
  36757. n |= this.view[t + 3],
  36758. n += this.view[t] << 24 >>> 0);
  36759. var o = new e(n,r,!0);
  36760. return i && (this.offset += 8),
  36761. o
  36762. }
  36763. ,
  36764. a.readUInt64 = a.readUint64),
  36765. a.writeFloat32 = function(e, t) {
  36766. var i = "undefined" == typeof t;
  36767. if (i && (t = this.offset),
  36768. !this.noAssert) {
  36769. if ("number" != typeof e)
  36770. throw TypeError("Illegal value: " + e + " (not a number)");
  36771. if ("number" != typeof t || t % 1 !== 0)
  36772. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36773. if (t >>>= 0,
  36774. t < 0 || t + 0 > this.buffer.byteLength)
  36775. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36776. }
  36777. t += 4;
  36778. var n = this.buffer.byteLength;
  36779. return t > n && this.resize((n *= 2) > t ? n : t),
  36780. t -= 4,
  36781. r(this.view, e, t, this.littleEndian, 23, 4),
  36782. i && (this.offset += 4),
  36783. this
  36784. }
  36785. ,
  36786. a.writeFloat = a.writeFloat32,
  36787. a.readFloat32 = function(e) {
  36788. var t = "undefined" == typeof e;
  36789. if (t && (e = this.offset),
  36790. !this.noAssert) {
  36791. if ("number" != typeof e || e % 1 !== 0)
  36792. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36793. if (e >>>= 0,
  36794. e < 0 || e + 4 > this.buffer.byteLength)
  36795. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  36796. }
  36797. var i = n(this.view, e, this.littleEndian, 23, 4);
  36798. return t && (this.offset += 4),
  36799. i
  36800. }
  36801. ,
  36802. a.readFloat = a.readFloat32,
  36803. a.writeFloat64 = function(e, t) {
  36804. var i = "undefined" == typeof t;
  36805. if (i && (t = this.offset),
  36806. !this.noAssert) {
  36807. if ("number" != typeof e)
  36808. throw TypeError("Illegal value: " + e + " (not a number)");
  36809. if ("number" != typeof t || t % 1 !== 0)
  36810. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36811. if (t >>>= 0,
  36812. t < 0 || t + 0 > this.buffer.byteLength)
  36813. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36814. }
  36815. t += 8;
  36816. var n = this.buffer.byteLength;
  36817. return t > n && this.resize((n *= 2) > t ? n : t),
  36818. t -= 8,
  36819. r(this.view, e, t, this.littleEndian, 52, 8),
  36820. i && (this.offset += 8),
  36821. this
  36822. }
  36823. ,
  36824. a.writeDouble = a.writeFloat64,
  36825. a.readFloat64 = function(e) {
  36826. var t = "undefined" == typeof e;
  36827. if (t && (e = this.offset),
  36828. !this.noAssert) {
  36829. if ("number" != typeof e || e % 1 !== 0)
  36830. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36831. if (e >>>= 0,
  36832. e < 0 || e + 8 > this.buffer.byteLength)
  36833. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  36834. }
  36835. var i = n(this.view, e, this.littleEndian, 52, 8);
  36836. return t && (this.offset += 8),
  36837. i
  36838. }
  36839. ,
  36840. a.readDouble = a.readFloat64,
  36841. o.MAX_VARINT32_BYTES = 5,
  36842. o.calculateVarint32 = function(e) {
  36843. return e >>>= 0,
  36844. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  36845. }
  36846. ,
  36847. o.zigZagEncode32 = function(e) {
  36848. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  36849. }
  36850. ,
  36851. o.zigZagDecode32 = function(e) {
  36852. return e >>> 1 ^ -(1 & e) | 0
  36853. }
  36854. ,
  36855. a.writeVarint32 = function(e, t) {
  36856. var i = "undefined" == typeof t;
  36857. if (i && (t = this.offset),
  36858. !this.noAssert) {
  36859. if ("number" != typeof e || e % 1 !== 0)
  36860. throw TypeError("Illegal value: " + e + " (not an integer)");
  36861. if (e |= 0,
  36862. "number" != typeof t || t % 1 !== 0)
  36863. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36864. if (t >>>= 0,
  36865. t < 0 || t + 0 > this.buffer.byteLength)
  36866. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36867. }
  36868. var n, r = o.calculateVarint32(e);
  36869. t += r;
  36870. var a = this.buffer.byteLength;
  36871. for (t > a && this.resize((a *= 2) > t ? a : t),
  36872. t -= r,
  36873. e >>>= 0; e >= 128; )
  36874. n = 127 & e | 128,
  36875. this.view[t++] = n,
  36876. e >>>= 7;
  36877. return this.view[t++] = e,
  36878. i ? (this.offset = t,
  36879. this) : r
  36880. }
  36881. ,
  36882. a.writeVarint32ZigZag = function(e, t) {
  36883. return this.writeVarint32(o.zigZagEncode32(e), t)
  36884. }
  36885. ,
  36886. a.readVarint32 = function(e) {
  36887. var t = "undefined" == typeof e;
  36888. if (t && (e = this.offset),
  36889. !this.noAssert) {
  36890. if ("number" != typeof e || e % 1 !== 0)
  36891. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36892. if (e >>>= 0,
  36893. e < 0 || e + 1 > this.buffer.byteLength)
  36894. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36895. }
  36896. var i, n = 0, r = 0;
  36897. do {
  36898. if (!this.noAssert && e > this.limit) {
  36899. var o = Error("Truncated");
  36900. throw o.truncated = !0,
  36901. o
  36902. }
  36903. i = this.view[e++],
  36904. n < 5 && (r |= (127 & i) << 7 * n),
  36905. ++n
  36906. } while (0 !== (128 & i));return r |= 0,
  36907. t ? (this.offset = e,
  36908. r) : {
  36909. value: r,
  36910. length: n
  36911. }
  36912. }
  36913. ,
  36914. a.readVarint32ZigZag = function(e) {
  36915. var t = this.readVarint32(e);
  36916. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  36917. t
  36918. }
  36919. ,
  36920. e && (o.MAX_VARINT64_BYTES = 10,
  36921. o.calculateVarint64 = function(t) {
  36922. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  36923. var i = t.toInt() >>> 0
  36924. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  36925. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  36926. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  36927. }
  36928. ,
  36929. o.zigZagEncode64 = function(t) {
  36930. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36931. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  36932. }
  36933. ,
  36934. o.zigZagDecode64 = function(t) {
  36935. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  36936. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  36937. }
  36938. ,
  36939. a.writeVarint64 = function(t, i) {
  36940. var n = "undefined" == typeof i;
  36941. if (n && (i = this.offset),
  36942. !this.noAssert) {
  36943. if ("number" == typeof t)
  36944. t = e.fromNumber(t);
  36945. else if ("string" == typeof t)
  36946. t = e.fromString(t);
  36947. else if (!(t && t instanceof e))
  36948. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  36949. if ("number" != typeof i || i % 1 !== 0)
  36950. throw TypeError("Illegal offset: " + i + " (not an integer)");
  36951. if (i >>>= 0,
  36952. i < 0 || i + 0 > this.buffer.byteLength)
  36953. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  36954. }
  36955. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  36956. var r = o.calculateVarint64(t)
  36957. , a = t.toInt() >>> 0
  36958. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  36959. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  36960. i += r;
  36961. var c = this.buffer.byteLength;
  36962. switch (i > c && this.resize((c *= 2) > i ? c : i),
  36963. i -= r,
  36964. r) {
  36965. case 10:
  36966. this.view[i + 9] = l >>> 7 & 1;
  36967. case 9:
  36968. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  36969. case 8:
  36970. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  36971. case 7:
  36972. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  36973. case 6:
  36974. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  36975. case 5:
  36976. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  36977. case 4:
  36978. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  36979. case 3:
  36980. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  36981. case 2:
  36982. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  36983. case 1:
  36984. this.view[i] = 1 !== r ? 128 | a : 127 & a
  36985. }
  36986. return n ? (this.offset += r,
  36987. this) : r
  36988. }
  36989. ,
  36990. a.writeVarint64ZigZag = function(e, t) {
  36991. return this.writeVarint64(o.zigZagEncode64(e), t)
  36992. }
  36993. ,
  36994. a.readVarint64 = function(t) {
  36995. var i = "undefined" == typeof t;
  36996. if (i && (t = this.offset),
  36997. !this.noAssert) {
  36998. if ("number" != typeof t || t % 1 !== 0)
  36999. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37000. if (t >>>= 0,
  37001. t < 0 || t + 1 > this.buffer.byteLength)
  37002. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37003. }
  37004. var n = t
  37005. , r = 0
  37006. , o = 0
  37007. , a = 0
  37008. , s = 0;
  37009. if (s = this.view[t++],
  37010. r = 127 & s,
  37011. 128 & s && (s = this.view[t++],
  37012. r |= (127 & s) << 7,
  37013. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37014. r |= (127 & s) << 14,
  37015. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37016. r |= (127 & s) << 21,
  37017. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37018. o = 127 & s,
  37019. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37020. o |= (127 & s) << 7,
  37021. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37022. o |= (127 & s) << 14,
  37023. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37024. o |= (127 & s) << 21,
  37025. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37026. a = 127 & s,
  37027. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37028. a |= (127 & s) << 7,
  37029. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37030. throw Error("Buffer overrun");
  37031. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37032. return i ? (this.offset = t,
  37033. l) : {
  37034. value: l,
  37035. length: t - n
  37036. }
  37037. }
  37038. ,
  37039. a.readVarint64ZigZag = function(t) {
  37040. var i = this.readVarint64(t);
  37041. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37042. i
  37043. }
  37044. ),
  37045. a.writeCString = function(e, i) {
  37046. var n = "undefined" == typeof i;
  37047. n && (i = this.offset);
  37048. var r, o = e.length;
  37049. if (!this.noAssert) {
  37050. if ("string" != typeof e)
  37051. throw TypeError("Illegal str: Not a string");
  37052. for (r = 0; r < o; ++r)
  37053. if (0 === e.charCodeAt(r))
  37054. throw RangeError("Illegal str: Contains NULL-characters");
  37055. if ("number" != typeof i || i % 1 !== 0)
  37056. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37057. if (i >>>= 0,
  37058. i < 0 || i + 0 > this.buffer.byteLength)
  37059. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37060. }
  37061. o = h.calculateUTF16asUTF8(t(e))[1],
  37062. i += o + 1;
  37063. var a = this.buffer.byteLength;
  37064. return i > a && this.resize((a *= 2) > i ? a : i),
  37065. i -= o + 1,
  37066. h.encodeUTF16toUTF8(t(e), function(e) {
  37067. this.view[i++] = e
  37068. }
  37069. .bind(this)),
  37070. this.view[i++] = 0,
  37071. n ? (this.offset = i,
  37072. this) : o
  37073. }
  37074. ,
  37075. a.readCString = function(e) {
  37076. var t = "undefined" == typeof e;
  37077. if (t && (e = this.offset),
  37078. !this.noAssert) {
  37079. if ("number" != typeof e || e % 1 !== 0)
  37080. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37081. if (e >>>= 0,
  37082. e < 0 || e + 1 > this.buffer.byteLength)
  37083. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37084. }
  37085. var n, r = e, o = -1;
  37086. return h.decodeUTF8toUTF16(function() {
  37087. if (0 === o)
  37088. return null;
  37089. if (e >= this.limit)
  37090. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37091. return o = this.view[e++],
  37092. 0 === o ? null : o
  37093. }
  37094. .bind(this), n = i(), !0),
  37095. t ? (this.offset = e,
  37096. n()) : {
  37097. string: n(),
  37098. length: e - r
  37099. }
  37100. }
  37101. ,
  37102. a.writeIString = function(e, i) {
  37103. var n = "undefined" == typeof i;
  37104. if (n && (i = this.offset),
  37105. !this.noAssert) {
  37106. if ("string" != typeof e)
  37107. throw TypeError("Illegal str: Not a string");
  37108. if ("number" != typeof i || i % 1 !== 0)
  37109. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37110. if (i >>>= 0,
  37111. i < 0 || i + 0 > this.buffer.byteLength)
  37112. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37113. }
  37114. var r, o = i;
  37115. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37116. i += 4 + r;
  37117. var a = this.buffer.byteLength;
  37118. if (i > a && this.resize((a *= 2) > i ? a : i),
  37119. i -= 4 + r,
  37120. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37121. this.view[i + 2] = r >>> 16 & 255,
  37122. this.view[i + 1] = r >>> 8 & 255,
  37123. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37124. this.view[i + 1] = r >>> 16 & 255,
  37125. this.view[i + 2] = r >>> 8 & 255,
  37126. this.view[i + 3] = 255 & r),
  37127. i += 4,
  37128. h.encodeUTF16toUTF8(t(e), function(e) {
  37129. this.view[i++] = e
  37130. }
  37131. .bind(this)),
  37132. i !== o + 4 + r)
  37133. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37134. return n ? (this.offset = i,
  37135. this) : i - o
  37136. }
  37137. ,
  37138. a.readIString = function(e) {
  37139. var t = "undefined" == typeof e;
  37140. if (t && (e = this.offset),
  37141. !this.noAssert) {
  37142. if ("number" != typeof e || e % 1 !== 0)
  37143. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37144. if (e >>>= 0,
  37145. e < 0 || e + 4 > this.buffer.byteLength)
  37146. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37147. }
  37148. var i = e
  37149. , n = this.readUint32(e)
  37150. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37151. return e += r.length,
  37152. t ? (this.offset = e,
  37153. r.string) : {
  37154. string: r.string,
  37155. length: e - i
  37156. }
  37157. }
  37158. ,
  37159. o.METRICS_CHARS = "c",
  37160. o.METRICS_BYTES = "b",
  37161. a.writeUTF8String = function(e, i) {
  37162. var n = "undefined" == typeof i;
  37163. if (n && (i = this.offset),
  37164. !this.noAssert) {
  37165. if ("number" != typeof i || i % 1 !== 0)
  37166. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37167. if (i >>>= 0,
  37168. i < 0 || i + 0 > this.buffer.byteLength)
  37169. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37170. }
  37171. var r, o = i;
  37172. r = h.calculateUTF16asUTF8(t(e))[1],
  37173. i += r;
  37174. var a = this.buffer.byteLength;
  37175. return i > a && this.resize((a *= 2) > i ? a : i),
  37176. i -= r,
  37177. h.encodeUTF16toUTF8(t(e), function(e) {
  37178. this.view[i++] = e
  37179. }
  37180. .bind(this)),
  37181. n ? (this.offset = i,
  37182. this) : i - o
  37183. }
  37184. ,
  37185. a.writeString = a.writeUTF8String,
  37186. o.calculateUTF8Chars = function(e) {
  37187. return h.calculateUTF16asUTF8(t(e))[0]
  37188. }
  37189. ,
  37190. o.calculateUTF8Bytes = function(e) {
  37191. return h.calculateUTF16asUTF8(t(e))[1]
  37192. }
  37193. ,
  37194. o.calculateString = o.calculateUTF8Bytes,
  37195. a.readUTF8String = function(e, t, n) {
  37196. "number" == typeof t && (n = t,
  37197. t = void 0);
  37198. var r = "undefined" == typeof n;
  37199. if (r && (n = this.offset),
  37200. "undefined" == typeof t && (t = o.METRICS_CHARS),
  37201. !this.noAssert) {
  37202. if ("number" != typeof e || e % 1 !== 0)
  37203. throw TypeError("Illegal length: " + e + " (not an integer)");
  37204. if (e |= 0,
  37205. "number" != typeof n || n % 1 !== 0)
  37206. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37207. if (n >>>= 0,
  37208. n < 0 || n + 0 > this.buffer.byteLength)
  37209. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  37210. }
  37211. var a, s = 0, l = n;
  37212. if (t === o.METRICS_CHARS) {
  37213. if (a = i(),
  37214. h.decodeUTF8(function() {
  37215. return s < e && n < this.limit ? this.view[n++] : null
  37216. }
  37217. .bind(this), function(e) {
  37218. ++s,
  37219. h.UTF8toUTF16(e, a)
  37220. }),
  37221. s !== e)
  37222. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  37223. return r ? (this.offset = n,
  37224. a()) : {
  37225. string: a(),
  37226. length: n - l
  37227. }
  37228. }
  37229. if (t === o.METRICS_BYTES) {
  37230. if (!this.noAssert) {
  37231. if ("number" != typeof n || n % 1 !== 0)
  37232. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37233. if (n >>>= 0,
  37234. n < 0 || n + e > this.buffer.byteLength)
  37235. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  37236. }
  37237. var c = n + e;
  37238. if (h.decodeUTF8toUTF16(function() {
  37239. return n < c ? this.view[n++] : null
  37240. }
  37241. .bind(this), a = i(), this.noAssert),
  37242. n !== c)
  37243. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  37244. return r ? (this.offset = n,
  37245. a()) : {
  37246. string: a(),
  37247. length: n - l
  37248. }
  37249. }
  37250. throw TypeError("Unsupported metrics: " + t)
  37251. }
  37252. ,
  37253. a.readString = a.readUTF8String,
  37254. a.writeVString = function(e, i) {
  37255. var n = "undefined" == typeof i;
  37256. if (n && (i = this.offset),
  37257. !this.noAssert) {
  37258. if ("string" != typeof e)
  37259. throw TypeError("Illegal str: Not a string");
  37260. if ("number" != typeof i || i % 1 !== 0)
  37261. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37262. if (i >>>= 0,
  37263. i < 0 || i + 0 > this.buffer.byteLength)
  37264. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37265. }
  37266. var r, a, s = i;
  37267. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37268. a = o.calculateVarint32(r),
  37269. i += a + r;
  37270. var l = this.buffer.byteLength;
  37271. if (i > l && this.resize((l *= 2) > i ? l : i),
  37272. i -= a + r,
  37273. i += this.writeVarint32(r, i),
  37274. h.encodeUTF16toUTF8(t(e), function(e) {
  37275. this.view[i++] = e
  37276. }
  37277. .bind(this)),
  37278. i !== s + r + a)
  37279. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  37280. return n ? (this.offset = i,
  37281. this) : i - s
  37282. }
  37283. ,
  37284. a.readVString = function(e) {
  37285. var t = "undefined" == typeof e;
  37286. if (t && (e = this.offset),
  37287. !this.noAssert) {
  37288. if ("number" != typeof e || e % 1 !== 0)
  37289. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37290. if (e >>>= 0,
  37291. e < 0 || e + 1 > this.buffer.byteLength)
  37292. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37293. }
  37294. var i = e
  37295. , n = this.readVarint32(e)
  37296. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  37297. return e += r.length,
  37298. t ? (this.offset = e,
  37299. r.string) : {
  37300. string: r.string,
  37301. length: e - i
  37302. }
  37303. }
  37304. ,
  37305. a.append = function(e, t, i) {
  37306. "number" != typeof t && "string" == typeof t || (i = t,
  37307. t = void 0);
  37308. var n = "undefined" == typeof i;
  37309. if (n && (i = this.offset),
  37310. !this.noAssert) {
  37311. if ("number" != typeof i || i % 1 !== 0)
  37312. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37313. if (i >>>= 0,
  37314. i < 0 || i + 0 > this.buffer.byteLength)
  37315. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37316. }
  37317. e instanceof o || (e = o.wrap(e, t));
  37318. var r = e.limit - e.offset;
  37319. if (r <= 0)
  37320. return this;
  37321. i += r;
  37322. var a = this.buffer.byteLength;
  37323. return i > a && this.resize((a *= 2) > i ? a : i),
  37324. i -= r,
  37325. this.view.set(e.view.subarray(e.offset, e.limit), i),
  37326. e.offset += r,
  37327. n && (this.offset += r),
  37328. this
  37329. }
  37330. ,
  37331. a.appendTo = function(e, t) {
  37332. return e.append(this, t),
  37333. this
  37334. }
  37335. ,
  37336. a.assert = function(e) {
  37337. return this.noAssert = !e,
  37338. this
  37339. }
  37340. ,
  37341. a.capacity = function() {
  37342. return this.buffer.byteLength
  37343. }
  37344. ,
  37345. a.clear = function() {
  37346. return this.offset = 0,
  37347. this.limit = this.buffer.byteLength,
  37348. this.markedOffset = -1,
  37349. this
  37350. }
  37351. ,
  37352. a.clone = function(e) {
  37353. var t = new o(0,this.littleEndian,this.noAssert);
  37354. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  37355. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  37356. t.view = this.view),
  37357. t.offset = this.offset,
  37358. t.markedOffset = this.markedOffset,
  37359. t.limit = this.limit,
  37360. t
  37361. }
  37362. ,
  37363. a.compact = function(e, t) {
  37364. if ("undefined" == typeof e && (e = this.offset),
  37365. "undefined" == typeof t && (t = this.limit),
  37366. !this.noAssert) {
  37367. if ("number" != typeof e || e % 1 !== 0)
  37368. throw TypeError("Illegal begin: Not an integer");
  37369. if (e >>>= 0,
  37370. "number" != typeof t || t % 1 !== 0)
  37371. throw TypeError("Illegal end: Not an integer");
  37372. if (t >>>= 0,
  37373. e < 0 || e > t || t > this.buffer.byteLength)
  37374. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37375. }
  37376. if (0 === e && t === this.buffer.byteLength)
  37377. return this;
  37378. var i = t - e;
  37379. if (0 === i)
  37380. return this.buffer = s,
  37381. this.view = null,
  37382. this.markedOffset >= 0 && (this.markedOffset -= e),
  37383. this.offset = 0,
  37384. this.limit = 0,
  37385. this;
  37386. var n = new ArrayBuffer(i)
  37387. , r = new Uint8Array(n);
  37388. return r.set(this.view.subarray(e, t)),
  37389. this.buffer = n,
  37390. this.view = r,
  37391. this.markedOffset >= 0 && (this.markedOffset -= e),
  37392. this.offset = 0,
  37393. this.limit = i,
  37394. this
  37395. }
  37396. ,
  37397. a.copy = function(e, t) {
  37398. if ("undefined" == typeof e && (e = this.offset),
  37399. "undefined" == typeof t && (t = this.limit),
  37400. !this.noAssert) {
  37401. if ("number" != typeof e || e % 1 !== 0)
  37402. throw TypeError("Illegal begin: Not an integer");
  37403. if (e >>>= 0,
  37404. "number" != typeof t || t % 1 !== 0)
  37405. throw TypeError("Illegal end: Not an integer");
  37406. if (t >>>= 0,
  37407. e < 0 || e > t || t > this.buffer.byteLength)
  37408. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37409. }
  37410. if (e === t)
  37411. return new o(0,this.littleEndian,this.noAssert);
  37412. var i = t - e
  37413. , n = new o(i,this.littleEndian,this.noAssert);
  37414. return n.offset = 0,
  37415. n.limit = i,
  37416. n.markedOffset >= 0 && (n.markedOffset -= e),
  37417. this.copyTo(n, 0, e, t),
  37418. n
  37419. }
  37420. ,
  37421. a.copyTo = function(e, t, i, n) {
  37422. var r, a;
  37423. if (!this.noAssert && !o.isByteBuffer(e))
  37424. throw TypeError("Illegal target: Not a ByteBuffer");
  37425. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  37426. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  37427. n = "undefined" == typeof n ? this.limit : 0 | n,
  37428. t < 0 || t > e.buffer.byteLength)
  37429. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  37430. if (i < 0 || n > this.buffer.byteLength)
  37431. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  37432. var s = n - i;
  37433. return 0 === s ? e : (e.ensureCapacity(t + s),
  37434. e.view.set(this.view.subarray(i, n), t),
  37435. r && (this.offset += s),
  37436. a && (e.offset += s),
  37437. this)
  37438. }
  37439. ,
  37440. a.ensureCapacity = function(e) {
  37441. var t = this.buffer.byteLength;
  37442. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  37443. }
  37444. ,
  37445. a.fill = function(e, t, i) {
  37446. var n = "undefined" == typeof t;
  37447. if (n && (t = this.offset),
  37448. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  37449. "undefined" == typeof t && (t = this.offset),
  37450. "undefined" == typeof i && (i = this.limit),
  37451. !this.noAssert) {
  37452. if ("number" != typeof e || e % 1 !== 0)
  37453. throw TypeError("Illegal value: " + e + " (not an integer)");
  37454. if (e |= 0,
  37455. "number" != typeof t || t % 1 !== 0)
  37456. throw TypeError("Illegal begin: Not an integer");
  37457. if (t >>>= 0,
  37458. "number" != typeof i || i % 1 !== 0)
  37459. throw TypeError("Illegal end: Not an integer");
  37460. if (i >>>= 0,
  37461. t < 0 || t > i || i > this.buffer.byteLength)
  37462. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37463. }
  37464. if (t >= i)
  37465. return this;
  37466. for (; t < i; )
  37467. this.view[t++] = e;
  37468. return n && (this.offset = t),
  37469. this
  37470. }
  37471. ,
  37472. a.flip = function() {
  37473. return this.limit = this.offset,
  37474. this.offset = 0,
  37475. this
  37476. }
  37477. ,
  37478. a.mark = function(e) {
  37479. if (e = "undefined" == typeof e ? this.offset : e,
  37480. !this.noAssert) {
  37481. if ("number" != typeof e || e % 1 !== 0)
  37482. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37483. if (e >>>= 0,
  37484. e < 0 || e + 0 > this.buffer.byteLength)
  37485. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  37486. }
  37487. return this.markedOffset = e,
  37488. this
  37489. }
  37490. ,
  37491. a.order = function(e) {
  37492. if (!this.noAssert && "boolean" != typeof e)
  37493. throw TypeError("Illegal littleEndian: Not a boolean");
  37494. return this.littleEndian = !!e,
  37495. this
  37496. }
  37497. ,
  37498. a.LE = function(e) {
  37499. return this.littleEndian = "undefined" == typeof e || !!e,
  37500. this
  37501. }
  37502. ,
  37503. a.BE = function(e) {
  37504. return this.littleEndian = "undefined" != typeof e && !e,
  37505. this
  37506. }
  37507. ,
  37508. a.prepend = function(e, t, i) {
  37509. "number" != typeof t && "string" == typeof t || (i = t,
  37510. t = void 0);
  37511. var n = "undefined" == typeof i;
  37512. if (n && (i = this.offset),
  37513. !this.noAssert) {
  37514. if ("number" != typeof i || i % 1 !== 0)
  37515. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37516. if (i >>>= 0,
  37517. i < 0 || i + 0 > this.buffer.byteLength)
  37518. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37519. }
  37520. e instanceof o || (e = o.wrap(e, t));
  37521. var r = e.limit - e.offset;
  37522. if (r <= 0)
  37523. return this;
  37524. var a = r - i;
  37525. if (a > 0) {
  37526. var s = new ArrayBuffer(this.buffer.byteLength + a)
  37527. , l = new Uint8Array(s);
  37528. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  37529. this.buffer = s,
  37530. this.view = l,
  37531. this.offset += a,
  37532. this.markedOffset >= 0 && (this.markedOffset += a),
  37533. this.limit += a,
  37534. i += a
  37535. } else {
  37536. new Uint8Array(this.buffer)
  37537. }
  37538. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  37539. e.offset = e.limit,
  37540. n && (this.offset -= r),
  37541. this
  37542. }
  37543. ,
  37544. a.prependTo = function(e, t) {
  37545. return e.prepend(this, t),
  37546. this
  37547. }
  37548. ,
  37549. a.printDebug = function(e) {
  37550. "function" != typeof e && (e = console.log.bind(console)),
  37551. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  37552. }
  37553. ,
  37554. a.remaining = function() {
  37555. return this.limit - this.offset
  37556. }
  37557. ,
  37558. a.reset = function() {
  37559. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  37560. this.markedOffset = -1) : this.offset = 0,
  37561. this
  37562. }
  37563. ,
  37564. a.resize = function(e) {
  37565. if (!this.noAssert) {
  37566. if ("number" != typeof e || e % 1 !== 0)
  37567. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  37568. if (e |= 0,
  37569. e < 0)
  37570. throw RangeError("Illegal capacity: 0 <= " + e)
  37571. }
  37572. if (this.buffer.byteLength < e) {
  37573. var t = new ArrayBuffer(e)
  37574. , i = new Uint8Array(t);
  37575. i.set(this.view),
  37576. this.buffer = t,
  37577. this.view = i
  37578. }
  37579. return this
  37580. }
  37581. ,
  37582. a.reverse = function(e, t) {
  37583. if ("undefined" == typeof e && (e = this.offset),
  37584. "undefined" == typeof t && (t = this.limit),
  37585. !this.noAssert) {
  37586. if ("number" != typeof e || e % 1 !== 0)
  37587. throw TypeError("Illegal begin: Not an integer");
  37588. if (e >>>= 0,
  37589. "number" != typeof t || t % 1 !== 0)
  37590. throw TypeError("Illegal end: Not an integer");
  37591. if (t >>>= 0,
  37592. e < 0 || e > t || t > this.buffer.byteLength)
  37593. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37594. }
  37595. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  37596. this)
  37597. }
  37598. ,
  37599. a.skip = function(e) {
  37600. if (!this.noAssert) {
  37601. if ("number" != typeof e || e % 1 !== 0)
  37602. throw TypeError("Illegal length: " + e + " (not an integer)");
  37603. e |= 0
  37604. }
  37605. var t = this.offset + e;
  37606. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  37607. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  37608. return this.offset = t,
  37609. this
  37610. }
  37611. ,
  37612. a.slice = function(e, t) {
  37613. if ("undefined" == typeof e && (e = this.offset),
  37614. "undefined" == typeof t && (t = this.limit),
  37615. !this.noAssert) {
  37616. if ("number" != typeof e || e % 1 !== 0)
  37617. throw TypeError("Illegal begin: Not an integer");
  37618. if (e >>>= 0,
  37619. "number" != typeof t || t % 1 !== 0)
  37620. throw TypeError("Illegal end: Not an integer");
  37621. if (t >>>= 0,
  37622. e < 0 || e > t || t > this.buffer.byteLength)
  37623. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37624. }
  37625. var i = this.clone();
  37626. return i.offset = e,
  37627. i.limit = t,
  37628. i
  37629. }
  37630. ,
  37631. a.toBuffer = function(e) {
  37632. var t = this.offset
  37633. , i = this.limit;
  37634. if (!this.noAssert) {
  37635. if ("number" != typeof t || t % 1 !== 0)
  37636. throw TypeError("Illegal offset: Not an integer");
  37637. if (t >>>= 0,
  37638. "number" != typeof i || i % 1 !== 0)
  37639. throw TypeError("Illegal limit: Not an integer");
  37640. if (i >>>= 0,
  37641. t < 0 || t > i || i > this.buffer.byteLength)
  37642. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  37643. }
  37644. if (!e && 0 === t && i === this.buffer.byteLength)
  37645. return this.buffer;
  37646. if (t === i)
  37647. return s;
  37648. var n = new ArrayBuffer(i - t);
  37649. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  37650. n
  37651. }
  37652. ,
  37653. a.toArrayBuffer = a.toBuffer,
  37654. a.toString = function(e, t, i) {
  37655. if ("undefined" == typeof e)
  37656. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  37657. switch ("number" == typeof e && (e = "utf8",
  37658. t = e,
  37659. i = t),
  37660. e) {
  37661. case "utf8":
  37662. return this.toUTF8(t, i);
  37663. case "base64":
  37664. return this.toBase64(t, i);
  37665. case "hex":
  37666. return this.toHex(t, i);
  37667. case "binary":
  37668. return this.toBinary(t, i);
  37669. case "debug":
  37670. return this.toDebug();
  37671. case "columns":
  37672. return this.toColumns();
  37673. default:
  37674. throw Error("Unsupported encoding: " + e)
  37675. }
  37676. }
  37677. ;
  37678. var c = function() {
  37679. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  37680. i[t[n]] = n;
  37681. return e.encode = function(e, i) {
  37682. for (var n, r; null !== (n = e()); )
  37683. i(t[n >> 2 & 63]),
  37684. r = (3 & n) << 4,
  37685. null !== (n = e()) ? (r |= n >> 4 & 15,
  37686. i(t[63 & (r | n >> 4 & 15)]),
  37687. r = (15 & n) << 2,
  37688. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  37689. i(t[63 & n])) : (i(t[63 & r]),
  37690. i(61))) : (i(t[63 & r]),
  37691. i(61),
  37692. i(61))
  37693. }
  37694. ,
  37695. e.decode = function(e, t) {
  37696. function n(e) {
  37697. throw Error("Illegal character code: " + e)
  37698. }
  37699. for (var r, o, a; null !== (r = e()); )
  37700. if (o = i[r],
  37701. "undefined" == typeof o && n(r),
  37702. null !== (r = e()) && (a = i[r],
  37703. "undefined" == typeof a && n(r),
  37704. t(o << 2 >>> 0 | (48 & a) >> 4),
  37705. null !== (r = e()))) {
  37706. if (o = i[r],
  37707. "undefined" == typeof o) {
  37708. if (61 === r)
  37709. break;
  37710. n(r)
  37711. }
  37712. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  37713. null !== (r = e())) {
  37714. if (a = i[r],
  37715. "undefined" == typeof a) {
  37716. if (61 === r)
  37717. break;
  37718. n(r)
  37719. }
  37720. t((3 & o) << 6 >>> 0 | a)
  37721. }
  37722. }
  37723. }
  37724. ,
  37725. e.test = function(e) {
  37726. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  37727. }
  37728. ,
  37729. e
  37730. }();
  37731. a.toBase64 = function(e, t) {
  37732. if ("undefined" == typeof e && (e = this.offset),
  37733. "undefined" == typeof t && (t = this.limit),
  37734. e |= 0,
  37735. t |= 0,
  37736. e < 0 || t > this.capacity || e > t)
  37737. throw RangeError("begin, end");
  37738. var n;
  37739. return c.encode(function() {
  37740. return e < t ? this.view[e++] : null
  37741. }
  37742. .bind(this), n = i()),
  37743. n()
  37744. }
  37745. ,
  37746. o.fromBase64 = function(e, i) {
  37747. if ("string" != typeof e)
  37748. throw TypeError("str");
  37749. var n = new o(e.length / 4 * 3,i)
  37750. , r = 0;
  37751. return c.decode(t(e), function(e) {
  37752. n.view[r++] = e
  37753. }),
  37754. n.limit = r,
  37755. n
  37756. }
  37757. ,
  37758. o.btoa = function(e) {
  37759. return o.fromBinary(e).toBase64()
  37760. }
  37761. ,
  37762. o.atob = function(e) {
  37763. return o.fromBase64(e).toBinary()
  37764. }
  37765. ,
  37766. a.toBinary = function(e, t) {
  37767. if ("undefined" == typeof e && (e = this.offset),
  37768. "undefined" == typeof t && (t = this.limit),
  37769. e |= 0,
  37770. t |= 0,
  37771. e < 0 || t > this.capacity() || e > t)
  37772. throw RangeError("begin, end");
  37773. if (e === t)
  37774. return "";
  37775. for (var i = [], n = []; e < t; )
  37776. i.push(this.view[e++]),
  37777. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  37778. i = []);
  37779. return n.join("") + String.fromCharCode.apply(String, i)
  37780. }
  37781. ,
  37782. o.fromBinary = function(e, t) {
  37783. if ("string" != typeof e)
  37784. throw TypeError("str");
  37785. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  37786. if (i = e.charCodeAt(n),
  37787. i > 255)
  37788. throw RangeError("illegal char code: " + i);
  37789. a.view[n++] = i
  37790. }
  37791. return a.limit = r,
  37792. a
  37793. }
  37794. ,
  37795. a.toDebug = function(e) {
  37796. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  37797. if (i !== -1 && (t = this.view[i],
  37798. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  37799. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  37800. ++i,
  37801. e && i > 0 && i % 16 === 0 && i !== n) {
  37802. for (; r.length < 51; )
  37803. r += " ";
  37804. a += r + o + "\n",
  37805. r = o = ""
  37806. }
  37807. r += i === this.offset && i === this.limit ? i === this.markedOffset ? "!" : "|" : i === this.offset ? i === this.markedOffset ? "[" : "<" : i === this.limit ? i === this.markedOffset ? "]" : ">" : i === this.markedOffset ? "'" : e || 0 !== i && i !== n ? " " : ""
  37808. }
  37809. if (e && " " !== r) {
  37810. for (; r.length < 51; )
  37811. r += " ";
  37812. a += r + o + "\n"
  37813. }
  37814. return e ? a : r
  37815. }
  37816. ,
  37817. o.fromDebug = function(e, t, i) {
  37818. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  37819. switch (n = e.charAt(l++)) {
  37820. case "!":
  37821. if (!i) {
  37822. if (u || d || p) {
  37823. f = !0;
  37824. break
  37825. }
  37826. u = d = p = !0
  37827. }
  37828. s.offset = s.markedOffset = s.limit = c,
  37829. h = !1;
  37830. break;
  37831. case "|":
  37832. if (!i) {
  37833. if (u || p) {
  37834. f = !0;
  37835. break
  37836. }
  37837. u = p = !0
  37838. }
  37839. s.offset = s.limit = c,
  37840. h = !1;
  37841. break;
  37842. case "[":
  37843. if (!i) {
  37844. if (u || d) {
  37845. f = !0;
  37846. break
  37847. }
  37848. u = d = !0
  37849. }
  37850. s.offset = s.markedOffset = c,
  37851. h = !1;
  37852. break;
  37853. case "<":
  37854. if (!i) {
  37855. if (u) {
  37856. f = !0;
  37857. break
  37858. }
  37859. u = !0
  37860. }
  37861. s.offset = c,
  37862. h = !1;
  37863. break;
  37864. case "]":
  37865. if (!i) {
  37866. if (p || d) {
  37867. f = !0;
  37868. break
  37869. }
  37870. p = d = !0
  37871. }
  37872. s.limit = s.markedOffset = c,
  37873. h = !1;
  37874. break;
  37875. case ">":
  37876. if (!i) {
  37877. if (p) {
  37878. f = !0;
  37879. break
  37880. }
  37881. p = !0
  37882. }
  37883. s.limit = c,
  37884. h = !1;
  37885. break;
  37886. case "'":
  37887. if (!i) {
  37888. if (d) {
  37889. f = !0;
  37890. break
  37891. }
  37892. d = !0
  37893. }
  37894. s.markedOffset = c,
  37895. h = !1;
  37896. break;
  37897. case " ":
  37898. h = !1;
  37899. break;
  37900. default:
  37901. if (!i && h) {
  37902. f = !0;
  37903. break
  37904. }
  37905. if (r = parseInt(n + e.charAt(l++), 16),
  37906. !i && (isNaN(r) || r < 0 || r > 255))
  37907. throw TypeError("Illegal str: Not a debug encoded string");
  37908. s.view[c++] = r,
  37909. h = !0
  37910. }
  37911. if (f)
  37912. throw TypeError("Illegal str: Invalid symbol at " + l)
  37913. }
  37914. if (!i) {
  37915. if (!u || !p)
  37916. throw TypeError("Illegal str: Missing offset or limit");
  37917. if (c < s.buffer.byteLength)
  37918. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  37919. }
  37920. return s
  37921. }
  37922. ,
  37923. a.toHex = function(e, t) {
  37924. if (e = "undefined" == typeof e ? this.offset : e,
  37925. t = "undefined" == typeof t ? this.limit : t,
  37926. !this.noAssert) {
  37927. if ("number" != typeof e || e % 1 !== 0)
  37928. throw TypeError("Illegal begin: Not an integer");
  37929. if (e >>>= 0,
  37930. "number" != typeof t || t % 1 !== 0)
  37931. throw TypeError("Illegal end: Not an integer");
  37932. if (t >>>= 0,
  37933. e < 0 || e > t || t > this.buffer.byteLength)
  37934. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37935. }
  37936. for (var i, n = new Array(t - e); e < t; )
  37937. i = this.view[e++],
  37938. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  37939. return n.join("")
  37940. }
  37941. ,
  37942. o.fromHex = function(e, t, i) {
  37943. if (!i) {
  37944. if ("string" != typeof e)
  37945. throw TypeError("Illegal str: Not a string");
  37946. if (e.length % 2 !== 0)
  37947. throw TypeError("Illegal str: Length not a multiple of 2")
  37948. }
  37949. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  37950. if (n = parseInt(e.substring(s, s + 2), 16),
  37951. !i && (!isFinite(n) || n < 0 || n > 255))
  37952. throw TypeError("Illegal str: Contains non-hex characters");
  37953. a.view[l++] = n
  37954. }
  37955. return a.limit = l,
  37956. a
  37957. }
  37958. ;
  37959. var h = function() {
  37960. var e = {};
  37961. return e.MAX_CODEPOINT = 1114111,
  37962. e.encodeUTF8 = function(e, t) {
  37963. var i = null;
  37964. for ("number" == typeof e && (i = e,
  37965. e = function() {
  37966. return null
  37967. }
  37968. ); null !== i || null !== (i = e()); )
  37969. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  37970. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  37971. t(i >> 6 & 63 | 128),
  37972. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  37973. t(i >> 12 & 63 | 128),
  37974. t(i >> 6 & 63 | 128),
  37975. t(63 & i | 128)),
  37976. i = null
  37977. }
  37978. ,
  37979. e.decodeUTF8 = function(e, t) {
  37980. for (var i, n, r, o, a = function(e) {
  37981. e = e.slice(0, e.indexOf(null));
  37982. var t = Error(e.toString());
  37983. throw t.name = "TruncatedError",
  37984. t.bytes = e,
  37985. t
  37986. }; null !== (i = e()); )
  37987. if (0 === (128 & i))
  37988. t(i);
  37989. else if (192 === (224 & i))
  37990. null === (n = e()) && a([i, n]),
  37991. t((31 & i) << 6 | 63 & n);
  37992. else if (224 === (240 & i))
  37993. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  37994. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  37995. else {
  37996. if (240 !== (248 & i))
  37997. throw RangeError("Illegal starting byte: " + i);
  37998. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  37999. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38000. }
  38001. }
  38002. ,
  38003. e.UTF16toUTF8 = function(e, t) {
  38004. for (var i, n = null; ; ) {
  38005. if (null === (i = null !== n ? n : e()))
  38006. break;
  38007. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38008. n = null) : t(i)
  38009. }
  38010. null !== n && t(n)
  38011. }
  38012. ,
  38013. e.UTF8toUTF16 = function(e, t) {
  38014. var i = null;
  38015. for ("number" == typeof e && (i = e,
  38016. e = function() {
  38017. return null
  38018. }
  38019. ); null !== i || null !== (i = e()); )
  38020. i <= 65535 ? t(i) : (i -= 65536,
  38021. t((i >> 10) + 55296),
  38022. t(i % 1024 + 56320)),
  38023. i = null
  38024. }
  38025. ,
  38026. e.encodeUTF16toUTF8 = function(t, i) {
  38027. e.UTF16toUTF8(t, function(t) {
  38028. e.encodeUTF8(t, i)
  38029. })
  38030. }
  38031. ,
  38032. e.decodeUTF8toUTF16 = function(t, i) {
  38033. e.decodeUTF8(t, function(t) {
  38034. e.UTF8toUTF16(t, i)
  38035. })
  38036. }
  38037. ,
  38038. e.calculateCodePoint = function(e) {
  38039. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38040. }
  38041. ,
  38042. e.calculateUTF8 = function(e) {
  38043. for (var t, i = 0; null !== (t = e()); )
  38044. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38045. return i
  38046. }
  38047. ,
  38048. e.calculateUTF16asUTF8 = function(t) {
  38049. var i = 0
  38050. , n = 0;
  38051. return e.UTF16toUTF8(t, function(e) {
  38052. ++i,
  38053. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38054. }),
  38055. [i, n]
  38056. }
  38057. ,
  38058. e
  38059. }();
  38060. return a.toUTF8 = function(e, t) {
  38061. if ("undefined" == typeof e && (e = this.offset),
  38062. "undefined" == typeof t && (t = this.limit),
  38063. !this.noAssert) {
  38064. if ("number" != typeof e || e % 1 !== 0)
  38065. throw TypeError("Illegal begin: Not an integer");
  38066. if (e >>>= 0,
  38067. "number" != typeof t || t % 1 !== 0)
  38068. throw TypeError("Illegal end: Not an integer");
  38069. if (t >>>= 0,
  38070. e < 0 || e > t || t > this.buffer.byteLength)
  38071. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38072. }
  38073. var n;
  38074. try {
  38075. h.decodeUTF8toUTF16(function() {
  38076. return e < t ? this.view[e++] : null
  38077. }
  38078. .bind(this), n = i())
  38079. } catch (i) {
  38080. if (e !== t)
  38081. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38082. }
  38083. return n()
  38084. }
  38085. ,
  38086. o.fromUTF8 = function(e, i, n) {
  38087. if (!n && "string" != typeof e)
  38088. throw TypeError("Illegal str: Not a string");
  38089. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38090. , a = 0;
  38091. return h.encodeUTF16toUTF8(t(e), function(e) {
  38092. r.view[a++] = e
  38093. }),
  38094. r.limit = a,
  38095. r
  38096. }
  38097. ,
  38098. o
  38099. })
  38100. }
  38101. , {
  38102. long: 216
  38103. }],
  38104. 216: [function(e, t, i) {
  38105. !function(i, n) {
  38106. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  38107. }(this, function() {
  38108. "use strict";
  38109. function e(e, t, i) {
  38110. this.low = 0 | e,
  38111. this.high = 0 | t,
  38112. this.unsigned = !!i
  38113. }
  38114. function t(e) {
  38115. return (e && e.__isLong__) === !0
  38116. }
  38117. function i(e, t) {
  38118. var i, n, o;
  38119. return t ? (e >>>= 0,
  38120. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38121. o && (l[e] = i),
  38122. i)) : (e |= 0,
  38123. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38124. o && (s[e] = i),
  38125. i))
  38126. }
  38127. function n(e, t) {
  38128. if (isNaN(e) || !isFinite(e))
  38129. return t ? m : g;
  38130. if (t) {
  38131. if (e < 0)
  38132. return m;
  38133. if (e >= d)
  38134. return I
  38135. } else {
  38136. if (e <= -p)
  38137. return E;
  38138. if (e + 1 >= p)
  38139. return C
  38140. }
  38141. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38142. }
  38143. function r(t, i, n) {
  38144. return new e(t,i,n)
  38145. }
  38146. function o(e, t, i) {
  38147. if (0 === e.length)
  38148. throw Error("empty string");
  38149. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38150. return g;
  38151. if ("number" == typeof t ? (i = t,
  38152. t = !1) : t = !!t,
  38153. i = i || 10,
  38154. i < 2 || 36 < i)
  38155. throw RangeError("radix");
  38156. var r;
  38157. if ((r = e.indexOf("-")) > 0)
  38158. throw Error("interior hyphen");
  38159. if (0 === r)
  38160. return o(e.substring(1), t, i).neg();
  38161. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38162. var h = Math.min(8, e.length - l)
  38163. , u = parseInt(e.substring(l, l + h), i);
  38164. if (h < 8) {
  38165. var d = n(c(i, h));
  38166. s = s.mul(d).add(n(u))
  38167. } else
  38168. s = s.mul(a),
  38169. s = s.add(n(u))
  38170. }
  38171. return s.unsigned = t,
  38172. s
  38173. }
  38174. function a(t) {
  38175. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38176. }
  38177. e.prototype.__isLong__,
  38178. Object.defineProperty(e.prototype, "__isLong__", {
  38179. value: !0,
  38180. enumerable: !1,
  38181. configurable: !1
  38182. }),
  38183. e.isLong = t;
  38184. var s = {}
  38185. , l = {};
  38186. e.fromInt = i,
  38187. e.fromNumber = n,
  38188. e.fromBits = r;
  38189. var c = Math.pow;
  38190. e.fromString = o,
  38191. e.fromValue = a;
  38192. var h = 1 << 24
  38193. , u = 4294967296
  38194. , d = 0x10000000000000000
  38195. , p = d / 2
  38196. , f = i(h)
  38197. , g = i(0);
  38198. e.ZERO = g;
  38199. var m = i(0, !0);
  38200. e.UZERO = m;
  38201. var v = i(1);
  38202. e.ONE = v;
  38203. var A = i(1, !0);
  38204. e.UONE = A;
  38205. var y = i(-1);
  38206. e.NEG_ONE = y;
  38207. var C = r(-1, 2147483647, !1);
  38208. e.MAX_VALUE = C;
  38209. var I = r(-1, -1, !0);
  38210. e.MAX_UNSIGNED_VALUE = I;
  38211. var E = r(0, -2147483648, !1);
  38212. e.MIN_VALUE = E;
  38213. var b = e.prototype;
  38214. return b.toInt = function() {
  38215. return this.unsigned ? this.low >>> 0 : this.low
  38216. }
  38217. ,
  38218. b.toNumber = function() {
  38219. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  38220. }
  38221. ,
  38222. b.toString = function(e) {
  38223. if (e = e || 10,
  38224. e < 2 || 36 < e)
  38225. throw RangeError("radix");
  38226. if (this.isZero())
  38227. return "0";
  38228. if (this.isNegative()) {
  38229. if (this.eq(E)) {
  38230. var t = n(e)
  38231. , i = this.div(t)
  38232. , r = i.mul(t).sub(this);
  38233. return i.toString(e) + r.toInt().toString(e)
  38234. }
  38235. return "-" + this.neg().toString(e)
  38236. }
  38237. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  38238. var l = a.div(o)
  38239. , h = a.sub(l.mul(o)).toInt() >>> 0
  38240. , u = h.toString(e);
  38241. if (a = l,
  38242. a.isZero())
  38243. return u + s;
  38244. for (; u.length < 6; )
  38245. u = "0" + u;
  38246. s = "" + u + s
  38247. }
  38248. }
  38249. ,
  38250. b.getHighBits = function() {
  38251. return this.high
  38252. }
  38253. ,
  38254. b.getHighBitsUnsigned = function() {
  38255. return this.high >>> 0
  38256. }
  38257. ,
  38258. b.getLowBits = function() {
  38259. return this.low
  38260. }
  38261. ,
  38262. b.getLowBitsUnsigned = function() {
  38263. return this.low >>> 0
  38264. }
  38265. ,
  38266. b.getNumBitsAbs = function() {
  38267. if (this.isNegative())
  38268. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  38269. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  38270. ;
  38271. return 0 != this.high ? t + 33 : t + 1
  38272. }
  38273. ,
  38274. b.isZero = function() {
  38275. return 0 === this.high && 0 === this.low
  38276. }
  38277. ,
  38278. b.isNegative = function() {
  38279. return !this.unsigned && this.high < 0
  38280. }
  38281. ,
  38282. b.isPositive = function() {
  38283. return this.unsigned || this.high >= 0
  38284. }
  38285. ,
  38286. b.isOdd = function() {
  38287. return 1 === (1 & this.low)
  38288. }
  38289. ,
  38290. b.isEven = function() {
  38291. return 0 === (1 & this.low)
  38292. }
  38293. ,
  38294. b.equals = function(e) {
  38295. return t(e) || (e = a(e)),
  38296. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  38297. }
  38298. ,
  38299. b.eq = b.equals,
  38300. b.notEquals = function(e) {
  38301. return !this.eq(e)
  38302. }
  38303. ,
  38304. b.neq = b.notEquals,
  38305. b.lessThan = function(e) {
  38306. return this.comp(e) < 0
  38307. }
  38308. ,
  38309. b.lt = b.lessThan,
  38310. b.lessThanOrEqual = function(e) {
  38311. return this.comp(e) <= 0
  38312. }
  38313. ,
  38314. b.lte = b.lessThanOrEqual,
  38315. b.greaterThan = function(e) {
  38316. return this.comp(e) > 0
  38317. }
  38318. ,
  38319. b.gt = b.greaterThan,
  38320. b.greaterThanOrEqual = function(e) {
  38321. return this.comp(e) >= 0
  38322. }
  38323. ,
  38324. b.gte = b.greaterThanOrEqual,
  38325. b.compare = function(e) {
  38326. if (t(e) || (e = a(e)),
  38327. this.eq(e))
  38328. return 0;
  38329. var i = this.isNegative()
  38330. , n = e.isNegative();
  38331. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  38332. }
  38333. ,
  38334. b.comp = b.compare,
  38335. b.negate = function() {
  38336. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  38337. }
  38338. ,
  38339. b.neg = b.negate,
  38340. b.add = function(e) {
  38341. t(e) || (e = a(e));
  38342. var i = this.high >>> 16
  38343. , n = 65535 & this.high
  38344. , o = this.low >>> 16
  38345. , s = 65535 & this.low
  38346. , l = e.high >>> 16
  38347. , c = 65535 & e.high
  38348. , h = e.low >>> 16
  38349. , u = 65535 & e.low
  38350. , d = 0
  38351. , p = 0
  38352. , f = 0
  38353. , g = 0;
  38354. return g += s + u,
  38355. f += g >>> 16,
  38356. g &= 65535,
  38357. f += o + h,
  38358. p += f >>> 16,
  38359. f &= 65535,
  38360. p += n + c,
  38361. d += p >>> 16,
  38362. p &= 65535,
  38363. d += i + l,
  38364. d &= 65535,
  38365. r(f << 16 | g, d << 16 | p, this.unsigned)
  38366. }
  38367. ,
  38368. b.subtract = function(e) {
  38369. return t(e) || (e = a(e)),
  38370. this.add(e.neg())
  38371. }
  38372. ,
  38373. b.sub = b.subtract,
  38374. b.multiply = function(e) {
  38375. if (this.isZero())
  38376. return g;
  38377. if (t(e) || (e = a(e)),
  38378. e.isZero())
  38379. return g;
  38380. if (this.eq(E))
  38381. return e.isOdd() ? E : g;
  38382. if (e.eq(E))
  38383. return this.isOdd() ? E : g;
  38384. if (this.isNegative())
  38385. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  38386. if (e.isNegative())
  38387. return this.mul(e.neg()).neg();
  38388. if (this.lt(f) && e.lt(f))
  38389. return n(this.toNumber() * e.toNumber(), this.unsigned);
  38390. var i = this.high >>> 16
  38391. , o = 65535 & this.high
  38392. , s = this.low >>> 16
  38393. , l = 65535 & this.low
  38394. , c = e.high >>> 16
  38395. , h = 65535 & e.high
  38396. , u = e.low >>> 16
  38397. , d = 65535 & e.low
  38398. , p = 0
  38399. , m = 0
  38400. , v = 0
  38401. , A = 0;
  38402. return A += l * d,
  38403. v += A >>> 16,
  38404. A &= 65535,
  38405. v += s * d,
  38406. m += v >>> 16,
  38407. v &= 65535,
  38408. v += l * u,
  38409. m += v >>> 16,
  38410. v &= 65535,
  38411. m += o * d,
  38412. p += m >>> 16,
  38413. m &= 65535,
  38414. m += s * u,
  38415. p += m >>> 16,
  38416. m &= 65535,
  38417. m += l * h,
  38418. p += m >>> 16,
  38419. m &= 65535,
  38420. p += i * d + o * u + s * h + l * c,
  38421. p &= 65535,
  38422. r(v << 16 | A, p << 16 | m, this.unsigned)
  38423. }
  38424. ,
  38425. b.mul = b.multiply,
  38426. b.divide = function(e) {
  38427. if (t(e) || (e = a(e)),
  38428. e.isZero())
  38429. throw Error("division by zero");
  38430. if (this.isZero())
  38431. return this.unsigned ? m : g;
  38432. var i, r, o;
  38433. if (this.unsigned) {
  38434. if (e.unsigned || (e = e.toUnsigned()),
  38435. e.gt(this))
  38436. return m;
  38437. if (e.gt(this.shru(1)))
  38438. return A;
  38439. o = m
  38440. } else {
  38441. if (this.eq(E)) {
  38442. if (e.eq(v) || e.eq(y))
  38443. return E;
  38444. if (e.eq(E))
  38445. return v;
  38446. var s = this.shr(1);
  38447. return i = s.div(e).shl(1),
  38448. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  38449. o = i.add(r.div(e)))
  38450. }
  38451. if (e.eq(E))
  38452. return this.unsigned ? m : g;
  38453. if (this.isNegative())
  38454. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  38455. if (e.isNegative())
  38456. return this.div(e.neg()).neg();
  38457. o = g
  38458. }
  38459. for (r = this; r.gte(e); ) {
  38460. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  38461. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  38462. i -= h,
  38463. u = n(i, this.unsigned),
  38464. d = u.mul(e);
  38465. u.isZero() && (u = v),
  38466. o = o.add(u),
  38467. r = r.sub(d)
  38468. }
  38469. return o
  38470. }
  38471. ,
  38472. b.div = b.divide,
  38473. b.modulo = function(e) {
  38474. return t(e) || (e = a(e)),
  38475. this.sub(this.div(e).mul(e))
  38476. }
  38477. ,
  38478. b.mod = b.modulo,
  38479. b.not = function() {
  38480. return r(~this.low, ~this.high, this.unsigned)
  38481. }
  38482. ,
  38483. b.and = function(e) {
  38484. return t(e) || (e = a(e)),
  38485. r(this.low & e.low, this.high & e.high, this.unsigned)
  38486. }
  38487. ,
  38488. b.or = function(e) {
  38489. return t(e) || (e = a(e)),
  38490. r(this.low | e.low, this.high | e.high, this.unsigned)
  38491. }
  38492. ,
  38493. b.xor = function(e) {
  38494. return t(e) || (e = a(e)),
  38495. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  38496. }
  38497. ,
  38498. b.shiftLeft = function(e) {
  38499. return t(e) && (e = e.toInt()),
  38500. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  38501. }
  38502. ,
  38503. b.shl = b.shiftLeft,
  38504. b.shiftRight = function(e) {
  38505. return t(e) && (e = e.toInt()),
  38506. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  38507. }
  38508. ,
  38509. b.shr = b.shiftRight,
  38510. b.shiftRightUnsigned = function(e) {
  38511. if (t(e) && (e = e.toInt()),
  38512. e &= 63,
  38513. 0 === e)
  38514. return this;
  38515. var i = this.high;
  38516. if (e < 32) {
  38517. var n = this.low;
  38518. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  38519. }
  38520. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  38521. }
  38522. ,
  38523. b.shru = b.shiftRightUnsigned,
  38524. b.toSigned = function() {
  38525. return this.unsigned ? r(this.low, this.high, !1) : this
  38526. }
  38527. ,
  38528. b.toUnsigned = function() {
  38529. return this.unsigned ? this : r(this.low, this.high, !0)
  38530. }
  38531. ,
  38532. b.toBytes = function(e) {
  38533. return e ? this.toBytesLE() : this.toBytesBE()
  38534. }
  38535. ,
  38536. b.toBytesLE = function() {
  38537. var e = this.high
  38538. , t = this.low;
  38539. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  38540. }
  38541. ,
  38542. b.toBytesBE = function() {
  38543. var e = this.high
  38544. , t = this.low;
  38545. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  38546. }
  38547. ,
  38548. e
  38549. })
  38550. }
  38551. , {}],
  38552. 217: [function(e, t, i) {
  38553. var n = {
  38554. REVISION: "75"
  38555. };
  38556. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  38557. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  38558. void 0 === Math.sign && (Math.sign = function(e) {
  38559. return e < 0 ? -1 : e > 0 ? 1 : +e
  38560. }
  38561. ),
  38562. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  38563. get: function() {
  38564. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  38565. }
  38566. }),
  38567. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  38568. writable: !0,
  38569. configurable: !0,
  38570. value: function(e) {
  38571. "use strict";
  38572. if (void 0 === e || null === e)
  38573. throw new TypeError("Cannot convert first argument to object");
  38574. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  38575. var r = arguments[i];
  38576. if (void 0 !== r && null !== r) {
  38577. r = Object(r);
  38578. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  38579. var l = o[a]
  38580. , c = Object.getOwnPropertyDescriptor(r, l);
  38581. void 0 !== c && c.enumerable && (t[l] = r[l])
  38582. }
  38583. }
  38584. }
  38585. return t
  38586. }
  38587. }),
  38588. n.MOUSE = {
  38589. LEFT: 0,
  38590. MIDDLE: 1,
  38591. RIGHT: 2
  38592. },
  38593. n.CullFaceNone = 0,
  38594. n.CullFaceBack = 1,
  38595. n.CullFaceFront = 2,
  38596. n.CullFaceFrontBack = 3,
  38597. n.FrontFaceDirectionCW = 0,
  38598. n.FrontFaceDirectionCCW = 1,
  38599. n.BasicShadowMap = 0,
  38600. n.PCFShadowMap = 1,
  38601. n.PCFSoftShadowMap = 2,
  38602. n.FrontSide = 0,
  38603. n.BackSide = 1,
  38604. n.DoubleSide = 2,
  38605. n.FlatShading = 1,
  38606. n.SmoothShading = 2,
  38607. n.NoColors = 0,
  38608. n.FaceColors = 1,
  38609. n.VertexColors = 2,
  38610. n.NoBlending = 0,
  38611. n.NormalBlending = 1,
  38612. n.AdditiveBlending = 2,
  38613. n.SubtractiveBlending = 3,
  38614. n.MultiplyBlending = 4,
  38615. n.CustomBlending = 5,
  38616. n.AddEquation = 100,
  38617. n.SubtractEquation = 101,
  38618. n.ReverseSubtractEquation = 102,
  38619. n.MinEquation = 103,
  38620. n.MaxEquation = 104,
  38621. n.ZeroFactor = 200,
  38622. n.OneFactor = 201,
  38623. n.SrcColorFactor = 202,
  38624. n.OneMinusSrcColorFactor = 203,
  38625. n.SrcAlphaFactor = 204,
  38626. n.OneMinusSrcAlphaFactor = 205,
  38627. n.DstAlphaFactor = 206,
  38628. n.OneMinusDstAlphaFactor = 207,
  38629. n.DstColorFactor = 208,
  38630. n.OneMinusDstColorFactor = 209,
  38631. n.SrcAlphaSaturateFactor = 210,
  38632. n.NeverDepth = 0,
  38633. n.AlwaysDepth = 1,
  38634. n.LessDepth = 2,
  38635. n.LessEqualDepth = 3,
  38636. n.EqualDepth = 4,
  38637. n.GreaterEqualDepth = 5,
  38638. n.GreaterDepth = 6,
  38639. n.NotEqualDepth = 7,
  38640. n.MultiplyOperation = 0,
  38641. n.MixOperation = 1,
  38642. n.AddOperation = 2,
  38643. n.NoToneMapping = 0,
  38644. n.LinearToneMapping = 1,
  38645. n.ReinhardToneMapping = 2,
  38646. n.Uncharted2ToneMapping = 3,
  38647. n.CineonToneMapping = 4,
  38648. n.UVMapping = 300,
  38649. n.CubeReflectionMapping = 301,
  38650. n.CubeRefractionMapping = 302,
  38651. n.EquirectangularReflectionMapping = 303,
  38652. n.EquirectangularRefractionMapping = 304,
  38653. n.SphericalReflectionMapping = 305,
  38654. n.CubeUVReflectionMapping = 306,
  38655. n.CubeUVRefractionMapping = 307,
  38656. n.RepeatWrapping = 1e3,
  38657. n.ClampToEdgeWrapping = 1001,
  38658. n.MirroredRepeatWrapping = 1002,
  38659. n.NearestFilter = 1003,
  38660. n.NearestMipMapNearestFilter = 1004,
  38661. n.NearestMipMapLinearFilter = 1005,
  38662. n.LinearFilter = 1006,
  38663. n.LinearMipMapNearestFilter = 1007,
  38664. n.LinearMipMapLinearFilter = 1008,
  38665. n.UnsignedByteType = 1009,
  38666. n.ByteType = 1010,
  38667. n.ShortType = 1011,
  38668. n.UnsignedShortType = 1012,
  38669. n.IntType = 1013,
  38670. n.UnsignedIntType = 1014,
  38671. n.FloatType = 1015,
  38672. n.HalfFloatType = 1025,
  38673. n.UnsignedShort4444Type = 1016,
  38674. n.UnsignedShort5551Type = 1017,
  38675. n.UnsignedShort565Type = 1018,
  38676. n.AlphaFormat = 1019,
  38677. n.RGBFormat = 1020,
  38678. n.RGBAFormat = 1021,
  38679. n.LuminanceFormat = 1022,
  38680. n.LuminanceAlphaFormat = 1023,
  38681. n.RGBEFormat = n.RGBAFormat,
  38682. n.RGB_S3TC_DXT1_Format = 2001,
  38683. n.RGBA_S3TC_DXT1_Format = 2002,
  38684. n.RGBA_S3TC_DXT3_Format = 2003,
  38685. n.RGBA_S3TC_DXT5_Format = 2004,
  38686. n.RGB_PVRTC_4BPPV1_Format = 2100,
  38687. n.RGB_PVRTC_2BPPV1_Format = 2101,
  38688. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  38689. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  38690. n.RGB_ETC1_Format = 2151,
  38691. n.LoopOnce = 2200,
  38692. n.LoopRepeat = 2201,
  38693. n.LoopPingPong = 2202,
  38694. n.InterpolateDiscrete = 2300,
  38695. n.InterpolateLinear = 2301,
  38696. n.InterpolateSmooth = 2302,
  38697. n.ZeroCurvatureEnding = 2400,
  38698. n.ZeroSlopeEnding = 2401,
  38699. n.WrapAroundEnding = 2402,
  38700. n.TrianglesDrawMode = 0,
  38701. n.TriangleStripDrawMode = 1,
  38702. n.TriangleFanDrawMode = 2,
  38703. n.LinearEncoding = 3e3,
  38704. n.sRGBEncoding = 3001,
  38705. n.GammaEncoding = 3007,
  38706. n.RGBEEncoding = 3002,
  38707. n.LogLuvEncoding = 3003,
  38708. n.RGBM7Encoding = 3004,
  38709. n.RGBM16Encoding = 3005,
  38710. n.RGBDEncoding = 3006,
  38711. n.Color = function(e) {
  38712. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  38713. }
  38714. ,
  38715. n.Color.prototype = {
  38716. constructor: n.Color,
  38717. r: 1,
  38718. g: 1,
  38719. b: 1,
  38720. set: function(e) {
  38721. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  38722. this
  38723. },
  38724. setScalar: function(e) {
  38725. this.r = e,
  38726. this.g = e,
  38727. this.b = e
  38728. },
  38729. setHex: function(e) {
  38730. return e = Math.floor(e),
  38731. this.r = (e >> 16 & 255) / 255,
  38732. this.g = (e >> 8 & 255) / 255,
  38733. this.b = (255 & e) / 255,
  38734. this
  38735. },
  38736. setRGB: function(e, t, i) {
  38737. return this.r = e,
  38738. this.g = t,
  38739. this.b = i,
  38740. this
  38741. },
  38742. setHSL: function() {
  38743. function e(e, t, i) {
  38744. return i < 0 && (i += 1),
  38745. i > 1 && (i -= 1),
  38746. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  38747. }
  38748. return function(t, i, r) {
  38749. if (t = n.Math.euclideanModulo(t, 1),
  38750. i = n.Math.clamp(i, 0, 1),
  38751. r = n.Math.clamp(r, 0, 1),
  38752. 0 === i)
  38753. this.r = this.g = this.b = r;
  38754. else {
  38755. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  38756. , a = 2 * r - o;
  38757. this.r = e(a, o, t + 1 / 3),
  38758. this.g = e(a, o, t),
  38759. this.b = e(a, o, t - 1 / 3)
  38760. }
  38761. return this
  38762. }
  38763. }(),
  38764. setStyle: function(e) {
  38765. function t(t) {
  38766. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  38767. }
  38768. var i;
  38769. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  38770. var r, o = i[1], a = i[2];
  38771. switch (o) {
  38772. case "rgb":
  38773. case "rgba":
  38774. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38775. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  38776. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  38777. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  38778. t(r[5]),
  38779. this;
  38780. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  38781. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  38782. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  38783. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  38784. t(r[5]),
  38785. this;
  38786. break;
  38787. case "hsl":
  38788. case "hsla":
  38789. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  38790. var s = parseFloat(r[1]) / 360
  38791. , l = parseInt(r[2], 10) / 100
  38792. , c = parseInt(r[3], 10) / 100;
  38793. return t(r[5]),
  38794. this.setHSL(s, l, c)
  38795. }
  38796. }
  38797. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  38798. var h = i[1]
  38799. , u = h.length;
  38800. if (3 === u)
  38801. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  38802. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  38803. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  38804. this;
  38805. if (6 === u)
  38806. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  38807. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  38808. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  38809. this
  38810. }
  38811. if (e && e.length > 0) {
  38812. var h = n.ColorKeywords[e];
  38813. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  38814. }
  38815. return this
  38816. },
  38817. clone: function() {
  38818. return new this.constructor(this.r,this.g,this.b)
  38819. },
  38820. copy: function(e) {
  38821. return this.r = e.r,
  38822. this.g = e.g,
  38823. this.b = e.b,
  38824. this
  38825. },
  38826. copyGammaToLinear: function(e, t) {
  38827. return void 0 === t && (t = 2),
  38828. this.r = Math.pow(e.r, t),
  38829. this.g = Math.pow(e.g, t),
  38830. this.b = Math.pow(e.b, t),
  38831. this
  38832. },
  38833. copyLinearToGamma: function(e, t) {
  38834. void 0 === t && (t = 2);
  38835. var i = t > 0 ? 1 / t : 1;
  38836. return this.r = Math.pow(e.r, i),
  38837. this.g = Math.pow(e.g, i),
  38838. this.b = Math.pow(e.b, i),
  38839. this
  38840. },
  38841. convertGammaToLinear: function() {
  38842. var e = this.r
  38843. , t = this.g
  38844. , i = this.b;
  38845. return this.r = e * e,
  38846. this.g = t * t,
  38847. this.b = i * i,
  38848. this
  38849. },
  38850. convertLinearToGamma: function() {
  38851. return this.r = Math.sqrt(this.r),
  38852. this.g = Math.sqrt(this.g),
  38853. this.b = Math.sqrt(this.b),
  38854. this
  38855. },
  38856. getHex: function() {
  38857. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  38858. },
  38859. getHexString: function() {
  38860. return ("000000" + this.getHex().toString(16)).slice(-6)
  38861. },
  38862. getHSL: function(e) {
  38863. var t, i, n = e || {
  38864. h: 0,
  38865. s: 0,
  38866. l: 0
  38867. }, r = this.r, o = this.g, a = this.b, s = Math.max(r, o, a), l = Math.min(r, o, a), c = (l + s) / 2;
  38868. if (l === s)
  38869. t = 0,
  38870. i = 0;
  38871. else {
  38872. var h = s - l;
  38873. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  38874. s) {
  38875. case r:
  38876. t = (o - a) / h + (o < a ? 6 : 0);
  38877. break;
  38878. case o:
  38879. t = (a - r) / h + 2;
  38880. break;
  38881. case a:
  38882. t = (r - o) / h + 4
  38883. }
  38884. t /= 6
  38885. }
  38886. return n.h = t,
  38887. n.s = i,
  38888. n.l = c,
  38889. n
  38890. },
  38891. getStyle: function() {
  38892. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  38893. },
  38894. offsetHSL: function(e, t, i) {
  38895. var n = this.getHSL();
  38896. return n.h += e,
  38897. n.s += t,
  38898. n.l += i,
  38899. this.setHSL(n.h, n.s, n.l),
  38900. this
  38901. },
  38902. add: function(e) {
  38903. return this.r += e.r,
  38904. this.g += e.g,
  38905. this.b += e.b,
  38906. this
  38907. },
  38908. addColors: function(e, t) {
  38909. return this.r = e.r + t.r,
  38910. this.g = e.g + t.g,
  38911. this.b = e.b + t.b,
  38912. this
  38913. },
  38914. addScalar: function(e) {
  38915. return this.r += e,
  38916. this.g += e,
  38917. this.b += e,
  38918. this
  38919. },
  38920. multiply: function(e) {
  38921. return this.r *= e.r,
  38922. this.g *= e.g,
  38923. this.b *= e.b,
  38924. this
  38925. },
  38926. multiplyScalar: function(e) {
  38927. return this.r *= e,
  38928. this.g *= e,
  38929. this.b *= e,
  38930. this
  38931. },
  38932. lerp: function(e, t) {
  38933. return this.r += (e.r - this.r) * t,
  38934. this.g += (e.g - this.g) * t,
  38935. this.b += (e.b - this.b) * t,
  38936. this
  38937. },
  38938. equals: function(e) {
  38939. return e.r === this.r && e.g === this.g && e.b === this.b
  38940. },
  38941. fromArray: function(e, t) {
  38942. return void 0 === t && (t = 0),
  38943. this.r = e[t],
  38944. this.g = e[t + 1],
  38945. this.b = e[t + 2],
  38946. this
  38947. },
  38948. toArray: function(e, t) {
  38949. return void 0 === e && (e = []),
  38950. void 0 === t && (t = 0),
  38951. e[t] = this.r,
  38952. e[t + 1] = this.g,
  38953. e[t + 2] = this.b,
  38954. e
  38955. }
  38956. },
  38957. n.ColorKeywords = {
  38958. aliceblue: 15792383,
  38959. antiquewhite: 16444375,
  38960. aqua: 65535,
  38961. aquamarine: 8388564,
  38962. azure: 15794175,
  38963. beige: 16119260,
  38964. bisque: 16770244,
  38965. black: 0,
  38966. blanchedalmond: 16772045,
  38967. blue: 255,
  38968. blueviolet: 9055202,
  38969. brown: 10824234,
  38970. burlywood: 14596231,
  38971. cadetblue: 6266528,
  38972. chartreuse: 8388352,
  38973. chocolate: 13789470,
  38974. coral: 16744272,
  38975. cornflowerblue: 6591981,
  38976. cornsilk: 16775388,
  38977. crimson: 14423100,
  38978. cyan: 65535,
  38979. darkblue: 139,
  38980. darkcyan: 35723,
  38981. darkgoldenrod: 12092939,
  38982. darkgray: 11119017,
  38983. darkgreen: 25600,
  38984. darkgrey: 11119017,
  38985. darkkhaki: 12433259,
  38986. darkmagenta: 9109643,
  38987. darkolivegreen: 5597999,
  38988. darkorange: 16747520,
  38989. darkorchid: 10040012,
  38990. darkred: 9109504,
  38991. darksalmon: 15308410,
  38992. darkseagreen: 9419919,
  38993. darkslateblue: 4734347,
  38994. darkslategray: 3100495,
  38995. darkslategrey: 3100495,
  38996. darkturquoise: 52945,
  38997. darkviolet: 9699539,
  38998. deeppink: 16716947,
  38999. deepskyblue: 49151,
  39000. dimgray: 6908265,
  39001. dimgrey: 6908265,
  39002. dodgerblue: 2003199,
  39003. firebrick: 11674146,
  39004. floralwhite: 16775920,
  39005. forestgreen: 2263842,
  39006. fuchsia: 16711935,
  39007. gainsboro: 14474460,
  39008. ghostwhite: 16316671,
  39009. gold: 16766720,
  39010. goldenrod: 14329120,
  39011. gray: 8421504,
  39012. green: 32768,
  39013. greenyellow: 11403055,
  39014. grey: 8421504,
  39015. honeydew: 15794160,
  39016. hotpink: 16738740,
  39017. indianred: 13458524,
  39018. indigo: 4915330,
  39019. ivory: 16777200,
  39020. khaki: 15787660,
  39021. lavender: 15132410,
  39022. lavenderblush: 16773365,
  39023. lawngreen: 8190976,
  39024. lemonchiffon: 16775885,
  39025. lightblue: 11393254,
  39026. lightcoral: 15761536,
  39027. lightcyan: 14745599,
  39028. lightgoldenrodyellow: 16448210,
  39029. lightgray: 13882323,
  39030. lightgreen: 9498256,
  39031. lightgrey: 13882323,
  39032. lightpink: 16758465,
  39033. lightsalmon: 16752762,
  39034. lightseagreen: 2142890,
  39035. lightskyblue: 8900346,
  39036. lightslategray: 7833753,
  39037. lightslategrey: 7833753,
  39038. lightsteelblue: 11584734,
  39039. lightyellow: 16777184,
  39040. lime: 65280,
  39041. limegreen: 3329330,
  39042. linen: 16445670,
  39043. magenta: 16711935,
  39044. maroon: 8388608,
  39045. mediumaquamarine: 6737322,
  39046. mediumblue: 205,
  39047. mediumorchid: 12211667,
  39048. mediumpurple: 9662683,
  39049. mediumseagreen: 3978097,
  39050. mediumslateblue: 8087790,
  39051. mediumspringgreen: 64154,
  39052. mediumturquoise: 4772300,
  39053. mediumvioletred: 13047173,
  39054. midnightblue: 1644912,
  39055. mintcream: 16121850,
  39056. mistyrose: 16770273,
  39057. moccasin: 16770229,
  39058. navajowhite: 16768685,
  39059. navy: 128,
  39060. oldlace: 16643558,
  39061. olive: 8421376,
  39062. olivedrab: 7048739,
  39063. orange: 16753920,
  39064. orangered: 16729344,
  39065. orchid: 14315734,
  39066. palegoldenrod: 15657130,
  39067. palegreen: 10025880,
  39068. paleturquoise: 11529966,
  39069. palevioletred: 14381203,
  39070. papayawhip: 16773077,
  39071. peachpuff: 16767673,
  39072. peru: 13468991,
  39073. pink: 16761035,
  39074. plum: 14524637,
  39075. powderblue: 11591910,
  39076. purple: 8388736,
  39077. red: 16711680,
  39078. rosybrown: 12357519,
  39079. royalblue: 4286945,
  39080. saddlebrown: 9127187,
  39081. salmon: 16416882,
  39082. sandybrown: 16032864,
  39083. seagreen: 3050327,
  39084. seashell: 16774638,
  39085. sienna: 10506797,
  39086. silver: 12632256,
  39087. skyblue: 8900331,
  39088. slateblue: 6970061,
  39089. slategray: 7372944,
  39090. slategrey: 7372944,
  39091. snow: 16775930,
  39092. springgreen: 65407,
  39093. steelblue: 4620980,
  39094. tan: 13808780,
  39095. teal: 32896,
  39096. thistle: 14204888,
  39097. tomato: 16737095,
  39098. turquoise: 4251856,
  39099. violet: 15631086,
  39100. wheat: 16113331,
  39101. white: 16777215,
  39102. whitesmoke: 16119285,
  39103. yellow: 16776960,
  39104. yellowgreen: 10145074
  39105. },
  39106. n.Quaternion = function(e, t, i, n) {
  39107. this._x = e || 0,
  39108. this._y = t || 0,
  39109. this._z = i || 0,
  39110. this._w = void 0 !== n ? n : 1
  39111. }
  39112. ,
  39113. n.Quaternion.prototype = {
  39114. constructor: n.Quaternion,
  39115. get x() {
  39116. return this._x
  39117. },
  39118. set x(e) {
  39119. this._x = e,
  39120. this.onChangeCallback()
  39121. },
  39122. get y() {
  39123. return this._y
  39124. },
  39125. set y(e) {
  39126. this._y = e,
  39127. this.onChangeCallback()
  39128. },
  39129. get z() {
  39130. return this._z
  39131. },
  39132. set z(e) {
  39133. this._z = e,
  39134. this.onChangeCallback()
  39135. },
  39136. get w() {
  39137. return this._w
  39138. },
  39139. set w(e) {
  39140. this._w = e,
  39141. this.onChangeCallback()
  39142. },
  39143. set: function(e, t, i, n) {
  39144. return this._x = e,
  39145. this._y = t,
  39146. this._z = i,
  39147. this._w = n,
  39148. this.onChangeCallback(),
  39149. this
  39150. },
  39151. clone: function() {
  39152. return new this.constructor(this._x,this._y,this._z,this._w)
  39153. },
  39154. copy: function(e) {
  39155. return this._x = e.x,
  39156. this._y = e.y,
  39157. this._z = e.z,
  39158. this._w = e.w,
  39159. this.onChangeCallback(),
  39160. this
  39161. },
  39162. setFromEuler: function(e, t) {
  39163. if (e instanceof n.Euler == !1)
  39164. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39165. var i = Math.cos(e._x / 2)
  39166. , r = Math.cos(e._y / 2)
  39167. , o = Math.cos(e._z / 2)
  39168. , a = Math.sin(e._x / 2)
  39169. , s = Math.sin(e._y / 2)
  39170. , l = Math.sin(e._z / 2)
  39171. , c = e.order;
  39172. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39173. this._y = i * s * o - a * r * l,
  39174. this._z = i * r * l + a * s * o,
  39175. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39176. this._y = i * s * o - a * r * l,
  39177. this._z = i * r * l - a * s * o,
  39178. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39179. this._y = i * s * o + a * r * l,
  39180. this._z = i * r * l + a * s * o,
  39181. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  39182. this._y = i * s * o + a * r * l,
  39183. this._z = i * r * l - a * s * o,
  39184. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  39185. this._y = i * s * o + a * r * l,
  39186. this._z = i * r * l - a * s * o,
  39187. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  39188. this._y = i * s * o - a * r * l,
  39189. this._z = i * r * l + a * s * o,
  39190. this._w = i * r * o + a * s * l),
  39191. t !== !1 && this.onChangeCallback(),
  39192. this
  39193. },
  39194. setFromAxisAngle: function(e, t) {
  39195. var i = t / 2
  39196. , n = Math.sin(i);
  39197. return this._x = e.x * n,
  39198. this._y = e.y * n,
  39199. this._z = e.z * n,
  39200. this._w = Math.cos(i),
  39201. this.onChangeCallback(),
  39202. this
  39203. },
  39204. setFromRotationMatrix: function(e) {
  39205. var t, i = e.elements, n = i[0], r = i[4], o = i[8], a = i[1], s = i[5], l = i[9], c = i[2], h = i[6], u = i[10], d = n + s + u;
  39206. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  39207. this._w = .25 / t,
  39208. this._x = (h - l) * t,
  39209. this._y = (o - c) * t,
  39210. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  39211. this._w = (h - l) / t,
  39212. this._x = .25 * t,
  39213. this._y = (r + a) / t,
  39214. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  39215. this._w = (o - c) / t,
  39216. this._x = (r + a) / t,
  39217. this._y = .25 * t,
  39218. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  39219. this._w = (a - r) / t,
  39220. this._x = (o + c) / t,
  39221. this._y = (l + h) / t,
  39222. this._z = .25 * t),
  39223. this.onChangeCallback(),
  39224. this
  39225. },
  39226. setFromUnitVectors: function() {
  39227. var e, t, i = 1e-6;
  39228. return function(r, o) {
  39229. return void 0 === e && (e = new n.Vector3),
  39230. t = r.dot(o) + 1,
  39231. t < i ? (t = 0,
  39232. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  39233. this._x = e.x,
  39234. this._y = e.y,
  39235. this._z = e.z,
  39236. this._w = t,
  39237. this.normalize(),
  39238. this
  39239. }
  39240. }(),
  39241. inverse: function() {
  39242. return this.conjugate().normalize(),
  39243. this
  39244. },
  39245. conjugate: function() {
  39246. return this._x *= -1,
  39247. this._y *= -1,
  39248. this._z *= -1,
  39249. this.onChangeCallback(),
  39250. this
  39251. },
  39252. dot: function(e) {
  39253. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  39254. },
  39255. lengthSq: function() {
  39256. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  39257. },
  39258. length: function() {
  39259. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  39260. },
  39261. normalize: function() {
  39262. var e = this.length();
  39263. return 0 === e ? (this._x = 0,
  39264. this._y = 0,
  39265. this._z = 0,
  39266. this._w = 1) : (e = 1 / e,
  39267. this._x = this._x * e,
  39268. this._y = this._y * e,
  39269. this._z = this._z * e,
  39270. this._w = this._w * e),
  39271. this.onChangeCallback(),
  39272. this
  39273. },
  39274. multiply: function(e, t) {
  39275. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  39276. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  39277. },
  39278. multiplyQuaternions: function(e, t) {
  39279. var i = e._x
  39280. , n = e._y
  39281. , r = e._z
  39282. , o = e._w
  39283. , a = t._x
  39284. , s = t._y
  39285. , l = t._z
  39286. , c = t._w;
  39287. return this._x = i * c + o * a + n * l - r * s,
  39288. this._y = n * c + o * s + r * a - i * l,
  39289. this._z = r * c + o * l + i * s - n * a,
  39290. this._w = o * c - i * a - n * s - r * l,
  39291. this.onChangeCallback(),
  39292. this
  39293. },
  39294. slerp: function(e, t) {
  39295. if (0 === t)
  39296. return this;
  39297. if (1 === t)
  39298. return this.copy(e);
  39299. var i = this._x
  39300. , n = this._y
  39301. , r = this._z
  39302. , o = this._w
  39303. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  39304. if (a < 0 ? (this._w = -e._w,
  39305. this._x = -e._x,
  39306. this._y = -e._y,
  39307. this._z = -e._z,
  39308. a = -a) : this.copy(e),
  39309. a >= 1)
  39310. return this._w = o,
  39311. this._x = i,
  39312. this._y = n,
  39313. this._z = r,
  39314. this;
  39315. var s = Math.sqrt(1 - a * a);
  39316. if (Math.abs(s) < .001)
  39317. return this._w = .5 * (o + this._w),
  39318. this._x = .5 * (i + this._x),
  39319. this._y = .5 * (n + this._y),
  39320. this._z = .5 * (r + this._z),
  39321. this;
  39322. var l = Math.atan2(s, a)
  39323. , c = Math.sin((1 - t) * l) / s
  39324. , h = Math.sin(t * l) / s;
  39325. return this._w = o * c + this._w * h,
  39326. this._x = i * c + this._x * h,
  39327. this._y = n * c + this._y * h,
  39328. this._z = r * c + this._z * h,
  39329. this.onChangeCallback(),
  39330. this
  39331. },
  39332. equals: function(e) {
  39333. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  39334. },
  39335. fromArray: function(e, t) {
  39336. return void 0 === t && (t = 0),
  39337. this._x = e[t],
  39338. this._y = e[t + 1],
  39339. this._z = e[t + 2],
  39340. this._w = e[t + 3],
  39341. this.onChangeCallback(),
  39342. this
  39343. },
  39344. toArray: function(e, t) {
  39345. return void 0 === e && (e = []),
  39346. void 0 === t && (t = 0),
  39347. e[t] = this._x,
  39348. e[t + 1] = this._y,
  39349. e[t + 2] = this._z,
  39350. e[t + 3] = this._w,
  39351. e
  39352. },
  39353. onChange: function(e) {
  39354. return this.onChangeCallback = e,
  39355. this
  39356. },
  39357. onChangeCallback: function() {}
  39358. },
  39359. Object.assign(n.Quaternion, {
  39360. slerp: function(e, t, i, n) {
  39361. return i.copy(e).slerp(t, n)
  39362. },
  39363. slerpFlat: function(e, t, i, n, r, o, a) {
  39364. var s = i[n + 0]
  39365. , l = i[n + 1]
  39366. , c = i[n + 2]
  39367. , h = i[n + 3]
  39368. , u = r[o + 0]
  39369. , d = r[o + 1]
  39370. , p = r[o + 2]
  39371. , f = r[o + 3];
  39372. if (h !== f || s !== u || l !== d || c !== p) {
  39373. var g = 1 - a
  39374. , m = s * u + l * d + c * p + h * f
  39375. , v = m >= 0 ? 1 : -1
  39376. , A = 1 - m * m;
  39377. if (A > Number.EPSILON) {
  39378. var y = Math.sqrt(A)
  39379. , C = Math.atan2(y, m * v);
  39380. g = Math.sin(g * C) / y,
  39381. a = Math.sin(a * C) / y
  39382. }
  39383. var I = a * v;
  39384. if (s = s * g + u * I,
  39385. l = l * g + d * I,
  39386. c = c * g + p * I,
  39387. h = h * g + f * I,
  39388. g === 1 - a) {
  39389. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  39390. s *= E,
  39391. l *= E,
  39392. c *= E,
  39393. h *= E
  39394. }
  39395. }
  39396. e[t] = s,
  39397. e[t + 1] = l,
  39398. e[t + 2] = c,
  39399. e[t + 3] = h
  39400. }
  39401. }),
  39402. n.Vector2 = function(e, t) {
  39403. this.x = e || 0,
  39404. this.y = t || 0
  39405. }
  39406. ,
  39407. n.Vector2.prototype = {
  39408. constructor: n.Vector2,
  39409. get width() {
  39410. return this.x
  39411. },
  39412. set width(e) {
  39413. this.x = e
  39414. },
  39415. get height() {
  39416. return this.y
  39417. },
  39418. set height(e) {
  39419. this.y = e
  39420. },
  39421. set: function(e, t) {
  39422. return this.x = e,
  39423. this.y = t,
  39424. this
  39425. },
  39426. setScalar: function(e) {
  39427. return this.x = e,
  39428. this.y = e,
  39429. this
  39430. },
  39431. setX: function(e) {
  39432. return this.x = e,
  39433. this
  39434. },
  39435. setY: function(e) {
  39436. return this.y = e,
  39437. this
  39438. },
  39439. setComponent: function(e, t) {
  39440. switch (e) {
  39441. case 0:
  39442. this.x = t;
  39443. break;
  39444. case 1:
  39445. this.y = t;
  39446. break;
  39447. default:
  39448. throw new Error("index is out of range: " + e)
  39449. }
  39450. },
  39451. getComponent: function(e) {
  39452. switch (e) {
  39453. case 0:
  39454. return this.x;
  39455. case 1:
  39456. return this.y;
  39457. default:
  39458. throw new Error("index is out of range: " + e)
  39459. }
  39460. },
  39461. clone: function() {
  39462. return new this.constructor(this.x,this.y)
  39463. },
  39464. copy: function(e) {
  39465. return this.x = e.x,
  39466. this.y = e.y,
  39467. this
  39468. },
  39469. add: function(e, t) {
  39470. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39471. this.addVectors(e, t)) : (this.x += e.x,
  39472. this.y += e.y,
  39473. this)
  39474. },
  39475. addScalar: function(e) {
  39476. return this.x += e,
  39477. this.y += e,
  39478. this
  39479. },
  39480. addVectors: function(e, t) {
  39481. return this.x = e.x + t.x,
  39482. this.y = e.y + t.y,
  39483. this
  39484. },
  39485. addScaledVector: function(e, t) {
  39486. return this.x += e.x * t,
  39487. this.y += e.y * t,
  39488. this
  39489. },
  39490. sub: function(e, t) {
  39491. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39492. this.subVectors(e, t)) : (this.x -= e.x,
  39493. this.y -= e.y,
  39494. this)
  39495. },
  39496. subScalar: function(e) {
  39497. return this.x -= e,
  39498. this.y -= e,
  39499. this
  39500. },
  39501. subVectors: function(e, t) {
  39502. return this.x = e.x - t.x,
  39503. this.y = e.y - t.y,
  39504. this
  39505. },
  39506. multiply: function(e) {
  39507. return this.x *= e.x,
  39508. this.y *= e.y,
  39509. this
  39510. },
  39511. multiplyScalar: function(e) {
  39512. return isFinite(e) ? (this.x *= e,
  39513. this.y *= e) : (this.x = 0,
  39514. this.y = 0),
  39515. this
  39516. },
  39517. divide: function(e) {
  39518. return this.x /= e.x,
  39519. this.y /= e.y,
  39520. this
  39521. },
  39522. divideScalar: function(e) {
  39523. return this.multiplyScalar(1 / e)
  39524. },
  39525. min: function(e) {
  39526. return this.x = Math.min(this.x, e.x),
  39527. this.y = Math.min(this.y, e.y),
  39528. this
  39529. },
  39530. max: function(e) {
  39531. return this.x = Math.max(this.x, e.x),
  39532. this.y = Math.max(this.y, e.y),
  39533. this
  39534. },
  39535. clamp: function(e, t) {
  39536. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39537. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39538. this
  39539. },
  39540. clampScalar: function() {
  39541. var e, t;
  39542. return function(i, r) {
  39543. return void 0 === e && (e = new n.Vector2,
  39544. t = new n.Vector2),
  39545. e.set(i, i),
  39546. t.set(r, r),
  39547. this.clamp(e, t)
  39548. }
  39549. }(),
  39550. clampLength: function(e, t) {
  39551. var i = this.length();
  39552. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39553. this
  39554. },
  39555. floor: function() {
  39556. return this.x = Math.floor(this.x),
  39557. this.y = Math.floor(this.y),
  39558. this
  39559. },
  39560. ceil: function() {
  39561. return this.x = Math.ceil(this.x),
  39562. this.y = Math.ceil(this.y),
  39563. this
  39564. },
  39565. round: function() {
  39566. return this.x = Math.round(this.x),
  39567. this.y = Math.round(this.y),
  39568. this
  39569. },
  39570. roundToZero: function() {
  39571. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39572. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39573. this
  39574. },
  39575. negate: function() {
  39576. return this.x = -this.x,
  39577. this.y = -this.y,
  39578. this
  39579. },
  39580. dot: function(e) {
  39581. return this.x * e.x + this.y * e.y
  39582. },
  39583. lengthSq: function() {
  39584. return this.x * this.x + this.y * this.y
  39585. },
  39586. length: function() {
  39587. return Math.sqrt(this.x * this.x + this.y * this.y)
  39588. },
  39589. lengthManhattan: function() {
  39590. return Math.abs(this.x) + Math.abs(this.y)
  39591. },
  39592. normalize: function() {
  39593. return this.divideScalar(this.length())
  39594. },
  39595. angle: function() {
  39596. var e = Math.atan2(this.y, this.x);
  39597. return e < 0 && (e += 2 * Math.PI),
  39598. e
  39599. },
  39600. distanceTo: function(e) {
  39601. return Math.sqrt(this.distanceToSquared(e))
  39602. },
  39603. distanceToSquared: function(e) {
  39604. var t = this.x - e.x
  39605. , i = this.y - e.y;
  39606. return t * t + i * i
  39607. },
  39608. setLength: function(e) {
  39609. return this.multiplyScalar(e / this.length())
  39610. },
  39611. lerp: function(e, t) {
  39612. return this.x += (e.x - this.x) * t,
  39613. this.y += (e.y - this.y) * t,
  39614. this
  39615. },
  39616. lerpVectors: function(e, t, i) {
  39617. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39618. this
  39619. },
  39620. equals: function(e) {
  39621. return e.x === this.x && e.y === this.y
  39622. },
  39623. fromArray: function(e, t) {
  39624. return void 0 === t && (t = 0),
  39625. this.x = e[t],
  39626. this.y = e[t + 1],
  39627. this
  39628. },
  39629. toArray: function(e, t) {
  39630. return void 0 === e && (e = []),
  39631. void 0 === t && (t = 0),
  39632. e[t] = this.x,
  39633. e[t + 1] = this.y,
  39634. e
  39635. },
  39636. fromAttribute: function(e, t, i) {
  39637. return void 0 === i && (i = 0),
  39638. t = t * e.itemSize + i,
  39639. this.x = e.array[t],
  39640. this.y = e.array[t + 1],
  39641. this
  39642. },
  39643. rotateAround: function(e, t) {
  39644. var i = Math.cos(t)
  39645. , n = Math.sin(t)
  39646. , r = this.x - e.x
  39647. , o = this.y - e.y;
  39648. return this.x = r * i - o * n + e.x,
  39649. this.y = r * n + o * i + e.y,
  39650. this
  39651. }
  39652. },
  39653. n.Vector3 = function(e, t, i) {
  39654. this.x = e || 0,
  39655. this.y = t || 0,
  39656. this.z = i || 0
  39657. }
  39658. ,
  39659. n.Vector3.prototype = {
  39660. constructor: n.Vector3,
  39661. set: function(e, t, i) {
  39662. return this.x = e,
  39663. this.y = t,
  39664. this.z = i,
  39665. this
  39666. },
  39667. setScalar: function(e) {
  39668. return this.x = e,
  39669. this.y = e,
  39670. this.z = e,
  39671. this
  39672. },
  39673. setX: function(e) {
  39674. return this.x = e,
  39675. this
  39676. },
  39677. setY: function(e) {
  39678. return this.y = e,
  39679. this
  39680. },
  39681. setZ: function(e) {
  39682. return this.z = e,
  39683. this
  39684. },
  39685. setComponent: function(e, t) {
  39686. switch (e) {
  39687. case 0:
  39688. this.x = t;
  39689. break;
  39690. case 1:
  39691. this.y = t;
  39692. break;
  39693. case 2:
  39694. this.z = t;
  39695. break;
  39696. default:
  39697. throw new Error("index is out of range: " + e)
  39698. }
  39699. },
  39700. getComponent: function(e) {
  39701. switch (e) {
  39702. case 0:
  39703. return this.x;
  39704. case 1:
  39705. return this.y;
  39706. case 2:
  39707. return this.z;
  39708. default:
  39709. throw new Error("index is out of range: " + e)
  39710. }
  39711. },
  39712. clone: function() {
  39713. return new this.constructor(this.x,this.y,this.z)
  39714. },
  39715. copy: function(e) {
  39716. return this.x = e.x,
  39717. this.y = e.y,
  39718. this.z = e.z,
  39719. this
  39720. },
  39721. add: function(e, t) {
  39722. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  39723. this.addVectors(e, t)) : (this.x += e.x,
  39724. this.y += e.y,
  39725. this.z += e.z,
  39726. this)
  39727. },
  39728. addScalar: function(e) {
  39729. return this.x += e,
  39730. this.y += e,
  39731. this.z += e,
  39732. this
  39733. },
  39734. addVectors: function(e, t) {
  39735. return this.x = e.x + t.x,
  39736. this.y = e.y + t.y,
  39737. this.z = e.z + t.z,
  39738. this
  39739. },
  39740. addScaledVector: function(e, t) {
  39741. return this.x += e.x * t,
  39742. this.y += e.y * t,
  39743. this.z += e.z * t,
  39744. this
  39745. },
  39746. sub: function(e, t) {
  39747. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  39748. this.subVectors(e, t)) : (this.x -= e.x,
  39749. this.y -= e.y,
  39750. this.z -= e.z,
  39751. this)
  39752. },
  39753. subScalar: function(e) {
  39754. return this.x -= e,
  39755. this.y -= e,
  39756. this.z -= e,
  39757. this
  39758. },
  39759. subVectors: function(e, t) {
  39760. return this.x = e.x - t.x,
  39761. this.y = e.y - t.y,
  39762. this.z = e.z - t.z,
  39763. this
  39764. },
  39765. multiply: function(e, t) {
  39766. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  39767. this.multiplyVectors(e, t)) : (this.x *= e.x,
  39768. this.y *= e.y,
  39769. this.z *= e.z,
  39770. this)
  39771. },
  39772. multiplyScalar: function(e) {
  39773. return isFinite(e) ? (this.x *= e,
  39774. this.y *= e,
  39775. this.z *= e) : (this.x = 0,
  39776. this.y = 0,
  39777. this.z = 0),
  39778. this
  39779. },
  39780. multiplyVectors: function(e, t) {
  39781. return this.x = e.x * t.x,
  39782. this.y = e.y * t.y,
  39783. this.z = e.z * t.z,
  39784. this
  39785. },
  39786. applyEuler: function() {
  39787. var e;
  39788. return function(t) {
  39789. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  39790. void 0 === e && (e = new n.Quaternion),
  39791. this.applyQuaternion(e.setFromEuler(t)),
  39792. this
  39793. }
  39794. }(),
  39795. applyAxisAngle: function() {
  39796. var e;
  39797. return function(t, i) {
  39798. return void 0 === e && (e = new n.Quaternion),
  39799. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  39800. this
  39801. }
  39802. }(),
  39803. applyMatrix3: function(e) {
  39804. var t = this.x
  39805. , i = this.y
  39806. , n = this.z
  39807. , r = e.elements;
  39808. return this.x = r[0] * t + r[3] * i + r[6] * n,
  39809. this.y = r[1] * t + r[4] * i + r[7] * n,
  39810. this.z = r[2] * t + r[5] * i + r[8] * n,
  39811. this
  39812. },
  39813. applyMatrix4: function(e) {
  39814. var t = this.x
  39815. , i = this.y
  39816. , n = this.z
  39817. , r = e.elements;
  39818. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  39819. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  39820. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  39821. this
  39822. },
  39823. applyProjection: function(e) {
  39824. var t = this.x
  39825. , i = this.y
  39826. , n = this.z
  39827. , r = e.elements
  39828. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  39829. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  39830. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  39831. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  39832. this
  39833. },
  39834. applyQuaternion: function(e) {
  39835. var t = this.x
  39836. , i = this.y
  39837. , n = this.z
  39838. , r = e.x
  39839. , o = e.y
  39840. , a = e.z
  39841. , s = e.w
  39842. , l = s * t + o * n - a * i
  39843. , c = s * i + a * t - r * n
  39844. , h = s * n + r * i - o * t
  39845. , u = -r * t - o * i - a * n;
  39846. return this.x = l * s + u * -r + c * -a - h * -o,
  39847. this.y = c * s + u * -o + h * -r - l * -a,
  39848. this.z = h * s + u * -a + l * -o - c * -r,
  39849. this
  39850. },
  39851. project: function() {
  39852. var e;
  39853. return function(t) {
  39854. return void 0 === e && (e = new n.Matrix4),
  39855. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  39856. this.applyProjection(e)
  39857. }
  39858. }(),
  39859. unproject: function() {
  39860. var e;
  39861. return function(t) {
  39862. return void 0 === e && (e = new n.Matrix4),
  39863. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  39864. this.applyProjection(e)
  39865. }
  39866. }(),
  39867. transformDirection: function(e) {
  39868. var t = this.x
  39869. , i = this.y
  39870. , n = this.z
  39871. , r = e.elements;
  39872. return this.x = r[0] * t + r[4] * i + r[8] * n,
  39873. this.y = r[1] * t + r[5] * i + r[9] * n,
  39874. this.z = r[2] * t + r[6] * i + r[10] * n,
  39875. this.normalize(),
  39876. this
  39877. },
  39878. divide: function(e) {
  39879. return this.x /= e.x,
  39880. this.y /= e.y,
  39881. this.z /= e.z,
  39882. this
  39883. },
  39884. divideScalar: function(e) {
  39885. return this.multiplyScalar(1 / e)
  39886. },
  39887. min: function(e) {
  39888. return this.x = Math.min(this.x, e.x),
  39889. this.y = Math.min(this.y, e.y),
  39890. this.z = Math.min(this.z, e.z),
  39891. this
  39892. },
  39893. max: function(e) {
  39894. return this.x = Math.max(this.x, e.x),
  39895. this.y = Math.max(this.y, e.y),
  39896. this.z = Math.max(this.z, e.z),
  39897. this
  39898. },
  39899. clamp: function(e, t) {
  39900. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  39901. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  39902. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  39903. this
  39904. },
  39905. clampScalar: function() {
  39906. var e, t;
  39907. return function(i, r) {
  39908. return void 0 === e && (e = new n.Vector3,
  39909. t = new n.Vector3),
  39910. e.set(i, i, i),
  39911. t.set(r, r, r),
  39912. this.clamp(e, t)
  39913. }
  39914. }(),
  39915. clampLength: function(e, t) {
  39916. var i = this.length();
  39917. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  39918. this
  39919. },
  39920. floor: function() {
  39921. return this.x = Math.floor(this.x),
  39922. this.y = Math.floor(this.y),
  39923. this.z = Math.floor(this.z),
  39924. this
  39925. },
  39926. ceil: function() {
  39927. return this.x = Math.ceil(this.x),
  39928. this.y = Math.ceil(this.y),
  39929. this.z = Math.ceil(this.z),
  39930. this
  39931. },
  39932. round: function() {
  39933. return this.x = Math.round(this.x),
  39934. this.y = Math.round(this.y),
  39935. this.z = Math.round(this.z),
  39936. this
  39937. },
  39938. roundToZero: function() {
  39939. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  39940. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  39941. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  39942. this
  39943. },
  39944. negate: function() {
  39945. return this.x = -this.x,
  39946. this.y = -this.y,
  39947. this.z = -this.z,
  39948. this
  39949. },
  39950. dot: function(e) {
  39951. return this.x * e.x + this.y * e.y + this.z * e.z
  39952. },
  39953. lengthSq: function() {
  39954. return this.x * this.x + this.y * this.y + this.z * this.z
  39955. },
  39956. length: function() {
  39957. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  39958. },
  39959. lengthManhattan: function() {
  39960. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  39961. },
  39962. normalize: function() {
  39963. return this.divideScalar(this.length())
  39964. },
  39965. setLength: function(e) {
  39966. return this.multiplyScalar(e / this.length())
  39967. },
  39968. lerp: function(e, t) {
  39969. return this.x += (e.x - this.x) * t,
  39970. this.y += (e.y - this.y) * t,
  39971. this.z += (e.z - this.z) * t,
  39972. this
  39973. },
  39974. lerpVectors: function(e, t, i) {
  39975. return this.subVectors(t, e).multiplyScalar(i).add(e),
  39976. this
  39977. },
  39978. cross: function(e, t) {
  39979. if (void 0 !== t)
  39980. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  39981. this.crossVectors(e, t);
  39982. var i = this.x
  39983. , n = this.y
  39984. , r = this.z;
  39985. return this.x = n * e.z - r * e.y,
  39986. this.y = r * e.x - i * e.z,
  39987. this.z = i * e.y - n * e.x,
  39988. this
  39989. },
  39990. crossVectors: function(e, t) {
  39991. var i = e.x
  39992. , n = e.y
  39993. , r = e.z
  39994. , o = t.x
  39995. , a = t.y
  39996. , s = t.z;
  39997. return this.x = n * s - r * a,
  39998. this.y = r * o - i * s,
  39999. this.z = i * a - n * o,
  40000. this
  40001. },
  40002. projectOnVector: function() {
  40003. var e, t;
  40004. return function(i) {
  40005. return void 0 === e && (e = new n.Vector3),
  40006. e.copy(i).normalize(),
  40007. t = this.dot(e),
  40008. this.copy(e).multiplyScalar(t)
  40009. }
  40010. }(),
  40011. projectOnPlane: function() {
  40012. var e;
  40013. return function(t) {
  40014. return void 0 === e && (e = new n.Vector3),
  40015. e.copy(this).projectOnVector(t),
  40016. this.sub(e)
  40017. }
  40018. }(),
  40019. reflect: function() {
  40020. var e;
  40021. return function(t) {
  40022. return void 0 === e && (e = new n.Vector3),
  40023. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40024. }
  40025. }(),
  40026. angleTo: function(e) {
  40027. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40028. return Math.acos(n.Math.clamp(t, -1, 1))
  40029. },
  40030. distanceTo: function(e) {
  40031. return Math.sqrt(this.distanceToSquared(e))
  40032. },
  40033. distanceToSquared: function(e) {
  40034. var t = this.x - e.x
  40035. , i = this.y - e.y
  40036. , n = this.z - e.z;
  40037. return t * t + i * i + n * n
  40038. },
  40039. setFromSpherical: function(e) {
  40040. var t = Math.sin(e.phi) * e.radius;
  40041. return this.x = t * Math.sin(e.theta),
  40042. this.y = Math.cos(e.phi) * e.radius,
  40043. this.z = t * Math.cos(e.theta),
  40044. this
  40045. },
  40046. setFromMatrixPosition: function(e) {
  40047. return this.setFromMatrixColumn(e, 3)
  40048. },
  40049. setFromMatrixScale: function(e) {
  40050. var t = this.setFromMatrixColumn(e, 0).length()
  40051. , i = this.setFromMatrixColumn(e, 1).length()
  40052. , n = this.setFromMatrixColumn(e, 2).length();
  40053. return this.x = t,
  40054. this.y = i,
  40055. this.z = n,
  40056. this
  40057. },
  40058. setFromMatrixColumn: function(e, t) {
  40059. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40060. e = arguments[1],
  40061. t = arguments[0]),
  40062. this.fromArray(e.elements, 4 * t)
  40063. },
  40064. equals: function(e) {
  40065. return e.x === this.x && e.y === this.y && e.z === this.z
  40066. },
  40067. fromArray: function(e, t) {
  40068. return void 0 === t && (t = 0),
  40069. this.x = e[t],
  40070. this.y = e[t + 1],
  40071. this.z = e[t + 2],
  40072. this
  40073. },
  40074. toArray: function(e, t) {
  40075. return void 0 === e && (e = []),
  40076. void 0 === t && (t = 0),
  40077. e[t] = this.x,
  40078. e[t + 1] = this.y,
  40079. e[t + 2] = this.z,
  40080. e
  40081. },
  40082. fromAttribute: function(e, t, i) {
  40083. return void 0 === i && (i = 0),
  40084. t = t * e.itemSize + i,
  40085. this.x = e.array[t],
  40086. this.y = e.array[t + 1],
  40087. this.z = e.array[t + 2],
  40088. this
  40089. }
  40090. },
  40091. n.Vector4 = function(e, t, i, n) {
  40092. this.x = e || 0,
  40093. this.y = t || 0,
  40094. this.z = i || 0,
  40095. this.w = void 0 !== n ? n : 1
  40096. }
  40097. ,
  40098. n.Vector4.prototype = {
  40099. constructor: n.Vector4,
  40100. set: function(e, t, i, n) {
  40101. return this.x = e,
  40102. this.y = t,
  40103. this.z = i,
  40104. this.w = n,
  40105. this
  40106. },
  40107. setScalar: function(e) {
  40108. return this.x = e,
  40109. this.y = e,
  40110. this.z = e,
  40111. this.w = e,
  40112. this
  40113. },
  40114. setX: function(e) {
  40115. return this.x = e,
  40116. this
  40117. },
  40118. setY: function(e) {
  40119. return this.y = e,
  40120. this
  40121. },
  40122. setZ: function(e) {
  40123. return this.z = e,
  40124. this
  40125. },
  40126. setW: function(e) {
  40127. return this.w = e,
  40128. this
  40129. },
  40130. setComponent: function(e, t) {
  40131. switch (e) {
  40132. case 0:
  40133. this.x = t;
  40134. break;
  40135. case 1:
  40136. this.y = t;
  40137. break;
  40138. case 2:
  40139. this.z = t;
  40140. break;
  40141. case 3:
  40142. this.w = t;
  40143. break;
  40144. default:
  40145. throw new Error("index is out of range: " + e)
  40146. }
  40147. },
  40148. getComponent: function(e) {
  40149. switch (e) {
  40150. case 0:
  40151. return this.x;
  40152. case 1:
  40153. return this.y;
  40154. case 2:
  40155. return this.z;
  40156. case 3:
  40157. return this.w;
  40158. default:
  40159. throw new Error("index is out of range: " + e)
  40160. }
  40161. },
  40162. clone: function() {
  40163. return new this.constructor(this.x,this.y,this.z,this.w)
  40164. },
  40165. copy: function(e) {
  40166. return this.x = e.x,
  40167. this.y = e.y,
  40168. this.z = e.z,
  40169. this.w = void 0 !== e.w ? e.w : 1,
  40170. this
  40171. },
  40172. add: function(e, t) {
  40173. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40174. this.addVectors(e, t)) : (this.x += e.x,
  40175. this.y += e.y,
  40176. this.z += e.z,
  40177. this.w += e.w,
  40178. this)
  40179. },
  40180. addScalar: function(e) {
  40181. return this.x += e,
  40182. this.y += e,
  40183. this.z += e,
  40184. this.w += e,
  40185. this
  40186. },
  40187. addVectors: function(e, t) {
  40188. return this.x = e.x + t.x,
  40189. this.y = e.y + t.y,
  40190. this.z = e.z + t.z,
  40191. this.w = e.w + t.w,
  40192. this
  40193. },
  40194. addScaledVector: function(e, t) {
  40195. return this.x += e.x * t,
  40196. this.y += e.y * t,
  40197. this.z += e.z * t,
  40198. this.w += e.w * t,
  40199. this
  40200. },
  40201. sub: function(e, t) {
  40202. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40203. this.subVectors(e, t)) : (this.x -= e.x,
  40204. this.y -= e.y,
  40205. this.z -= e.z,
  40206. this.w -= e.w,
  40207. this)
  40208. },
  40209. subScalar: function(e) {
  40210. return this.x -= e,
  40211. this.y -= e,
  40212. this.z -= e,
  40213. this.w -= e,
  40214. this
  40215. },
  40216. subVectors: function(e, t) {
  40217. return this.x = e.x - t.x,
  40218. this.y = e.y - t.y,
  40219. this.z = e.z - t.z,
  40220. this.w = e.w - t.w,
  40221. this
  40222. },
  40223. multiplyScalar: function(e) {
  40224. return isFinite(e) ? (this.x *= e,
  40225. this.y *= e,
  40226. this.z *= e,
  40227. this.w *= e) : (this.x = 0,
  40228. this.y = 0,
  40229. this.z = 0,
  40230. this.w = 0),
  40231. this
  40232. },
  40233. applyMatrix4: function(e) {
  40234. var t = this.x
  40235. , i = this.y
  40236. , n = this.z
  40237. , r = this.w
  40238. , o = e.elements;
  40239. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  40240. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  40241. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  40242. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  40243. this
  40244. },
  40245. divideScalar: function(e) {
  40246. return this.multiplyScalar(1 / e)
  40247. },
  40248. setAxisAngleFromQuaternion: function(e) {
  40249. this.w = 2 * Math.acos(e.w);
  40250. var t = Math.sqrt(1 - e.w * e.w);
  40251. return t < 1e-4 ? (this.x = 1,
  40252. this.y = 0,
  40253. this.z = 0) : (this.x = e.x / t,
  40254. this.y = e.y / t,
  40255. this.z = e.z / t),
  40256. this
  40257. },
  40258. setAxisAngleFromRotationMatrix: function(e) {
  40259. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  40260. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  40261. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  40262. return this.set(1, 0, 0, 0),
  40263. this;
  40264. t = Math.PI;
  40265. var v = (l + 1) / 2
  40266. , A = (d + 1) / 2
  40267. , y = (m + 1) / 2
  40268. , C = (c + u) / 4
  40269. , I = (h + f) / 4
  40270. , E = (p + g) / 4;
  40271. return v > A && v > y ? v < o ? (i = 0,
  40272. n = .707106781,
  40273. r = .707106781) : (i = Math.sqrt(v),
  40274. n = C / i,
  40275. r = I / i) : A > y ? A < o ? (i = .707106781,
  40276. n = 0,
  40277. r = .707106781) : (n = Math.sqrt(A),
  40278. i = C / n,
  40279. r = E / n) : y < o ? (i = .707106781,
  40280. n = .707106781,
  40281. r = 0) : (r = Math.sqrt(y),
  40282. i = I / r,
  40283. n = E / r),
  40284. this.set(i, n, r, t),
  40285. this
  40286. }
  40287. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  40288. return Math.abs(b) < .001 && (b = 1),
  40289. this.x = (g - p) / b,
  40290. this.y = (h - f) / b,
  40291. this.z = (u - c) / b,
  40292. this.w = Math.acos((l + d + m - 1) / 2),
  40293. this
  40294. },
  40295. min: function(e) {
  40296. return this.x = Math.min(this.x, e.x),
  40297. this.y = Math.min(this.y, e.y),
  40298. this.z = Math.min(this.z, e.z),
  40299. this.w = Math.min(this.w, e.w),
  40300. this
  40301. },
  40302. max: function(e) {
  40303. return this.x = Math.max(this.x, e.x),
  40304. this.y = Math.max(this.y, e.y),
  40305. this.z = Math.max(this.z, e.z),
  40306. this.w = Math.max(this.w, e.w),
  40307. this
  40308. },
  40309. clamp: function(e, t) {
  40310. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40311. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40312. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40313. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  40314. this
  40315. },
  40316. clampScalar: function() {
  40317. var e, t;
  40318. return function(i, r) {
  40319. return void 0 === e && (e = new n.Vector4,
  40320. t = new n.Vector4),
  40321. e.set(i, i, i, i),
  40322. t.set(r, r, r, r),
  40323. this.clamp(e, t)
  40324. }
  40325. }(),
  40326. floor: function() {
  40327. return this.x = Math.floor(this.x),
  40328. this.y = Math.floor(this.y),
  40329. this.z = Math.floor(this.z),
  40330. this.w = Math.floor(this.w),
  40331. this
  40332. },
  40333. ceil: function() {
  40334. return this.x = Math.ceil(this.x),
  40335. this.y = Math.ceil(this.y),
  40336. this.z = Math.ceil(this.z),
  40337. this.w = Math.ceil(this.w),
  40338. this
  40339. },
  40340. round: function() {
  40341. return this.x = Math.round(this.x),
  40342. this.y = Math.round(this.y),
  40343. this.z = Math.round(this.z),
  40344. this.w = Math.round(this.w),
  40345. this
  40346. },
  40347. roundToZero: function() {
  40348. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40349. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40350. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40351. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  40352. this
  40353. },
  40354. negate: function() {
  40355. return this.x = -this.x,
  40356. this.y = -this.y,
  40357. this.z = -this.z,
  40358. this.w = -this.w,
  40359. this
  40360. },
  40361. dot: function(e) {
  40362. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  40363. },
  40364. lengthSq: function() {
  40365. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  40366. },
  40367. length: function() {
  40368. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  40369. },
  40370. lengthManhattan: function() {
  40371. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  40372. },
  40373. normalize: function() {
  40374. return this.divideScalar(this.length())
  40375. },
  40376. setLength: function(e) {
  40377. return this.multiplyScalar(e / this.length())
  40378. },
  40379. lerp: function(e, t) {
  40380. return this.x += (e.x - this.x) * t,
  40381. this.y += (e.y - this.y) * t,
  40382. this.z += (e.z - this.z) * t,
  40383. this.w += (e.w - this.w) * t,
  40384. this
  40385. },
  40386. lerpVectors: function(e, t, i) {
  40387. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40388. this
  40389. },
  40390. equals: function(e) {
  40391. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  40392. },
  40393. fromArray: function(e, t) {
  40394. return void 0 === t && (t = 0),
  40395. this.x = e[t],
  40396. this.y = e[t + 1],
  40397. this.z = e[t + 2],
  40398. this.w = e[t + 3],
  40399. this
  40400. },
  40401. toArray: function(e, t) {
  40402. return void 0 === e && (e = []),
  40403. void 0 === t && (t = 0),
  40404. e[t] = this.x,
  40405. e[t + 1] = this.y,
  40406. e[t + 2] = this.z,
  40407. e[t + 3] = this.w,
  40408. e
  40409. },
  40410. fromAttribute: function(e, t, i) {
  40411. return void 0 === i && (i = 0),
  40412. t = t * e.itemSize + i,
  40413. this.x = e.array[t],
  40414. this.y = e.array[t + 1],
  40415. this.z = e.array[t + 2],
  40416. this.w = e.array[t + 3],
  40417. this
  40418. }
  40419. },
  40420. n.Euler = function(e, t, i, r) {
  40421. this._x = e || 0,
  40422. this._y = t || 0,
  40423. this._z = i || 0,
  40424. this._order = r || n.Euler.DefaultOrder
  40425. }
  40426. ,
  40427. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  40428. n.Euler.DefaultOrder = "XYZ",
  40429. n.Euler.prototype = {
  40430. constructor: n.Euler,
  40431. get x() {
  40432. return this._x
  40433. },
  40434. set x(e) {
  40435. this._x = e,
  40436. this.onChangeCallback()
  40437. },
  40438. get y() {
  40439. return this._y
  40440. },
  40441. set y(e) {
  40442. this._y = e,
  40443. this.onChangeCallback()
  40444. },
  40445. get z() {
  40446. return this._z
  40447. },
  40448. set z(e) {
  40449. this._z = e,
  40450. this.onChangeCallback()
  40451. },
  40452. get order() {
  40453. return this._order
  40454. },
  40455. set order(e) {
  40456. this._order = e,
  40457. this.onChangeCallback()
  40458. },
  40459. set: function(e, t, i, n) {
  40460. return this._x = e,
  40461. this._y = t,
  40462. this._z = i,
  40463. this._order = n || this._order,
  40464. this.onChangeCallback(),
  40465. this
  40466. },
  40467. clone: function() {
  40468. return new this.constructor(this._x,this._y,this._z,this._order)
  40469. },
  40470. copy: function(e) {
  40471. return this._x = e._x,
  40472. this._y = e._y,
  40473. this._z = e._z,
  40474. this._order = e._order,
  40475. this.onChangeCallback(),
  40476. this
  40477. },
  40478. setFromRotationMatrix: function(e, t, i) {
  40479. var r = n.Math.clamp
  40480. , o = e.elements
  40481. , a = o[0]
  40482. , s = o[4]
  40483. , l = o[8]
  40484. , c = o[1]
  40485. , h = o[5]
  40486. , u = o[9]
  40487. , d = o[2]
  40488. , p = o[6]
  40489. , f = o[10];
  40490. return t = t || this._order,
  40491. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  40492. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  40493. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  40494. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  40495. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  40496. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  40497. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  40498. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  40499. this._z = Math.atan2(-s, h)) : (this._y = 0,
  40500. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  40501. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  40502. this._z = Math.atan2(c, a)) : (this._x = 0,
  40503. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  40504. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  40505. this._y = Math.atan2(-d, a)) : (this._x = 0,
  40506. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  40507. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  40508. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  40509. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  40510. this._order = t,
  40511. i !== !1 && this.onChangeCallback(),
  40512. this
  40513. },
  40514. setFromQuaternion: function() {
  40515. var e;
  40516. return function(t, i, r) {
  40517. return void 0 === e && (e = new n.Matrix4),
  40518. e.makeRotationFromQuaternion(t),
  40519. this.setFromRotationMatrix(e, i, r),
  40520. this
  40521. }
  40522. }(),
  40523. setFromVector3: function(e, t) {
  40524. return this.set(e.x, e.y, e.z, t || this._order)
  40525. },
  40526. reorder: function() {
  40527. var e = new n.Quaternion;
  40528. return function(t) {
  40529. e.setFromEuler(this),
  40530. this.setFromQuaternion(e, t)
  40531. }
  40532. }(),
  40533. equals: function(e) {
  40534. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  40535. },
  40536. fromArray: function(e) {
  40537. return this._x = e[0],
  40538. this._y = e[1],
  40539. this._z = e[2],
  40540. void 0 !== e[3] && (this._order = e[3]),
  40541. this.onChangeCallback(),
  40542. this
  40543. },
  40544. toArray: function(e, t) {
  40545. return void 0 === e && (e = []),
  40546. void 0 === t && (t = 0),
  40547. e[t] = this._x,
  40548. e[t + 1] = this._y,
  40549. e[t + 2] = this._z,
  40550. e[t + 3] = this._order,
  40551. e
  40552. },
  40553. toVector3: function(e) {
  40554. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  40555. },
  40556. onChange: function(e) {
  40557. return this.onChangeCallback = e,
  40558. this
  40559. },
  40560. onChangeCallback: function() {}
  40561. },
  40562. n.Line3 = function(e, t) {
  40563. this.start = void 0 !== e ? e : new n.Vector3,
  40564. this.end = void 0 !== t ? t : new n.Vector3
  40565. }
  40566. ,
  40567. n.Line3.prototype = {
  40568. constructor: n.Line3,
  40569. set: function(e, t) {
  40570. return this.start.copy(e),
  40571. this.end.copy(t),
  40572. this
  40573. },
  40574. clone: function() {
  40575. return (new this.constructor).copy(this)
  40576. },
  40577. copy: function(e) {
  40578. return this.start.copy(e.start),
  40579. this.end.copy(e.end),
  40580. this
  40581. },
  40582. center: function(e) {
  40583. var t = e || new n.Vector3;
  40584. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  40585. },
  40586. delta: function(e) {
  40587. var t = e || new n.Vector3;
  40588. return t.subVectors(this.end, this.start)
  40589. },
  40590. distanceSq: function() {
  40591. return this.start.distanceToSquared(this.end)
  40592. },
  40593. distance: function() {
  40594. return this.start.distanceTo(this.end)
  40595. },
  40596. at: function(e, t) {
  40597. var i = t || new n.Vector3;
  40598. return this.delta(i).multiplyScalar(e).add(this.start)
  40599. },
  40600. closestPointToPointParameter: function() {
  40601. var e = new n.Vector3
  40602. , t = new n.Vector3;
  40603. return function(i, r) {
  40604. e.subVectors(i, this.start),
  40605. t.subVectors(this.end, this.start);
  40606. var o = t.dot(t)
  40607. , a = t.dot(e)
  40608. , s = a / o;
  40609. return r && (s = n.Math.clamp(s, 0, 1)),
  40610. s
  40611. }
  40612. }(),
  40613. closestPointToPoint: function(e, t, i) {
  40614. var r = this.closestPointToPointParameter(e, t)
  40615. , o = i || new n.Vector3;
  40616. return this.delta(o).multiplyScalar(r).add(this.start)
  40617. },
  40618. applyMatrix4: function(e) {
  40619. return this.start.applyMatrix4(e),
  40620. this.end.applyMatrix4(e),
  40621. this
  40622. },
  40623. equals: function(e) {
  40624. return e.start.equals(this.start) && e.end.equals(this.end)
  40625. }
  40626. },
  40627. n.Box2 = function(e, t) {
  40628. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  40629. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  40630. }
  40631. ,
  40632. n.Box2.prototype = {
  40633. constructor: n.Box2,
  40634. set: function(e, t) {
  40635. return this.min.copy(e),
  40636. this.max.copy(t),
  40637. this
  40638. },
  40639. setFromPoints: function(e) {
  40640. this.makeEmpty();
  40641. for (var t = 0, i = e.length; t < i; t++)
  40642. this.expandByPoint(e[t]);
  40643. return this
  40644. },
  40645. setFromCenterAndSize: function() {
  40646. var e = new n.Vector2;
  40647. return function(t, i) {
  40648. var n = e.copy(i).multiplyScalar(.5);
  40649. return this.min.copy(t).sub(n),
  40650. this.max.copy(t).add(n),
  40651. this
  40652. }
  40653. }(),
  40654. clone: function() {
  40655. return (new this.constructor).copy(this)
  40656. },
  40657. copy: function(e) {
  40658. return this.min.copy(e.min),
  40659. this.max.copy(e.max),
  40660. this
  40661. },
  40662. makeEmpty: function() {
  40663. return this.min.x = this.min.y = +(1 / 0),
  40664. this.max.x = this.max.y = -(1 / 0),
  40665. this
  40666. },
  40667. isEmpty: function() {
  40668. return this.max.x < this.min.x || this.max.y < this.min.y
  40669. },
  40670. center: function(e) {
  40671. var t = e || new n.Vector2;
  40672. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40673. },
  40674. size: function(e) {
  40675. var t = e || new n.Vector2;
  40676. return t.subVectors(this.max, this.min)
  40677. },
  40678. expandByPoint: function(e) {
  40679. return this.min.min(e),
  40680. this.max.max(e),
  40681. this
  40682. },
  40683. expandByVector: function(e) {
  40684. return this.min.sub(e),
  40685. this.max.add(e),
  40686. this
  40687. },
  40688. expandByScalar: function(e) {
  40689. return this.min.addScalar(-e),
  40690. this.max.addScalar(e),
  40691. this
  40692. },
  40693. containsPoint: function(e) {
  40694. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  40695. },
  40696. containsBox: function(e) {
  40697. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y
  40698. },
  40699. getParameter: function(e, t) {
  40700. var i = t || new n.Vector2;
  40701. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  40702. },
  40703. intersectsBox: function(e) {
  40704. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y)
  40705. },
  40706. clampPoint: function(e, t) {
  40707. var i = t || new n.Vector2;
  40708. return i.copy(e).clamp(this.min, this.max)
  40709. },
  40710. distanceToPoint: function() {
  40711. var e = new n.Vector2;
  40712. return function(t) {
  40713. var i = e.copy(t).clamp(this.min, this.max);
  40714. return i.sub(t).length()
  40715. }
  40716. }(),
  40717. intersect: function(e) {
  40718. return this.min.max(e.min),
  40719. this.max.min(e.max),
  40720. this
  40721. },
  40722. union: function(e) {
  40723. return this.min.min(e.min),
  40724. this.max.max(e.max),
  40725. this
  40726. },
  40727. translate: function(e) {
  40728. return this.min.add(e),
  40729. this.max.add(e),
  40730. this
  40731. },
  40732. equals: function(e) {
  40733. return e.min.equals(this.min) && e.max.equals(this.max)
  40734. }
  40735. },
  40736. n.Box3 = function(e, t) {
  40737. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  40738. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  40739. }
  40740. ,
  40741. n.Box3.prototype = {
  40742. constructor: n.Box3,
  40743. set: function(e, t) {
  40744. return this.min.copy(e),
  40745. this.max.copy(t),
  40746. this
  40747. },
  40748. setFromArray: function(e) {
  40749. this.makeEmpty();
  40750. for (var t = +(1 / 0), i = +(1 / 0), n = +(1 / 0), r = -(1 / 0), o = -(1 / 0), a = -(1 / 0), s = 0, l = e.length; s < l; s += 3) {
  40751. var c = e[s]
  40752. , h = e[s + 1]
  40753. , u = e[s + 2];
  40754. c < t && (t = c),
  40755. h < i && (i = h),
  40756. u < n && (n = u),
  40757. c > r && (r = c),
  40758. h > o && (o = h),
  40759. u > a && (a = u)
  40760. }
  40761. this.min.set(t, i, n),
  40762. this.max.set(r, o, a)
  40763. },
  40764. setFromPoints: function(e) {
  40765. this.makeEmpty();
  40766. for (var t = 0, i = e.length; t < i; t++)
  40767. this.expandByPoint(e[t]);
  40768. return this
  40769. },
  40770. setFromCenterAndSize: function() {
  40771. var e = new n.Vector3;
  40772. return function(t, i) {
  40773. var n = e.copy(i).multiplyScalar(.5);
  40774. return this.min.copy(t).sub(n),
  40775. this.max.copy(t).add(n),
  40776. this
  40777. }
  40778. }(),
  40779. setFromObject: function() {
  40780. var e;
  40781. return function(t) {
  40782. void 0 === e && (e = new n.Box3);
  40783. var i = this;
  40784. return this.makeEmpty(),
  40785. t.updateMatrixWorld(!0),
  40786. t.traverse(function(t) {
  40787. var n = t.geometry;
  40788. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  40789. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  40790. e.applyMatrix4(t.matrixWorld),
  40791. i.union(e)))
  40792. }),
  40793. this
  40794. }
  40795. }(),
  40796. clone: function() {
  40797. return (new this.constructor).copy(this)
  40798. },
  40799. copy: function(e) {
  40800. return this.min.copy(e.min),
  40801. this.max.copy(e.max),
  40802. this
  40803. },
  40804. makeEmpty: function() {
  40805. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  40806. this.max.x = this.max.y = this.max.z = -(1 / 0),
  40807. this
  40808. },
  40809. isEmpty: function() {
  40810. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  40811. },
  40812. center: function(e) {
  40813. var t = e || new n.Vector3;
  40814. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  40815. },
  40816. size: function(e) {
  40817. var t = e || new n.Vector3;
  40818. return t.subVectors(this.max, this.min)
  40819. },
  40820. expandByPoint: function(e) {
  40821. return this.min.min(e),
  40822. this.max.max(e),
  40823. this
  40824. },
  40825. expandByVector: function(e) {
  40826. return this.min.sub(e),
  40827. this.max.add(e),
  40828. this
  40829. },
  40830. expandByScalar: function(e) {
  40831. return this.min.addScalar(-e),
  40832. this.max.addScalar(e),
  40833. this
  40834. },
  40835. containsPoint: function(e) {
  40836. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y || e.z < this.min.z || e.z > this.max.z)
  40837. },
  40838. containsBox: function(e) {
  40839. return this.min.x <= e.min.x && e.max.x <= this.max.x && this.min.y <= e.min.y && e.max.y <= this.max.y && this.min.z <= e.min.z && e.max.z <= this.max.z
  40840. },
  40841. getParameter: function(e, t) {
  40842. var i = t || new n.Vector3;
  40843. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  40844. },
  40845. intersectsBox: function(e) {
  40846. return !(e.max.x < this.min.x || e.min.x > this.max.x || e.max.y < this.min.y || e.min.y > this.max.y || e.max.z < this.min.z || e.min.z > this.max.z)
  40847. },
  40848. intersectsSphere: function() {
  40849. var e;
  40850. return function(t) {
  40851. return void 0 === e && (e = new n.Vector3),
  40852. this.clampPoint(t.center, e),
  40853. e.distanceToSquared(t.center) <= t.radius * t.radius
  40854. }
  40855. }(),
  40856. intersectsPlane: function(e) {
  40857. var t, i;
  40858. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  40859. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  40860. i = e.normal.x * this.min.x),
  40861. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  40862. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  40863. i += e.normal.y * this.min.y),
  40864. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  40865. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  40866. i += e.normal.z * this.min.z),
  40867. t <= e.constant && i >= e.constant
  40868. },
  40869. clampPoint: function(e, t) {
  40870. var i = t || new n.Vector3;
  40871. return i.copy(e).clamp(this.min, this.max)
  40872. },
  40873. distanceToPoint: function() {
  40874. var e = new n.Vector3;
  40875. return function(t) {
  40876. var i = e.copy(t).clamp(this.min, this.max);
  40877. return i.sub(t).length()
  40878. }
  40879. }(),
  40880. getBoundingSphere: function() {
  40881. var e = new n.Vector3;
  40882. return function(t) {
  40883. var i = t || new n.Sphere;
  40884. return i.center = this.center(),
  40885. i.radius = .5 * this.size(e).length(),
  40886. i
  40887. }
  40888. }(),
  40889. intersect: function(e) {
  40890. return this.min.max(e.min),
  40891. this.max.min(e.max),
  40892. this
  40893. },
  40894. union: function(e) {
  40895. return this.min.min(e.min),
  40896. this.max.max(e.max),
  40897. this
  40898. },
  40899. applyMatrix4: function() {
  40900. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  40901. return function(t) {
  40902. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  40903. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  40904. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  40905. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  40906. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  40907. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  40908. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  40909. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  40910. this.makeEmpty(),
  40911. this.setFromPoints(e),
  40912. this
  40913. }
  40914. }(),
  40915. translate: function(e) {
  40916. return this.min.add(e),
  40917. this.max.add(e),
  40918. this
  40919. },
  40920. equals: function(e) {
  40921. return e.min.equals(this.min) && e.max.equals(this.max)
  40922. }
  40923. },
  40924. n.Matrix3 = function() {
  40925. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  40926. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  40927. }
  40928. ,
  40929. n.Matrix3.prototype = {
  40930. constructor: n.Matrix3,
  40931. set: function(e, t, i, n, r, o, a, s, l) {
  40932. var c = this.elements;
  40933. return c[0] = e,
  40934. c[1] = n,
  40935. c[2] = a,
  40936. c[3] = t,
  40937. c[4] = r,
  40938. c[5] = s,
  40939. c[6] = i,
  40940. c[7] = o,
  40941. c[8] = l,
  40942. this
  40943. },
  40944. identity: function() {
  40945. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  40946. this
  40947. },
  40948. clone: function() {
  40949. return (new this.constructor).fromArray(this.elements)
  40950. },
  40951. copy: function(e) {
  40952. var t = e.elements;
  40953. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  40954. this
  40955. },
  40956. setFromMatrix4: function(e) {
  40957. var t = e.elements;
  40958. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  40959. this
  40960. },
  40961. applyToVector3Array: function() {
  40962. var e;
  40963. return function(t, i, r) {
  40964. void 0 === e && (e = new n.Vector3),
  40965. void 0 === i && (i = 0),
  40966. void 0 === r && (r = t.length);
  40967. for (var o = 0, a = i; o < r; o += 3,
  40968. a += 3)
  40969. e.fromArray(t, a),
  40970. e.applyMatrix3(this),
  40971. e.toArray(t, a);
  40972. return t
  40973. }
  40974. }(),
  40975. applyToBuffer: function() {
  40976. var e;
  40977. return function(t, i, r) {
  40978. void 0 === e && (e = new n.Vector3),
  40979. void 0 === i && (i = 0),
  40980. void 0 === r && (r = t.length / t.itemSize);
  40981. for (var o = 0, a = i; o < r; o++,
  40982. a++)
  40983. e.x = t.getX(a),
  40984. e.y = t.getY(a),
  40985. e.z = t.getZ(a),
  40986. e.applyMatrix3(this),
  40987. t.setXYZ(e.x, e.y, e.z);
  40988. return t
  40989. }
  40990. }(),
  40991. multiplyScalar: function(e) {
  40992. var t = this.elements;
  40993. return t[0] *= e,
  40994. t[3] *= e,
  40995. t[6] *= e,
  40996. t[1] *= e,
  40997. t[4] *= e,
  40998. t[7] *= e,
  40999. t[2] *= e,
  41000. t[5] *= e,
  41001. t[8] *= e,
  41002. this
  41003. },
  41004. determinant: function() {
  41005. var e = this.elements
  41006. , t = e[0]
  41007. , i = e[1]
  41008. , n = e[2]
  41009. , r = e[3]
  41010. , o = e[4]
  41011. , a = e[5]
  41012. , s = e[6]
  41013. , l = e[7]
  41014. , c = e[8];
  41015. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41016. },
  41017. getInverse: function(e, t) {
  41018. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41019. var i = e.elements
  41020. , r = this.elements
  41021. , o = i[0]
  41022. , a = i[1]
  41023. , s = i[2]
  41024. , l = i[3]
  41025. , c = i[4]
  41026. , h = i[5]
  41027. , u = i[6]
  41028. , d = i[7]
  41029. , p = i[8]
  41030. , f = p * c - h * d
  41031. , g = h * u - p * l
  41032. , m = d * l - c * u
  41033. , v = o * f + a * g + s * m;
  41034. if (0 === v) {
  41035. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41036. if (t)
  41037. throw new Error(A);
  41038. return console.warn(A),
  41039. this.identity()
  41040. }
  41041. return r[0] = f,
  41042. r[1] = s * d - p * a,
  41043. r[2] = h * a - s * c,
  41044. r[3] = g,
  41045. r[4] = p * o - s * u,
  41046. r[5] = s * l - h * o,
  41047. r[6] = m,
  41048. r[7] = a * u - d * o,
  41049. r[8] = c * o - a * l,
  41050. this.multiplyScalar(1 / v)
  41051. },
  41052. transpose: function() {
  41053. var e, t = this.elements;
  41054. return e = t[1],
  41055. t[1] = t[3],
  41056. t[3] = e,
  41057. e = t[2],
  41058. t[2] = t[6],
  41059. t[6] = e,
  41060. e = t[5],
  41061. t[5] = t[7],
  41062. t[7] = e,
  41063. this
  41064. },
  41065. flattenToArrayOffset: function(e, t) {
  41066. var i = this.elements;
  41067. return e[t] = i[0],
  41068. e[t + 1] = i[1],
  41069. e[t + 2] = i[2],
  41070. e[t + 3] = i[3],
  41071. e[t + 4] = i[4],
  41072. e[t + 5] = i[5],
  41073. e[t + 6] = i[6],
  41074. e[t + 7] = i[7],
  41075. e[t + 8] = i[8],
  41076. e
  41077. },
  41078. getNormalMatrix: function(e) {
  41079. return this.setFromMatrix4(e).getInverse(this).transpose()
  41080. },
  41081. transposeIntoArray: function(e) {
  41082. var t = this.elements;
  41083. return e[0] = t[0],
  41084. e[1] = t[3],
  41085. e[2] = t[6],
  41086. e[3] = t[1],
  41087. e[4] = t[4],
  41088. e[5] = t[7],
  41089. e[6] = t[2],
  41090. e[7] = t[5],
  41091. e[8] = t[8],
  41092. this
  41093. },
  41094. fromArray: function(e) {
  41095. return this.elements.set(e),
  41096. this
  41097. },
  41098. toArray: function() {
  41099. var e = this.elements;
  41100. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41101. }
  41102. },
  41103. n.Matrix4 = function() {
  41104. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41105. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41106. }
  41107. ,
  41108. n.Matrix4.prototype = {
  41109. constructor: n.Matrix4,
  41110. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41111. var m = this.elements;
  41112. return m[0] = e,
  41113. m[4] = t,
  41114. m[8] = i,
  41115. m[12] = n,
  41116. m[1] = r,
  41117. m[5] = o,
  41118. m[9] = a,
  41119. m[13] = s,
  41120. m[2] = l,
  41121. m[6] = c,
  41122. m[10] = h,
  41123. m[14] = u,
  41124. m[3] = d,
  41125. m[7] = p,
  41126. m[11] = f,
  41127. m[15] = g,
  41128. this
  41129. },
  41130. identity: function() {
  41131. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41132. this
  41133. },
  41134. clone: function() {
  41135. return (new n.Matrix4).fromArray(this.elements)
  41136. },
  41137. copy: function(e) {
  41138. return this.elements.set(e.elements),
  41139. this
  41140. },
  41141. copyPosition: function(e) {
  41142. var t = this.elements
  41143. , i = e.elements;
  41144. return t[12] = i[12],
  41145. t[13] = i[13],
  41146. t[14] = i[14],
  41147. this
  41148. },
  41149. extractBasis: function(e, t, i) {
  41150. return e.setFromMatrixColumn(this, 0),
  41151. t.setFromMatrixColumn(this, 1),
  41152. i.setFromMatrixColumn(this, 2),
  41153. this
  41154. },
  41155. makeBasis: function(e, t, i) {
  41156. return 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),
  41157. this
  41158. },
  41159. extractRotation: function() {
  41160. var e;
  41161. return function(t) {
  41162. void 0 === e && (e = new n.Vector3);
  41163. var i = this.elements
  41164. , r = t.elements
  41165. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41166. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41167. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41168. return i[0] = r[0] * o,
  41169. i[1] = r[1] * o,
  41170. i[2] = r[2] * o,
  41171. i[4] = r[4] * a,
  41172. i[5] = r[5] * a,
  41173. i[6] = r[6] * a,
  41174. i[8] = r[8] * s,
  41175. i[9] = r[9] * s,
  41176. i[10] = r[10] * s,
  41177. this
  41178. }
  41179. }(),
  41180. makeRotationFromEuler: function(e) {
  41181. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  41182. var t = this.elements
  41183. , i = e.x
  41184. , r = e.y
  41185. , o = e.z
  41186. , a = Math.cos(i)
  41187. , s = Math.sin(i)
  41188. , l = Math.cos(r)
  41189. , c = Math.sin(r)
  41190. , h = Math.cos(o)
  41191. , u = Math.sin(o);
  41192. if ("XYZ" === e.order) {
  41193. var d = a * h
  41194. , p = a * u
  41195. , f = s * h
  41196. , g = s * u;
  41197. t[0] = l * h,
  41198. t[4] = -l * u,
  41199. t[8] = c,
  41200. t[1] = p + f * c,
  41201. t[5] = d - g * c,
  41202. t[9] = -s * l,
  41203. t[2] = g - d * c,
  41204. t[6] = f + p * c,
  41205. t[10] = a * l
  41206. } else if ("YXZ" === e.order) {
  41207. var m = l * h
  41208. , v = l * u
  41209. , A = c * h
  41210. , y = c * u;
  41211. t[0] = m + y * s,
  41212. t[4] = A * s - v,
  41213. t[8] = a * c,
  41214. t[1] = a * u,
  41215. t[5] = a * h,
  41216. t[9] = -s,
  41217. t[2] = v * s - A,
  41218. t[6] = y + m * s,
  41219. t[10] = a * l
  41220. } else if ("ZXY" === e.order) {
  41221. var m = l * h
  41222. , v = l * u
  41223. , A = c * h
  41224. , y = c * u;
  41225. t[0] = m - y * s,
  41226. t[4] = -a * u,
  41227. t[8] = A + v * s,
  41228. t[1] = v + A * s,
  41229. t[5] = a * h,
  41230. t[9] = y - m * s,
  41231. t[2] = -a * c,
  41232. t[6] = s,
  41233. t[10] = a * l
  41234. } else if ("ZYX" === e.order) {
  41235. var d = a * h
  41236. , p = a * u
  41237. , f = s * h
  41238. , g = s * u;
  41239. t[0] = l * h,
  41240. t[4] = f * c - p,
  41241. t[8] = d * c + g,
  41242. t[1] = l * u,
  41243. t[5] = g * c + d,
  41244. t[9] = p * c - f,
  41245. t[2] = -c,
  41246. t[6] = s * l,
  41247. t[10] = a * l
  41248. } else if ("YZX" === e.order) {
  41249. var C = a * l
  41250. , I = a * c
  41251. , E = s * l
  41252. , b = s * c;
  41253. t[0] = l * h,
  41254. t[4] = b - C * u,
  41255. t[8] = E * u + I,
  41256. t[1] = u,
  41257. t[5] = a * h,
  41258. t[9] = -s * h,
  41259. t[2] = -c * h,
  41260. t[6] = I * u + E,
  41261. t[10] = C - b * u
  41262. } else if ("XZY" === e.order) {
  41263. var C = a * l
  41264. , I = a * c
  41265. , E = s * l
  41266. , b = s * c;
  41267. t[0] = l * h,
  41268. t[4] = -u,
  41269. t[8] = c * h,
  41270. t[1] = C * u + b,
  41271. t[5] = a * h,
  41272. t[9] = I * u - E,
  41273. t[2] = E * u - I,
  41274. t[6] = s * h,
  41275. t[10] = b * u + C
  41276. }
  41277. return t[3] = 0,
  41278. t[7] = 0,
  41279. t[11] = 0,
  41280. t[12] = 0,
  41281. t[13] = 0,
  41282. t[14] = 0,
  41283. t[15] = 1,
  41284. this
  41285. },
  41286. makeRotationFromQuaternion: function(e) {
  41287. var t = this.elements
  41288. , i = e.x
  41289. , n = e.y
  41290. , r = e.z
  41291. , o = e.w
  41292. , a = i + i
  41293. , s = n + n
  41294. , l = r + r
  41295. , c = i * a
  41296. , h = i * s
  41297. , u = i * l
  41298. , d = n * s
  41299. , p = n * l
  41300. , f = r * l
  41301. , g = o * a
  41302. , m = o * s
  41303. , v = o * l;
  41304. return t[0] = 1 - (d + f),
  41305. t[4] = h - v,
  41306. t[8] = u + m,
  41307. t[1] = h + v,
  41308. t[5] = 1 - (c + f),
  41309. t[9] = p - g,
  41310. t[2] = u - m,
  41311. t[6] = p + g,
  41312. t[10] = 1 - (c + d),
  41313. t[3] = 0,
  41314. t[7] = 0,
  41315. t[11] = 0,
  41316. t[12] = 0,
  41317. t[13] = 0,
  41318. t[14] = 0,
  41319. t[15] = 1,
  41320. this
  41321. },
  41322. lookAt: function() {
  41323. var e, t, i;
  41324. return function(r, o, a) {
  41325. void 0 === e && (e = new n.Vector3),
  41326. void 0 === t && (t = new n.Vector3),
  41327. void 0 === i && (i = new n.Vector3);
  41328. var s = this.elements;
  41329. return i.subVectors(r, o).normalize(),
  41330. 0 === i.lengthSq() && (i.z = 1),
  41331. e.crossVectors(a, i).normalize(),
  41332. 0 === e.lengthSq() && (i.x += 1e-4,
  41333. e.crossVectors(a, i).normalize()),
  41334. t.crossVectors(i, e),
  41335. s[0] = e.x,
  41336. s[4] = t.x,
  41337. s[8] = i.x,
  41338. s[1] = e.y,
  41339. s[5] = t.y,
  41340. s[9] = i.y,
  41341. s[2] = e.z,
  41342. s[6] = t.z,
  41343. s[10] = i.z,
  41344. this
  41345. }
  41346. }(),
  41347. multiply: function(e, t) {
  41348. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  41349. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  41350. },
  41351. multiplyMatrices: function(e, t) {
  41352. var i = e.elements
  41353. , n = t.elements
  41354. , r = this.elements
  41355. , o = i[0]
  41356. , a = i[4]
  41357. , s = i[8]
  41358. , l = i[12]
  41359. , c = i[1]
  41360. , h = i[5]
  41361. , u = i[9]
  41362. , d = i[13]
  41363. , p = i[2]
  41364. , f = i[6]
  41365. , g = i[10]
  41366. , m = i[14]
  41367. , v = i[3]
  41368. , A = i[7]
  41369. , y = i[11]
  41370. , C = i[15]
  41371. , I = n[0]
  41372. , E = n[4]
  41373. , b = n[8]
  41374. , w = n[12]
  41375. , _ = n[1]
  41376. , T = n[5]
  41377. , x = n[9]
  41378. , S = n[13]
  41379. , M = n[2]
  41380. , R = n[6]
  41381. , P = n[10]
  41382. , O = n[14]
  41383. , L = n[3]
  41384. , D = n[7]
  41385. , N = n[11]
  41386. , B = n[15];
  41387. return r[0] = o * I + a * _ + s * M + l * L,
  41388. r[4] = o * E + a * T + s * R + l * D,
  41389. r[8] = o * b + a * x + s * P + l * N,
  41390. r[12] = o * w + a * S + s * O + l * B,
  41391. r[1] = c * I + h * _ + u * M + d * L,
  41392. r[5] = c * E + h * T + u * R + d * D,
  41393. r[9] = c * b + h * x + u * P + d * N,
  41394. r[13] = c * w + h * S + u * O + d * B,
  41395. r[2] = p * I + f * _ + g * M + m * L,
  41396. r[6] = p * E + f * T + g * R + m * D,
  41397. r[10] = p * b + f * x + g * P + m * N,
  41398. r[14] = p * w + f * S + g * O + m * B,
  41399. r[3] = v * I + A * _ + y * M + C * L,
  41400. r[7] = v * E + A * T + y * R + C * D,
  41401. r[11] = v * b + A * x + y * P + C * N,
  41402. r[15] = v * w + A * S + y * O + C * B,
  41403. this
  41404. },
  41405. multiplyToArray: function(e, t, i) {
  41406. var n = this.elements;
  41407. return this.multiplyMatrices(e, t),
  41408. i[0] = n[0],
  41409. i[1] = n[1],
  41410. i[2] = n[2],
  41411. i[3] = n[3],
  41412. i[4] = n[4],
  41413. i[5] = n[5],
  41414. i[6] = n[6],
  41415. i[7] = n[7],
  41416. i[8] = n[8],
  41417. i[9] = n[9],
  41418. i[10] = n[10],
  41419. i[11] = n[11],
  41420. i[12] = n[12],
  41421. i[13] = n[13],
  41422. i[14] = n[14],
  41423. i[15] = n[15],
  41424. this
  41425. },
  41426. multiplyScalar: function(e) {
  41427. var t = this.elements;
  41428. return t[0] *= e,
  41429. t[4] *= e,
  41430. t[8] *= e,
  41431. t[12] *= e,
  41432. t[1] *= e,
  41433. t[5] *= e,
  41434. t[9] *= e,
  41435. t[13] *= e,
  41436. t[2] *= e,
  41437. t[6] *= e,
  41438. t[10] *= e,
  41439. t[14] *= e,
  41440. t[3] *= e,
  41441. t[7] *= e,
  41442. t[11] *= e,
  41443. t[15] *= e,
  41444. this
  41445. },
  41446. applyToVector3Array: function() {
  41447. var e;
  41448. return function(t, i, r) {
  41449. void 0 === e && (e = new n.Vector3),
  41450. void 0 === i && (i = 0),
  41451. void 0 === r && (r = t.length);
  41452. for (var o = 0, a = i; o < r; o += 3,
  41453. a += 3)
  41454. e.fromArray(t, a),
  41455. e.applyMatrix4(this),
  41456. e.toArray(t, a);
  41457. return t
  41458. }
  41459. }(),
  41460. applyToBuffer: function() {
  41461. var e;
  41462. return function(t, i, r) {
  41463. void 0 === e && (e = new n.Vector3),
  41464. void 0 === i && (i = 0),
  41465. void 0 === r && (r = t.length / t.itemSize);
  41466. for (var o = 0, a = i; o < r; o++,
  41467. a++)
  41468. e.x = t.getX(a),
  41469. e.y = t.getY(a),
  41470. e.z = t.getZ(a),
  41471. e.applyMatrix4(this),
  41472. t.setXYZ(e.x, e.y, e.z);
  41473. return t
  41474. }
  41475. }(),
  41476. determinant: function() {
  41477. var e = this.elements
  41478. , t = e[0]
  41479. , i = e[4]
  41480. , n = e[8]
  41481. , r = e[12]
  41482. , o = e[1]
  41483. , a = e[5]
  41484. , s = e[9]
  41485. , l = e[13]
  41486. , c = e[2]
  41487. , h = e[6]
  41488. , u = e[10]
  41489. , d = e[14]
  41490. , p = e[3]
  41491. , f = e[7]
  41492. , g = e[11]
  41493. , m = e[15];
  41494. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  41495. },
  41496. transpose: function() {
  41497. var e, t = this.elements;
  41498. return e = t[1],
  41499. t[1] = t[4],
  41500. t[4] = e,
  41501. e = t[2],
  41502. t[2] = t[8],
  41503. t[8] = e,
  41504. e = t[6],
  41505. t[6] = t[9],
  41506. t[9] = e,
  41507. e = t[3],
  41508. t[3] = t[12],
  41509. t[12] = e,
  41510. e = t[7],
  41511. t[7] = t[13],
  41512. t[13] = e,
  41513. e = t[11],
  41514. t[11] = t[14],
  41515. t[14] = e,
  41516. this
  41517. },
  41518. flattenToArrayOffset: function(e, t) {
  41519. var i = this.elements;
  41520. return e[t] = i[0],
  41521. e[t + 1] = i[1],
  41522. e[t + 2] = i[2],
  41523. e[t + 3] = i[3],
  41524. e[t + 4] = i[4],
  41525. e[t + 5] = i[5],
  41526. e[t + 6] = i[6],
  41527. e[t + 7] = i[7],
  41528. e[t + 8] = i[8],
  41529. e[t + 9] = i[9],
  41530. e[t + 10] = i[10],
  41531. e[t + 11] = i[11],
  41532. e[t + 12] = i[12],
  41533. e[t + 13] = i[13],
  41534. e[t + 14] = i[14],
  41535. e[t + 15] = i[15],
  41536. e
  41537. },
  41538. getPosition: function() {
  41539. var e;
  41540. return function() {
  41541. return void 0 === e && (e = new n.Vector3),
  41542. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  41543. e.setFromMatrixColumn(this, 3)
  41544. }
  41545. }(),
  41546. setPosition: function(e) {
  41547. var t = this.elements;
  41548. return t[12] = e.x,
  41549. t[13] = e.y,
  41550. t[14] = e.z,
  41551. this
  41552. },
  41553. getInverse: function(e, t) {
  41554. var i = this.elements
  41555. , n = e.elements
  41556. , r = n[0]
  41557. , o = n[1]
  41558. , a = n[2]
  41559. , s = n[3]
  41560. , l = n[4]
  41561. , c = n[5]
  41562. , h = n[6]
  41563. , u = n[7]
  41564. , d = n[8]
  41565. , p = n[9]
  41566. , f = n[10]
  41567. , g = n[11]
  41568. , m = n[12]
  41569. , v = n[13]
  41570. , A = n[14]
  41571. , y = n[15]
  41572. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  41573. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  41574. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  41575. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  41576. , w = r * C + o * I + a * E + s * b;
  41577. if (0 === w) {
  41578. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  41579. if (t)
  41580. throw new Error(_);
  41581. return console.warn(_),
  41582. this.identity()
  41583. }
  41584. return i[0] = C,
  41585. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  41586. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  41587. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  41588. i[4] = I,
  41589. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  41590. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  41591. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  41592. i[8] = E,
  41593. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  41594. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  41595. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  41596. i[12] = b,
  41597. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  41598. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  41599. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  41600. this.multiplyScalar(1 / w)
  41601. },
  41602. scale: function(e) {
  41603. var t = this.elements
  41604. , i = e.x
  41605. , n = e.y
  41606. , r = e.z;
  41607. return t[0] *= i,
  41608. t[4] *= n,
  41609. t[8] *= r,
  41610. t[1] *= i,
  41611. t[5] *= n,
  41612. t[9] *= r,
  41613. t[2] *= i,
  41614. t[6] *= n,
  41615. t[10] *= r,
  41616. t[3] *= i,
  41617. t[7] *= n,
  41618. t[11] *= r,
  41619. this
  41620. },
  41621. getMaxScaleOnAxis: function() {
  41622. var e = this.elements
  41623. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  41624. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  41625. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  41626. return Math.sqrt(Math.max(t, i, n))
  41627. },
  41628. makeTranslation: function(e, t, i) {
  41629. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  41630. this
  41631. },
  41632. makeRotationX: function(e) {
  41633. var t = Math.cos(e)
  41634. , i = Math.sin(e);
  41635. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  41636. this
  41637. },
  41638. makeRotationY: function(e) {
  41639. var t = Math.cos(e)
  41640. , i = Math.sin(e);
  41641. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  41642. this
  41643. },
  41644. makeRotationZ: function(e) {
  41645. var t = Math.cos(e)
  41646. , i = Math.sin(e);
  41647. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41648. this
  41649. },
  41650. makeRotationAxis: function(e, t) {
  41651. var i = Math.cos(t)
  41652. , n = Math.sin(t)
  41653. , r = 1 - i
  41654. , o = e.x
  41655. , a = e.y
  41656. , s = e.z
  41657. , l = r * o
  41658. , c = r * a;
  41659. return this.set(l * o + i, l * a - n * s, l * s + n * a, 0, l * a + n * s, c * a + i, c * s - n * o, 0, l * s - n * a, c * s + n * o, r * s * s + i, 0, 0, 0, 0, 1),
  41660. this
  41661. },
  41662. makeScale: function(e, t, i) {
  41663. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  41664. this
  41665. },
  41666. compose: function(e, t, i) {
  41667. return this.makeRotationFromQuaternion(t),
  41668. this.scale(i),
  41669. this.setPosition(e),
  41670. this
  41671. },
  41672. decompose: function() {
  41673. var e, t;
  41674. return function(i, r, o) {
  41675. void 0 === e && (e = new n.Vector3),
  41676. void 0 === t && (t = new n.Matrix4);
  41677. var a = this.elements
  41678. , s = e.set(a[0], a[1], a[2]).length()
  41679. , l = e.set(a[4], a[5], a[6]).length()
  41680. , c = e.set(a[8], a[9], a[10]).length()
  41681. , h = this.determinant();
  41682. h < 0 && (s = -s),
  41683. i.x = a[12],
  41684. i.y = a[13],
  41685. i.z = a[14],
  41686. t.elements.set(this.elements);
  41687. var u = 1 / s
  41688. , d = 1 / l
  41689. , p = 1 / c;
  41690. return t.elements[0] *= u,
  41691. t.elements[1] *= u,
  41692. t.elements[2] *= u,
  41693. t.elements[4] *= d,
  41694. t.elements[5] *= d,
  41695. t.elements[6] *= d,
  41696. t.elements[8] *= p,
  41697. t.elements[9] *= p,
  41698. t.elements[10] *= p,
  41699. r.setFromRotationMatrix(t),
  41700. o.x = s,
  41701. o.y = l,
  41702. o.z = c,
  41703. this
  41704. }
  41705. }(),
  41706. makeFrustum: function(e, t, i, n, r, o) {
  41707. var a = this.elements
  41708. , s = 2 * r / (t - e)
  41709. , l = 2 * r / (n - i)
  41710. , c = (t + e) / (t - e)
  41711. , h = (n + i) / (n - i)
  41712. , u = -(o + r) / (o - r)
  41713. , d = -2 * o * r / (o - r);
  41714. return a[0] = s,
  41715. a[4] = 0,
  41716. a[8] = c,
  41717. a[12] = 0,
  41718. a[1] = 0,
  41719. a[5] = l,
  41720. a[9] = h,
  41721. a[13] = 0,
  41722. a[2] = 0,
  41723. a[6] = 0,
  41724. a[10] = u,
  41725. a[14] = d,
  41726. a[3] = 0,
  41727. a[7] = 0,
  41728. a[11] = -1,
  41729. a[15] = 0,
  41730. this
  41731. },
  41732. makePerspective: function(e, t, i, r) {
  41733. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  41734. , a = -o
  41735. , s = a * t
  41736. , l = o * t;
  41737. return this.makeFrustum(s, l, a, o, i, r)
  41738. },
  41739. makeOrthographic: function(e, t, i, n, r, o) {
  41740. var a = this.elements
  41741. , s = 1 / (t - e)
  41742. , l = 1 / (i - n)
  41743. , c = 1 / (o - r)
  41744. , h = (t + e) * s
  41745. , u = (i + n) * l
  41746. , d = (o + r) * c;
  41747. return a[0] = 2 * s,
  41748. a[4] = 0,
  41749. a[8] = 0,
  41750. a[12] = -h,
  41751. a[1] = 0,
  41752. a[5] = 2 * l,
  41753. a[9] = 0,
  41754. a[13] = -u,
  41755. a[2] = 0,
  41756. a[6] = 0,
  41757. a[10] = -2 * c,
  41758. a[14] = -d,
  41759. a[3] = 0,
  41760. a[7] = 0,
  41761. a[11] = 0,
  41762. a[15] = 1,
  41763. this
  41764. },
  41765. equals: function(e) {
  41766. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  41767. if (t[n] !== i[n])
  41768. return !1;
  41769. return !0
  41770. },
  41771. fromArray: function(e) {
  41772. return this.elements.set(e),
  41773. this
  41774. },
  41775. toArray: function() {
  41776. var e = this.elements;
  41777. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]]
  41778. }
  41779. },
  41780. n.Ray = function(e, t) {
  41781. this.origin = void 0 !== e ? e : new n.Vector3,
  41782. this.direction = void 0 !== t ? t : new n.Vector3
  41783. }
  41784. ,
  41785. n.Ray.prototype = {
  41786. constructor: n.Ray,
  41787. set: function(e, t) {
  41788. return this.origin.copy(e),
  41789. this.direction.copy(t),
  41790. this
  41791. },
  41792. clone: function() {
  41793. return (new this.constructor).copy(this)
  41794. },
  41795. copy: function(e) {
  41796. return this.origin.copy(e.origin),
  41797. this.direction.copy(e.direction),
  41798. this
  41799. },
  41800. at: function(e, t) {
  41801. var i = t || new n.Vector3;
  41802. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  41803. },
  41804. lookAt: function(e) {
  41805. this.direction.copy(e).sub(this.origin).normalize()
  41806. },
  41807. recast: function() {
  41808. var e = new n.Vector3;
  41809. return function(t) {
  41810. return this.origin.copy(this.at(t, e)),
  41811. this
  41812. }
  41813. }(),
  41814. closestPointToPoint: function(e, t) {
  41815. var i = t || new n.Vector3;
  41816. i.subVectors(e, this.origin);
  41817. var r = i.dot(this.direction);
  41818. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  41819. },
  41820. distanceToPoint: function(e) {
  41821. return Math.sqrt(this.distanceSqToPoint(e))
  41822. },
  41823. distanceSqToPoint: function() {
  41824. var e = new n.Vector3;
  41825. return function(t) {
  41826. var i = e.subVectors(t, this.origin).dot(this.direction);
  41827. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  41828. e.distanceToSquared(t))
  41829. }
  41830. }(),
  41831. distanceSqToSegment: function() {
  41832. var e = new n.Vector3
  41833. , t = new n.Vector3
  41834. , i = new n.Vector3;
  41835. return function(n, r, o, a) {
  41836. e.copy(n).add(r).multiplyScalar(.5),
  41837. t.copy(r).sub(n).normalize(),
  41838. i.copy(this.origin).sub(e);
  41839. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  41840. if (m > 0)
  41841. if (s = d * f - p,
  41842. l = d * p - f,
  41843. h = u * m,
  41844. s >= 0)
  41845. if (l >= -h)
  41846. if (l <= h) {
  41847. var v = 1 / m;
  41848. s *= v,
  41849. l *= v,
  41850. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  41851. } else
  41852. l = u,
  41853. s = Math.max(0, -(d * l + p)),
  41854. c = -s * s + l * (l + 2 * f) + g;
  41855. else
  41856. l = -u,
  41857. s = Math.max(0, -(d * l + p)),
  41858. c = -s * s + l * (l + 2 * f) + g;
  41859. else
  41860. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  41861. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  41862. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  41863. l = Math.min(Math.max(-u, -f), u),
  41864. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  41865. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  41866. c = -s * s + l * (l + 2 * f) + g);
  41867. else
  41868. l = d > 0 ? -u : u,
  41869. s = Math.max(0, -(d * l + p)),
  41870. c = -s * s + l * (l + 2 * f) + g;
  41871. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  41872. a && a.copy(t).multiplyScalar(l).add(e),
  41873. c
  41874. }
  41875. }(),
  41876. intersectSphere: function() {
  41877. var e = new n.Vector3;
  41878. return function(t, i) {
  41879. e.subVectors(t.center, this.origin);
  41880. var n = e.dot(this.direction)
  41881. , r = e.dot(e) - n * n
  41882. , o = t.radius * t.radius;
  41883. if (r > o)
  41884. return null;
  41885. var a = Math.sqrt(o - r)
  41886. , s = n - a
  41887. , l = n + a;
  41888. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  41889. }
  41890. }(),
  41891. intersectsSphere: function(e) {
  41892. return this.distanceToPoint(e.center) <= e.radius
  41893. },
  41894. distanceToPlane: function(e) {
  41895. var t = e.normal.dot(this.direction);
  41896. if (0 === t)
  41897. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  41898. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  41899. return i >= 0 ? i : null
  41900. },
  41901. intersectPlane: function(e, t) {
  41902. var i = this.distanceToPlane(e);
  41903. return null === i ? null : this.at(i, t)
  41904. },
  41905. intersectsPlane: function(e) {
  41906. var t = e.distanceToPoint(this.origin);
  41907. if (0 === t)
  41908. return !0;
  41909. var i = e.normal.dot(this.direction);
  41910. return i * t < 0
  41911. },
  41912. intersectBox: function(e, t) {
  41913. var i, n, r, o, a, s, l = 1 / this.direction.x, c = 1 / this.direction.y, h = 1 / this.direction.z, u = this.origin;
  41914. return l >= 0 ? (i = (e.min.x - u.x) * l,
  41915. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  41916. n = (e.min.x - u.x) * l),
  41917. c >= 0 ? (r = (e.min.y - u.y) * c,
  41918. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  41919. o = (e.min.y - u.y) * c),
  41920. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  41921. (o < n || n !== n) && (n = o),
  41922. h >= 0 ? (a = (e.min.z - u.z) * h,
  41923. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  41924. s = (e.min.z - u.z) * h),
  41925. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  41926. (s < n || n !== n) && (n = s),
  41927. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  41928. },
  41929. intersectsBox: function() {
  41930. var e = new n.Vector3;
  41931. return function(t) {
  41932. return null !== this.intersectBox(t, e)
  41933. }
  41934. }(),
  41935. intersectTriangle: function() {
  41936. var e = new n.Vector3
  41937. , t = new n.Vector3
  41938. , i = new n.Vector3
  41939. , r = new n.Vector3;
  41940. return function(n, o, a, s, l) {
  41941. t.subVectors(o, n),
  41942. i.subVectors(a, n),
  41943. r.crossVectors(t, i);
  41944. var c, h = this.direction.dot(r);
  41945. if (h > 0) {
  41946. if (s)
  41947. return null;
  41948. c = 1
  41949. } else {
  41950. if (!(h < 0))
  41951. return null;
  41952. c = -1,
  41953. h = -h
  41954. }
  41955. e.subVectors(this.origin, n);
  41956. var u = c * this.direction.dot(i.crossVectors(e, i));
  41957. if (u < 0)
  41958. return null;
  41959. var d = c * this.direction.dot(t.cross(e));
  41960. if (d < 0)
  41961. return null;
  41962. if (u + d > h)
  41963. return null;
  41964. var p = -c * e.dot(r);
  41965. return p < 0 ? null : this.at(p / h, l)
  41966. }
  41967. }(),
  41968. applyMatrix4: function(e) {
  41969. return this.direction.add(this.origin).applyMatrix4(e),
  41970. this.origin.applyMatrix4(e),
  41971. this.direction.sub(this.origin),
  41972. this.direction.normalize(),
  41973. this
  41974. },
  41975. equals: function(e) {
  41976. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  41977. }
  41978. },
  41979. n.Sphere = function(e, t) {
  41980. this.center = void 0 !== e ? e : new n.Vector3,
  41981. this.radius = void 0 !== t ? t : 0
  41982. }
  41983. ,
  41984. n.Sphere.prototype = {
  41985. constructor: n.Sphere,
  41986. set: function(e, t) {
  41987. return this.center.copy(e),
  41988. this.radius = t,
  41989. this
  41990. },
  41991. setFromPoints: function() {
  41992. var e = new n.Box3;
  41993. return function(t, i) {
  41994. var n = this.center;
  41995. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  41996. for (var r = 0, o = 0, a = t.length; o < a; o++)
  41997. r = Math.max(r, n.distanceToSquared(t[o]));
  41998. return this.radius = Math.sqrt(r),
  41999. this
  42000. }
  42001. }(),
  42002. clone: function() {
  42003. return (new this.constructor).copy(this)
  42004. },
  42005. copy: function(e) {
  42006. return this.center.copy(e.center),
  42007. this.radius = e.radius,
  42008. this
  42009. },
  42010. empty: function() {
  42011. return this.radius <= 0
  42012. },
  42013. containsPoint: function(e) {
  42014. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42015. },
  42016. distanceToPoint: function(e) {
  42017. return e.distanceTo(this.center) - this.radius
  42018. },
  42019. intersectsSphere: function(e) {
  42020. var t = this.radius + e.radius;
  42021. return e.center.distanceToSquared(this.center) <= t * t
  42022. },
  42023. intersectsBox: function(e) {
  42024. return e.intersectsSphere(this)
  42025. },
  42026. intersectsPlane: function(e) {
  42027. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42028. },
  42029. clampPoint: function(e, t) {
  42030. var i = this.center.distanceToSquared(e)
  42031. , r = t || new n.Vector3;
  42032. return r.copy(e),
  42033. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42034. r.multiplyScalar(this.radius).add(this.center)),
  42035. r
  42036. },
  42037. getBoundingBox: function(e) {
  42038. var t = e || new n.Box3;
  42039. return t.set(this.center, this.center),
  42040. t.expandByScalar(this.radius),
  42041. t
  42042. },
  42043. applyMatrix4: function(e) {
  42044. return this.center.applyMatrix4(e),
  42045. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42046. this
  42047. },
  42048. translate: function(e) {
  42049. return this.center.add(e),
  42050. this
  42051. },
  42052. equals: function(e) {
  42053. return e.center.equals(this.center) && e.radius === this.radius
  42054. }
  42055. },
  42056. n.Frustum = function(e, t, i, r, o, a) {
  42057. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  42058. }
  42059. ,
  42060. n.Frustum.prototype = {
  42061. constructor: n.Frustum,
  42062. set: function(e, t, i, n, r, o) {
  42063. var a = this.planes;
  42064. return a[0].copy(e),
  42065. a[1].copy(t),
  42066. a[2].copy(i),
  42067. a[3].copy(n),
  42068. a[4].copy(r),
  42069. a[5].copy(o),
  42070. this
  42071. },
  42072. clone: function() {
  42073. return (new this.constructor).copy(this)
  42074. },
  42075. copy: function(e) {
  42076. for (var t = this.planes, i = 0; i < 6; i++)
  42077. t[i].copy(e.planes[i]);
  42078. return this
  42079. },
  42080. setFromMatrix: function(e) {
  42081. var t = this.planes
  42082. , i = e.elements
  42083. , n = i[0]
  42084. , r = i[1]
  42085. , o = i[2]
  42086. , a = i[3]
  42087. , s = i[4]
  42088. , l = i[5]
  42089. , c = i[6]
  42090. , h = i[7]
  42091. , u = i[8]
  42092. , d = i[9]
  42093. , p = i[10]
  42094. , f = i[11]
  42095. , g = i[12]
  42096. , m = i[13]
  42097. , v = i[14]
  42098. , A = i[15];
  42099. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42100. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42101. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42102. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42103. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42104. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42105. this
  42106. },
  42107. intersectsObject: function() {
  42108. var e = new n.Sphere;
  42109. return function(t) {
  42110. var i = t.geometry;
  42111. return null === i.boundingSphere && i.computeBoundingSphere(),
  42112. e.copy(i.boundingSphere),
  42113. e.applyMatrix4(t.matrixWorld),
  42114. this.intersectsSphere(e)
  42115. }
  42116. }(),
  42117. intersectsSphere: function(e) {
  42118. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42119. var o = t[r].distanceToPoint(i);
  42120. if (o < n)
  42121. return !1
  42122. }
  42123. return !0
  42124. },
  42125. intersectsBox: function() {
  42126. var e = new n.Vector3
  42127. , t = new n.Vector3;
  42128. return function(i) {
  42129. for (var n = this.planes, r = 0; r < 6; r++) {
  42130. var o = n[r];
  42131. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42132. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42133. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42134. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42135. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42136. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42137. var a = o.distanceToPoint(e)
  42138. , s = o.distanceToPoint(t);
  42139. if (a < 0 && s < 0)
  42140. return !1
  42141. }
  42142. return !0
  42143. }
  42144. }(),
  42145. containsPoint: function(e) {
  42146. for (var t = this.planes, i = 0; i < 6; i++)
  42147. if (t[i].distanceToPoint(e) < 0)
  42148. return !1;
  42149. return !0
  42150. }
  42151. },
  42152. n.Plane = function(e, t) {
  42153. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42154. this.constant = void 0 !== t ? t : 0
  42155. }
  42156. ,
  42157. n.Plane.prototype = {
  42158. constructor: n.Plane,
  42159. set: function(e, t) {
  42160. return this.normal.copy(e),
  42161. this.constant = t,
  42162. this
  42163. },
  42164. setComponents: function(e, t, i, n) {
  42165. return this.normal.set(e, t, i),
  42166. this.constant = n,
  42167. this
  42168. },
  42169. setFromNormalAndCoplanarPoint: function(e, t) {
  42170. return this.normal.copy(e),
  42171. this.constant = -t.dot(this.normal),
  42172. this
  42173. },
  42174. setFromCoplanarPoints: function() {
  42175. var e = new n.Vector3
  42176. , t = new n.Vector3;
  42177. return function(i, n, r) {
  42178. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42179. return this.setFromNormalAndCoplanarPoint(o, i),
  42180. this
  42181. }
  42182. }(),
  42183. clone: function() {
  42184. return (new this.constructor).copy(this)
  42185. },
  42186. copy: function(e) {
  42187. return this.normal.copy(e.normal),
  42188. this.constant = e.constant,
  42189. this
  42190. },
  42191. normalize: function() {
  42192. var e = 1 / this.normal.length();
  42193. return this.normal.multiplyScalar(e),
  42194. this.constant *= e,
  42195. this
  42196. },
  42197. negate: function() {
  42198. return this.constant *= -1,
  42199. this.normal.negate(),
  42200. this
  42201. },
  42202. distanceToPoint: function(e) {
  42203. return this.normal.dot(e) + this.constant
  42204. },
  42205. distanceToSphere: function(e) {
  42206. return this.distanceToPoint(e.center) - e.radius
  42207. },
  42208. projectPoint: function(e, t) {
  42209. return this.orthoPoint(e, t).sub(e).negate()
  42210. },
  42211. orthoPoint: function(e, t) {
  42212. var i = this.distanceToPoint(e)
  42213. , r = t || new n.Vector3;
  42214. return r.copy(this.normal).multiplyScalar(i)
  42215. },
  42216. intersectLine: function() {
  42217. var e = new n.Vector3;
  42218. return function(t, i) {
  42219. var r = i || new n.Vector3
  42220. , o = t.delta(e)
  42221. , a = this.normal.dot(o);
  42222. if (0 !== a) {
  42223. var s = -(t.start.dot(this.normal) + this.constant) / a;
  42224. if (!(s < 0 || s > 1))
  42225. return r.copy(o).multiplyScalar(s).add(t.start)
  42226. } else if (0 === this.distanceToPoint(t.start))
  42227. return r.copy(t.start)
  42228. }
  42229. }(),
  42230. intersectsLine: function(e) {
  42231. var t = this.distanceToPoint(e.start)
  42232. , i = this.distanceToPoint(e.end);
  42233. return t < 0 && i > 0 || i < 0 && t > 0
  42234. },
  42235. intersectsBox: function(e) {
  42236. return e.intersectsPlane(this)
  42237. },
  42238. intersectsSphere: function(e) {
  42239. return e.intersectsPlane(this)
  42240. },
  42241. coplanarPoint: function(e) {
  42242. var t = e || new n.Vector3;
  42243. return t.copy(this.normal).multiplyScalar(-this.constant)
  42244. },
  42245. applyMatrix4: function() {
  42246. var e = new n.Vector3
  42247. , t = new n.Vector3
  42248. , i = new n.Matrix3;
  42249. return function(n, r) {
  42250. var o = r || i.getNormalMatrix(n)
  42251. , a = e.copy(this.normal).applyMatrix3(o)
  42252. , s = this.coplanarPoint(t);
  42253. return s.applyMatrix4(n),
  42254. this.setFromNormalAndCoplanarPoint(a, s),
  42255. this
  42256. }
  42257. }(),
  42258. translate: function(e) {
  42259. return this.constant = this.constant - e.dot(this.normal),
  42260. this
  42261. },
  42262. equals: function(e) {
  42263. return e.normal.equals(this.normal) && e.constant === this.constant
  42264. }
  42265. },
  42266. n.Spherical = function(e, t, i) {
  42267. return this.radius = void 0 !== e ? e : 1,
  42268. this.phi = void 0 !== t ? t : 0,
  42269. this.theta = void 0 !== i ? i : 0,
  42270. this
  42271. }
  42272. ,
  42273. n.Spherical.prototype = {
  42274. constructor: n.Spherical,
  42275. set: function(e, t, i) {
  42276. this.radius = e,
  42277. this.phi = t,
  42278. this.theta = i
  42279. },
  42280. clone: function() {
  42281. return (new this.constructor).copy(this)
  42282. },
  42283. copy: function(e) {
  42284. return this.radius.copy(e.radius),
  42285. this.phi.copy(e.phi),
  42286. this.theta.copy(e.theta),
  42287. this
  42288. },
  42289. makeSafe: function() {
  42290. var e = 1e-6;
  42291. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  42292. },
  42293. setFromVector3: function(e) {
  42294. return this.radius = e.length(),
  42295. 0 === this.radius ? (this.theta = 0,
  42296. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  42297. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  42298. this
  42299. }
  42300. },
  42301. n.Math = {
  42302. generateUUID: function() {
  42303. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  42304. return function() {
  42305. for (var r = 0; r < 36; r++)
  42306. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  42307. e = 15 & n,
  42308. n >>= 4,
  42309. i[r] = t[19 === r ? 3 & e | 8 : e]);
  42310. return i.join("")
  42311. }
  42312. }(),
  42313. clamp: function(e, t, i) {
  42314. return Math.max(t, Math.min(i, e))
  42315. },
  42316. euclideanModulo: function(e, t) {
  42317. return (e % t + t) % t
  42318. },
  42319. mapLinear: function(e, t, i, n, r) {
  42320. return n + (e - t) * (r - n) / (i - t)
  42321. },
  42322. smoothstep: function(e, t, i) {
  42323. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42324. e * e * (3 - 2 * e))
  42325. },
  42326. smootherstep: function(e, t, i) {
  42327. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42328. e * e * e * (e * (6 * e - 15) + 10))
  42329. },
  42330. random16: function() {
  42331. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  42332. Math.random()
  42333. },
  42334. randInt: function(e, t) {
  42335. return e + Math.floor(Math.random() * (t - e + 1))
  42336. },
  42337. randFloat: function(e, t) {
  42338. return e + Math.random() * (t - e)
  42339. },
  42340. randFloatSpread: function(e) {
  42341. return e * (.5 - Math.random())
  42342. },
  42343. degToRad: function() {
  42344. var e = Math.PI / 180;
  42345. return function(t) {
  42346. return t * e
  42347. }
  42348. }(),
  42349. radToDeg: function() {
  42350. var e = 180 / Math.PI;
  42351. return function(t) {
  42352. return t * e
  42353. }
  42354. }(),
  42355. isPowerOfTwo: function(e) {
  42356. return 0 === (e & e - 1) && 0 !== e
  42357. },
  42358. nearestPowerOfTwo: function(e) {
  42359. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  42360. },
  42361. nextPowerOfTwo: function(e) {
  42362. return e--,
  42363. e |= e >> 1,
  42364. e |= e >> 2,
  42365. e |= e >> 4,
  42366. e |= e >> 8,
  42367. e |= e >> 16,
  42368. e++,
  42369. e
  42370. }
  42371. },
  42372. n.Spline = function(e) {
  42373. function t(e, t, i, n, r, o, a) {
  42374. var s = .5 * (i - e)
  42375. , l = .5 * (n - t);
  42376. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  42377. }
  42378. this.points = e;
  42379. var i, r, o, a, s, l, c, h, u, d = [], p = {
  42380. x: 0,
  42381. y: 0,
  42382. z: 0
  42383. };
  42384. this.initFromArray = function(e) {
  42385. this.points = [];
  42386. for (var t = 0; t < e.length; t++)
  42387. this.points[t] = {
  42388. x: e[t][0],
  42389. y: e[t][1],
  42390. z: e[t][2]
  42391. }
  42392. }
  42393. ,
  42394. this.getPoint = function(e) {
  42395. return i = (this.points.length - 1) * e,
  42396. r = Math.floor(i),
  42397. o = i - r,
  42398. d[0] = 0 === r ? r : r - 1,
  42399. d[1] = r,
  42400. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  42401. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  42402. l = this.points[d[0]],
  42403. c = this.points[d[1]],
  42404. h = this.points[d[2]],
  42405. u = this.points[d[3]],
  42406. a = o * o,
  42407. s = o * a,
  42408. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  42409. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  42410. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  42411. p
  42412. }
  42413. ,
  42414. this.getControlPointsArray = function() {
  42415. var e, t, i = this.points.length, n = [];
  42416. for (e = 0; e < i; e++)
  42417. t = this.points[e],
  42418. n[e] = [t.x, t.y, t.z];
  42419. return n
  42420. }
  42421. ,
  42422. this.getLength = function(e) {
  42423. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  42424. for (u[0] = 0,
  42425. e || (e = 100),
  42426. r = this.points.length * e,
  42427. c.copy(this.points[0]),
  42428. t = 1; t < r; t++)
  42429. i = t / r,
  42430. o = this.getPoint(i),
  42431. h.copy(o),
  42432. d += h.distanceTo(c),
  42433. c.copy(o),
  42434. a = (this.points.length - 1) * i,
  42435. s = Math.floor(a),
  42436. s !== l && (u[s] = d,
  42437. l = s);
  42438. return u[u.length] = d,
  42439. {
  42440. chunks: u,
  42441. total: d
  42442. }
  42443. }
  42444. ,
  42445. this.reparametrizeByArcLength = function(e) {
  42446. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  42447. for (h.push(u.copy(this.points[0]).clone()),
  42448. t = 1; t < this.points.length; t++) {
  42449. for (s = d.chunks[t] - d.chunks[t - 1],
  42450. l = Math.ceil(e * s / d.total),
  42451. o = (t - 1) / (this.points.length - 1),
  42452. a = t / (this.points.length - 1),
  42453. i = 1; i < l - 1; i++)
  42454. r = o + i * (1 / l) * (a - o),
  42455. c = this.getPoint(r),
  42456. h.push(u.copy(c).clone());
  42457. h.push(u.copy(this.points[t]).clone())
  42458. }
  42459. this.points = h
  42460. }
  42461. }
  42462. ,
  42463. n.Triangle = function(e, t, i) {
  42464. this.a = void 0 !== e ? e : new n.Vector3,
  42465. this.b = void 0 !== t ? t : new n.Vector3,
  42466. this.c = void 0 !== i ? i : new n.Vector3
  42467. }
  42468. ,
  42469. n.Triangle.normal = function() {
  42470. var e = new n.Vector3;
  42471. return function(t, i, r, o) {
  42472. var a = o || new n.Vector3;
  42473. a.subVectors(r, i),
  42474. e.subVectors(t, i),
  42475. a.cross(e);
  42476. var s = a.lengthSq();
  42477. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  42478. }
  42479. }(),
  42480. n.Triangle.barycoordFromPoint = function() {
  42481. var e = new n.Vector3
  42482. , t = new n.Vector3
  42483. , i = new n.Vector3;
  42484. return function(r, o, a, s, l) {
  42485. e.subVectors(s, o),
  42486. t.subVectors(a, o),
  42487. i.subVectors(r, o);
  42488. var c = e.dot(e)
  42489. , h = e.dot(t)
  42490. , u = e.dot(i)
  42491. , d = t.dot(t)
  42492. , p = t.dot(i)
  42493. , f = c * d - h * h
  42494. , g = l || new n.Vector3;
  42495. if (0 === f)
  42496. return g.set(-2, -1, -1);
  42497. var m = 1 / f
  42498. , v = (d * u - h * p) * m
  42499. , A = (c * p - h * u) * m;
  42500. return g.set(1 - v - A, A, v)
  42501. }
  42502. }(),
  42503. n.Triangle.containsPoint = function() {
  42504. var e = new n.Vector3;
  42505. return function(t, i, r, o) {
  42506. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  42507. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  42508. }
  42509. }(),
  42510. n.Triangle.prototype = {
  42511. constructor: n.Triangle,
  42512. set: function(e, t, i) {
  42513. return this.a.copy(e),
  42514. this.b.copy(t),
  42515. this.c.copy(i),
  42516. this
  42517. },
  42518. setFromPointsAndIndices: function(e, t, i, n) {
  42519. return this.a.copy(e[t]),
  42520. this.b.copy(e[i]),
  42521. this.c.copy(e[n]),
  42522. this
  42523. },
  42524. clone: function() {
  42525. return (new this.constructor).copy(this)
  42526. },
  42527. copy: function(e) {
  42528. return this.a.copy(e.a),
  42529. this.b.copy(e.b),
  42530. this.c.copy(e.c),
  42531. this
  42532. },
  42533. area: function() {
  42534. var e = new n.Vector3
  42535. , t = new n.Vector3;
  42536. return function() {
  42537. return e.subVectors(this.c, this.b),
  42538. t.subVectors(this.a, this.b),
  42539. .5 * e.cross(t).length()
  42540. }
  42541. }(),
  42542. midpoint: function(e) {
  42543. var t = e || new n.Vector3;
  42544. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  42545. },
  42546. normal: function(e) {
  42547. return n.Triangle.normal(this.a, this.b, this.c, e)
  42548. },
  42549. plane: function(e) {
  42550. var t = e || new n.Plane;
  42551. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  42552. },
  42553. barycoordFromPoint: function(e, t) {
  42554. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  42555. },
  42556. containsPoint: function(e) {
  42557. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  42558. },
  42559. equals: function(e) {
  42560. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  42561. }
  42562. },
  42563. n.Interpolant = function(e, t, i, n) {
  42564. this.parameterPositions = e,
  42565. this._cachedIndex = 0,
  42566. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  42567. this.sampleValues = t,
  42568. this.valueSize = i
  42569. }
  42570. ,
  42571. n.Interpolant.prototype = {
  42572. constructor: n.Interpolant,
  42573. evaluate: function(e) {
  42574. var t = this.parameterPositions
  42575. , i = this._cachedIndex
  42576. , n = t[i]
  42577. , r = t[i - 1];
  42578. e: {
  42579. t: {
  42580. var o;
  42581. i: {
  42582. n: if (!(e < n)) {
  42583. for (var a = i + 2; ; ) {
  42584. if (void 0 === n) {
  42585. if (e < r)
  42586. break n;
  42587. return i = t.length,
  42588. this._cachedIndex = i,
  42589. this.afterEnd_(i - 1, e, r)
  42590. }
  42591. if (i === a)
  42592. break;
  42593. if (r = n,
  42594. n = t[++i],
  42595. e < n)
  42596. break t
  42597. }
  42598. o = t.length;
  42599. break i
  42600. }
  42601. {
  42602. if (e >= r)
  42603. break e;
  42604. var s = t[1];
  42605. e < s && (i = 2,
  42606. r = s);
  42607. for (var a = i - 2; ; ) {
  42608. if (void 0 === r)
  42609. return this._cachedIndex = 0,
  42610. this.beforeStart_(0, e, n);
  42611. if (i === a)
  42612. break;
  42613. if (n = r,
  42614. r = t[--i - 1],
  42615. e >= r)
  42616. break t
  42617. }
  42618. o = i,
  42619. i = 0
  42620. }
  42621. }
  42622. for (; i < o; ) {
  42623. var l = i + o >>> 1;
  42624. e < t[l] ? o = l : i = l + 1
  42625. }
  42626. if (n = t[i],
  42627. r = t[i - 1],
  42628. void 0 === r)
  42629. return this._cachedIndex = 0,
  42630. this.beforeStart_(0, e, n);
  42631. if (void 0 === n)
  42632. return i = t.length,
  42633. this._cachedIndex = i,
  42634. this.afterEnd_(i - 1, r, e)
  42635. }
  42636. this._cachedIndex = i,
  42637. this.intervalChanged_(i, r, n)
  42638. }
  42639. return this.interpolate_(i, r, e, n)
  42640. },
  42641. settings: null,
  42642. DefaultSettings_: {},
  42643. getSettings_: function() {
  42644. return this.settings || this.DefaultSettings_
  42645. },
  42646. copySampleValue_: function(e) {
  42647. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  42648. t[o] = i[r + o];
  42649. return t
  42650. },
  42651. interpolate_: function(e, t, i, n) {
  42652. throw new Error("call to abstract method")
  42653. },
  42654. intervalChanged_: function(e, t, i) {}
  42655. },
  42656. Object.assign(n.Interpolant.prototype, {
  42657. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  42658. afterEnd_: n.Interpolant.prototype.copySampleValue_
  42659. }),
  42660. n.CubicInterpolant = function(e, t, i, r) {
  42661. n.Interpolant.call(this, e, t, i, r),
  42662. this._weightPrev = -0,
  42663. this._offsetPrev = -0,
  42664. this._weightNext = -0,
  42665. this._offsetNext = -0
  42666. }
  42667. ,
  42668. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42669. constructor: n.CubicInterpolant,
  42670. DefaultSettings_: {
  42671. endingStart: n.ZeroCurvatureEnding,
  42672. endingEnd: n.ZeroCurvatureEnding
  42673. },
  42674. intervalChanged_: function(e, t, i) {
  42675. var r = this.parameterPositions
  42676. , o = e - 2
  42677. , a = e + 1
  42678. , s = r[o]
  42679. , l = r[a];
  42680. if (void 0 === s)
  42681. switch (this.getSettings_().endingStart) {
  42682. case n.ZeroSlopeEnding:
  42683. o = e,
  42684. s = 2 * t - i;
  42685. break;
  42686. case n.WrapAroundEnding:
  42687. o = r.length - 2,
  42688. s = t + r[o] - r[o + 1];
  42689. break;
  42690. default:
  42691. o = e,
  42692. s = i
  42693. }
  42694. if (void 0 === l)
  42695. switch (this.getSettings_().endingEnd) {
  42696. case n.ZeroSlopeEnding:
  42697. a = e,
  42698. l = 2 * i - t;
  42699. break;
  42700. case n.WrapAroundEnding:
  42701. a = 1,
  42702. l = i + r[1] - r[0];
  42703. break;
  42704. default:
  42705. a = e - 1,
  42706. l = t
  42707. }
  42708. var c = .5 * (i - t)
  42709. , h = this.valueSize;
  42710. this._weightPrev = c / (t - s),
  42711. this._weightNext = c / (l - i),
  42712. this._offsetPrev = o * h,
  42713. this._offsetNext = a * h
  42714. },
  42715. interpolate_: function(e, t, i, n) {
  42716. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  42717. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  42718. return r
  42719. }
  42720. }),
  42721. n.DiscreteInterpolant = function(e, t, i, r) {
  42722. n.Interpolant.call(this, e, t, i, r)
  42723. }
  42724. ,
  42725. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42726. constructor: n.DiscreteInterpolant,
  42727. interpolate_: function(e, t, i, n) {
  42728. return this.copySampleValue_(e - 1)
  42729. }
  42730. }),
  42731. n.LinearInterpolant = function(e, t, i, r) {
  42732. n.Interpolant.call(this, e, t, i, r)
  42733. }
  42734. ,
  42735. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42736. constructor: n.LinearInterpolant,
  42737. interpolate_: function(e, t, i, n) {
  42738. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = (i - t) / (n - t), h = 1 - c, u = 0; u !== a; ++u)
  42739. r[u] = o[l + u] * h + o[s + u] * c;
  42740. return r
  42741. }
  42742. }),
  42743. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  42744. n.Interpolant.call(this, e, t, i, r)
  42745. }
  42746. ,
  42747. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  42748. constructor: n.QuaternionLinearInterpolant,
  42749. interpolate_: function(e, t, i, r) {
  42750. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  42751. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  42752. return o
  42753. }
  42754. }),
  42755. n.Clock = function(e) {
  42756. this.autoStart = void 0 === e || e,
  42757. this.startTime = 0,
  42758. this.oldTime = 0,
  42759. this.elapsedTime = 0,
  42760. this.running = !1
  42761. }
  42762. ,
  42763. n.Clock.prototype = {
  42764. constructor: n.Clock,
  42765. start: function() {
  42766. this.startTime = performance.now(),
  42767. this.oldTime = this.startTime,
  42768. this.running = !0
  42769. },
  42770. stop: function() {
  42771. this.getElapsedTime(),
  42772. this.running = !1
  42773. },
  42774. getElapsedTime: function() {
  42775. return this.getDelta(),
  42776. this.elapsedTime
  42777. },
  42778. getDelta: function() {
  42779. var e = 0;
  42780. if (this.autoStart && !this.running && this.start(),
  42781. this.running) {
  42782. var t = performance.now();
  42783. e = .001 * (t - this.oldTime),
  42784. this.oldTime = t,
  42785. this.elapsedTime += e
  42786. }
  42787. return e
  42788. }
  42789. },
  42790. n.EventDispatcher = function() {}
  42791. ,
  42792. n.EventDispatcher.prototype = {
  42793. constructor: n.EventDispatcher,
  42794. apply: function(e) {
  42795. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  42796. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  42797. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  42798. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  42799. },
  42800. addEventListener: function(e, t) {
  42801. void 0 === this._listeners && (this._listeners = {});
  42802. var i = this._listeners;
  42803. void 0 === i[e] && (i[e] = []),
  42804. i[e].indexOf(t) === -1 && i[e].push(t)
  42805. },
  42806. hasEventListener: function(e, t) {
  42807. if (void 0 === this._listeners)
  42808. return !1;
  42809. var i = this._listeners;
  42810. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  42811. },
  42812. removeEventListener: function(e, t) {
  42813. if (void 0 !== this._listeners) {
  42814. var i = this._listeners
  42815. , n = i[e];
  42816. if (void 0 !== n) {
  42817. var r = n.indexOf(t);
  42818. r !== -1 && n.splice(r, 1)
  42819. }
  42820. }
  42821. },
  42822. dispatchEvent: function(e) {
  42823. if (void 0 !== this._listeners) {
  42824. var t = this._listeners
  42825. , i = t[e.type];
  42826. if (void 0 !== i) {
  42827. e.target = this;
  42828. for (var n = [], r = i.length, o = 0; o < r; o++)
  42829. n[o] = i[o];
  42830. for (var o = 0; o < r; o++)
  42831. n[o].call(this, e)
  42832. }
  42833. }
  42834. }
  42835. },
  42836. n.Layers = function() {
  42837. this.mask = 1
  42838. }
  42839. ,
  42840. n.Layers.prototype = {
  42841. constructor: n.Layers,
  42842. set: function(e) {
  42843. this.mask = 1 << e
  42844. },
  42845. enable: function(e) {
  42846. this.mask |= 1 << e
  42847. },
  42848. toggle: function(e) {
  42849. this.mask ^= 1 << e
  42850. },
  42851. disable: function(e) {
  42852. this.mask &= ~(1 << e)
  42853. },
  42854. test: function(e) {
  42855. return 0 !== (this.mask & e.mask)
  42856. }
  42857. },
  42858. function(e) {
  42859. function t(e, t) {
  42860. return e.distance - t.distance
  42861. }
  42862. function i(e, t, n, r) {
  42863. if (e.visible !== !1 && (e.raycast(t, n),
  42864. r === !0))
  42865. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  42866. i(o[a], t, n, !0)
  42867. }
  42868. e.Raycaster = function(t, i, n, r) {
  42869. this.ray = new e.Ray(t,i),
  42870. this.near = n || 0,
  42871. this.far = r || 1 / 0,
  42872. this.params = {
  42873. Mesh: {},
  42874. Line: {},
  42875. LOD: {},
  42876. Points: {
  42877. threshold: 1
  42878. },
  42879. Sprite: {}
  42880. },
  42881. Object.defineProperties(this.params, {
  42882. PointCloud: {
  42883. get: function() {
  42884. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  42885. this.Points
  42886. }
  42887. }
  42888. })
  42889. }
  42890. ,
  42891. e.Raycaster.prototype = {
  42892. constructor: e.Raycaster,
  42893. linePrecision: 1,
  42894. set: function(e, t) {
  42895. this.ray.set(e, t)
  42896. },
  42897. setFromCamera: function(t, i) {
  42898. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  42899. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  42900. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  42901. },
  42902. intersectObject: function(e, n) {
  42903. var r = [];
  42904. return i(e, this, r, n),
  42905. r.sort(t),
  42906. r
  42907. },
  42908. intersectObjects: function(e, n) {
  42909. var r = [];
  42910. if (Array.isArray(e) === !1)
  42911. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  42912. r;
  42913. for (var o = 0, a = e.length; o < a; o++)
  42914. i(e[o], this, r, n);
  42915. return r.sort(t),
  42916. r
  42917. }
  42918. }
  42919. }(n),
  42920. n.Object3D = function() {
  42921. function e() {
  42922. o.setFromEuler(r, !1)
  42923. }
  42924. function t() {
  42925. r.setFromQuaternion(o, void 0, !1)
  42926. }
  42927. Object.defineProperty(this, "id", {
  42928. value: n.Object3DIdCount++
  42929. }),
  42930. this.uuid = n.Math.generateUUID(),
  42931. this.name = "",
  42932. this.type = "Object3D",
  42933. this.parent = null,
  42934. this.children = [],
  42935. this.up = n.Object3D.DefaultUp.clone();
  42936. var i = new n.Vector3
  42937. , r = new n.Euler
  42938. , o = new n.Quaternion
  42939. , a = new n.Vector3(1,1,1);
  42940. r.onChange(e),
  42941. o.onChange(t),
  42942. Object.defineProperties(this, {
  42943. position: {
  42944. enumerable: !0,
  42945. value: i
  42946. },
  42947. rotation: {
  42948. enumerable: !0,
  42949. value: r
  42950. },
  42951. quaternion: {
  42952. enumerable: !0,
  42953. value: o
  42954. },
  42955. scale: {
  42956. enumerable: !0,
  42957. value: a
  42958. },
  42959. modelViewMatrix: {
  42960. value: new n.Matrix4
  42961. },
  42962. normalMatrix: {
  42963. value: new n.Matrix3
  42964. }
  42965. }),
  42966. this.rotationAutoUpdate = !0,
  42967. this.matrix = new n.Matrix4,
  42968. this.matrixWorld = new n.Matrix4,
  42969. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  42970. this.matrixWorldNeedsUpdate = !1,
  42971. this.layers = new n.Layers,
  42972. this.visible = !0,
  42973. this.castShadow = !1,
  42974. this.receiveShadow = !1,
  42975. this.frustumCulled = !0,
  42976. this.renderOrder = 0,
  42977. this.userData = {}
  42978. }
  42979. ,
  42980. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  42981. n.Object3D.DefaultMatrixAutoUpdate = !0,
  42982. n.Object3D.prototype = {
  42983. constructor: n.Object3D,
  42984. applyMatrix: function(e) {
  42985. this.matrix.multiplyMatrices(e, this.matrix),
  42986. this.matrix.decompose(this.position, this.quaternion, this.scale)
  42987. },
  42988. setRotationFromAxisAngle: function(e, t) {
  42989. this.quaternion.setFromAxisAngle(e, t)
  42990. },
  42991. setRotationFromEuler: function(e) {
  42992. this.quaternion.setFromEuler(e, !0)
  42993. },
  42994. setRotationFromMatrix: function(e) {
  42995. this.quaternion.setFromRotationMatrix(e)
  42996. },
  42997. setRotationFromQuaternion: function(e) {
  42998. this.quaternion.copy(e)
  42999. },
  43000. rotateOnAxis: function() {
  43001. var e = new n.Quaternion;
  43002. return function(t, i) {
  43003. return e.setFromAxisAngle(t, i),
  43004. this.quaternion.multiply(e),
  43005. this
  43006. }
  43007. }(),
  43008. rotateX: function() {
  43009. var e = new n.Vector3(1,0,0);
  43010. return function(t) {
  43011. return this.rotateOnAxis(e, t)
  43012. }
  43013. }(),
  43014. rotateY: function() {
  43015. var e = new n.Vector3(0,1,0);
  43016. return function(t) {
  43017. return this.rotateOnAxis(e, t)
  43018. }
  43019. }(),
  43020. rotateZ: function() {
  43021. var e = new n.Vector3(0,0,1);
  43022. return function(t) {
  43023. return this.rotateOnAxis(e, t)
  43024. }
  43025. }(),
  43026. translateOnAxis: function() {
  43027. var e = new n.Vector3;
  43028. return function(t, i) {
  43029. return e.copy(t).applyQuaternion(this.quaternion),
  43030. this.position.add(e.multiplyScalar(i)),
  43031. this
  43032. }
  43033. }(),
  43034. translateX: function() {
  43035. var e = new n.Vector3(1,0,0);
  43036. return function(t) {
  43037. return this.translateOnAxis(e, t)
  43038. }
  43039. }(),
  43040. translateY: function() {
  43041. var e = new n.Vector3(0,1,0);
  43042. return function(t) {
  43043. return this.translateOnAxis(e, t)
  43044. }
  43045. }(),
  43046. translateZ: function() {
  43047. var e = new n.Vector3(0,0,1);
  43048. return function(t) {
  43049. return this.translateOnAxis(e, t)
  43050. }
  43051. }(),
  43052. localToWorld: function(e) {
  43053. return e.applyMatrix4(this.matrixWorld)
  43054. },
  43055. worldToLocal: function() {
  43056. var e = new n.Matrix4;
  43057. return function(t) {
  43058. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43059. }
  43060. }(),
  43061. lookAt: function() {
  43062. var e = new n.Matrix4;
  43063. return function(t) {
  43064. e.lookAt(t, this.position, this.up),
  43065. this.quaternion.setFromRotationMatrix(e)
  43066. }
  43067. }(),
  43068. add: function(e) {
  43069. if (arguments.length > 1) {
  43070. for (var t = 0; t < arguments.length; t++)
  43071. this.add(arguments[t]);
  43072. return this
  43073. }
  43074. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43075. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43076. e.parent = this,
  43077. e.dispatchEvent({
  43078. type: "added"
  43079. }),
  43080. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43081. this)
  43082. },
  43083. remove: function(e) {
  43084. if (arguments.length > 1)
  43085. for (var t = 0; t < arguments.length; t++)
  43086. this.remove(arguments[t]);
  43087. var i = this.children.indexOf(e);
  43088. i !== -1 && (e.parent = null,
  43089. e.dispatchEvent({
  43090. type: "removed"
  43091. }),
  43092. this.children.splice(i, 1))
  43093. },
  43094. getObjectById: function(e) {
  43095. return this.getObjectByProperty("id", e)
  43096. },
  43097. getObjectByName: function(e) {
  43098. return this.getObjectByProperty("name", e)
  43099. },
  43100. getObjectByProperty: function(e, t) {
  43101. if (this[e] === t)
  43102. return this;
  43103. for (var i = 0, n = this.children.length; i < n; i++) {
  43104. var r = this.children[i]
  43105. , o = r.getObjectByProperty(e, t);
  43106. if (void 0 !== o)
  43107. return o
  43108. }
  43109. },
  43110. getWorldPosition: function(e) {
  43111. var t = e || new n.Vector3;
  43112. return this.updateMatrixWorld(!0),
  43113. t.setFromMatrixPosition(this.matrixWorld)
  43114. },
  43115. getWorldQuaternion: function() {
  43116. var e = new n.Vector3
  43117. , t = new n.Vector3;
  43118. return function(i) {
  43119. var r = i || new n.Quaternion;
  43120. return this.updateMatrixWorld(!0),
  43121. this.matrixWorld.decompose(e, r, t),
  43122. r
  43123. }
  43124. }(),
  43125. getWorldRotation: function() {
  43126. var e = new n.Quaternion;
  43127. return function(t) {
  43128. var i = t || new n.Euler;
  43129. return this.getWorldQuaternion(e),
  43130. i.setFromQuaternion(e, this.rotation.order, !1)
  43131. }
  43132. }(),
  43133. getWorldScale: function() {
  43134. var e = new n.Vector3
  43135. , t = new n.Quaternion;
  43136. return function(i) {
  43137. var r = i || new n.Vector3;
  43138. return this.updateMatrixWorld(!0),
  43139. this.matrixWorld.decompose(e, t, r),
  43140. r
  43141. }
  43142. }(),
  43143. getWorldDirection: function() {
  43144. var e = new n.Quaternion;
  43145. return function(t) {
  43146. var i = t || new n.Vector3;
  43147. return this.getWorldQuaternion(e),
  43148. i.set(0, 0, 1).applyQuaternion(e)
  43149. }
  43150. }(),
  43151. raycast: function() {},
  43152. traverse: function(e) {
  43153. e(this);
  43154. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43155. t[i].traverse(e)
  43156. },
  43157. traverseVisible: function(e) {
  43158. if (this.visible !== !1) {
  43159. e(this);
  43160. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43161. t[i].traverseVisible(e)
  43162. }
  43163. },
  43164. traverseAncestors: function(e) {
  43165. var t = this.parent;
  43166. null !== t && (e(t),
  43167. t.traverseAncestors(e))
  43168. },
  43169. updateMatrix: function() {
  43170. this.matrix.compose(this.position, this.quaternion, this.scale),
  43171. this.matrixWorldNeedsUpdate = !0
  43172. },
  43173. updateMatrixWorld: function(e) {
  43174. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43175. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43176. this.matrixWorldNeedsUpdate = !1,
  43177. e = !0);
  43178. for (var t = 0, i = this.children.length; t < i; t++)
  43179. this.children[t].updateMatrixWorld(e)
  43180. },
  43181. toJSON: function(e) {
  43182. function t(e) {
  43183. var t = [];
  43184. for (var i in e) {
  43185. var n = e[i];
  43186. delete n.metadata,
  43187. t.push(n)
  43188. }
  43189. return t
  43190. }
  43191. var i = void 0 === e
  43192. , n = {};
  43193. i && (e = {
  43194. geometries: {},
  43195. materials: {},
  43196. textures: {},
  43197. images: {}
  43198. },
  43199. n.metadata = {
  43200. version: 4.4,
  43201. type: "Object",
  43202. generator: "Object3D.toJSON"
  43203. });
  43204. var r = {};
  43205. if (r.uuid = this.uuid,
  43206. r.type = this.type,
  43207. "" !== this.name && (r.name = this.name),
  43208. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  43209. this.castShadow === !0 && (r.castShadow = !0),
  43210. this.receiveShadow === !0 && (r.receiveShadow = !0),
  43211. this.visible === !1 && (r.visible = !1),
  43212. r.matrix = this.matrix.toArray(),
  43213. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  43214. r.geometry = this.geometry.uuid),
  43215. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  43216. r.material = this.material.uuid),
  43217. this.children.length > 0) {
  43218. r.children = [];
  43219. for (var o = 0; o < this.children.length; o++)
  43220. r.children.push(this.children[o].toJSON(e).object)
  43221. }
  43222. if (i) {
  43223. var a = t(e.geometries)
  43224. , s = t(e.materials)
  43225. , l = t(e.textures)
  43226. , c = t(e.images);
  43227. a.length > 0 && (n.geometries = a),
  43228. s.length > 0 && (n.materials = s),
  43229. l.length > 0 && (n.textures = l),
  43230. c.length > 0 && (n.images = c)
  43231. }
  43232. return n.object = r,
  43233. n
  43234. },
  43235. clone: function(e) {
  43236. return (new this.constructor).copy(this, e)
  43237. },
  43238. copy: function(e, t) {
  43239. if (void 0 === t && (t = !0),
  43240. this.name = e.name,
  43241. this.up.copy(e.up),
  43242. this.position.copy(e.position),
  43243. this.quaternion.copy(e.quaternion),
  43244. this.scale.copy(e.scale),
  43245. this.rotationAutoUpdate = e.rotationAutoUpdate,
  43246. this.matrix.copy(e.matrix),
  43247. this.matrixWorld.copy(e.matrixWorld),
  43248. this.matrixAutoUpdate = e.matrixAutoUpdate,
  43249. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  43250. this.visible = e.visible,
  43251. this.castShadow = e.castShadow,
  43252. this.receiveShadow = e.receiveShadow,
  43253. this.frustumCulled = e.frustumCulled,
  43254. this.renderOrder = e.renderOrder,
  43255. this.userData = JSON.parse(JSON.stringify(e.userData)),
  43256. t === !0)
  43257. for (var i = 0; i < e.children.length; i++) {
  43258. var n = e.children[i];
  43259. this.add(n.clone())
  43260. }
  43261. return this
  43262. }
  43263. },
  43264. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  43265. n.Object3DIdCount = 0,
  43266. n.Face3 = function(e, t, i, r, o, a) {
  43267. this.a = e,
  43268. this.b = t,
  43269. this.c = i,
  43270. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  43271. this.vertexNormals = Array.isArray(r) ? r : [],
  43272. this.color = o instanceof n.Color ? o : new n.Color,
  43273. this.vertexColors = Array.isArray(o) ? o : [],
  43274. this.materialIndex = void 0 !== a ? a : 0
  43275. }
  43276. ,
  43277. n.Face3.prototype = {
  43278. constructor: n.Face3,
  43279. clone: function() {
  43280. return (new this.constructor).copy(this)
  43281. },
  43282. copy: function(e) {
  43283. this.a = e.a,
  43284. this.b = e.b,
  43285. this.c = e.c,
  43286. this.normal.copy(e.normal),
  43287. this.color.copy(e.color),
  43288. this.materialIndex = e.materialIndex;
  43289. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  43290. this.vertexNormals[t] = e.vertexNormals[t].clone();
  43291. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  43292. this.vertexColors[t] = e.vertexColors[t].clone();
  43293. return this
  43294. }
  43295. },
  43296. n.BufferAttribute = function(e, t) {
  43297. this.uuid = n.Math.generateUUID(),
  43298. this.array = e,
  43299. this.itemSize = t,
  43300. this.dynamic = !1,
  43301. this.updateRange = {
  43302. offset: 0,
  43303. count: -1
  43304. },
  43305. this.version = 0
  43306. }
  43307. ,
  43308. n.BufferAttribute.prototype = {
  43309. constructor: n.BufferAttribute,
  43310. get count() {
  43311. return this.array.length / this.itemSize
  43312. },
  43313. set needsUpdate(e) {
  43314. e === !0 && this.version++
  43315. },
  43316. setDynamic: function(e) {
  43317. return this.dynamic = e,
  43318. this
  43319. },
  43320. copy: function(e) {
  43321. return this.array = new e.array.constructor(e.array),
  43322. this.itemSize = e.itemSize,
  43323. this.dynamic = e.dynamic,
  43324. this
  43325. },
  43326. copyAt: function(e, t, i) {
  43327. e *= this.itemSize,
  43328. i *= t.itemSize;
  43329. for (var n = 0, r = this.itemSize; n < r; n++)
  43330. this.array[e + n] = t.array[i + n];
  43331. return this
  43332. },
  43333. copyArray: function(e) {
  43334. return this.array.set(e),
  43335. this
  43336. },
  43337. copyColorsArray: function(e) {
  43338. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43339. var a = e[r];
  43340. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  43341. a = new n.Color),
  43342. t[i++] = a.r,
  43343. t[i++] = a.g,
  43344. t[i++] = a.b
  43345. }
  43346. return this
  43347. },
  43348. copyIndicesArray: function(e) {
  43349. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  43350. var o = e[n];
  43351. t[i++] = o.a,
  43352. t[i++] = o.b,
  43353. t[i++] = o.c
  43354. }
  43355. return this
  43356. },
  43357. copyVector2sArray: function(e) {
  43358. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43359. var a = e[r];
  43360. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  43361. a = new n.Vector2),
  43362. t[i++] = a.x,
  43363. t[i++] = a.y
  43364. }
  43365. return this
  43366. },
  43367. copyVector3sArray: function(e) {
  43368. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43369. var a = e[r];
  43370. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  43371. a = new n.Vector3),
  43372. t[i++] = a.x,
  43373. t[i++] = a.y,
  43374. t[i++] = a.z
  43375. }
  43376. return this
  43377. },
  43378. copyVector4sArray: function(e) {
  43379. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43380. var a = e[r];
  43381. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  43382. a = new n.Vector4),
  43383. t[i++] = a.x,
  43384. t[i++] = a.y,
  43385. t[i++] = a.z,
  43386. t[i++] = a.w
  43387. }
  43388. return this
  43389. },
  43390. set: function(e, t) {
  43391. return void 0 === t && (t = 0),
  43392. this.array.set(e, t),
  43393. this
  43394. },
  43395. getX: function(e) {
  43396. return this.array[e * this.itemSize]
  43397. },
  43398. setX: function(e, t) {
  43399. return this.array[e * this.itemSize] = t,
  43400. this
  43401. },
  43402. getY: function(e) {
  43403. return this.array[e * this.itemSize + 1]
  43404. },
  43405. setY: function(e, t) {
  43406. return this.array[e * this.itemSize + 1] = t,
  43407. this
  43408. },
  43409. getZ: function(e) {
  43410. return this.array[e * this.itemSize + 2]
  43411. },
  43412. setZ: function(e, t) {
  43413. return this.array[e * this.itemSize + 2] = t,
  43414. this
  43415. },
  43416. getW: function(e) {
  43417. return this.array[e * this.itemSize + 3]
  43418. },
  43419. setW: function(e, t) {
  43420. return this.array[e * this.itemSize + 3] = t,
  43421. this
  43422. },
  43423. setXY: function(e, t, i) {
  43424. return e *= this.itemSize,
  43425. this.array[e + 0] = t,
  43426. this.array[e + 1] = i,
  43427. this
  43428. },
  43429. setXYZ: function(e, t, i, n) {
  43430. return e *= this.itemSize,
  43431. this.array[e + 0] = t,
  43432. this.array[e + 1] = i,
  43433. this.array[e + 2] = n,
  43434. this
  43435. },
  43436. setXYZW: function(e, t, i, n, r) {
  43437. return e *= this.itemSize,
  43438. this.array[e + 0] = t,
  43439. this.array[e + 1] = i,
  43440. this.array[e + 2] = n,
  43441. this.array[e + 3] = r,
  43442. this
  43443. },
  43444. clone: function() {
  43445. return (new this.constructor).copy(this)
  43446. }
  43447. },
  43448. n.Int8Attribute = function(e, t) {
  43449. return new n.BufferAttribute(new Int8Array(e),t)
  43450. }
  43451. ,
  43452. n.Uint8Attribute = function(e, t) {
  43453. return new n.BufferAttribute(new Uint8Array(e),t)
  43454. }
  43455. ,
  43456. n.Uint8ClampedAttribute = function(e, t) {
  43457. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  43458. }
  43459. ,
  43460. n.Int16Attribute = function(e, t) {
  43461. return new n.BufferAttribute(new Int16Array(e),t)
  43462. }
  43463. ,
  43464. n.Uint16Attribute = function(e, t) {
  43465. return new n.BufferAttribute(new Uint16Array(e),t)
  43466. }
  43467. ;
  43468. n.Int32Attribute = function(e, t) {
  43469. return new n.BufferAttribute(new Int32Array(e),t)
  43470. }
  43471. ;
  43472. n.Uint32Attribute = function(e, t) {
  43473. return new n.BufferAttribute(new Uint32Array(e),t)
  43474. }
  43475. ,
  43476. n.Float32Attribute = function(e, t) {
  43477. return new n.BufferAttribute(new Float32Array(e),t)
  43478. }
  43479. ,
  43480. n.Float64Attribute = function(e, t) {
  43481. return new n.BufferAttribute(new Float64Array(e),t)
  43482. }
  43483. ,
  43484. n.DynamicBufferAttribute = function(e, t) {
  43485. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  43486. new n.BufferAttribute(e,t).setDynamic(!0)
  43487. }
  43488. ,
  43489. n.InstancedBufferAttribute = function(e, t, i) {
  43490. n.BufferAttribute.call(this, e, t),
  43491. this.meshPerAttribute = i || 1
  43492. }
  43493. ,
  43494. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  43495. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  43496. n.InstancedBufferAttribute.prototype.copy = function(e) {
  43497. return n.BufferAttribute.prototype.copy.call(this, e),
  43498. this.meshPerAttribute = e.meshPerAttribute,
  43499. this
  43500. }
  43501. ,
  43502. n.InterleavedBuffer = function(e, t) {
  43503. this.uuid = n.Math.generateUUID(),
  43504. this.array = e,
  43505. this.stride = t,
  43506. this.dynamic = !1,
  43507. this.updateRange = {
  43508. offset: 0,
  43509. count: -1
  43510. },
  43511. this.version = 0
  43512. }
  43513. ,
  43514. n.InterleavedBuffer.prototype = {
  43515. constructor: n.InterleavedBuffer,
  43516. get length() {
  43517. return this.array.length
  43518. },
  43519. get count() {
  43520. return this.array.length / this.stride
  43521. },
  43522. set needsUpdate(e) {
  43523. e === !0 && this.version++
  43524. },
  43525. setDynamic: function(e) {
  43526. return this.dynamic = e,
  43527. this
  43528. },
  43529. copy: function(e) {
  43530. return this.array = new e.array.constructor(e.array),
  43531. this.stride = e.stride,
  43532. this.dynamic = e.dynamic,
  43533. this
  43534. },
  43535. copyAt: function(e, t, i) {
  43536. e *= this.stride,
  43537. i *= t.stride;
  43538. for (var n = 0, r = this.stride; n < r; n++)
  43539. this.array[e + n] = t.array[i + n];
  43540. return this
  43541. },
  43542. set: function(e, t) {
  43543. return void 0 === t && (t = 0),
  43544. this.array.set(e, t),
  43545. this
  43546. },
  43547. clone: function() {
  43548. return (new this.constructor).copy(this)
  43549. }
  43550. },
  43551. n.InstancedInterleavedBuffer = function(e, t, i) {
  43552. n.InterleavedBuffer.call(this, e, t),
  43553. this.meshPerAttribute = i || 1
  43554. }
  43555. ,
  43556. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  43557. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  43558. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  43559. return n.InterleavedBuffer.prototype.copy.call(this, e),
  43560. this.meshPerAttribute = e.meshPerAttribute,
  43561. this
  43562. }
  43563. ,
  43564. n.InterleavedBufferAttribute = function(e, t, i) {
  43565. this.uuid = n.Math.generateUUID(),
  43566. this.data = e,
  43567. this.itemSize = t,
  43568. this.offset = i
  43569. }
  43570. ,
  43571. n.InterleavedBufferAttribute.prototype = {
  43572. constructor: n.InterleavedBufferAttribute,
  43573. get length() {
  43574. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  43575. this.array.length
  43576. },
  43577. get count() {
  43578. return this.data.count
  43579. },
  43580. setX: function(e, t) {
  43581. return this.data.array[e * this.data.stride + this.offset] = t,
  43582. this
  43583. },
  43584. setY: function(e, t) {
  43585. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  43586. this
  43587. },
  43588. setZ: function(e, t) {
  43589. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  43590. this
  43591. },
  43592. setW: function(e, t) {
  43593. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  43594. this
  43595. },
  43596. getX: function(e) {
  43597. return this.data.array[e * this.data.stride + this.offset]
  43598. },
  43599. getY: function(e) {
  43600. return this.data.array[e * this.data.stride + this.offset + 1]
  43601. },
  43602. getZ: function(e) {
  43603. return this.data.array[e * this.data.stride + this.offset + 2]
  43604. },
  43605. getW: function(e) {
  43606. return this.data.array[e * this.data.stride + this.offset + 3]
  43607. },
  43608. setXY: function(e, t, i) {
  43609. return e = e * this.data.stride + this.offset,
  43610. this.data.array[e + 0] = t,
  43611. this.data.array[e + 1] = i,
  43612. this
  43613. },
  43614. setXYZ: function(e, t, i, n) {
  43615. return e = e * this.data.stride + this.offset,
  43616. this.data.array[e + 0] = t,
  43617. this.data.array[e + 1] = i,
  43618. this.data.array[e + 2] = n,
  43619. this
  43620. },
  43621. setXYZW: function(e, t, i, n, r) {
  43622. return e = e * this.data.stride + this.offset,
  43623. this.data.array[e + 0] = t,
  43624. this.data.array[e + 1] = i,
  43625. this.data.array[e + 2] = n,
  43626. this.data.array[e + 3] = r,
  43627. this
  43628. }
  43629. },
  43630. n.Geometry = function() {
  43631. Object.defineProperty(this, "id", {
  43632. value: n.GeometryIdCount++
  43633. }),
  43634. this.uuid = n.Math.generateUUID(),
  43635. this.name = "",
  43636. this.type = "Geometry",
  43637. this.vertices = [],
  43638. this.colors = [],
  43639. this.faces = [],
  43640. this.faceVertexUvs = [[]],
  43641. this.morphTargets = [],
  43642. this.morphNormals = [],
  43643. this.skinWeights = [],
  43644. this.skinIndices = [],
  43645. this.lineDistances = [],
  43646. this.boundingBox = null,
  43647. this.boundingSphere = null,
  43648. this.verticesNeedUpdate = !1,
  43649. this.elementsNeedUpdate = !1,
  43650. this.uvsNeedUpdate = !1,
  43651. this.normalsNeedUpdate = !1,
  43652. this.colorsNeedUpdate = !1,
  43653. this.lineDistancesNeedUpdate = !1,
  43654. this.groupsNeedUpdate = !1
  43655. }
  43656. ,
  43657. n.Geometry.prototype = {
  43658. constructor: n.Geometry,
  43659. applyMatrix: function(e) {
  43660. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  43661. var o = this.vertices[i];
  43662. o.applyMatrix4(e)
  43663. }
  43664. for (var i = 0, r = this.faces.length; i < r; i++) {
  43665. var a = this.faces[i];
  43666. a.normal.applyMatrix3(t).normalize();
  43667. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  43668. a.vertexNormals[s].applyMatrix3(t).normalize()
  43669. }
  43670. return null !== this.boundingBox && this.computeBoundingBox(),
  43671. null !== this.boundingSphere && this.computeBoundingSphere(),
  43672. this.verticesNeedUpdate = !0,
  43673. this.normalsNeedUpdate = !0,
  43674. this
  43675. },
  43676. rotateX: function() {
  43677. var e;
  43678. return function(t) {
  43679. return void 0 === e && (e = new n.Matrix4),
  43680. e.makeRotationX(t),
  43681. this.applyMatrix(e),
  43682. this
  43683. }
  43684. }(),
  43685. rotateY: function() {
  43686. var e;
  43687. return function(t) {
  43688. return void 0 === e && (e = new n.Matrix4),
  43689. e.makeRotationY(t),
  43690. this.applyMatrix(e),
  43691. this
  43692. }
  43693. }(),
  43694. rotateZ: function() {
  43695. var e;
  43696. return function(t) {
  43697. return void 0 === e && (e = new n.Matrix4),
  43698. e.makeRotationZ(t),
  43699. this.applyMatrix(e),
  43700. this
  43701. }
  43702. }(),
  43703. translate: function() {
  43704. var e;
  43705. return function(t, i, r) {
  43706. return void 0 === e && (e = new n.Matrix4),
  43707. e.makeTranslation(t, i, r),
  43708. this.applyMatrix(e),
  43709. this
  43710. }
  43711. }(),
  43712. scale: function() {
  43713. var e;
  43714. return function(t, i, r) {
  43715. return void 0 === e && (e = new n.Matrix4),
  43716. e.makeScale(t, i, r),
  43717. this.applyMatrix(e),
  43718. this
  43719. }
  43720. }(),
  43721. lookAt: function() {
  43722. var e;
  43723. return function(t) {
  43724. void 0 === e && (e = new n.Object3D),
  43725. e.lookAt(t),
  43726. e.updateMatrix(),
  43727. this.applyMatrix(e.matrix)
  43728. }
  43729. }(),
  43730. fromBufferGeometry: function(e) {
  43731. function t(e, t, r, o) {
  43732. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  43733. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  43734. , g = new n.Face3(e,t,r,a,f,o);
  43735. i.faces.push(g),
  43736. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  43737. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  43738. }
  43739. var i = this
  43740. , r = null !== e.index ? e.index.array : void 0
  43741. , o = e.attributes
  43742. , a = o.position.array
  43743. , s = void 0 !== o.normal ? o.normal.array : void 0
  43744. , l = void 0 !== o.color ? o.color.array : void 0
  43745. , c = void 0 !== o.uv ? o.uv.array : void 0
  43746. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  43747. void 0 !== h && (this.faceVertexUvs[1] = []);
  43748. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  43749. g += 2)
  43750. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  43751. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  43752. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  43753. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  43754. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  43755. if (void 0 !== r) {
  43756. var m = e.groups;
  43757. if (m.length > 0)
  43758. for (var f = 0; f < m.length; f++)
  43759. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  43760. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  43761. else
  43762. for (var f = 0; f < r.length; f += 3)
  43763. t(r[f], r[f + 1], r[f + 2])
  43764. } else
  43765. for (var f = 0; f < a.length / 3; f += 3)
  43766. t(f, f + 1, f + 2);
  43767. return this.computeFaceNormals(),
  43768. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  43769. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  43770. this
  43771. },
  43772. center: function() {
  43773. this.computeBoundingBox();
  43774. var e = this.boundingBox.center().negate();
  43775. return this.translate(e.x, e.y, e.z),
  43776. e
  43777. },
  43778. normalize: function() {
  43779. this.computeBoundingSphere();
  43780. var e = this.boundingSphere.center
  43781. , t = this.boundingSphere.radius
  43782. , i = 0 === t ? 1 : 1 / t
  43783. , r = new n.Matrix4;
  43784. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  43785. this.applyMatrix(r),
  43786. this
  43787. },
  43788. computeFaceNormals: function() {
  43789. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  43790. var o = this.faces[i]
  43791. , a = this.vertices[o.a]
  43792. , s = this.vertices[o.b]
  43793. , l = this.vertices[o.c];
  43794. e.subVectors(l, s),
  43795. t.subVectors(a, s),
  43796. e.cross(t),
  43797. e.normalize(),
  43798. o.normal.copy(e)
  43799. }
  43800. },
  43801. computeVertexNormals: function(e) {
  43802. void 0 === e && (e = !0);
  43803. var t, i, r, o, a, s;
  43804. for (s = new Array(this.vertices.length),
  43805. t = 0,
  43806. i = this.vertices.length; t < i; t++)
  43807. s[t] = new n.Vector3;
  43808. if (e) {
  43809. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  43810. for (r = 0,
  43811. o = this.faces.length; r < o; r++)
  43812. a = this.faces[r],
  43813. l = this.vertices[a.a],
  43814. c = this.vertices[a.b],
  43815. h = this.vertices[a.c],
  43816. u.subVectors(h, c),
  43817. d.subVectors(l, c),
  43818. u.cross(d),
  43819. s[a.a].add(u),
  43820. s[a.b].add(u),
  43821. s[a.c].add(u)
  43822. } else
  43823. for (r = 0,
  43824. o = this.faces.length; r < o; r++)
  43825. a = this.faces[r],
  43826. s[a.a].add(a.normal),
  43827. s[a.b].add(a.normal),
  43828. s[a.c].add(a.normal);
  43829. for (t = 0,
  43830. i = this.vertices.length; t < i; t++)
  43831. s[t].normalize();
  43832. for (r = 0,
  43833. o = this.faces.length; r < o; r++) {
  43834. a = this.faces[r];
  43835. var p = a.vertexNormals;
  43836. 3 === p.length ? (p[0].copy(s[a.a]),
  43837. p[1].copy(s[a.b]),
  43838. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  43839. p[1] = s[a.b].clone(),
  43840. p[2] = s[a.c].clone())
  43841. }
  43842. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  43843. },
  43844. computeMorphNormals: function() {
  43845. var e, t, i, r, o;
  43846. for (i = 0,
  43847. r = this.faces.length; i < r; i++)
  43848. for (o = this.faces[i],
  43849. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  43850. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  43851. e = 0,
  43852. t = o.vertexNormals.length; e < t; e++)
  43853. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  43854. var a = new n.Geometry;
  43855. for (a.faces = this.faces,
  43856. e = 0,
  43857. t = this.morphTargets.length; e < t; e++) {
  43858. if (!this.morphNormals[e]) {
  43859. this.morphNormals[e] = {},
  43860. this.morphNormals[e].faceNormals = [],
  43861. this.morphNormals[e].vertexNormals = [];
  43862. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  43863. for (i = 0,
  43864. r = this.faces.length; i < r; i++)
  43865. s = new n.Vector3,
  43866. l = {
  43867. a: new n.Vector3,
  43868. b: new n.Vector3,
  43869. c: new n.Vector3
  43870. },
  43871. c.push(s),
  43872. h.push(l)
  43873. }
  43874. var u = this.morphNormals[e];
  43875. a.vertices = this.morphTargets[e].vertices,
  43876. a.computeFaceNormals(),
  43877. a.computeVertexNormals();
  43878. var s, l;
  43879. for (i = 0,
  43880. r = this.faces.length; i < r; i++)
  43881. o = this.faces[i],
  43882. s = u.faceNormals[i],
  43883. l = u.vertexNormals[i],
  43884. s.copy(o.normal),
  43885. l.a.copy(o.vertexNormals[0]),
  43886. l.b.copy(o.vertexNormals[1]),
  43887. l.c.copy(o.vertexNormals[2])
  43888. }
  43889. for (i = 0,
  43890. r = this.faces.length; i < r; i++)
  43891. o = this.faces[i],
  43892. o.normal = o.__originalFaceNormal,
  43893. o.vertexNormals = o.__originalVertexNormals
  43894. },
  43895. computeTangents: function() {
  43896. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  43897. },
  43898. computeLineDistances: function() {
  43899. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  43900. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  43901. this.lineDistances[i] = e
  43902. },
  43903. computeBoundingBox: function() {
  43904. null === this.boundingBox && (this.boundingBox = new n.Box3),
  43905. this.boundingBox.setFromPoints(this.vertices)
  43906. },
  43907. computeBoundingSphere: function() {
  43908. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  43909. this.boundingSphere.setFromPoints(this.vertices)
  43910. },
  43911. merge: function(e, t, i) {
  43912. if (e instanceof n.Geometry == !1)
  43913. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  43914. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  43915. void 0 === i && (i = 0),
  43916. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  43917. for (var d = 0, p = s.length; d < p; d++) {
  43918. var f = s[d]
  43919. , g = f.clone();
  43920. void 0 !== t && g.applyMatrix4(t),
  43921. a.push(g)
  43922. }
  43923. for (d = 0,
  43924. p = c.length; d < p; d++) {
  43925. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  43926. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  43927. m.normal.copy(y.normal),
  43928. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  43929. for (var E = 0, b = C.length; E < b; E++)
  43930. v = C[E].clone(),
  43931. void 0 !== r && v.applyMatrix3(r).normalize(),
  43932. m.vertexNormals.push(v);
  43933. m.color.copy(y.color);
  43934. for (var E = 0, b = I.length; E < b; E++)
  43935. A = I[E],
  43936. m.vertexColors.push(A.clone());
  43937. m.materialIndex = y.materialIndex + i,
  43938. l.push(m)
  43939. }
  43940. for (d = 0,
  43941. p = u.length; d < p; d++) {
  43942. var w = u[d]
  43943. , _ = [];
  43944. if (void 0 !== w) {
  43945. for (var E = 0, b = w.length; E < b; E++)
  43946. _.push(w[E].clone());
  43947. h.push(_)
  43948. }
  43949. }
  43950. },
  43951. mergeMesh: function(e) {
  43952. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  43953. void this.merge(e.geometry, e.matrix))
  43954. },
  43955. mergeVertices: function() {
  43956. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  43957. for (i = 0,
  43958. n = this.vertices.length; i < n; i++)
  43959. e = this.vertices[i],
  43960. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  43961. void 0 === l[t] ? (l[t] = i,
  43962. c.push(this.vertices[i]),
  43963. h[i] = c.length - 1) : h[i] = h[l[t]];
  43964. var p = [];
  43965. for (i = 0,
  43966. n = this.faces.length; i < n; i++) {
  43967. r = this.faces[i],
  43968. r.a = h[r.a],
  43969. r.b = h[r.b],
  43970. r.c = h[r.c],
  43971. o = [r.a, r.b, r.c];
  43972. for (var f = -1, g = 0; g < 3; g++)
  43973. if (o[g] === o[(g + 1) % 3]) {
  43974. f = g,
  43975. p.push(i);
  43976. break
  43977. }
  43978. }
  43979. for (i = p.length - 1; i >= 0; i--) {
  43980. var m = p[i];
  43981. for (this.faces.splice(m, 1),
  43982. a = 0,
  43983. s = this.faceVertexUvs.length; a < s; a++)
  43984. this.faceVertexUvs[a].splice(m, 1)
  43985. }
  43986. var v = this.vertices.length - c.length;
  43987. return this.vertices = c,
  43988. v
  43989. },
  43990. sortFacesByMaterialIndex: function() {
  43991. function e(e, t) {
  43992. return e.materialIndex - t.materialIndex
  43993. }
  43994. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  43995. t[n]._id = n;
  43996. t.sort(e);
  43997. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  43998. a && a.length === i && (r = []),
  43999. s && s.length === i && (o = []);
  44000. for (var n = 0; n < i; n++) {
  44001. var l = t[n]._id;
  44002. r && r.push(a[l]),
  44003. o && o.push(s[l])
  44004. }
  44005. r && (this.faceVertexUvs[0] = r),
  44006. o && (this.faceVertexUvs[1] = o)
  44007. },
  44008. toJSON: function() {
  44009. function e(e, t, i) {
  44010. return i ? e | 1 << t : e & ~(1 << t)
  44011. }
  44012. function t(e) {
  44013. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44014. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44015. u.push(e.x, e.y, e.z),
  44016. d[t])
  44017. }
  44018. function i(e) {
  44019. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44020. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44021. p.push(e.getHex()),
  44022. f[t])
  44023. }
  44024. function n(e) {
  44025. var t = e.x.toString() + e.y.toString();
  44026. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44027. g.push(e.x, e.y),
  44028. m[t])
  44029. }
  44030. var r = {
  44031. metadata: {
  44032. version: 4.4,
  44033. type: "Geometry",
  44034. generator: "Geometry.toJSON"
  44035. }
  44036. };
  44037. if (r.uuid = this.uuid,
  44038. r.type = this.type,
  44039. "" !== this.name && (r.name = this.name),
  44040. void 0 !== this.parameters) {
  44041. var o = this.parameters;
  44042. for (var a in o)
  44043. void 0 !== o[a] && (r[a] = o[a]);
  44044. return r
  44045. }
  44046. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44047. var c = this.vertices[l];
  44048. s.push(c.x, c.y, c.z)
  44049. }
  44050. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44051. var v = this.faces[l]
  44052. , A = !0
  44053. , y = !1
  44054. , C = void 0 !== this.faceVertexUvs[0][l]
  44055. , I = v.normal.length() > 0
  44056. , E = v.vertexNormals.length > 0
  44057. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44058. , w = v.vertexColors.length > 0
  44059. , _ = 0;
  44060. if (_ = e(_, 0, 0),
  44061. _ = e(_, 1, A),
  44062. _ = e(_, 2, y),
  44063. _ = e(_, 3, C),
  44064. _ = e(_, 4, I),
  44065. _ = e(_, 5, E),
  44066. _ = e(_, 6, b),
  44067. _ = e(_, 7, w),
  44068. h.push(_),
  44069. h.push(v.a, v.b, v.c),
  44070. h.push(v.materialIndex),
  44071. C) {
  44072. var T = this.faceVertexUvs[0][l];
  44073. h.push(n(T[0]), n(T[1]), n(T[2]))
  44074. }
  44075. if (I && h.push(t(v.normal)),
  44076. E) {
  44077. var x = v.vertexNormals;
  44078. h.push(t(x[0]), t(x[1]), t(x[2]))
  44079. }
  44080. if (b && h.push(i(v.color)),
  44081. w) {
  44082. var S = v.vertexColors;
  44083. h.push(i(S[0]), i(S[1]), i(S[2]))
  44084. }
  44085. }
  44086. return r.data = {},
  44087. r.data.vertices = s,
  44088. r.data.normals = u,
  44089. p.length > 0 && (r.data.colors = p),
  44090. g.length > 0 && (r.data.uvs = [g]),
  44091. r.data.faces = h,
  44092. r
  44093. },
  44094. clone: function() {
  44095. return (new n.Geometry).copy(this)
  44096. },
  44097. copy: function(e) {
  44098. this.vertices = [],
  44099. this.faces = [],
  44100. this.faceVertexUvs = [[]];
  44101. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44102. this.vertices.push(t[i].clone());
  44103. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44104. this.faces.push(r[i].clone());
  44105. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44106. var o = e.faceVertexUvs[i];
  44107. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44108. for (var a = 0, s = o.length; a < s; a++) {
  44109. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44110. var d = l[h];
  44111. c.push(d.clone())
  44112. }
  44113. this.faceVertexUvs[i].push(c)
  44114. }
  44115. }
  44116. return this
  44117. },
  44118. dispose: function() {
  44119. this.dispatchEvent({
  44120. type: "dispose"
  44121. })
  44122. }
  44123. },
  44124. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44125. n.GeometryIdCount = 0,
  44126. n.DirectGeometry = function() {
  44127. Object.defineProperty(this, "id", {
  44128. value: n.GeometryIdCount++
  44129. }),
  44130. this.uuid = n.Math.generateUUID(),
  44131. this.name = "",
  44132. this.type = "DirectGeometry",
  44133. this.indices = [],
  44134. this.vertices = [],
  44135. this.normals = [],
  44136. this.colors = [],
  44137. this.uvs = [],
  44138. this.uvs2 = [],
  44139. this.groups = [],
  44140. this.morphTargets = {},
  44141. this.skinWeights = [],
  44142. this.skinIndices = [],
  44143. this.boundingBox = null,
  44144. this.boundingSphere = null,
  44145. this.verticesNeedUpdate = !1,
  44146. this.normalsNeedUpdate = !1,
  44147. this.colorsNeedUpdate = !1,
  44148. this.uvsNeedUpdate = !1,
  44149. this.groupsNeedUpdate = !1
  44150. }
  44151. ,
  44152. n.DirectGeometry.prototype = {
  44153. constructor: n.DirectGeometry,
  44154. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44155. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44156. computeFaceNormals: function() {
  44157. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44158. },
  44159. computeVertexNormals: function() {
  44160. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44161. },
  44162. computeGroups: function(e) {
  44163. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44164. var a = r[o];
  44165. a.materialIndex !== i && (i = a.materialIndex,
  44166. void 0 !== t && (t.count = 3 * o - t.start,
  44167. n.push(t)),
  44168. t = {
  44169. start: 3 * o,
  44170. materialIndex: i
  44171. })
  44172. }
  44173. void 0 !== t && (t.count = 3 * o - t.start,
  44174. n.push(t)),
  44175. this.groups = n
  44176. },
  44177. fromGeometry: function(e) {
  44178. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  44179. if (c > 0) {
  44180. t = [];
  44181. for (var h = 0; h < c; h++)
  44182. t[h] = [];
  44183. this.morphTargets.position = t
  44184. }
  44185. var u, d = e.morphNormals, p = d.length;
  44186. if (p > 0) {
  44187. u = [];
  44188. for (var h = 0; h < p; h++)
  44189. u[h] = [];
  44190. this.morphTargets.normal = u
  44191. }
  44192. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  44193. var A = i[h];
  44194. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  44195. var y = A.vertexNormals;
  44196. if (3 === y.length)
  44197. this.normals.push(y[0], y[1], y[2]);
  44198. else {
  44199. var C = A.normal;
  44200. this.normals.push(C, C, C)
  44201. }
  44202. var I = A.vertexColors;
  44203. if (3 === I.length)
  44204. this.colors.push(I[0], I[1], I[2]);
  44205. else {
  44206. var E = A.color;
  44207. this.colors.push(E, E, E)
  44208. }
  44209. if (a === !0) {
  44210. var b = o[0][h];
  44211. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  44212. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44213. }
  44214. if (s === !0) {
  44215. var b = o[1][h];
  44216. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  44217. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44218. }
  44219. for (var w = 0; w < c; w++) {
  44220. var _ = l[w].vertices;
  44221. t[w].push(_[A.a], _[A.b], _[A.c])
  44222. }
  44223. for (var w = 0; w < p; w++) {
  44224. var T = d[w].vertexNormals[h];
  44225. u[w].push(T.a, T.b, T.c)
  44226. }
  44227. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  44228. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  44229. }
  44230. return this.computeGroups(e),
  44231. this.verticesNeedUpdate = e.verticesNeedUpdate,
  44232. this.normalsNeedUpdate = e.normalsNeedUpdate,
  44233. this.colorsNeedUpdate = e.colorsNeedUpdate,
  44234. this.uvsNeedUpdate = e.uvsNeedUpdate,
  44235. this.groupsNeedUpdate = e.groupsNeedUpdate,
  44236. this
  44237. },
  44238. dispose: function() {
  44239. this.dispatchEvent({
  44240. type: "dispose"
  44241. })
  44242. }
  44243. },
  44244. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  44245. n.BufferGeometry = function() {
  44246. Object.defineProperty(this, "id", {
  44247. value: n.GeometryIdCount++
  44248. }),
  44249. this.uuid = n.Math.generateUUID(),
  44250. this.name = "",
  44251. this.type = "BufferGeometry",
  44252. this.index = null,
  44253. this.attributes = {},
  44254. this.morphAttributes = {},
  44255. this.groups = [],
  44256. this.boundingBox = null,
  44257. this.boundingSphere = null,
  44258. this.drawRange = {
  44259. start: 0,
  44260. count: 1 / 0
  44261. }
  44262. }
  44263. ,
  44264. n.BufferGeometry.prototype = {
  44265. constructor: n.BufferGeometry,
  44266. getIndex: function() {
  44267. return this.index
  44268. },
  44269. setIndex: function(e) {
  44270. this.index = e
  44271. },
  44272. addAttribute: function(e, t) {
  44273. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  44274. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  44275. void this.setIndex(t)) : (this.attributes[e] = t,
  44276. this)
  44277. },
  44278. getAttribute: function(e) {
  44279. return this.attributes[e]
  44280. },
  44281. removeAttribute: function(e) {
  44282. return delete this.attributes[e],
  44283. this
  44284. },
  44285. addGroup: function(e, t, i) {
  44286. this.groups.push({
  44287. start: e,
  44288. count: t,
  44289. materialIndex: void 0 !== i ? i : 0
  44290. })
  44291. },
  44292. clearGroups: function() {
  44293. this.groups = []
  44294. },
  44295. setDrawRange: function(e, t) {
  44296. this.drawRange.start = e,
  44297. this.drawRange.count = t
  44298. },
  44299. applyMatrix: function(e) {
  44300. var t = this.attributes.position;
  44301. void 0 !== t && (e.applyToVector3Array(t.array),
  44302. t.needsUpdate = !0);
  44303. var i = this.attributes.normal;
  44304. if (void 0 !== i) {
  44305. var r = (new n.Matrix3).getNormalMatrix(e);
  44306. r.applyToVector3Array(i.array),
  44307. i.needsUpdate = !0
  44308. }
  44309. return null !== this.boundingBox && this.computeBoundingBox(),
  44310. null !== this.boundingSphere && this.computeBoundingSphere(),
  44311. this
  44312. },
  44313. rotateX: function() {
  44314. var e;
  44315. return function(t) {
  44316. return void 0 === e && (e = new n.Matrix4),
  44317. e.makeRotationX(t),
  44318. this.applyMatrix(e),
  44319. this
  44320. }
  44321. }(),
  44322. rotateY: function() {
  44323. var e;
  44324. return function(t) {
  44325. return void 0 === e && (e = new n.Matrix4),
  44326. e.makeRotationY(t),
  44327. this.applyMatrix(e),
  44328. this
  44329. }
  44330. }(),
  44331. rotateZ: function() {
  44332. var e;
  44333. return function(t) {
  44334. return void 0 === e && (e = new n.Matrix4),
  44335. e.makeRotationZ(t),
  44336. this.applyMatrix(e),
  44337. this
  44338. }
  44339. }(),
  44340. translate: function() {
  44341. var e;
  44342. return function(t, i, r) {
  44343. return void 0 === e && (e = new n.Matrix4),
  44344. e.makeTranslation(t, i, r),
  44345. this.applyMatrix(e),
  44346. this
  44347. }
  44348. }(),
  44349. scale: function() {
  44350. var e;
  44351. return function(t, i, r) {
  44352. return void 0 === e && (e = new n.Matrix4),
  44353. e.makeScale(t, i, r),
  44354. this.applyMatrix(e),
  44355. this
  44356. }
  44357. }(),
  44358. lookAt: function() {
  44359. var e;
  44360. return function(t) {
  44361. void 0 === e && (e = new n.Object3D),
  44362. e.lookAt(t),
  44363. e.updateMatrix(),
  44364. this.applyMatrix(e.matrix)
  44365. }
  44366. }(),
  44367. center: function() {
  44368. this.computeBoundingBox();
  44369. var e = this.boundingBox.center().negate();
  44370. return this.translate(e.x, e.y, e.z),
  44371. e
  44372. },
  44373. setFromObject: function(e) {
  44374. var t = e.geometry;
  44375. if (e instanceof n.Points || e instanceof n.Line) {
  44376. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  44377. , r = new n.Float32Attribute(3 * t.colors.length,3);
  44378. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  44379. this.addAttribute("color", r.copyColorsArray(t.colors)),
  44380. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  44381. var o = new n.Float32Attribute(t.lineDistances.length,1);
  44382. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  44383. }
  44384. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  44385. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  44386. } else
  44387. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  44388. return this
  44389. },
  44390. updateFromObject: function(e) {
  44391. var t = e.geometry;
  44392. if (e instanceof n.Mesh) {
  44393. var i = t.__directGeometry;
  44394. if (void 0 === i)
  44395. return this.fromGeometry(t);
  44396. i.verticesNeedUpdate = t.verticesNeedUpdate,
  44397. i.normalsNeedUpdate = t.normalsNeedUpdate,
  44398. i.colorsNeedUpdate = t.colorsNeedUpdate,
  44399. i.uvsNeedUpdate = t.uvsNeedUpdate,
  44400. i.groupsNeedUpdate = t.groupsNeedUpdate,
  44401. t.verticesNeedUpdate = !1,
  44402. t.normalsNeedUpdate = !1,
  44403. t.colorsNeedUpdate = !1,
  44404. t.uvsNeedUpdate = !1,
  44405. t.groupsNeedUpdate = !1,
  44406. t = i
  44407. }
  44408. if (t.verticesNeedUpdate === !0) {
  44409. var r = this.attributes.position;
  44410. void 0 !== r && (r.copyVector3sArray(t.vertices),
  44411. r.needsUpdate = !0),
  44412. t.verticesNeedUpdate = !1
  44413. }
  44414. if (t.normalsNeedUpdate === !0) {
  44415. var r = this.attributes.normal;
  44416. void 0 !== r && (r.copyVector3sArray(t.normals),
  44417. r.needsUpdate = !0),
  44418. t.normalsNeedUpdate = !1
  44419. }
  44420. if (t.colorsNeedUpdate === !0) {
  44421. var r = this.attributes.color;
  44422. void 0 !== r && (r.copyColorsArray(t.colors),
  44423. r.needsUpdate = !0),
  44424. t.colorsNeedUpdate = !1
  44425. }
  44426. if (t.uvsNeedUpdate) {
  44427. var r = this.attributes.uv;
  44428. void 0 !== r && (r.copyVector2sArray(t.uvs),
  44429. r.needsUpdate = !0),
  44430. t.uvsNeedUpdate = !1
  44431. }
  44432. if (t.lineDistancesNeedUpdate) {
  44433. var r = this.attributes.lineDistance;
  44434. void 0 !== r && (r.copyArray(t.lineDistances),
  44435. r.needsUpdate = !0),
  44436. t.lineDistancesNeedUpdate = !1
  44437. }
  44438. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  44439. this.groups = t.groups,
  44440. t.groupsNeedUpdate = !1),
  44441. this
  44442. },
  44443. fromGeometry: function(e) {
  44444. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  44445. this.fromDirectGeometry(e.__directGeometry)
  44446. },
  44447. fromDirectGeometry: function(e) {
  44448. var t = new Float32Array(3 * e.vertices.length);
  44449. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  44450. e.normals.length > 0) {
  44451. var i = new Float32Array(3 * e.normals.length);
  44452. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  44453. }
  44454. if (e.colors.length > 0) {
  44455. var r = new Float32Array(3 * e.colors.length);
  44456. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  44457. }
  44458. if (e.uvs.length > 0) {
  44459. var o = new Float32Array(2 * e.uvs.length);
  44460. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  44461. }
  44462. if (e.uvs2.length > 0) {
  44463. var a = new Float32Array(2 * e.uvs2.length);
  44464. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  44465. }
  44466. if (e.indices.length > 0) {
  44467. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  44468. , l = new s(3 * e.indices.length);
  44469. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  44470. }
  44471. this.groups = e.groups;
  44472. for (var c in e.morphTargets) {
  44473. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  44474. var f = u[d]
  44475. , g = new n.Float32Attribute(3 * f.length,3);
  44476. h.push(g.copyVector3sArray(f))
  44477. }
  44478. this.morphAttributes[c] = h
  44479. }
  44480. if (e.skinIndices.length > 0) {
  44481. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  44482. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  44483. }
  44484. if (e.skinWeights.length > 0) {
  44485. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  44486. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  44487. }
  44488. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44489. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44490. this
  44491. },
  44492. computeBoundingBox: function() {
  44493. new n.Vector3;
  44494. return function() {
  44495. null === this.boundingBox && (this.boundingBox = new n.Box3);
  44496. var e = this.attributes.position.array;
  44497. e && this.boundingBox.setFromArray(e),
  44498. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  44499. this.boundingBox.max.set(0, 0, 0)),
  44500. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  44501. }
  44502. }(),
  44503. computeBoundingSphere: function() {
  44504. var e = new n.Box3
  44505. , t = new n.Vector3;
  44506. return function() {
  44507. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  44508. var i = this.attributes.position.array;
  44509. if (i) {
  44510. var r = this.boundingSphere.center;
  44511. e.setFromArray(i),
  44512. e.center(r);
  44513. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  44514. t.fromArray(i, a),
  44515. o = Math.max(o, r.distanceToSquared(t));
  44516. this.boundingSphere.radius = Math.sqrt(o),
  44517. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  44518. }
  44519. }
  44520. }(),
  44521. computeFaceNormals: function() {},
  44522. computeVertexNormals: function() {
  44523. var e = this.index
  44524. , t = this.attributes
  44525. , i = this.groups;
  44526. if (t.position) {
  44527. var r = t.position.array;
  44528. if (void 0 === t.normal)
  44529. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  44530. else
  44531. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  44532. o[a] = 0;
  44533. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  44534. if (e) {
  44535. var v = e.array;
  44536. 0 === i.length && this.addGroup(0, v.length);
  44537. for (var A = 0, y = i.length; A < y; ++A)
  44538. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  44539. l = 3 * v[a + 0],
  44540. c = 3 * v[a + 1],
  44541. h = 3 * v[a + 2],
  44542. d.fromArray(r, l),
  44543. p.fromArray(r, c),
  44544. f.fromArray(r, h),
  44545. g.subVectors(f, p),
  44546. m.subVectors(d, p),
  44547. g.cross(m),
  44548. u[l] += g.x,
  44549. u[l + 1] += g.y,
  44550. u[l + 2] += g.z,
  44551. u[c] += g.x,
  44552. u[c + 1] += g.y,
  44553. u[c + 2] += g.z,
  44554. u[h] += g.x,
  44555. u[h + 1] += g.y,
  44556. u[h + 2] += g.z
  44557. } else
  44558. for (var a = 0, s = r.length; a < s; a += 9)
  44559. d.fromArray(r, a),
  44560. p.fromArray(r, a + 3),
  44561. f.fromArray(r, a + 6),
  44562. g.subVectors(f, p),
  44563. m.subVectors(d, p),
  44564. g.cross(m),
  44565. u[a] = g.x,
  44566. u[a + 1] = g.y,
  44567. u[a + 2] = g.z,
  44568. u[a + 3] = g.x,
  44569. u[a + 4] = g.y,
  44570. u[a + 5] = g.z,
  44571. u[a + 6] = g.x,
  44572. u[a + 7] = g.y,
  44573. u[a + 8] = g.z;
  44574. this.normalizeNormals(),
  44575. t.normal.needsUpdate = !0
  44576. }
  44577. },
  44578. merge: function(e, t) {
  44579. if (e instanceof n.BufferGeometry == !1)
  44580. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  44581. void 0 === t && (t = 0);
  44582. var i = this.attributes;
  44583. for (var r in i)
  44584. if (void 0 !== e.attributes[r])
  44585. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  44586. u++)
  44587. a[u] = l[h];
  44588. return this
  44589. },
  44590. normalizeNormals: function() {
  44591. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  44592. e = r[o],
  44593. t = r[o + 1],
  44594. i = r[o + 2],
  44595. n = 1 / Math.sqrt(e * e + t * t + i * i),
  44596. r[o] *= n,
  44597. r[o + 1] *= n,
  44598. r[o + 2] *= n
  44599. },
  44600. toNonIndexed: function() {
  44601. if (null === this.index)
  44602. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  44603. this;
  44604. var e = new n.BufferGeometry
  44605. , t = this.index.array
  44606. , i = this.attributes;
  44607. for (var r in i) {
  44608. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  44609. c = t[u] * s;
  44610. for (var p = 0; p < s; p++)
  44611. l[h++] = a[c++]
  44612. }
  44613. e.addAttribute(r, new n.BufferAttribute(l,s))
  44614. }
  44615. return e
  44616. },
  44617. toJSON: function() {
  44618. var e = {
  44619. metadata: {
  44620. version: 4.4,
  44621. type: "BufferGeometry",
  44622. generator: "BufferGeometry.toJSON"
  44623. }
  44624. };
  44625. if (e.uuid = this.uuid,
  44626. e.type = this.type,
  44627. "" !== this.name && (e.name = this.name),
  44628. void 0 !== this.parameters) {
  44629. var t = this.parameters;
  44630. for (var i in t)
  44631. void 0 !== t[i] && (e[i] = t[i]);
  44632. return e
  44633. }
  44634. e.data = {
  44635. attributes: {}
  44636. };
  44637. var n = this.index;
  44638. if (null !== n) {
  44639. var r = Array.prototype.slice.call(n.array);
  44640. e.data.index = {
  44641. type: n.array.constructor.name,
  44642. array: r
  44643. }
  44644. }
  44645. var o = this.attributes;
  44646. for (var i in o) {
  44647. var a = o[i]
  44648. , r = Array.prototype.slice.call(a.array);
  44649. e.data.attributes[i] = {
  44650. itemSize: a.itemSize,
  44651. type: a.array.constructor.name,
  44652. array: r
  44653. }
  44654. }
  44655. var s = this.groups;
  44656. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  44657. var l = this.boundingSphere;
  44658. return null !== l && (e.data.boundingSphere = {
  44659. center: l.center.toArray(),
  44660. radius: l.radius
  44661. }),
  44662. e
  44663. },
  44664. clone: function() {
  44665. return (new n.BufferGeometry).copy(this)
  44666. },
  44667. copy: function(e) {
  44668. var t = e.index;
  44669. null !== t && this.setIndex(t.clone());
  44670. var i = e.attributes;
  44671. for (var n in i) {
  44672. var r = i[n];
  44673. this.addAttribute(n, r.clone())
  44674. }
  44675. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44676. var l = o[a];
  44677. this.addGroup(l.start, l.count)
  44678. }
  44679. return this
  44680. },
  44681. dispose: function() {
  44682. this.dispatchEvent({
  44683. type: "dispose"
  44684. })
  44685. }
  44686. },
  44687. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  44688. n.BufferGeometry.MaxIndex = 65535,
  44689. n.InstancedBufferGeometry = function() {
  44690. n.BufferGeometry.call(this),
  44691. this.type = "InstancedBufferGeometry",
  44692. this.maxInstancedCount = void 0
  44693. }
  44694. ,
  44695. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  44696. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  44697. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  44698. this.groups.push({
  44699. start: e,
  44700. count: t,
  44701. instances: i
  44702. })
  44703. }
  44704. ,
  44705. n.InstancedBufferGeometry.prototype.copy = function(e) {
  44706. var t = e.index;
  44707. null !== t && this.setIndex(t.clone());
  44708. var i = e.attributes;
  44709. for (var n in i) {
  44710. var r = i[n];
  44711. this.addAttribute(n, r.clone())
  44712. }
  44713. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  44714. var l = o[a];
  44715. this.addGroup(l.start, l.count, l.instances)
  44716. }
  44717. return this
  44718. }
  44719. ,
  44720. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  44721. n.Uniform = function(e, t) {
  44722. this.type = e,
  44723. this.value = t,
  44724. this.dynamic = !1
  44725. }
  44726. ,
  44727. n.Uniform.prototype = {
  44728. constructor: n.Uniform,
  44729. onUpdate: function(e) {
  44730. return this.dynamic = !0,
  44731. this.onUpdateCallback = e,
  44732. this
  44733. }
  44734. },
  44735. n.AnimationClip = function(e, t, i) {
  44736. this.name = e || n.Math.generateUUID(),
  44737. this.tracks = i,
  44738. this.duration = void 0 !== t ? t : -1,
  44739. this.duration < 0 && this.resetDuration(),
  44740. this.trim(),
  44741. this.optimize()
  44742. }
  44743. ,
  44744. n.AnimationClip.prototype = {
  44745. constructor: n.AnimationClip,
  44746. resetDuration: function() {
  44747. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  44748. var r = this.tracks[i];
  44749. t = Math.max(t, r.times[r.times.length - 1])
  44750. }
  44751. this.duration = t
  44752. },
  44753. trim: function() {
  44754. for (var e = 0; e < this.tracks.length; e++)
  44755. this.tracks[e].trim(0, this.duration);
  44756. return this
  44757. },
  44758. optimize: function() {
  44759. for (var e = 0; e < this.tracks.length; e++)
  44760. this.tracks[e].optimize();
  44761. return this
  44762. }
  44763. },
  44764. Object.assign(n.AnimationClip, {
  44765. parse: function(e) {
  44766. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  44767. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  44768. return new n.AnimationClip(e.name,e.duration,t)
  44769. },
  44770. toJSON: function(e) {
  44771. for (var t = [], i = e.tracks, r = {
  44772. name: e.name,
  44773. duration: e.duration,
  44774. tracks: t
  44775. }, o = 0, a = i.length; o !== a; ++o)
  44776. t.push(n.KeyframeTrack.toJSON(i[o]));
  44777. return r
  44778. },
  44779. CreateFromMorphTargetSequence: function(e, t, i) {
  44780. for (var r = t.length, o = [], a = 0; a < r; a++) {
  44781. var s = []
  44782. , l = [];
  44783. s.push((a + r - 1) % r, a, (a + 1) % r),
  44784. l.push(0, 1, 0);
  44785. var c = n.AnimationUtils.getKeyframeOrder(s);
  44786. s = n.AnimationUtils.sortedArray(s, 1, c),
  44787. l = n.AnimationUtils.sortedArray(l, 1, c),
  44788. 0 === s[0] && (s.push(r),
  44789. l.push(l[0])),
  44790. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  44791. }
  44792. return new n.AnimationClip(e,-1,o)
  44793. },
  44794. findByName: function(e, t) {
  44795. for (var i = 0; i < e.length; i++)
  44796. if (e[i].name === t)
  44797. return e[i];
  44798. return null
  44799. },
  44800. CreateClipsFromMorphTargetSequences: function(e, t) {
  44801. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  44802. var s = e[o]
  44803. , l = s.name.match(r);
  44804. if (l && l.length > 1) {
  44805. var c = l[1]
  44806. , h = i[c];
  44807. h || (i[c] = h = []),
  44808. h.push(s)
  44809. }
  44810. }
  44811. var u = [];
  44812. for (var c in i)
  44813. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  44814. return u
  44815. },
  44816. parseAnimation: function(e, t, i) {
  44817. if (!e)
  44818. return console.error(" no animation in JSONLoader data"),
  44819. null;
  44820. for (var r = function(e, t, i, r, o) {
  44821. if (0 !== i.length) {
  44822. var a = []
  44823. , s = [];
  44824. n.AnimationUtils.flattenJSON(i, a, s, r),
  44825. 0 !== a.length && o.push(new e(t,a,s))
  44826. }
  44827. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  44828. var u = c[h].keys;
  44829. if (u && 0 != u.length)
  44830. if (u[0].morphTargets) {
  44831. for (var d = {}, p = 0; p < u.length; p++)
  44832. if (u[p].morphTargets)
  44833. for (var f = 0; f < u[p].morphTargets.length; f++)
  44834. d[u[p].morphTargets[f]] = -1;
  44835. for (var g in d) {
  44836. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  44837. var A = u[p];
  44838. m.push(A.time),
  44839. v.push(A.morphTarget === g ? 1 : 0)
  44840. }
  44841. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  44842. }
  44843. s = d.length * (l || 1)
  44844. } else {
  44845. var y = ".bones[" + t[h].name + "]";
  44846. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  44847. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  44848. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  44849. }
  44850. }
  44851. if (0 === o.length)
  44852. return null;
  44853. var C = new n.AnimationClip(a,s,o);
  44854. return C
  44855. }
  44856. }),
  44857. n.AnimationMixer = function(e) {
  44858. this._root = e,
  44859. this._initMemoryManager(),
  44860. this._accuIndex = 0,
  44861. this.time = 0,
  44862. this.timeScale = 1
  44863. }
  44864. ,
  44865. n.AnimationMixer.prototype = {
  44866. constructor: n.AnimationMixer,
  44867. clipAction: function(e, t) {
  44868. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  44869. if (void 0 !== l) {
  44870. var c = l.actionByRoot[o];
  44871. if (void 0 !== c)
  44872. return c;
  44873. if (i = l.knownActions[0],
  44874. s = i._clip,
  44875. e !== a && e !== s)
  44876. throw new Error("Different clips with the same name detected!")
  44877. }
  44878. if (null === s)
  44879. return null;
  44880. var h = new n.AnimationMixer._Action(this,s,t);
  44881. return this._bindAction(h, i),
  44882. this._addInactiveAction(h, a, o),
  44883. h
  44884. },
  44885. existingAction: function(e, t) {
  44886. var i = t || this._root
  44887. , n = i.uuid
  44888. , r = "string" == typeof e ? e : e.name
  44889. , o = this._actionsByClip[r];
  44890. return void 0 !== o ? o.actionByRoot[n] || null : null
  44891. },
  44892. stopAllAction: function() {
  44893. var e = this._actions
  44894. , t = this._nActiveActions
  44895. , i = this._bindings
  44896. , n = this._nActiveBindings;
  44897. this._nActiveActions = 0,
  44898. this._nActiveBindings = 0;
  44899. for (var r = 0; r !== t; ++r)
  44900. e[r].reset();
  44901. for (var r = 0; r !== n; ++r)
  44902. i[r].useCount = 0;
  44903. return this
  44904. },
  44905. update: function(e) {
  44906. e *= this.timeScale;
  44907. for (var t = this._actions, i = this._nActiveActions, n = this.time += e, r = Math.sign(e), o = this._accuIndex ^= 1, a = 0; a !== i; ++a) {
  44908. var s = t[a];
  44909. s.enabled && s._update(n, e, r, o)
  44910. }
  44911. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  44912. l[a].apply(o);
  44913. return this
  44914. },
  44915. getRoot: function() {
  44916. return this._root
  44917. },
  44918. uncacheClip: function(e) {
  44919. var t = this._actions
  44920. , i = e.name
  44921. , n = this._actionsByClip
  44922. , r = n[i];
  44923. if (void 0 !== r) {
  44924. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  44925. var l = o[a];
  44926. this._deactivateAction(l);
  44927. var c = l._cacheIndex
  44928. , h = t[t.length - 1];
  44929. l._cacheIndex = null,
  44930. l._byClipCacheIndex = null,
  44931. h._cacheIndex = c,
  44932. t[c] = h,
  44933. t.pop(),
  44934. this._removeInactiveBindingsForAction(l)
  44935. }
  44936. delete n[i]
  44937. }
  44938. },
  44939. uncacheRoot: function(e) {
  44940. var t = e.uuid
  44941. , i = this._actionsByClip;
  44942. for (var n in i) {
  44943. var r = i[n].actionByRoot
  44944. , o = r[t];
  44945. void 0 !== o && (this._deactivateAction(o),
  44946. this._removeInactiveAction(o))
  44947. }
  44948. var a = this._bindingsByRootAndName
  44949. , s = a[t];
  44950. if (void 0 !== s)
  44951. for (var l in s) {
  44952. var c = s[l];
  44953. c.restoreOriginalState(),
  44954. this._removeInactiveBinding(c)
  44955. }
  44956. },
  44957. uncacheAction: function(e, t) {
  44958. var i = this.existingAction(e, t);
  44959. null !== i && (this._deactivateAction(i),
  44960. this._removeInactiveAction(i))
  44961. }
  44962. },
  44963. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  44964. n.AnimationMixer._Action = function(e, t, i) {
  44965. this._mixer = e,
  44966. this._clip = t,
  44967. this._localRoot = i || null;
  44968. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  44969. endingStart: n.ZeroCurvatureEnding,
  44970. endingEnd: n.ZeroCurvatureEnding
  44971. }, l = 0; l !== o; ++l) {
  44972. var c = r[l].createInterpolant(null);
  44973. a[l] = c,
  44974. c.settings = s
  44975. }
  44976. this._interpolantSettings = s,
  44977. this._interpolants = a,
  44978. this._propertyBindings = new Array(o),
  44979. this._cacheIndex = null,
  44980. this._byClipCacheIndex = null,
  44981. this._timeScaleInterpolant = null,
  44982. this._weightInterpolant = null,
  44983. this.loop = n.LoopRepeat,
  44984. this._loopCount = -1,
  44985. this._startTime = null,
  44986. this.time = 0,
  44987. this.timeScale = 1,
  44988. this._effectiveTimeScale = 1,
  44989. this.weight = 1,
  44990. this._effectiveWeight = 1,
  44991. this.repetitions = 1 / 0,
  44992. this.paused = !1,
  44993. this.enabled = !0,
  44994. this.clampWhenFinished = !1,
  44995. this.zeroSlopeAtStart = !0,
  44996. this.zeroSlopeAtEnd = !0
  44997. }
  44998. ,
  44999. n.AnimationMixer._Action.prototype = {
  45000. constructor: n.AnimationMixer._Action,
  45001. play: function() {
  45002. return this._mixer._activateAction(this),
  45003. this
  45004. },
  45005. stop: function() {
  45006. return this._mixer._deactivateAction(this),
  45007. this.reset()
  45008. },
  45009. reset: function() {
  45010. return this.paused = !1,
  45011. this.enabled = !0,
  45012. this.time = 0,
  45013. this._loopCount = -1,
  45014. this._startTime = null,
  45015. this.stopFading().stopWarping()
  45016. },
  45017. isRunning: function() {
  45018. this._startTime;
  45019. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45020. },
  45021. isScheduled: function() {
  45022. return this._mixer._isActiveAction(this)
  45023. },
  45024. startAt: function(e) {
  45025. return this._startTime = e,
  45026. this
  45027. },
  45028. setLoop: function(e, t) {
  45029. return this.loop = e,
  45030. this.repetitions = t,
  45031. this
  45032. },
  45033. setEffectiveWeight: function(e) {
  45034. return this.weight = e,
  45035. this._effectiveWeight = this.enabled ? e : 0,
  45036. this.stopFading()
  45037. },
  45038. getEffectiveWeight: function() {
  45039. return this._effectiveWeight
  45040. },
  45041. fadeIn: function(e) {
  45042. return this._scheduleFading(e, 0, 1)
  45043. },
  45044. fadeOut: function(e) {
  45045. return this._scheduleFading(e, 1, 0)
  45046. },
  45047. crossFadeFrom: function(e, t, i) {
  45048. this._mixer;
  45049. if (e.fadeOut(t),
  45050. this.fadeIn(t),
  45051. i) {
  45052. var n = this._clip.duration
  45053. , r = e._clip.duration
  45054. , o = r / n
  45055. , a = n / r;
  45056. e.warp(1, o, t),
  45057. this.warp(a, 1, t)
  45058. }
  45059. return this
  45060. },
  45061. crossFadeTo: function(e, t, i) {
  45062. return e.crossFadeFrom(this, t, i)
  45063. },
  45064. stopFading: function() {
  45065. var e = this._weightInterpolant;
  45066. return null !== e && (this._weightInterpolant = null,
  45067. this._mixer._takeBackControlInterpolant(e)),
  45068. this
  45069. },
  45070. setEffectiveTimeScale: function(e) {
  45071. return this.timeScale = e,
  45072. this._effectiveTimeScale = this.paused ? 0 : e,
  45073. this.stopWarping()
  45074. },
  45075. getEffectiveTimeScale: function() {
  45076. return this._effectiveTimeScale
  45077. },
  45078. setDuration: function(e) {
  45079. return this.timeScale = this._clip.duration / e,
  45080. this.stopWarping()
  45081. },
  45082. syncWith: function(e) {
  45083. return this.time = e.time,
  45084. this.timeScale = e.timeScale,
  45085. this.stopWarping()
  45086. },
  45087. halt: function(e) {
  45088. return this.warp(this._currentTimeScale, 0, e)
  45089. },
  45090. warp: function(e, t, i) {
  45091. var n = this._mixer
  45092. , r = n.time
  45093. , o = this._timeScaleInterpolant
  45094. , a = this.timeScale;
  45095. null === o && (o = n._lendControlInterpolant(),
  45096. this._timeScaleInterpolant = o);
  45097. var s = o.parameterPositions
  45098. , l = o.sampleValues;
  45099. return s[0] = r,
  45100. s[1] = r + i,
  45101. l[0] = e / a,
  45102. l[1] = t / a,
  45103. this
  45104. },
  45105. stopWarping: function() {
  45106. var e = this._timeScaleInterpolant;
  45107. return null !== e && (this._timeScaleInterpolant = null,
  45108. this._mixer._takeBackControlInterpolant(e)),
  45109. this
  45110. },
  45111. getMixer: function() {
  45112. return this._mixer
  45113. },
  45114. getClip: function() {
  45115. return this._clip
  45116. },
  45117. getRoot: function() {
  45118. return this._localRoot || this._mixer._root
  45119. },
  45120. _update: function(e, t, i, n) {
  45121. var r = this._startTime;
  45122. if (null !== r) {
  45123. var o = (e - r) * i;
  45124. if (o < 0 || 0 === i)
  45125. return;
  45126. this._startTime = null,
  45127. t = i * o
  45128. }
  45129. t *= this._updateTimeScale(e);
  45130. var a = this._updateTime(t)
  45131. , s = this._updateWeight(e);
  45132. if (s > 0)
  45133. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45134. l[h].evaluate(a),
  45135. c[h].accumulate(n, s)
  45136. },
  45137. _updateWeight: function(e) {
  45138. var t = 0;
  45139. if (this.enabled) {
  45140. t = this.weight;
  45141. var i = this._weightInterpolant;
  45142. if (null !== i) {
  45143. var n = i.evaluate(e)[0];
  45144. t *= n,
  45145. e > i.parameterPositions[1] && (this.stopFading(),
  45146. 0 === n && (this.enabled = !1))
  45147. }
  45148. }
  45149. return this._effectiveWeight = t,
  45150. t
  45151. },
  45152. _updateTimeScale: function(e) {
  45153. var t = 0;
  45154. if (!this.paused) {
  45155. t = this.timeScale;
  45156. var i = this._timeScaleInterpolant;
  45157. if (null !== i) {
  45158. var n = i.evaluate(e)[0];
  45159. t *= n,
  45160. e > i.parameterPositions[1] && (this.stopWarping(),
  45161. 0 === t ? this.pause = !0 : this.timeScale = t)
  45162. }
  45163. }
  45164. return this._effectiveTimeScale = t,
  45165. t
  45166. },
  45167. _updateTime: function(e) {
  45168. var t = this.time + e;
  45169. if (0 === e)
  45170. return t;
  45171. var i = this._clip.duration
  45172. , r = this.loop
  45173. , o = this._loopCount
  45174. , a = !1;
  45175. switch (r) {
  45176. case n.LoopOnce:
  45177. if (o === -1 && (this.loopCount = 0,
  45178. this._setEndings(!0, !0, !1)),
  45179. t >= i)
  45180. t = i;
  45181. else {
  45182. if (!(t < 0))
  45183. break;
  45184. t = 0
  45185. }
  45186. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  45187. this._mixer.dispatchEvent({
  45188. type: "finished",
  45189. action: this,
  45190. direction: e < 0 ? -1 : 1
  45191. });
  45192. break;
  45193. case n.LoopPingPong:
  45194. a = !0;
  45195. case n.LoopRepeat:
  45196. if (o === -1 && (e > 0 ? (o = 0,
  45197. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  45198. t >= i || t < 0) {
  45199. var s = Math.floor(t / i);
  45200. t -= i * s,
  45201. o += Math.abs(s);
  45202. var l = this.repetitions - o;
  45203. if (l < 0) {
  45204. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  45205. t = e > 0 ? i : 0,
  45206. this._mixer.dispatchEvent({
  45207. type: "finished",
  45208. action: this,
  45209. direction: e > 0 ? 1 : -1
  45210. });
  45211. break
  45212. }
  45213. if (0 === l) {
  45214. var c = e < 0;
  45215. this._setEndings(c, !c, a)
  45216. } else
  45217. this._setEndings(!1, !1, a);
  45218. this._loopCount = o,
  45219. this._mixer.dispatchEvent({
  45220. type: "loop",
  45221. action: this,
  45222. loopDelta: s
  45223. })
  45224. }
  45225. if (r === n.LoopPingPong && 1 === (1 & o))
  45226. return this.time = t,
  45227. i - t
  45228. }
  45229. return this.time = t,
  45230. t
  45231. },
  45232. _setEndings: function(e, t, i) {
  45233. var r = this._interpolantSettings;
  45234. i ? (r.endingStart = n.ZeroSlopeEnding,
  45235. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  45236. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  45237. },
  45238. _scheduleFading: function(e, t, i) {
  45239. var n = this._mixer
  45240. , r = n.time
  45241. , o = this._weightInterpolant;
  45242. null === o && (o = n._lendControlInterpolant(),
  45243. this._weightInterpolant = o);
  45244. var a = o.parameterPositions
  45245. , s = o.sampleValues;
  45246. return a[0] = r,
  45247. s[0] = t,
  45248. a[1] = r + e,
  45249. s[1] = i,
  45250. this
  45251. }
  45252. },
  45253. Object.assign(n.AnimationMixer.prototype, {
  45254. _bindAction: function(e, t) {
  45255. var i = e._localRoot || this._root
  45256. , r = e._clip.tracks
  45257. , o = r.length
  45258. , a = e._propertyBindings
  45259. , s = e._interpolants
  45260. , l = i.uuid
  45261. , c = this._bindingsByRootAndName
  45262. , h = c[l];
  45263. void 0 === h && (h = {},
  45264. c[l] = h);
  45265. for (var u = 0; u !== o; ++u) {
  45266. var d = r[u]
  45267. , p = d.name
  45268. , f = h[p];
  45269. if (void 0 !== f)
  45270. a[u] = f;
  45271. else {
  45272. if (f = a[u],
  45273. void 0 !== f) {
  45274. null === f._cacheIndex && (++f.referenceCount,
  45275. this._addInactiveBinding(f, l, p));
  45276. continue
  45277. }
  45278. var g = t && t._propertyBindings[u].binding.parsedPath;
  45279. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  45280. ++f.referenceCount,
  45281. this._addInactiveBinding(f, l, p),
  45282. a[u] = f
  45283. }
  45284. s[u].resultBuffer = f.buffer
  45285. }
  45286. },
  45287. _activateAction: function(e) {
  45288. if (!this._isActiveAction(e)) {
  45289. if (null === e._cacheIndex) {
  45290. var t = (e._localRoot || this._root).uuid
  45291. , i = e._clip.name
  45292. , n = this._actionsByClip[i];
  45293. this._bindAction(e, n && n.knownActions[0]),
  45294. this._addInactiveAction(e, i, t)
  45295. }
  45296. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  45297. var s = r[o];
  45298. 0 === s.useCount++ && (this._lendBinding(s),
  45299. s.saveOriginalState())
  45300. }
  45301. this._lendAction(e)
  45302. }
  45303. },
  45304. _deactivateAction: function(e) {
  45305. if (this._isActiveAction(e)) {
  45306. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45307. var r = t[i];
  45308. 0 === --r.useCount && (r.restoreOriginalState(),
  45309. this._takeBackBinding(r))
  45310. }
  45311. this._takeBackAction(e)
  45312. }
  45313. },
  45314. _initMemoryManager: function() {
  45315. this._actions = [],
  45316. this._nActiveActions = 0,
  45317. this._actionsByClip = {},
  45318. this._bindings = [],
  45319. this._nActiveBindings = 0,
  45320. this._bindingsByRootAndName = {},
  45321. this._controlInterpolants = [],
  45322. this._nActiveControlInterpolants = 0;
  45323. var e = this;
  45324. this.stats = {
  45325. actions: {
  45326. get total() {
  45327. return e._actions.length
  45328. },
  45329. get inUse() {
  45330. return e._nActiveActions
  45331. }
  45332. },
  45333. bindings: {
  45334. get total() {
  45335. return e._bindings.length
  45336. },
  45337. get inUse() {
  45338. return e._nActiveBindings
  45339. }
  45340. },
  45341. controlInterpolants: {
  45342. get total() {
  45343. return e._controlInterpolants.length
  45344. },
  45345. get inUse() {
  45346. return e._nActiveControlInterpolants
  45347. }
  45348. }
  45349. }
  45350. },
  45351. _isActiveAction: function(e) {
  45352. var t = e._cacheIndex;
  45353. return null !== t && t < this._nActiveActions
  45354. },
  45355. _addInactiveAction: function(e, t, i) {
  45356. var n = this._actions
  45357. , r = this._actionsByClip
  45358. , o = r[t];
  45359. if (void 0 === o)
  45360. o = {
  45361. knownActions: [e],
  45362. actionByRoot: {}
  45363. },
  45364. e._byClipCacheIndex = 0,
  45365. r[t] = o;
  45366. else {
  45367. var a = o.knownActions;
  45368. e._byClipCacheIndex = a.length,
  45369. a.push(e)
  45370. }
  45371. e._cacheIndex = n.length,
  45372. n.push(e),
  45373. o.actionByRoot[i] = e
  45374. },
  45375. _removeInactiveAction: function(e) {
  45376. var t = this._actions
  45377. , i = t[t.length - 1]
  45378. , n = e._cacheIndex;
  45379. i._cacheIndex = n,
  45380. t[n] = i,
  45381. t.pop(),
  45382. e._cacheIndex = null;
  45383. var r = e._clip.name
  45384. , o = this._actionsByClip
  45385. , a = o[r]
  45386. , s = a.knownActions
  45387. , l = s[s.length - 1]
  45388. , c = e._byClipCacheIndex;
  45389. l._byClipCacheIndex = c,
  45390. s[c] = l,
  45391. s.pop(),
  45392. e._byClipCacheIndex = null;
  45393. var h = a.actionByRoot
  45394. , u = (t._localRoot || this._root).uuid;
  45395. delete h[u],
  45396. 0 === s.length && delete o[r],
  45397. this._removeInactiveBindingsForAction(e)
  45398. },
  45399. _removeInactiveBindingsForAction: function(e) {
  45400. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45401. var r = t[i];
  45402. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  45403. }
  45404. },
  45405. _lendAction: function(e) {
  45406. var t = this._actions
  45407. , i = e._cacheIndex
  45408. , n = this._nActiveActions++
  45409. , r = t[n];
  45410. e._cacheIndex = n,
  45411. t[n] = e,
  45412. r._cacheIndex = i,
  45413. t[i] = r
  45414. },
  45415. _takeBackAction: function(e) {
  45416. var t = this._actions
  45417. , i = e._cacheIndex
  45418. , n = --this._nActiveActions
  45419. , r = t[n];
  45420. e._cacheIndex = n,
  45421. t[n] = e,
  45422. r._cacheIndex = i,
  45423. t[i] = r
  45424. },
  45425. _addInactiveBinding: function(e, t, i) {
  45426. var n = this._bindingsByRootAndName
  45427. , r = n[t]
  45428. , o = this._bindings;
  45429. void 0 === r && (r = {},
  45430. n[t] = r),
  45431. r[i] = e,
  45432. e._cacheIndex = o.length,
  45433. o.push(e)
  45434. },
  45435. _removeInactiveBinding: function(e) {
  45436. var t = this._bindings
  45437. , i = e.binding
  45438. , n = i.rootNode.uuid
  45439. , r = i.path
  45440. , o = this._bindingsByRootAndName
  45441. , a = o[n]
  45442. , s = t[t.length - 1]
  45443. , l = e._cacheIndex;
  45444. s._cacheIndex = l,
  45445. t[l] = s,
  45446. t.pop(),
  45447. delete a[r];
  45448. e: {
  45449. for (var c in a)
  45450. break e;
  45451. delete o[n]
  45452. }
  45453. },
  45454. _lendBinding: function(e) {
  45455. var t = this._bindings
  45456. , i = e._cacheIndex
  45457. , n = this._nActiveBindings++
  45458. , r = t[n];
  45459. e._cacheIndex = n,
  45460. t[n] = e,
  45461. r._cacheIndex = i,
  45462. t[i] = r
  45463. },
  45464. _takeBackBinding: function(e) {
  45465. var t = this._bindings
  45466. , i = e._cacheIndex
  45467. , n = --this._nActiveBindings
  45468. , r = t[n];
  45469. e._cacheIndex = n,
  45470. t[n] = e,
  45471. r._cacheIndex = i,
  45472. t[i] = r
  45473. },
  45474. _lendControlInterpolant: function() {
  45475. var e = this._controlInterpolants
  45476. , t = this._nActiveControlInterpolants++
  45477. , i = e[t];
  45478. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  45479. i.__cacheIndex = t,
  45480. e[t] = i),
  45481. i
  45482. },
  45483. _takeBackControlInterpolant: function(e) {
  45484. var t = this._controlInterpolants
  45485. , i = e.__cacheIndex
  45486. , n = --this._nActiveControlInterpolants
  45487. , r = t[n];
  45488. e.__cacheIndex = n,
  45489. t[n] = e,
  45490. r.__cacheIndex = i,
  45491. t[i] = r
  45492. },
  45493. _controlInterpolantsResultBuffer: new Float32Array(1)
  45494. }),
  45495. n.AnimationObjectGroup = function(e) {
  45496. this.uuid = n.Math.generateUUID(),
  45497. this._objects = Array.prototype.slice.call(arguments),
  45498. this.nCachedObjects_ = 0;
  45499. var t = {};
  45500. this._indicesByUUID = t;
  45501. for (var i = 0, r = arguments.length; i !== r; ++i)
  45502. t[arguments[i].uuid] = i;
  45503. this._paths = [],
  45504. this._parsedPaths = [],
  45505. this._bindings = [],
  45506. this._bindingsIndicesByPath = {};
  45507. var o = this;
  45508. this.stats = {
  45509. objects: {
  45510. get total() {
  45511. return o._objects.length
  45512. },
  45513. get inUse() {
  45514. return this.total - o.nCachedObjects_
  45515. }
  45516. },
  45517. get bindingsPerObject() {
  45518. return o._bindings.length
  45519. }
  45520. }
  45521. }
  45522. ,
  45523. n.AnimationObjectGroup.prototype = {
  45524. constructor: n.AnimationObjectGroup,
  45525. add: function(e) {
  45526. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  45527. var d = arguments[h]
  45528. , p = d.uuid
  45529. , f = o[p];
  45530. if (void 0 === f) {
  45531. f = i++,
  45532. o[p] = f,
  45533. t.push(d);
  45534. for (var g = 0, m = c; g !== m; ++g)
  45535. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  45536. } else if (f < r) {
  45537. var v = t[f]
  45538. , A = --r
  45539. , y = t[A];
  45540. o[y.uuid] = f,
  45541. t[f] = y,
  45542. o[p] = A,
  45543. t[A] = d;
  45544. for (var g = 0, m = c; g !== m; ++g) {
  45545. var C = l[g]
  45546. , I = C[A]
  45547. , E = C[f];
  45548. C[f] = I,
  45549. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  45550. C[A] = E
  45551. }
  45552. } else
  45553. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  45554. }
  45555. this.nCachedObjects_ = r
  45556. },
  45557. remove: function(e) {
  45558. for (var t = this._objects, i = (t.length,
  45559. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  45560. var l = arguments[a]
  45561. , c = l.uuid
  45562. , h = n[c];
  45563. if (void 0 !== h && h >= i) {
  45564. var u = i++
  45565. , d = t[u];
  45566. n[d.uuid] = h,
  45567. t[h] = d,
  45568. n[c] = u,
  45569. t[u] = l;
  45570. for (var p = 0, f = o; p !== f; ++p) {
  45571. var g = r[p]
  45572. , m = g[u]
  45573. , v = g[h];
  45574. g[h] = m,
  45575. g[u] = v
  45576. }
  45577. }
  45578. }
  45579. this.nCachedObjects_ = i
  45580. },
  45581. uncache: function(e) {
  45582. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._bindings, a = o.length, s = 0, l = arguments.length; s !== l; ++s) {
  45583. var c = arguments[s]
  45584. , h = c.uuid
  45585. , u = r[h];
  45586. if (void 0 !== u)
  45587. if (delete r[h],
  45588. u < n) {
  45589. var d = --n
  45590. , p = t[d]
  45591. , f = --i
  45592. , g = t[f];
  45593. r[p.uuid] = u,
  45594. t[u] = p,
  45595. r[g.uuid] = d,
  45596. t[d] = g,
  45597. t.pop();
  45598. for (var m = 0, v = a; m !== v; ++m) {
  45599. var A = o[m]
  45600. , y = A[d]
  45601. , C = A[f];
  45602. A[u] = y,
  45603. A[d] = C,
  45604. A.pop()
  45605. }
  45606. } else {
  45607. var f = --i
  45608. , g = t[f];
  45609. r[g.uuid] = u,
  45610. t[u] = g,
  45611. t.pop();
  45612. for (var m = 0, v = a; m !== v; ++m) {
  45613. var A = o[m];
  45614. A[u] = A[f],
  45615. A.pop()
  45616. }
  45617. }
  45618. }
  45619. this.nCachedObjects_ = n
  45620. },
  45621. subscribe_: function(e, t) {
  45622. var i = this._bindingsIndicesByPath
  45623. , r = i[e]
  45624. , o = this._bindings;
  45625. if (void 0 !== r)
  45626. return o[r];
  45627. var a = this._paths
  45628. , s = this._parsedPaths
  45629. , l = this._objects
  45630. , c = l.length
  45631. , h = this.nCachedObjects_
  45632. , u = new Array(c);
  45633. r = o.length,
  45634. i[e] = r,
  45635. a.push(e),
  45636. s.push(t),
  45637. o.push(u);
  45638. for (var d = h, p = l.length; d !== p; ++d) {
  45639. var f = l[d];
  45640. u[d] = new n.PropertyBinding(f,e,t)
  45641. }
  45642. return u
  45643. },
  45644. unsubscribe_: function(e) {
  45645. var t = this._bindingsIndicesByPath
  45646. , i = t[e];
  45647. if (void 0 !== i) {
  45648. var n = this._paths
  45649. , r = this._parsedPaths
  45650. , o = this._bindings
  45651. , a = o.length - 1
  45652. , s = o[a]
  45653. , l = e[a];
  45654. t[l] = i,
  45655. o[i] = s,
  45656. o.pop(),
  45657. r[i] = r[a],
  45658. r.pop(),
  45659. n[i] = n[a],
  45660. n.pop()
  45661. }
  45662. }
  45663. },
  45664. n.AnimationUtils = {
  45665. arraySlice: function(e, t, i) {
  45666. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  45667. },
  45668. convertArray: function(e, t, i) {
  45669. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  45670. },
  45671. isTypedArray: function(e) {
  45672. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  45673. },
  45674. getKeyframeOrder: function(e) {
  45675. function t(t, i) {
  45676. return e[t] - e[i]
  45677. }
  45678. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  45679. n[r] = r;
  45680. return n.sort(t),
  45681. n
  45682. },
  45683. sortedArray: function(e, t, i) {
  45684. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  45685. for (var s = i[o] * t, l = 0; l !== t; ++l)
  45686. r[a++] = e[s + l];
  45687. return r
  45688. },
  45689. flattenJSON: function(e, t, i, n) {
  45690. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  45691. o = e[r++];
  45692. if (void 0 !== o) {
  45693. var a = o[n];
  45694. if (void 0 !== a)
  45695. if (Array.isArray(a)) {
  45696. do
  45697. a = o[n],
  45698. void 0 !== a && (t.push(o.time),
  45699. i.push.apply(i, a)),
  45700. o = e[r++];
  45701. while (void 0 !== o)
  45702. } else if (void 0 !== a.toArray) {
  45703. do
  45704. a = o[n],
  45705. void 0 !== a && (t.push(o.time),
  45706. a.toArray(i, i.length)),
  45707. o = e[r++];
  45708. while (void 0 !== o)
  45709. } else
  45710. do
  45711. a = o[n],
  45712. void 0 !== a && (t.push(o.time),
  45713. i.push(a)),
  45714. o = e[r++];
  45715. while (void 0 !== o)
  45716. }
  45717. }
  45718. },
  45719. n.KeyframeTrack = function(e, t, i, r) {
  45720. if (void 0 === e)
  45721. throw new Error("track name is undefined");
  45722. if (void 0 === t || 0 === t.length)
  45723. throw new Error("no keyframes in track named " + e);
  45724. this.name = e,
  45725. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  45726. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  45727. this.setInterpolation(r || this.DefaultInterpolation),
  45728. this.validate(),
  45729. this.optimize()
  45730. }
  45731. ,
  45732. n.KeyframeTrack.prototype = {
  45733. constructor: n.KeyframeTrack,
  45734. TimeBufferType: Float32Array,
  45735. ValueBufferType: Float32Array,
  45736. DefaultInterpolation: n.InterpolateLinear,
  45737. InterpolantFactoryMethodDiscrete: function(e) {
  45738. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  45739. },
  45740. InterpolantFactoryMethodLinear: function(e) {
  45741. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  45742. },
  45743. InterpolantFactoryMethodSmooth: function(e) {
  45744. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  45745. },
  45746. setInterpolation: function(e) {
  45747. var t = void 0;
  45748. switch (e) {
  45749. case n.InterpolateDiscrete:
  45750. t = this.InterpolantFactoryMethodDiscrete;
  45751. break;
  45752. case n.InterpolateLinear:
  45753. t = this.InterpolantFactoryMethodLinear;
  45754. break;
  45755. case n.InterpolateSmooth:
  45756. t = this.InterpolantFactoryMethodSmooth
  45757. }
  45758. if (void 0 === t) {
  45759. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  45760. if (void 0 === this.createInterpolant) {
  45761. if (e === this.DefaultInterpolation)
  45762. throw new Error(i);
  45763. this.setInterpolation(this.DefaultInterpolation)
  45764. }
  45765. return void console.warn(i)
  45766. }
  45767. this.createInterpolant = t
  45768. },
  45769. getInterpolation: function() {
  45770. switch (this.createInterpolant) {
  45771. case this.InterpolantFactoryMethodDiscrete:
  45772. return n.InterpolateDiscrete;
  45773. case this.InterpolantFactoryMethodLinear:
  45774. return n.InterpolateLinear;
  45775. case this.InterpolantFactoryMethodSmooth:
  45776. return n.InterpolateSmooth
  45777. }
  45778. },
  45779. getValueSize: function() {
  45780. return this.values.length / this.times.length
  45781. },
  45782. shift: function(e) {
  45783. if (0 !== e)
  45784. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45785. t[i] += e;
  45786. return this
  45787. },
  45788. scale: function(e) {
  45789. if (1 !== e)
  45790. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  45791. t[i] *= e;
  45792. return this
  45793. },
  45794. trim: function(e, t) {
  45795. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  45796. ++o;
  45797. for (; a !== -1 && i[a] > t; )
  45798. --a;
  45799. if (++a,
  45800. 0 !== o || a !== r) {
  45801. o >= a && (a = Math.max(a, 1),
  45802. o = a - 1);
  45803. var s = this.getValueSize();
  45804. this.times = n.AnimationUtils.arraySlice(i, o, a),
  45805. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  45806. }
  45807. return this
  45808. },
  45809. validate: function() {
  45810. var e = !0
  45811. , t = this.getValueSize();
  45812. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  45813. e = !1);
  45814. var i = this.times
  45815. , r = this.values
  45816. , o = i.length;
  45817. 0 === o && (console.error("track is empty", this),
  45818. e = !1);
  45819. for (var a = null, s = 0; s !== o; s++) {
  45820. var l = i[s];
  45821. if ("number" == typeof l && isNaN(l)) {
  45822. console.error("time is not a valid number", this, s, l),
  45823. e = !1;
  45824. break
  45825. }
  45826. if (null !== a && a > l) {
  45827. console.error("out of order keys", this, s, l, a),
  45828. e = !1;
  45829. break
  45830. }
  45831. a = l
  45832. }
  45833. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  45834. for (var s = 0, c = r.length; s !== c; ++s) {
  45835. var h = r[s];
  45836. if (isNaN(h)) {
  45837. console.error("value is not a valid number", this, s, h),
  45838. e = !1;
  45839. break
  45840. }
  45841. }
  45842. return e
  45843. },
  45844. optimize: function() {
  45845. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  45846. var s = !1
  45847. , l = e[o]
  45848. , c = e[o + 1];
  45849. if (l !== c && (1 !== o || l !== l[0]))
  45850. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  45851. var f = t[h + p];
  45852. if (f !== t[u + p] || f !== t[d + p]) {
  45853. s = !0;
  45854. break
  45855. }
  45856. }
  45857. if (s) {
  45858. if (o !== r) {
  45859. e[r] = e[o];
  45860. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  45861. t[m + p] = t[g + p]
  45862. }
  45863. ++r
  45864. }
  45865. }
  45866. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  45867. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  45868. this
  45869. }
  45870. },
  45871. Object.assign(n.KeyframeTrack, {
  45872. parse: function(e) {
  45873. if (void 0 === e.type)
  45874. throw new Error("track type undefined, can not parse");
  45875. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  45876. if (void 0 === e.times) {
  45877. console.warn("legacy JSON format detected, converting");
  45878. var i = []
  45879. , r = [];
  45880. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  45881. e.times = i,
  45882. e.values = r
  45883. }
  45884. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  45885. },
  45886. toJSON: function(e) {
  45887. var t, i = e.constructor;
  45888. if (void 0 !== i.toJSON)
  45889. t = i.toJSON(e);
  45890. else {
  45891. t = {
  45892. name: e.name,
  45893. times: n.AnimationUtils.convertArray(e.times, Array),
  45894. values: n.AnimationUtils.convertArray(e.values, Array)
  45895. };
  45896. var r = e.getInterpolation();
  45897. r !== e.DefaultInterpolation && (t.interpolation = r)
  45898. }
  45899. return t.type = e.ValueTypeName,
  45900. t
  45901. },
  45902. _getTrackTypeForValueTypeName: function(e) {
  45903. switch (e.toLowerCase()) {
  45904. case "scalar":
  45905. case "double":
  45906. case "float":
  45907. case "number":
  45908. case "integer":
  45909. return n.NumberKeyframeTrack;
  45910. case "vector":
  45911. case "vector2":
  45912. case "vector3":
  45913. case "vector4":
  45914. return n.VectorKeyframeTrack;
  45915. case "color":
  45916. return n.ColorKeyframeTrack;
  45917. case "quaternion":
  45918. return n.QuaternionKeyframeTrack;
  45919. case "bool":
  45920. case "boolean":
  45921. return n.BooleanKeyframeTrack;
  45922. case "string":
  45923. return n.StringKeyframeTrack
  45924. }
  45925. throw new Error("Unsupported typeName: " + e)
  45926. }
  45927. }),
  45928. n.PropertyBinding = function(e, t, i) {
  45929. this.path = t,
  45930. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  45931. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  45932. this.rootNode = e
  45933. }
  45934. ,
  45935. n.PropertyBinding.prototype = {
  45936. constructor: n.PropertyBinding,
  45937. getValue: function(e, t) {
  45938. this.bind(),
  45939. this.getValue(e, t)
  45940. },
  45941. setValue: function(e, t) {
  45942. this.bind(),
  45943. this.setValue(e, t)
  45944. },
  45945. bind: function() {
  45946. var e = this.node
  45947. , t = this.parsedPath
  45948. , i = t.objectName
  45949. , r = t.propertyName
  45950. , o = t.propertyIndex;
  45951. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  45952. this.node = e),
  45953. this.getValue = this._getValue_unavailable,
  45954. this.setValue = this._setValue_unavailable,
  45955. !e)
  45956. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  45957. if (i) {
  45958. var a = t.objectIndex;
  45959. switch (i) {
  45960. case "materials":
  45961. if (!e.material)
  45962. return void console.error(" can not bind to material as node does not have a material", this);
  45963. if (!e.material.materials)
  45964. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  45965. e = e.material.materials;
  45966. break;
  45967. case "bones":
  45968. if (!e.skeleton)
  45969. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  45970. e = e.skeleton.bones;
  45971. for (var s = 0; s < e.length; s++)
  45972. if (e[s].name === a) {
  45973. a = s;
  45974. break
  45975. }
  45976. break;
  45977. default:
  45978. if (void 0 === e[i])
  45979. return void console.error(" can not bind to objectName of node, undefined", this);
  45980. e = e[i]
  45981. }
  45982. if (void 0 !== a) {
  45983. if (void 0 === e[a])
  45984. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  45985. e = e[a]
  45986. }
  45987. }
  45988. var l = e[r];
  45989. if (!l) {
  45990. var c = t.nodeName;
  45991. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  45992. }
  45993. var h = this.Versioning.None;
  45994. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  45995. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  45996. this.targetObject = e);
  45997. var u = this.BindingType.Direct;
  45998. if (void 0 !== o) {
  45999. if ("morphTargetInfluences" === r) {
  46000. if (!e.geometry)
  46001. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46002. if (!e.geometry.morphTargets)
  46003. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46004. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46005. if (e.geometry.morphTargets[s].name === o) {
  46006. o = s;
  46007. break
  46008. }
  46009. }
  46010. u = this.BindingType.ArrayElement,
  46011. this.resolvedProperty = l,
  46012. this.propertyIndex = o
  46013. } else
  46014. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46015. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46016. this.resolvedProperty = l) : this.propertyName = r;
  46017. this.getValue = this.GetterByBindingType[u],
  46018. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46019. },
  46020. unbind: function() {
  46021. this.node = null,
  46022. this.getValue = this._getValue_unbound,
  46023. this.setValue = this._setValue_unbound
  46024. }
  46025. },
  46026. Object.assign(n.PropertyBinding.prototype, {
  46027. _getValue_unavailable: function() {},
  46028. _setValue_unavailable: function() {},
  46029. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46030. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46031. BindingType: {
  46032. Direct: 0,
  46033. EntireArray: 1,
  46034. ArrayElement: 2,
  46035. HasFromToArray: 3
  46036. },
  46037. Versioning: {
  46038. None: 0,
  46039. NeedsUpdate: 1,
  46040. MatrixWorldNeedsUpdate: 2
  46041. },
  46042. GetterByBindingType: [function(e, t) {
  46043. e[t] = this.node[this.propertyName]
  46044. }
  46045. , function(e, t) {
  46046. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46047. e[t++] = i[n]
  46048. }
  46049. , function(e, t) {
  46050. e[t] = this.resolvedProperty[this.propertyIndex]
  46051. }
  46052. , function(e, t) {
  46053. this.resolvedProperty.toArray(e, t)
  46054. }
  46055. ],
  46056. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46057. this.node[this.propertyName] = e[t]
  46058. }
  46059. , function(e, t) {
  46060. this.node[this.propertyName] = e[t],
  46061. this.targetObject.needsUpdate = !0
  46062. }
  46063. , function(e, t) {
  46064. this.node[this.propertyName] = e[t],
  46065. this.targetObject.matrixWorldNeedsUpdate = !0
  46066. }
  46067. ], [function(e, t) {
  46068. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46069. i[n] = e[t++]
  46070. }
  46071. , function(e, t) {
  46072. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46073. i[n] = e[t++];
  46074. this.targetObject.needsUpdate = !0
  46075. }
  46076. , function(e, t) {
  46077. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46078. i[n] = e[t++];
  46079. this.targetObject.matrixWorldNeedsUpdate = !0
  46080. }
  46081. ], [function(e, t) {
  46082. this.resolvedProperty[this.propertyIndex] = e[t]
  46083. }
  46084. , function(e, t) {
  46085. this.resolvedProperty[this.propertyIndex] = e[t],
  46086. this.targetObject.needsUpdate = !0
  46087. }
  46088. , function(e, t) {
  46089. this.resolvedProperty[this.propertyIndex] = e[t],
  46090. this.targetObject.matrixWorldNeedsUpdate = !0
  46091. }
  46092. ], [function(e, t) {
  46093. this.resolvedProperty.fromArray(e, t)
  46094. }
  46095. , function(e, t) {
  46096. this.resolvedProperty.fromArray(e, t),
  46097. this.targetObject.needsUpdate = !0
  46098. }
  46099. , function(e, t) {
  46100. this.resolvedProperty.fromArray(e, t),
  46101. this.targetObject.matrixWorldNeedsUpdate = !0
  46102. }
  46103. ]]
  46104. }),
  46105. n.PropertyBinding.Composite = function(e, t, i) {
  46106. var r = i || n.PropertyBinding.parseTrackName(t);
  46107. this._targetGroup = e,
  46108. this._bindings = e.subscribe_(t, r)
  46109. }
  46110. ,
  46111. n.PropertyBinding.Composite.prototype = {
  46112. constructor: n.PropertyBinding.Composite,
  46113. getValue: function(e, t) {
  46114. this.bind();
  46115. var i = this._targetGroup.nCachedObjects_
  46116. , n = this._bindings[i];
  46117. void 0 !== n && n.getValue(e, t)
  46118. },
  46119. setValue: function(e, t) {
  46120. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46121. i[n].setValue(e, t)
  46122. },
  46123. bind: function() {
  46124. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46125. e[t].bind()
  46126. },
  46127. unbind: function() {
  46128. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46129. e[t].unbind()
  46130. }
  46131. },
  46132. n.PropertyBinding.create = function(e, t, i) {
  46133. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46134. }
  46135. ,
  46136. n.PropertyBinding.parseTrackName = function(e) {
  46137. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46138. , i = t.exec(e);
  46139. if (!i)
  46140. throw new Error("cannot parse trackName at all: " + e);
  46141. i.index === t.lastIndex && t.lastIndex++;
  46142. var n = {
  46143. nodeName: i[3],
  46144. objectName: i[5],
  46145. objectIndex: i[7],
  46146. propertyName: i[9],
  46147. propertyIndex: i[11]
  46148. };
  46149. if (null === n.propertyName || 0 === n.propertyName.length)
  46150. throw new Error("can not parse propertyName from trackName: " + e);
  46151. return n
  46152. }
  46153. ,
  46154. n.PropertyBinding.findNode = function(e, t) {
  46155. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46156. return e;
  46157. if (e.skeleton) {
  46158. var i = function(e) {
  46159. for (var i = 0; i < e.bones.length; i++) {
  46160. var n = e.bones[i];
  46161. if (n.name === t)
  46162. return n
  46163. }
  46164. return null
  46165. }
  46166. , n = i(e.skeleton);
  46167. if (n)
  46168. return n
  46169. }
  46170. if (e.children) {
  46171. var r = function(e) {
  46172. for (var i = 0; i < e.length; i++) {
  46173. var n = e[i];
  46174. if (n.name === t || n.uuid === t)
  46175. return n;
  46176. var o = r(n.children);
  46177. if (o)
  46178. return o
  46179. }
  46180. return null
  46181. }
  46182. , o = r(e.children);
  46183. if (o)
  46184. return o
  46185. }
  46186. return null
  46187. }
  46188. ,
  46189. n.PropertyMixer = function(e, t, i) {
  46190. this.binding = e,
  46191. this.valueSize = i;
  46192. var n, r = Float64Array;
  46193. switch (t) {
  46194. case "quaternion":
  46195. n = this._slerp;
  46196. break;
  46197. case "string":
  46198. case "bool":
  46199. r = Array,
  46200. n = this._select;
  46201. break;
  46202. default:
  46203. n = this._lerp
  46204. }
  46205. this.buffer = new r(4 * i),
  46206. this._mixBufferRegion = n,
  46207. this.cumulativeWeight = 0,
  46208. this.useCount = 0,
  46209. this.referenceCount = 0
  46210. }
  46211. ,
  46212. n.PropertyMixer.prototype = {
  46213. constructor: n.PropertyMixer,
  46214. accumulate: function(e, t) {
  46215. var i = this.buffer
  46216. , n = this.valueSize
  46217. , r = e * n + n
  46218. , o = this.cumulativeWeight;
  46219. if (0 === o) {
  46220. for (var a = 0; a !== n; ++a)
  46221. i[r + a] = i[a];
  46222. o = t
  46223. } else {
  46224. o += t;
  46225. var s = t / o;
  46226. this._mixBufferRegion(i, r, 0, s, n)
  46227. }
  46228. this.cumulativeWeight = o
  46229. },
  46230. apply: function(e) {
  46231. var t = this.valueSize
  46232. , i = this.buffer
  46233. , n = e * t + t
  46234. , r = this.cumulativeWeight
  46235. , o = this.binding;
  46236. if (this.cumulativeWeight = 0,
  46237. r < 1) {
  46238. var a = 3 * t;
  46239. this._mixBufferRegion(i, n, a, 1 - r, t)
  46240. }
  46241. for (var s = t, l = t + t; s !== l; ++s)
  46242. if (i[s] !== i[s + t]) {
  46243. o.setValue(i, n);
  46244. break
  46245. }
  46246. },
  46247. saveOriginalState: function() {
  46248. var e = this.binding
  46249. , t = this.buffer
  46250. , i = this.valueSize
  46251. , n = 3 * i;
  46252. e.getValue(t, n);
  46253. for (var r = i, o = n; r !== o; ++r)
  46254. t[r] = t[n + r % i];
  46255. this.cumulativeWeight = 0
  46256. },
  46257. restoreOriginalState: function() {
  46258. var e = 3 * this.valueSize;
  46259. this.binding.setValue(this.buffer, e)
  46260. },
  46261. _select: function(e, t, i, n, r) {
  46262. if (n >= .5)
  46263. for (var o = 0; o !== r; ++o)
  46264. e[t + o] = e[i + o]
  46265. },
  46266. _slerp: function(e, t, i, r, o) {
  46267. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  46268. },
  46269. _lerp: function(e, t, i, n, r) {
  46270. for (var o = 1 - n, a = 0; a !== r; ++a) {
  46271. var s = t + a;
  46272. e[s] = e[s] * o + e[i + a] * n
  46273. }
  46274. }
  46275. },
  46276. n.BooleanKeyframeTrack = function(e, t, i) {
  46277. n.KeyframeTrack.call(this, e, t, i)
  46278. }
  46279. ,
  46280. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46281. constructor: n.BooleanKeyframeTrack,
  46282. ValueTypeName: "bool",
  46283. ValueBufferType: Array,
  46284. DefaultInterpolation: n.IntepolateDiscrete,
  46285. InterpolantFactoryMethodLinear: void 0,
  46286. InterpolantFactoryMethodSmooth: void 0
  46287. }),
  46288. n.NumberKeyframeTrack = function(e, t, i, r) {
  46289. n.KeyframeTrack.call(this, e, t, i, r)
  46290. }
  46291. ,
  46292. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46293. constructor: n.NumberKeyframeTrack,
  46294. ValueTypeName: "number"
  46295. }),
  46296. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  46297. n.KeyframeTrack.call(this, e, t, i, r)
  46298. }
  46299. ,
  46300. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46301. constructor: n.QuaternionKeyframeTrack,
  46302. ValueTypeName: "quaternion",
  46303. DefaultInterpolation: n.InterpolateLinear,
  46304. InterpolantFactoryMethodLinear: function(e) {
  46305. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46306. },
  46307. InterpolantFactoryMethodSmooth: void 0
  46308. }),
  46309. n.StringKeyframeTrack = function(e, t, i, r) {
  46310. n.KeyframeTrack.call(this, e, t, i, r)
  46311. }
  46312. ,
  46313. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46314. constructor: n.StringKeyframeTrack,
  46315. ValueTypeName: "string",
  46316. ValueBufferType: Array,
  46317. DefaultInterpolation: n.IntepolateDiscrete,
  46318. InterpolantFactoryMethodLinear: void 0,
  46319. InterpolantFactoryMethodSmooth: void 0
  46320. }),
  46321. n.VectorKeyframeTrack = function(e, t, i, r) {
  46322. n.KeyframeTrack.call(this, e, t, i, r)
  46323. }
  46324. ,
  46325. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46326. constructor: n.VectorKeyframeTrack,
  46327. ValueTypeName: "vector"
  46328. }),
  46329. n.Audio = function(e) {
  46330. n.Object3D.call(this),
  46331. this.type = "Audio",
  46332. this.context = e.context,
  46333. this.source = this.context.createBufferSource(),
  46334. this.source.onended = this.onEnded.bind(this),
  46335. this.gain = this.context.createGain(),
  46336. this.gain.connect(e.getInput()),
  46337. this.autoplay = !1,
  46338. this.startTime = 0,
  46339. this.playbackRate = 1,
  46340. this.isPlaying = !1,
  46341. this.hasPlaybackControl = !0,
  46342. this.sourceType = "empty",
  46343. this.filter = null
  46344. }
  46345. ,
  46346. n.Audio.prototype = Object.create(n.Object3D.prototype),
  46347. n.Audio.prototype.constructor = n.Audio,
  46348. n.Audio.prototype.getOutput = function() {
  46349. return this.gain
  46350. }
  46351. ,
  46352. n.Audio.prototype.load = function(e) {
  46353. var t = new n.AudioBuffer(this.context);
  46354. return t.load(e),
  46355. this.setBuffer(t),
  46356. this
  46357. }
  46358. ,
  46359. n.Audio.prototype.setNodeSource = function(e) {
  46360. return this.hasPlaybackControl = !1,
  46361. this.sourceType = "audioNode",
  46362. this.source = e,
  46363. this.connect(),
  46364. this
  46365. }
  46366. ,
  46367. n.Audio.prototype.setBuffer = function(e) {
  46368. var t = this;
  46369. return e.onReady(function(e) {
  46370. t.source.buffer = e,
  46371. t.sourceType = "buffer",
  46372. t.autoplay && t.play()
  46373. }),
  46374. this
  46375. }
  46376. ,
  46377. n.Audio.prototype.play = function() {
  46378. if (this.isPlaying === !0)
  46379. return void console.warn("THREE.Audio: Audio is already playing.");
  46380. if (this.hasPlaybackControl === !1)
  46381. return void console.warn("THREE.Audio: this Audio has no playback control.");
  46382. var e = this.context.createBufferSource();
  46383. e.buffer = this.source.buffer,
  46384. e.loop = this.source.loop,
  46385. e.onended = this.source.onended,
  46386. e.start(0, this.startTime),
  46387. e.playbackRate.value = this.playbackRate,
  46388. this.isPlaying = !0,
  46389. this.source = e,
  46390. this.connect()
  46391. }
  46392. ,
  46393. n.Audio.prototype.pause = function() {
  46394. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46395. void (this.startTime = this.context.currentTime))
  46396. }
  46397. ,
  46398. n.Audio.prototype.stop = function() {
  46399. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46400. void (this.startTime = 0))
  46401. }
  46402. ,
  46403. n.Audio.prototype.connect = function() {
  46404. null !== this.filter ? (this.source.connect(this.filter),
  46405. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  46406. }
  46407. ,
  46408. n.Audio.prototype.disconnect = function() {
  46409. null !== this.filter ? (this.source.disconnect(this.filter),
  46410. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  46411. }
  46412. ,
  46413. n.Audio.prototype.getFilter = function() {
  46414. return this.filter
  46415. }
  46416. ,
  46417. n.Audio.prototype.setFilter = function(e) {
  46418. void 0 === e && (e = null),
  46419. this.isPlaying === !0 ? (this.disconnect(),
  46420. this.filter = e,
  46421. this.connect()) : this.filter = e
  46422. }
  46423. ,
  46424. n.Audio.prototype.setPlaybackRate = function(e) {
  46425. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  46426. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  46427. }
  46428. ,
  46429. n.Audio.prototype.getPlaybackRate = function() {
  46430. return this.playbackRate
  46431. }
  46432. ,
  46433. n.Audio.prototype.onEnded = function() {
  46434. this.isPlaying = !1
  46435. }
  46436. ,
  46437. n.Audio.prototype.setLoop = function(e) {
  46438. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  46439. }
  46440. ,
  46441. n.Audio.prototype.getLoop = function() {
  46442. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  46443. !1) : this.source.loop
  46444. }
  46445. ,
  46446. n.Audio.prototype.setVolume = function(e) {
  46447. this.gain.gain.value = e
  46448. }
  46449. ,
  46450. n.Audio.prototype.getVolume = function() {
  46451. return this.gain.gain.value
  46452. }
  46453. ,
  46454. n.AudioAnalyser = function(e, t) {
  46455. this.analyser = e.context.createAnalyser(),
  46456. this.analyser.fftSize = void 0 !== t ? t : 2048,
  46457. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  46458. e.getOutput().connect(this.analyser)
  46459. }
  46460. ,
  46461. n.AudioAnalyser.prototype = {
  46462. constructor: n.AudioAnalyser,
  46463. getData: function() {
  46464. return this.analyser.getByteFrequencyData(this.data),
  46465. this.data
  46466. }
  46467. },
  46468. n.AudioBuffer = function(e) {
  46469. this.context = e,
  46470. this.ready = !1,
  46471. this.readyCallbacks = []
  46472. }
  46473. ,
  46474. n.AudioBuffer.prototype.load = function(e) {
  46475. var t = this
  46476. , i = new XMLHttpRequest;
  46477. return i.open("GET", e, !0),
  46478. i.responseType = "arraybuffer",
  46479. i.onload = function(e) {
  46480. t.context.decodeAudioData(this.response, function(e) {
  46481. t.buffer = e,
  46482. t.ready = !0;
  46483. for (var i = 0; i < t.readyCallbacks.length; i++)
  46484. t.readyCallbacks[i](t.buffer);
  46485. t.readyCallbacks = []
  46486. })
  46487. }
  46488. ,
  46489. i.send(),
  46490. this
  46491. }
  46492. ,
  46493. n.AudioBuffer.prototype.onReady = function(e) {
  46494. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  46495. }
  46496. ,
  46497. n.PositionalAudio = function(e) {
  46498. n.Audio.call(this, e),
  46499. this.panner = this.context.createPanner(),
  46500. this.panner.connect(this.gain)
  46501. }
  46502. ,
  46503. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  46504. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  46505. n.PositionalAudio.prototype.getOutput = function() {
  46506. return this.panner
  46507. }
  46508. ,
  46509. n.PositionalAudio.prototype.setRefDistance = function(e) {
  46510. this.panner.refDistance = e
  46511. }
  46512. ,
  46513. n.PositionalAudio.prototype.getRefDistance = function() {
  46514. return this.panner.refDistance
  46515. }
  46516. ,
  46517. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  46518. this.panner.rolloffFactor = e
  46519. }
  46520. ,
  46521. n.PositionalAudio.prototype.getRolloffFactor = function() {
  46522. return this.panner.rolloffFactor
  46523. }
  46524. ,
  46525. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  46526. this.panner.distanceModel = e
  46527. }
  46528. ,
  46529. n.PositionalAudio.prototype.getDistanceModel = function() {
  46530. return this.panner.distanceModel
  46531. }
  46532. ,
  46533. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  46534. this.panner.maxDistance = e
  46535. }
  46536. ,
  46537. n.PositionalAudio.prototype.getMaxDistance = function() {
  46538. return this.panner.maxDistance
  46539. }
  46540. ,
  46541. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  46542. var e = new n.Vector3;
  46543. return function(t) {
  46544. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  46545. e.setFromMatrixPosition(this.matrixWorld),
  46546. this.panner.setPosition(e.x, e.y, e.z)
  46547. }
  46548. }(),
  46549. n.AudioListener = function() {
  46550. n.Object3D.call(this),
  46551. this.type = "AudioListener",
  46552. this.context = new (window.AudioContext || window.webkitAudioContext),
  46553. this.gain = this.context.createGain(),
  46554. this.gain.connect(this.context.destination),
  46555. this.filter = null
  46556. }
  46557. ,
  46558. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  46559. n.AudioListener.prototype.constructor = n.AudioListener,
  46560. n.AudioListener.prototype.getInput = function() {
  46561. return this.gain
  46562. }
  46563. ,
  46564. n.AudioListener.prototype.removeFilter = function() {
  46565. null !== this.filter && (this.gain.disconnect(this.filter),
  46566. this.filter.disconnect(this.context.destination),
  46567. this.gain.connect(this.context.destination),
  46568. this.filter = null)
  46569. }
  46570. ,
  46571. n.AudioListener.prototype.setFilter = function(e) {
  46572. null !== this.filter ? (this.gain.disconnect(this.filter),
  46573. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  46574. this.filter = e,
  46575. this.gain.connect(this.filter),
  46576. this.filter.connect(this.context.destination)
  46577. }
  46578. ,
  46579. n.AudioListener.prototype.getFilter = function() {
  46580. return this.filter
  46581. }
  46582. ,
  46583. n.AudioListener.prototype.setMasterVolume = function(e) {
  46584. this.gain.gain.value = e
  46585. }
  46586. ,
  46587. n.AudioListener.prototype.getMasterVolume = function() {
  46588. return this.gain.gain.value
  46589. }
  46590. ,
  46591. n.AudioListener.prototype.updateMatrixWorld = function() {
  46592. var e = new n.Vector3
  46593. , t = new n.Quaternion
  46594. , i = new n.Vector3
  46595. , r = new n.Vector3;
  46596. return function(o) {
  46597. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  46598. var a = this.context.listener
  46599. , s = this.up;
  46600. this.matrixWorld.decompose(e, t, i),
  46601. r.set(0, 0, -1).applyQuaternion(t),
  46602. a.setPosition(e.x, e.y, e.z),
  46603. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  46604. }
  46605. }(),
  46606. n.Camera = function() {
  46607. n.Object3D.call(this),
  46608. this.type = "Camera",
  46609. this.matrixWorldInverse = new n.Matrix4,
  46610. this.projectionMatrix = new n.Matrix4
  46611. }
  46612. ,
  46613. n.Camera.prototype = Object.create(n.Object3D.prototype),
  46614. n.Camera.prototype.constructor = n.Camera,
  46615. n.Camera.prototype.getWorldDirection = function() {
  46616. var e = new n.Quaternion;
  46617. return function(t) {
  46618. var i = t || new n.Vector3;
  46619. return this.getWorldQuaternion(e),
  46620. i.set(0, 0, -1).applyQuaternion(e)
  46621. }
  46622. }(),
  46623. n.Camera.prototype.lookAt = function() {
  46624. var e = new n.Matrix4;
  46625. return function(t) {
  46626. e.lookAt(this.position, t, this.up),
  46627. this.quaternion.setFromRotationMatrix(e)
  46628. }
  46629. }(),
  46630. n.Camera.prototype.clone = function() {
  46631. return (new this.constructor).copy(this)
  46632. }
  46633. ,
  46634. n.Camera.prototype.copy = function(e) {
  46635. return n.Object3D.prototype.copy.call(this, e),
  46636. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  46637. this.projectionMatrix.copy(e.projectionMatrix),
  46638. this
  46639. }
  46640. ,
  46641. n.CubeCamera = function(e, t, i) {
  46642. n.Object3D.call(this),
  46643. this.type = "CubeCamera";
  46644. var r = 90
  46645. , o = 1
  46646. , a = new n.PerspectiveCamera(r,o,e,t);
  46647. a.up.set(0, -1, 0),
  46648. a.lookAt(new n.Vector3(1,0,0)),
  46649. this.add(a);
  46650. var s = new n.PerspectiveCamera(r,o,e,t);
  46651. s.up.set(0, -1, 0),
  46652. s.lookAt(new n.Vector3(-1,0,0)),
  46653. this.add(s);
  46654. var l = new n.PerspectiveCamera(r,o,e,t);
  46655. l.up.set(0, 0, 1),
  46656. l.lookAt(new n.Vector3(0,1,0)),
  46657. this.add(l);
  46658. var c = new n.PerspectiveCamera(r,o,e,t);
  46659. c.up.set(0, 0, -1),
  46660. c.lookAt(new n.Vector3(0,-1,0)),
  46661. this.add(c);
  46662. var h = new n.PerspectiveCamera(r,o,e,t);
  46663. h.up.set(0, -1, 0),
  46664. h.lookAt(new n.Vector3(0,0,1)),
  46665. this.add(h);
  46666. var u = new n.PerspectiveCamera(r,o,e,t);
  46667. u.up.set(0, -1, 0),
  46668. u.lookAt(new n.Vector3(0,0,-1)),
  46669. this.add(u);
  46670. var d = {
  46671. format: n.RGBFormat,
  46672. magFilter: n.LinearFilter,
  46673. minFilter: n.LinearFilter
  46674. };
  46675. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  46676. this.updateCubeMap = function(e, t) {
  46677. null === this.parent && this.updateMatrixWorld();
  46678. var i = this.renderTarget
  46679. , n = i.texture.generateMipmaps;
  46680. i.texture.generateMipmaps = !1,
  46681. i.activeCubeFace = 0,
  46682. e.render(t, a, i),
  46683. i.activeCubeFace = 1,
  46684. e.render(t, s, i),
  46685. i.activeCubeFace = 2,
  46686. e.render(t, l, i),
  46687. i.activeCubeFace = 3,
  46688. e.render(t, c, i),
  46689. i.activeCubeFace = 4,
  46690. e.render(t, h, i),
  46691. i.texture.generateMipmaps = n,
  46692. i.activeCubeFace = 5,
  46693. e.render(t, u, i),
  46694. e.setRenderTarget(null)
  46695. }
  46696. }
  46697. ,
  46698. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  46699. n.CubeCamera.prototype.constructor = n.CubeCamera,
  46700. n.OrthographicCamera = function(e, t, i, r, o, a) {
  46701. n.Camera.call(this),
  46702. this.type = "OrthographicCamera",
  46703. this.zoom = 1,
  46704. this.left = e,
  46705. this.right = t,
  46706. this.top = i,
  46707. this.bottom = r,
  46708. this.near = void 0 !== o ? o : .1,
  46709. this.far = void 0 !== a ? a : 2e3,
  46710. this.updateProjectionMatrix()
  46711. }
  46712. ,
  46713. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  46714. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  46715. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  46716. var e = (this.right - this.left) / (2 * this.zoom)
  46717. , t = (this.top - this.bottom) / (2 * this.zoom)
  46718. , i = (this.right + this.left) / 2
  46719. , n = (this.top + this.bottom) / 2;
  46720. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  46721. }
  46722. ,
  46723. n.OrthographicCamera.prototype.copy = function(e) {
  46724. return n.Camera.prototype.copy.call(this, e),
  46725. this.left = e.left,
  46726. this.right = e.right,
  46727. this.top = e.top,
  46728. this.bottom = e.bottom,
  46729. this.near = e.near,
  46730. this.far = e.far,
  46731. this.zoom = e.zoom,
  46732. this
  46733. }
  46734. ,
  46735. n.OrthographicCamera.prototype.toJSON = function(e) {
  46736. var t = n.Object3D.prototype.toJSON.call(this, e);
  46737. return t.object.zoom = this.zoom,
  46738. t.object.left = this.left,
  46739. t.object.right = this.right,
  46740. t.object.top = this.top,
  46741. t.object.bottom = this.bottom,
  46742. t.object.near = this.near,
  46743. t.object.far = this.far,
  46744. t
  46745. }
  46746. ,
  46747. n.PerspectiveCamera = function(e, t, i, r) {
  46748. n.Camera.call(this),
  46749. this.type = "PerspectiveCamera",
  46750. this.focalLength = 10,
  46751. this.zoom = 1,
  46752. this.fov = void 0 !== e ? e : 50,
  46753. this.aspect = void 0 !== t ? t : 1,
  46754. this.near = void 0 !== i ? i : .1,
  46755. this.far = void 0 !== r ? r : 2e3,
  46756. this.updateProjectionMatrix()
  46757. }
  46758. ,
  46759. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  46760. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  46761. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  46762. void 0 === t && (t = 24),
  46763. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  46764. this.updateProjectionMatrix()
  46765. }
  46766. ,
  46767. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  46768. this.fullWidth = e,
  46769. this.fullHeight = t,
  46770. this.x = i,
  46771. this.y = n,
  46772. this.width = r,
  46773. this.height = o,
  46774. this.updateProjectionMatrix()
  46775. }
  46776. ,
  46777. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  46778. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  46779. if (this.fullWidth) {
  46780. var t = this.fullWidth / this.fullHeight
  46781. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  46782. , r = -i
  46783. , o = t * r
  46784. , a = t * i
  46785. , s = Math.abs(a - o)
  46786. , l = Math.abs(i - r);
  46787. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  46788. } else
  46789. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  46790. }
  46791. ,
  46792. n.PerspectiveCamera.prototype.copy = function(e) {
  46793. return n.Camera.prototype.copy.call(this, e),
  46794. this.focalLength = e.focalLength,
  46795. this.zoom = e.zoom,
  46796. this.fov = e.fov,
  46797. this.aspect = e.aspect,
  46798. this.near = e.near,
  46799. this.far = e.far,
  46800. this
  46801. }
  46802. ,
  46803. n.PerspectiveCamera.prototype.toJSON = function(e) {
  46804. var t = n.Object3D.prototype.toJSON.call(this, e);
  46805. return t.object.focalLength = this.focalLength,
  46806. t.object.zoom = this.zoom,
  46807. t.object.fov = this.fov,
  46808. t.object.aspect = this.aspect,
  46809. t.object.near = this.near,
  46810. t.object.far = this.far,
  46811. t
  46812. }
  46813. ,
  46814. n.StereoCamera = function() {
  46815. this.type = "StereoCamera",
  46816. this.aspect = 1,
  46817. this.cameraL = new n.PerspectiveCamera,
  46818. this.cameraL.layers.enable(1),
  46819. this.cameraL.matrixAutoUpdate = !1,
  46820. this.cameraR = new n.PerspectiveCamera,
  46821. this.cameraR.layers.enable(2),
  46822. this.cameraR.matrixAutoUpdate = !1
  46823. }
  46824. ,
  46825. n.StereoCamera.prototype = {
  46826. constructor: n.StereoCamera,
  46827. update: function() {
  46828. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  46829. return function(l) {
  46830. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  46831. if (c) {
  46832. e = l.focalLength,
  46833. t = l.fov,
  46834. i = l.aspect * this.aspect,
  46835. r = l.near,
  46836. o = l.far;
  46837. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  46838. s.elements[12] = -p,
  46839. a.elements[12] = p,
  46840. h = -g * i + f,
  46841. u = g * i + f,
  46842. d.elements[0] = 2 * r / (u - h),
  46843. d.elements[8] = (u + h) / (u - h),
  46844. this.cameraL.projectionMatrix.copy(d),
  46845. h = -g * i - f,
  46846. u = g * i - f,
  46847. d.elements[0] = 2 * r / (u - h),
  46848. d.elements[8] = (u + h) / (u - h),
  46849. this.cameraR.projectionMatrix.copy(d)
  46850. }
  46851. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  46852. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  46853. }
  46854. }()
  46855. },
  46856. n.Light = function(e, t) {
  46857. n.Object3D.call(this),
  46858. this.type = "Light",
  46859. this.color = new n.Color(e),
  46860. this.intensity = void 0 !== t ? t : 1,
  46861. this.receiveShadow = void 0
  46862. }
  46863. ,
  46864. n.Light.prototype = Object.create(n.Object3D.prototype),
  46865. n.Light.prototype.constructor = n.Light,
  46866. n.Light.prototype.copy = function(e) {
  46867. return n.Object3D.prototype.copy.call(this, e),
  46868. this.color.copy(e.color),
  46869. this.intensity = e.intensity,
  46870. this
  46871. }
  46872. ,
  46873. n.Light.prototype.toJSON = function(e) {
  46874. var t = n.Object3D.prototype.toJSON.call(this, e);
  46875. return t.object.color = this.color.getHex(),
  46876. t.object.intensity = this.intensity,
  46877. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  46878. void 0 !== this.distance && (t.object.distance = this.distance),
  46879. void 0 !== this.angle && (t.object.angle = this.angle),
  46880. void 0 !== this.decay && (t.object.decay = this.decay),
  46881. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  46882. t
  46883. }
  46884. ,
  46885. n.LightShadow = function(e) {
  46886. this.camera = e,
  46887. this.bias = 0,
  46888. this.radius = 1,
  46889. this.mapSize = new n.Vector2(512,512),
  46890. this.map = null,
  46891. this.matrix = new n.Matrix4
  46892. }
  46893. ,
  46894. n.LightShadow.prototype = {
  46895. constructor: n.LightShadow,
  46896. copy: function(e) {
  46897. return this.camera = e.camera.clone(),
  46898. this.bias = e.bias,
  46899. this.radius = e.radius,
  46900. this.mapSize.copy(e.mapSize),
  46901. this
  46902. },
  46903. clone: function() {
  46904. return (new this.constructor).copy(this)
  46905. }
  46906. },
  46907. n.AmbientLight = function(e, t) {
  46908. n.Light.call(this, e, t),
  46909. this.type = "AmbientLight",
  46910. this.castShadow = void 0
  46911. }
  46912. ,
  46913. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  46914. n.AmbientLight.prototype.constructor = n.AmbientLight,
  46915. n.DirectionalLight = function(e, t) {
  46916. n.Light.call(this, e, t),
  46917. this.type = "DirectionalLight",
  46918. this.position.set(0, 1, 0),
  46919. this.updateMatrix(),
  46920. this.target = new n.Object3D,
  46921. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  46922. }
  46923. ,
  46924. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  46925. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  46926. n.DirectionalLight.prototype.copy = function(e) {
  46927. return n.Light.prototype.copy.call(this, e),
  46928. this.target = e.target.clone(),
  46929. this.shadow = e.shadow.clone(),
  46930. this
  46931. }
  46932. ,
  46933. n.HemisphereLight = function(e, t, i) {
  46934. n.Light.call(this, e, i),
  46935. this.type = "HemisphereLight",
  46936. this.castShadow = void 0,
  46937. this.position.set(0, 1, 0),
  46938. this.updateMatrix(),
  46939. this.groundColor = new n.Color(t)
  46940. }
  46941. ,
  46942. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  46943. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  46944. n.HemisphereLight.prototype.copy = function(e) {
  46945. return n.Light.prototype.copy.call(this, e),
  46946. this.groundColor.copy(e.groundColor),
  46947. this
  46948. }
  46949. ,
  46950. n.PointLight = function(e, t, i, r) {
  46951. n.Light.call(this, e, t),
  46952. this.type = "PointLight",
  46953. this.distance = void 0 !== i ? i : 0,
  46954. this.decay = void 0 !== r ? r : 1,
  46955. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  46956. }
  46957. ,
  46958. n.PointLight.prototype = Object.create(n.Light.prototype),
  46959. n.PointLight.prototype.constructor = n.PointLight,
  46960. Object.defineProperty(n.PointLight.prototype, "power", {
  46961. get: function() {
  46962. return 4 * this.intensity * Math.PI
  46963. },
  46964. set: function(e) {
  46965. this.intensity = e / (4 * Math.PI)
  46966. }
  46967. }),
  46968. n.PointLight.prototype.copy = function(e) {
  46969. return n.Light.prototype.copy.call(this, e),
  46970. this.distance = e.distance,
  46971. this.decay = e.decay,
  46972. this.shadow = e.shadow.clone(),
  46973. this
  46974. }
  46975. ,
  46976. n.SpotLight = function(e, t, i, r, o, a) {
  46977. n.Light.call(this, e, t),
  46978. this.type = "SpotLight",
  46979. this.position.set(0, 1, 0),
  46980. this.updateMatrix(),
  46981. this.target = new n.Object3D,
  46982. this.distance = void 0 !== i ? i : 0,
  46983. this.angle = void 0 !== r ? r : Math.PI / 3,
  46984. this.penumbra = void 0 !== o ? o : 0,
  46985. this.decay = void 0 !== a ? a : 1,
  46986. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  46987. }
  46988. ,
  46989. n.SpotLight.prototype = Object.create(n.Light.prototype),
  46990. n.SpotLight.prototype.constructor = n.SpotLight,
  46991. Object.defineProperty(n.SpotLight.prototype, "power", {
  46992. get: function() {
  46993. return this.intensity * Math.PI
  46994. },
  46995. set: function(e) {
  46996. this.intensity = e / Math.PI
  46997. }
  46998. }),
  46999. n.SpotLight.prototype.copy = function(e) {
  47000. return n.Light.prototype.copy.call(this, e),
  47001. this.distance = e.distance,
  47002. this.angle = e.angle,
  47003. this.penumbra = e.penumbra,
  47004. this.decay = e.decay,
  47005. this.target = e.target.clone(),
  47006. this.shadow = e.shadow.clone(),
  47007. this
  47008. }
  47009. ,
  47010. n.Cache = {
  47011. enabled: !1,
  47012. files: {},
  47013. add: function(e, t) {
  47014. this.enabled !== !1 && (this.files[e] = t)
  47015. },
  47016. get: function(e) {
  47017. if (this.enabled !== !1)
  47018. return this.files[e]
  47019. },
  47020. remove: function(e) {
  47021. delete this.files[e]
  47022. },
  47023. clear: function() {
  47024. this.files = {}
  47025. }
  47026. },
  47027. n.Loader = function() {
  47028. this.onLoadStart = function() {}
  47029. ,
  47030. this.onLoadProgress = function() {}
  47031. ,
  47032. this.onLoadComplete = function() {}
  47033. }
  47034. ,
  47035. n.Loader.prototype = {
  47036. constructor: n.Loader,
  47037. crossOrigin: void 0,
  47038. extractUrlBase: function(e) {
  47039. var t = e.split("/");
  47040. return 1 === t.length ? "./" : (t.pop(),
  47041. t.join("/") + "/")
  47042. },
  47043. initMaterials: function(e, t, i) {
  47044. for (var n = [], r = 0; r < e.length; ++r)
  47045. n[r] = this.createMaterial(e[r], t, i);
  47046. return n
  47047. },
  47048. createMaterial: function() {
  47049. var e, t, i;
  47050. return function(r, o, a) {
  47051. function s(e, i, r, s, c) {
  47052. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47053. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47054. h = t.load(u)),
  47055. void 0 !== i && (h.repeat.fromArray(i),
  47056. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47057. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47058. void 0 !== r && h.offset.fromArray(r),
  47059. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47060. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47061. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47062. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47063. void 0 !== c && (h.anisotropy = c);
  47064. var p = n.Math.generateUUID();
  47065. return l[p] = h,
  47066. p
  47067. }
  47068. void 0 === e && (e = new n.Color),
  47069. void 0 === t && (t = new n.TextureLoader),
  47070. void 0 === i && (i = new n.MaterialLoader);
  47071. var l = {}
  47072. , c = {
  47073. uuid: n.Math.generateUUID(),
  47074. type: "MeshLambertMaterial"
  47075. };
  47076. for (var h in r) {
  47077. var u = r[h];
  47078. switch (h) {
  47079. case "DbgColor":
  47080. case "DbgIndex":
  47081. case "opticalDensity":
  47082. case "illumination":
  47083. break;
  47084. case "DbgName":
  47085. c.name = u;
  47086. break;
  47087. case "blending":
  47088. c.blending = n[u];
  47089. break;
  47090. case "colorAmbient":
  47091. case "mapAmbient":
  47092. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47093. break;
  47094. case "colorDiffuse":
  47095. c.color = e.fromArray(u).getHex();
  47096. break;
  47097. case "colorSpecular":
  47098. c.specular = e.fromArray(u).getHex();
  47099. break;
  47100. case "colorEmissive":
  47101. c.emissive = e.fromArray(u).getHex();
  47102. break;
  47103. case "specularCoef":
  47104. c.shininess = u;
  47105. break;
  47106. case "shading":
  47107. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47108. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47109. break;
  47110. case "mapDiffuse":
  47111. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47112. break;
  47113. case "mapDiffuseRepeat":
  47114. case "mapDiffuseOffset":
  47115. case "mapDiffuseWrap":
  47116. case "mapDiffuseAnisotropy":
  47117. break;
  47118. case "mapLight":
  47119. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47120. break;
  47121. case "mapLightRepeat":
  47122. case "mapLightOffset":
  47123. case "mapLightWrap":
  47124. case "mapLightAnisotropy":
  47125. break;
  47126. case "mapAO":
  47127. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47128. break;
  47129. case "mapAORepeat":
  47130. case "mapAOOffset":
  47131. case "mapAOWrap":
  47132. case "mapAOAnisotropy":
  47133. break;
  47134. case "mapBump":
  47135. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47136. break;
  47137. case "mapBumpScale":
  47138. c.bumpScale = u;
  47139. break;
  47140. case "mapBumpRepeat":
  47141. case "mapBumpOffset":
  47142. case "mapBumpWrap":
  47143. case "mapBumpAnisotropy":
  47144. break;
  47145. case "mapNormal":
  47146. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47147. break;
  47148. case "mapNormalFactor":
  47149. c.normalScale = [u, u];
  47150. break;
  47151. case "mapNormalRepeat":
  47152. case "mapNormalOffset":
  47153. case "mapNormalWrap":
  47154. case "mapNormalAnisotropy":
  47155. break;
  47156. case "mapSpecular":
  47157. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47158. break;
  47159. case "mapSpecularRepeat":
  47160. case "mapSpecularOffset":
  47161. case "mapSpecularWrap":
  47162. case "mapSpecularAnisotropy":
  47163. break;
  47164. case "mapAlpha":
  47165. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47166. break;
  47167. case "mapAlphaRepeat":
  47168. case "mapAlphaOffset":
  47169. case "mapAlphaWrap":
  47170. case "mapAlphaAnisotropy":
  47171. break;
  47172. case "flipSided":
  47173. c.side = n.BackSide;
  47174. break;
  47175. case "doubleSided":
  47176. c.side = n.DoubleSide;
  47177. break;
  47178. case "transparency":
  47179. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  47180. c.opacity = u;
  47181. break;
  47182. case "depthTest":
  47183. case "depthWrite":
  47184. case "colorWrite":
  47185. case "opacity":
  47186. case "reflectivity":
  47187. case "transparent":
  47188. case "visible":
  47189. case "wireframe":
  47190. c[h] = u;
  47191. break;
  47192. case "vertexColors":
  47193. u === !0 && (c.vertexColors = n.VertexColors),
  47194. "face" === u && (c.vertexColors = n.FaceColors);
  47195. break;
  47196. default:
  47197. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  47198. }
  47199. }
  47200. return "MeshBasicMaterial" === c.type && delete c.emissive,
  47201. "MeshPhongMaterial" !== c.type && delete c.specular,
  47202. c.opacity < 1 && (c.transparent = !0),
  47203. i.setTextures(l),
  47204. i.parse(c)
  47205. }
  47206. }()
  47207. },
  47208. n.Loader.Handlers = {
  47209. handlers: [],
  47210. add: function(e, t) {
  47211. this.handlers.push(e, t)
  47212. },
  47213. get: function(e) {
  47214. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  47215. var r = t[i]
  47216. , o = t[i + 1];
  47217. if (r.test(e))
  47218. return o
  47219. }
  47220. return null
  47221. }
  47222. },
  47223. n.XHRLoader = function(e) {
  47224. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47225. }
  47226. ,
  47227. n.XHRLoader.prototype = {
  47228. constructor: n.XHRLoader,
  47229. load: function(e, t, i, r) {
  47230. void 0 !== this.path && (e = this.path + e);
  47231. var o = this
  47232. , a = n.Cache.get(e);
  47233. if (void 0 !== a)
  47234. return t && setTimeout(function() {
  47235. t(a)
  47236. }, 0),
  47237. a;
  47238. var s = new XMLHttpRequest;
  47239. return s.overrideMimeType("text/plain"),
  47240. s.open("GET", e, !0),
  47241. s.addEventListener("load", function(i) {
  47242. var a = i.target.response;
  47243. n.Cache.add(e, a),
  47244. 200 === this.status ? (t && t(a),
  47245. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  47246. t && t(a),
  47247. o.manager.itemEnd(e)) : (r && r(i),
  47248. o.manager.itemError(e))
  47249. }, !1),
  47250. void 0 !== i && s.addEventListener("progress", function(e) {
  47251. i(e)
  47252. }, !1),
  47253. s.addEventListener("error", function(t) {
  47254. r && r(t),
  47255. o.manager.itemError(e)
  47256. }, !1),
  47257. void 0 !== this.responseType && (s.responseType = this.responseType),
  47258. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  47259. s.send(null),
  47260. o.manager.itemStart(e),
  47261. s
  47262. },
  47263. setPath: function(e) {
  47264. this.path = e
  47265. },
  47266. setResponseType: function(e) {
  47267. this.responseType = e
  47268. },
  47269. setWithCredentials: function(e) {
  47270. this.withCredentials = e
  47271. }
  47272. },
  47273. n.FontLoader = function(e) {
  47274. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47275. }
  47276. ,
  47277. n.FontLoader.prototype = {
  47278. constructor: n.FontLoader,
  47279. load: function(e, t, i, r) {
  47280. var o = new n.XHRLoader(this.manager);
  47281. o.load(e, function(e) {
  47282. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  47283. }, i, r)
  47284. }
  47285. },
  47286. n.ImageLoader = function(e) {
  47287. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47288. }
  47289. ,
  47290. n.ImageLoader.prototype = {
  47291. constructor: n.ImageLoader,
  47292. load: function(e, t, i, r) {
  47293. void 0 !== this.path && (e = this.path + e);
  47294. var o = this
  47295. , a = n.Cache.get(e);
  47296. if (void 0 !== a)
  47297. return o.manager.itemStart(e),
  47298. t ? setTimeout(function() {
  47299. t(a),
  47300. o.manager.itemEnd(e)
  47301. }, 0) : o.manager.itemEnd(e),
  47302. a;
  47303. var s = document.createElement("img");
  47304. return s.addEventListener("load", function(i) {
  47305. n.Cache.add(e, this),
  47306. t && t(this),
  47307. o.manager.itemEnd(e)
  47308. }, !1),
  47309. void 0 !== i && s.addEventListener("progress", function(e) {
  47310. i(e)
  47311. }, !1),
  47312. s.addEventListener("error", function(t) {
  47313. r && r(t),
  47314. o.manager.itemError(e)
  47315. }, !1),
  47316. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  47317. o.manager.itemStart(e),
  47318. s.src = e,
  47319. s
  47320. },
  47321. setCrossOrigin: function(e) {
  47322. this.crossOrigin = e
  47323. },
  47324. setPath: function(e) {
  47325. this.path = e
  47326. }
  47327. },
  47328. n.JSONLoader = function(e) {
  47329. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  47330. e = void 0),
  47331. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47332. this.withCredentials = !1
  47333. }
  47334. ,
  47335. n.JSONLoader.prototype = {
  47336. constructor: n.JSONLoader,
  47337. get statusDomElement() {
  47338. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  47339. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  47340. this._statusDomElement
  47341. },
  47342. load: function(e, t, i, r) {
  47343. var o = this
  47344. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  47345. , s = new n.XHRLoader(this.manager);
  47346. s.setWithCredentials(this.withCredentials),
  47347. s.load(e, function(i) {
  47348. var n = JSON.parse(i)
  47349. , r = n.metadata;
  47350. if (void 0 !== r) {
  47351. var s = r.type;
  47352. if (void 0 !== s) {
  47353. if ("object" === s.toLowerCase())
  47354. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  47355. if ("scene" === s.toLowerCase())
  47356. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  47357. }
  47358. }
  47359. var l = o.parse(n, a);
  47360. t(l.geometry, l.materials)
  47361. }, i, r)
  47362. },
  47363. setTexturePath: function(e) {
  47364. this.texturePath = e
  47365. },
  47366. parse: function(e, t) {
  47367. function i(t) {
  47368. function i(e, t) {
  47369. return e & 1 << t
  47370. }
  47371. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  47372. if (void 0 !== e.uvs) {
  47373. for (r = 0; r < e.uvs.length; r++)
  47374. e.uvs[r].length && B++;
  47375. for (r = 0; r < B; r++)
  47376. s.faceVertexUvs[r] = []
  47377. }
  47378. for (l = 0,
  47379. c = L.length; l < c; )
  47380. E = new n.Vector3,
  47381. E.x = L[l++] * t,
  47382. E.y = L[l++] * t,
  47383. E.z = L[l++] * t,
  47384. s.vertices.push(E);
  47385. for (l = 0,
  47386. c = O.length; l < c; )
  47387. if (f = O[l++],
  47388. g = i(f, 0),
  47389. m = i(f, 1),
  47390. v = i(f, 3),
  47391. A = i(f, 4),
  47392. y = i(f, 5),
  47393. C = i(f, 6),
  47394. I = i(f, 7),
  47395. g) {
  47396. if (w = new n.Face3,
  47397. w.a = O[l],
  47398. w.b = O[l + 1],
  47399. w.c = O[l + 3],
  47400. _ = new n.Face3,
  47401. _.a = O[l + 1],
  47402. _.b = O[l + 2],
  47403. _.c = O[l + 3],
  47404. l += 4,
  47405. m && (p = O[l++],
  47406. w.materialIndex = p,
  47407. _.materialIndex = p),
  47408. a = s.faces.length,
  47409. v)
  47410. for (r = 0; r < B; r++)
  47411. for (S = e.uvs[r],
  47412. s.faceVertexUvs[r][a] = [],
  47413. s.faceVertexUvs[r][a + 1] = [],
  47414. o = 0; o < 4; o++)
  47415. d = O[l++],
  47416. R = S[2 * d],
  47417. P = S[2 * d + 1],
  47418. M = new n.Vector2(R,P),
  47419. 2 !== o && s.faceVertexUvs[r][a].push(M),
  47420. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  47421. if (A && (u = 3 * O[l++],
  47422. w.normal.set(D[u++], D[u++], D[u]),
  47423. _.normal.copy(w.normal)),
  47424. y)
  47425. for (r = 0; r < 4; r++)
  47426. u = 3 * O[l++],
  47427. x = new n.Vector3(D[u++],D[u++],D[u]),
  47428. 2 !== r && w.vertexNormals.push(x),
  47429. 0 !== r && _.vertexNormals.push(x);
  47430. if (C && (h = O[l++],
  47431. T = N[h],
  47432. w.color.setHex(T),
  47433. _.color.setHex(T)),
  47434. I)
  47435. for (r = 0; r < 4; r++)
  47436. h = O[l++],
  47437. T = N[h],
  47438. 2 !== r && w.vertexColors.push(new n.Color(T)),
  47439. 0 !== r && _.vertexColors.push(new n.Color(T));
  47440. s.faces.push(w),
  47441. s.faces.push(_)
  47442. } else {
  47443. if (b = new n.Face3,
  47444. b.a = O[l++],
  47445. b.b = O[l++],
  47446. b.c = O[l++],
  47447. m && (p = O[l++],
  47448. b.materialIndex = p),
  47449. a = s.faces.length,
  47450. v)
  47451. for (r = 0; r < B; r++)
  47452. for (S = e.uvs[r],
  47453. s.faceVertexUvs[r][a] = [],
  47454. o = 0; o < 3; o++)
  47455. d = O[l++],
  47456. R = S[2 * d],
  47457. P = S[2 * d + 1],
  47458. M = new n.Vector2(R,P),
  47459. s.faceVertexUvs[r][a].push(M);
  47460. if (A && (u = 3 * O[l++],
  47461. b.normal.set(D[u++], D[u++], D[u])),
  47462. y)
  47463. for (r = 0; r < 3; r++)
  47464. u = 3 * O[l++],
  47465. x = new n.Vector3(D[u++],D[u++],D[u]),
  47466. b.vertexNormals.push(x);
  47467. if (C && (h = O[l++],
  47468. b.color.setHex(N[h])),
  47469. I)
  47470. for (r = 0; r < 3; r++)
  47471. h = O[l++],
  47472. b.vertexColors.push(new n.Color(N[h]));
  47473. s.faces.push(b)
  47474. }
  47475. }
  47476. function r() {
  47477. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  47478. if (e.skinWeights)
  47479. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  47480. var o = e.skinWeights[i]
  47481. , a = t > 1 ? e.skinWeights[i + 1] : 0
  47482. , l = t > 2 ? e.skinWeights[i + 2] : 0
  47483. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  47484. s.skinWeights.push(new n.Vector4(o,a,l,c))
  47485. }
  47486. if (e.skinIndices)
  47487. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  47488. var h = e.skinIndices[i]
  47489. , u = t > 1 ? e.skinIndices[i + 1] : 0
  47490. , d = t > 2 ? e.skinIndices[i + 2] : 0
  47491. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  47492. s.skinIndices.push(new n.Vector4(h,u,d,p))
  47493. }
  47494. s.bones = e.bones,
  47495. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  47496. }
  47497. function o(t) {
  47498. if (void 0 !== e.morphTargets)
  47499. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  47500. s.morphTargets[i] = {},
  47501. s.morphTargets[i].name = e.morphTargets[i].name,
  47502. s.morphTargets[i].vertices = [];
  47503. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  47504. var h = new n.Vector3;
  47505. h.x = a[l] * t,
  47506. h.y = a[l + 1] * t,
  47507. h.z = a[l + 2] * t,
  47508. o.push(h)
  47509. }
  47510. }
  47511. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  47512. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  47513. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  47514. u[i].color.fromArray(d, 3 * i)
  47515. }
  47516. }
  47517. function a() {
  47518. var t = []
  47519. , i = [];
  47520. void 0 !== e.animation && i.push(e.animation),
  47521. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  47522. for (var r = 0; r < i.length; r++) {
  47523. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  47524. o && t.push(o)
  47525. }
  47526. if (s.morphTargets) {
  47527. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  47528. t = t.concat(a)
  47529. }
  47530. t.length > 0 && (s.animations = t)
  47531. }
  47532. var s = new n.Geometry
  47533. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  47534. if (i(l),
  47535. r(),
  47536. o(l),
  47537. a(),
  47538. s.computeFaceNormals(),
  47539. s.computeBoundingSphere(),
  47540. void 0 === e.materials || 0 === e.materials.length)
  47541. return {
  47542. geometry: s
  47543. };
  47544. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  47545. return {
  47546. geometry: s,
  47547. materials: c
  47548. }
  47549. }
  47550. },
  47551. n.LoadingManager = function(e, t, i) {
  47552. var n = this
  47553. , r = !1
  47554. , o = 0
  47555. , a = 0;
  47556. this.onStart = void 0,
  47557. this.onLoad = e,
  47558. this.onProgress = t,
  47559. this.onError = i,
  47560. this.itemStart = function(e) {
  47561. a++,
  47562. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  47563. r = !0
  47564. }
  47565. ,
  47566. this.itemEnd = function(e) {
  47567. o++,
  47568. void 0 !== n.onProgress && n.onProgress(e, o, a),
  47569. o === a && (r = !1,
  47570. void 0 !== n.onLoad && n.onLoad())
  47571. }
  47572. ,
  47573. this.itemError = function(e) {
  47574. void 0 !== n.onError && n.onError(e)
  47575. }
  47576. }
  47577. ,
  47578. n.DefaultLoadingManager = new n.LoadingManager,
  47579. n.BufferGeometryLoader = function(e) {
  47580. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47581. }
  47582. ,
  47583. n.BufferGeometryLoader.prototype = {
  47584. constructor: n.BufferGeometryLoader,
  47585. load: function(e, t, i, r) {
  47586. var o = this
  47587. , a = new n.XHRLoader(o.manager);
  47588. a.load(e, function(e) {
  47589. t(o.parse(JSON.parse(e)))
  47590. }, i, r)
  47591. },
  47592. parse: function(e) {
  47593. var t = new n.BufferGeometry
  47594. , i = e.data.index
  47595. , r = {
  47596. Int8Array: Int8Array,
  47597. Uint8Array: Uint8Array,
  47598. Uint8ClampedArray: Uint8ClampedArray,
  47599. Int16Array: Int16Array,
  47600. Uint16Array: Uint16Array,
  47601. Int32Array: Int32Array,
  47602. Uint32Array: Uint32Array,
  47603. Float32Array: Float32Array,
  47604. Float64Array: Float64Array
  47605. };
  47606. if (void 0 !== i) {
  47607. var o = new r[i.type](i.array);
  47608. t.setIndex(new n.BufferAttribute(o,1))
  47609. }
  47610. var a = e.data.attributes;
  47611. for (var s in a) {
  47612. var l = a[s]
  47613. , o = new r[l.type](l.array);
  47614. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  47615. }
  47616. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  47617. if (void 0 !== c)
  47618. for (var h = 0, u = c.length; h !== u; ++h) {
  47619. var d = c[h];
  47620. t.addGroup(d.start, d.count, d.materialIndex)
  47621. }
  47622. var p = e.data.boundingSphere;
  47623. if (void 0 !== p) {
  47624. var f = new n.Vector3;
  47625. void 0 !== p.center && f.fromArray(p.center),
  47626. t.boundingSphere = new n.Sphere(f,p.radius)
  47627. }
  47628. return t
  47629. }
  47630. },
  47631. n.MaterialLoader = function(e) {
  47632. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47633. this.textures = {}
  47634. }
  47635. ,
  47636. n.MaterialLoader.prototype = {
  47637. constructor: n.MaterialLoader,
  47638. load: function(e, t, i, r) {
  47639. var o = this
  47640. , a = new n.XHRLoader(o.manager);
  47641. a.load(e, function(e) {
  47642. t(o.parse(JSON.parse(e)))
  47643. }, i, r)
  47644. },
  47645. setTextures: function(e) {
  47646. this.textures = e
  47647. },
  47648. getTexture: function(e) {
  47649. var t = this.textures;
  47650. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  47651. t[e]
  47652. },
  47653. parse: function(e) {
  47654. var t = new n[e.type];
  47655. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  47656. void 0 !== e.name && (t.name = e.name),
  47657. void 0 !== e.color && t.color.setHex(e.color),
  47658. void 0 !== e.roughness && (t.roughness = e.roughness),
  47659. void 0 !== e.metalness && (t.metalness = e.metalness),
  47660. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  47661. void 0 !== e.specular && t.specular.setHex(e.specular),
  47662. void 0 !== e.shininess && (t.shininess = e.shininess),
  47663. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  47664. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  47665. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  47666. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  47667. void 0 !== e.shading && (t.shading = e.shading),
  47668. void 0 !== e.blending && (t.blending = e.blending),
  47669. void 0 !== e.side && (t.side = e.side),
  47670. void 0 !== e.opacity && (t.opacity = e.opacity),
  47671. void 0 !== e.transparent && (t.transparent = e.transparent),
  47672. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  47673. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  47674. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  47675. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  47676. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  47677. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  47678. void 0 !== e.size && (t.size = e.size),
  47679. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  47680. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  47681. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  47682. t.transparent = !0),
  47683. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  47684. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  47685. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  47686. void 0 !== e.normalScale) {
  47687. var i = e.normalScale;
  47688. Array.isArray(i) === !1 && (i = [i, i]),
  47689. t.normalScale = (new n.Vector2).fromArray(i)
  47690. }
  47691. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  47692. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  47693. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  47694. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  47695. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  47696. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  47697. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  47698. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  47699. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  47700. t.combine = n.MultiplyOperation),
  47701. e.reflectivity && (t.reflectivity = e.reflectivity),
  47702. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  47703. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  47704. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  47705. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  47706. void 0 !== e.materials)
  47707. for (var r = 0, o = e.materials.length; r < o; r++)
  47708. t.materials.push(this.parse(e.materials[r]));
  47709. return t
  47710. }
  47711. },
  47712. n.ObjectLoader = function(e) {
  47713. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47714. this.texturePath = ""
  47715. }
  47716. ,
  47717. n.ObjectLoader.prototype = {
  47718. constructor: n.ObjectLoader,
  47719. load: function(e, t, i, r) {
  47720. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  47721. var o = this
  47722. , a = new n.XHRLoader(o.manager);
  47723. a.load(e, function(e) {
  47724. o.parse(JSON.parse(e), t)
  47725. }, i, r)
  47726. },
  47727. setTexturePath: function(e) {
  47728. this.texturePath = e
  47729. },
  47730. setCrossOrigin: function(e) {
  47731. this.crossOrigin = e
  47732. },
  47733. parse: function(e, t) {
  47734. var i = this.parseGeometries(e.geometries)
  47735. , n = this.parseImages(e.images, function() {
  47736. void 0 !== t && t(a)
  47737. })
  47738. , r = this.parseTextures(e.textures, n)
  47739. , o = this.parseMaterials(e.materials, r)
  47740. , a = this.parseObject(e.object, i, o);
  47741. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  47742. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  47743. a
  47744. },
  47745. parseGeometries: function(e) {
  47746. var t = {};
  47747. if (void 0 !== e)
  47748. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  47749. var s, l = e[o];
  47750. switch (l.type) {
  47751. case "PlaneGeometry":
  47752. case "PlaneBufferGeometry":
  47753. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  47754. break;
  47755. case "BoxGeometry":
  47756. case "BoxBufferGeometry":
  47757. case "CubeGeometry":
  47758. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  47759. break;
  47760. case "CircleGeometry":
  47761. case "CircleBufferGeometry":
  47762. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  47763. break;
  47764. case "CylinderGeometry":
  47765. case "CylinderBufferGeometry":
  47766. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  47767. break;
  47768. case "SphereGeometry":
  47769. case "SphereBufferGeometry":
  47770. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  47771. break;
  47772. case "DodecahedronGeometry":
  47773. s = new n.DodecahedronGeometry(l.radius,l.detail);
  47774. break;
  47775. case "IcosahedronGeometry":
  47776. s = new n.IcosahedronGeometry(l.radius,l.detail);
  47777. break;
  47778. case "OctahedronGeometry":
  47779. s = new n.OctahedronGeometry(l.radius,l.detail);
  47780. break;
  47781. case "TetrahedronGeometry":
  47782. s = new n.TetrahedronGeometry(l.radius,l.detail);
  47783. break;
  47784. case "RingGeometry":
  47785. case "RingBufferGeometry":
  47786. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  47787. break;
  47788. case "TorusGeometry":
  47789. case "TorusBufferGeometry":
  47790. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  47791. break;
  47792. case "TorusKnotGeometry":
  47793. case "TorusKnotBufferGeometry":
  47794. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  47795. break;
  47796. case "LatheGeometry":
  47797. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  47798. break;
  47799. case "BufferGeometry":
  47800. s = r.parse(l);
  47801. break;
  47802. case "Geometry":
  47803. s = i.parse(l.data, this.texturePath).geometry;
  47804. break;
  47805. default:
  47806. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  47807. continue
  47808. }
  47809. s.uuid = l.uuid,
  47810. void 0 !== l.name && (s.name = l.name),
  47811. t[l.uuid] = s
  47812. }
  47813. return t
  47814. },
  47815. parseMaterials: function(e, t) {
  47816. var i = {};
  47817. if (void 0 !== e) {
  47818. var r = new n.MaterialLoader;
  47819. r.setTextures(t);
  47820. for (var o = 0, a = e.length; o < a; o++) {
  47821. var s = r.parse(e[o]);
  47822. i[s.uuid] = s
  47823. }
  47824. }
  47825. return i
  47826. },
  47827. parseAnimations: function(e) {
  47828. for (var t = [], i = 0; i < e.length; i++) {
  47829. var r = n.AnimationClip.parse(e[i]);
  47830. t.push(r)
  47831. }
  47832. return t
  47833. },
  47834. parseImages: function(e, t) {
  47835. function i(e) {
  47836. return r.manager.itemStart(e),
  47837. s.load(e, function() {
  47838. r.manager.itemEnd(e)
  47839. })
  47840. }
  47841. var r = this
  47842. , o = {};
  47843. if (void 0 !== e && e.length > 0) {
  47844. var a = new n.LoadingManager(t)
  47845. , s = new n.ImageLoader(a);
  47846. s.setCrossOrigin(this.crossOrigin);
  47847. for (var l = 0, c = e.length; l < c; l++) {
  47848. var h = e[l]
  47849. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  47850. o[h.uuid] = i(u)
  47851. }
  47852. }
  47853. return o
  47854. },
  47855. parseTextures: function(e, t) {
  47856. function i(e) {
  47857. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  47858. n[e])
  47859. }
  47860. var r = {};
  47861. if (void 0 !== e)
  47862. for (var o = 0, a = e.length; o < a; o++) {
  47863. var s = e[o];
  47864. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  47865. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  47866. var l = new n.Texture(t[s.image]);
  47867. l.needsUpdate = !0,
  47868. l.uuid = s.uuid,
  47869. void 0 !== s.name && (l.name = s.name),
  47870. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  47871. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  47872. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  47873. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  47874. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  47875. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  47876. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  47877. l.wrapT = i(s.wrap[1])),
  47878. r[s.uuid] = l
  47879. }
  47880. return r
  47881. },
  47882. parseObject: function() {
  47883. var e = new n.Matrix4;
  47884. return function(t, i, r) {
  47885. function o(e) {
  47886. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  47887. i[e]
  47888. }
  47889. function a(e) {
  47890. if (void 0 !== e)
  47891. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  47892. r[e]
  47893. }
  47894. var s;
  47895. switch (t.type) {
  47896. case "Scene":
  47897. s = new n.Scene;
  47898. break;
  47899. case "PerspectiveCamera":
  47900. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  47901. break;
  47902. case "OrthographicCamera":
  47903. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  47904. break;
  47905. case "AmbientLight":
  47906. s = new n.AmbientLight(t.color,t.intensity);
  47907. break;
  47908. case "DirectionalLight":
  47909. s = new n.DirectionalLight(t.color,t.intensity);
  47910. break;
  47911. case "PointLight":
  47912. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  47913. break;
  47914. case "SpotLight":
  47915. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  47916. break;
  47917. case "HemisphereLight":
  47918. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  47919. break;
  47920. case "Mesh":
  47921. var l = o(t.geometry)
  47922. , c = a(t.material);
  47923. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  47924. break;
  47925. case "LOD":
  47926. s = new n.LOD;
  47927. break;
  47928. case "Line":
  47929. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  47930. break;
  47931. case "PointCloud":
  47932. case "Points":
  47933. s = new n.Points(o(t.geometry),a(t.material));
  47934. break;
  47935. case "Sprite":
  47936. s = new n.Sprite(a(t.material));
  47937. break;
  47938. case "Group":
  47939. s = new n.Group;
  47940. break;
  47941. default:
  47942. s = new n.Object3D
  47943. }
  47944. if (s.uuid = t.uuid,
  47945. void 0 !== t.name && (s.name = t.name),
  47946. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  47947. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  47948. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  47949. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  47950. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  47951. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  47952. void 0 !== t.visible && (s.visible = t.visible),
  47953. void 0 !== t.userData && (s.userData = t.userData),
  47954. void 0 !== t.children)
  47955. for (var h in t.children)
  47956. s.add(this.parseObject(t.children[h], i, r));
  47957. if ("LOD" === t.type)
  47958. for (var u = t.levels, d = 0; d < u.length; d++) {
  47959. var p = u[d]
  47960. , h = s.getObjectByProperty("uuid", p.object);
  47961. void 0 !== h && s.addLevel(h, p.distance)
  47962. }
  47963. return s
  47964. }
  47965. }()
  47966. },
  47967. n.TextureLoader = function(e) {
  47968. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47969. }
  47970. ,
  47971. n.TextureLoader.prototype = {
  47972. constructor: n.TextureLoader,
  47973. load: function(e, t, i, r) {
  47974. var o = new n.Texture
  47975. , a = new n.ImageLoader(this.manager);
  47976. return a.setCrossOrigin(this.crossOrigin),
  47977. a.setPath(this.path),
  47978. a.load(e, function(e) {
  47979. o.image = e,
  47980. o.needsUpdate = !0,
  47981. void 0 !== t && t(o)
  47982. }, i, r),
  47983. o
  47984. },
  47985. setCrossOrigin: function(e) {
  47986. this.crossOrigin = e
  47987. },
  47988. setPath: function(e) {
  47989. this.path = e
  47990. }
  47991. },
  47992. n.CubeTextureLoader = function(e) {
  47993. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47994. }
  47995. ,
  47996. n.CubeTextureLoader.prototype = {
  47997. constructor: n.CubeTextureLoader,
  47998. load: function(e, t, i, r) {
  47999. function o(i) {
  48000. s.load(e[i], function(e) {
  48001. a.images[i] = e,
  48002. l++,
  48003. 6 === l && (a.needsUpdate = !0,
  48004. t && t(a))
  48005. }, void 0, r)
  48006. }
  48007. var a = new n.CubeTexture
  48008. , s = new n.ImageLoader(this.manager);
  48009. s.setCrossOrigin(this.crossOrigin),
  48010. s.setPath(this.path);
  48011. for (var l = 0, c = 0; c < e.length; ++c)
  48012. o(c);
  48013. return a
  48014. },
  48015. setCrossOrigin: function(e) {
  48016. this.crossOrigin = e
  48017. },
  48018. setPath: function(e) {
  48019. this.path = e
  48020. }
  48021. },
  48022. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48023. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48024. this._parser = null
  48025. }
  48026. ,
  48027. n.BinaryTextureLoader.prototype = {
  48028. constructor: n.BinaryTextureLoader,
  48029. load: function(e, t, i, r) {
  48030. var o = this
  48031. , a = new n.DataTexture
  48032. , s = new n.XHRLoader(this.manager);
  48033. return s.setResponseType("arraybuffer"),
  48034. s.load(e, function(e) {
  48035. var i = o._parser(e);
  48036. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48037. a.image.height = i.height,
  48038. a.image.data = i.data),
  48039. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48040. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48041. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48042. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48043. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48044. void 0 !== i.format && (a.format = i.format),
  48045. void 0 !== i.type && (a.type = i.type),
  48046. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48047. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48048. a.needsUpdate = !0,
  48049. t && t(a, i))
  48050. }, i, r),
  48051. a
  48052. }
  48053. },
  48054. n.CompressedTextureLoader = function(e) {
  48055. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48056. this._parser = null
  48057. }
  48058. ;
  48059. n.CompressedTextureLoader.prototype = {
  48060. constructor: n.CompressedTextureLoader,
  48061. load: function(e, t, i, r) {
  48062. function o(o) {
  48063. c.load(e[o], function(e) {
  48064. var i = a._parser(e, !0);
  48065. s[o] = {
  48066. width: i.width,
  48067. height: i.height,
  48068. format: i.format,
  48069. mipmaps: i.mipmaps
  48070. },
  48071. h += 1,
  48072. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48073. l.format = i.format,
  48074. l.needsUpdate = !0,
  48075. t && t(l))
  48076. }, i, r)
  48077. }
  48078. var a = this
  48079. , s = []
  48080. , l = new n.CompressedTexture;
  48081. l.image = s;
  48082. var c = new n.XHRLoader(this.manager);
  48083. if (c.setPath(this.path),
  48084. c.setResponseType("arraybuffer"),
  48085. Array.isArray(e))
  48086. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48087. o(u);
  48088. else
  48089. c.load(e, function(e) {
  48090. var i = a._parser(e, !0);
  48091. if (i.isCubemap)
  48092. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48093. s[o] = {
  48094. mipmaps: []
  48095. };
  48096. for (var c = 0; c < i.mipmapCount; c++)
  48097. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48098. s[o].format = i.format,
  48099. s[o].width = i.width,
  48100. s[o].height = i.height
  48101. }
  48102. else
  48103. l.image.width = i.width,
  48104. l.image.height = i.height,
  48105. l.mipmaps = i.mipmaps;
  48106. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48107. l.format = i.format,
  48108. l.needsUpdate = !0,
  48109. t && t(l)
  48110. }, i, r);
  48111. return l
  48112. },
  48113. setPath: function(e) {
  48114. this.path = e
  48115. }
  48116. };
  48117. n.Material = function() {
  48118. Object.defineProperty(this, "id", {
  48119. value: n.MaterialIdCount++
  48120. }),
  48121. this.uuid = n.Math.generateUUID(),
  48122. this.name = "",
  48123. this.type = "Material",
  48124. this.side = n.FrontSide,
  48125. this.opacity = 1,
  48126. this.transparent = !1,
  48127. this.blending = n.NormalBlending,
  48128. this.blendSrc = n.SrcAlphaFactor,
  48129. this.blendDst = n.OneMinusSrcAlphaFactor,
  48130. this.blendEquation = n.AddEquation,
  48131. this.blendSrcAlpha = null,
  48132. this.blendDstAlpha = null,
  48133. this.blendEquationAlpha = null,
  48134. this.depthFunc = n.LessEqualDepth,
  48135. this.depthTest = !0,
  48136. this.depthWrite = !0,
  48137. this.colorWrite = !0,
  48138. this.precision = null,
  48139. this.polygonOffset = !1,
  48140. this.polygonOffsetFactor = 0,
  48141. this.polygonOffsetUnits = 0,
  48142. this.alphaTest = 0,
  48143. this.premultipliedAlpha = !1,
  48144. this.overdraw = 0,
  48145. this.visible = !0,
  48146. this._needsUpdate = !0
  48147. }
  48148. ,
  48149. n.Material.prototype = {
  48150. constructor: n.Material,
  48151. get needsUpdate() {
  48152. return this._needsUpdate
  48153. },
  48154. set needsUpdate(e) {
  48155. e === !0 && this.update(),
  48156. this._needsUpdate = e
  48157. },
  48158. setValues: function(e) {
  48159. if (void 0 !== e)
  48160. for (var t in e) {
  48161. var i = e[t];
  48162. if (void 0 !== i) {
  48163. var r = this[t];
  48164. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  48165. } else
  48166. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48167. }
  48168. },
  48169. toJSON: function(e) {
  48170. function t(e) {
  48171. var t = [];
  48172. for (var i in e) {
  48173. var n = e[i];
  48174. delete n.metadata,
  48175. t.push(n)
  48176. }
  48177. return t
  48178. }
  48179. var i = void 0 === e;
  48180. i && (e = {
  48181. textures: {},
  48182. images: {}
  48183. });
  48184. var r = {
  48185. metadata: {
  48186. version: 4.4,
  48187. type: "Material",
  48188. generator: "Material.toJSON"
  48189. }
  48190. };
  48191. if (r.uuid = this.uuid,
  48192. r.type = this.type,
  48193. "" !== this.name && (r.name = this.name),
  48194. this.color instanceof n.Color && (r.color = this.color.getHex()),
  48195. .5 !== this.roughness && (r.roughness = this.roughness),
  48196. .5 !== this.metalness && (r.metalness = this.metalness),
  48197. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  48198. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  48199. void 0 !== this.shininess && (r.shininess = this.shininess),
  48200. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  48201. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  48202. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  48203. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  48204. r.bumpScale = this.bumpScale),
  48205. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  48206. r.normalScale = this.normalScale.toArray()),
  48207. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  48208. r.displacementScale = this.displacementScale,
  48209. r.displacementBias = this.displacementBias),
  48210. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  48211. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  48212. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  48213. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  48214. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  48215. r.reflectivity = this.reflectivity),
  48216. void 0 !== this.size && (r.size = this.size),
  48217. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  48218. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  48219. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  48220. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  48221. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  48222. this.opacity < 1 && (r.opacity = this.opacity),
  48223. this.transparent === !0 && (r.transparent = this.transparent),
  48224. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  48225. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  48226. this.wireframe === !0 && (r.wireframe = this.wireframe),
  48227. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  48228. i) {
  48229. var o = t(e.textures)
  48230. , a = t(e.images);
  48231. o.length > 0 && (r.textures = o),
  48232. a.length > 0 && (r.images = a)
  48233. }
  48234. return r
  48235. },
  48236. clone: function() {
  48237. return (new this.constructor).copy(this)
  48238. },
  48239. copy: function(e) {
  48240. return this.name = e.name,
  48241. this.side = e.side,
  48242. this.opacity = e.opacity,
  48243. this.transparent = e.transparent,
  48244. this.blending = e.blending,
  48245. this.blendSrc = e.blendSrc,
  48246. this.blendDst = e.blendDst,
  48247. this.blendEquation = e.blendEquation,
  48248. this.blendSrcAlpha = e.blendSrcAlpha,
  48249. this.blendDstAlpha = e.blendDstAlpha,
  48250. this.blendEquationAlpha = e.blendEquationAlpha,
  48251. this.depthFunc = e.depthFunc,
  48252. this.depthTest = e.depthTest,
  48253. this.depthWrite = e.depthWrite,
  48254. this.colorWrite = e.colorWrite,
  48255. this.precision = e.precision,
  48256. this.polygonOffset = e.polygonOffset,
  48257. this.polygonOffsetFactor = e.polygonOffsetFactor,
  48258. this.polygonOffsetUnits = e.polygonOffsetUnits,
  48259. this.alphaTest = e.alphaTest,
  48260. this.premultipliedAlpha = e.premultipliedAlpha,
  48261. this.overdraw = e.overdraw,
  48262. this.visible = e.visible,
  48263. this
  48264. },
  48265. update: function() {
  48266. this.dispatchEvent({
  48267. type: "update"
  48268. })
  48269. },
  48270. dispose: function() {
  48271. this.dispatchEvent({
  48272. type: "dispose"
  48273. })
  48274. }
  48275. },
  48276. n.EventDispatcher.prototype.apply(n.Material.prototype),
  48277. n.MaterialIdCount = 0,
  48278. n.LineBasicMaterial = function(e) {
  48279. n.Material.call(this),
  48280. this.type = "LineBasicMaterial",
  48281. this.color = new n.Color(16777215),
  48282. this.linewidth = 1,
  48283. this.linecap = "round",
  48284. this.linejoin = "round",
  48285. this.blending = n.NormalBlending,
  48286. this.vertexColors = n.NoColors,
  48287. this.fog = !0,
  48288. this.setValues(e)
  48289. }
  48290. ,
  48291. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  48292. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  48293. n.LineBasicMaterial.prototype.copy = function(e) {
  48294. return n.Material.prototype.copy.call(this, e),
  48295. this.color.copy(e.color),
  48296. this.linewidth = e.linewidth,
  48297. this.linecap = e.linecap,
  48298. this.linejoin = e.linejoin,
  48299. this.vertexColors = e.vertexColors,
  48300. this.fog = e.fog,
  48301. this
  48302. }
  48303. ,
  48304. n.LineDashedMaterial = function(e) {
  48305. n.Material.call(this),
  48306. this.type = "LineDashedMaterial",
  48307. this.color = new n.Color(16777215),
  48308. this.linewidth = 1,
  48309. this.scale = 1,
  48310. this.dashSize = 3,
  48311. this.gapSize = 1,
  48312. this.blending = n.NormalBlending,
  48313. this.vertexColors = n.NoColors,
  48314. this.fog = !0,
  48315. this.setValues(e)
  48316. }
  48317. ,
  48318. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  48319. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  48320. n.LineDashedMaterial.prototype.copy = function(e) {
  48321. return n.Material.prototype.copy.call(this, e),
  48322. this.color.copy(e.color),
  48323. this.linewidth = e.linewidth,
  48324. this.scale = e.scale,
  48325. this.dashSize = e.dashSize,
  48326. this.gapSize = e.gapSize,
  48327. this.vertexColors = e.vertexColors,
  48328. this.fog = e.fog,
  48329. this
  48330. }
  48331. ,
  48332. n.MeshBasicMaterial = function(e) {
  48333. n.Material.call(this),
  48334. this.type = "MeshBasicMaterial",
  48335. this.color = new n.Color(16777215),
  48336. this.map = null,
  48337. this.aoMap = null,
  48338. this.aoMapIntensity = 1,
  48339. this.specularMap = null,
  48340. this.alphaMap = null,
  48341. this.envMap = null,
  48342. this.combine = n.MultiplyOperation,
  48343. this.reflectivity = 1,
  48344. this.refractionRatio = .98,
  48345. this.fog = !0,
  48346. this.shading = n.SmoothShading,
  48347. this.blending = n.NormalBlending,
  48348. this.wireframe = !1,
  48349. this.wireframeLinewidth = 1,
  48350. this.wireframeLinecap = "round",
  48351. this.wireframeLinejoin = "round",
  48352. this.vertexColors = n.NoColors,
  48353. this.skinning = !1,
  48354. this.morphTargets = !1,
  48355. this.setValues(e)
  48356. }
  48357. ,
  48358. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  48359. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  48360. n.MeshBasicMaterial.prototype.copy = function(e) {
  48361. return n.Material.prototype.copy.call(this, e),
  48362. this.color.copy(e.color),
  48363. this.map = e.map,
  48364. this.aoMap = e.aoMap,
  48365. this.aoMapIntensity = e.aoMapIntensity,
  48366. this.specularMap = e.specularMap,
  48367. this.alphaMap = e.alphaMap,
  48368. this.envMap = e.envMap,
  48369. this.combine = e.combine,
  48370. this.reflectivity = e.reflectivity,
  48371. this.refractionRatio = e.refractionRatio,
  48372. this.fog = e.fog,
  48373. this.shading = e.shading,
  48374. this.wireframe = e.wireframe,
  48375. this.wireframeLinewidth = e.wireframeLinewidth,
  48376. this.wireframeLinecap = e.wireframeLinecap,
  48377. this.wireframeLinejoin = e.wireframeLinejoin,
  48378. this.vertexColors = e.vertexColors,
  48379. this.skinning = e.skinning,
  48380. this.morphTargets = e.morphTargets,
  48381. this
  48382. }
  48383. ,
  48384. n.MeshLambertMaterial = function(e) {
  48385. n.Material.call(this),
  48386. this.type = "MeshLambertMaterial",
  48387. this.color = new n.Color(16777215),
  48388. this.map = null,
  48389. this.lightMap = null,
  48390. this.lightMapIntensity = 1,
  48391. this.aoMap = null,
  48392. this.aoMapIntensity = 1,
  48393. this.emissive = new n.Color(0),
  48394. this.emissiveIntensity = 1,
  48395. this.emissiveMap = null,
  48396. this.specularMap = null,
  48397. this.alphaMap = null,
  48398. this.envMap = null,
  48399. this.combine = n.MultiplyOperation,
  48400. this.reflectivity = 1,
  48401. this.refractionRatio = .98,
  48402. this.fog = !0,
  48403. this.blending = n.NormalBlending,
  48404. this.wireframe = !1,
  48405. this.wireframeLinewidth = 1,
  48406. this.wireframeLinecap = "round",
  48407. this.wireframeLinejoin = "round",
  48408. this.vertexColors = n.NoColors,
  48409. this.skinning = !1,
  48410. this.morphTargets = !1,
  48411. this.morphNormals = !1,
  48412. this.setValues(e)
  48413. }
  48414. ,
  48415. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  48416. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  48417. n.MeshLambertMaterial.prototype.copy = function(e) {
  48418. return n.Material.prototype.copy.call(this, e),
  48419. this.color.copy(e.color),
  48420. this.map = e.map,
  48421. this.lightMap = e.lightMap,
  48422. this.lightMapIntensity = e.lightMapIntensity,
  48423. this.aoMap = e.aoMap,
  48424. this.aoMapIntensity = e.aoMapIntensity,
  48425. this.emissive.copy(e.emissive),
  48426. this.emissiveMap = e.emissiveMap,
  48427. this.emissiveIntensity = e.emissiveIntensity,
  48428. this.specularMap = e.specularMap,
  48429. this.alphaMap = e.alphaMap,
  48430. this.envMap = e.envMap,
  48431. this.combine = e.combine,
  48432. this.reflectivity = e.reflectivity,
  48433. this.refractionRatio = e.refractionRatio,
  48434. this.fog = e.fog,
  48435. this.wireframe = e.wireframe,
  48436. this.wireframeLinewidth = e.wireframeLinewidth,
  48437. this.wireframeLinecap = e.wireframeLinecap,
  48438. this.wireframeLinejoin = e.wireframeLinejoin,
  48439. this.vertexColors = e.vertexColors,
  48440. this.skinning = e.skinning,
  48441. this.morphTargets = e.morphTargets,
  48442. this.morphNormals = e.morphNormals,
  48443. this
  48444. }
  48445. ,
  48446. n.MeshPhongMaterial = function(e) {
  48447. n.Material.call(this),
  48448. this.type = "MeshPhongMaterial",
  48449. this.color = new n.Color(16777215),
  48450. this.specular = new n.Color(1118481),
  48451. this.shininess = 30,
  48452. this.map = null,
  48453. this.lightMap = null,
  48454. this.lightMapIntensity = 1,
  48455. this.aoMap = null,
  48456. this.aoMapIntensity = 1,
  48457. this.emissive = new n.Color(0),
  48458. this.emissiveIntensity = 1,
  48459. this.emissiveMap = null,
  48460. this.bumpMap = null,
  48461. this.bumpScale = 1,
  48462. this.normalMap = null,
  48463. this.normalScale = new n.Vector2(1,1),
  48464. this.displacementMap = null,
  48465. this.displacementScale = 1,
  48466. this.displacementBias = 0,
  48467. this.specularMap = null,
  48468. this.alphaMap = null,
  48469. this.envMap = null,
  48470. this.combine = n.MultiplyOperation,
  48471. this.reflectivity = 1,
  48472. this.refractionRatio = .98,
  48473. this.fog = !0,
  48474. this.shading = n.SmoothShading,
  48475. this.blending = n.NormalBlending,
  48476. this.wireframe = !1,
  48477. this.wireframeLinewidth = 1,
  48478. this.wireframeLinecap = "round",
  48479. this.wireframeLinejoin = "round",
  48480. this.vertexColors = n.NoColors,
  48481. this.skinning = !1,
  48482. this.morphTargets = !1,
  48483. this.morphNormals = !1,
  48484. this.setValues(e)
  48485. }
  48486. ,
  48487. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  48488. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  48489. n.MeshPhongMaterial.prototype.copy = function(e) {
  48490. return n.Material.prototype.copy.call(this, e),
  48491. this.color.copy(e.color),
  48492. this.specular.copy(e.specular),
  48493. this.shininess = e.shininess,
  48494. this.map = e.map,
  48495. this.lightMap = e.lightMap,
  48496. this.lightMapIntensity = e.lightMapIntensity,
  48497. this.aoMap = e.aoMap,
  48498. this.aoMapIntensity = e.aoMapIntensity,
  48499. this.emissive.copy(e.emissive),
  48500. this.emissiveMap = e.emissiveMap,
  48501. this.emissiveIntensity = e.emissiveIntensity,
  48502. this.bumpMap = e.bumpMap,
  48503. this.bumpScale = e.bumpScale,
  48504. this.normalMap = e.normalMap,
  48505. this.normalScale.copy(e.normalScale),
  48506. this.displacementMap = e.displacementMap,
  48507. this.displacementScale = e.displacementScale,
  48508. this.displacementBias = e.displacementBias,
  48509. this.specularMap = e.specularMap,
  48510. this.alphaMap = e.alphaMap,
  48511. this.envMap = e.envMap,
  48512. this.combine = e.combine,
  48513. this.reflectivity = e.reflectivity,
  48514. this.refractionRatio = e.refractionRatio,
  48515. this.fog = e.fog,
  48516. this.shading = e.shading,
  48517. this.wireframe = e.wireframe,
  48518. this.wireframeLinewidth = e.wireframeLinewidth,
  48519. this.wireframeLinecap = e.wireframeLinecap,
  48520. this.wireframeLinejoin = e.wireframeLinejoin,
  48521. this.vertexColors = e.vertexColors,
  48522. this.skinning = e.skinning,
  48523. this.morphTargets = e.morphTargets,
  48524. this.morphNormals = e.morphNormals,
  48525. this
  48526. }
  48527. ,
  48528. n.MeshStandardMaterial = function(e) {
  48529. n.Material.call(this),
  48530. this.type = "MeshStandardMaterial",
  48531. this.color = new n.Color(16777215),
  48532. this.roughness = .5,
  48533. this.metalness = .5,
  48534. this.map = null,
  48535. this.lightMap = null,
  48536. this.lightMapIntensity = 1,
  48537. this.aoMap = null,
  48538. this.aoMapIntensity = 1,
  48539. this.emissive = new n.Color(0),
  48540. this.emissiveIntensity = 1,
  48541. this.emissiveMap = null,
  48542. this.bumpMap = null,
  48543. this.bumpScale = 1,
  48544. this.normalMap = null,
  48545. this.normalScale = new n.Vector2(1,1),
  48546. this.displacementMap = null,
  48547. this.displacementScale = 1,
  48548. this.displacementBias = 0,
  48549. this.roughnessMap = null,
  48550. this.metalnessMap = null,
  48551. this.alphaMap = null,
  48552. this.envMap = null,
  48553. this.envMapIntensity = 1,
  48554. this.refractionRatio = .98,
  48555. this.fog = !0,
  48556. this.shading = n.SmoothShading,
  48557. this.blending = n.NormalBlending,
  48558. this.wireframe = !1,
  48559. this.wireframeLinewidth = 1,
  48560. this.wireframeLinecap = "round",
  48561. this.wireframeLinejoin = "round",
  48562. this.vertexColors = n.NoColors,
  48563. this.skinning = !1,
  48564. this.morphTargets = !1,
  48565. this.morphNormals = !1,
  48566. this.setValues(e)
  48567. }
  48568. ,
  48569. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  48570. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  48571. n.MeshStandardMaterial.prototype.copy = function(e) {
  48572. return n.Material.prototype.copy.call(this, e),
  48573. this.color.copy(e.color),
  48574. this.roughness = e.roughness,
  48575. this.metalness = e.metalness,
  48576. this.map = e.map,
  48577. this.lightMap = e.lightMap,
  48578. this.lightMapIntensity = e.lightMapIntensity,
  48579. this.aoMap = e.aoMap,
  48580. this.aoMapIntensity = e.aoMapIntensity,
  48581. this.emissive.copy(e.emissive),
  48582. this.emissiveMap = e.emissiveMap,
  48583. this.emissiveIntensity = e.emissiveIntensity,
  48584. this.bumpMap = e.bumpMap,
  48585. this.bumpScale = e.bumpScale,
  48586. this.normalMap = e.normalMap,
  48587. this.normalScale.copy(e.normalScale),
  48588. this.displacementMap = e.displacementMap,
  48589. this.displacementScale = e.displacementScale,
  48590. this.displacementBias = e.displacementBias,
  48591. this.roughnessMap = e.roughnessMap,
  48592. this.metalnessMap = e.metalnessMap,
  48593. this.alphaMap = e.alphaMap,
  48594. this.envMap = e.envMap,
  48595. this.envMapIntensity = e.envMapIntensity,
  48596. this.refractionRatio = e.refractionRatio,
  48597. this.fog = e.fog,
  48598. this.shading = e.shading,
  48599. this.wireframe = e.wireframe,
  48600. this.wireframeLinewidth = e.wireframeLinewidth,
  48601. this.wireframeLinecap = e.wireframeLinecap,
  48602. this.wireframeLinejoin = e.wireframeLinejoin,
  48603. this.vertexColors = e.vertexColors,
  48604. this.skinning = e.skinning,
  48605. this.morphTargets = e.morphTargets,
  48606. this.morphNormals = e.morphNormals,
  48607. this
  48608. }
  48609. ,
  48610. n.MeshDepthMaterial = function(e) {
  48611. n.Material.call(this),
  48612. this.type = "MeshDepthMaterial",
  48613. this.morphTargets = !1,
  48614. this.wireframe = !1,
  48615. this.wireframeLinewidth = 1,
  48616. this.setValues(e)
  48617. }
  48618. ,
  48619. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  48620. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  48621. n.MeshDepthMaterial.prototype.copy = function(e) {
  48622. return n.Material.prototype.copy.call(this, e),
  48623. this.wireframe = e.wireframe,
  48624. this.wireframeLinewidth = e.wireframeLinewidth,
  48625. this
  48626. }
  48627. ,
  48628. n.MeshNormalMaterial = function(e) {
  48629. n.Material.call(this, e),
  48630. this.type = "MeshNormalMaterial",
  48631. this.wireframe = !1,
  48632. this.wireframeLinewidth = 1,
  48633. this.morphTargets = !1,
  48634. this.setValues(e)
  48635. }
  48636. ,
  48637. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  48638. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  48639. n.MeshNormalMaterial.prototype.copy = function(e) {
  48640. return n.Material.prototype.copy.call(this, e),
  48641. this.wireframe = e.wireframe,
  48642. this.wireframeLinewidth = e.wireframeLinewidth,
  48643. this
  48644. }
  48645. ,
  48646. n.MultiMaterial = function(e) {
  48647. this.uuid = n.Math.generateUUID(),
  48648. this.type = "MultiMaterial",
  48649. this.materials = e instanceof Array ? e : [],
  48650. this.visible = !0
  48651. }
  48652. ,
  48653. n.MultiMaterial.prototype = {
  48654. constructor: n.MultiMaterial,
  48655. toJSON: function(e) {
  48656. for (var t = {
  48657. metadata: {
  48658. version: 4.2,
  48659. type: "material",
  48660. generator: "MaterialExporter"
  48661. },
  48662. uuid: this.uuid,
  48663. type: this.type,
  48664. materials: []
  48665. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  48666. var o = i[n].toJSON(e);
  48667. delete o.metadata,
  48668. t.materials.push(o)
  48669. }
  48670. return t.visible = this.visible,
  48671. t
  48672. },
  48673. clone: function() {
  48674. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  48675. e.materials.push(this.materials[t].clone());
  48676. return e.visible = this.visible,
  48677. e
  48678. }
  48679. },
  48680. n.PointsMaterial = function(e) {
  48681. n.Material.call(this),
  48682. this.type = "PointsMaterial",
  48683. this.color = new n.Color(16777215),
  48684. this.map = null,
  48685. this.size = 1,
  48686. this.sizeAttenuation = !0,
  48687. this.blending = n.NormalBlending,
  48688. this.vertexColors = n.NoColors,
  48689. this.fog = !0,
  48690. this.setValues(e)
  48691. }
  48692. ,
  48693. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  48694. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  48695. n.PointsMaterial.prototype.copy = function(e) {
  48696. return n.Material.prototype.copy.call(this, e),
  48697. this.color.copy(e.color),
  48698. this.map = e.map,
  48699. this.size = e.size,
  48700. this.sizeAttenuation = e.sizeAttenuation,
  48701. this.vertexColors = e.vertexColors,
  48702. this.fog = e.fog,
  48703. this
  48704. }
  48705. ,
  48706. n.ShaderMaterial = function(e) {
  48707. n.Material.call(this),
  48708. this.type = "ShaderMaterial",
  48709. this.defines = {},
  48710. this.uniforms = {},
  48711. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  48712. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  48713. this.shading = n.SmoothShading,
  48714. this.linewidth = 1,
  48715. this.wireframe = !1,
  48716. this.wireframeLinewidth = 1,
  48717. this.fog = !1,
  48718. this.lights = !1,
  48719. this.vertexColors = n.NoColors,
  48720. this.skinning = !1,
  48721. this.morphTargets = !1,
  48722. this.morphNormals = !1,
  48723. this.extensions = {
  48724. derivatives: !1,
  48725. fragDepth: !1,
  48726. drawBuffers: !1,
  48727. shaderTextureLOD: !1
  48728. },
  48729. this.defaultAttributeValues = {
  48730. color: [1, 1, 1],
  48731. uv: [0, 0],
  48732. uv2: [0, 0]
  48733. },
  48734. this.index0AttributeName = void 0,
  48735. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  48736. this.setValues(e))
  48737. }
  48738. ,
  48739. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  48740. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  48741. n.ShaderMaterial.prototype.copy = function(e) {
  48742. return n.Material.prototype.copy.call(this, e),
  48743. this.fragmentShader = e.fragmentShader,
  48744. this.vertexShader = e.vertexShader,
  48745. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  48746. this.defines = e.defines,
  48747. this.shading = e.shading,
  48748. this.wireframe = e.wireframe,
  48749. this.wireframeLinewidth = e.wireframeLinewidth,
  48750. this.fog = e.fog,
  48751. this.lights = e.lights,
  48752. this.vertexColors = e.vertexColors,
  48753. this.skinning = e.skinning,
  48754. this.morphTargets = e.morphTargets,
  48755. this.morphNormals = e.morphNormals,
  48756. this.extensions = e.extensions,
  48757. this
  48758. }
  48759. ,
  48760. n.ShaderMaterial.prototype.toJSON = function(e) {
  48761. var t = n.Material.prototype.toJSON.call(this, e);
  48762. return t.uniforms = this.uniforms,
  48763. t.vertexShader = this.vertexShader,
  48764. t.fragmentShader = this.fragmentShader,
  48765. t
  48766. }
  48767. ,
  48768. n.RawShaderMaterial = function(e) {
  48769. n.ShaderMaterial.call(this, e),
  48770. this.type = "RawShaderMaterial"
  48771. }
  48772. ,
  48773. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  48774. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  48775. n.SpriteMaterial = function(e) {
  48776. n.Material.call(this),
  48777. this.type = "SpriteMaterial",
  48778. this.color = new n.Color(16777215),
  48779. this.map = null,
  48780. this.rotation = 0,
  48781. this.fog = !1,
  48782. this.setValues(e)
  48783. }
  48784. ,
  48785. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  48786. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  48787. n.SpriteMaterial.prototype.copy = function(e) {
  48788. return n.Material.prototype.copy.call(this, e),
  48789. this.color.copy(e.color),
  48790. this.map = e.map,
  48791. this.rotation = e.rotation,
  48792. this.fog = e.fog,
  48793. this
  48794. }
  48795. ,
  48796. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  48797. Object.defineProperty(this, "id", {
  48798. value: n.TextureIdCount++
  48799. }),
  48800. this.uuid = n.Math.generateUUID(),
  48801. this.name = "",
  48802. this.sourceFile = "",
  48803. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  48804. this.mipmaps = [],
  48805. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  48806. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  48807. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  48808. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  48809. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  48810. this.anisotropy = void 0 !== c ? c : 1,
  48811. this.format = void 0 !== s ? s : n.RGBAFormat,
  48812. this.type = void 0 !== l ? l : n.UnsignedByteType,
  48813. this.offset = new n.Vector2(0,0),
  48814. this.repeat = new n.Vector2(1,1),
  48815. this.generateMipmaps = !0,
  48816. this.premultiplyAlpha = !1,
  48817. this.flipY = !0,
  48818. this.unpackAlignment = 4,
  48819. this.encoding = n.LinearEncoding,
  48820. this.version = 0,
  48821. this.onUpdate = null
  48822. }
  48823. ,
  48824. n.Texture.DEFAULT_IMAGE = void 0,
  48825. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  48826. n.Texture.prototype = {
  48827. constructor: n.Texture,
  48828. set needsUpdate(e) {
  48829. e === !0 && this.version++
  48830. },
  48831. clone: function() {
  48832. return (new this.constructor).copy(this)
  48833. },
  48834. copy: function(e) {
  48835. return this.image = e.image,
  48836. this.mipmaps = e.mipmaps.slice(0),
  48837. this.mapping = e.mapping,
  48838. this.wrapS = e.wrapS,
  48839. this.wrapT = e.wrapT,
  48840. this.magFilter = e.magFilter,
  48841. this.minFilter = e.minFilter,
  48842. this.anisotropy = e.anisotropy,
  48843. this.format = e.format,
  48844. this.type = e.type,
  48845. this.offset.copy(e.offset),
  48846. this.repeat.copy(e.repeat),
  48847. this.generateMipmaps = e.generateMipmaps,
  48848. this.premultiplyAlpha = e.premultiplyAlpha,
  48849. this.flipY = e.flipY,
  48850. this.unpackAlignment = e.unpackAlignment,
  48851. this.encoding = e.encoding,
  48852. this
  48853. },
  48854. toJSON: function(e) {
  48855. function t(e) {
  48856. var t;
  48857. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  48858. t.width = e.width,
  48859. t.height = e.height,
  48860. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  48861. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  48862. }
  48863. if (void 0 !== e.textures[this.uuid])
  48864. return e.textures[this.uuid];
  48865. var i = {
  48866. metadata: {
  48867. version: 4.4,
  48868. type: "Texture",
  48869. generator: "Texture.toJSON"
  48870. },
  48871. uuid: this.uuid,
  48872. name: this.name,
  48873. mapping: this.mapping,
  48874. repeat: [this.repeat.x, this.repeat.y],
  48875. offset: [this.offset.x, this.offset.y],
  48876. wrap: [this.wrapS, this.wrapT],
  48877. minFilter: this.minFilter,
  48878. magFilter: this.magFilter,
  48879. anisotropy: this.anisotropy
  48880. };
  48881. if (void 0 !== this.image) {
  48882. var r = this.image;
  48883. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  48884. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  48885. uuid: r.uuid,
  48886. url: t(r)
  48887. }),
  48888. i.image = r.uuid
  48889. }
  48890. return e.textures[this.uuid] = i,
  48891. i
  48892. },
  48893. dispose: function() {
  48894. this.dispatchEvent({
  48895. type: "dispose"
  48896. })
  48897. },
  48898. transformUv: function(e) {
  48899. if (this.mapping === n.UVMapping) {
  48900. if (e.multiply(this.repeat),
  48901. e.add(this.offset),
  48902. e.x < 0 || e.x > 1)
  48903. switch (this.wrapS) {
  48904. case n.RepeatWrapping:
  48905. e.x = e.x - Math.floor(e.x);
  48906. break;
  48907. case n.ClampToEdgeWrapping:
  48908. e.x = e.x < 0 ? 0 : 1;
  48909. break;
  48910. case n.MirroredRepeatWrapping:
  48911. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  48912. }
  48913. if (e.y < 0 || e.y > 1)
  48914. switch (this.wrapT) {
  48915. case n.RepeatWrapping:
  48916. e.y = e.y - Math.floor(e.y);
  48917. break;
  48918. case n.ClampToEdgeWrapping:
  48919. e.y = e.y < 0 ? 0 : 1;
  48920. break;
  48921. case n.MirroredRepeatWrapping:
  48922. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  48923. }
  48924. this.flipY && (e.y = 1 - e.y)
  48925. }
  48926. }
  48927. },
  48928. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  48929. n.TextureIdCount = 0,
  48930. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  48931. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48932. this.needsUpdate = !0
  48933. }
  48934. ,
  48935. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  48936. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  48937. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  48938. e = void 0 !== e ? e : [],
  48939. t = void 0 !== t ? t : n.CubeReflectionMapping,
  48940. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48941. this.flipY = !1
  48942. }
  48943. ,
  48944. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  48945. n.CubeTexture.prototype.constructor = n.CubeTexture,
  48946. Object.defineProperty(n.CubeTexture.prototype, "images", {
  48947. get: function() {
  48948. return this.image
  48949. },
  48950. set: function(e) {
  48951. this.image = e
  48952. }
  48953. }),
  48954. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48955. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48956. this.image = {
  48957. width: t,
  48958. height: i
  48959. },
  48960. this.mipmaps = e,
  48961. this.flipY = !1,
  48962. this.generateMipmaps = !1
  48963. }
  48964. ,
  48965. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  48966. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  48967. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  48968. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  48969. this.image = {
  48970. data: e,
  48971. width: t,
  48972. height: i
  48973. },
  48974. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  48975. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  48976. this.flipY = !1,
  48977. this.generateMipmaps = !1
  48978. }
  48979. ,
  48980. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  48981. n.DataTexture.prototype.constructor = n.DataTexture,
  48982. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  48983. function h() {
  48984. requestAnimationFrame(h)
  48985. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  48986. u.needsUpdate = !0
  48987. }
  48988. }
  48989. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  48990. this.generateMipmaps = !1;
  48991. var u = this;
  48992. h()
  48993. }
  48994. ,
  48995. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  48996. n.VideoTexture.prototype.constructor = n.VideoTexture,
  48997. n.Group = function() {
  48998. n.Object3D.call(this),
  48999. this.type = "Group"
  49000. }
  49001. ,
  49002. n.Group.prototype = Object.create(n.Object3D.prototype),
  49003. n.Group.prototype.constructor = n.Group,
  49004. n.Points = function(e, t) {
  49005. n.Object3D.call(this),
  49006. this.type = "Points",
  49007. this.geometry = void 0 !== e ? e : new n.Geometry,
  49008. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49009. color: 16777215 * Math.random()
  49010. })
  49011. }
  49012. ,
  49013. n.Points.prototype = Object.create(n.Object3D.prototype),
  49014. n.Points.prototype.constructor = n.Points,
  49015. n.Points.prototype.raycast = function() {
  49016. var e = new n.Matrix4
  49017. , t = new n.Ray
  49018. , i = new n.Sphere;
  49019. return function(r, o) {
  49020. function a(e, i) {
  49021. var n = t.distanceSqToPoint(e);
  49022. if (n < d) {
  49023. var a = t.closestPointToPoint(e);
  49024. a.applyMatrix4(c);
  49025. var l = r.ray.origin.distanceTo(a);
  49026. if (l < r.near || l > r.far)
  49027. return;
  49028. o.push({
  49029. distance: l,
  49030. distanceToRay: Math.sqrt(n),
  49031. point: a.clone(),
  49032. index: i,
  49033. face: null,
  49034. object: s
  49035. })
  49036. }
  49037. }
  49038. var s = this
  49039. , l = this.geometry
  49040. , c = this.matrixWorld
  49041. , h = r.params.Points.threshold;
  49042. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49043. i.copy(l.boundingSphere),
  49044. i.applyMatrix4(c),
  49045. r.ray.intersectsSphere(i) !== !1) {
  49046. e.getInverse(c),
  49047. t.copy(r.ray).applyMatrix4(e);
  49048. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49049. , d = u * u
  49050. , p = new n.Vector3;
  49051. if (l instanceof n.BufferGeometry) {
  49052. var f = l.index
  49053. , g = l.attributes
  49054. , m = g.position.array;
  49055. if (null !== f)
  49056. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49057. var C = v[A];
  49058. p.fromArray(m, 3 * C),
  49059. a(p, C)
  49060. }
  49061. else
  49062. for (var A = 0, I = m.length / 3; A < I; A++)
  49063. p.fromArray(m, 3 * A),
  49064. a(p, A)
  49065. } else
  49066. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49067. a(E[A], A)
  49068. }
  49069. }
  49070. }(),
  49071. n.Points.prototype.clone = function() {
  49072. return new this.constructor(this.geometry,this.material).copy(this)
  49073. }
  49074. ,
  49075. n.Line = function(e, t, i) {
  49076. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49077. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49078. this.type = "Line",
  49079. this.geometry = void 0 !== e ? e : new n.Geometry,
  49080. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49081. color: 16777215 * Math.random()
  49082. })))
  49083. }
  49084. ,
  49085. n.Line.prototype = Object.create(n.Object3D.prototype),
  49086. n.Line.prototype.constructor = n.Line,
  49087. n.Line.prototype.raycast = function() {
  49088. var e = new n.Matrix4
  49089. , t = new n.Ray
  49090. , i = new n.Sphere;
  49091. return function(r, o) {
  49092. var a = r.linePrecision
  49093. , s = a * a
  49094. , l = this.geometry
  49095. , c = this.matrixWorld;
  49096. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49097. i.copy(l.boundingSphere),
  49098. i.applyMatrix4(c),
  49099. r.ray.intersectsSphere(i) !== !1) {
  49100. e.getInverse(c),
  49101. t.copy(r.ray).applyMatrix4(e);
  49102. var h = new n.Vector3
  49103. , u = new n.Vector3
  49104. , d = new n.Vector3
  49105. , p = new n.Vector3
  49106. , f = this instanceof n.LineSegments ? 2 : 1;
  49107. if (l instanceof n.BufferGeometry) {
  49108. var g = l.index
  49109. , m = l.attributes
  49110. , v = m.position.array;
  49111. if (null !== g)
  49112. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49113. var I = A[y]
  49114. , E = A[y + 1];
  49115. h.fromArray(v, 3 * I),
  49116. u.fromArray(v, 3 * E);
  49117. var b = t.distanceSqToSegment(h, u, p, d);
  49118. if (!(b > s)) {
  49119. p.applyMatrix4(this.matrixWorld);
  49120. var w = r.ray.origin.distanceTo(p);
  49121. w < r.near || w > r.far || o.push({
  49122. distance: w,
  49123. point: d.clone().applyMatrix4(this.matrixWorld),
  49124. index: y,
  49125. face: null,
  49126. faceIndex: null,
  49127. object: this
  49128. })
  49129. }
  49130. }
  49131. else
  49132. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49133. h.fromArray(v, 3 * y),
  49134. u.fromArray(v, 3 * y + 3);
  49135. var b = t.distanceSqToSegment(h, u, p, d);
  49136. if (!(b > s)) {
  49137. p.applyMatrix4(this.matrixWorld);
  49138. var w = r.ray.origin.distanceTo(p);
  49139. w < r.near || w > r.far || o.push({
  49140. distance: w,
  49141. point: d.clone().applyMatrix4(this.matrixWorld),
  49142. index: y,
  49143. face: null,
  49144. faceIndex: null,
  49145. object: this
  49146. })
  49147. }
  49148. }
  49149. } else if (l instanceof n.Geometry)
  49150. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49151. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49152. if (!(b > s)) {
  49153. p.applyMatrix4(this.matrixWorld);
  49154. var w = r.ray.origin.distanceTo(p);
  49155. w < r.near || w > r.far || o.push({
  49156. distance: w,
  49157. point: d.clone().applyMatrix4(this.matrixWorld),
  49158. index: y,
  49159. face: null,
  49160. faceIndex: null,
  49161. object: this
  49162. })
  49163. }
  49164. }
  49165. }
  49166. }
  49167. }(),
  49168. n.Line.prototype.clone = function() {
  49169. return new this.constructor(this.geometry,this.material).copy(this)
  49170. }
  49171. ,
  49172. n.LineStrip = 0,
  49173. n.LinePieces = 1,
  49174. n.LineSegments = function(e, t) {
  49175. n.Line.call(this, e, t),
  49176. this.type = "LineSegments"
  49177. }
  49178. ,
  49179. n.LineSegments.prototype = Object.create(n.Line.prototype),
  49180. n.LineSegments.prototype.constructor = n.LineSegments,
  49181. n.Mesh = function(e, t) {
  49182. n.Object3D.call(this),
  49183. this.type = "Mesh",
  49184. this.geometry = void 0 !== e ? e : new n.Geometry,
  49185. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  49186. color: 16777215 * Math.random()
  49187. }),
  49188. this.drawMode = n.TrianglesDrawMode,
  49189. this.updateMorphTargets()
  49190. }
  49191. ,
  49192. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  49193. n.Mesh.prototype.constructor = n.Mesh,
  49194. n.Mesh.prototype.setDrawMode = function(e) {
  49195. this.drawMode = e
  49196. }
  49197. ,
  49198. n.Mesh.prototype.updateMorphTargets = function() {
  49199. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  49200. this.morphTargetBase = -1,
  49201. this.morphTargetInfluences = [],
  49202. this.morphTargetDictionary = {};
  49203. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  49204. this.morphTargetInfluences.push(0),
  49205. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  49206. }
  49207. }
  49208. ,
  49209. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  49210. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  49211. 0)
  49212. }
  49213. ,
  49214. n.Mesh.prototype.raycast = function() {
  49215. function e(e, t, i, r, o, a, s) {
  49216. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  49217. o.multiplyScalar(m.x),
  49218. a.multiplyScalar(m.y),
  49219. s.multiplyScalar(m.z),
  49220. o.add(a).add(s),
  49221. o.clone()
  49222. }
  49223. function t(e, t, i, r, o, a, s) {
  49224. var l, c = e.material;
  49225. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  49226. null === l)
  49227. return null;
  49228. A.copy(s),
  49229. A.applyMatrix4(e.matrixWorld);
  49230. var h = t.ray.origin.distanceTo(A);
  49231. return h < t.near || h > t.far ? null : {
  49232. distance: h,
  49233. point: A.clone(),
  49234. object: e
  49235. }
  49236. }
  49237. function i(i, r, o, a, h, u, d, m) {
  49238. s.fromArray(a, 3 * u),
  49239. l.fromArray(a, 3 * d),
  49240. c.fromArray(a, 3 * m);
  49241. var A = t(i, r, o, s, l, c, v);
  49242. return A && (h && (p.fromArray(h, 2 * u),
  49243. f.fromArray(h, 2 * d),
  49244. g.fromArray(h, 2 * m),
  49245. A.uv = e(v, s, l, c, p, f, g)),
  49246. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  49247. A.faceIndex = u),
  49248. A
  49249. }
  49250. var r = new n.Matrix4
  49251. , o = new n.Ray
  49252. , a = new n.Sphere
  49253. , s = new n.Vector3
  49254. , l = new n.Vector3
  49255. , c = new n.Vector3
  49256. , h = new n.Vector3
  49257. , u = new n.Vector3
  49258. , d = new n.Vector3
  49259. , p = new n.Vector2
  49260. , f = new n.Vector2
  49261. , g = new n.Vector2
  49262. , m = new n.Vector3
  49263. , v = new n.Vector3
  49264. , A = new n.Vector3;
  49265. return function(m, A) {
  49266. var y = this.geometry
  49267. , C = this.material
  49268. , I = this.matrixWorld;
  49269. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  49270. a.copy(y.boundingSphere),
  49271. a.applyMatrix4(I),
  49272. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  49273. o.copy(m.ray).applyMatrix4(r),
  49274. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  49275. var E, b;
  49276. if (y instanceof n.BufferGeometry) {
  49277. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  49278. if (void 0 !== S.uv && (E = S.uv.array),
  49279. null !== x)
  49280. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  49281. w = R[P],
  49282. _ = R[P + 1],
  49283. T = R[P + 2],
  49284. b = i(this, m, o, M, E, w, _, T),
  49285. b && (b.faceIndex = Math.floor(P / 3),
  49286. A.push(b));
  49287. else
  49288. for (var P = 0, O = M.length; P < O; P += 9)
  49289. w = P / 3,
  49290. _ = w + 1,
  49291. T = w + 2,
  49292. b = i(this, m, o, M, E, w, _, T),
  49293. b && (b.index = w,
  49294. A.push(b))
  49295. } else if (y instanceof n.Geometry) {
  49296. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  49297. k.length > 0 && (E = k);
  49298. for (var H = 0, G = U.length; H < G; H++) {
  49299. var z = U[H]
  49300. , W = B === !0 ? F[z.materialIndex] : C;
  49301. if (void 0 !== W) {
  49302. if (L = V[z.a],
  49303. D = V[z.b],
  49304. N = V[z.c],
  49305. W.morphTargets === !0) {
  49306. var j = y.morphTargets
  49307. , Y = this.morphTargetInfluences;
  49308. s.set(0, 0, 0),
  49309. l.set(0, 0, 0),
  49310. c.set(0, 0, 0);
  49311. for (var X = 0, Z = j.length; X < Z; X++) {
  49312. var q = Y[X];
  49313. if (0 !== q) {
  49314. var K = j[X].vertices;
  49315. s.addScaledVector(h.subVectors(K[z.a], L), q),
  49316. l.addScaledVector(u.subVectors(K[z.b], D), q),
  49317. c.addScaledVector(d.subVectors(K[z.c], N), q)
  49318. }
  49319. }
  49320. s.add(L),
  49321. l.add(D),
  49322. c.add(N),
  49323. L = s,
  49324. D = l,
  49325. N = c
  49326. }
  49327. if (b = t(this, m, o, L, D, N, v)) {
  49328. if (E) {
  49329. var Q = E[H];
  49330. p.copy(Q[0]),
  49331. f.copy(Q[1]),
  49332. g.copy(Q[2]),
  49333. b.uv = e(v, L, D, N, p, f, g)
  49334. }
  49335. b.face = z,
  49336. b.faceIndex = H,
  49337. A.push(b)
  49338. }
  49339. }
  49340. }
  49341. }
  49342. }
  49343. }
  49344. }(),
  49345. n.Mesh.prototype.clone = function() {
  49346. return new this.constructor(this.geometry,this.material).copy(this)
  49347. }
  49348. ,
  49349. n.Bone = function(e) {
  49350. n.Object3D.call(this),
  49351. this.type = "Bone",
  49352. this.skin = e
  49353. }
  49354. ,
  49355. n.Bone.prototype = Object.create(n.Object3D.prototype),
  49356. n.Bone.prototype.constructor = n.Bone,
  49357. n.Bone.prototype.copy = function(e) {
  49358. return n.Object3D.prototype.copy.call(this, e),
  49359. this.skin = e.skin,
  49360. this
  49361. }
  49362. ,
  49363. n.Skeleton = function(e, t, i) {
  49364. if (this.useVertexTexture = void 0 === i || i,
  49365. this.identityMatrix = new n.Matrix4,
  49366. e = e || [],
  49367. this.bones = e.slice(0),
  49368. this.useVertexTexture) {
  49369. var r = Math.sqrt(4 * this.bones.length);
  49370. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  49371. r = Math.max(r, 4),
  49372. this.boneTextureWidth = r,
  49373. this.boneTextureHeight = r,
  49374. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  49375. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  49376. } else
  49377. this.boneMatrices = new Float32Array(16 * this.bones.length);
  49378. if (void 0 === t)
  49379. this.calculateInverses();
  49380. else if (this.bones.length === t.length)
  49381. this.boneInverses = t.slice(0);
  49382. else {
  49383. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  49384. this.boneInverses = [];
  49385. for (var o = 0, a = this.bones.length; o < a; o++)
  49386. this.boneInverses.push(new n.Matrix4)
  49387. }
  49388. }
  49389. ,
  49390. n.Skeleton.prototype.calculateInverses = function() {
  49391. this.boneInverses = [];
  49392. for (var e = 0, t = this.bones.length; e < t; e++) {
  49393. var i = new n.Matrix4;
  49394. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  49395. this.boneInverses.push(i)
  49396. }
  49397. }
  49398. ,
  49399. n.Skeleton.prototype.pose = function() {
  49400. for (var e, t = 0, i = this.bones.length; t < i; t++)
  49401. e = this.bones[t],
  49402. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  49403. for (var t = 0, i = this.bones.length; t < i; t++)
  49404. e = this.bones[t],
  49405. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  49406. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  49407. e.matrix.decompose(e.position, e.quaternion, e.scale));
  49408. }
  49409. ,
  49410. n.Skeleton.prototype.update = function() {
  49411. var e = new n.Matrix4;
  49412. return function() {
  49413. for (var t = 0, i = this.bones.length; t < i; t++) {
  49414. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  49415. e.multiplyMatrices(n, this.boneInverses[t]),
  49416. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  49417. }
  49418. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  49419. }
  49420. }(),
  49421. n.Skeleton.prototype.clone = function() {
  49422. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  49423. }
  49424. ,
  49425. n.SkinnedMesh = function(e, t, i) {
  49426. n.Mesh.call(this, e, t),
  49427. this.type = "SkinnedMesh",
  49428. this.bindMode = "attached",
  49429. this.bindMatrix = new n.Matrix4,
  49430. this.bindMatrixInverse = new n.Matrix4;
  49431. var r = [];
  49432. if (this.geometry && void 0 !== this.geometry.bones) {
  49433. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  49434. a = this.geometry.bones[s],
  49435. o = new n.Bone(this),
  49436. r.push(o),
  49437. o.name = a.name,
  49438. o.position.fromArray(a.pos),
  49439. o.quaternion.fromArray(a.rotq),
  49440. void 0 !== a.scl && o.scale.fromArray(a.scl);
  49441. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  49442. a = this.geometry.bones[s],
  49443. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  49444. }
  49445. this.normalizeSkinWeights(),
  49446. this.updateMatrixWorld(!0),
  49447. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  49448. }
  49449. ,
  49450. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  49451. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  49452. n.SkinnedMesh.prototype.bind = function(e, t) {
  49453. this.skeleton = e,
  49454. void 0 === t && (this.updateMatrixWorld(!0),
  49455. this.skeleton.calculateInverses(),
  49456. t = this.matrixWorld),
  49457. this.bindMatrix.copy(t),
  49458. this.bindMatrixInverse.getInverse(t)
  49459. }
  49460. ,
  49461. n.SkinnedMesh.prototype.pose = function() {
  49462. this.skeleton.pose()
  49463. }
  49464. ,
  49465. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  49466. if (this.geometry instanceof n.Geometry)
  49467. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  49468. var t = this.geometry.skinWeights[e]
  49469. , i = 1 / t.lengthManhattan();
  49470. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  49471. }
  49472. else if (this.geometry instanceof n.BufferGeometry)
  49473. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  49474. r.x = o.getX(e),
  49475. r.y = o.getY(e),
  49476. r.z = o.getZ(e),
  49477. r.w = o.getW(e);
  49478. var i = 1 / r.lengthManhattan();
  49479. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  49480. o.setXYZW(e, r.x, r.y, r.z, r.w)
  49481. }
  49482. }
  49483. ,
  49484. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  49485. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  49486. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  49487. }
  49488. ,
  49489. n.SkinnedMesh.prototype.clone = function() {
  49490. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  49491. }
  49492. ,
  49493. n.LOD = function() {
  49494. n.Object3D.call(this),
  49495. this.type = "LOD",
  49496. Object.defineProperties(this, {
  49497. levels: {
  49498. enumerable: !0,
  49499. value: []
  49500. },
  49501. objects: {
  49502. get: function() {
  49503. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  49504. this.levels
  49505. }
  49506. }
  49507. })
  49508. }
  49509. ,
  49510. n.LOD.prototype = Object.create(n.Object3D.prototype),
  49511. n.LOD.prototype.constructor = n.LOD,
  49512. n.LOD.prototype.addLevel = function(e, t) {
  49513. void 0 === t && (t = 0),
  49514. t = Math.abs(t);
  49515. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  49516. ;
  49517. i.splice(n, 0, {
  49518. distance: t,
  49519. object: e
  49520. }),
  49521. this.add(e)
  49522. }
  49523. ,
  49524. n.LOD.prototype.getObjectForDistance = function(e) {
  49525. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  49526. ;
  49527. return t[i - 1].object
  49528. }
  49529. ,
  49530. n.LOD.prototype.raycast = function() {
  49531. var e = new n.Vector3;
  49532. return function(t, i) {
  49533. e.setFromMatrixPosition(this.matrixWorld);
  49534. var n = t.ray.origin.distanceTo(e);
  49535. this.getObjectForDistance(n).raycast(t, i)
  49536. }
  49537. }(),
  49538. n.LOD.prototype.update = function() {
  49539. var e = new n.Vector3
  49540. , t = new n.Vector3;
  49541. return function(i) {
  49542. var n = this.levels;
  49543. if (n.length > 1) {
  49544. e.setFromMatrixPosition(i.matrixWorld),
  49545. t.setFromMatrixPosition(this.matrixWorld);
  49546. var r = e.distanceTo(t);
  49547. n[0].object.visible = !0;
  49548. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  49549. n[o - 1].object.visible = !1,
  49550. n[o].object.visible = !0;
  49551. for (; o < a; o++)
  49552. n[o].object.visible = !1
  49553. }
  49554. }
  49555. }(),
  49556. n.LOD.prototype.copy = function(e) {
  49557. n.Object3D.prototype.copy.call(this, e, !1);
  49558. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  49559. var o = t[i];
  49560. this.addLevel(o.object.clone(), o.distance)
  49561. }
  49562. return this
  49563. }
  49564. ,
  49565. n.LOD.prototype.toJSON = function(e) {
  49566. var t = n.Object3D.prototype.toJSON.call(this, e);
  49567. t.object.levels = [];
  49568. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  49569. var a = i[r];
  49570. t.object.levels.push({
  49571. object: a.object.uuid,
  49572. distance: a.distance
  49573. })
  49574. }
  49575. return t
  49576. }
  49577. ,
  49578. n.Sprite = function() {
  49579. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  49580. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  49581. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  49582. , r = new n.BufferGeometry;
  49583. return r.setIndex(new n.BufferAttribute(e,1)),
  49584. r.addAttribute("position", new n.BufferAttribute(t,3)),
  49585. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  49586. function(e) {
  49587. n.Object3D.call(this),
  49588. this.type = "Sprite",
  49589. this.geometry = r,
  49590. this.material = void 0 !== e ? e : new n.SpriteMaterial
  49591. }
  49592. }(),
  49593. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  49594. n.Sprite.prototype.constructor = n.Sprite,
  49595. n.Sprite.prototype.raycast = function() {
  49596. var e = new n.Vector3;
  49597. return function(t, i) {
  49598. e.setFromMatrixPosition(this.matrixWorld);
  49599. var n = t.ray.distanceSqToPoint(e)
  49600. , r = this.scale.x * this.scale.y;
  49601. n > r || i.push({
  49602. distance: Math.sqrt(n),
  49603. point: this.position,
  49604. face: null,
  49605. object: this
  49606. })
  49607. }
  49608. }(),
  49609. n.Sprite.prototype.clone = function() {
  49610. return new this.constructor(this.material).copy(this)
  49611. }
  49612. ,
  49613. n.Particle = n.Sprite,
  49614. n.LensFlare = function(e, t, i, r, o) {
  49615. n.Object3D.call(this),
  49616. this.lensFlares = [],
  49617. this.positionScreen = new n.Vector3,
  49618. this.customUpdateCallback = void 0,
  49619. void 0 !== e && this.add(e, t, i, r, o)
  49620. }
  49621. ,
  49622. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  49623. n.LensFlare.prototype.constructor = n.LensFlare,
  49624. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  49625. void 0 === t && (t = -1),
  49626. void 0 === i && (i = 0),
  49627. void 0 === a && (a = 1),
  49628. void 0 === o && (o = new n.Color(16777215)),
  49629. void 0 === r && (r = n.NormalBlending),
  49630. i = Math.min(i, Math.max(0, i)),
  49631. this.lensFlares.push({
  49632. texture: e,
  49633. size: t,
  49634. distance: i,
  49635. x: 0,
  49636. y: 0,
  49637. z: 0,
  49638. scale: 1,
  49639. rotation: 0,
  49640. opacity: a,
  49641. color: o,
  49642. blending: r
  49643. })
  49644. }
  49645. ,
  49646. n.LensFlare.prototype.updateLensFlares = function() {
  49647. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  49648. for (e = 0; e < i; e++)
  49649. t = this.lensFlares[e],
  49650. t.x = this.positionScreen.x + n * t.distance,
  49651. t.y = this.positionScreen.y + r * t.distance,
  49652. t.wantedRotation = t.x * Math.PI * .25,
  49653. t.rotation += .25 * (t.wantedRotation - t.rotation)
  49654. }
  49655. ,
  49656. n.LensFlare.prototype.copy = function(e) {
  49657. n.Object3D.prototype.copy.call(this, e),
  49658. this.positionScreen.copy(e.positionScreen),
  49659. this.customUpdateCallback = e.customUpdateCallback;
  49660. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  49661. this.lensFlares.push(e.lensFlares[t]);
  49662. return this
  49663. }
  49664. ,
  49665. n.Scene = function() {
  49666. n.Object3D.call(this),
  49667. this.type = "Scene",
  49668. this.fog = null,
  49669. this.overrideMaterial = null,
  49670. this.autoUpdate = !0
  49671. }
  49672. ,
  49673. n.Scene.prototype = Object.create(n.Object3D.prototype),
  49674. n.Scene.prototype.constructor = n.Scene,
  49675. n.Scene.prototype.copy = function(e, t) {
  49676. return n.Object3D.prototype.copy.call(this, e, t),
  49677. null !== e.fog && (this.fog = e.fog.clone()),
  49678. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  49679. this.autoUpdate = e.autoUpdate,
  49680. this.matrixAutoUpdate = e.matrixAutoUpdate,
  49681. this
  49682. }
  49683. ,
  49684. n.Fog = function(e, t, i) {
  49685. this.name = "",
  49686. this.color = new n.Color(e),
  49687. this.near = void 0 !== t ? t : 1,
  49688. this.far = void 0 !== i ? i : 1e3
  49689. }
  49690. ,
  49691. n.Fog.prototype.clone = function() {
  49692. return new n.Fog(this.color.getHex(),this.near,this.far)
  49693. }
  49694. ,
  49695. n.FogExp2 = function(e, t) {
  49696. this.name = "",
  49697. this.color = new n.Color(e),
  49698. this.density = void 0 !== t ? t : 25e-5
  49699. }
  49700. ,
  49701. n.FogExp2.prototype.clone = function() {
  49702. return new n.FogExp2(this.color.getHex(),this.density)
  49703. }
  49704. ,
  49705. n.ShaderChunk = {},
  49706. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  49707. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  49708. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  49709. n.ShaderChunk.aomap_fragment = "#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",
  49710. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  49711. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  49712. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  49713. n.ShaderChunk.bsdfs = "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",
  49714. n.ShaderChunk.bumpmap_pars_fragment = "#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",
  49715. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  49716. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  49717. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  49718. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  49719. n.ShaderChunk.common = "#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",
  49720. n.ShaderChunk.cube_uv_reflection_fragment = "#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",
  49721. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  49722. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  49723. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  49724. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  49725. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  49726. n.ShaderChunk.encodings_pars_fragment = "\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",
  49727. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  49728. n.ShaderChunk.envmap_fragment = "#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",
  49729. n.ShaderChunk.envmap_pars_fragment = "#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",
  49730. n.ShaderChunk.envmap_pars_vertex = "#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",
  49731. n.ShaderChunk.envmap_vertex = "#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",
  49732. n.ShaderChunk.fog_fragment = "#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",
  49733. n.ShaderChunk.fog_pars_fragment = "#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",
  49734. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  49735. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  49736. n.ShaderChunk.lights_lambert_vertex = "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",
  49737. n.ShaderChunk.lights_pars = "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",
  49738. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  49739. n.ShaderChunk.lights_phong_pars_fragment = "#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",
  49740. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  49741. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  49742. n.ShaderChunk.lights_standard_fragment = "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",
  49743. n.ShaderChunk.lights_standard_pars_fragment = "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",
  49744. n.ShaderChunk.lights_template = "\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",
  49745. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  49746. n.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  49747. n.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  49748. n.ShaderChunk.logdepthbuf_vertex = "#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",
  49749. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  49750. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  49751. n.ShaderChunk.map_particle_fragment = "#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",
  49752. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  49753. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  49754. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  49755. n.ShaderChunk.morphnormal_vertex = "#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",
  49756. n.ShaderChunk.morphtarget_pars_vertex = "#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";
  49757. n.ShaderChunk.morphtarget_vertex = "#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";
  49758. n.ShaderChunk.normal_fragment = "#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",
  49759. n.ShaderChunk.normalmap_pars_fragment = "#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",
  49760. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  49761. n.ShaderChunk.project_vertex = "#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",
  49762. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  49763. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  49764. n.ShaderChunk.shadowmap_pars_fragment = "#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",
  49765. n.ShaderChunk.shadowmap_pars_vertex = "#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",
  49766. n.ShaderChunk.shadowmap_vertex = "#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",
  49767. n.ShaderChunk.shadowmask_pars_fragment = "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",
  49768. n.ShaderChunk.skinbase_vertex = "#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",
  49769. n.ShaderChunk.skinning_pars_vertex = "#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",
  49770. n.ShaderChunk.skinning_vertex = "#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",
  49771. n.ShaderChunk.skinnormal_vertex = "#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",
  49772. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  49773. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  49774. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  49775. n.ShaderChunk.tonemapping_pars_fragment = "#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",
  49776. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  49777. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  49778. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  49779. n.ShaderChunk.uv_pars_fragment = "#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",
  49780. n.ShaderChunk.uv_pars_vertex = "#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",
  49781. n.ShaderChunk.uv_vertex = "#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",
  49782. n.ShaderChunk.worldpos_vertex = "#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",
  49783. n.UniformsUtils = {
  49784. merge: function(e) {
  49785. for (var t = {}, i = 0; i < e.length; i++) {
  49786. var n = this.clone(e[i]);
  49787. for (var r in n)
  49788. t[r] = n[r]
  49789. }
  49790. return t
  49791. },
  49792. clone: function(e) {
  49793. var t = {};
  49794. for (var i in e) {
  49795. t[i] = {};
  49796. for (var r in e[i]) {
  49797. var o = e[i][r];
  49798. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  49799. }
  49800. }
  49801. return t
  49802. }
  49803. },
  49804. n.UniformsLib = {
  49805. common: {
  49806. diffuse: {
  49807. type: "c",
  49808. value: new n.Color(15658734)
  49809. },
  49810. opacity: {
  49811. type: "f",
  49812. value: 1
  49813. },
  49814. map: {
  49815. type: "t",
  49816. value: null
  49817. },
  49818. offsetRepeat: {
  49819. type: "v4",
  49820. value: new n.Vector4(0,0,1,1)
  49821. },
  49822. specularMap: {
  49823. type: "t",
  49824. value: null
  49825. },
  49826. alphaMap: {
  49827. type: "t",
  49828. value: null
  49829. },
  49830. envMap: {
  49831. type: "t",
  49832. value: null
  49833. },
  49834. flipEnvMap: {
  49835. type: "f",
  49836. value: -1
  49837. },
  49838. reflectivity: {
  49839. type: "f",
  49840. value: 1
  49841. },
  49842. refractionRatio: {
  49843. type: "f",
  49844. value: .98
  49845. }
  49846. },
  49847. aomap: {
  49848. aoMap: {
  49849. type: "t",
  49850. value: null
  49851. },
  49852. aoMapIntensity: {
  49853. type: "f",
  49854. value: 1
  49855. }
  49856. },
  49857. lightmap: {
  49858. lightMap: {
  49859. type: "t",
  49860. value: null
  49861. },
  49862. lightMapIntensity: {
  49863. type: "f",
  49864. value: 1
  49865. }
  49866. },
  49867. emissivemap: {
  49868. emissiveMap: {
  49869. type: "t",
  49870. value: null
  49871. }
  49872. },
  49873. bumpmap: {
  49874. bumpMap: {
  49875. type: "t",
  49876. value: null
  49877. },
  49878. bumpScale: {
  49879. type: "f",
  49880. value: 1
  49881. }
  49882. },
  49883. normalmap: {
  49884. normalMap: {
  49885. type: "t",
  49886. value: null
  49887. },
  49888. normalScale: {
  49889. type: "v2",
  49890. value: new n.Vector2(1,1)
  49891. }
  49892. },
  49893. displacementmap: {
  49894. displacementMap: {
  49895. type: "t",
  49896. value: null
  49897. },
  49898. displacementScale: {
  49899. type: "f",
  49900. value: 1
  49901. },
  49902. displacementBias: {
  49903. type: "f",
  49904. value: 0
  49905. }
  49906. },
  49907. roughnessmap: {
  49908. roughnessMap: {
  49909. type: "t",
  49910. value: null
  49911. }
  49912. },
  49913. metalnessmap: {
  49914. metalnessMap: {
  49915. type: "t",
  49916. value: null
  49917. }
  49918. },
  49919. fog: {
  49920. fogDensity: {
  49921. type: "f",
  49922. value: 25e-5
  49923. },
  49924. fogNear: {
  49925. type: "f",
  49926. value: 1
  49927. },
  49928. fogFar: {
  49929. type: "f",
  49930. value: 2e3
  49931. },
  49932. fogColor: {
  49933. type: "c",
  49934. value: new n.Color(16777215)
  49935. }
  49936. },
  49937. lights: {
  49938. ambientLightColor: {
  49939. type: "fv",
  49940. value: []
  49941. },
  49942. directionalLights: {
  49943. type: "sa",
  49944. value: [],
  49945. properties: {
  49946. direction: {
  49947. type: "v3"
  49948. },
  49949. color: {
  49950. type: "c"
  49951. },
  49952. shadow: {
  49953. type: "i"
  49954. },
  49955. shadowBias: {
  49956. type: "f"
  49957. },
  49958. shadowRadius: {
  49959. type: "f"
  49960. },
  49961. shadowMapSize: {
  49962. type: "v2"
  49963. }
  49964. }
  49965. },
  49966. directionalShadowMap: {
  49967. type: "tv",
  49968. value: []
  49969. },
  49970. directionalShadowMatrix: {
  49971. type: "m4v",
  49972. value: []
  49973. },
  49974. spotLights: {
  49975. type: "sa",
  49976. value: [],
  49977. properties: {
  49978. color: {
  49979. type: "c"
  49980. },
  49981. position: {
  49982. type: "v3"
  49983. },
  49984. direction: {
  49985. type: "v3"
  49986. },
  49987. distance: {
  49988. type: "f"
  49989. },
  49990. coneCos: {
  49991. type: "f"
  49992. },
  49993. penumbraCos: {
  49994. type: "f"
  49995. },
  49996. decay: {
  49997. type: "f"
  49998. },
  49999. shadow: {
  50000. type: "i"
  50001. },
  50002. shadowBias: {
  50003. type: "f"
  50004. },
  50005. shadowRadius: {
  50006. type: "f"
  50007. },
  50008. shadowMapSize: {
  50009. type: "v2"
  50010. }
  50011. }
  50012. },
  50013. spotShadowMap: {
  50014. type: "tv",
  50015. value: []
  50016. },
  50017. spotShadowMatrix: {
  50018. type: "m4v",
  50019. value: []
  50020. },
  50021. pointLights: {
  50022. type: "sa",
  50023. value: [],
  50024. properties: {
  50025. color: {
  50026. type: "c"
  50027. },
  50028. position: {
  50029. type: "v3"
  50030. },
  50031. decay: {
  50032. type: "f"
  50033. },
  50034. distance: {
  50035. type: "f"
  50036. },
  50037. shadow: {
  50038. type: "i"
  50039. },
  50040. shadowBias: {
  50041. type: "f"
  50042. },
  50043. shadowRadius: {
  50044. type: "f"
  50045. },
  50046. shadowMapSize: {
  50047. type: "v2"
  50048. }
  50049. }
  50050. },
  50051. pointShadowMap: {
  50052. type: "tv",
  50053. value: []
  50054. },
  50055. pointShadowMatrix: {
  50056. type: "m4v",
  50057. value: []
  50058. },
  50059. hemisphereLights: {
  50060. type: "sa",
  50061. value: [],
  50062. properties: {
  50063. direction: {
  50064. type: "v3"
  50065. },
  50066. skyColor: {
  50067. type: "c"
  50068. },
  50069. groundColor: {
  50070. type: "c"
  50071. }
  50072. }
  50073. }
  50074. },
  50075. points: {
  50076. diffuse: {
  50077. type: "c",
  50078. value: new n.Color(15658734)
  50079. },
  50080. opacity: {
  50081. type: "f",
  50082. value: 1
  50083. },
  50084. size: {
  50085. type: "f",
  50086. value: 1
  50087. },
  50088. scale: {
  50089. type: "f",
  50090. value: 1
  50091. },
  50092. map: {
  50093. type: "t",
  50094. value: null
  50095. },
  50096. offsetRepeat: {
  50097. type: "v4",
  50098. value: new n.Vector4(0,0,1,1)
  50099. }
  50100. }
  50101. },
  50102. n.ShaderChunk.cube_frag = "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",
  50103. n.ShaderChunk.cube_vert = "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",
  50104. n.ShaderChunk.depth_frag = "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",
  50105. n.ShaderChunk.depth_vert = "#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",
  50106. n.ShaderChunk.depthRGBA_frag = "#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",
  50107. n.ShaderChunk.depthRGBA_vert = "#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",
  50108. n.ShaderChunk.distanceRGBA_frag = "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",
  50109. n.ShaderChunk.distanceRGBA_vert = "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",
  50110. n.ShaderChunk.equirect_frag = "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",
  50111. n.ShaderChunk.equirect_vert = "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",
  50112. n.ShaderChunk.linedashed_frag = "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",
  50113. n.ShaderChunk.linedashed_vert = "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",
  50114. n.ShaderChunk.meshbasic_frag = "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",
  50115. n.ShaderChunk.meshbasic_vert = "#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",
  50116. n.ShaderChunk.meshlambert_frag = "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",
  50117. n.ShaderChunk.meshlambert_vert = "#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",
  50118. n.ShaderChunk.meshphong_frag = "#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",
  50119. n.ShaderChunk.meshphong_vert = "#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",
  50120. n.ShaderChunk.meshstandard_frag = "#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",
  50121. n.ShaderChunk.meshstandard_vert = "#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",
  50122. n.ShaderChunk.normal_frag = "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",
  50123. n.ShaderChunk.normal_vert = "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",
  50124. n.ShaderChunk.points_frag = "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",
  50125. n.ShaderChunk.points_vert = "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",
  50126. n.ShaderLib = {
  50127. basic: {
  50128. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50129. vertexShader: n.ShaderChunk.meshbasic_vert,
  50130. fragmentShader: n.ShaderChunk.meshbasic_frag
  50131. },
  50132. lambert: {
  50133. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50134. emissive: {
  50135. type: "c",
  50136. value: new n.Color(0)
  50137. }
  50138. }]),
  50139. vertexShader: n.ShaderChunk.meshlambert_vert,
  50140. fragmentShader: n.ShaderChunk.meshlambert_frag
  50141. },
  50142. phong: {
  50143. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50144. emissive: {
  50145. type: "c",
  50146. value: new n.Color(0)
  50147. },
  50148. specular: {
  50149. type: "c",
  50150. value: new n.Color(1118481)
  50151. },
  50152. shininess: {
  50153. type: "f",
  50154. value: 30
  50155. }
  50156. }]),
  50157. vertexShader: n.ShaderChunk.meshphong_vert,
  50158. fragmentShader: n.ShaderChunk.meshphong_frag
  50159. },
  50160. standard: {
  50161. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50162. emissive: {
  50163. type: "c",
  50164. value: new n.Color(0)
  50165. },
  50166. roughness: {
  50167. type: "f",
  50168. value: .5
  50169. },
  50170. metalness: {
  50171. type: "f",
  50172. value: 0
  50173. },
  50174. envMapIntensity: {
  50175. type: "f",
  50176. value: 1
  50177. }
  50178. }]),
  50179. vertexShader: n.ShaderChunk.meshstandard_vert,
  50180. fragmentShader: n.ShaderChunk.meshstandard_frag
  50181. },
  50182. points: {
  50183. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  50184. vertexShader: n.ShaderChunk.points_vert,
  50185. fragmentShader: n.ShaderChunk.points_frag
  50186. },
  50187. dashed: {
  50188. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  50189. scale: {
  50190. type: "f",
  50191. value: 1
  50192. },
  50193. dashSize: {
  50194. type: "f",
  50195. value: 1
  50196. },
  50197. totalSize: {
  50198. type: "f",
  50199. value: 2
  50200. }
  50201. }]),
  50202. vertexShader: n.ShaderChunk.linedashed_vert,
  50203. fragmentShader: n.ShaderChunk.linedashed_frag
  50204. },
  50205. depth: {
  50206. uniforms: {
  50207. mNear: {
  50208. type: "f",
  50209. value: 1
  50210. },
  50211. mFar: {
  50212. type: "f",
  50213. value: 2e3
  50214. },
  50215. opacity: {
  50216. type: "f",
  50217. value: 1
  50218. }
  50219. },
  50220. vertexShader: n.ShaderChunk.depth_vert,
  50221. fragmentShader: n.ShaderChunk.depth_frag
  50222. },
  50223. normal: {
  50224. uniforms: {
  50225. opacity: {
  50226. type: "f",
  50227. value: 1
  50228. }
  50229. },
  50230. vertexShader: n.ShaderChunk.normal_vert,
  50231. fragmentShader: n.ShaderChunk.normal_frag
  50232. },
  50233. cube: {
  50234. uniforms: {
  50235. tCube: {
  50236. type: "t",
  50237. value: null
  50238. },
  50239. tFlip: {
  50240. type: "f",
  50241. value: -1
  50242. }
  50243. },
  50244. vertexShader: n.ShaderChunk.cube_vert,
  50245. fragmentShader: n.ShaderChunk.cube_frag
  50246. },
  50247. equirect: {
  50248. uniforms: {
  50249. tEquirect: {
  50250. type: "t",
  50251. value: null
  50252. },
  50253. tFlip: {
  50254. type: "f",
  50255. value: -1
  50256. }
  50257. },
  50258. vertexShader: n.ShaderChunk.equirect_vert,
  50259. fragmentShader: n.ShaderChunk.equirect_frag
  50260. },
  50261. depthRGBA: {
  50262. uniforms: {},
  50263. vertexShader: n.ShaderChunk.depthRGBA_vert,
  50264. fragmentShader: n.ShaderChunk.depthRGBA_frag
  50265. },
  50266. distanceRGBA: {
  50267. uniforms: {
  50268. lightPos: {
  50269. type: "v3",
  50270. value: new n.Vector3(0,0,0)
  50271. }
  50272. },
  50273. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  50274. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  50275. }
  50276. },
  50277. n.WebGLRenderer = function(e) {
  50278. function t() {
  50279. return null === ye ? Oe : 1
  50280. }
  50281. function i(e, t, i, n) {
  50282. se === !0 && (e *= n,
  50283. t *= n,
  50284. i *= n),
  50285. Ye.clearColor(e, t, i, n)
  50286. }
  50287. function r() {
  50288. Ye.init(),
  50289. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  50290. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  50291. i(Se.r, Se.g, Se.b, Me)
  50292. }
  50293. function o() {
  50294. Ae = null,
  50295. be = null,
  50296. Ee = "",
  50297. Ie = -1,
  50298. Ye.reset()
  50299. }
  50300. function a(e) {
  50301. e.preventDefault(),
  50302. o(),
  50303. r(),
  50304. Xe.clear()
  50305. }
  50306. function s(e) {
  50307. var t = e.target;
  50308. t.removeEventListener("dispose", s),
  50309. h(t),
  50310. ke.textures--
  50311. }
  50312. function l(e) {
  50313. var t = e.target;
  50314. t.removeEventListener("dispose", l),
  50315. u(t),
  50316. ke.textures--
  50317. }
  50318. function c(e) {
  50319. var t = e.target;
  50320. t.removeEventListener("dispose", c),
  50321. d(t)
  50322. }
  50323. function h(e) {
  50324. var t = Xe.get(e);
  50325. if (e.image && t.__image__webglTextureCube)
  50326. Ge.deleteTexture(t.__image__webglTextureCube);
  50327. else {
  50328. if (void 0 === t.__webglInit)
  50329. return;
  50330. Ge.deleteTexture(t.__webglTexture)
  50331. }
  50332. Xe.delete(e)
  50333. }
  50334. function u(e) {
  50335. var t = Xe.get(e)
  50336. , i = Xe.get(e.texture);
  50337. if (e && void 0 !== i.__webglTexture) {
  50338. if (Ge.deleteTexture(i.__webglTexture),
  50339. e instanceof n.WebGLRenderTargetCube)
  50340. for (var r = 0; r < 6; r++)
  50341. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  50342. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  50343. else
  50344. Ge.deleteFramebuffer(t.__webglFramebuffer),
  50345. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  50346. Xe.delete(e.texture),
  50347. Xe.delete(e)
  50348. }
  50349. }
  50350. function d(e) {
  50351. p(e),
  50352. Xe.delete(e)
  50353. }
  50354. function p(e) {
  50355. var t = Xe.get(e).program;
  50356. e.program = void 0,
  50357. void 0 !== t && qe.releaseProgram(t)
  50358. }
  50359. function f(e, t, i, r) {
  50360. var o;
  50361. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  50362. null === o))
  50363. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50364. void 0 === r && (r = 0),
  50365. Ye.initAttributes();
  50366. var a = i.attributes
  50367. , s = t.getAttributes()
  50368. , l = e.defaultAttributeValues;
  50369. for (var c in s) {
  50370. var h = s[c];
  50371. if (h >= 0) {
  50372. var u = a[c];
  50373. if (void 0 !== u) {
  50374. var d = u.itemSize
  50375. , p = Ze.getAttributeBuffer(u);
  50376. if (u instanceof n.InterleavedBufferAttribute) {
  50377. var f = u.data
  50378. , g = f.stride
  50379. , m = u.offset;
  50380. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  50381. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  50382. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50383. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  50384. } else
  50385. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  50386. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  50387. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50388. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  50389. } else if (void 0 !== l) {
  50390. var v = l[c];
  50391. if (void 0 !== v)
  50392. switch (v.length) {
  50393. case 2:
  50394. Ge.vertexAttrib2fv(h, v);
  50395. break;
  50396. case 3:
  50397. Ge.vertexAttrib3fv(h, v);
  50398. break;
  50399. case 4:
  50400. Ge.vertexAttrib4fv(h, v);
  50401. break;
  50402. default:
  50403. Ge.vertexAttrib1fv(h, v)
  50404. }
  50405. }
  50406. }
  50407. }
  50408. Ye.disableUnusedAttributes()
  50409. }
  50410. function g(e, t) {
  50411. return Math.abs(t[0]) - Math.abs(e[0])
  50412. }
  50413. function m(e, t) {
  50414. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
  50415. }
  50416. function v(e, t) {
  50417. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.z !== t.z ? t.z - e.z : e.id - t.id
  50418. }
  50419. function A(e, t, i, n, r) {
  50420. var o, a;
  50421. i.transparent ? (o = de,
  50422. a = ++pe) : (o = he,
  50423. a = ++ue);
  50424. var s = o[a];
  50425. void 0 !== s ? (s.id = e.id,
  50426. s.object = e,
  50427. s.geometry = t,
  50428. s.material = i,
  50429. s.z = Ve.z,
  50430. s.group = r) : (s = {
  50431. id: e.id,
  50432. object: e,
  50433. geometry: t,
  50434. material: i,
  50435. z: Ve.z,
  50436. group: r
  50437. },
  50438. o.push(s))
  50439. }
  50440. function y(e, t) {
  50441. if (e.visible !== !1) {
  50442. if (e.layers.test(t.layers))
  50443. if (e instanceof n.Light)
  50444. ce.push(e);
  50445. else if (e instanceof n.Sprite)
  50446. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  50447. else if (e instanceof n.LensFlare)
  50448. me.push(e);
  50449. else if (e instanceof n.ImmediateRenderObject)
  50450. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50451. Ve.applyProjection(Fe)),
  50452. A(e, null, e.material, Ve.z, null);
  50453. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  50454. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  50455. var i = e.material;
  50456. if (i.visible === !0) {
  50457. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  50458. Ve.applyProjection(Fe));
  50459. var r = Ze.update(e);
  50460. if (i instanceof n.MultiMaterial)
  50461. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  50462. var c = o[s]
  50463. , h = a[c.materialIndex];
  50464. h.visible === !0 && A(e, r, h, Ve.z, c)
  50465. }
  50466. else
  50467. A(e, r, i, Ve.z, null)
  50468. }
  50469. }
  50470. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  50471. y(u[s], t)
  50472. }
  50473. }
  50474. function C(e, t, i, r) {
  50475. for (var o = 0, a = e.length; o < a; o++) {
  50476. var s = e[o]
  50477. , l = s.object
  50478. , c = s.geometry
  50479. , h = void 0 === r ? s.material : r
  50480. , u = s.group;
  50481. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50482. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  50483. l instanceof n.ImmediateRenderObject) {
  50484. E(h);
  50485. var d = w(t, i, h, l);
  50486. Ee = "",
  50487. l.render(function(e) {
  50488. ve.renderBufferImmediate(e, d, h)
  50489. })
  50490. } else
  50491. ve.renderBufferDirect(t, i, c, h, l, u)
  50492. }
  50493. }
  50494. function I(e, t, i) {
  50495. var r = Xe.get(e)
  50496. , o = qe.getParameters(e, Ue, t, i)
  50497. , a = qe.getProgramCode(e, o)
  50498. , s = r.program
  50499. , l = !0;
  50500. if (void 0 === s)
  50501. e.addEventListener("dispose", c);
  50502. else if (s.code !== a)
  50503. p(e);
  50504. else {
  50505. if (void 0 !== o.shaderID)
  50506. return;
  50507. l = !1
  50508. }
  50509. if (l) {
  50510. if (o.shaderID) {
  50511. var h = n.ShaderLib[o.shaderID];
  50512. r.__webglShader = {
  50513. name: e.type,
  50514. uniforms: n.UniformsUtils.clone(h.uniforms),
  50515. vertexShader: h.vertexShader,
  50516. fragmentShader: h.fragmentShader
  50517. }
  50518. } else
  50519. r.__webglShader = {
  50520. name: e.type,
  50521. uniforms: e.uniforms,
  50522. vertexShader: e.vertexShader,
  50523. fragmentShader: e.fragmentShader
  50524. };
  50525. e.__webglShader = r.__webglShader,
  50526. s = qe.acquireProgram(e, o, a),
  50527. r.program = s,
  50528. e.program = s
  50529. }
  50530. var u = s.getAttributes();
  50531. if (e.morphTargets) {
  50532. e.numSupportedMorphTargets = 0;
  50533. for (var d = 0; d < ve.maxMorphTargets; d++)
  50534. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  50535. }
  50536. if (e.morphNormals) {
  50537. e.numSupportedMorphNormals = 0;
  50538. for (var d = 0; d < ve.maxMorphNormals; d++)
  50539. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  50540. }
  50541. r.uniformsList = [];
  50542. var f = r.__webglShader.uniforms
  50543. , g = r.program.getUniforms();
  50544. for (var m in f) {
  50545. var v = g[m];
  50546. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  50547. }
  50548. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  50549. f.ambientLightColor.value = Ue.ambient,
  50550. f.directionalLights.value = Ue.directional,
  50551. f.spotLights.value = Ue.spot,
  50552. f.pointLights.value = Ue.point,
  50553. f.hemisphereLights.value = Ue.hemi,
  50554. f.directionalShadowMap.value = Ue.directionalShadowMap,
  50555. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  50556. f.spotShadowMap.value = Ue.spotShadowMap,
  50557. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  50558. f.pointShadowMap.value = Ue.pointShadowMap,
  50559. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  50560. r.hasDynamicUniforms = !1;
  50561. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  50562. var C = r.uniformsList[A][0];
  50563. if (C.dynamic === !0) {
  50564. r.hasDynamicUniforms = !0;
  50565. break
  50566. }
  50567. }
  50568. }
  50569. function E(e) {
  50570. b(e),
  50571. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  50572. Ye.setDepthFunc(e.depthFunc),
  50573. Ye.setDepthTest(e.depthTest),
  50574. Ye.setDepthWrite(e.depthWrite),
  50575. Ye.setColorWrite(e.colorWrite),
  50576. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  50577. }
  50578. function b(e) {
  50579. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  50580. Ye.setFlipSided(e.side === n.BackSide)
  50581. }
  50582. function w(e, t, i, r) {
  50583. xe = 0;
  50584. var o = Xe.get(i);
  50585. void 0 === o.program && (i.needsUpdate = !0),
  50586. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  50587. i.needsUpdate && (I(i, t, r),
  50588. i.needsUpdate = !1);
  50589. var a = !1
  50590. , s = !1
  50591. , l = !1
  50592. , c = o.program
  50593. , h = c.getUniforms()
  50594. , u = o.__webglShader.uniforms;
  50595. if (c.id !== Ae && (Ge.useProgram(c.program),
  50596. Ae = c.id,
  50597. a = !0,
  50598. s = !0,
  50599. l = !0),
  50600. i.id !== Ie && (Ie = i.id,
  50601. s = !0),
  50602. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  50603. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  50604. e !== be && (be = e,
  50605. s = !0,
  50606. l = !0),
  50607. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  50608. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  50609. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  50610. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  50611. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  50612. i.skinning)
  50613. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  50614. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  50615. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  50616. if (void 0 !== h.boneTexture) {
  50617. var d = B();
  50618. Ge.uniform1i(h.boneTexture, d),
  50619. ve.setTexture(r.skeleton.boneTexture, d)
  50620. }
  50621. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  50622. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  50623. } else
  50624. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  50625. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  50626. t && i.fog && R(u, t),
  50627. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  50628. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  50629. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  50630. u.mFar.value = e.far,
  50631. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  50632. V(o.uniformsList)),
  50633. N(h, r),
  50634. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  50635. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  50636. c
  50637. }
  50638. function _(e, t, i) {
  50639. for (var n = [], r = 0, o = e.length; r < o; r++) {
  50640. var a = e[r][0]
  50641. , s = a.onUpdateCallback;
  50642. void 0 !== s && (s.bind(a)(t, i),
  50643. n.push(e[r]))
  50644. }
  50645. V(n)
  50646. }
  50647. function T(e, t) {
  50648. e.opacity.value = t.opacity,
  50649. e.diffuse.value = t.color,
  50650. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  50651. e.map.value = t.map,
  50652. e.specularMap.value = t.specularMap,
  50653. e.alphaMap.value = t.alphaMap,
  50654. t.aoMap && (e.aoMap.value = t.aoMap,
  50655. e.aoMapIntensity.value = t.aoMapIntensity);
  50656. var i;
  50657. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  50658. void 0 !== i) {
  50659. i instanceof n.WebGLRenderTarget && (i = i.texture);
  50660. var r = i.offset
  50661. , o = i.repeat;
  50662. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  50663. }
  50664. e.envMap.value = t.envMap,
  50665. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  50666. e.reflectivity.value = t.reflectivity,
  50667. e.refractionRatio.value = t.refractionRatio
  50668. }
  50669. function x(e, t) {
  50670. e.diffuse.value = t.color,
  50671. e.opacity.value = t.opacity
  50672. }
  50673. function S(e, t) {
  50674. e.dashSize.value = t.dashSize,
  50675. e.totalSize.value = t.dashSize + t.gapSize,
  50676. e.scale.value = t.scale
  50677. }
  50678. function M(e, t) {
  50679. if (e.diffuse.value = t.color,
  50680. e.opacity.value = t.opacity,
  50681. e.size.value = t.size * Oe,
  50682. e.scale.value = te.clientHeight / 2,
  50683. e.map.value = t.map,
  50684. null !== t.map) {
  50685. var i = t.map.offset
  50686. , n = t.map.repeat;
  50687. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  50688. }
  50689. }
  50690. function R(e, t) {
  50691. e.fogColor.value = t.color,
  50692. t instanceof n.Fog ? (e.fogNear.value = t.near,
  50693. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  50694. }
  50695. function P(e, t) {
  50696. t.lightMap && (e.lightMap.value = t.lightMap,
  50697. e.lightMapIntensity.value = t.lightMapIntensity),
  50698. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  50699. }
  50700. function O(e, t) {
  50701. e.specular.value = t.specular,
  50702. e.shininess.value = Math.max(t.shininess, 1e-4),
  50703. t.lightMap && (e.lightMap.value = t.lightMap,
  50704. e.lightMapIntensity.value = t.lightMapIntensity),
  50705. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50706. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50707. e.bumpScale.value = t.bumpScale),
  50708. t.normalMap && (e.normalMap.value = t.normalMap,
  50709. e.normalScale.value.copy(t.normalScale)),
  50710. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50711. e.displacementScale.value = t.displacementScale,
  50712. e.displacementBias.value = t.displacementBias)
  50713. }
  50714. function L(e, t) {
  50715. e.roughness.value = t.roughness,
  50716. e.metalness.value = t.metalness,
  50717. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  50718. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  50719. t.lightMap && (e.lightMap.value = t.lightMap,
  50720. e.lightMapIntensity.value = t.lightMapIntensity),
  50721. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  50722. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  50723. e.bumpScale.value = t.bumpScale),
  50724. t.normalMap && (e.normalMap.value = t.normalMap,
  50725. e.normalScale.value.copy(t.normalScale)),
  50726. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  50727. e.displacementScale.value = t.displacementScale,
  50728. e.displacementBias.value = t.displacementBias),
  50729. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  50730. }
  50731. function D(e, t) {
  50732. e.ambientLightColor.needsUpdate = t,
  50733. e.directionalLights.needsUpdate = t,
  50734. e.pointLights.needsUpdate = t,
  50735. e.spotLights.needsUpdate = t,
  50736. e.hemisphereLights.needsUpdate = t
  50737. }
  50738. function N(e, t) {
  50739. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  50740. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  50741. }
  50742. function B() {
  50743. var e = xe;
  50744. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  50745. xe += 1,
  50746. e
  50747. }
  50748. function F(e, t, i, r) {
  50749. var o, a;
  50750. if ("1i" === t)
  50751. Ge.uniform1i(i, r);
  50752. else if ("1f" === t)
  50753. Ge.uniform1f(i, r);
  50754. else if ("2f" === t)
  50755. Ge.uniform2f(i, r[0], r[1]);
  50756. else if ("3f" === t)
  50757. Ge.uniform3f(i, r[0], r[1], r[2]);
  50758. else if ("4f" === t)
  50759. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  50760. else if ("1iv" === t)
  50761. Ge.uniform1iv(i, r);
  50762. else if ("3iv" === t)
  50763. Ge.uniform3iv(i, r);
  50764. else if ("1fv" === t)
  50765. Ge.uniform1fv(i, r);
  50766. else if ("2fv" === t)
  50767. Ge.uniform2fv(i, r);
  50768. else if ("3fv" === t)
  50769. Ge.uniform3fv(i, r);
  50770. else if ("4fv" === t)
  50771. Ge.uniform4fv(i, r);
  50772. else if ("Matrix2fv" === t)
  50773. Ge.uniformMatrix2fv(i, !1, r);
  50774. else if ("Matrix3fv" === t)
  50775. Ge.uniformMatrix3fv(i, !1, r);
  50776. else if ("Matrix4fv" === t)
  50777. Ge.uniformMatrix4fv(i, !1, r);
  50778. else if ("i" === t)
  50779. Ge.uniform1i(i, r);
  50780. else if ("f" === t)
  50781. Ge.uniform1f(i, r);
  50782. else if ("v2" === t)
  50783. Ge.uniform2f(i, r.x, r.y);
  50784. else if ("v3" === t)
  50785. Ge.uniform3f(i, r.x, r.y, r.z);
  50786. else if ("v4" === t)
  50787. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  50788. else if ("c" === t)
  50789. Ge.uniform3f(i, r.r, r.g, r.b);
  50790. else if ("s" === t) {
  50791. var s = e.properties;
  50792. for (var l in s) {
  50793. var c = s[l]
  50794. , h = i[l]
  50795. , u = r[l];
  50796. F(c, c.type, h, u)
  50797. }
  50798. } else if ("sa" === t)
  50799. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  50800. for (var l in s) {
  50801. var c = s[l]
  50802. , h = i[d][l]
  50803. , u = r[d][l];
  50804. F(c, c.type, h, u)
  50805. }
  50806. else if ("iv1" === t)
  50807. Ge.uniform1iv(i, r);
  50808. else if ("iv" === t)
  50809. Ge.uniform3iv(i, r);
  50810. else if ("fv1" === t)
  50811. Ge.uniform1fv(i, r);
  50812. else if ("fv" === t)
  50813. Ge.uniform3fv(i, r);
  50814. else if ("v2v" === t) {
  50815. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  50816. for (var d = 0, f = 0, g = r.length; d < g; d++,
  50817. f += 2)
  50818. e._array[f + 0] = r[d].x,
  50819. e._array[f + 1] = r[d].y;
  50820. Ge.uniform2fv(i, e._array)
  50821. } else if ("v3v" === t) {
  50822. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  50823. for (var d = 0, m = 0, g = r.length; d < g; d++,
  50824. m += 3)
  50825. e._array[m + 0] = r[d].x,
  50826. e._array[m + 1] = r[d].y,
  50827. e._array[m + 2] = r[d].z;
  50828. Ge.uniform3fv(i, e._array)
  50829. } else if ("v4v" === t) {
  50830. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  50831. for (var d = 0, v = 0, g = r.length; d < g; d++,
  50832. v += 4)
  50833. e._array[v + 0] = r[d].x,
  50834. e._array[v + 1] = r[d].y,
  50835. e._array[v + 2] = r[d].z,
  50836. e._array[v + 3] = r[d].w;
  50837. Ge.uniform4fv(i, e._array)
  50838. } else if ("m2" === t)
  50839. Ge.uniformMatrix2fv(i, !1, r.elements);
  50840. else if ("m3" === t)
  50841. Ge.uniformMatrix3fv(i, !1, r.elements);
  50842. else if ("m3v" === t) {
  50843. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  50844. for (var d = 0, g = r.length; d < g; d++)
  50845. r[d].flattenToArrayOffset(e._array, 9 * d);
  50846. Ge.uniformMatrix3fv(i, !1, e._array)
  50847. } else if ("m4" === t)
  50848. Ge.uniformMatrix4fv(i, !1, r.elements);
  50849. else if ("m4v" === t) {
  50850. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  50851. for (var d = 0, g = r.length; d < g; d++)
  50852. r[d].flattenToArrayOffset(e._array, 16 * d);
  50853. Ge.uniformMatrix4fv(i, !1, e._array)
  50854. } else if ("t" === t) {
  50855. if (o = r,
  50856. a = B(),
  50857. Ge.uniform1i(i, a),
  50858. !o)
  50859. return;
  50860. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  50861. } else if ("tv" === t) {
  50862. void 0 === e._array && (e._array = []);
  50863. for (var d = 0, g = e.value.length; d < g; d++)
  50864. e._array[d] = B();
  50865. Ge.uniform1iv(i, e._array);
  50866. for (var d = 0, g = e.value.length; d < g; d++)
  50867. o = e.value[d],
  50868. a = e._array[d],
  50869. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  50870. } else
  50871. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  50872. }
  50873. function V(e) {
  50874. for (var t = 0, i = e.length; t < i; t++) {
  50875. var n = e[t][0];
  50876. if (n.needsUpdate !== !1) {
  50877. var r = n.type
  50878. , o = e[t][1]
  50879. , a = n.value;
  50880. F(n, r, o, a)
  50881. }
  50882. }
  50883. }
  50884. function U(e, t) {
  50885. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  50886. for (Ue.shadowsPointLight = 0,
  50887. i = 0,
  50888. r = e.length; i < r; i++)
  50889. if (o = e[i],
  50890. a = o.color,
  50891. s = o.intensity,
  50892. l = o.distance,
  50893. o instanceof n.AmbientLight)
  50894. c += a.r * s,
  50895. h += a.g * s,
  50896. u += a.b * s;
  50897. else if (o instanceof n.DirectionalLight) {
  50898. var A = Ke.get(o);
  50899. A.color.copy(o.color).multiplyScalar(o.intensity),
  50900. A.direction.setFromMatrixPosition(o.matrixWorld),
  50901. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50902. A.direction.sub(Ve),
  50903. A.direction.transformDirection(d),
  50904. A.shadow = o.castShadow,
  50905. o.castShadow && (A.shadowBias = o.shadow.bias,
  50906. A.shadowRadius = o.shadow.radius,
  50907. A.shadowMapSize = o.shadow.mapSize,
  50908. Ue.shadows[v++] = o),
  50909. Ue.directionalShadowMap[p] = o.shadow.map,
  50910. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  50911. Ue.directional[p++] = A
  50912. } else if (o instanceof n.SpotLight) {
  50913. var A = Ke.get(o);
  50914. A.position.setFromMatrixPosition(o.matrixWorld),
  50915. A.position.applyMatrix4(d),
  50916. A.color.copy(a).multiplyScalar(s),
  50917. A.distance = l,
  50918. A.direction.setFromMatrixPosition(o.matrixWorld),
  50919. Ve.setFromMatrixPosition(o.target.matrixWorld),
  50920. A.direction.sub(Ve),
  50921. A.direction.transformDirection(d),
  50922. A.coneCos = Math.cos(o.angle),
  50923. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  50924. A.decay = 0 === o.distance ? 0 : o.decay,
  50925. A.shadow = o.castShadow,
  50926. o.castShadow && (A.shadowBias = o.shadow.bias,
  50927. A.shadowRadius = o.shadow.radius,
  50928. A.shadowMapSize = o.shadow.mapSize,
  50929. Ue.shadows[v++] = o),
  50930. Ue.spotShadowMap[g] = o.shadow.map,
  50931. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  50932. Ue.spot[g++] = A
  50933. } else if (o instanceof n.PointLight) {
  50934. var A = Ke.get(o);
  50935. A.position.setFromMatrixPosition(o.matrixWorld),
  50936. A.position.applyMatrix4(d),
  50937. A.color.copy(o.color).multiplyScalar(o.intensity),
  50938. A.distance = o.distance,
  50939. A.decay = 0 === o.distance ? 0 : o.decay,
  50940. A.shadow = o.castShadow,
  50941. o.castShadow && (A.shadowBias = o.shadow.bias,
  50942. A.shadowRadius = o.shadow.radius,
  50943. A.shadowMapSize = o.shadow.mapSize,
  50944. Ue.shadows[v++] = o),
  50945. Ue.pointShadowMap[f] = o.shadow.map,
  50946. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  50947. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  50948. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  50949. Ue.point[f++] = A
  50950. } else if (o instanceof n.HemisphereLight) {
  50951. var A = Ke.get(o);
  50952. A.direction.setFromMatrixPosition(o.matrixWorld),
  50953. A.direction.transformDirection(d),
  50954. A.direction.normalize(),
  50955. A.skyColor.copy(o.color).multiplyScalar(s),
  50956. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  50957. Ue.hemi[m++] = A
  50958. }
  50959. Ue.ambient[0] = c,
  50960. Ue.ambient[1] = h,
  50961. Ue.ambient[2] = u,
  50962. Ue.directional.length = p,
  50963. Ue.spot.length = g,
  50964. Ue.point.length = f,
  50965. Ue.hemi.length = m,
  50966. Ue.shadows.length = v,
  50967. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  50968. }
  50969. function k(e, t, i) {
  50970. var r;
  50971. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  50972. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  50973. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  50974. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  50975. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  50976. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  50977. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  50978. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  50979. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  50980. r = We.get("EXT_texture_filter_anisotropic")) {
  50981. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  50982. return;
  50983. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  50984. return;
  50985. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  50986. Xe.get(t).__currentAnisotropy = t.anisotropy)
  50987. }
  50988. }
  50989. function H(e, t, i) {
  50990. void 0 === e.__webglInit && (e.__webglInit = !0,
  50991. t.addEventListener("dispose", s),
  50992. e.__webglTexture = Ge.createTexture(),
  50993. ke.textures++),
  50994. Ye.activeTexture(Ge.TEXTURE0 + i),
  50995. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  50996. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  50997. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  50998. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  50999. var r = G(t.image, je.maxTextureSize);
  51000. W(t) && z(r) === !1 && (r = j(r));
  51001. var o = z(r)
  51002. , a = ee(t.format)
  51003. , l = ee(t.type);
  51004. k(Ge.TEXTURE_2D, t, o);
  51005. var c, h = t.mipmaps;
  51006. if (t instanceof n.DataTexture)
  51007. if (h.length > 0 && o) {
  51008. for (var u = 0, d = h.length; u < d; u++)
  51009. c = h[u],
  51010. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51011. t.generateMipmaps = !1
  51012. } else
  51013. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51014. else if (t instanceof n.CompressedTexture)
  51015. for (var u = 0, d = h.length; u < d; u++)
  51016. c = h[u],
  51017. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51018. else if (h.length > 0 && o) {
  51019. for (var u = 0, d = h.length; u < d; u++)
  51020. c = h[u],
  51021. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51022. t.generateMipmaps = !1
  51023. } else
  51024. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51025. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51026. e.__version = t.version,
  51027. t.onUpdate && t.onUpdate(t)
  51028. }
  51029. function G(e, t) {
  51030. if (e.width > t || e.height > t) {
  51031. var i = t / Math.max(e.width, e.height)
  51032. , n = document.createElement("canvas");
  51033. n.width = Math.floor(e.width * i),
  51034. n.height = Math.floor(e.height * i);
  51035. var r = n.getContext("2d");
  51036. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51037. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51038. n
  51039. }
  51040. return e
  51041. }
  51042. function z(e) {
  51043. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51044. }
  51045. function W(e) {
  51046. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51047. }
  51048. function j(e) {
  51049. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51050. var t = document.createElement("canvas");
  51051. t.width = n.Math.nearestPowerOfTwo(e.width),
  51052. t.height = n.Math.nearestPowerOfTwo(e.height);
  51053. var i = t.getContext("2d");
  51054. return i.drawImage(e, 0, 0, t.width, t.height),
  51055. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51056. t
  51057. }
  51058. return e
  51059. }
  51060. function Y(e, t) {
  51061. var i = Xe.get(e);
  51062. if (6 === e.image.length)
  51063. if (e.version > 0 && i.__version !== e.version) {
  51064. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51065. i.__image__webglTextureCube = Ge.createTexture(),
  51066. ke.textures++),
  51067. Ye.activeTexture(Ge.TEXTURE0 + t),
  51068. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51069. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51070. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51071. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51072. var c = a[0]
  51073. , h = z(c)
  51074. , u = ee(e.format)
  51075. , d = ee(e.type);
  51076. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51077. for (var l = 0; l < 6; l++)
  51078. if (r)
  51079. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51080. p = f[g],
  51081. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  51082. else
  51083. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  51084. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51085. i.__version = e.version,
  51086. e.onUpdate && e.onUpdate(e)
  51087. } else
  51088. Ye.activeTexture(Ge.TEXTURE0 + t),
  51089. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51090. }
  51091. function X(e, t) {
  51092. Ye.activeTexture(Ge.TEXTURE0 + t),
  51093. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51094. }
  51095. function Z(e, t, i, n) {
  51096. var r = ee(t.texture.format)
  51097. , o = ee(t.texture.type);
  51098. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51099. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51100. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51101. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51102. }
  51103. function q(e, t) {
  51104. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51105. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51106. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  51107. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51108. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51109. }
  51110. function K(e) {
  51111. var t = Xe.get(e)
  51112. , i = e instanceof n.WebGLRenderTargetCube;
  51113. if (i) {
  51114. t.__webglDepthbuffer = [];
  51115. for (var r = 0; r < 6; r++)
  51116. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51117. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51118. q(t.__webglDepthbuffer[r], e)
  51119. } else
  51120. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51121. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51122. q(t.__webglDepthbuffer, e);
  51123. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51124. }
  51125. function Q(e) {
  51126. var t = Xe.get(e)
  51127. , i = Xe.get(e.texture);
  51128. e.addEventListener("dispose", l),
  51129. i.__webglTexture = Ge.createTexture(),
  51130. ke.textures++;
  51131. var r = e instanceof n.WebGLRenderTargetCube
  51132. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51133. if (r) {
  51134. t.__webglFramebuffer = [];
  51135. for (var a = 0; a < 6; a++)
  51136. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51137. } else
  51138. t.__webglFramebuffer = Ge.createFramebuffer();
  51139. if (r) {
  51140. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51141. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51142. for (var a = 0; a < 6; a++)
  51143. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51144. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51145. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51146. } else
  51147. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51148. k(Ge.TEXTURE_2D, e.texture, o),
  51149. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51150. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51151. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51152. e.depthBuffer && K(e)
  51153. }
  51154. function J(e) {
  51155. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51156. , i = Xe.get(e.texture).__webglTexture;
  51157. Ye.bindTexture(t, i),
  51158. Ge.generateMipmap(t),
  51159. Ye.bindTexture(t, null)
  51160. }
  51161. function $(e) {
  51162. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51163. }
  51164. function ee(e) {
  51165. var t;
  51166. if (e === n.RepeatWrapping)
  51167. return Ge.REPEAT;
  51168. if (e === n.ClampToEdgeWrapping)
  51169. return Ge.CLAMP_TO_EDGE;
  51170. if (e === n.MirroredRepeatWrapping)
  51171. return Ge.MIRRORED_REPEAT;
  51172. if (e === n.NearestFilter)
  51173. return Ge.NEAREST;
  51174. if (e === n.NearestMipMapNearestFilter)
  51175. return Ge.NEAREST_MIPMAP_NEAREST;
  51176. if (e === n.NearestMipMapLinearFilter)
  51177. return Ge.NEAREST_MIPMAP_LINEAR;
  51178. if (e === n.LinearFilter)
  51179. return Ge.LINEAR;
  51180. if (e === n.LinearMipMapNearestFilter)
  51181. return Ge.LINEAR_MIPMAP_NEAREST;
  51182. if (e === n.LinearMipMapLinearFilter)
  51183. return Ge.LINEAR_MIPMAP_LINEAR;
  51184. if (e === n.UnsignedByteType)
  51185. return Ge.UNSIGNED_BYTE;
  51186. if (e === n.UnsignedShort4444Type)
  51187. return Ge.UNSIGNED_SHORT_4_4_4_4;
  51188. if (e === n.UnsignedShort5551Type)
  51189. return Ge.UNSIGNED_SHORT_5_5_5_1;
  51190. if (e === n.UnsignedShort565Type)
  51191. return Ge.UNSIGNED_SHORT_5_6_5;
  51192. if (e === n.ByteType)
  51193. return Ge.BYTE;
  51194. if (e === n.ShortType)
  51195. return Ge.SHORT;
  51196. if (e === n.UnsignedShortType)
  51197. return Ge.UNSIGNED_SHORT;
  51198. if (e === n.IntType)
  51199. return Ge.INT;
  51200. if (e === n.UnsignedIntType)
  51201. return Ge.UNSIGNED_INT;
  51202. if (e === n.FloatType)
  51203. return Ge.FLOAT;
  51204. if (t = We.get("OES_texture_half_float"),
  51205. null !== t && e === n.HalfFloatType)
  51206. return t.HALF_FLOAT_OES;
  51207. if (e === n.AlphaFormat)
  51208. return Ge.ALPHA;
  51209. if (e === n.RGBFormat)
  51210. return Ge.RGB;
  51211. if (e === n.RGBAFormat)
  51212. return Ge.RGBA;
  51213. if (e === n.LuminanceFormat)
  51214. return Ge.LUMINANCE;
  51215. if (e === n.LuminanceAlphaFormat)
  51216. return Ge.LUMINANCE_ALPHA;
  51217. if (e === n.AddEquation)
  51218. return Ge.FUNC_ADD;
  51219. if (e === n.SubtractEquation)
  51220. return Ge.FUNC_SUBTRACT;
  51221. if (e === n.ReverseSubtractEquation)
  51222. return Ge.FUNC_REVERSE_SUBTRACT;
  51223. if (e === n.ZeroFactor)
  51224. return Ge.ZERO;
  51225. if (e === n.OneFactor)
  51226. return Ge.ONE;
  51227. if (e === n.SrcColorFactor)
  51228. return Ge.SRC_COLOR;
  51229. if (e === n.OneMinusSrcColorFactor)
  51230. return Ge.ONE_MINUS_SRC_COLOR;
  51231. if (e === n.SrcAlphaFactor)
  51232. return Ge.SRC_ALPHA;
  51233. if (e === n.OneMinusSrcAlphaFactor)
  51234. return Ge.ONE_MINUS_SRC_ALPHA;
  51235. if (e === n.DstAlphaFactor)
  51236. return Ge.DST_ALPHA;
  51237. if (e === n.OneMinusDstAlphaFactor)
  51238. return Ge.ONE_MINUS_DST_ALPHA;
  51239. if (e === n.DstColorFactor)
  51240. return Ge.DST_COLOR;
  51241. if (e === n.OneMinusDstColorFactor)
  51242. return Ge.ONE_MINUS_DST_COLOR;
  51243. if (e === n.SrcAlphaSaturateFactor)
  51244. return Ge.SRC_ALPHA_SATURATE;
  51245. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  51246. null !== t) {
  51247. if (e === n.RGB_S3TC_DXT1_Format)
  51248. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  51249. if (e === n.RGBA_S3TC_DXT1_Format)
  51250. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  51251. if (e === n.RGBA_S3TC_DXT3_Format)
  51252. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  51253. if (e === n.RGBA_S3TC_DXT5_Format)
  51254. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  51255. }
  51256. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  51257. null !== t) {
  51258. if (e === n.RGB_PVRTC_4BPPV1_Format)
  51259. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  51260. if (e === n.RGB_PVRTC_2BPPV1_Format)
  51261. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  51262. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  51263. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  51264. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  51265. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  51266. }
  51267. if (t = We.get("WEBGL_compressed_texture_etc1"),
  51268. null !== t && e === n.RGB_ETC1_Format)
  51269. return t.COMPRESSED_RGB_ETC1_WEBGL;
  51270. if (t = We.get("EXT_blend_minmax"),
  51271. null !== t) {
  51272. if (e === n.MinEquation)
  51273. return t.MIN_EXT;
  51274. if (e === n.MaxEquation)
  51275. return t.MAX_EXT
  51276. }
  51277. return 0
  51278. }
  51279. console.log("THREE.WebGLRenderer", n.REVISION),
  51280. e = e || {};
  51281. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  51282. , ie = void 0 !== e.context ? e.context : null
  51283. , ne = void 0 !== e.alpha && e.alpha
  51284. , re = void 0 === e.depth || e.depth
  51285. , oe = void 0 === e.stencil || e.stencil
  51286. , ae = void 0 !== e.antialias && e.antialias
  51287. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  51288. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  51289. , ce = []
  51290. , he = []
  51291. , ue = -1
  51292. , de = []
  51293. , pe = -1
  51294. , fe = new Float32Array(8)
  51295. , ge = []
  51296. , me = [];
  51297. this.domElement = te,
  51298. this.context = null,
  51299. this.autoClear = !0,
  51300. this.autoClearColor = !0,
  51301. this.autoClearDepth = !0,
  51302. this.autoClearStencil = !0,
  51303. this.sortObjects = !0,
  51304. this.gammaFactor = 2,
  51305. this.gammaInput = !1,
  51306. this.gammaOutput = !1,
  51307. this.physicallyCorrectLights = !1,
  51308. this.toneMapping = n.LinearToneMapping,
  51309. this.toneMappingExposure = 1,
  51310. this.toneMappingWhitePoint = 1,
  51311. this.maxMorphTargets = 8,
  51312. this.maxMorphNormals = 4,
  51313. this.autoScaleCubemaps = !0;
  51314. var ve = this
  51315. , Ae = null
  51316. , ye = null
  51317. , Ce = null
  51318. , Ie = -1
  51319. , Ee = ""
  51320. , be = null
  51321. , we = new n.Vector4
  51322. , _e = null
  51323. , Te = new n.Vector4
  51324. , xe = 0
  51325. , Se = new n.Color(0)
  51326. , Me = 0
  51327. , Re = te.width
  51328. , Pe = te.height
  51329. , Oe = 1
  51330. , Le = new n.Vector4(0,0,Re,Pe)
  51331. , De = !1
  51332. , Ne = new n.Vector4(0,0,Re,Pe)
  51333. , Be = new n.Frustum
  51334. , Fe = new n.Matrix4
  51335. , Ve = new n.Vector3
  51336. , Ue = {
  51337. hash: "",
  51338. ambient: [0, 0, 0],
  51339. directional: [],
  51340. directionalShadowMap: [],
  51341. directionalShadowMatrix: [],
  51342. spot: [],
  51343. spotShadowMap: [],
  51344. spotShadowMatrix: [],
  51345. point: [],
  51346. pointShadowMap: [],
  51347. pointShadowMatrix: [],
  51348. hemi: [],
  51349. shadows: [],
  51350. shadowsPointLight: 0
  51351. }
  51352. , ke = {
  51353. geometries: 0,
  51354. textures: 0
  51355. }
  51356. , He = {
  51357. calls: 0,
  51358. vertices: 0,
  51359. faces: 0,
  51360. points: 0
  51361. };
  51362. this.info = {
  51363. render: He,
  51364. memory: ke,
  51365. programs: null
  51366. };
  51367. var Ge;
  51368. try {
  51369. var ze = {
  51370. alpha: ne,
  51371. depth: re,
  51372. stencil: oe,
  51373. antialias: ae,
  51374. premultipliedAlpha: se,
  51375. preserveDrawingBuffer: le
  51376. };
  51377. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  51378. null === Ge)
  51379. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  51380. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  51381. return {
  51382. rangeMin: 1,
  51383. rangeMax: 1,
  51384. precision: 1
  51385. }
  51386. }
  51387. ),
  51388. te.addEventListener("webglcontextlost", a, !1)
  51389. } catch (e) {
  51390. console.error("THREE.WebGLRenderer: " + e)
  51391. }
  51392. var We = new n.WebGLExtensions(Ge);
  51393. We.get("OES_texture_float"),
  51394. We.get("OES_texture_float_linear"),
  51395. We.get("OES_texture_half_float"),
  51396. We.get("OES_texture_half_float_linear"),
  51397. We.get("OES_standard_derivatives"),
  51398. We.get("ANGLE_instanced_arrays"),
  51399. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  51400. var je = new n.WebGLCapabilities(Ge,We,e)
  51401. , Ye = new n.WebGLState(Ge,We,ee)
  51402. , Xe = new n.WebGLProperties
  51403. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  51404. , qe = new n.WebGLPrograms(this,je)
  51405. , Ke = new n.WebGLLights;
  51406. this.info.programs = qe.programs;
  51407. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  51408. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  51409. r(),
  51410. this.context = Ge,
  51411. this.capabilities = je,
  51412. this.extensions = We,
  51413. this.properties = Xe,
  51414. this.state = Ye;
  51415. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  51416. this.shadowMap = $e;
  51417. var et = new n.SpritePlugin(this,ge)
  51418. , tt = new n.LensFlarePlugin(this,me);
  51419. this.getContext = function() {
  51420. return Ge
  51421. }
  51422. ,
  51423. this.getContextAttributes = function() {
  51424. return Ge.getContextAttributes()
  51425. }
  51426. ,
  51427. this.forceContextLoss = function() {
  51428. We.get("WEBGL_lose_context").loseContext()
  51429. }
  51430. ,
  51431. this.getMaxAnisotropy = function() {
  51432. var e;
  51433. return function() {
  51434. if (void 0 !== e)
  51435. return e;
  51436. var t = We.get("EXT_texture_filter_anisotropic");
  51437. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  51438. }
  51439. }(),
  51440. this.getPrecision = function() {
  51441. return je.precision
  51442. }
  51443. ,
  51444. this.getPixelRatio = function() {
  51445. return Oe
  51446. }
  51447. ,
  51448. this.setPixelRatio = function(e) {
  51449. void 0 !== e && (Oe = e,
  51450. this.setSize(Ne.z, Ne.w, !1))
  51451. }
  51452. ,
  51453. this.getSize = function() {
  51454. return {
  51455. width: Re,
  51456. height: Pe
  51457. }
  51458. }
  51459. ,
  51460. this.setSize = function(e, t, i, devicePixelRatio) {
  51461. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  51462. Re = e,
  51463. Pe = t,
  51464. te.width = e * Oe,
  51465. te.height = t * Oe,
  51466. i !== !1 && (te.style.width = e + "px",
  51467. te.style.height = t + "px"),
  51468. this.setViewport(0, 0, e, t)
  51469. }
  51470. ,
  51471. this.setViewport = function(e, t, i, n) {
  51472. Ye.viewport(Ne.set(e, t, i, n))
  51473. }
  51474. ,
  51475. this.setScissor = function(e, t, i, n) {
  51476. Ye.scissor(Le.set(e, t, i, n))
  51477. }
  51478. ,
  51479. this.setScissorTest = function(e) {
  51480. Ye.setScissorTest(De = e)
  51481. }
  51482. ,
  51483. this.getClearColor = function() {
  51484. return Se
  51485. }
  51486. ,
  51487. this.setClearColor = function(e, t) {
  51488. Se.set(e),
  51489. Me = void 0 !== t ? t : 1,
  51490. i(Se.r, Se.g, Se.b, Me)
  51491. }
  51492. ,
  51493. this.getClearAlpha = function() {
  51494. return Me
  51495. }
  51496. ,
  51497. this.setClearAlpha = function(e) {
  51498. Me = e,
  51499. i(Se.r, Se.g, Se.b, Me)
  51500. }
  51501. ,
  51502. this.clear = function(e, t, i) {
  51503. var n = 0;
  51504. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  51505. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  51506. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  51507. Ge.clear(n)
  51508. }
  51509. ,
  51510. this.clearColor = function() {
  51511. this.clear(!0, !1, !1)
  51512. }
  51513. ,
  51514. this.clearDepth = function() {
  51515. this.clear(!1, !0, !1)
  51516. }
  51517. ,
  51518. this.clearStencil = function() {
  51519. this.clear(!1, !1, !0)
  51520. }
  51521. ,
  51522. this.clearTarget = function(e, t, i, n) {
  51523. this.setRenderTarget(e),
  51524. this.clear(t, i, n)
  51525. }
  51526. ,
  51527. this.resetGLState = o,
  51528. this.dispose = function() {
  51529. te.removeEventListener("webglcontextlost", a, !1)
  51530. }
  51531. ,
  51532. this.renderBufferImmediate = function(e, t, i) {
  51533. Ye.initAttributes();
  51534. var r = Xe.get(e);
  51535. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  51536. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  51537. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  51538. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  51539. var o = t.getAttributes();
  51540. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  51541. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  51542. Ye.enableAttribute(o.position),
  51543. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  51544. e.hasNormals) {
  51545. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  51546. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  51547. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  51548. var l = e.normalArray
  51549. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  51550. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  51551. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  51552. l[a + 0] = c,
  51553. l[a + 1] = h,
  51554. l[a + 2] = u,
  51555. l[a + 3] = c,
  51556. l[a + 4] = h,
  51557. l[a + 5] = u,
  51558. l[a + 6] = c,
  51559. l[a + 7] = h,
  51560. l[a + 8] = u
  51561. }
  51562. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  51563. Ye.enableAttribute(o.normal),
  51564. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  51565. }
  51566. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  51567. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  51568. Ye.enableAttribute(o.uv),
  51569. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  51570. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  51571. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  51572. Ye.enableAttribute(o.color),
  51573. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  51574. Ye.disableUnusedAttributes(),
  51575. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  51576. e.count = 0
  51577. }
  51578. ,
  51579. this.renderBufferDirect = function(e, i, r, o, a, s) {
  51580. E(o);
  51581. var l = w(e, i, o, a)
  51582. , c = !1
  51583. , h = r.id + "_" + l.id + "_" + o.wireframe;
  51584. h !== Ee && (Ee = h,
  51585. c = !0);
  51586. var u = a.morphTargetInfluences;
  51587. if (void 0 !== u) {
  51588. for (var d = [], p = 0, m = u.length; p < m; p++) {
  51589. var v = u[p];
  51590. d.push([v, p])
  51591. }
  51592. d.sort(g),
  51593. d.length > 8 && (d.length = 8);
  51594. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  51595. var v = d[p];
  51596. if (fe[p] = v[0],
  51597. 0 !== v[0]) {
  51598. var y = v[1];
  51599. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  51600. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  51601. } else
  51602. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  51603. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  51604. }
  51605. var C = l.getUniforms();
  51606. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  51607. c = !0
  51608. }
  51609. var y = r.index
  51610. , I = r.attributes.position;
  51611. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  51612. var b;
  51613. null !== y ? (b = Je,
  51614. b.setIndex(y)) : b = Qe,
  51615. c && (f(o, l, r),
  51616. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  51617. var _ = 0
  51618. , T = 1 / 0;
  51619. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  51620. var x = r.drawRange.start
  51621. , S = r.drawRange.count
  51622. , M = null !== s ? s.start : 0
  51623. , R = null !== s ? s.count : 1 / 0
  51624. , P = Math.max(_, x, M)
  51625. , O = Math.min(_ + T, x + S, M + R) - 1
  51626. , L = Math.max(0, O - P + 1);
  51627. if (a instanceof n.Mesh)
  51628. if (o.wireframe === !0)
  51629. Ye.setLineWidth(o.wireframeLinewidth * t()),
  51630. b.setMode(Ge.LINES);
  51631. else
  51632. switch (a.drawMode) {
  51633. case n.TrianglesDrawMode:
  51634. b.setMode(Ge.TRIANGLES);
  51635. break;
  51636. case n.TriangleStripDrawMode:
  51637. b.setMode(Ge.TRIANGLE_STRIP);
  51638. break;
  51639. case n.TriangleFanDrawMode:
  51640. b.setMode(Ge.TRIANGLE_FAN)
  51641. }
  51642. else if (a instanceof n.Line) {
  51643. var D = o.linewidth;
  51644. void 0 === D && (D = 1),
  51645. Ye.setLineWidth(D * t()),
  51646. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  51647. } else
  51648. a instanceof n.Points && b.setMode(Ge.POINTS);
  51649. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  51650. }
  51651. ,
  51652. this.render = function(e, t, i, r) {
  51653. if (t instanceof n.Camera == !1)
  51654. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  51655. var o = e.fog;
  51656. if (Ee = "",
  51657. Ie = -1,
  51658. be = null,
  51659. e.autoUpdate === !0 && e.updateMatrixWorld(),
  51660. null === t.parent && t.updateMatrixWorld(),
  51661. t.matrixWorldInverse.getInverse(t.matrixWorld),
  51662. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  51663. Be.setFromMatrix(Fe),
  51664. ce.length = 0,
  51665. ue = -1,
  51666. pe = -1,
  51667. ge.length = 0,
  51668. me.length = 0,
  51669. y(e, t),
  51670. he.length = ue + 1,
  51671. de.length = pe + 1,
  51672. ve.sortObjects === !0 && (he.sort(m),
  51673. de.sort(v)),
  51674. U(ce, t),
  51675. $e.render(e, t),
  51676. He.calls = 0,
  51677. He.vertices = 0,
  51678. He.faces = 0,
  51679. He.points = 0,
  51680. void 0 === i && (i = null),
  51681. this.setRenderTarget(i),
  51682. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  51683. e.overrideMaterial) {
  51684. var a = e.overrideMaterial;
  51685. C(he, t, o, a),
  51686. C(de, t, o, a)
  51687. } else
  51688. Ye.setBlending(n.NoBlending),
  51689. C(he, t, o),
  51690. C(de, t, o);
  51691. if (et.render(e, t),
  51692. tt.render(e, t, Te),
  51693. i) {
  51694. var s = i.texture;
  51695. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  51696. }
  51697. Ye.setDepthTest(!0),
  51698. Ye.setDepthWrite(!0),
  51699. Ye.setColorWrite(!0)
  51700. }
  51701. ,
  51702. this.setFaceCulling = function(e, t) {
  51703. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  51704. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  51705. Ye.enable(Ge.CULL_FACE))
  51706. }
  51707. ,
  51708. this.setTexture = function(e, t) {
  51709. var i = Xe.get(e);
  51710. if (e.version > 0 && i.__version !== e.version) {
  51711. var n = e.image;
  51712. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  51713. }
  51714. Ye.activeTexture(Ge.TEXTURE0 + t),
  51715. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  51716. }
  51717. ,
  51718. this.getCurrentRenderTarget = function() {
  51719. return ye
  51720. }
  51721. ,
  51722. this.setRenderTarget = function(e) {
  51723. ye = e,
  51724. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  51725. var t, i = e instanceof n.WebGLRenderTargetCube;
  51726. if (e) {
  51727. var r = Xe.get(e);
  51728. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  51729. we.copy(e.scissor),
  51730. _e = e.scissorTest,
  51731. Te.copy(e.viewport)
  51732. } else
  51733. t = null,
  51734. we.copy(Le).multiplyScalar(Oe),
  51735. _e = De,
  51736. Te.copy(Ne).multiplyScalar(Oe);
  51737. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  51738. Ce = t),
  51739. Ye.scissor(we),
  51740. Ye.setScissorTest(_e),
  51741. Ye.viewport(Te),
  51742. i) {
  51743. var o = Xe.get(e.texture);
  51744. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  51745. }
  51746. }
  51747. ,
  51748. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  51749. if (e instanceof n.WebGLRenderTarget == !1)
  51750. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  51751. var s = Xe.get(e).__webglFramebuffer;
  51752. if (s) {
  51753. var l = !1;
  51754. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  51755. l = !0);
  51756. try {
  51757. var c = e.texture;
  51758. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  51759. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  51760. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  51761. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  51762. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  51763. } finally {
  51764. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  51765. }
  51766. }
  51767. }
  51768. }
  51769. ,
  51770. n.WebGLRenderTarget = function(e, t, i) {
  51771. this.uuid = n.Math.generateUUID(),
  51772. this.width = e,
  51773. this.height = t,
  51774. this.scissor = new n.Vector4(0,0,e,t),
  51775. this.scissorTest = !1,
  51776. this.viewport = new n.Vector4(0,0,e,t),
  51777. i = i || {},
  51778. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  51779. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  51780. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  51781. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  51782. }
  51783. ,
  51784. n.WebGLRenderTarget.prototype = {
  51785. constructor: n.WebGLRenderTarget,
  51786. setSize: function(e, t) {
  51787. this.width === e && this.height === t || (this.width = e,
  51788. this.height = t,
  51789. this.dispose()),
  51790. this.viewport.set(0, 0, e, t),
  51791. this.scissor.set(0, 0, e, t)
  51792. },
  51793. clone: function() {
  51794. return (new this.constructor).copy(this)
  51795. },
  51796. copy: function(e) {
  51797. return this.width = e.width,
  51798. this.height = e.height,
  51799. this.viewport.copy(e.viewport),
  51800. this.texture = e.texture.clone(),
  51801. this.depthBuffer = e.depthBuffer,
  51802. this.stencilBuffer = e.stencilBuffer,
  51803. this
  51804. },
  51805. dispose: function() {
  51806. this.dispatchEvent({
  51807. type: "dispose"
  51808. })
  51809. }
  51810. },
  51811. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  51812. n.WebGLRenderTargetCube = function(e, t, i) {
  51813. n.WebGLRenderTarget.call(this, e, t, i),
  51814. this.activeCubeFace = 0,
  51815. this.activeMipMapLevel = 0
  51816. }
  51817. ,
  51818. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  51819. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  51820. n.WebGLBufferRenderer = function(e, t, i) {
  51821. function r(e) {
  51822. s = e
  51823. }
  51824. function o(t, n) {
  51825. e.drawArrays(s, t, n),
  51826. i.calls++,
  51827. i.vertices += n,
  51828. s === e.TRIANGLES && (i.faces += n / 3)
  51829. }
  51830. function a(r) {
  51831. var o = t.get("ANGLE_instanced_arrays");
  51832. if (null === o)
  51833. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51834. var a = r.attributes.position
  51835. , l = 0;
  51836. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  51837. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  51838. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  51839. i.calls++,
  51840. i.vertices += l * r.maxInstancedCount,
  51841. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  51842. }
  51843. var s;
  51844. this.setMode = r,
  51845. this.render = o,
  51846. this.renderInstances = a
  51847. }
  51848. ,
  51849. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  51850. function n(e) {
  51851. s = e
  51852. }
  51853. function r(i) {
  51854. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  51855. c = 4) : (l = e.UNSIGNED_SHORT,
  51856. c = 2)
  51857. }
  51858. function o(t, n) {
  51859. e.drawElements(s, n, l, t * c),
  51860. i.calls++,
  51861. i.vertices += n,
  51862. s === e.TRIANGLES && (i.faces += n / 3)
  51863. }
  51864. function a(n, r, o) {
  51865. var a = t.get("ANGLE_instanced_arrays");
  51866. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  51867. i.calls++,
  51868. i.vertices += o * n.maxInstancedCount,
  51869. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  51870. }
  51871. var s, l, c;
  51872. this.setMode = n,
  51873. this.setIndex = r,
  51874. this.render = o,
  51875. this.renderInstances = a
  51876. }
  51877. ,
  51878. n.WebGLExtensions = function(e) {
  51879. var t = {};
  51880. this.get = function(i) {
  51881. if (void 0 !== t[i])
  51882. return t[i];
  51883. var n;
  51884. switch (i) {
  51885. case "EXT_texture_filter_anisotropic":
  51886. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  51887. break;
  51888. case "WEBGL_compressed_texture_s3tc":
  51889. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  51890. break;
  51891. case "WEBGL_compressed_texture_pvrtc":
  51892. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  51893. break;
  51894. case "WEBGL_compressed_texture_etc1":
  51895. n = e.getExtension("WEBGL_compressed_texture_etc1");
  51896. break;
  51897. default:
  51898. n = e.getExtension(i)
  51899. }
  51900. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  51901. t[i] = n,
  51902. n
  51903. }
  51904. }
  51905. ,
  51906. n.WebGLCapabilities = function(e, t, i) {
  51907. function n(t) {
  51908. if ("highp" === t) {
  51909. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  51910. return "highp";
  51911. t = "mediump"
  51912. }
  51913. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  51914. }
  51915. this.getMaxPrecision = n,
  51916. this.precision = void 0 !== i.precision ? i.precision : "highp",
  51917. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  51918. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  51919. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  51920. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  51921. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  51922. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  51923. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  51924. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  51925. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  51926. this.vertexTextures = this.maxVertexTextures > 0,
  51927. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  51928. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  51929. var r = n(this.precision);
  51930. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  51931. this.precision = r),
  51932. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  51933. }
  51934. ,
  51935. n.WebGLGeometries = function(e, t, i) {
  51936. function r(e) {
  51937. var t = e.geometry;
  51938. if (void 0 !== h[t.id])
  51939. return h[t.id];
  51940. t.addEventListener("dispose", o);
  51941. var r;
  51942. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  51943. r = t._bufferGeometry),
  51944. h[t.id] = r,
  51945. i.memory.geometries++,
  51946. r
  51947. }
  51948. function o(e) {
  51949. var n = e.target
  51950. , r = h[n.id];
  51951. null !== r.index && s(r.index),
  51952. l(r.attributes),
  51953. n.removeEventListener("dispose", o),
  51954. delete h[n.id];
  51955. var a = t.get(n);
  51956. a.wireframe && s(a.wireframe),
  51957. t.delete(n);
  51958. var c = t.get(r);
  51959. c.wireframe && s(c.wireframe),
  51960. t.delete(r),
  51961. i.memory.geometries--
  51962. }
  51963. function a(e) {
  51964. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  51965. }
  51966. function s(t) {
  51967. var i = a(t);
  51968. void 0 !== i && (e.deleteBuffer(i),
  51969. c(t))
  51970. }
  51971. function l(e) {
  51972. for (var t in e)
  51973. s(e[t])
  51974. }
  51975. function c(e) {
  51976. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  51977. }
  51978. var h = {};
  51979. this.get = r
  51980. }
  51981. ,
  51982. n.WebGLLights = function() {
  51983. var e = {};
  51984. this.get = function(t) {
  51985. if (void 0 !== e[t.id])
  51986. return e[t.id];
  51987. var i;
  51988. switch (t.type) {
  51989. case "DirectionalLight":
  51990. i = {
  51991. direction: new n.Vector3,
  51992. color: new n.Color,
  51993. shadow: !1,
  51994. shadowBias: 0,
  51995. shadowRadius: 1,
  51996. shadowMapSize: new n.Vector2
  51997. };
  51998. break;
  51999. case "SpotLight":
  52000. i = {
  52001. position: new n.Vector3,
  52002. direction: new n.Vector3,
  52003. color: new n.Color,
  52004. distance: 0,
  52005. coneCos: 0,
  52006. penumbraCos: 0,
  52007. decay: 0,
  52008. shadow: !1,
  52009. shadowBias: 0,
  52010. shadowRadius: 1,
  52011. shadowMapSize: new n.Vector2
  52012. };
  52013. break;
  52014. case "PointLight":
  52015. i = {
  52016. position: new n.Vector3,
  52017. color: new n.Color,
  52018. distance: 0,
  52019. decay: 0,
  52020. shadow: !1,
  52021. shadowBias: 0,
  52022. shadowRadius: 1,
  52023. shadowMapSize: new n.Vector2
  52024. };
  52025. break;
  52026. case "HemisphereLight":
  52027. i = {
  52028. direction: new n.Vector3,
  52029. skyColor: new n.Color,
  52030. groundColor: new n.Color
  52031. }
  52032. }
  52033. return e[t.id] = i,
  52034. i
  52035. }
  52036. }
  52037. ,
  52038. n.WebGLObjects = function(e, t, i) {
  52039. function r(t) {
  52040. var i = u.get(t);
  52041. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52042. var r = i.index
  52043. , a = i.attributes;
  52044. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52045. for (var s in a)
  52046. o(a[s], e.ARRAY_BUFFER);
  52047. var l = i.morphAttributes;
  52048. for (var s in l)
  52049. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52050. o(c[h], e.ARRAY_BUFFER);
  52051. return i
  52052. }
  52053. function o(e, i) {
  52054. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52055. , o = t.get(r);
  52056. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52057. }
  52058. function a(t, i, n) {
  52059. t.__webglBuffer = e.createBuffer(),
  52060. e.bindBuffer(n, t.__webglBuffer);
  52061. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52062. e.bufferData(n, i.array, r),
  52063. t.version = i.version
  52064. }
  52065. function s(t, i, n) {
  52066. e.bindBuffer(n, t.__webglBuffer),
  52067. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  52068. i.updateRange.count = 0),
  52069. t.version = i.version
  52070. }
  52071. function l(e) {
  52072. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52073. }
  52074. function c(i) {
  52075. var r = t.get(i);
  52076. if (void 0 !== r.wireframe)
  52077. return r.wireframe;
  52078. var a = []
  52079. , s = i.index
  52080. , l = i.attributes
  52081. , c = l.position;
  52082. if (null !== s)
  52083. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52084. var g = d[p + 0]
  52085. , m = d[p + 1]
  52086. , v = d[p + 2];
  52087. h(u, g, m) && a.push(g, m),
  52088. h(u, m, v) && a.push(m, v),
  52089. h(u, v, g) && a.push(v, g)
  52090. }
  52091. else
  52092. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52093. var g = p + 0
  52094. , m = p + 1
  52095. , v = p + 2;
  52096. a.push(g, m, m, v, v, g)
  52097. }
  52098. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52099. , y = new n.BufferAttribute(new A(a),1);
  52100. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52101. r.wireframe = y,
  52102. y
  52103. }
  52104. function h(e, t, i) {
  52105. if (t > i) {
  52106. var n = t;
  52107. t = i,
  52108. i = n
  52109. }
  52110. var r = e[t];
  52111. return void 0 === r ? (e[t] = [i],
  52112. !0) : r.indexOf(i) === -1 && (r.push(i),
  52113. !0)
  52114. }
  52115. var u = new n.WebGLGeometries(e,t,i);
  52116. this.getAttributeBuffer = l,
  52117. this.getWireframeAttribute = c,
  52118. this.update = r
  52119. }
  52120. ,
  52121. n.WebGLProgram = function() {
  52122. function e(e) {
  52123. switch (e) {
  52124. case n.LinearEncoding:
  52125. return ["Linear", "( value )"];
  52126. case n.sRGBEncoding:
  52127. return ["sRGB", "( value )"];
  52128. case n.RGBEEncoding:
  52129. return ["RGBE", "( value )"];
  52130. case n.RGBM7Encoding:
  52131. return ["RGBM", "( value, 7.0 )"];
  52132. case n.RGBM16Encoding:
  52133. return ["RGBM", "( value, 16.0 )"];
  52134. case n.RGBDEncoding:
  52135. return ["RGBD", "( value, 256.0 )"];
  52136. case n.GammaEncoding:
  52137. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52138. default:
  52139. throw new Error("unsupported encoding: " + e)
  52140. }
  52141. }
  52142. function t(t, i) {
  52143. var n = e(i);
  52144. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52145. }
  52146. function i(t, i) {
  52147. var n = e(i);
  52148. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52149. }
  52150. function r(e, t) {
  52151. var i;
  52152. switch (t) {
  52153. case n.LinearToneMapping:
  52154. i = "Linear";
  52155. break;
  52156. case n.ReinhardToneMapping:
  52157. i = "Reinhard";
  52158. break;
  52159. case n.Uncharted2ToneMapping:
  52160. i = "Uncharted2";
  52161. break;
  52162. case n.CineonToneMapping:
  52163. i = "OptimizedCineon";
  52164. break;
  52165. default:
  52166. throw new Error("unsupported toneMapping: " + t)
  52167. }
  52168. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52169. }
  52170. function o(e, t, i) {
  52171. e = e || {};
  52172. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  52173. return n.filter(c).join("\n")
  52174. }
  52175. function a(e) {
  52176. var t = [];
  52177. for (var i in e) {
  52178. var n = e[i];
  52179. n !== !1 && t.push("#define " + i + " " + n)
  52180. }
  52181. return t.join("\n")
  52182. }
  52183. function s(e, t, i) {
  52184. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  52185. var a = e.getActiveUniform(t, o)
  52186. , s = a.name
  52187. , l = e.getUniformLocation(t, s)
  52188. , c = f.exec(s);
  52189. if (c) {
  52190. var h = c[1]
  52191. , u = c[2]
  52192. , d = n[h];
  52193. d || (d = n[h] = {}),
  52194. d[u] = l
  52195. } else if (c = g.exec(s)) {
  52196. var p = c[1]
  52197. , v = c[2]
  52198. , A = c[3]
  52199. , y = n[p];
  52200. y || (y = n[p] = []);
  52201. var C = y[v];
  52202. C || (C = y[v] = {}),
  52203. C[A] = l
  52204. } else if (c = m.exec(s)) {
  52205. var p = c[1];
  52206. n[p] = l
  52207. } else
  52208. n[s] = l
  52209. }
  52210. return n
  52211. }
  52212. function l(e, t, i) {
  52213. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  52214. var a = e.getActiveAttrib(t, o)
  52215. , s = a.name;
  52216. n[s] = e.getAttribLocation(t, s)
  52217. }
  52218. return n
  52219. }
  52220. function c(e) {
  52221. return "" !== e
  52222. }
  52223. function h(e, t) {
  52224. return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  52225. }
  52226. function u(e) {
  52227. function t(e, t) {
  52228. var i = n.ShaderChunk[t];
  52229. if (void 0 === i)
  52230. throw new Error("Can not resolve #include <" + t + ">");
  52231. return u(i)
  52232. }
  52233. var i = /#include +<([\w\d.]+)>/g;
  52234. return e.replace(i, t)
  52235. }
  52236. function d(e) {
  52237. function t(e, t, i, n) {
  52238. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  52239. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  52240. return r
  52241. }
  52242. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  52243. return e.replace(i, t)
  52244. }
  52245. var p = 0
  52246. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  52247. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  52248. , m = /^([\w\d_]+)\[0\]$/;
  52249. return function(e, f, g, m) {
  52250. var v = e.context
  52251. , A = g.extensions
  52252. , y = g.defines
  52253. , C = g.__webglShader.vertexShader
  52254. , I = g.__webglShader.fragmentShader
  52255. , E = "SHADOWMAP_TYPE_BASIC";
  52256. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  52257. var b = "ENVMAP_TYPE_CUBE"
  52258. , w = "ENVMAP_MODE_REFLECTION"
  52259. , _ = "ENVMAP_BLENDING_MULTIPLY";
  52260. if (m.envMap) {
  52261. switch (g.envMap.mapping) {
  52262. case n.CubeReflectionMapping:
  52263. case n.CubeRefractionMapping:
  52264. b = "ENVMAP_TYPE_CUBE";
  52265. break;
  52266. case n.CubeUVReflectionMapping:
  52267. case n.CubeUVRefractionMapping:
  52268. b = "ENVMAP_TYPE_CUBE_UV";
  52269. break;
  52270. case n.EquirectangularReflectionMapping:
  52271. case n.EquirectangularRefractionMapping:
  52272. b = "ENVMAP_TYPE_EQUIREC";
  52273. break;
  52274. case n.SphericalReflectionMapping:
  52275. b = "ENVMAP_TYPE_SPHERE"
  52276. }
  52277. switch (g.envMap.mapping) {
  52278. case n.CubeRefractionMapping:
  52279. case n.EquirectangularRefractionMapping:
  52280. w = "ENVMAP_MODE_REFRACTION"
  52281. }
  52282. switch (g.combine) {
  52283. case n.MultiplyOperation:
  52284. _ = "ENVMAP_BLENDING_MULTIPLY";
  52285. break;
  52286. case n.MixOperation:
  52287. _ = "ENVMAP_BLENDING_MIX";
  52288. break;
  52289. case n.AddOperation:
  52290. _ = "ENVMAP_BLENDING_ADD"
  52291. }
  52292. }
  52293. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  52294. g instanceof n.RawShaderMaterial ? (T = "",
  52295. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  52296. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  52297. C = u(C, m),
  52298. C = h(C, m),
  52299. I = u(I, m),
  52300. I = h(I, m),
  52301. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  52302. I = d(I));
  52303. var O = T + C
  52304. , L = x + I
  52305. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  52306. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  52307. v.attachShader(P, D),
  52308. v.attachShader(P, N),
  52309. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  52310. v.linkProgram(P);
  52311. var B = v.getProgramInfoLog(P)
  52312. , F = v.getShaderInfoLog(D)
  52313. , V = v.getShaderInfoLog(N)
  52314. , U = !0
  52315. , k = !0;
  52316. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  52317. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  52318. k && (this.diagnostics = {
  52319. runnable: U,
  52320. material: g,
  52321. programLog: B,
  52322. vertexShader: {
  52323. log: F,
  52324. prefix: T
  52325. },
  52326. fragmentShader: {
  52327. log: V,
  52328. prefix: x
  52329. }
  52330. }),
  52331. v.deleteShader(D),
  52332. v.deleteShader(N);
  52333. var H;
  52334. this.getUniforms = function() {
  52335. return void 0 === H && (H = s(v, P)),
  52336. H
  52337. }
  52338. ;
  52339. var G;
  52340. return this.getAttributes = function() {
  52341. return void 0 === G && (G = l(v, P)),
  52342. G
  52343. }
  52344. ,
  52345. this.destroy = function() {
  52346. v.deleteProgram(P),
  52347. this.program = void 0
  52348. }
  52349. ,
  52350. Object.defineProperties(this, {
  52351. uniforms: {
  52352. get: function() {
  52353. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  52354. this.getUniforms()
  52355. }
  52356. },
  52357. attributes: {
  52358. get: function() {
  52359. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  52360. this.getAttributes()
  52361. }
  52362. }
  52363. }),
  52364. this.id = p++,
  52365. this.code = f,
  52366. this.usedTimes = 1,
  52367. this.program = P,
  52368. this.vertexShader = D,
  52369. this.fragmentShader = N,
  52370. this
  52371. }
  52372. }(),
  52373. n.WebGLPrograms = function(e, t) {
  52374. function i(e) {
  52375. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  52376. return 1024;
  52377. var i = t.maxVertexUniforms
  52378. , r = Math.floor((i - 20) / 4)
  52379. , o = r;
  52380. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  52381. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  52382. o
  52383. }
  52384. function r(e, t) {
  52385. var i;
  52386. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  52387. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  52388. i
  52389. }
  52390. var o = []
  52391. , a = {
  52392. MeshDepthMaterial: "depth",
  52393. MeshNormalMaterial: "normal",
  52394. MeshBasicMaterial: "basic",
  52395. MeshLambertMaterial: "lambert",
  52396. MeshPhongMaterial: "phong",
  52397. MeshStandardMaterial: "standard",
  52398. LineBasicMaterial: "basic",
  52399. LineDashedMaterial: "dashed",
  52400. PointsMaterial: "points"
  52401. }
  52402. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  52403. this.getParameters = function(o, s, l, c) {
  52404. var h = a[o.type]
  52405. , u = i(c)
  52406. , d = e.getPrecision();
  52407. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  52408. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  52409. var p = {
  52410. shaderID: h,
  52411. precision: d,
  52412. supportsVertexTextures: t.vertexTextures,
  52413. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  52414. map: !!o.map,
  52415. mapEncoding: r(o.map, e.gammaInput),
  52416. envMap: !!o.envMap,
  52417. envMapMode: o.envMap && o.envMap.mapping,
  52418. envMapEncoding: r(o.envMap, e.gammaInput),
  52419. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  52420. lightMap: !!o.lightMap,
  52421. aoMap: !!o.aoMap,
  52422. emissiveMap: !!o.emissiveMap,
  52423. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  52424. bumpMap: !!o.bumpMap,
  52425. normalMap: !!o.normalMap,
  52426. displacementMap: !!o.displacementMap,
  52427. roughnessMap: !!o.roughnessMap,
  52428. metalnessMap: !!o.metalnessMap,
  52429. specularMap: !!o.specularMap,
  52430. alphaMap: !!o.alphaMap,
  52431. combine: o.combine,
  52432. vertexColors: o.vertexColors,
  52433. fog: l,
  52434. useFog: o.fog,
  52435. fogExp: l instanceof n.FogExp2,
  52436. flatShading: o.shading === n.FlatShading,
  52437. sizeAttenuation: o.sizeAttenuation,
  52438. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  52439. skinning: o.skinning,
  52440. maxBones: u,
  52441. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  52442. morphTargets: o.morphTargets,
  52443. morphNormals: o.morphNormals,
  52444. maxMorphTargets: e.maxMorphTargets,
  52445. maxMorphNormals: e.maxMorphNormals,
  52446. numDirLights: s.directional.length,
  52447. numPointLights: s.point.length,
  52448. numSpotLights: s.spot.length,
  52449. numHemiLights: s.hemi.length,
  52450. pointLightShadows: s.shadowsPointLight,
  52451. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  52452. shadowMapType: e.shadowMap.type,
  52453. toneMapping: e.toneMapping,
  52454. physicallyCorrectLights: e.physicallyCorrectLights,
  52455. premultipliedAlpha: o.premultipliedAlpha,
  52456. alphaTest: o.alphaTest,
  52457. doubleSided: o.side === n.DoubleSide,
  52458. flipSided: o.side === n.BackSide
  52459. };
  52460. return p
  52461. }
  52462. ,
  52463. this.getProgramCode = function(e, t) {
  52464. var i = [];
  52465. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  52466. i.push(e.vertexShader)),
  52467. void 0 !== e.defines)
  52468. for (var n in e.defines)
  52469. i.push(n),
  52470. i.push(e.defines[n]);
  52471. for (var r = 0; r < s.length; r++) {
  52472. var o = s[r];
  52473. i.push(o),
  52474. i.push(t[o])
  52475. }
  52476. return i.join()
  52477. }
  52478. ,
  52479. this.acquireProgram = function(t, i, r) {
  52480. for (var a, s = 0, l = o.length; s < l; s++) {
  52481. var c = o[s];
  52482. if (c.code === r) {
  52483. a = c,
  52484. ++a.usedTimes;
  52485. break
  52486. }
  52487. }
  52488. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  52489. o.push(a)),
  52490. a
  52491. }
  52492. ,
  52493. this.releaseProgram = function(e) {
  52494. if (0 === --e.usedTimes) {
  52495. var t = o.indexOf(e);
  52496. o[t] = o[o.length - 1],
  52497. o.pop(),
  52498. e.destroy()
  52499. }
  52500. }
  52501. ,
  52502. this.programs = o
  52503. }
  52504. ,
  52505. n.WebGLProperties = function() {
  52506. var e = {};
  52507. this.get = function(t) {
  52508. var i = t.uuid
  52509. , n = e[i];
  52510. return void 0 === n && (n = {},
  52511. e[i] = n),
  52512. n
  52513. }
  52514. ,
  52515. this.delete = function(t) {
  52516. delete e[t.uuid]
  52517. }
  52518. ,
  52519. this.clear = function() {
  52520. e = {}
  52521. }
  52522. }
  52523. ,
  52524. n.WebGLShader = function() {
  52525. function e(e) {
  52526. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  52527. t[i] = i + 1 + ": " + t[i];
  52528. return t.join("\n")
  52529. }
  52530. return function(t, i, n) {
  52531. var r = t.createShader(i);
  52532. return t.shaderSource(r, n),
  52533. t.compileShader(r),
  52534. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  52535. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  52536. r
  52537. }
  52538. }(),
  52539. n.WebGLShadowMap = function(e, t, i) {
  52540. function r(e, t, i, r) {
  52541. var o = e.geometry
  52542. , a = null
  52543. , s = v
  52544. , l = e.customDepthMaterial;
  52545. if (i && (s = A,
  52546. l = e.customDistanceMaterial),
  52547. l)
  52548. a = l;
  52549. else {
  52550. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  52551. , h = e instanceof n.SkinnedMesh && t.skinning
  52552. , u = 0;
  52553. c && (u |= f),
  52554. h && (u |= g),
  52555. a = s[u]
  52556. }
  52557. return a.visible = t.visible,
  52558. a.wireframe = t.wireframe,
  52559. a.wireframeLinewidth = t.wireframeLinewidth,
  52560. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  52561. a
  52562. }
  52563. function o(e, t, i) {
  52564. if (e.visible !== !1) {
  52565. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  52566. var r = e.material;
  52567. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  52568. p.push(e))
  52569. }
  52570. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  52571. o(a[s], t, i)
  52572. }
  52573. }
  52574. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  52575. var x = 0 !== (T & f)
  52576. , S = 0 !== (T & g)
  52577. , M = new n.ShaderMaterial({
  52578. uniforms: b,
  52579. vertexShader: E.vertexShader,
  52580. fragmentShader: E.fragmentShader,
  52581. morphTargets: x,
  52582. skinning: S
  52583. });
  52584. v[T] = M;
  52585. var R = new n.ShaderMaterial({
  52586. defines: {
  52587. USE_SHADOWMAP: ""
  52588. },
  52589. uniforms: _,
  52590. vertexShader: w.vertexShader,
  52591. fragmentShader: w.fragmentShader,
  52592. morphTargets: x,
  52593. skinning: S
  52594. });
  52595. A[T] = R
  52596. }
  52597. var P = this;
  52598. this.enabled = !1,
  52599. this.autoUpdate = !0,
  52600. this.needsUpdate = !1,
  52601. this.type = n.PCFShadowMap,
  52602. this.cullFace = n.CullFaceFront,
  52603. this.render = function(f, g) {
  52604. var m, v, A = t.shadows;
  52605. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  52606. s.clearColor(1, 1, 1, 1),
  52607. s.disable(a.BLEND),
  52608. s.enable(a.CULL_FACE),
  52609. a.frontFace(a.CCW),
  52610. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  52611. s.setDepthTest(!0),
  52612. s.setScissorTest(!1);
  52613. for (var E = 0, b = A.length; E < b; E++) {
  52614. var w = A[E]
  52615. , _ = w.shadow
  52616. , T = _.camera;
  52617. if (h.copy(_.mapSize),
  52618. w instanceof n.PointLight) {
  52619. m = 6,
  52620. v = !0;
  52621. var x = h.x
  52622. , S = h.y;
  52623. I[0].set(2 * x, S, x, S),
  52624. I[1].set(0, S, x, S),
  52625. I[2].set(3 * x, S, x, S),
  52626. I[3].set(x, S, x, S),
  52627. I[4].set(3 * x, 0, x, S),
  52628. I[5].set(x, 0, x, S),
  52629. h.x *= 4,
  52630. h.y *= 2
  52631. } else
  52632. m = 1,
  52633. v = !1;
  52634. if (null === _.map) {
  52635. var M = {
  52636. minFilter: n.NearestFilter,
  52637. magFilter: n.NearestFilter,
  52638. format: n.RGBAFormat
  52639. };
  52640. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  52641. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  52642. T.updateProjectionMatrix()
  52643. }
  52644. var R = _.map
  52645. , O = _.matrix;
  52646. d.setFromMatrixPosition(w.matrixWorld),
  52647. T.position.copy(d),
  52648. e.setRenderTarget(R),
  52649. e.clear();
  52650. for (var L = 0; L < m; L++) {
  52651. if (v) {
  52652. u.copy(T.position),
  52653. u.add(y[L]),
  52654. T.up.copy(C[L]),
  52655. T.lookAt(u);
  52656. var D = I[L];
  52657. s.viewport(D)
  52658. } else
  52659. u.setFromMatrixPosition(w.target.matrixWorld),
  52660. T.lookAt(u);
  52661. T.updateMatrixWorld(),
  52662. T.matrixWorldInverse.getInverse(T.matrixWorld),
  52663. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  52664. O.multiply(T.projectionMatrix),
  52665. O.multiply(T.matrixWorldInverse),
  52666. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  52667. l.setFromMatrix(c),
  52668. p.length = 0,
  52669. o(f, g, T);
  52670. for (var N = 0, B = p.length; N < B; N++) {
  52671. var F = p[N]
  52672. , V = i.update(F)
  52673. , U = F.material;
  52674. if (U instanceof n.MultiMaterial)
  52675. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  52676. var W = k[G]
  52677. , j = H[W.materialIndex];
  52678. if (j.visible === !0) {
  52679. var Y = r(F, j, v, d);
  52680. e.renderBufferDirect(T, null, V, Y, F, W)
  52681. }
  52682. }
  52683. else {
  52684. var Y = r(F, U, v, d);
  52685. e.renderBufferDirect(T, null, V, Y, F, null)
  52686. }
  52687. }
  52688. }
  52689. }
  52690. var X = e.getClearColor()
  52691. , Z = e.getClearAlpha();
  52692. e.setClearColor(X, Z),
  52693. s.enable(a.BLEND),
  52694. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  52695. P.needsUpdate = !1
  52696. }
  52697. }
  52698. }
  52699. ,
  52700. n.WebGLState = function(e, t, i) {
  52701. var r = this
  52702. , o = new n.Vector4
  52703. , a = new Uint8Array(16)
  52704. , s = new Uint8Array(16)
  52705. , l = new Uint8Array(16)
  52706. , c = {}
  52707. , h = null
  52708. , u = null
  52709. , d = null
  52710. , p = null
  52711. , f = null
  52712. , g = null
  52713. , m = null
  52714. , v = null
  52715. , A = !1
  52716. , y = null
  52717. , C = null
  52718. , I = null
  52719. , E = null
  52720. , b = null
  52721. , w = null
  52722. , _ = null
  52723. , T = null
  52724. , x = null
  52725. , S = null
  52726. , M = null
  52727. , R = null
  52728. , P = null
  52729. , O = null
  52730. , L = null
  52731. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  52732. , N = void 0
  52733. , B = {}
  52734. , F = new n.Vector4
  52735. , V = null
  52736. , U = null
  52737. , k = new n.Vector4
  52738. , H = new n.Vector4
  52739. , G = e.createTexture();
  52740. e.bindTexture(e.TEXTURE_2D, G),
  52741. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  52742. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  52743. this.init = function() {
  52744. this.clearColor(0, 0, 0, 1),
  52745. this.clearDepth(1),
  52746. this.clearStencil(0),
  52747. this.enable(e.DEPTH_TEST),
  52748. e.depthFunc(e.LEQUAL),
  52749. e.frontFace(e.CCW),
  52750. e.cullFace(e.BACK),
  52751. this.enable(e.CULL_FACE),
  52752. this.enable(e.BLEND),
  52753. e.blendEquation(e.FUNC_ADD),
  52754. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  52755. }
  52756. ,
  52757. this.initAttributes = function() {
  52758. for (var e = 0, t = a.length; e < t; e++)
  52759. a[e] = 0
  52760. }
  52761. ,
  52762. this.enableAttribute = function(i) {
  52763. if (a[i] = 1,
  52764. 0 === s[i] && (e.enableVertexAttribArray(i),
  52765. s[i] = 1),
  52766. 0 !== l[i]) {
  52767. var n = t.get("ANGLE_instanced_arrays");
  52768. n.vertexAttribDivisorANGLE(i, 0),
  52769. l[i] = 0
  52770. }
  52771. }
  52772. ,
  52773. this.enableAttributeAndDivisor = function(t, i, n) {
  52774. a[t] = 1,
  52775. 0 === s[t] && (e.enableVertexAttribArray(t),
  52776. s[t] = 1),
  52777. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  52778. l[t] = i)
  52779. }
  52780. ,
  52781. this.disableUnusedAttributes = function() {
  52782. for (var t = 0, i = s.length; t < i; t++)
  52783. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  52784. s[t] = 0)
  52785. }
  52786. ,
  52787. this.enable = function(t) {
  52788. c[t] !== !0 && (e.enable(t),
  52789. c[t] = !0)
  52790. }
  52791. ,
  52792. this.disable = function(t) {
  52793. c[t] !== !1 && (e.disable(t),
  52794. c[t] = !1)
  52795. }
  52796. ,
  52797. this.getCompressedTextureFormats = function() {
  52798. if (null === h && (h = [],
  52799. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  52800. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  52801. h.push(i[n]);
  52802. return h
  52803. }
  52804. ,
  52805. this.setBlending = function(t, r, o, a, s, l, c, h) {
  52806. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  52807. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52808. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  52809. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52810. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52811. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52812. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  52813. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52814. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  52815. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  52816. u = t,
  52817. A = h),
  52818. t === n.CustomBlending ? (s = s || r,
  52819. l = l || o,
  52820. c = c || a,
  52821. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  52822. d = r,
  52823. g = s),
  52824. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  52825. p = o,
  52826. f = a,
  52827. m = l,
  52828. v = c)) : (d = null,
  52829. p = null,
  52830. f = null,
  52831. g = null,
  52832. m = null,
  52833. v = null)
  52834. }
  52835. ,
  52836. this.setDepthFunc = function(t) {
  52837. if (y !== t) {
  52838. if (t)
  52839. switch (t) {
  52840. case n.NeverDepth:
  52841. e.depthFunc(e.NEVER);
  52842. break;
  52843. case n.AlwaysDepth:
  52844. e.depthFunc(e.ALWAYS);
  52845. break;
  52846. case n.LessDepth:
  52847. e.depthFunc(e.LESS);
  52848. break;
  52849. case n.LessEqualDepth:
  52850. e.depthFunc(e.LEQUAL);
  52851. break;
  52852. case n.EqualDepth:
  52853. e.depthFunc(e.EQUAL);
  52854. break;
  52855. case n.GreaterEqualDepth:
  52856. e.depthFunc(e.GEQUAL);
  52857. break;
  52858. case n.GreaterDepth:
  52859. e.depthFunc(e.GREATER);
  52860. break;
  52861. case n.NotEqualDepth:
  52862. e.depthFunc(e.NOTEQUAL);
  52863. break;
  52864. default:
  52865. e.depthFunc(e.LEQUAL)
  52866. }
  52867. else
  52868. e.depthFunc(e.LEQUAL);
  52869. y = t
  52870. }
  52871. }
  52872. ,
  52873. this.setDepthTest = function(t) {
  52874. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  52875. }
  52876. ,
  52877. this.setDepthWrite = function(t) {
  52878. C !== t && (e.depthMask(t),
  52879. C = t)
  52880. }
  52881. ,
  52882. this.setColorWrite = function(t) {
  52883. I !== t && (e.colorMask(t, t, t, t),
  52884. I = t)
  52885. }
  52886. ,
  52887. this.setStencilFunc = function(t, i, n) {
  52888. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  52889. b = t,
  52890. w = i,
  52891. _ = n)
  52892. }
  52893. ,
  52894. this.setStencilOp = function(t, i, n) {
  52895. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  52896. T = t,
  52897. x = i,
  52898. S = n)
  52899. }
  52900. ,
  52901. this.setStencilTest = function(t) {
  52902. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  52903. }
  52904. ,
  52905. this.setStencilWrite = function(t) {
  52906. E !== t && (e.stencilMask(t),
  52907. E = t)
  52908. }
  52909. ,
  52910. this.setFlipSided = function(t) {
  52911. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  52912. M = t)
  52913. }
  52914. ,
  52915. this.setLineWidth = function(t) {
  52916. t !== R && (e.lineWidth(t),
  52917. R = t)
  52918. }
  52919. ,
  52920. this.setPolygonOffset = function(t, i, n) {
  52921. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  52922. !t || P === i && O === n || (e.polygonOffset(i, n),
  52923. P = i,
  52924. O = n)
  52925. }
  52926. ,
  52927. this.getScissorTest = function() {
  52928. return L
  52929. }
  52930. ,
  52931. this.setScissorTest = function(t) {
  52932. L = t,
  52933. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  52934. }
  52935. ,
  52936. this.activeTexture = function(t) {
  52937. void 0 === t && (t = e.TEXTURE0 + D - 1),
  52938. N !== t && (e.activeTexture(t),
  52939. N = t)
  52940. }
  52941. ,
  52942. this.bindTexture = function(t, i) {
  52943. void 0 === N && r.activeTexture();
  52944. var n = B[N];
  52945. void 0 === n && (n = {
  52946. type: void 0,
  52947. texture: void 0
  52948. },
  52949. B[N] = n),
  52950. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  52951. n.type = t,
  52952. n.texture = i)
  52953. }
  52954. ,
  52955. this.compressedTexImage2D = function() {
  52956. try {
  52957. e.compressedTexImage2D.apply(e, arguments)
  52958. } catch (e) {
  52959. console.error(e)
  52960. }
  52961. }
  52962. ,
  52963. this.texImage2D = function() {
  52964. try {
  52965. e.texImage2D.apply(e, arguments)
  52966. } catch (e) {
  52967. console.error(e)
  52968. }
  52969. }
  52970. ,
  52971. this.clearColor = function(t, i, n, r) {
  52972. o.set(t, i, n, r),
  52973. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  52974. F.copy(o))
  52975. }
  52976. ,
  52977. this.clearDepth = function(t) {
  52978. V !== t && (e.clearDepth(t),
  52979. V = t)
  52980. }
  52981. ,
  52982. this.clearStencil = function(t) {
  52983. U !== t && (e.clearStencil(t),
  52984. U = t)
  52985. }
  52986. ,
  52987. this.scissor = function(t) {
  52988. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  52989. k.copy(t))
  52990. }
  52991. ,
  52992. this.viewport = function(t) {
  52993. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  52994. H.copy(t))
  52995. }
  52996. ,
  52997. this.reset = function() {
  52998. for (var t = 0; t < s.length; t++)
  52999. 1 === s[t] && (e.disableVertexAttribArray(t),
  53000. s[t] = 0);
  53001. c = {},
  53002. h = null,
  53003. N = void 0,
  53004. B = {},
  53005. u = null,
  53006. I = null,
  53007. C = null,
  53008. E = null,
  53009. M = null
  53010. }
  53011. }
  53012. ,
  53013. n.LensFlarePlugin = function(e, t) {
  53014. function i() {
  53015. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53016. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53017. o = p.createBuffer(),
  53018. a = p.createBuffer(),
  53019. p.bindBuffer(p.ARRAY_BUFFER, o),
  53020. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53021. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53022. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53023. u = p.createTexture(),
  53024. d = p.createTexture(),
  53025. f.bindTexture(p.TEXTURE_2D, u),
  53026. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53027. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53028. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53029. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53030. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53031. f.bindTexture(p.TEXTURE_2D, d),
  53032. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53033. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53034. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53035. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53036. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53037. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53038. var i;
  53039. i = h ? {
  53040. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "uniform sampler2D occlusionMap;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", "vVisibility = visibility.r / 9.0;", "vVisibility *= 1.0 - visibility.g / 9.0;", "vVisibility *= visibility.b / 9.0;", "vVisibility *= 1.0 - visibility.a / 9.0;", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  53041. fragmentShader: ["uniform lowp int renderType;", "uniform sampler2D map;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * vVisibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  53042. } : {
  53043. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  53044. fragmentShader: ["precision mediump float;", "uniform lowp int renderType;", "uniform sampler2D map;", "uniform sampler2D occlusionMap;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", "visibility = ( 1.0 - visibility / 4.0 );", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * visibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  53045. },
  53046. s = r(i),
  53047. l = {
  53048. vertex: p.getAttribLocation(s, "position"),
  53049. uv: p.getAttribLocation(s, "uv")
  53050. },
  53051. c = {
  53052. renderType: p.getUniformLocation(s, "renderType"),
  53053. map: p.getUniformLocation(s, "map"),
  53054. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53055. opacity: p.getUniformLocation(s, "opacity"),
  53056. color: p.getUniformLocation(s, "color"),
  53057. scale: p.getUniformLocation(s, "scale"),
  53058. rotation: p.getUniformLocation(s, "rotation"),
  53059. screenPosition: p.getUniformLocation(s, "screenPosition")
  53060. }
  53061. }
  53062. function r(t) {
  53063. var i = p.createProgram()
  53064. , n = p.createShader(p.FRAGMENT_SHADER)
  53065. , r = p.createShader(p.VERTEX_SHADER)
  53066. , o = "precision " + e.getPrecision() + " float;\n";
  53067. return p.shaderSource(n, o + t.fragmentShader),
  53068. p.shaderSource(r, o + t.vertexShader),
  53069. p.compileShader(n),
  53070. p.compileShader(r),
  53071. p.attachShader(i, n),
  53072. p.attachShader(i, r),
  53073. p.linkProgram(i),
  53074. i
  53075. }
  53076. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53077. this.render = function(r, g, m) {
  53078. if (0 !== t.length) {
  53079. var v = new n.Vector3
  53080. , A = m.w / m.z
  53081. , y = .5 * m.z
  53082. , C = .5 * m.w
  53083. , I = 16 / m.w
  53084. , E = new n.Vector2(I * A,I)
  53085. , b = new n.Vector3(1,1,0)
  53086. , w = new n.Vector2(1,1);
  53087. void 0 === s && i(),
  53088. p.useProgram(s),
  53089. f.initAttributes(),
  53090. f.enableAttribute(l.vertex),
  53091. f.enableAttribute(l.uv),
  53092. f.disableUnusedAttributes(),
  53093. p.uniform1i(c.occlusionMap, 0),
  53094. p.uniform1i(c.map, 1),
  53095. p.bindBuffer(p.ARRAY_BUFFER, o),
  53096. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53097. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53098. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53099. f.disable(p.CULL_FACE),
  53100. f.setDepthWrite(!1);
  53101. for (var _ = 0, T = t.length; _ < T; _++) {
  53102. I = 16 / m.w,
  53103. E.set(I * A, I);
  53104. var x = t[_];
  53105. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53106. v.applyMatrix4(g.matrixWorldInverse),
  53107. v.applyProjection(g.projectionMatrix),
  53108. b.copy(v),
  53109. w.x = b.x * y + y,
  53110. w.y = b.y * C + C,
  53111. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53112. f.activeTexture(p.TEXTURE0),
  53113. f.bindTexture(p.TEXTURE_2D, null),
  53114. f.activeTexture(p.TEXTURE1),
  53115. f.bindTexture(p.TEXTURE_2D, u),
  53116. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53117. p.uniform1i(c.renderType, 0),
  53118. p.uniform2f(c.scale, E.x, E.y),
  53119. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53120. f.disable(p.BLEND),
  53121. f.enable(p.DEPTH_TEST),
  53122. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53123. f.activeTexture(p.TEXTURE0),
  53124. f.bindTexture(p.TEXTURE_2D, d),
  53125. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53126. p.uniform1i(c.renderType, 1),
  53127. f.disable(p.DEPTH_TEST),
  53128. f.activeTexture(p.TEXTURE1),
  53129. f.bindTexture(p.TEXTURE_2D, u),
  53130. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53131. x.positionScreen.copy(b),
  53132. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53133. p.uniform1i(c.renderType, 2),
  53134. f.enable(p.BLEND);
  53135. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53136. var R = x.lensFlares[S];
  53137. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53138. b.y = R.y,
  53139. b.z = R.z,
  53140. I = R.size * R.scale / m.w,
  53141. E.x = I * A,
  53142. E.y = I,
  53143. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53144. p.uniform2f(c.scale, E.x, E.y),
  53145. p.uniform1f(c.rotation, R.rotation),
  53146. p.uniform1f(c.opacity, R.opacity),
  53147. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53148. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53149. e.setTexture(R.texture, 1),
  53150. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53151. }
  53152. }
  53153. }
  53154. f.enable(p.CULL_FACE),
  53155. f.enable(p.DEPTH_TEST),
  53156. f.setDepthWrite(!0),
  53157. e.resetGLState()
  53158. }
  53159. }
  53160. }
  53161. ,
  53162. n.SpritePlugin = function(e, t) {
  53163. function i() {
  53164. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53165. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53166. a = d.createBuffer(),
  53167. s = d.createBuffer(),
  53168. d.bindBuffer(d.ARRAY_BUFFER, a),
  53169. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53170. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53171. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53172. l = r(),
  53173. c = {
  53174. position: d.getAttribLocation(l, "position"),
  53175. uv: d.getAttribLocation(l, "uv")
  53176. },
  53177. h = {
  53178. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53179. uvScale: d.getUniformLocation(l, "uvScale"),
  53180. rotation: d.getUniformLocation(l, "rotation"),
  53181. scale: d.getUniformLocation(l, "scale"),
  53182. color: d.getUniformLocation(l, "color"),
  53183. map: d.getUniformLocation(l, "map"),
  53184. opacity: d.getUniformLocation(l, "opacity"),
  53185. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  53186. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  53187. fogType: d.getUniformLocation(l, "fogType"),
  53188. fogDensity: d.getUniformLocation(l, "fogDensity"),
  53189. fogNear: d.getUniformLocation(l, "fogNear"),
  53190. fogFar: d.getUniformLocation(l, "fogFar"),
  53191. fogColor: d.getUniformLocation(l, "fogColor"),
  53192. alphaTest: d.getUniformLocation(l, "alphaTest")
  53193. };
  53194. var i = document.createElement("canvas");
  53195. i.width = 8,
  53196. i.height = 8;
  53197. var o = i.getContext("2d");
  53198. o.fillStyle = "white",
  53199. o.fillRect(0, 0, 8, 8),
  53200. u = new n.Texture(i),
  53201. u.needsUpdate = !0
  53202. }
  53203. function r() {
  53204. var t = d.createProgram()
  53205. , i = d.createShader(d.VERTEX_SHADER)
  53206. , n = d.createShader(d.FRAGMENT_SHADER);
  53207. return d.shaderSource(i, ["precision " + e.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  53208. d.shaderSource(n, ["precision " + e.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  53209. d.compileShader(i),
  53210. d.compileShader(n),
  53211. d.attachShader(t, i),
  53212. d.attachShader(t, n),
  53213. d.linkProgram(t),
  53214. t
  53215. }
  53216. function o(e, t) {
  53217. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  53218. }
  53219. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  53220. this.render = function(r, v) {
  53221. if (0 !== t.length) {
  53222. void 0 === l && i(),
  53223. d.useProgram(l),
  53224. p.initAttributes(),
  53225. p.enableAttribute(c.position),
  53226. p.enableAttribute(c.uv),
  53227. p.disableUnusedAttributes(),
  53228. p.disable(d.CULL_FACE),
  53229. p.enable(d.BLEND),
  53230. d.bindBuffer(d.ARRAY_BUFFER, a),
  53231. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  53232. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  53233. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53234. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  53235. p.activeTexture(d.TEXTURE0),
  53236. d.uniform1i(h.map, 0);
  53237. var A = 0
  53238. , y = 0
  53239. , C = r.fog;
  53240. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  53241. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  53242. d.uniform1f(h.fogFar, C.far),
  53243. d.uniform1i(h.fogType, 1),
  53244. A = 1,
  53245. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  53246. d.uniform1i(h.fogType, 2),
  53247. A = 2,
  53248. y = 2)) : (d.uniform1i(h.fogType, 0),
  53249. A = 0,
  53250. y = 0);
  53251. for (var I = 0, E = t.length; I < E; I++) {
  53252. var b = t[I];
  53253. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  53254. b.z = -b.modelViewMatrix.elements[14]
  53255. }
  53256. t.sort(o);
  53257. for (var w = [], I = 0, E = t.length; I < E; I++) {
  53258. var b = t[I]
  53259. , _ = b.material;
  53260. d.uniform1f(h.alphaTest, _.alphaTest),
  53261. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  53262. b.matrixWorld.decompose(f, g, m),
  53263. w[0] = m.x,
  53264. w[1] = m.y;
  53265. var T = 0;
  53266. r.fog && _.fog && (T = y),
  53267. A !== T && (d.uniform1i(h.fogType, T),
  53268. A = T),
  53269. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  53270. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  53271. d.uniform2f(h.uvScale, 1, 1)),
  53272. d.uniform1f(h.opacity, _.opacity),
  53273. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  53274. d.uniform1f(h.rotation, _.rotation),
  53275. d.uniform2fv(h.scale, w),
  53276. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  53277. p.setDepthTest(_.depthTest),
  53278. p.setDepthWrite(_.depthWrite),
  53279. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  53280. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  53281. }
  53282. p.enable(d.CULL_FACE),
  53283. e.resetGLState()
  53284. }
  53285. }
  53286. }
  53287. ,
  53288. Object.defineProperties(n.Box2.prototype, {
  53289. empty: {
  53290. value: function() {
  53291. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  53292. this.isEmpty()
  53293. }
  53294. },
  53295. isIntersectionBox: {
  53296. value: function(e) {
  53297. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53298. this.intersectsBox(e)
  53299. }
  53300. }
  53301. }),
  53302. Object.defineProperties(n.Box3.prototype, {
  53303. empty: {
  53304. value: function() {
  53305. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  53306. this.isEmpty()
  53307. }
  53308. },
  53309. isIntersectionBox: {
  53310. value: function(e) {
  53311. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53312. this.intersectsBox(e)
  53313. }
  53314. },
  53315. isIntersectionSphere: {
  53316. value: function(e) {
  53317. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53318. this.intersectsSphere(e)
  53319. }
  53320. }
  53321. }),
  53322. Object.defineProperties(n.Matrix3.prototype, {
  53323. multiplyVector3: {
  53324. value: function(e) {
  53325. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  53326. e.applyMatrix3(this)
  53327. }
  53328. },
  53329. multiplyVector3Array: {
  53330. value: function(e) {
  53331. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53332. this.applyToVector3Array(e)
  53333. }
  53334. }
  53335. }),
  53336. Object.defineProperties(n.Matrix4.prototype, {
  53337. extractPosition: {
  53338. value: function(e) {
  53339. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  53340. this.copyPosition(e)
  53341. }
  53342. },
  53343. setRotationFromQuaternion: {
  53344. value: function(e) {
  53345. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  53346. this.makeRotationFromQuaternion(e)
  53347. }
  53348. },
  53349. multiplyVector3: {
  53350. value: function(e) {
  53351. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  53352. e.applyProjection(this)
  53353. }
  53354. },
  53355. multiplyVector4: {
  53356. value: function(e) {
  53357. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53358. e.applyMatrix4(this)
  53359. }
  53360. },
  53361. multiplyVector3Array: {
  53362. value: function(e) {
  53363. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53364. this.applyToVector3Array(e)
  53365. }
  53366. },
  53367. rotateAxis: {
  53368. value: function(e) {
  53369. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  53370. e.transformDirection(this)
  53371. }
  53372. },
  53373. crossVector: {
  53374. value: function(e) {
  53375. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53376. e.applyMatrix4(this)
  53377. }
  53378. },
  53379. translate: {
  53380. value: function(e) {
  53381. console.error("THREE.Matrix4: .translate() has been removed.")
  53382. }
  53383. },
  53384. rotateX: {
  53385. value: function(e) {
  53386. console.error("THREE.Matrix4: .rotateX() has been removed.")
  53387. }
  53388. },
  53389. rotateY: {
  53390. value: function(e) {
  53391. console.error("THREE.Matrix4: .rotateY() has been removed.")
  53392. }
  53393. },
  53394. rotateZ: {
  53395. value: function(e) {
  53396. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  53397. }
  53398. },
  53399. rotateByAxis: {
  53400. value: function(e, t) {
  53401. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  53402. }
  53403. }
  53404. }),
  53405. Object.defineProperties(n.Plane.prototype, {
  53406. isIntersectionLine: {
  53407. value: function(e) {
  53408. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  53409. this.intersectsLine(e)
  53410. }
  53411. }
  53412. }),
  53413. Object.defineProperties(n.Quaternion.prototype, {
  53414. multiplyVector3: {
  53415. value: function(e) {
  53416. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  53417. e.applyQuaternion(this)
  53418. }
  53419. }
  53420. }),
  53421. Object.defineProperties(n.Ray.prototype, {
  53422. isIntersectionBox: {
  53423. value: function(e) {
  53424. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53425. this.intersectsBox(e)
  53426. }
  53427. },
  53428. isIntersectionPlane: {
  53429. value: function(e) {
  53430. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  53431. this.intersectsPlane(e)
  53432. }
  53433. },
  53434. isIntersectionSphere: {
  53435. value: function(e) {
  53436. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53437. this.intersectsSphere(e)
  53438. }
  53439. }
  53440. }),
  53441. Object.defineProperties(n.Vector3.prototype, {
  53442. setEulerFromRotationMatrix: {
  53443. value: function() {
  53444. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  53445. }
  53446. },
  53447. setEulerFromQuaternion: {
  53448. value: function() {
  53449. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  53450. }
  53451. },
  53452. getPositionFromMatrix: {
  53453. value: function(e) {
  53454. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  53455. this.setFromMatrixPosition(e)
  53456. }
  53457. },
  53458. getScaleFromMatrix: {
  53459. value: function(e) {
  53460. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  53461. this.setFromMatrixScale(e)
  53462. }
  53463. },
  53464. getColumnFromMatrix: {
  53465. value: function(e, t) {
  53466. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  53467. this.setFromMatrixColumn(e, t)
  53468. }
  53469. }
  53470. }),
  53471. n.Face4 = function(e, t, i, r, o, a, s) {
  53472. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  53473. new n.Face3(e,t,i,o,a,s)
  53474. }
  53475. ,
  53476. n.Vertex = function(e, t, i) {
  53477. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  53478. new n.Vector3(e,t,i)
  53479. }
  53480. ,
  53481. Object.defineProperties(n.Object3D.prototype, {
  53482. eulerOrder: {
  53483. get: function() {
  53484. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53485. this.rotation.order
  53486. },
  53487. set: function(e) {
  53488. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  53489. this.rotation.order = e
  53490. }
  53491. },
  53492. getChildByName: {
  53493. value: function(e) {
  53494. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  53495. this.getObjectByName(e)
  53496. }
  53497. },
  53498. renderDepth: {
  53499. set: function(e) {
  53500. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  53501. }
  53502. },
  53503. translate: {
  53504. value: function(e, t) {
  53505. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  53506. this.translateOnAxis(t, e)
  53507. }
  53508. },
  53509. useQuaternion: {
  53510. get: function() {
  53511. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53512. },
  53513. set: function(e) {
  53514. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  53515. }
  53516. }
  53517. }),
  53518. Object.defineProperties(n, {
  53519. PointCloud: {
  53520. value: function(e, t) {
  53521. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  53522. new n.Points(e,t)
  53523. }
  53524. },
  53525. ParticleSystem: {
  53526. value: function(e, t) {
  53527. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  53528. new n.Points(e,t)
  53529. }
  53530. }
  53531. }),
  53532. Object.defineProperties(n.Light.prototype, {
  53533. onlyShadow: {
  53534. set: function(e) {
  53535. console.warn("THREE.Light: .onlyShadow has been removed.")
  53536. }
  53537. },
  53538. shadowCameraFov: {
  53539. set: function(e) {
  53540. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  53541. this.shadow.camera.fov = e
  53542. }
  53543. },
  53544. shadowCameraLeft: {
  53545. set: function(e) {
  53546. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  53547. this.shadow.camera.left = e
  53548. }
  53549. },
  53550. shadowCameraRight: {
  53551. set: function(e) {
  53552. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  53553. this.shadow.camera.right = e
  53554. }
  53555. },
  53556. shadowCameraTop: {
  53557. set: function(e) {
  53558. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  53559. this.shadow.camera.top = e
  53560. }
  53561. },
  53562. shadowCameraBottom: {
  53563. set: function(e) {
  53564. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  53565. this.shadow.camera.bottom = e
  53566. }
  53567. },
  53568. shadowCameraNear: {
  53569. set: function(e) {
  53570. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  53571. this.shadow.camera.near = e
  53572. }
  53573. },
  53574. shadowCameraFar: {
  53575. set: function(e) {
  53576. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  53577. this.shadow.camera.far = e
  53578. }
  53579. },
  53580. shadowCameraVisible: {
  53581. set: function(e) {
  53582. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  53583. }
  53584. },
  53585. shadowBias: {
  53586. set: function(e) {
  53587. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  53588. this.shadow.bias = e
  53589. }
  53590. },
  53591. shadowDarkness: {
  53592. set: function(e) {
  53593. console.warn("THREE.Light: .shadowDarkness has been removed.")
  53594. }
  53595. },
  53596. shadowMapWidth: {
  53597. set: function(e) {
  53598. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  53599. this.shadow.mapSize.width = e
  53600. }
  53601. },
  53602. shadowMapHeight: {
  53603. set: function(e) {
  53604. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  53605. this.shadow.mapSize.height = e
  53606. }
  53607. }
  53608. }),
  53609. Object.defineProperties(n.BufferAttribute.prototype, {
  53610. length: {
  53611. get: function() {
  53612. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  53613. this.array.length
  53614. }
  53615. }
  53616. }),
  53617. Object.defineProperties(n.BufferGeometry.prototype, {
  53618. drawcalls: {
  53619. get: function() {
  53620. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  53621. this.groups
  53622. }
  53623. },
  53624. offsets: {
  53625. get: function() {
  53626. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  53627. this.groups
  53628. }
  53629. },
  53630. addIndex: {
  53631. value: function(e) {
  53632. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  53633. this.setIndex(e)
  53634. }
  53635. },
  53636. addDrawCall: {
  53637. value: function(e, t, i) {
  53638. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  53639. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  53640. this.addGroup(e, t)
  53641. }
  53642. },
  53643. clearDrawCalls: {
  53644. value: function() {
  53645. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  53646. this.clearGroups()
  53647. }
  53648. },
  53649. computeTangents: {
  53650. value: function() {
  53651. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  53652. }
  53653. },
  53654. computeOffsets: {
  53655. value: function() {
  53656. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  53657. }
  53658. }
  53659. }),
  53660. Object.defineProperties(n.Material.prototype, {
  53661. wrapAround: {
  53662. get: function() {
  53663. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53664. },
  53665. set: function(e) {
  53666. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  53667. }
  53668. },
  53669. wrapRGB: {
  53670. get: function() {
  53671. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  53672. new n.Color
  53673. }
  53674. }
  53675. }),
  53676. Object.defineProperties(n, {
  53677. PointCloudMaterial: {
  53678. value: function(e) {
  53679. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  53680. new n.PointsMaterial(e)
  53681. }
  53682. },
  53683. ParticleBasicMaterial: {
  53684. value: function(e) {
  53685. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  53686. new n.PointsMaterial(e)
  53687. }
  53688. },
  53689. ParticleSystemMaterial: {
  53690. value: function(e) {
  53691. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  53692. new n.PointsMaterial(e)
  53693. }
  53694. }
  53695. }),
  53696. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  53697. metal: {
  53698. get: function() {
  53699. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  53700. !1
  53701. },
  53702. set: function(e) {
  53703. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  53704. }
  53705. }
  53706. }),
  53707. Object.defineProperties(n.ShaderMaterial.prototype, {
  53708. derivatives: {
  53709. get: function() {
  53710. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53711. this.extensions.derivatives
  53712. },
  53713. set: function(e) {
  53714. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  53715. this.extensions.derivatives = e
  53716. }
  53717. }
  53718. }),
  53719. Object.defineProperties(n.WebGLRenderer.prototype, {
  53720. supportsFloatTextures: {
  53721. value: function() {
  53722. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  53723. this.extensions.get("OES_texture_float")
  53724. }
  53725. },
  53726. supportsHalfFloatTextures: {
  53727. value: function() {
  53728. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  53729. this.extensions.get("OES_texture_half_float")
  53730. }
  53731. },
  53732. supportsStandardDerivatives: {
  53733. value: function() {
  53734. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  53735. this.extensions.get("OES_standard_derivatives")
  53736. }
  53737. },
  53738. supportsCompressedTextureS3TC: {
  53739. value: function() {
  53740. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  53741. this.extensions.get("WEBGL_compressed_texture_s3tc")
  53742. }
  53743. },
  53744. supportsCompressedTexturePVRTC: {
  53745. value: function() {
  53746. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  53747. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  53748. }
  53749. },
  53750. supportsBlendMinMax: {
  53751. value: function() {
  53752. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  53753. this.extensions.get("EXT_blend_minmax")
  53754. }
  53755. },
  53756. supportsVertexTextures: {
  53757. value: function() {
  53758. return this.capabilities.vertexTextures
  53759. }
  53760. },
  53761. supportsInstancedArrays: {
  53762. value: function() {
  53763. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  53764. this.extensions.get("ANGLE_instanced_arrays")
  53765. }
  53766. },
  53767. enableScissorTest: {
  53768. value: function(e) {
  53769. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  53770. this.setScissorTest(e)
  53771. }
  53772. },
  53773. initMaterial: {
  53774. value: function() {
  53775. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  53776. }
  53777. },
  53778. addPrePlugin: {
  53779. value: function() {
  53780. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  53781. }
  53782. },
  53783. addPostPlugin: {
  53784. value: function() {
  53785. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  53786. }
  53787. },
  53788. updateShadowMap: {
  53789. value: function() {
  53790. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  53791. }
  53792. },
  53793. shadowMapEnabled: {
  53794. get: function() {
  53795. return this.shadowMap.enabled
  53796. },
  53797. set: function(e) {
  53798. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  53799. this.shadowMap.enabled = e
  53800. }
  53801. },
  53802. shadowMapType: {
  53803. get: function() {
  53804. return this.shadowMap.type
  53805. },
  53806. set: function(e) {
  53807. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  53808. this.shadowMap.type = e
  53809. }
  53810. },
  53811. shadowMapCullFace: {
  53812. get: function() {
  53813. return this.shadowMap.cullFace
  53814. },
  53815. set: function(e) {
  53816. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  53817. this.shadowMap.cullFace = e
  53818. }
  53819. }
  53820. }),
  53821. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  53822. wrapS: {
  53823. get: function() {
  53824. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53825. this.texture.wrapS
  53826. },
  53827. set: function(e) {
  53828. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  53829. this.texture.wrapS = e
  53830. }
  53831. },
  53832. wrapT: {
  53833. get: function() {
  53834. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53835. this.texture.wrapT
  53836. },
  53837. set: function(e) {
  53838. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  53839. this.texture.wrapT = e
  53840. }
  53841. },
  53842. magFilter: {
  53843. get: function() {
  53844. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53845. this.texture.magFilter
  53846. },
  53847. set: function(e) {
  53848. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  53849. this.texture.magFilter = e
  53850. }
  53851. },
  53852. minFilter: {
  53853. get: function() {
  53854. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53855. this.texture.minFilter
  53856. },
  53857. set: function(e) {
  53858. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  53859. this.texture.minFilter = e
  53860. }
  53861. },
  53862. anisotropy: {
  53863. get: function() {
  53864. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53865. this.texture.anisotropy
  53866. },
  53867. set: function(e) {
  53868. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  53869. this.texture.anisotropy = e
  53870. }
  53871. },
  53872. offset: {
  53873. get: function() {
  53874. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53875. this.texture.offset
  53876. },
  53877. set: function(e) {
  53878. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  53879. this.texture.offset = e
  53880. }
  53881. },
  53882. repeat: {
  53883. get: function() {
  53884. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53885. this.texture.repeat
  53886. },
  53887. set: function(e) {
  53888. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  53889. this.texture.repeat = e
  53890. }
  53891. },
  53892. format: {
  53893. get: function() {
  53894. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53895. this.texture.format
  53896. },
  53897. set: function(e) {
  53898. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  53899. this.texture.format = e
  53900. }
  53901. },
  53902. type: {
  53903. get: function() {
  53904. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53905. this.texture.type
  53906. },
  53907. set: function(e) {
  53908. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  53909. this.texture.type = e
  53910. }
  53911. },
  53912. generateMipmaps: {
  53913. get: function() {
  53914. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53915. this.texture.generateMipmaps
  53916. },
  53917. set: function(e) {
  53918. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  53919. this.texture.generateMipmaps = e
  53920. }
  53921. }
  53922. }),
  53923. n.GeometryUtils = {
  53924. merge: function(e, t, i) {
  53925. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  53926. var r;
  53927. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  53928. r = t.matrix,
  53929. t = t.geometry),
  53930. e.merge(t, r, i)
  53931. },
  53932. center: function(e) {
  53933. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  53934. e.center()
  53935. }
  53936. },
  53937. n.ImageUtils = {
  53938. crossOrigin: void 0,
  53939. loadTexture: function(e, t, i, r) {
  53940. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  53941. var o = new n.TextureLoader;
  53942. o.setCrossOrigin(this.crossOrigin);
  53943. var a = o.load(e, i, void 0, r);
  53944. return t && (a.mapping = t),
  53945. a
  53946. },
  53947. loadTextureCube: function(e, t, i, r) {
  53948. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  53949. var o = new n.CubeTextureLoader;
  53950. o.setCrossOrigin(this.crossOrigin);
  53951. var a = o.load(e, i, void 0, r);
  53952. return t && (a.mapping = t),
  53953. a
  53954. },
  53955. loadCompressedTexture: function() {
  53956. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  53957. },
  53958. loadCompressedTextureCube: function() {
  53959. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  53960. }
  53961. },
  53962. n.Projector = function() {
  53963. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  53964. this.projectVector = function(e, t) {
  53965. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  53966. e.project(t)
  53967. }
  53968. ,
  53969. this.unprojectVector = function(e, t) {
  53970. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  53971. e.unproject(t)
  53972. }
  53973. ,
  53974. this.pickingRay = function(e, t) {
  53975. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  53976. }
  53977. }
  53978. ,
  53979. n.CanvasRenderer = function() {
  53980. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  53981. this.domElement = document.createElement("canvas"),
  53982. this.clear = function() {}
  53983. ,
  53984. this.render = function() {}
  53985. ,
  53986. this.setClearColor = function() {}
  53987. ,
  53988. this.setSize = function() {}
  53989. }
  53990. ,
  53991. n.MeshFaceMaterial = n.MultiMaterial,
  53992. n.CurveUtils = {
  53993. tangentQuadraticBezier: function(e, t, i, n) {
  53994. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  53995. },
  53996. tangentCubicBezier: function(e, t, i, n, r) {
  53997. return -3 * t * (1 - e) * (1 - e) + 3 * i * (1 - e) * (1 - e) - 6 * e * i * (1 - e) + 6 * e * n * (1 - e) - 3 * e * e * n + 3 * e * e * r
  53998. },
  53999. tangentSpline: function(e, t, i, n, r) {
  54000. var o = 6 * e * e - 6 * e
  54001. , a = 3 * e * e - 4 * e + 1
  54002. , s = -6 * e * e + 6 * e
  54003. , l = 3 * e * e - 2 * e;
  54004. return o + a + s + l
  54005. },
  54006. interpolate: function(e, t, i, n, r) {
  54007. var o = .5 * (i - e)
  54008. , a = .5 * (n - t)
  54009. , s = r * r
  54010. , l = r * s;
  54011. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54012. }
  54013. },
  54014. n.SceneUtils = {
  54015. createMultiMaterialObject: function(e, t) {
  54016. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54017. i.add(new n.Mesh(e,t[r]));
  54018. return i
  54019. },
  54020. detach: function(e, t, i) {
  54021. e.applyMatrix(t.matrixWorld),
  54022. t.remove(e),
  54023. i.add(e)
  54024. },
  54025. attach: function(e, t, i) {
  54026. var r = new n.Matrix4;
  54027. r.getInverse(i.matrixWorld),
  54028. e.applyMatrix(r),
  54029. t.remove(e),
  54030. i.add(e)
  54031. }
  54032. },
  54033. n.ShapeUtils = {
  54034. area: function(e) {
  54035. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54036. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54037. return .5 * i
  54038. },
  54039. triangulate: function() {
  54040. function e(e, t, i, n, r, o) {
  54041. var a, s, l, c, h, u, d, p, f;
  54042. if (s = e[o[t]].x,
  54043. l = e[o[t]].y,
  54044. c = e[o[i]].x,
  54045. h = e[o[i]].y,
  54046. u = e[o[n]].x,
  54047. d = e[o[n]].y,
  54048. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54049. return !1;
  54050. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54051. for (g = u - c,
  54052. m = d - h,
  54053. v = s - u,
  54054. A = l - d,
  54055. y = c - s,
  54056. C = h - l,
  54057. a = 0; a < r; a++)
  54058. if (p = e[o[a]].x,
  54059. f = e[o[a]].y,
  54060. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54061. E = f - l,
  54062. b = p - c,
  54063. w = f - h,
  54064. _ = p - u,
  54065. T = f - d,
  54066. M = g * w - m * b,
  54067. x = y * E - C * I,
  54068. S = v * T - A * _,
  54069. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54070. return !1;
  54071. return !0
  54072. }
  54073. return function(t, i) {
  54074. var r = t.length;
  54075. if (r < 3)
  54076. return null;
  54077. var o, a, s, l = [], c = [], h = [];
  54078. if (n.ShapeUtils.area(t) > 0)
  54079. for (a = 0; a < r; a++)
  54080. c[a] = a;
  54081. else
  54082. for (a = 0; a < r; a++)
  54083. c[a] = r - 1 - a;
  54084. var u = r
  54085. , d = 2 * u;
  54086. for (a = u - 1; u > 2; ) {
  54087. if (d-- <= 0)
  54088. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54089. i ? h : l;
  54090. if (o = a,
  54091. u <= o && (o = 0),
  54092. a = o + 1,
  54093. u <= a && (a = 0),
  54094. s = a + 1,
  54095. u <= s && (s = 0),
  54096. e(t, o, a, s, u, c)) {
  54097. var p, f, g, m, v;
  54098. for (p = c[o],
  54099. f = c[a],
  54100. g = c[s],
  54101. l.push([t[p], t[f], t[g]]),
  54102. h.push([c[o], c[a], c[s]]),
  54103. m = a,
  54104. v = a + 1; v < u; m++,
  54105. v++)
  54106. c[m] = c[v];
  54107. u--,
  54108. d = 2 * u
  54109. }
  54110. }
  54111. return i ? h : l
  54112. }
  54113. }(),
  54114. triangulateShape: function(e, t) {
  54115. function i(e, t, i) {
  54116. return e.x !== t.x ? e.x < t.x ? e.x <= i.x && i.x <= t.x : t.x <= i.x && i.x <= e.x : e.y < t.y ? e.y <= i.y && i.y <= t.y : t.y <= i.y && i.y <= e.y
  54117. }
  54118. function r(e, t, n, r, o) {
  54119. var a = t.x - e.x
  54120. , s = t.y - e.y
  54121. , l = r.x - n.x
  54122. , c = r.y - n.y
  54123. , h = e.x - n.x
  54124. , u = e.y - n.y
  54125. , d = s * l - a * c
  54126. , p = s * h - a * u;
  54127. if (Math.abs(d) > Number.EPSILON) {
  54128. var f;
  54129. if (d > 0) {
  54130. if (p < 0 || p > d)
  54131. return [];
  54132. if (f = c * h - l * u,
  54133. f < 0 || f > d)
  54134. return []
  54135. } else {
  54136. if (p > 0 || p < d)
  54137. return [];
  54138. if (f = c * h - l * u,
  54139. f > 0 || f < d)
  54140. return []
  54141. }
  54142. if (0 === f)
  54143. return !o || 0 !== p && p !== d ? [e] : [];
  54144. if (f === d)
  54145. return !o || 0 !== p && p !== d ? [t] : [];
  54146. if (0 === p)
  54147. return [n];
  54148. if (p === d)
  54149. return [r];
  54150. var g = f / d;
  54151. return [{
  54152. x: e.x + g * a,
  54153. y: e.y + g * s
  54154. }]
  54155. }
  54156. if (0 !== p || c * h !== l * u)
  54157. return [];
  54158. var m = 0 === a && 0 === s
  54159. , v = 0 === l && 0 === c;
  54160. if (m && v)
  54161. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54162. if (m)
  54163. return i(n, r, e) ? [e] : [];
  54164. if (v)
  54165. return i(e, t, n) ? [n] : [];
  54166. var A, y, C, I, E, b, w, _;
  54167. return 0 !== a ? (e.x < t.x ? (A = e,
  54168. C = e.x,
  54169. y = t,
  54170. I = t.x) : (A = t,
  54171. C = t.x,
  54172. y = e,
  54173. I = e.x),
  54174. n.x < r.x ? (E = n,
  54175. w = n.x,
  54176. b = r,
  54177. _ = r.x) : (E = r,
  54178. w = r.x,
  54179. b = n,
  54180. _ = n.x)) : (e.y < t.y ? (A = e,
  54181. C = e.y,
  54182. y = t,
  54183. I = t.y) : (A = t,
  54184. C = t.y,
  54185. y = e,
  54186. I = e.y),
  54187. n.y < r.y ? (E = n,
  54188. w = n.y,
  54189. b = r,
  54190. _ = r.y) : (E = r,
  54191. w = r.y,
  54192. b = n,
  54193. _ = n.y)),
  54194. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  54195. }
  54196. function o(e, t, i, n) {
  54197. var r = t.x - e.x
  54198. , o = t.y - e.y
  54199. , a = i.x - e.x
  54200. , s = i.y - e.y
  54201. , l = n.x - e.x
  54202. , c = n.y - e.y
  54203. , h = r * s - o * a
  54204. , u = r * c - o * l;
  54205. if (Math.abs(h) > Number.EPSILON) {
  54206. var d = l * s - c * a;
  54207. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  54208. }
  54209. return u > 0
  54210. }
  54211. function a(e, t) {
  54212. function i(e, t) {
  54213. var i = A.length - 1
  54214. , n = e - 1;
  54215. n < 0 && (n = i);
  54216. var r = e + 1;
  54217. r > i && (r = 0);
  54218. var a = o(A[e], A[n], A[r], s[t]);
  54219. if (!a)
  54220. return !1;
  54221. var l = s.length - 1
  54222. , c = t - 1;
  54223. c < 0 && (c = l);
  54224. var h = t + 1;
  54225. return h > l && (h = 0),
  54226. a = o(s[t], s[c], s[h], A[e]),
  54227. !!a
  54228. }
  54229. function n(e, t) {
  54230. var i, n, o;
  54231. for (i = 0; i < A.length; i++)
  54232. if (n = i + 1,
  54233. n %= A.length,
  54234. o = r(e, t, A[i], A[n], !0),
  54235. o.length > 0)
  54236. return !0;
  54237. return !1
  54238. }
  54239. function a(e, i) {
  54240. var n, o, a, s, l;
  54241. for (n = 0; n < y.length; n++)
  54242. for (o = t[y[n]],
  54243. a = 0; a < o.length; a++)
  54244. if (s = a + 1,
  54245. s %= o.length,
  54246. l = r(e, i, o[a], o[s], !0),
  54247. l.length > 0)
  54248. return !0;
  54249. return !1
  54250. }
  54251. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  54252. y.push(I);
  54253. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  54254. if (w--,
  54255. w < 0) {
  54256. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  54257. break
  54258. }
  54259. for (c = b; c < A.length; c++) {
  54260. h = A[c],
  54261. l = -1;
  54262. for (var I = 0; I < y.length; I++)
  54263. if (d = y[I],
  54264. p = h.x + ":" + h.y + ":" + d,
  54265. void 0 === C[p]) {
  54266. s = t[d];
  54267. for (var _ = 0; _ < s.length; _++)
  54268. if (u = s[_],
  54269. i(c, _) && !n(h, u) && !a(h, u)) {
  54270. l = _,
  54271. y.splice(I, 1),
  54272. f = A.slice(0, c + 1),
  54273. g = A.slice(c),
  54274. m = s.slice(l),
  54275. v = s.slice(0, l + 1),
  54276. A = f.concat(m).concat(v).concat(g),
  54277. b = c;
  54278. break
  54279. }
  54280. if (l >= 0)
  54281. break;
  54282. C[p] = !0
  54283. }
  54284. if (l >= 0)
  54285. break
  54286. }
  54287. }
  54288. return A
  54289. }
  54290. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  54291. Array.prototype.push.apply(f, t[g]);
  54292. for (s = 0,
  54293. l = f.length; s < l; s++)
  54294. u = f[s].x + ":" + f[s].y,
  54295. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  54296. p[u] = s;
  54297. var v = a(e, t)
  54298. , A = n.ShapeUtils.triangulate(v, !1);
  54299. for (s = 0,
  54300. l = A.length; s < l; s++)
  54301. for (h = A[s],
  54302. c = 0; c < 3; c++)
  54303. u = h[c].x + ":" + h[c].y,
  54304. d = p[u],
  54305. void 0 !== d && (h[c] = d);
  54306. return A.concat()
  54307. },
  54308. isClockWise: function(e) {
  54309. return n.ShapeUtils.area(e) < 0
  54310. },
  54311. b2: function() {
  54312. function e(e, t) {
  54313. var i = 1 - e;
  54314. return i * i * t
  54315. }
  54316. function t(e, t) {
  54317. return 2 * (1 - e) * e * t
  54318. }
  54319. function i(e, t) {
  54320. return e * e * t
  54321. }
  54322. return function(n, r, o, a) {
  54323. return e(n, r) + t(n, o) + i(n, a)
  54324. }
  54325. }(),
  54326. b3: function() {
  54327. function e(e, t) {
  54328. var i = 1 - e;
  54329. return i * i * i * t
  54330. }
  54331. function t(e, t) {
  54332. var i = 1 - e;
  54333. return 3 * i * i * e * t
  54334. }
  54335. function i(e, t) {
  54336. var i = 1 - e;
  54337. return 3 * i * e * e * t
  54338. }
  54339. function n(e, t) {
  54340. return e * e * e * t
  54341. }
  54342. return function(r, o, a, s, l) {
  54343. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  54344. }
  54345. }()
  54346. },
  54347. n.Curve = function() {}
  54348. ,
  54349. n.Curve.prototype = {
  54350. constructor: n.Curve,
  54351. getPoint: function(e) {
  54352. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  54353. null
  54354. },
  54355. getPointAt: function(e) {
  54356. var t = this.getUtoTmapping(e);
  54357. return this.getPoint(t)
  54358. },
  54359. getPoints: function(e) {
  54360. e || (e = 5);
  54361. var t, i = [];
  54362. for (t = 0; t <= e; t++)
  54363. i.push(this.getPoint(t / e));
  54364. return i
  54365. },
  54366. getSpacedPoints: function(e) {
  54367. e || (e = 5);
  54368. var t, i = [];
  54369. for (t = 0; t <= e; t++)
  54370. i.push(this.getPointAt(t / e));
  54371. return i
  54372. },
  54373. getLength: function() {
  54374. var e = this.getLengths();
  54375. return e[e.length - 1]
  54376. },
  54377. getLengths: function(e) {
  54378. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  54379. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  54380. return this.cacheArcLengths;
  54381. this.needsUpdate = !1;
  54382. var t, i, n = [], r = this.getPoint(0), o = 0;
  54383. for (n.push(0),
  54384. i = 1; i <= e; i++)
  54385. t = this.getPoint(i / e),
  54386. o += t.distanceTo(r),
  54387. n.push(o),
  54388. r = t;
  54389. return this.cacheArcLengths = n,
  54390. n
  54391. },
  54392. updateArcLengths: function() {
  54393. this.needsUpdate = !0,
  54394. this.getLengths()
  54395. },
  54396. getUtoTmapping: function(e, t) {
  54397. var i, n = this.getLengths(), r = 0, o = n.length;
  54398. i = t ? t : e * n[o - 1];
  54399. for (var a, s = 0, l = o - 1; s <= l; )
  54400. if (r = Math.floor(s + (l - s) / 2),
  54401. a = n[r] - i,
  54402. a < 0)
  54403. s = r + 1;
  54404. else {
  54405. if (!(a > 0)) {
  54406. l = r;
  54407. break
  54408. }
  54409. l = r - 1
  54410. }
  54411. if (r = l,
  54412. n[r] === i) {
  54413. var c = r / (o - 1);
  54414. return c
  54415. }
  54416. var h = n[r]
  54417. , u = n[r + 1]
  54418. , d = u - h
  54419. , p = (i - h) / d
  54420. , c = (r + p) / (o - 1);
  54421. return c
  54422. },
  54423. getTangent: function(e) {
  54424. var t = 1e-4
  54425. , i = e - t
  54426. , n = e + t;
  54427. i < 0 && (i = 0),
  54428. n > 1 && (n = 1);
  54429. var r = this.getPoint(i)
  54430. , o = this.getPoint(n)
  54431. , a = o.clone().sub(r);
  54432. return a.normalize()
  54433. },
  54434. getTangentAt: function(e) {
  54435. var t = this.getUtoTmapping(e);
  54436. return this.getTangent(t)
  54437. }
  54438. },
  54439. n.Curve.create = function(e, t) {
  54440. return e.prototype = Object.create(n.Curve.prototype),
  54441. e.prototype.constructor = e,
  54442. e.prototype.getPoint = t,
  54443. e
  54444. }
  54445. ,
  54446. n.CurvePath = function() {
  54447. this.curves = [],
  54448. this.autoClose = !1
  54449. }
  54450. ,
  54451. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  54452. n.CurvePath.prototype.constructor = n.CurvePath,
  54453. n.CurvePath.prototype.add = function(e) {
  54454. this.curves.push(e)
  54455. }
  54456. ,
  54457. n.CurvePath.prototype.closePath = function() {
  54458. var e = this.curves[0].getPoint(0)
  54459. , t = this.curves[this.curves.length - 1].getPoint(1);
  54460. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  54461. }
  54462. ,
  54463. n.CurvePath.prototype.getPoint = function(e) {
  54464. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  54465. if (i[n] >= t) {
  54466. var r = i[n] - t
  54467. , o = this.curves[n]
  54468. , a = 1 - r / o.getLength();
  54469. return o.getPointAt(a)
  54470. }
  54471. n++
  54472. }
  54473. return null
  54474. }
  54475. ,
  54476. n.CurvePath.prototype.getLength = function() {
  54477. var e = this.getCurveLengths();
  54478. return e[e.length - 1]
  54479. }
  54480. ,
  54481. n.CurvePath.prototype.getCurveLengths = function() {
  54482. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  54483. return this.cacheLengths;
  54484. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  54485. t += this.curves[i].getLength(),
  54486. e.push(t);
  54487. return this.cacheLengths = e,
  54488. e
  54489. }
  54490. ,
  54491. n.CurvePath.prototype.createPointsGeometry = function(e) {
  54492. var t = this.getPoints(e);
  54493. return this.createGeometry(t)
  54494. }
  54495. ,
  54496. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  54497. var t = this.getSpacedPoints(e);
  54498. return this.createGeometry(t)
  54499. }
  54500. ,
  54501. n.CurvePath.prototype.createGeometry = function(e) {
  54502. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  54503. var o = e[i];
  54504. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  54505. }
  54506. return t
  54507. }
  54508. ,
  54509. n.Font = function(e) {
  54510. this.data = e
  54511. }
  54512. ,
  54513. n.Font.prototype = {
  54514. constructor: n.Font,
  54515. generateShapes: function(e, t, i) {
  54516. function r(e) {
  54517. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  54518. var c = o(i[l], n, r);
  54519. r += c.offset,
  54520. s.push(c.path)
  54521. }
  54522. return s
  54523. }
  54524. function o(e, t, r) {
  54525. var o = a.glyphs[e] || a.glyphs["?"];
  54526. if (o) {
  54527. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  54528. if (o.o)
  54529. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  54530. var _ = E[b++];
  54531. switch (_) {
  54532. case "m":
  54533. s = E[b++] * t + r,
  54534. l = E[b++] * t,
  54535. A.moveTo(s, l);
  54536. break;
  54537. case "l":
  54538. s = E[b++] * t + r,
  54539. l = E[b++] * t,
  54540. A.lineTo(s, l);
  54541. break;
  54542. case "q":
  54543. if (c = E[b++] * t + r,
  54544. h = E[b++] * t,
  54545. p = E[b++] * t + r,
  54546. f = E[b++] * t,
  54547. A.quadraticCurveTo(p, f, c, h),
  54548. v = y[y.length - 1]) {
  54549. u = v.x,
  54550. d = v.y;
  54551. for (var T = 1; T <= i; T++) {
  54552. var x = T / i;
  54553. C(x, u, p, c),
  54554. C(x, d, f, h)
  54555. }
  54556. }
  54557. break;
  54558. case "b":
  54559. if (c = E[b++] * t + r,
  54560. h = E[b++] * t,
  54561. p = E[b++] * t + r,
  54562. f = E[b++] * t,
  54563. g = E[b++] * t + r,
  54564. m = E[b++] * t,
  54565. A.bezierCurveTo(p, f, g, m, c, h),
  54566. v = y[y.length - 1]) {
  54567. u = v.x,
  54568. d = v.y;
  54569. for (var T = 1; T <= i; T++) {
  54570. var x = T / i;
  54571. I(x, u, p, g, c),
  54572. I(x, d, f, m, h)
  54573. }
  54574. }
  54575. }
  54576. }
  54577. return {
  54578. offset: o.ha * t,
  54579. path: A
  54580. }
  54581. }
  54582. }
  54583. void 0 === t && (t = 100),
  54584. void 0 === i && (i = 4);
  54585. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  54586. Array.prototype.push.apply(l, s[c].toShapes());
  54587. return l
  54588. }
  54589. },
  54590. n.Path = function(e) {
  54591. n.CurvePath.call(this),
  54592. this.actions = [],
  54593. e && this.fromPoints(e)
  54594. }
  54595. ,
  54596. n.Path.prototype = Object.create(n.CurvePath.prototype),
  54597. n.Path.prototype.constructor = n.Path,
  54598. n.Path.prototype.fromPoints = function(e) {
  54599. this.moveTo(e[0].x, e[0].y);
  54600. for (var t = 1, i = e.length; t < i; t++)
  54601. this.lineTo(e[t].x, e[t].y)
  54602. }
  54603. ,
  54604. n.Path.prototype.moveTo = function(e, t) {
  54605. this.actions.push({
  54606. action: "moveTo",
  54607. args: [e, t]
  54608. })
  54609. }
  54610. ,
  54611. n.Path.prototype.lineTo = function(e, t) {
  54612. var i = this.actions[this.actions.length - 1].args
  54613. , r = i[i.length - 2]
  54614. , o = i[i.length - 1]
  54615. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  54616. this.curves.push(a),
  54617. this.actions.push({
  54618. action: "lineTo",
  54619. args: [e, t]
  54620. })
  54621. }
  54622. ,
  54623. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  54624. var o = this.actions[this.actions.length - 1].args
  54625. , a = o[o.length - 2]
  54626. , s = o[o.length - 1]
  54627. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  54628. this.curves.push(l),
  54629. this.actions.push({
  54630. action: "quadraticCurveTo",
  54631. args: [e, t, i, r]
  54632. })
  54633. }
  54634. ,
  54635. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  54636. var s = this.actions[this.actions.length - 1].args
  54637. , l = s[s.length - 2]
  54638. , c = s[s.length - 1]
  54639. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  54640. this.curves.push(h),
  54641. this.actions.push({
  54642. action: "bezierCurveTo",
  54643. args: [e, t, i, r, o, a]
  54644. })
  54645. }
  54646. ,
  54647. n.Path.prototype.splineThru = function(e) {
  54648. var t = Array.prototype.slice.call(arguments)
  54649. , i = this.actions[this.actions.length - 1].args
  54650. , r = i[i.length - 2]
  54651. , o = i[i.length - 1]
  54652. , a = [new n.Vector2(r,o)];
  54653. Array.prototype.push.apply(a, e);
  54654. var s = new n.SplineCurve(a);
  54655. this.curves.push(s),
  54656. this.actions.push({
  54657. action: "splineThru",
  54658. args: t
  54659. })
  54660. }
  54661. ,
  54662. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  54663. var a = this.actions[this.actions.length - 1].args
  54664. , s = a[a.length - 2]
  54665. , l = a[a.length - 1];
  54666. this.absarc(e + s, t + l, i, n, r, o)
  54667. }
  54668. ,
  54669. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  54670. this.absellipse(e, t, i, i, n, r, o)
  54671. }
  54672. ,
  54673. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  54674. var l = this.actions[this.actions.length - 1].args
  54675. , c = l[l.length - 2]
  54676. , h = l[l.length - 1];
  54677. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  54678. }
  54679. ,
  54680. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  54681. var c = [e, t, i, r, o, a, s, l || 0]
  54682. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  54683. this.curves.push(h);
  54684. var u = h.getPoint(1);
  54685. c.push(u.x),
  54686. c.push(u.y),
  54687. this.actions.push({
  54688. action: "ellipse",
  54689. args: c
  54690. })
  54691. }
  54692. ,
  54693. n.Path.prototype.getSpacedPoints = function(e) {
  54694. e || (e = 40);
  54695. for (var t = [], i = 0; i < e; i++)
  54696. t.push(this.getPoint(i / e));
  54697. return this.autoClose && t.push(t[0]),
  54698. t
  54699. }
  54700. ,
  54701. n.Path.prototype.getPoints = function(e) {
  54702. e = e || 12;
  54703. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  54704. var A = this.actions[m]
  54705. , y = A.action
  54706. , C = A.args;
  54707. switch (y) {
  54708. case "moveTo":
  54709. g.push(new n.Vector2(C[0],C[1]));
  54710. break;
  54711. case "lineTo":
  54712. g.push(new n.Vector2(C[0],C[1]));
  54713. break;
  54714. case "quadraticCurveTo":
  54715. t = C[2],
  54716. i = C[3],
  54717. a = C[0],
  54718. s = C[1],
  54719. g.length > 0 ? (h = g[g.length - 1],
  54720. l = h.x,
  54721. c = h.y) : (h = this.actions[m - 1].args,
  54722. l = h[h.length - 2],
  54723. c = h[h.length - 1]);
  54724. for (var I = 1; I <= e; I++) {
  54725. var E = I / e;
  54726. u = p(E, l, a, t),
  54727. d = p(E, c, s, i),
  54728. g.push(new n.Vector2(u,d))
  54729. }
  54730. break;
  54731. case "bezierCurveTo":
  54732. t = C[4],
  54733. i = C[5],
  54734. a = C[0],
  54735. s = C[1],
  54736. r = C[2],
  54737. o = C[3],
  54738. g.length > 0 ? (h = g[g.length - 1],
  54739. l = h.x,
  54740. c = h.y) : (h = this.actions[m - 1].args,
  54741. l = h[h.length - 2],
  54742. c = h[h.length - 1]);
  54743. for (var I = 1; I <= e; I++) {
  54744. var E = I / e;
  54745. u = f(E, l, a, r, t),
  54746. d = f(E, c, s, o, i),
  54747. g.push(new n.Vector2(u,d))
  54748. }
  54749. break;
  54750. case "splineThru":
  54751. h = this.actions[m - 1].args;
  54752. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  54753. , w = [b]
  54754. , _ = e * C[0].length;
  54755. w = w.concat(C[0]);
  54756. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  54757. g.push(T.getPointAt(I / _));
  54758. break;
  54759. case "arc":
  54760. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  54761. var E = I / N;
  54762. L || (E = 1 - E),
  54763. x = P + E * D,
  54764. u = S + R * Math.cos(x),
  54765. d = M + R * Math.sin(x),
  54766. g.push(new n.Vector2(u,d))
  54767. }
  54768. break;
  54769. case "ellipse":
  54770. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  54771. 0 !== k && (B = Math.cos(k),
  54772. F = Math.sin(k));
  54773. for (var I = 1; I <= N; I++) {
  54774. var E = I / N;
  54775. if (L || (E = 1 - E),
  54776. x = P + E * D,
  54777. u = S + V * Math.cos(x),
  54778. d = M + U * Math.sin(x),
  54779. 0 !== k) {
  54780. var H = u
  54781. , G = d;
  54782. u = (H - S) * B - (G - M) * F + S,
  54783. d = (H - S) * F + (G - M) * B + M
  54784. }
  54785. g.push(new n.Vector2(u,d))
  54786. }
  54787. }
  54788. }
  54789. var z = g[g.length - 1];
  54790. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  54791. this.autoClose && g.push(g[0]),
  54792. g
  54793. }
  54794. ,
  54795. n.Path.prototype.toShapes = function(e, t) {
  54796. function i(e) {
  54797. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  54798. var a = e[r]
  54799. , s = a.args
  54800. , l = a.action;
  54801. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  54802. i = new n.Path),
  54803. i[l].apply(i, s)
  54804. }
  54805. return 0 !== i.actions.length && t.push(i),
  54806. t
  54807. }
  54808. function r(e) {
  54809. for (var t = [], i = 0, r = e.length; i < r; i++) {
  54810. var o = e[i]
  54811. , a = new n.Shape;
  54812. a.actions = o.actions,
  54813. a.curves = o.curves,
  54814. t.push(a)
  54815. }
  54816. return t
  54817. }
  54818. function o(e, t) {
  54819. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  54820. var a = t[r]
  54821. , s = t[o]
  54822. , l = s.x - a.x
  54823. , c = s.y - a.y;
  54824. if (Math.abs(c) > Number.EPSILON) {
  54825. if (c < 0 && (a = t[o],
  54826. l = -l,
  54827. s = t[r],
  54828. c = -c),
  54829. e.y < a.y || e.y > s.y)
  54830. continue;
  54831. if (e.y === a.y) {
  54832. if (e.x === a.x)
  54833. return !0
  54834. } else {
  54835. var h = c * (e.x - a.x) - l * (e.y - a.y);
  54836. if (0 === h)
  54837. return !0;
  54838. if (h < 0)
  54839. continue;
  54840. n = !n
  54841. }
  54842. } else {
  54843. if (e.y !== a.y)
  54844. continue;
  54845. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  54846. return !0
  54847. }
  54848. }
  54849. return n
  54850. }
  54851. var a = n.ShapeUtils.isClockWise
  54852. , s = i(this.actions);
  54853. if (0 === s.length)
  54854. return [];
  54855. if (t === !0)
  54856. return r(s);
  54857. var l, c, h, u = [];
  54858. if (1 === s.length)
  54859. return c = s[0],
  54860. h = new n.Shape,
  54861. h.actions = c.actions,
  54862. h.curves = c.curves,
  54863. u.push(h),
  54864. u;
  54865. var d = !a(s[0].getPoints());
  54866. d = e ? !d : d;
  54867. var p, f = [], g = [], m = [], v = 0;
  54868. g[v] = void 0,
  54869. m[v] = [];
  54870. for (var A = 0, y = s.length; A < y; A++)
  54871. c = s[A],
  54872. p = c.getPoints(),
  54873. l = a(p),
  54874. l = e ? !l : l,
  54875. l ? (!d && g[v] && v++,
  54876. g[v] = {
  54877. s: new n.Shape,
  54878. p: p
  54879. },
  54880. g[v].s.actions = c.actions,
  54881. g[v].s.curves = c.curves,
  54882. d && v++,
  54883. m[v] = []) : m[v].push({
  54884. h: c,
  54885. p: p[0]
  54886. });
  54887. if (!g[0])
  54888. return r(s);
  54889. if (g.length > 1) {
  54890. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  54891. f[E] = [];
  54892. for (var E = 0, b = g.length; E < b; E++)
  54893. for (var w = m[E], _ = 0; _ < w.length; _++) {
  54894. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  54895. o(T.p, g[S].p) && (E !== S && I.push({
  54896. froms: E,
  54897. tos: S,
  54898. hole: _
  54899. }),
  54900. x ? (x = !1,
  54901. f[S].push(T)) : C = !0);
  54902. x && f[E].push(T)
  54903. }
  54904. I.length > 0 && (C || (m = f))
  54905. }
  54906. for (var M, A = 0, R = g.length; A < R; A++) {
  54907. h = g[A].s,
  54908. u.push(h),
  54909. M = m[A];
  54910. for (var P = 0, O = M.length; P < O; P++)
  54911. h.holes.push(M[P].h)
  54912. }
  54913. return u
  54914. }
  54915. ,
  54916. n.Shape = function() {
  54917. n.Path.apply(this, arguments),
  54918. this.holes = []
  54919. }
  54920. ,
  54921. n.Shape.prototype = Object.create(n.Path.prototype),
  54922. n.Shape.prototype.constructor = n.Shape,
  54923. n.Shape.prototype.extrude = function(e) {
  54924. return new n.ExtrudeGeometry(this,e)
  54925. }
  54926. ,
  54927. n.Shape.prototype.makeGeometry = function(e) {
  54928. return new n.ShapeGeometry(this,e)
  54929. }
  54930. ,
  54931. n.Shape.prototype.getPointsHoles = function(e) {
  54932. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  54933. t[i] = this.holes[i].getPoints(e);
  54934. return t
  54935. }
  54936. ,
  54937. n.Shape.prototype.extractAllPoints = function(e) {
  54938. return {
  54939. shape: this.getPoints(e),
  54940. holes: this.getPointsHoles(e)
  54941. }
  54942. }
  54943. ,
  54944. n.Shape.prototype.extractPoints = function(e) {
  54945. return this.extractAllPoints(e)
  54946. }
  54947. ,
  54948. n.LineCurve = function(e, t) {
  54949. this.v1 = e,
  54950. this.v2 = t
  54951. }
  54952. ,
  54953. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  54954. n.LineCurve.prototype.constructor = n.LineCurve,
  54955. n.LineCurve.prototype.getPoint = function(e) {
  54956. var t = this.v2.clone().sub(this.v1);
  54957. return t.multiplyScalar(e).add(this.v1),
  54958. t
  54959. }
  54960. ,
  54961. n.LineCurve.prototype.getPointAt = function(e) {
  54962. return this.getPoint(e)
  54963. }
  54964. ,
  54965. n.LineCurve.prototype.getTangent = function(e) {
  54966. var t = this.v2.clone().sub(this.v1);
  54967. return t.normalize()
  54968. }
  54969. ,
  54970. n.QuadraticBezierCurve = function(e, t, i) {
  54971. this.v0 = e,
  54972. this.v1 = t,
  54973. this.v2 = i
  54974. }
  54975. ,
  54976. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  54977. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  54978. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  54979. var t = n.ShapeUtils.b2;
  54980. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  54981. }
  54982. ,
  54983. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  54984. var t = n.CurveUtils.tangentQuadraticBezier;
  54985. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  54986. }
  54987. ,
  54988. n.CubicBezierCurve = function(e, t, i, n) {
  54989. this.v0 = e,
  54990. this.v1 = t,
  54991. this.v2 = i,
  54992. this.v3 = n
  54993. }
  54994. ,
  54995. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  54996. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  54997. n.CubicBezierCurve.prototype.getPoint = function(e) {
  54998. var t = n.ShapeUtils.b3;
  54999. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  55000. }
  55001. ,
  55002. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55003. var t = n.CurveUtils.tangentCubicBezier;
  55004. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  55005. }
  55006. ,
  55007. n.SplineCurve = function(e) {
  55008. this.points = void 0 == e ? [] : e
  55009. }
  55010. ,
  55011. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55012. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55013. n.SplineCurve.prototype.getPoint = function(e) {
  55014. var t = this.points
  55015. , i = (t.length - 1) * e
  55016. , r = Math.floor(i)
  55017. , o = i - r
  55018. , a = t[0 === r ? r : r - 1]
  55019. , s = t[r]
  55020. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55021. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55022. , h = n.CurveUtils.interpolate;
  55023. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55024. }
  55025. ,
  55026. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55027. this.aX = e,
  55028. this.aY = t,
  55029. this.xRadius = i,
  55030. this.yRadius = n,
  55031. this.aStartAngle = r,
  55032. this.aEndAngle = o,
  55033. this.aClockwise = a,
  55034. this.aRotation = s || 0
  55035. }
  55036. ,
  55037. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55038. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55039. n.EllipseCurve.prototype.getPoint = function(e) {
  55040. var t = this.aEndAngle - this.aStartAngle;
  55041. t < 0 && (t += 2 * Math.PI),
  55042. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55043. var i;
  55044. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55045. var r = this.aX + this.xRadius * Math.cos(i)
  55046. , o = this.aY + this.yRadius * Math.sin(i);
  55047. if (0 !== this.aRotation) {
  55048. var a = Math.cos(this.aRotation)
  55049. , s = Math.sin(this.aRotation)
  55050. , l = r
  55051. , c = o;
  55052. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55053. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55054. }
  55055. return new n.Vector2(r,o)
  55056. }
  55057. ,
  55058. n.ArcCurve = function(e, t, i, r, o, a) {
  55059. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55060. }
  55061. ,
  55062. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55063. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55064. n.LineCurve3 = n.Curve.create(function(e, t) {
  55065. this.v1 = e,
  55066. this.v2 = t
  55067. }, function(e) {
  55068. var t = new n.Vector3;
  55069. return t.subVectors(this.v2, this.v1),
  55070. t.multiplyScalar(e),
  55071. t.add(this.v1),
  55072. t
  55073. }),
  55074. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55075. this.v0 = e,
  55076. this.v1 = t,
  55077. this.v2 = i
  55078. }, function(e) {
  55079. var t = n.ShapeUtils.b2;
  55080. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  55081. }),
  55082. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55083. this.v0 = e,
  55084. this.v1 = t,
  55085. this.v2 = i,
  55086. this.v3 = n
  55087. }, function(e) {
  55088. var t = n.ShapeUtils.b3;
  55089. return new n.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  55090. }),
  55091. n.SplineCurve3 = n.Curve.create(function(e) {
  55092. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55093. this.points = void 0 == e ? [] : e
  55094. }, function(e) {
  55095. var t = this.points
  55096. , i = (t.length - 1) * e
  55097. , r = Math.floor(i)
  55098. , o = i - r
  55099. , a = t[0 == r ? r : r - 1]
  55100. , s = t[r]
  55101. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55102. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55103. , h = n.CurveUtils.interpolate;
  55104. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  55105. }),
  55106. n.CatmullRomCurve3 = function() {
  55107. function e() {}
  55108. var t = new n.Vector3
  55109. , i = new e
  55110. , r = new e
  55111. , o = new e;
  55112. return e.prototype.init = function(e, t, i, n) {
  55113. this.c0 = e,
  55114. this.c1 = i,
  55115. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55116. this.c3 = 2 * e - 2 * t + i + n
  55117. }
  55118. ,
  55119. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55120. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55121. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55122. s *= o,
  55123. l *= o,
  55124. this.init(t, i, s, l)
  55125. }
  55126. ,
  55127. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55128. this.init(t, i, r * (i - e), r * (n - t))
  55129. }
  55130. ,
  55131. e.prototype.calc = function(e) {
  55132. var t = e * e
  55133. , i = t * e;
  55134. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55135. }
  55136. ,
  55137. n.Curve.create(function(e) {
  55138. this.points = e || [],
  55139. this.closed = !1
  55140. }, function(e) {
  55141. var a, s, l, c, h = this.points;
  55142. c = h.length,
  55143. c < 2 && console.log("duh, you need at least 2 points"),
  55144. a = (c - (this.closed ? 0 : 1)) * e,
  55145. s = Math.floor(a),
  55146. l = a - s,
  55147. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55148. l = 1);
  55149. var u, d, p, f;
  55150. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55151. u = t),
  55152. d = h[s % c],
  55153. p = h[(s + 1) % c],
  55154. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55155. f = t),
  55156. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55157. var g = "chordal" === this.type ? .5 : .25
  55158. , m = Math.pow(u.distanceToSquared(d), g)
  55159. , v = Math.pow(d.distanceToSquared(p), g)
  55160. , A = Math.pow(p.distanceToSquared(f), g);
  55161. v < 1e-4 && (v = 1),
  55162. m < 1e-4 && (m = v),
  55163. A < 1e-4 && (A = v),
  55164. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55165. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55166. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55167. } else if ("catmullrom" === this.type) {
  55168. var y = void 0 !== this.tension ? this.tension : .5;
  55169. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55170. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55171. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55172. }
  55173. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55174. return C
  55175. })
  55176. }(),
  55177. n.ClosedSplineCurve3 = function(e) {
  55178. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55179. n.CatmullRomCurve3.call(this, e),
  55180. this.type = "catmullrom",
  55181. this.closed = !0
  55182. }
  55183. ,
  55184. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  55185. n.BoxGeometry = function(e, t, i, r, o, a) {
  55186. n.Geometry.call(this),
  55187. this.type = "BoxGeometry",
  55188. this.parameters = {
  55189. width: e,
  55190. height: t,
  55191. depth: i,
  55192. widthSegments: r,
  55193. heightSegments: o,
  55194. depthSegments: a
  55195. },
  55196. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  55197. this.mergeVertices()
  55198. }
  55199. ,
  55200. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  55201. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  55202. n.CubeGeometry = n.BoxGeometry,
  55203. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  55204. function s(e, t, i) {
  55205. var n = 0;
  55206. return n += e * t * 2,
  55207. n += e * i * 2,
  55208. n += i * t * 2,
  55209. 4 * n
  55210. }
  55211. function l(e, t, i, r, o, a, s, l, h, u, I) {
  55212. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  55213. for (var L = O * b - _, D = 0; D < x; D++) {
  55214. var N = D * E - w;
  55215. P[e] = N * r,
  55216. P[t] = L * o,
  55217. P[i] = T,
  55218. p[m] = P.x,
  55219. p[m + 1] = P.y,
  55220. p[m + 2] = P.z,
  55221. P[e] = 0,
  55222. P[t] = 0,
  55223. P[i] = l > 0 ? 1 : -1,
  55224. f[m] = P.x,
  55225. f[m + 1] = P.y,
  55226. f[m + 2] = P.z,
  55227. g[v] = D / h,
  55228. g[v + 1] = 1 - O / u,
  55229. m += 3,
  55230. v += 2,
  55231. M += 1
  55232. }
  55233. for (O = 0; O < u; O++)
  55234. for (D = 0; D < h; D++) {
  55235. var B = y + D + x * O
  55236. , F = y + D + x * (O + 1)
  55237. , V = y + (D + 1) + x * (O + 1)
  55238. , U = y + (D + 1) + x * O;
  55239. d[A] = B,
  55240. d[A + 1] = F,
  55241. d[A + 2] = U,
  55242. d[A + 3] = F,
  55243. d[A + 4] = V,
  55244. d[A + 5] = U,
  55245. A += 6,
  55246. R += 6
  55247. }
  55248. c.addGroup(C, R, I),
  55249. C += R,
  55250. y += M
  55251. }
  55252. n.BufferGeometry.call(this),
  55253. this.type = "BoxBufferGeometry",
  55254. this.parameters = {
  55255. width: e,
  55256. height: t,
  55257. depth: i,
  55258. widthSegments: r,
  55259. heightSegments: o,
  55260. depthSegments: a
  55261. };
  55262. var c = this;
  55263. r = Math.floor(r) || 1,
  55264. o = Math.floor(o) || 1,
  55265. a = Math.floor(a) || 1;
  55266. var h = s(r, o, a)
  55267. , u = h / 4 * 6
  55268. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  55269. , p = new Float32Array(3 * h)
  55270. , f = new Float32Array(3 * h)
  55271. , g = new Float32Array(2 * h)
  55272. , m = 0
  55273. , v = 0
  55274. , A = 0
  55275. , y = 0
  55276. , C = 0;
  55277. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  55278. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  55279. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  55280. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  55281. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  55282. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  55283. this.setIndex(new n.BufferAttribute(d,1)),
  55284. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55285. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55286. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55287. }
  55288. ,
  55289. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55290. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  55291. n.CircleGeometry = function(e, t, i, r) {
  55292. n.Geometry.call(this),
  55293. this.type = "CircleGeometry",
  55294. this.parameters = {
  55295. radius: e,
  55296. segments: t,
  55297. thetaStart: i,
  55298. thetaLength: r
  55299. },
  55300. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  55301. }
  55302. ,
  55303. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  55304. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  55305. n.CircleBufferGeometry = function(e, t, i, r) {
  55306. n.BufferGeometry.call(this),
  55307. this.type = "CircleBufferGeometry",
  55308. this.parameters = {
  55309. radius: e,
  55310. segments: t,
  55311. thetaStart: i,
  55312. thetaLength: r
  55313. },
  55314. e = e || 50,
  55315. t = void 0 !== t ? Math.max(3, t) : 8,
  55316. i = void 0 !== i ? i : 0,
  55317. r = void 0 !== r ? r : 2 * Math.PI;
  55318. var o = t + 2
  55319. , a = new Float32Array(3 * o)
  55320. , s = new Float32Array(3 * o)
  55321. , l = new Float32Array(2 * o);
  55322. s[2] = 1,
  55323. l[0] = .5,
  55324. l[1] = .5;
  55325. for (var c = 0, h = 3, u = 2; c <= t; c++,
  55326. h += 3,
  55327. u += 2) {
  55328. var d = i + c / t * r;
  55329. a[h] = e * Math.cos(d),
  55330. a[h + 1] = e * Math.sin(d),
  55331. s[h + 2] = 1,
  55332. l[u] = (a[h] / e + 1) / 2,
  55333. l[u + 1] = (a[h + 1] / e + 1) / 2
  55334. }
  55335. for (var p = [], h = 1; h <= t; h++)
  55336. p.push(h, h + 1, 0);
  55337. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  55338. this.addAttribute("position", new n.BufferAttribute(a,3)),
  55339. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  55340. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  55341. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  55342. }
  55343. ,
  55344. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55345. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  55346. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  55347. function c() {
  55348. var e = (r + 1) * (o + 1);
  55349. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  55350. e
  55351. }
  55352. function h() {
  55353. var e = r * o * 2 * 3;
  55354. return a === !1 && (e += 2 * r * 3),
  55355. e
  55356. }
  55357. function u() {
  55358. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  55359. for (c = 0; c <= o; c++) {
  55360. var p = []
  55361. , f = c / o
  55362. , b = f * (t - e) + e;
  55363. for (a = 0; a <= r; a++) {
  55364. var w = a / r;
  55365. u.x = b * Math.sin(w * l + s),
  55366. u.y = -f * i + E,
  55367. u.z = b * Math.cos(w * l + s),
  55368. m.setXYZ(y, u.x, u.y, u.z),
  55369. h.copy(u),
  55370. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  55371. h.z = Math.cos(w * l + s)),
  55372. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  55373. v.setXYZ(y, h.x, h.y, h.z),
  55374. A.setXY(y, w, 1 - f),
  55375. p.push(y),
  55376. y++
  55377. }
  55378. I.push(p)
  55379. }
  55380. for (a = 0; a < r; a++)
  55381. for (c = 0; c < o; c++) {
  55382. var _ = I[c][a]
  55383. , T = I[c + 1][a]
  55384. , x = I[c + 1][a + 1]
  55385. , S = I[c][a + 1];
  55386. g.setX(C, _),
  55387. C++,
  55388. g.setX(C, T),
  55389. C++,
  55390. g.setX(C, S),
  55391. C++,
  55392. g.setX(C, T),
  55393. C++,
  55394. g.setX(C, x),
  55395. C++,
  55396. g.setX(C, S),
  55397. C++
  55398. }
  55399. }
  55400. function d(i) {
  55401. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  55402. for (a = y,
  55403. o = 1; o <= r; o++)
  55404. m.setXYZ(y, 0, E * p, 0),
  55405. v.setXYZ(y, 0, p, 0),
  55406. i === !0 ? (h.x = o / r,
  55407. h.y = 0) : (h.x = (o - 1) / r,
  55408. h.y = 1),
  55409. A.setXY(y, h.x, h.y),
  55410. y++;
  55411. for (c = y,
  55412. o = 0; o <= r; o++) {
  55413. var f = o / r;
  55414. u.x = d * Math.sin(f * l + s),
  55415. u.y = E * p,
  55416. u.z = d * Math.cos(f * l + s),
  55417. m.setXYZ(y, u.x, u.y, u.z),
  55418. v.setXYZ(y, 0, p, 0),
  55419. A.setXY(y, f, i === !0 ? 1 : 0),
  55420. y++
  55421. }
  55422. for (o = 0; o < r; o++) {
  55423. var I = a + o
  55424. , b = c + o;
  55425. i === !0 ? (g.setX(C, b),
  55426. C++,
  55427. g.setX(C, b + 1),
  55428. C++,
  55429. g.setX(C, I),
  55430. C++) : (g.setX(C, b + 1),
  55431. C++,
  55432. g.setX(C, b),
  55433. C++,
  55434. g.setX(C, I),
  55435. C++)
  55436. }
  55437. }
  55438. n.BufferGeometry.call(this),
  55439. this.type = "CylinderBufferGeometry",
  55440. this.parameters = {
  55441. radiusTop: e,
  55442. radiusBottom: t,
  55443. height: i,
  55444. radialSegments: r,
  55445. heightSegments: o,
  55446. openEnded: a,
  55447. thetaStart: s,
  55448. thetaLength: l
  55449. },
  55450. e = void 0 !== e ? e : 20,
  55451. t = void 0 !== t ? t : 20,
  55452. i = void 0 !== i ? i : 100,
  55453. r = Math.floor(r) || 8,
  55454. o = Math.floor(o) || 1,
  55455. a = void 0 !== a && a,
  55456. s = void 0 !== s ? s : 0,
  55457. l = void 0 !== l ? l : 2 * Math.PI;
  55458. var p = c()
  55459. , f = h()
  55460. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  55461. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  55462. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  55463. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  55464. , y = 0
  55465. , C = 0
  55466. , I = []
  55467. , E = i / 2;
  55468. u(),
  55469. a === !1 && (e > 0 && d(!0),
  55470. t > 0 && d(!1)),
  55471. this.setIndex(g),
  55472. this.addAttribute("position", m),
  55473. this.addAttribute("normal", v),
  55474. this.addAttribute("uv", A)
  55475. }
  55476. ,
  55477. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55478. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  55479. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  55480. n.Geometry.call(this),
  55481. this.type = "CylinderGeometry",
  55482. this.parameters = {
  55483. radiusTop: e,
  55484. radiusBottom: t,
  55485. height: i,
  55486. radialSegments: r,
  55487. heightSegments: o,
  55488. openEnded: a,
  55489. thetaStart: s,
  55490. thetaLength: l
  55491. },
  55492. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  55493. this.mergeVertices()
  55494. }
  55495. ,
  55496. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  55497. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  55498. n.EdgesGeometry = function(e, t) {
  55499. function i(e, t) {
  55500. return e - t
  55501. }
  55502. n.BufferGeometry.call(this),
  55503. t = void 0 !== t ? t : 1;
  55504. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  55505. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  55506. r.fromBufferGeometry(e)) : r = e.clone(),
  55507. r.mergeVertices(),
  55508. r.computeFaceNormals();
  55509. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  55510. for (var p = h[u], f = 0; f < 3; f++) {
  55511. a[0] = p[l[f]],
  55512. a[1] = p[l[(f + 1) % 3]],
  55513. a.sort(i);
  55514. var g = a.toString();
  55515. void 0 === s[g] ? s[g] = {
  55516. vert1: a[0],
  55517. vert2: a[1],
  55518. face1: u,
  55519. face2: void 0
  55520. } : s[g].face2 = u
  55521. }
  55522. var m = [];
  55523. for (var g in s) {
  55524. var v = s[g];
  55525. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  55526. var A = c[v.vert1];
  55527. m.push(A.x),
  55528. m.push(A.y),
  55529. m.push(A.z),
  55530. A = c[v.vert2],
  55531. m.push(A.x),
  55532. m.push(A.y),
  55533. m.push(A.z)
  55534. }
  55535. }
  55536. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  55537. }
  55538. ,
  55539. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55540. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  55541. n.ExtrudeGeometry = function(e, t) {
  55542. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  55543. this.type = "ExtrudeGeometry",
  55544. e = Array.isArray(e) ? e : [e],
  55545. this.addShapeList(e, t),
  55546. void this.computeFaceNormals())
  55547. }
  55548. ;
  55549. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  55550. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  55551. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  55552. for (var i = e.length, n = 0; n < i; n++) {
  55553. var r = e[n];
  55554. this.addShape(r, t)
  55555. }
  55556. }
  55557. ,
  55558. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  55559. function i(e, t, i) {
  55560. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  55561. t.clone().multiplyScalar(i).add(e)
  55562. }
  55563. function r(e, t, i) {
  55564. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  55565. if (Math.abs(d) > Number.EPSILON) {
  55566. var p = Math.sqrt(u)
  55567. , f = Math.sqrt(c * c + h * h)
  55568. , g = t.x - l / p
  55569. , m = t.y + s / p
  55570. , v = i.x - h / f
  55571. , A = i.y + c / f
  55572. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  55573. r = g + s * y - e.x,
  55574. o = m + l * y - e.y;
  55575. var C = r * r + o * o;
  55576. if (C <= 2)
  55577. return new n.Vector2(r,o);
  55578. a = Math.sqrt(C / 2)
  55579. } else {
  55580. var I = !1;
  55581. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  55582. I ? (r = -l,
  55583. o = s,
  55584. a = Math.sqrt(u)) : (r = s,
  55585. o = l,
  55586. a = Math.sqrt(u / 2))
  55587. }
  55588. return new n.Vector2(r / a,o / a)
  55589. }
  55590. function o() {
  55591. if (C) {
  55592. var e = 0
  55593. , t = z * e;
  55594. for (Y = 0; Y < W; Y++)
  55595. G = N[Y],
  55596. c(G[2] + t, G[1] + t, G[0] + t);
  55597. for (e = E + 2 * y,
  55598. t = z * e,
  55599. Y = 0; Y < W; Y++)
  55600. G = N[Y],
  55601. c(G[0] + t, G[1] + t, G[2] + t)
  55602. } else {
  55603. for (Y = 0; Y < W; Y++)
  55604. G = N[Y],
  55605. c(G[2], G[1], G[0]);
  55606. for (Y = 0; Y < W; Y++)
  55607. G = N[Y],
  55608. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  55609. }
  55610. }
  55611. function a() {
  55612. var e = 0;
  55613. for (s(B, e),
  55614. e += B.length,
  55615. x = 0,
  55616. S = L.length; x < S; x++)
  55617. T = L[x],
  55618. s(T, e),
  55619. e += T.length
  55620. }
  55621. function s(e, t) {
  55622. var i, n;
  55623. for (Y = e.length; --Y >= 0; ) {
  55624. i = Y,
  55625. n = Y - 1,
  55626. n < 0 && (n = e.length - 1);
  55627. var r = 0
  55628. , o = E + 2 * y;
  55629. for (r = 0; r < o; r++) {
  55630. var a = z * r
  55631. , s = z * (r + 1)
  55632. , l = t + i + a
  55633. , c = t + n + a
  55634. , u = t + n + s
  55635. , d = t + i + s;
  55636. h(l, c, u, d, e, r, o, i, n)
  55637. }
  55638. }
  55639. }
  55640. function l(e, t, i) {
  55641. M.vertices.push(new n.Vector3(e,t,i))
  55642. }
  55643. function c(e, t, i) {
  55644. e += R,
  55645. t += R,
  55646. i += R,
  55647. M.faces.push(new n.Face3(e,t,i,null,null,0));
  55648. var r = _.generateTopUV(M, e, t, i);
  55649. M.faceVertexUvs[0].push(r)
  55650. }
  55651. function h(e, t, i, r, o, a, s, l, c) {
  55652. e += R,
  55653. t += R,
  55654. i += R,
  55655. r += R,
  55656. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  55657. M.faces.push(new n.Face3(t,i,r,null,null,1));
  55658. var h = _.generateSideWallUV(M, e, t, i, r);
  55659. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  55660. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  55661. }
  55662. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  55663. b && (u = b.getSpacedPoints(E),
  55664. w = !0,
  55665. C = !1,
  55666. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  55667. p = new n.Vector3,
  55668. f = new n.Vector3,
  55669. g = new n.Vector3),
  55670. C || (y = 0,
  55671. v = 0,
  55672. A = 0);
  55673. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  55674. if (D) {
  55675. for (O = O.reverse(),
  55676. x = 0,
  55677. S = L.length; x < S; x++)
  55678. T = L[x],
  55679. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  55680. D = !1
  55681. }
  55682. var N = n.ShapeUtils.triangulateShape(O, L)
  55683. , B = O;
  55684. for (x = 0,
  55685. S = L.length; x < S; x++)
  55686. T = L[x],
  55687. O = O.concat(T);
  55688. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  55689. Z++,
  55690. q++)
  55691. Z === X && (Z = 0),
  55692. q === X && (q = 0),
  55693. j[Y] = r(B[Y], B[Z], B[q]);
  55694. var K, Q = [], J = j.concat();
  55695. for (x = 0,
  55696. S = L.length; x < S; x++) {
  55697. for (T = L[x],
  55698. K = [],
  55699. Y = 0,
  55700. X = T.length,
  55701. Z = X - 1,
  55702. q = Y + 1; Y < X; Y++,
  55703. Z++,
  55704. q++)
  55705. Z === X && (Z = 0),
  55706. q === X && (q = 0),
  55707. K[Y] = r(T[Y], T[Z], T[q]);
  55708. Q.push(K),
  55709. J = J.concat(K)
  55710. }
  55711. for (F = 0; F < y; F++) {
  55712. for (U = F / y,
  55713. k = v * (1 - U),
  55714. V = A * Math.sin(U * Math.PI / 2),
  55715. Y = 0,
  55716. X = B.length; Y < X; Y++)
  55717. H = i(B[Y], j[Y], V),
  55718. l(H.x, H.y, -k);
  55719. for (x = 0,
  55720. S = L.length; x < S; x++)
  55721. for (T = L[x],
  55722. K = Q[x],
  55723. Y = 0,
  55724. X = T.length; Y < X; Y++)
  55725. H = i(T[Y], K[Y], V),
  55726. l(H.x, H.y, -k)
  55727. }
  55728. for (V = A,
  55729. Y = 0; Y < z; Y++)
  55730. H = C ? i(O[Y], J[Y], V) : O[Y],
  55731. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  55732. p.copy(d.binormals[0]).multiplyScalar(H.y),
  55733. g.copy(u[0]).add(f).add(p),
  55734. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  55735. var $;
  55736. for ($ = 1; $ <= E; $++)
  55737. for (Y = 0; Y < z; Y++)
  55738. H = C ? i(O[Y], J[Y], V) : O[Y],
  55739. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  55740. p.copy(d.binormals[$]).multiplyScalar(H.y),
  55741. g.copy(u[$]).add(f).add(p),
  55742. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  55743. for (F = y - 1; F >= 0; F--) {
  55744. for (U = F / y,
  55745. k = v * (1 - U),
  55746. V = A * Math.sin(U * Math.PI / 2),
  55747. Y = 0,
  55748. X = B.length; Y < X; Y++)
  55749. H = i(B[Y], j[Y], V),
  55750. l(H.x, H.y, m + k);
  55751. for (x = 0,
  55752. S = L.length; x < S; x++)
  55753. for (T = L[x],
  55754. K = Q[x],
  55755. Y = 0,
  55756. X = T.length; Y < X; Y++)
  55757. H = i(T[Y], K[Y], V),
  55758. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  55759. }
  55760. o(),
  55761. a()
  55762. }
  55763. ,
  55764. n.ExtrudeGeometry.WorldUVGenerator = {
  55765. generateTopUV: function(e, t, i, r) {
  55766. var o = e.vertices
  55767. , a = o[t]
  55768. , s = o[i]
  55769. , l = o[r];
  55770. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  55771. },
  55772. generateSideWallUV: function(e, t, i, r, o) {
  55773. var a = e.vertices
  55774. , s = a[t]
  55775. , l = a[i]
  55776. , c = a[r]
  55777. , h = a[o];
  55778. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  55779. }
  55780. },
  55781. n.ShapeGeometry = function(e, t) {
  55782. n.Geometry.call(this),
  55783. this.type = "ShapeGeometry",
  55784. Array.isArray(e) === !1 && (e = [e]),
  55785. this.addShapeList(e, t),
  55786. this.computeFaceNormals()
  55787. }
  55788. ,
  55789. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  55790. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  55791. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  55792. for (var i = 0, n = e.length; i < n; i++)
  55793. this.addShape(e[i], t);
  55794. return this
  55795. }
  55796. ,
  55797. n.ShapeGeometry.prototype.addShape = function(e, t) {
  55798. void 0 === t && (t = {});
  55799. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  55800. if (p) {
  55801. for (u = u.reverse(),
  55802. i = 0,
  55803. r = d.length; i < r; i++)
  55804. o = d[i],
  55805. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  55806. p = !1
  55807. }
  55808. var f = n.ShapeUtils.triangulateShape(u, d);
  55809. for (i = 0,
  55810. r = d.length; i < r; i++)
  55811. o = d[i],
  55812. u = u.concat(o);
  55813. var g, m, v = u.length, A = f.length;
  55814. for (i = 0; i < v; i++)
  55815. g = u[i],
  55816. this.vertices.push(new n.Vector3(g.x,g.y,0));
  55817. for (i = 0; i < A; i++) {
  55818. m = f[i];
  55819. var y = m[0] + c
  55820. , C = m[1] + c
  55821. , I = m[2] + c;
  55822. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  55823. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  55824. }
  55825. }
  55826. ,
  55827. n.LatheBufferGeometry = function(e, t, i, r) {
  55828. n.BufferGeometry.call(this),
  55829. this.type = "LatheBufferGeometry",
  55830. this.parameters = {
  55831. points: e,
  55832. segments: t,
  55833. phiStart: i,
  55834. phiLength: r
  55835. },
  55836. t = Math.floor(t) || 12,
  55837. i = i || 0,
  55838. r = r || 2 * Math.PI,
  55839. r = n.Math.clamp(r, 0, 2 * Math.PI);
  55840. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  55841. 1 / t), m = new n.Vector3, v = new n.Vector2;
  55842. for (a = 0; a <= t; a++) {
  55843. var A = i + a * g * r
  55844. , y = Math.sin(A)
  55845. , C = Math.cos(A);
  55846. for (s = 0; s <= e.length - 1; s++)
  55847. m.x = e[s].x * y,
  55848. m.y = e[s].y,
  55849. m.z = e[s].x * C,
  55850. u.setXYZ(p, m.x, m.y, m.z),
  55851. v.x = a / t,
  55852. v.y = s / (e.length - 1),
  55853. d.setXY(p, v.x, v.y),
  55854. p++
  55855. }
  55856. for (a = 0; a < t; a++)
  55857. for (s = 0; s < e.length - 1; s++) {
  55858. o = s + a * e.length;
  55859. var I = o
  55860. , E = o + e.length
  55861. , b = o + e.length + 1
  55862. , w = o + 1;
  55863. h.setX(f, I),
  55864. f++,
  55865. h.setX(f, E),
  55866. f++,
  55867. h.setX(f, w),
  55868. f++,
  55869. h.setX(f, E),
  55870. f++,
  55871. h.setX(f, b),
  55872. f++,
  55873. h.setX(f, w),
  55874. f++
  55875. }
  55876. if (this.setIndex(h),
  55877. this.addAttribute("position", u),
  55878. this.addAttribute("uv", d),
  55879. this.computeVertexNormals(),
  55880. r === 2 * Math.PI) {
  55881. var _ = this.attributes.normal.array
  55882. , T = new n.Vector3
  55883. , x = new n.Vector3
  55884. , S = new n.Vector3;
  55885. for (o = t * e.length * 3,
  55886. a = 0,
  55887. s = 0; a < e.length; a++,
  55888. s += 3)
  55889. T.x = _[s + 0],
  55890. T.y = _[s + 1],
  55891. T.z = _[s + 2],
  55892. x.x = _[o + s + 0],
  55893. x.y = _[o + s + 1],
  55894. x.z = _[o + s + 2],
  55895. S.addVectors(T, x).normalize(),
  55896. _[s + 0] = _[o + s + 0] = S.x,
  55897. _[s + 1] = _[o + s + 1] = S.y,
  55898. _[s + 2] = _[o + s + 2] = S.z
  55899. }
  55900. }
  55901. ,
  55902. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55903. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  55904. n.LatheGeometry = function(e, t, i, r) {
  55905. n.Geometry.call(this),
  55906. this.type = "LatheGeometry",
  55907. this.parameters = {
  55908. points: e,
  55909. segments: t,
  55910. phiStart: i,
  55911. phiLength: r
  55912. },
  55913. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  55914. this.mergeVertices()
  55915. }
  55916. ,
  55917. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  55918. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  55919. n.PlaneGeometry = function(e, t, i, r) {
  55920. n.Geometry.call(this),
  55921. this.type = "PlaneGeometry",
  55922. this.parameters = {
  55923. width: e,
  55924. height: t,
  55925. widthSegments: i,
  55926. heightSegments: r
  55927. },
  55928. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  55929. }
  55930. ,
  55931. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  55932. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  55933. n.PlaneBufferGeometry = function(e, t, i, r) {
  55934. n.BufferGeometry.call(this),
  55935. this.type = "PlaneBufferGeometry",
  55936. this.parameters = {
  55937. width: e,
  55938. height: t,
  55939. widthSegments: i,
  55940. heightSegments: r
  55941. };
  55942. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  55943. for (var y = A * d - a, C = 0; C < c; C++) {
  55944. var I = C * u - o;
  55945. p[m] = I,
  55946. p[m + 1] = -y,
  55947. f[m + 2] = 1,
  55948. g[v] = C / s,
  55949. g[v + 1] = 1 - A / l,
  55950. m += 3,
  55951. v += 2
  55952. }
  55953. m = 0;
  55954. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  55955. for (var C = 0; C < s; C++) {
  55956. var b = C + c * A
  55957. , w = C + c * (A + 1)
  55958. , _ = C + 1 + c * (A + 1)
  55959. , T = C + 1 + c * A;
  55960. E[m] = b,
  55961. E[m + 1] = w,
  55962. E[m + 2] = T,
  55963. E[m + 3] = w,
  55964. E[m + 4] = _,
  55965. E[m + 5] = T,
  55966. m += 6
  55967. }
  55968. this.setIndex(new n.BufferAttribute(E,1)),
  55969. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55970. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55971. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55972. }
  55973. ,
  55974. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55975. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  55976. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  55977. n.BufferGeometry.call(this),
  55978. this.type = "RingBufferGeometry",
  55979. this.parameters = {
  55980. innerRadius: e,
  55981. outerRadius: t,
  55982. thetaSegments: i,
  55983. phiSegments: r,
  55984. thetaStart: o,
  55985. thetaLength: a
  55986. },
  55987. e = e || 20,
  55988. t = t || 50,
  55989. o = void 0 !== o ? o : 0,
  55990. a = void 0 !== a ? a : 2 * Math.PI,
  55991. i = void 0 !== i ? Math.max(3, i) : 8,
  55992. r = void 0 !== r ? Math.max(1, r) : 1;
  55993. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  55994. for (l = 0; l <= r; l++) {
  55995. for (c = 0; c <= i; c++)
  55996. s = o + c / i * a,
  55997. C.x = A * Math.cos(s),
  55998. C.y = A * Math.sin(s),
  55999. p.setXYZ(m, C.x, C.y, C.z),
  56000. f.setXYZ(m, 0, 0, 1),
  56001. I.x = (C.x / t + 1) / 2,
  56002. I.y = (C.y / t + 1) / 2,
  56003. g.setXY(m, I.x, I.y),
  56004. m++;
  56005. A += y
  56006. }
  56007. for (l = 0; l < r; l++) {
  56008. var E = l * (i + 1);
  56009. for (c = 0; c < i; c++) {
  56010. s = c + E;
  56011. var b = s
  56012. , w = s + i + 1
  56013. , _ = s + i + 2
  56014. , T = s + 1;
  56015. d.setX(v, b),
  56016. v++,
  56017. d.setX(v, w),
  56018. v++,
  56019. d.setX(v, _),
  56020. v++,
  56021. d.setX(v, b),
  56022. v++,
  56023. d.setX(v, _),
  56024. v++,
  56025. d.setX(v, T),
  56026. v++
  56027. }
  56028. }
  56029. this.setIndex(d),
  56030. this.addAttribute("position", p),
  56031. this.addAttribute("normal", f),
  56032. this.addAttribute("uv", g)
  56033. }
  56034. ,
  56035. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56036. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56037. n.RingGeometry = function(e, t, i, r, o, a) {
  56038. n.Geometry.call(this),
  56039. this.type = "RingGeometry",
  56040. this.parameters = {
  56041. innerRadius: e,
  56042. outerRadius: t,
  56043. thetaSegments: i,
  56044. phiSegments: r,
  56045. thetaStart: o,
  56046. thetaLength: a
  56047. },
  56048. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56049. }
  56050. ,
  56051. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56052. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56053. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56054. n.Geometry.call(this),
  56055. this.type = "SphereGeometry",
  56056. this.parameters = {
  56057. radius: e,
  56058. widthSegments: t,
  56059. heightSegments: i,
  56060. phiStart: r,
  56061. phiLength: o,
  56062. thetaStart: a,
  56063. thetaLength: s
  56064. },
  56065. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56066. }
  56067. ,
  56068. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56069. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56070. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56071. n.BufferGeometry.call(this),
  56072. this.type = "SphereBufferGeometry",
  56073. this.parameters = {
  56074. radius: e,
  56075. widthSegments: t,
  56076. heightSegments: i,
  56077. phiStart: r,
  56078. phiLength: o,
  56079. thetaStart: a,
  56080. thetaLength: s
  56081. },
  56082. e = e || 50,
  56083. t = Math.max(3, Math.floor(t) || 8),
  56084. i = Math.max(2, Math.floor(i) || 6),
  56085. r = void 0 !== r ? r : 0,
  56086. o = void 0 !== o ? o : 2 * Math.PI,
  56087. a = void 0 !== a ? a : 0,
  56088. s = void 0 !== s ? s : Math.PI;
  56089. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  56090. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56091. var C = y / t
  56092. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56093. , E = e * Math.cos(a + A * s)
  56094. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56095. g.set(I, E, b).normalize(),
  56096. h.setXYZ(p, I, E, b),
  56097. u.setXYZ(p, g.x, g.y, g.z),
  56098. d.setXY(p, C, 1 - A),
  56099. v.push(p),
  56100. p++
  56101. }
  56102. f.push(v)
  56103. }
  56104. for (var w = [], m = 0; m < i; m++)
  56105. for (var y = 0; y < t; y++) {
  56106. var _ = f[m][y + 1]
  56107. , T = f[m][y]
  56108. , x = f[m + 1][y]
  56109. , S = f[m + 1][y + 1];
  56110. (0 !== m || a > 0) && w.push(_, T, S),
  56111. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56112. }
  56113. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56114. this.addAttribute("position", h),
  56115. this.addAttribute("normal", u),
  56116. this.addAttribute("uv", d),
  56117. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56118. }
  56119. ,
  56120. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56121. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56122. n.TextGeometry = function(e, t) {
  56123. t = t || {};
  56124. var i = t.font;
  56125. if (i instanceof n.Font == !1)
  56126. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56127. new n.Geometry;
  56128. var r = i.generateShapes(e, t.size, t.curveSegments);
  56129. t.amount = void 0 !== t.height ? t.height : 50,
  56130. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56131. void 0 === t.bevelSize && (t.bevelSize = 8),
  56132. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56133. n.ExtrudeGeometry.call(this, r, t),
  56134. this.type = "TextGeometry"
  56135. }
  56136. ,
  56137. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56138. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56139. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56140. n.BufferGeometry.call(this),
  56141. this.type = "TorusBufferGeometry",
  56142. this.parameters = {
  56143. radius: e,
  56144. tube: t,
  56145. radialSegments: i,
  56146. tubularSegments: r,
  56147. arc: o
  56148. },
  56149. e = e || 100,
  56150. t = t || 40,
  56151. i = Math.floor(i) || 8,
  56152. r = Math.floor(r) || 6,
  56153. o = o || 2 * Math.PI;
  56154. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  56155. for (a = 0; a <= i; a++)
  56156. for (s = 0; s <= r; s++) {
  56157. var C = s / r * o
  56158. , I = a / i * Math.PI * 2;
  56159. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56160. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56161. A.z = t * Math.sin(I),
  56162. u[f] = A.x,
  56163. u[f + 1] = A.y,
  56164. u[f + 2] = A.z,
  56165. v.x = e * Math.cos(C),
  56166. v.y = e * Math.sin(C),
  56167. y.subVectors(A, v).normalize(),
  56168. d[f] = y.x,
  56169. d[f + 1] = y.y,
  56170. d[f + 2] = y.z,
  56171. p[g] = s / r,
  56172. p[g + 1] = a / i,
  56173. f += 3,
  56174. g += 2
  56175. }
  56176. for (a = 1; a <= i; a++)
  56177. for (s = 1; s <= r; s++) {
  56178. var E = (r + 1) * a + s - 1
  56179. , b = (r + 1) * (a - 1) + s - 1
  56180. , w = (r + 1) * (a - 1) + s
  56181. , _ = (r + 1) * a + s;
  56182. h[m] = E,
  56183. h[m + 1] = b,
  56184. h[m + 2] = _,
  56185. h[m + 3] = b,
  56186. h[m + 4] = w,
  56187. h[m + 5] = _,
  56188. m += 6
  56189. }
  56190. this.setIndex(new n.BufferAttribute(h,1)),
  56191. this.addAttribute("position", new n.BufferAttribute(u,3)),
  56192. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  56193. this.addAttribute("uv", new n.BufferAttribute(p,2))
  56194. }
  56195. ,
  56196. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56197. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  56198. n.TorusGeometry = function(e, t, i, r, o) {
  56199. n.Geometry.call(this),
  56200. this.type = "TorusGeometry",
  56201. this.parameters = {
  56202. radius: e,
  56203. tube: t,
  56204. radialSegments: i,
  56205. tubularSegments: r,
  56206. arc: o
  56207. },
  56208. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  56209. }
  56210. ,
  56211. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  56212. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  56213. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  56214. function s(e, t, i, n, r) {
  56215. var o = Math.cos(e)
  56216. , a = Math.sin(e)
  56217. , s = i / t * e
  56218. , l = Math.cos(s);
  56219. r.x = n * (2 + l) * .5 * o,
  56220. r.y = n * (2 + l) * a * .5,
  56221. r.z = n * Math.sin(s) * .5
  56222. }
  56223. n.BufferGeometry.call(this),
  56224. this.type = "TorusKnotBufferGeometry",
  56225. this.parameters = {
  56226. radius: e,
  56227. tube: t,
  56228. tubularSegments: i,
  56229. radialSegments: r,
  56230. p: o,
  56231. q: a
  56232. },
  56233. e = e || 100,
  56234. t = t || 40,
  56235. i = Math.floor(i) || 64,
  56236. r = Math.floor(r) || 8,
  56237. o = o || 2,
  56238. a = a || 3;
  56239. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  56240. for (l = 0; l <= i; ++l) {
  56241. var T = l / i * o * Math.PI * 2;
  56242. for (s(T, o, a, e, I),
  56243. s(T + .01, o, a, e, E),
  56244. w.subVectors(E, I),
  56245. _.addVectors(E, I),
  56246. b.crossVectors(w, _),
  56247. _.crossVectors(b, w),
  56248. b.normalize(),
  56249. _.normalize(),
  56250. c = 0; c <= r; ++c) {
  56251. var x = c / r * Math.PI * 2
  56252. , S = -t * Math.cos(x)
  56253. , M = t * Math.sin(x);
  56254. A.x = I.x + (S * _.x + M * b.x),
  56255. A.y = I.y + (S * _.y + M * b.y),
  56256. A.z = I.z + (S * _.z + M * b.z),
  56257. p.setXYZ(m, A.x, A.y, A.z),
  56258. y.subVectors(A, I).normalize(),
  56259. f.setXYZ(m, y.x, y.y, y.z),
  56260. C.x = l / i,
  56261. C.y = c / r,
  56262. g.setXY(m, C.x, C.y),
  56263. m++
  56264. }
  56265. }
  56266. for (c = 1; c <= i; c++)
  56267. for (l = 1; l <= r; l++) {
  56268. var R = (r + 1) * (c - 1) + (l - 1)
  56269. , P = (r + 1) * c + (l - 1)
  56270. , O = (r + 1) * c + l
  56271. , L = (r + 1) * (c - 1) + l;
  56272. d.setX(v, R),
  56273. v++,
  56274. d.setX(v, P),
  56275. v++,
  56276. d.setX(v, L),
  56277. v++,
  56278. d.setX(v, P),
  56279. v++,
  56280. d.setX(v, O),
  56281. v++,
  56282. d.setX(v, L),
  56283. v++
  56284. }
  56285. this.setIndex(d),
  56286. this.addAttribute("position", p),
  56287. this.addAttribute("normal", f),
  56288. this.addAttribute("uv", g)
  56289. }
  56290. ,
  56291. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56292. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  56293. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  56294. n.Geometry.call(this),
  56295. this.type = "TorusKnotGeometry",
  56296. this.parameters = {
  56297. radius: e,
  56298. tube: t,
  56299. tubularSegments: i,
  56300. radialSegments: r,
  56301. p: o,
  56302. q: a
  56303. },
  56304. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  56305. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  56306. this.mergeVertices()
  56307. }
  56308. ,
  56309. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  56310. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  56311. n.TubeGeometry = function(e, t, i, r, o, a) {
  56312. function s(e, t, i) {
  56313. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  56314. }
  56315. n.Geometry.call(this),
  56316. this.type = "TubeGeometry",
  56317. this.parameters = {
  56318. path: e,
  56319. segments: t,
  56320. radius: i,
  56321. radialSegments: r,
  56322. closed: o,
  56323. taper: a
  56324. },
  56325. t = t || 64,
  56326. i = i || 1,
  56327. r = r || 8,
  56328. o = o || !1,
  56329. a = a || n.TubeGeometry.NoTaper;
  56330. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  56331. for (this.tangents = D,
  56332. this.normals = N,
  56333. this.binormals = B,
  56334. v = 0; v < P; v++)
  56335. for (M[v] = [],
  56336. u = v / (P - 1),
  56337. m = e.getPointAt(u),
  56338. l = D[v],
  56339. c = N[v],
  56340. h = B[v],
  56341. p = i * a(u),
  56342. A = 0; A < r; A++)
  56343. d = A / r * 2 * Math.PI,
  56344. f = -p * Math.cos(d),
  56345. g = p * Math.sin(d),
  56346. O.copy(m),
  56347. O.x += f * c.x + g * h.x,
  56348. O.y += f * c.y + g * h.y,
  56349. O.z += f * c.z + g * h.z,
  56350. M[v][A] = s(O.x, O.y, O.z);
  56351. for (v = 0; v < t; v++)
  56352. for (A = 0; A < r; A++)
  56353. y = o ? (v + 1) % t : v + 1,
  56354. C = (A + 1) % r,
  56355. I = M[v][A],
  56356. E = M[y][A],
  56357. b = M[y][C],
  56358. w = M[v][C],
  56359. _ = new n.Vector2(v / t,A / r),
  56360. T = new n.Vector2((v + 1) / t,A / r),
  56361. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  56362. S = new n.Vector2(v / t,(A + 1) / r),
  56363. this.faces.push(new n.Face3(I,E,w)),
  56364. this.faceVertexUvs[0].push([_, T, S]),
  56365. this.faces.push(new n.Face3(E,b,w)),
  56366. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  56367. this.computeFaceNormals(),
  56368. this.computeVertexNormals()
  56369. }
  56370. ,
  56371. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  56372. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  56373. n.TubeGeometry.NoTaper = function(e) {
  56374. return 1
  56375. }
  56376. ,
  56377. n.TubeGeometry.SinusoidalTaper = function(e) {
  56378. return Math.sin(Math.PI * e)
  56379. }
  56380. ,
  56381. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  56382. function r() {
  56383. f[0] = new n.Vector3,
  56384. g[0] = new n.Vector3,
  56385. a = Number.MAX_VALUE,
  56386. s = Math.abs(p[0].x),
  56387. l = Math.abs(p[0].y),
  56388. c = Math.abs(p[0].z),
  56389. s <= a && (a = s,
  56390. d.set(1, 0, 0)),
  56391. l <= a && (a = l,
  56392. d.set(0, 1, 0)),
  56393. c <= a && d.set(0, 0, 1),
  56394. m.crossVectors(p[0], d).normalize(),
  56395. f[0].crossVectors(p[0], m),
  56396. g[0].crossVectors(p[0], f[0])
  56397. }
  56398. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  56399. for (this.tangents = p,
  56400. this.normals = f,
  56401. this.binormals = g,
  56402. h = 0; h < A; h++)
  56403. u = h / (A - 1),
  56404. p[h] = e.getTangentAt(u),
  56405. p[h].normalize();
  56406. for (r(),
  56407. h = 1; h < A; h++)
  56408. f[h] = f[h - 1].clone(),
  56409. g[h] = g[h - 1].clone(),
  56410. m.crossVectors(p[h - 1], p[h]),
  56411. m.length() > Number.EPSILON && (m.normalize(),
  56412. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  56413. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  56414. g[h].crossVectors(p[h], f[h]);
  56415. if (i)
  56416. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  56417. o /= A - 1,
  56418. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  56419. h = 1; h < A; h++)
  56420. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  56421. g[h].crossVectors(p[h], f[h])
  56422. }
  56423. ,
  56424. n.PolyhedronGeometry = function(e, t, i, r) {
  56425. function o(e) {
  56426. var t = e.normalize().clone();
  56427. t.index = u.vertices.push(t) - 1;
  56428. var i = l(e) / 2 / Math.PI + .5
  56429. , r = c(e) / Math.PI + .5;
  56430. return t.uv = new n.Vector2(i,1 - r),
  56431. t
  56432. }
  56433. function a(e, t, i, r) {
  56434. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  56435. u.faces.push(o),
  56436. C.copy(e).add(t).add(i).divideScalar(3);
  56437. var a = l(C);
  56438. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  56439. }
  56440. function s(e, t) {
  56441. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  56442. l[h] = [];
  56443. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  56444. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  56445. }
  56446. for (var h = 0; h < i; h++)
  56447. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  56448. var m = Math.floor(g / 2);
  56449. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  56450. }
  56451. }
  56452. function l(e) {
  56453. return Math.atan2(e.z, -e.x)
  56454. }
  56455. function c(e) {
  56456. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  56457. }
  56458. function h(e, t, i) {
  56459. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  56460. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  56461. e.clone()
  56462. }
  56463. n.Geometry.call(this),
  56464. this.type = "PolyhedronGeometry",
  56465. this.parameters = {
  56466. vertices: e,
  56467. indices: t,
  56468. radius: i,
  56469. detail: r
  56470. },
  56471. i = i || 1,
  56472. r = r || 0;
  56473. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  56474. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  56475. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  56476. m++) {
  56477. var v = f[t[d]]
  56478. , A = f[t[d + 1]]
  56479. , y = f[t[d + 2]];
  56480. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  56481. }
  56482. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  56483. s(g[d], r);
  56484. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  56485. var I = this.faceVertexUvs[0][d]
  56486. , E = I[0].x
  56487. , b = I[1].x
  56488. , w = I[2].x
  56489. , _ = Math.max(E, b, w)
  56490. , T = Math.min(E, b, w);
  56491. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  56492. b < .2 && (I[1].x += 1),
  56493. w < .2 && (I[2].x += 1))
  56494. }
  56495. for (var d = 0, p = this.vertices.length; d < p; d++)
  56496. this.vertices[d].multiplyScalar(i);
  56497. this.mergeVertices(),
  56498. this.computeFaceNormals(),
  56499. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  56500. }
  56501. ,
  56502. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  56503. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  56504. n.DodecahedronGeometry = function(e, t) {
  56505. var i = (1 + Math.sqrt(5)) / 2
  56506. , r = 1 / i
  56507. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  56508. , a = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 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, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];
  56509. n.PolyhedronGeometry.call(this, o, a, e, t),
  56510. this.type = "DodecahedronGeometry",
  56511. this.parameters = {
  56512. radius: e,
  56513. detail: t
  56514. }
  56515. }
  56516. ,
  56517. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56518. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  56519. n.IcosahedronGeometry = function(e, t) {
  56520. var i = (1 + Math.sqrt(5)) / 2
  56521. , r = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1]
  56522. , o = [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, 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, 10, 8, 6, 7, 9, 8, 1];
  56523. n.PolyhedronGeometry.call(this, r, o, e, t),
  56524. this.type = "IcosahedronGeometry",
  56525. this.parameters = {
  56526. radius: e,
  56527. detail: t
  56528. }
  56529. }
  56530. ,
  56531. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56532. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  56533. n.OctahedronGeometry = function(e, t) {
  56534. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  56535. , 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];
  56536. n.PolyhedronGeometry.call(this, i, r, e, t),
  56537. this.type = "OctahedronGeometry",
  56538. this.parameters = {
  56539. radius: e,
  56540. detail: t
  56541. }
  56542. }
  56543. ,
  56544. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56545. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  56546. n.TetrahedronGeometry = function(e, t) {
  56547. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  56548. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  56549. n.PolyhedronGeometry.call(this, i, r, e, t),
  56550. this.type = "TetrahedronGeometry",
  56551. this.parameters = {
  56552. radius: e,
  56553. detail: t
  56554. }
  56555. }
  56556. ,
  56557. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  56558. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  56559. n.ParametricGeometry = function(e, t, i) {
  56560. n.Geometry.call(this),
  56561. this.type = "ParametricGeometry",
  56562. this.parameters = {
  56563. func: e,
  56564. slices: t,
  56565. stacks: i
  56566. };
  56567. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  56568. for (r = 0; r <= i; r++)
  56569. for (l = r / i,
  56570. o = 0; o <= t; o++)
  56571. s = o / t,
  56572. a = e(s, l),
  56573. c.push(a);
  56574. var p, f, g, m, v, A, y, C;
  56575. for (r = 0; r < i; r++)
  56576. for (o = 0; o < t; o++)
  56577. p = r * d + o,
  56578. f = r * d + o + 1,
  56579. g = (r + 1) * d + o + 1,
  56580. m = (r + 1) * d + o,
  56581. v = new n.Vector2(o / t,r / i),
  56582. A = new n.Vector2((o + 1) / t,r / i),
  56583. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  56584. C = new n.Vector2(o / t,(r + 1) / i),
  56585. h.push(new n.Face3(p,f,m)),
  56586. u.push([v, A, C]),
  56587. h.push(new n.Face3(f,g,m)),
  56588. u.push([A.clone(), y, C.clone()]);
  56589. this.computeFaceNormals(),
  56590. this.computeVertexNormals()
  56591. }
  56592. ,
  56593. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  56594. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  56595. n.WireframeGeometry = function(e) {
  56596. function t(e, t) {
  56597. return e - t
  56598. }
  56599. n.BufferGeometry.call(this);
  56600. var i = [0, 0]
  56601. , r = {}
  56602. , o = ["a", "b", "c"];
  56603. if (e instanceof n.Geometry) {
  56604. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  56605. for (var d = s[h], p = 0; p < 3; p++) {
  56606. i[0] = d[o[p]],
  56607. i[1] = d[o[(p + 1) % 3]],
  56608. i.sort(t);
  56609. var f = i.toString();
  56610. void 0 === r[f] && (c[2 * l] = i[0],
  56611. c[2 * l + 1] = i[1],
  56612. r[f] = !0,
  56613. l++)
  56614. }
  56615. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56616. for (var p = 0; p < 2; p++) {
  56617. var m = a[c[2 * h + p]]
  56618. , v = 6 * h + 3 * p;
  56619. g[v + 0] = m.x,
  56620. g[v + 1] = m.y,
  56621. g[v + 2] = m.z
  56622. }
  56623. this.addAttribute("position", new n.BufferAttribute(g,3))
  56624. } else if (e instanceof n.BufferGeometry)
  56625. if (null !== e.index) {
  56626. var A = e.index.array
  56627. , a = e.attributes.position
  56628. , y = e.groups
  56629. , l = 0;
  56630. 0 === y.length && e.addGroup(0, A.length);
  56631. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  56632. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  56633. for (var p = 0; p < 3; p++) {
  56634. i[0] = A[h + p],
  56635. i[1] = A[h + (p + 1) % 3],
  56636. i.sort(t);
  56637. var f = i.toString();
  56638. void 0 === r[f] && (c[2 * l] = i[0],
  56639. c[2 * l + 1] = i[1],
  56640. r[f] = !0,
  56641. l++)
  56642. }
  56643. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  56644. for (var p = 0; p < 2; p++) {
  56645. var v = 6 * h + 3 * p
  56646. , T = c[2 * h + p];
  56647. g[v + 0] = a.getX(T),
  56648. g[v + 1] = a.getY(T),
  56649. g[v + 2] = a.getZ(T)
  56650. }
  56651. this.addAttribute("position", new n.BufferAttribute(g,3))
  56652. } else {
  56653. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  56654. for (var p = 0; p < 3; p++) {
  56655. var v = 18 * h + 6 * p
  56656. , S = 9 * h + 3 * p;
  56657. g[v + 0] = a[S],
  56658. g[v + 1] = a[S + 1],
  56659. g[v + 2] = a[S + 2];
  56660. var T = 9 * h + 3 * ((p + 1) % 3);
  56661. g[v + 3] = a[T],
  56662. g[v + 4] = a[T + 1],
  56663. g[v + 5] = a[T + 2]
  56664. }
  56665. this.addAttribute("position", new n.BufferAttribute(g,3))
  56666. }
  56667. }
  56668. ,
  56669. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56670. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  56671. n.AxisHelper = function(e) {
  56672. e = e || 1;
  56673. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  56674. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  56675. , r = new n.BufferGeometry;
  56676. r.addAttribute("position", new n.BufferAttribute(t,3)),
  56677. r.addAttribute("color", new n.BufferAttribute(i,3));
  56678. var o = new n.LineBasicMaterial({
  56679. vertexColors: n.VertexColors
  56680. });
  56681. n.LineSegments.call(this, r, o)
  56682. }
  56683. ,
  56684. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  56685. n.AxisHelper.prototype.constructor = n.AxisHelper,
  56686. n.ArrowHelper = function() {
  56687. var e = new n.Geometry;
  56688. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  56689. var t = new n.CylinderGeometry(0,.5,1,5,1);
  56690. return t.translate(0, -.5, 0),
  56691. function(i, r, o, a, s, l) {
  56692. n.Object3D.call(this),
  56693. void 0 === a && (a = 16776960),
  56694. void 0 === o && (o = 1),
  56695. void 0 === s && (s = .2 * o),
  56696. void 0 === l && (l = .2 * s),
  56697. this.position.copy(r),
  56698. this.line = new n.Line(e,new n.LineBasicMaterial({
  56699. color: a
  56700. })),
  56701. this.line.matrixAutoUpdate = !1,
  56702. this.add(this.line),
  56703. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  56704. color: a
  56705. })),
  56706. this.cone.matrixAutoUpdate = !1,
  56707. this.add(this.cone),
  56708. this.setDirection(i),
  56709. this.setLength(o, s, l)
  56710. }
  56711. }(),
  56712. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  56713. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  56714. n.ArrowHelper.prototype.setDirection = function() {
  56715. var e, t = new n.Vector3;
  56716. return function(i) {
  56717. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  56718. e = Math.acos(i.y),
  56719. this.quaternion.setFromAxisAngle(t, e))
  56720. }
  56721. }(),
  56722. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  56723. void 0 === t && (t = .2 * e),
  56724. void 0 === i && (i = .2 * t),
  56725. this.line.scale.set(1, Math.max(0, e - t), 1),
  56726. this.line.updateMatrix(),
  56727. this.cone.scale.set(i, t, i),
  56728. this.cone.position.y = e,
  56729. this.cone.updateMatrix()
  56730. }
  56731. ,
  56732. n.ArrowHelper.prototype.setColor = function(e) {
  56733. this.line.material.color.set(e),
  56734. this.cone.material.color.set(e)
  56735. }
  56736. ,
  56737. n.BoxHelper = function(e) {
  56738. var t = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7])
  56739. , i = new Float32Array(24)
  56740. , r = new n.BufferGeometry;
  56741. r.setIndex(new n.BufferAttribute(t,1)),
  56742. r.addAttribute("position", new n.BufferAttribute(i,3)),
  56743. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  56744. color: 16776960
  56745. })),
  56746. void 0 !== e && this.update(e)
  56747. }
  56748. ,
  56749. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  56750. n.BoxHelper.prototype.constructor = n.BoxHelper,
  56751. n.BoxHelper.prototype.update = function() {
  56752. var e = new n.Box3;
  56753. return function(t) {
  56754. if (e.setFromObject(t),
  56755. !e.isEmpty()) {
  56756. var i = e.min
  56757. , n = e.max
  56758. , r = this.geometry.attributes.position
  56759. , o = r.array;
  56760. o[0] = n.x,
  56761. o[1] = n.y,
  56762. o[2] = n.z,
  56763. o[3] = i.x,
  56764. o[4] = n.y,
  56765. o[5] = n.z,
  56766. o[6] = i.x,
  56767. o[7] = i.y,
  56768. o[8] = n.z,
  56769. o[9] = n.x,
  56770. o[10] = i.y,
  56771. o[11] = n.z,
  56772. o[12] = n.x,
  56773. o[13] = n.y,
  56774. o[14] = i.z,
  56775. o[15] = i.x,
  56776. o[16] = n.y,
  56777. o[17] = i.z,
  56778. o[18] = i.x,
  56779. o[19] = i.y,
  56780. o[20] = i.z,
  56781. o[21] = n.x,
  56782. o[22] = i.y,
  56783. o[23] = i.z,
  56784. r.needsUpdate = !0,
  56785. this.geometry.computeBoundingSphere()
  56786. }
  56787. }
  56788. }(),
  56789. n.BoundingBoxHelper = function(e, t) {
  56790. var i = void 0 !== t ? t : 8947848;
  56791. this.object = e,
  56792. this.box = new n.Box3,
  56793. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  56794. color: i,
  56795. wireframe: !0
  56796. }))
  56797. }
  56798. ,
  56799. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  56800. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  56801. n.BoundingBoxHelper.prototype.update = function() {
  56802. this.box.setFromObject(this.object),
  56803. this.box.size(this.scale),
  56804. this.box.center(this.position)
  56805. }
  56806. ,
  56807. n.CameraHelper = function(e) {
  56808. function t(e, t, n) {
  56809. i(e, n),
  56810. i(t, n)
  56811. }
  56812. function i(e, t) {
  56813. r.vertices.push(new n.Vector3),
  56814. r.colors.push(new n.Color(t)),
  56815. void 0 === a[e] && (a[e] = []),
  56816. a[e].push(r.vertices.length - 1)
  56817. }
  56818. var r = new n.Geometry
  56819. , o = new n.LineBasicMaterial({
  56820. color: 16777215,
  56821. vertexColors: n.FaceColors
  56822. })
  56823. , a = {}
  56824. , s = 16755200
  56825. , l = 16711680
  56826. , c = 43775
  56827. , h = 16777215
  56828. , u = 3355443;
  56829. t("n1", "n2", s),
  56830. t("n2", "n4", s),
  56831. t("n4", "n3", s),
  56832. t("n3", "n1", s),
  56833. t("f1", "f2", s),
  56834. t("f2", "f4", s),
  56835. t("f4", "f3", s),
  56836. t("f3", "f1", s),
  56837. t("n1", "f1", s),
  56838. t("n2", "f2", s),
  56839. t("n3", "f3", s),
  56840. t("n4", "f4", s),
  56841. t("p", "n1", l),
  56842. t("p", "n2", l),
  56843. t("p", "n3", l),
  56844. t("p", "n4", l),
  56845. t("u1", "u2", c),
  56846. t("u2", "u3", c),
  56847. t("u3", "u1", c),
  56848. t("c", "t", h),
  56849. t("p", "c", u),
  56850. t("cn1", "cn2", u),
  56851. t("cn3", "cn4", u),
  56852. t("cf1", "cf2", u),
  56853. t("cf3", "cf4", u),
  56854. n.LineSegments.call(this, r, o),
  56855. this.camera = e,
  56856. this.camera.updateProjectionMatrix(),
  56857. this.matrix = e.matrixWorld,
  56858. this.matrixAutoUpdate = !1,
  56859. this.pointMap = a,
  56860. this.update()
  56861. }
  56862. ,
  56863. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  56864. n.CameraHelper.prototype.constructor = n.CameraHelper,
  56865. n.CameraHelper.prototype.update = function() {
  56866. function e(e, n, a, s) {
  56867. r.set(n, a, s).unproject(o);
  56868. var l = i[e];
  56869. if (void 0 !== l)
  56870. for (var c = 0, h = l.length; c < h; c++)
  56871. t.vertices[l[c]].copy(r)
  56872. }
  56873. var t, i, r = new n.Vector3, o = new n.Camera;
  56874. return function() {
  56875. t = this.geometry,
  56876. i = this.pointMap;
  56877. var n = 1
  56878. , r = 1;
  56879. o.projectionMatrix.copy(this.camera.projectionMatrix),
  56880. e("c", 0, 0, -1),
  56881. e("t", 0, 0, 1),
  56882. e("n1", -n, -r, -1),
  56883. e("n2", n, -r, -1),
  56884. e("n3", -n, r, -1),
  56885. e("n4", n, r, -1),
  56886. e("f1", -n, -r, 1),
  56887. e("f2", n, -r, 1),
  56888. e("f3", -n, r, 1),
  56889. e("f4", n, r, 1),
  56890. e("u1", .7 * n, 1.1 * r, -1),
  56891. e("u2", .7 * -n, 1.1 * r, -1),
  56892. e("u3", 0, 2 * r, -1),
  56893. e("cf1", -n, 0, 1),
  56894. e("cf2", n, 0, 1),
  56895. e("cf3", 0, -r, 1),
  56896. e("cf4", 0, r, 1),
  56897. e("cn1", -n, 0, -1),
  56898. e("cn2", n, 0, -1),
  56899. e("cn3", 0, -r, -1),
  56900. e("cn4", 0, r, -1),
  56901. t.verticesNeedUpdate = !0
  56902. }
  56903. }(),
  56904. n.DirectionalLightHelper = function(e, t) {
  56905. n.Object3D.call(this),
  56906. this.light = e,
  56907. this.light.updateMatrixWorld(),
  56908. this.matrix = e.matrixWorld,
  56909. this.matrixAutoUpdate = !1,
  56910. t = t || 1;
  56911. var i = new n.Geometry;
  56912. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  56913. var r = new n.LineBasicMaterial({
  56914. fog: !1
  56915. });
  56916. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56917. this.lightPlane = new n.Line(i,r),
  56918. this.add(this.lightPlane),
  56919. i = new n.Geometry,
  56920. i.vertices.push(new n.Vector3, new n.Vector3),
  56921. r = new n.LineBasicMaterial({
  56922. fog: !1
  56923. }),
  56924. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56925. this.targetLine = new n.Line(i,r),
  56926. this.add(this.targetLine),
  56927. this.update()
  56928. }
  56929. ,
  56930. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  56931. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  56932. n.DirectionalLightHelper.prototype.dispose = function() {
  56933. this.lightPlane.geometry.dispose(),
  56934. this.lightPlane.material.dispose(),
  56935. this.targetLine.geometry.dispose(),
  56936. this.targetLine.material.dispose()
  56937. }
  56938. ,
  56939. n.DirectionalLightHelper.prototype.update = function() {
  56940. var e = new n.Vector3
  56941. , t = new n.Vector3
  56942. , i = new n.Vector3;
  56943. return function() {
  56944. e.setFromMatrixPosition(this.light.matrixWorld),
  56945. t.setFromMatrixPosition(this.light.target.matrixWorld),
  56946. i.subVectors(t, e),
  56947. this.lightPlane.lookAt(i),
  56948. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  56949. this.targetLine.geometry.vertices[1].copy(i),
  56950. this.targetLine.geometry.verticesNeedUpdate = !0,
  56951. this.targetLine.material.color.copy(this.lightPlane.material.color)
  56952. }
  56953. }(),
  56954. n.EdgesHelper = function(e, t, i) {
  56955. var r = void 0 !== t ? t : 16777215;
  56956. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  56957. color: r
  56958. })),
  56959. this.matrix = e.matrixWorld,
  56960. this.matrixAutoUpdate = !1
  56961. }
  56962. ,
  56963. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  56964. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  56965. n.FaceNormalsHelper = function(e, t, i, r) {
  56966. this.object = e,
  56967. this.size = void 0 !== t ? t : 1;
  56968. var o = void 0 !== i ? i : 16776960
  56969. , a = void 0 !== r ? r : 1
  56970. , s = 0
  56971. , l = this.object.geometry;
  56972. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  56973. var c = new n.BufferGeometry
  56974. , h = new n.Float32Attribute(2 * s * 3,3);
  56975. c.addAttribute("position", h),
  56976. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  56977. color: o,
  56978. linewidth: a
  56979. })),
  56980. this.matrixAutoUpdate = !1,
  56981. this.update()
  56982. }
  56983. ,
  56984. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  56985. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  56986. n.FaceNormalsHelper.prototype.update = function() {
  56987. var e = new n.Vector3
  56988. , t = new n.Vector3
  56989. , i = new n.Matrix3;
  56990. return function() {
  56991. this.object.updateMatrixWorld(!0),
  56992. i.getNormalMatrix(this.object.matrixWorld);
  56993. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  56994. var u = s[c]
  56995. , d = u.normal;
  56996. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  56997. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  56998. r.setXYZ(l, e.x, e.y, e.z),
  56999. l += 1,
  57000. r.setXYZ(l, t.x, t.y, t.z),
  57001. l += 1
  57002. }
  57003. return r.needsUpdate = !0,
  57004. this
  57005. }
  57006. }(),
  57007. n.GridHelper = function(e, t) {
  57008. var i = new n.Geometry
  57009. , r = new n.LineBasicMaterial({
  57010. vertexColors: n.VertexColors
  57011. });
  57012. this.color1 = new n.Color(4473924),
  57013. this.color2 = new n.Color(8947848);
  57014. for (var o = -e; o <= e; o += t) {
  57015. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  57016. var a = 0 === o ? this.color1 : this.color2;
  57017. i.colors.push(a, a, a, a)
  57018. }
  57019. n.LineSegments.call(this, i, r)
  57020. }
  57021. ,
  57022. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57023. n.GridHelper.prototype.constructor = n.GridHelper,
  57024. n.GridHelper.prototype.setColors = function(e, t) {
  57025. this.color1.set(e),
  57026. this.color2.set(t),
  57027. this.geometry.colorsNeedUpdate = !0
  57028. }
  57029. ,
  57030. n.HemisphereLightHelper = function(e, t) {
  57031. n.Object3D.call(this),
  57032. this.light = e,
  57033. this.light.updateMatrixWorld(),
  57034. this.matrix = e.matrixWorld,
  57035. this.matrixAutoUpdate = !1,
  57036. this.colors = [new n.Color, new n.Color];
  57037. var i = new n.SphereGeometry(t,4,2);
  57038. i.rotateX(-Math.PI / 2);
  57039. for (var r = 0, o = 8; r < o; r++)
  57040. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57041. var a = new n.MeshBasicMaterial({
  57042. vertexColors: n.FaceColors,
  57043. wireframe: !0
  57044. });
  57045. this.lightSphere = new n.Mesh(i,a),
  57046. this.add(this.lightSphere),
  57047. this.update()
  57048. }
  57049. ,
  57050. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57051. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57052. n.HemisphereLightHelper.prototype.dispose = function() {
  57053. this.lightSphere.geometry.dispose(),
  57054. this.lightSphere.material.dispose()
  57055. }
  57056. ,
  57057. n.HemisphereLightHelper.prototype.update = function() {
  57058. var e = new n.Vector3;
  57059. return function() {
  57060. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57061. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57062. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57063. this.lightSphere.geometry.colorsNeedUpdate = !0
  57064. }
  57065. }(),
  57066. n.PointLightHelper = function(e, t) {
  57067. this.light = e,
  57068. this.light.updateMatrixWorld();
  57069. var i = new n.SphereGeometry(t,4,2)
  57070. , r = new n.MeshBasicMaterial({
  57071. wireframe: !0,
  57072. fog: !1
  57073. });
  57074. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57075. n.Mesh.call(this, i, r),
  57076. this.matrix = this.light.matrixWorld,
  57077. this.matrixAutoUpdate = !1
  57078. }
  57079. ,
  57080. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57081. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57082. n.PointLightHelper.prototype.dispose = function() {
  57083. this.geometry.dispose(),
  57084. this.material.dispose()
  57085. }
  57086. ,
  57087. n.PointLightHelper.prototype.update = function() {
  57088. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57089. }
  57090. ,
  57091. n.SkeletonHelper = function(e) {
  57092. this.bones = this.getBoneList(e);
  57093. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57094. var r = this.bones[i];
  57095. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57096. t.vertices.push(new n.Vector3),
  57097. t.colors.push(new n.Color(0,0,1)),
  57098. t.colors.push(new n.Color(0,1,0)))
  57099. }
  57100. t.dynamic = !0;
  57101. var o = new n.LineBasicMaterial({
  57102. vertexColors: n.VertexColors,
  57103. depthTest: !1,
  57104. depthWrite: !1,
  57105. transparent: !0
  57106. });
  57107. n.LineSegments.call(this, t, o),
  57108. this.root = e,
  57109. this.matrix = e.matrixWorld,
  57110. this.matrixAutoUpdate = !1,
  57111. this.update()
  57112. }
  57113. ,
  57114. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57115. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57116. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57117. var t = [];
  57118. e instanceof n.Bone && t.push(e);
  57119. for (var i = 0; i < e.children.length; i++)
  57120. t.push.apply(t, this.getBoneList(e.children[i]));
  57121. return t
  57122. }
  57123. ,
  57124. n.SkeletonHelper.prototype.update = function() {
  57125. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  57126. var a = this.bones[o];
  57127. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57128. e.vertices[r].setFromMatrixPosition(i),
  57129. i.multiplyMatrices(t, a.parent.matrixWorld),
  57130. e.vertices[r + 1].setFromMatrixPosition(i),
  57131. r += 2)
  57132. }
  57133. e.verticesNeedUpdate = !0,
  57134. e.computeBoundingSphere()
  57135. }
  57136. ,
  57137. n.SpotLightHelper = function(e) {
  57138. n.Object3D.call(this),
  57139. this.light = e,
  57140. this.light.updateMatrixWorld(),
  57141. this.matrix = e.matrixWorld,
  57142. this.matrixAutoUpdate = !1;
  57143. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57144. t.translate(0, -.5, 0),
  57145. t.rotateX(-Math.PI / 2);
  57146. var i = new n.MeshBasicMaterial({
  57147. wireframe: !0,
  57148. fog: !1
  57149. });
  57150. this.cone = new n.Mesh(t,i),
  57151. this.add(this.cone),
  57152. this.update()
  57153. }
  57154. ,
  57155. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57156. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57157. n.SpotLightHelper.prototype.dispose = function() {
  57158. this.cone.geometry.dispose(),
  57159. this.cone.material.dispose()
  57160. }
  57161. ,
  57162. n.SpotLightHelper.prototype.update = function() {
  57163. var e = new n.Vector3
  57164. , t = new n.Vector3;
  57165. return function() {
  57166. var i = this.light.distance ? this.light.distance : 1e4
  57167. , n = i * Math.tan(this.light.angle);
  57168. this.cone.scale.set(n, n, i),
  57169. e.setFromMatrixPosition(this.light.matrixWorld),
  57170. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57171. this.cone.lookAt(t.sub(e)),
  57172. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57173. }
  57174. }(),
  57175. n.VertexNormalsHelper = function(e, t, i, r) {
  57176. this.object = e,
  57177. this.size = void 0 !== t ? t : 1;
  57178. var o = void 0 !== i ? i : 16711680
  57179. , a = void 0 !== r ? r : 1
  57180. , s = 0
  57181. , l = this.object.geometry;
  57182. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  57183. var c = new n.BufferGeometry
  57184. , h = new n.Float32Attribute(2 * s * 3,3);
  57185. c.addAttribute("position", h),
  57186. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57187. color: o,
  57188. linewidth: a
  57189. })),
  57190. this.matrixAutoUpdate = !1,
  57191. this.update()
  57192. }
  57193. ,
  57194. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57195. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  57196. n.VertexNormalsHelper.prototype.update = function() {
  57197. var e = new n.Vector3
  57198. , t = new n.Vector3
  57199. , i = new n.Matrix3;
  57200. return function() {
  57201. var r = ["a", "b", "c"];
  57202. this.object.updateMatrixWorld(!0),
  57203. i.getNormalMatrix(this.object.matrixWorld);
  57204. var o = this.object.matrixWorld
  57205. , a = this.geometry.attributes.position
  57206. , s = this.object.geometry;
  57207. if (s instanceof n.Geometry)
  57208. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  57209. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  57210. var m = l[p[r[f]]]
  57211. , v = p.vertexNormals[f];
  57212. e.copy(m).applyMatrix4(o),
  57213. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57214. a.setXYZ(h, e.x, e.y, e.z),
  57215. h += 1,
  57216. a.setXYZ(h, t.x, t.y, t.z),
  57217. h += 1
  57218. }
  57219. else if (s instanceof n.BufferGeometry)
  57220. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  57221. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  57222. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  57223. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57224. a.setXYZ(h, e.x, e.y, e.z),
  57225. h += 1,
  57226. a.setXYZ(h, t.x, t.y, t.z),
  57227. h += 1;
  57228. return a.needsUpdate = !0,
  57229. this
  57230. }
  57231. }(),
  57232. n.WireframeHelper = function(e, t) {
  57233. var i = void 0 !== t ? t : 16777215;
  57234. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  57235. color: i
  57236. })),
  57237. this.matrix = e.matrixWorld,
  57238. this.matrixAutoUpdate = !1
  57239. }
  57240. ,
  57241. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  57242. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  57243. n.ImmediateRenderObject = function(e) {
  57244. n.Object3D.call(this),
  57245. this.material = e,
  57246. this.render = function(e) {}
  57247. }
  57248. ,
  57249. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  57250. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  57251. n.MorphBlendMesh = function(e, t) {
  57252. n.Mesh.call(this, e, t),
  57253. this.animationsMap = {},
  57254. this.animationsList = [];
  57255. var i = this.geometry.morphTargets.length
  57256. , r = "__default"
  57257. , o = 0
  57258. , a = i - 1
  57259. , s = i / 1;
  57260. this.createAnimation(r, o, a, s),
  57261. this.setAnimationWeight(r, 1)
  57262. }
  57263. ,
  57264. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  57265. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  57266. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  57267. var r = {
  57268. start: t,
  57269. end: i,
  57270. length: i - t + 1,
  57271. fps: n,
  57272. duration: (i - t) / n,
  57273. lastFrame: 0,
  57274. currentFrame: 0,
  57275. active: !1,
  57276. time: 0,
  57277. direction: 1,
  57278. weight: 1,
  57279. directionBackwards: !1,
  57280. mirroredLoop: !1
  57281. };
  57282. this.animationsMap[e] = r,
  57283. this.animationsList.push(r)
  57284. }
  57285. ,
  57286. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  57287. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  57288. var s = r.morphTargets[o]
  57289. , l = s.name.match(i);
  57290. if (l && l.length > 1) {
  57291. var c = l[1];
  57292. n[c] || (n[c] = {
  57293. start: 1 / 0,
  57294. end: -(1 / 0)
  57295. });
  57296. var h = n[c];
  57297. o < h.start && (h.start = o),
  57298. o > h.end && (h.end = o),
  57299. t || (t = c)
  57300. }
  57301. }
  57302. for (var c in n) {
  57303. var h = n[c];
  57304. this.createAnimation(c, h.start, h.end, e)
  57305. }
  57306. this.firstAnimation = t
  57307. }
  57308. ,
  57309. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  57310. var t = this.animationsMap[e];
  57311. t && (t.direction = 1,
  57312. t.directionBackwards = !1)
  57313. }
  57314. ,
  57315. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  57316. var t = this.animationsMap[e];
  57317. t && (t.direction = -1,
  57318. t.directionBackwards = !0)
  57319. }
  57320. ,
  57321. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  57322. var i = this.animationsMap[e];
  57323. i && (i.fps = t,
  57324. i.duration = (i.end - i.start) / i.fps)
  57325. }
  57326. ,
  57327. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  57328. var i = this.animationsMap[e];
  57329. i && (i.duration = t,
  57330. i.fps = (i.end - i.start) / i.duration)
  57331. }
  57332. ,
  57333. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  57334. var i = this.animationsMap[e];
  57335. i && (i.weight = t)
  57336. }
  57337. ,
  57338. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  57339. var i = this.animationsMap[e];
  57340. i && (i.time = t)
  57341. }
  57342. ,
  57343. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  57344. var t = 0
  57345. , i = this.animationsMap[e];
  57346. return i && (t = i.time),
  57347. t
  57348. }
  57349. ,
  57350. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  57351. var t = -1
  57352. , i = this.animationsMap[e];
  57353. return i && (t = i.duration),
  57354. t
  57355. }
  57356. ,
  57357. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  57358. var t = this.animationsMap[e];
  57359. t ? (t.time = 0,
  57360. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  57361. }
  57362. ,
  57363. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  57364. var t = this.animationsMap[e];
  57365. t && (t.active = !1)
  57366. }
  57367. ,
  57368. n.MorphBlendMesh.prototype.update = function(e) {
  57369. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  57370. var r = this.animationsList[t];
  57371. if (r.active) {
  57372. var o = r.duration / r.length;
  57373. r.time += r.direction * e,
  57374. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  57375. r.time > r.duration && (r.time = r.duration,
  57376. r.directionBackwards = !0),
  57377. r.time < 0 && (r.time = 0,
  57378. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  57379. r.time < 0 && (r.time += r.duration));
  57380. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  57381. , s = r.weight;
  57382. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  57383. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  57384. this.morphTargetInfluences[a] = 0,
  57385. r.lastFrame = r.currentFrame,
  57386. r.currentFrame = a);
  57387. var l = r.time % o / o;
  57388. r.directionBackwards && (l = 1 - l),
  57389. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  57390. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  57391. }
  57392. }
  57393. }
  57394. ,
  57395. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  57396. i.THREE = n) : this.THREE = n
  57397. window.THREE = n
  57398. getObjLoader()
  57399. }
  57400. , {}]
  57401. }, {}, [116]);
  57402. function initTransitionPass(THREE){
  57403. THREE.TransitionPass = function ( scene, camera ) {
  57404. this.renderScene = scene;
  57405. this.renderCamera = camera;
  57406. this.coverRenderTarget = new THREE.WebGLRenderTarget( 100, 100, {
  57407. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  57408. format: THREE.RGBAFormat
  57409. });
  57410. this.coverTex = this.coverRenderTarget.texture;
  57411. this.enabled = false;
  57412. this.oldClearColor = new THREE.Color();
  57413. this.oldClearAlpha = 1;
  57414. this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
  57415. this.scene = new THREE.Scene();
  57416. this.material = this.getMaskMaterial()
  57417. var copyShader = THREE.CopyShader;
  57418. this.materialCopy = new THREE.ShaderMaterial( {
  57419. uniforms: this.copyUniforms,
  57420. vertexShader: copyShader.vertexShader,
  57421. fragmentShader: copyShader.fragmentShader,
  57422. blending: THREE.NoBlending,
  57423. depthTest: false,
  57424. depthWrite: false,
  57425. transparent: true
  57426. } );
  57427. this.quad = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), this.material);
  57428. this.quad.frustumCulled = false; // Avoid getting clipped
  57429. this.scene.add( this.quad );
  57430. }
  57431. THREE.TransitionPass.prototype = {//波形扩散,出下一个画面
  57432. constructor: THREE.TransitionPass,
  57433. setSize: function ( width, height ) {
  57434. this.coverRenderTarget.setSize( width, height );
  57435. },
  57436. render: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
  57437. var oldAutoClear = renderer.autoClear;
  57438. renderer.autoClear = false;
  57439. var uniforms = this.quad.material.uniforms
  57440. uniforms.bgTex.value = readBuffer.texture;
  57441. uniforms.coverTex.value = this.coverTex;
  57442. uniforms.progress.value = player.model.skybox.material.uniforms.progress.value//
  57443. uniforms.screenRatio.value = player.domElement.clientWidth / player.domElement.clientHeight;// 使波纹为圆形
  57444. uniforms.screenRatio.value *= uniforms.screenRatio.value
  57445. renderer.render( this.scene, this.camera);
  57446. renderer.autoClear = oldAutoClear;
  57447. },
  57448. start:function(sceneRenderer){
  57449. this.enabled = true
  57450. //draw coverTex
  57451. this.quad.material.uniforms.progress.value = 1;
  57452. sceneRenderer.renderer.render( sceneRenderer.scene, sceneRenderer.camera, this.coverRenderTarget, true );
  57453. },
  57454. stop:function(){
  57455. this.enabled = false
  57456. }
  57457. ,
  57458. getMaskMaterial :function(){
  57459. return new THREE.ShaderMaterial( {
  57460. uniforms: {
  57461. coverTex: {
  57462. type: "t",
  57463. value: null
  57464. },
  57465. bgTex: {
  57466. type: "t",
  57467. value: null
  57468. },
  57469. progress:{
  57470. type: "f",
  57471. value: 0
  57472. },
  57473. screenRatio:{
  57474. type: "f",
  57475. value: 1
  57476. }
  57477. },
  57478. vertexShader: `
  57479. varying vec2 vUv;
  57480. void main()
  57481. {
  57482. vUv = uv;
  57483. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  57484. }
  57485. `,
  57486. fragmentShader: `
  57487. uniform sampler2D coverTex;
  57488. uniform sampler2D bgTex;
  57489. uniform float progress;
  57490. uniform float screenRatio;
  57491. varying vec2 vUv;
  57492. void main() {
  57493. const float maxRadius = 0.708; // sqrt(0.5^2+0.5^2)
  57494. const float minRadius = 0.0 ;
  57495. float radius = screenRatio>1.0 ? sqrt((vUv.x - 0.5)*(vUv.x - 0.5) + (vUv.y - 0.5)*(vUv.y - 0.5)/screenRatio) : sqrt((vUv.x - 0.5)*(vUv.x - 0.5)*screenRatio+ (vUv.y - 0.5)*(vUv.y - 0.5));
  57496. float diff = 0.292; //1.0-maxRadius;
  57497. float radiusIn = maxRadius * progress + minRadius * (1.0-progress);
  57498. float radiusOut = radiusIn + diff;
  57499. if(radius < radiusIn) {
  57500. gl_FragColor = texture2D(bgTex, vUv);
  57501. //gl_FragColor = vec4(0.0,0.0,1.0,1.0);//
  57502. }else if(radius>radiusOut){
  57503. gl_FragColor = texture2D(coverTex, vUv) ;
  57504. //gl_FragColor = vec4(1.0,1.0,0.0,1.0);//
  57505. }else{
  57506. vec4 color1 = texture2D(bgTex, vUv);
  57507. vec4 color2 = texture2D(coverTex, vUv);
  57508. float rotio = smoothstep(radiusIn ,radiusOut,radius);
  57509. gl_FragColor = mix(color1, color2, rotio);
  57510. }
  57511. }
  57512. `
  57513. } );
  57514. },
  57515. }
  57516. }
  57517. /*
  57518. var addMagnifier = function(){
  57519. class Magnifier extends THREE.Object3D {
  57520. constructor () {
  57521. super()
  57522. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  57523. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  57524. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  57525. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  57526. format: THREE.RGBAFormat ,
  57527. //type: THREE.FloatType,
  57528. //minFilter: THREE.NearestFilter,
  57529. //magFilter: THREE.NearestFilter,
  57530. } )
  57531. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  57532. side: THREE.DoubleSide ,
  57533. map: this.renderTarget.texture ,
  57534. transparent:true,
  57535. depthTest: !1,
  57536. depthWrite: !1,
  57537. }))
  57538. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  57539. side: THREE.DoubleSide ,
  57540. map: Texture.load('static/images/crosshair.png') ,
  57541. transparent:true,
  57542. depthTest: !1,
  57543. depthWrite: !1,
  57544. }))
  57545. this.add(this.mesh)
  57546. this.add(this.overlayMesh)
  57547. player.model.add(this);
  57548. player.magnifier = this;
  57549. }
  57550. update(aimPos){
  57551. const magDistance_ = 0.3;
  57552. var playerPos = player.position
  57553. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  57554. this.camera.position.copy(aimPos.clone().add(vec))
  57555. this.camera.lookAt(aimPos)
  57556. var playerCamera = player.camera
  57557. this.quaternion.copy(playerCamera.quaternion);
  57558. var pos2d = player.mouse.clone();
  57559. var shift = 400;
  57560. var clientHeight = player.domElement.clientHeight
  57561. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  57562. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  57563. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  57564. this.position.copy(newPos)
  57565. var renderer = player.sceneRenderer.renderer
  57566. var oldAutoClear = renderer.autoClear
  57567. renderer.autoClear = false
  57568. //renderer.clear( true, true, true );
  57569. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  57570. renderer.autoClear = oldAutoClear
  57571. }
  57572. }
  57573. new Magnifier()
  57574. }
  57575. */
  57576. /*
  57577. 笔记:
  57578. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  57579. {
  57580. //到导览中某个点位(假设点位不重复)
  57581. var id = 73
  57582. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  57583. var i = player.model.heroLocations.indexOf(p)
  57584. var p1 = p.heroLocations.find(e=>e.panoId == id)
  57585. var j = p.heroLocations.indexOf(p1)
  57586. player.director.goToHighlight([i,j])
  57587. }
  57588. */